@medplum/app 3.2.16 → 3.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-CMlkeBKK.js +582 -0
- package/dist/assets/index-CMlkeBKK.js.map +1 -0
- package/dist/assets/index-cRTrvbk5.css +1 -0
- package/dist/index.html +3 -3
- package/package.json +17 -17
- package/dist/assets/index-CGpybjvv.css +0 -1
- package/dist/assets/index-DiO5UUQN.js +0 -583
- package/dist/assets/index-DiO5UUQN.js.map +0 -1
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
function BS(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 i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{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 i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var $0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ev(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var VS={exports:{}},Af={},HS={exports:{}},Ke={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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 Gc=Symbol.for("react.element"),r_=Symbol.for("react.portal"),o_=Symbol.for("react.fragment"),i_=Symbol.for("react.strict_mode"),s_=Symbol.for("react.profiler"),a_=Symbol.for("react.provider"),l_=Symbol.for("react.context"),c_=Symbol.for("react.forward_ref"),u_=Symbol.for("react.suspense"),d_=Symbol.for("react.memo"),f_=Symbol.for("react.lazy"),F0=Symbol.iterator;function h_(e){return e===null||typeof e!="object"?null:(e=F0&&e[F0]||e["@@iterator"],typeof e=="function"?e:null)}var WS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qS=Object.assign,GS={};function ll(e,t,n){this.props=e,this.context=t,this.refs=GS,this.updater=n||WS}ll.prototype.isReactComponent={};ll.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ll.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function QS(){}QS.prototype=ll.prototype;function tv(e,t,n){this.props=e,this.context=t,this.refs=GS,this.updater=n||WS}var nv=tv.prototype=new QS;nv.constructor=tv;qS(nv,ll.prototype);nv.isPureReactComponent=!0;var z0=Array.isArray,KS=Object.prototype.hasOwnProperty,rv={current:null},YS={key:!0,ref:!0,__self:!0,__source:!0};function XS(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)KS.call(t,r)&&!YS.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Gc,type:e,key:i,ref:a,props:o,_owner:rv.current}}function p_(e,t){return{$$typeof:Gc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ov(e){return typeof e=="object"&&e!==null&&e.$$typeof===Gc}function m_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var U0=/\/+/g;function ap(e,t){return typeof e=="object"&&e!==null&&e.key!=null?m_(""+e.key):t.toString(36)}function fd(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Gc:case r_:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+ap(a,0):r,z0(o)?(n="",e!=null&&(n=e.replace(U0,"$&/")+"/"),fd(o,t,n,"",function(u){return u})):o!=null&&(ov(o)&&(o=p_(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(U0,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",z0(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+ap(i,l);a+=fd(i,t,n,c,o)}else if(c=h_(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+ap(i,l++),a+=fd(i,t,n,c,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Iu(e,t,n){if(e==null)return e;var r=[],o=0;return fd(e,r,"","",function(i){return t.call(n,i,o++)}),r}function g_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Fn={current:null},hd={transition:null},v_={ReactCurrentDispatcher:Fn,ReactCurrentBatchConfig:hd,ReactCurrentOwner:rv};Ke.Children={map:Iu,forEach:function(e,t,n){Iu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Iu(e,function(){t++}),t},toArray:function(e){return Iu(e,function(t){return t})||[]},only:function(e){if(!ov(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ke.Component=ll;Ke.Fragment=o_;Ke.Profiler=s_;Ke.PureComponent=tv;Ke.StrictMode=i_;Ke.Suspense=u_;Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=v_;Ke.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=qS({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=rv.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)KS.call(t,c)&&!YS.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Gc,type:e.type,key:o,ref:i,props:r,_owner:a}};Ke.createContext=function(e){return e={$$typeof:l_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:a_,_context:e},e.Consumer=e};Ke.createElement=XS;Ke.createFactory=function(e){var t=XS.bind(null,e);return t.type=e,t};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(e){return{$$typeof:c_,render:e}};Ke.isValidElement=ov;Ke.lazy=function(e){return{$$typeof:f_,_payload:{_status:-1,_result:e},_init:g_}};Ke.memo=function(e,t){return{$$typeof:d_,type:e,compare:t===void 0?null:t}};Ke.startTransition=function(e){var t=hd.transition;hd.transition={};try{e()}finally{hd.transition=t}};Ke.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ke.useCallback=function(e,t){return Fn.current.useCallback(e,t)};Ke.useContext=function(e){return Fn.current.useContext(e)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(e){return Fn.current.useDeferredValue(e)};Ke.useEffect=function(e,t){return Fn.current.useEffect(e,t)};Ke.useId=function(){return Fn.current.useId()};Ke.useImperativeHandle=function(e,t,n){return Fn.current.useImperativeHandle(e,t,n)};Ke.useInsertionEffect=function(e,t){return Fn.current.useInsertionEffect(e,t)};Ke.useLayoutEffect=function(e,t){return Fn.current.useLayoutEffect(e,t)};Ke.useMemo=function(e,t){return Fn.current.useMemo(e,t)};Ke.useReducer=function(e,t,n){return Fn.current.useReducer(e,t,n)};Ke.useRef=function(e){return Fn.current.useRef(e)};Ke.useState=function(e){return Fn.current.useState(e)};Ke.useSyncExternalStore=function(e,t,n){return Fn.current.useSyncExternalStore(e,t,n)};Ke.useTransition=function(){return Fn.current.useTransition()};Ke.version="18.2.0";HS.exports=Ke;var p=HS.exports;const fn=ev(p),JS=BS({__proto__:null,default:fn},[p]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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 y_=p,x_=Symbol.for("react.element"),b_=Symbol.for("react.fragment"),w_=Object.prototype.hasOwnProperty,S_=y_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,j_={key:!0,ref:!0,__self:!0,__source:!0};function ZS(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)w_.call(t,r)&&!j_.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:x_,type:e,key:i,ref:a,props:o,_owner:S_.current}}Af.Fragment=b_;Af.jsx=ZS;Af.jsxs=ZS;VS.exports=Af;var s=VS.exports,co=function(){return co=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},co.apply(this,arguments)};function ej(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 C_(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var pd="right-scroll-bar-position",md="width-before-scroll-bar",E_="with-scroll-bars-hidden",T_="--removed-body-scroll-bar-size";function lp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function P_(e,t){var n=p.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 k_=typeof window<"u"?p.useLayoutEffect:p.useEffect,B0=new WeakMap;function R_(e,t){var n=P_(null,function(r){return e.forEach(function(o){return lp(o,r)})});return k_(function(){var r=B0.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(l){i.has(l)||lp(l,null)}),i.forEach(function(l){o.has(l)||lp(l,a)})}B0.set(n,e)},[e]),n}function __(e){return e}function D_(e,t){t===void 0&&(t=__);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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var c=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function I_(e){e===void 0&&(e={});var t=D_(null);return t.options=co({async:!0,ssr:!1},e),t}var tj=function(e){var t=e.sideCar,n=ej(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 p.createElement(r,co({},n))};tj.isSideCarExport=!0;function A_(e,t){return e.useMedium(t),tj}var nj=I_(),cp=function(){},Nf=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:cp,onWheelCapture:cp,onTouchMoveCapture:cp}),o=r[0],i=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,S=e.as,x=S===void 0?"div":S,w=e.gapMode,y=ej(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=h,C=R_([n,t]),j=co(co({},y),o);return p.createElement(p.Fragment,null,d&&p.createElement(b,{sideCar:nj,removeScrollBar:u,shards:f,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),a?p.cloneElement(p.Children.only(l),co(co({},j),{ref:C})):p.createElement(x,co({},j,{className:c,ref:C}),l))});Nf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Nf.classNames={fullWidth:md,zeroRight:pd};var N_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function M_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=N_();return t&&e.setAttribute("nonce",t),e}function O_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function L_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=M_())&&(O_(t,n),L_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},F_=function(){var e=$_();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},rj=function(){var e=F_(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},z_={left:0,top:0,right:0,gap:0},up=function(e){return parseInt(e||"",10)||0},U_=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[up(n),up(r),up(o)]},B_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return z_;var t=U_(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])}},V_=rj(),Na="data-scroll-locked",H_=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
+
.`.concat(E_,` {
|
|
19
|
+
overflow: hidden `).concat(r,`;
|
|
20
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
body[`).concat(Na,`] {
|
|
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(i,`px;
|
|
28
|
+
padding-right: `).concat(a,`px;
|
|
29
|
+
margin-left:0;
|
|
30
|
+
margin-top:0;
|
|
31
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
32
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(pd,` {
|
|
36
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(md,` {
|
|
40
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.`).concat(pd," .").concat(pd,` {
|
|
44
|
+
right: 0 `).concat(r,`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.`).concat(md," .").concat(md,` {
|
|
48
|
+
margin-right: 0 `).concat(r,`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body[`).concat(Na,`] {
|
|
52
|
+
`).concat(T_,": ").concat(l,`px;
|
|
53
|
+
}
|
|
54
|
+
`)},V0=function(){var e=parseInt(document.body.getAttribute(Na)||"0",10);return isFinite(e)?e:0},W_=function(){p.useEffect(function(){return document.body.setAttribute(Na,(V0()+1).toString()),function(){var e=V0()-1;e<=0?document.body.removeAttribute(Na):document.body.setAttribute(Na,e.toString())}},[])},q_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;W_();var i=p.useMemo(function(){return B_(o)},[o]);return p.createElement(V_,{styles:H_(i,!t,o,n?"":"!important")})},mm=!1;if(typeof window<"u")try{var Au=Object.defineProperty({},"passive",{get:function(){return mm=!0,!0}});window.addEventListener("test",Au,Au),window.removeEventListener("test",Au,Au)}catch{mm=!1}var sa=mm?{passive:!1}:!1,G_=function(e){return e.tagName==="TEXTAREA"},oj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!G_(e)&&n[t]==="visible")},Q_=function(e){return oj(e,"overflowY")},K_=function(e){return oj(e,"overflowX")},H0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ij(e,r);if(o){var i=sj(e,r),a=i[1],l=i[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Y_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},X_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ij=function(e,t){return e==="v"?Q_(t):K_(t)},sj=function(e,t){return e==="v"?Y_(t):X_(t)},J_=function(e,t){return e==="h"&&t==="rtl"?-1:1},Z_=function(e,t,n,r,o){var i=J_(e,window.getComputedStyle(t).direction),a=i*r,l=n.target,c=t.contains(l),u=!1,d=a>0,f=0,h=0;do{var m=sj(e,l),g=m[0],v=m[1],S=m[2],x=v-S-i*g;(g||x)&&ij(e,l)&&(f+=x,h+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!o)||!d&&(Math.abs(h)<1||!o))&&(u=!0),u},Nu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},W0=function(e){return[e.deltaX,e.deltaY]},q0=function(e){return e&&"current"in e?e.current:e},eD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tD=function(e){return`
|
|
55
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
+
`)},nD=0,aa=[];function rD(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(nD++)[0],i=p.useState(rj)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=C_([e.lockRef.current],(e.shards||[]).map(q0),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var x=Nu(v),w=n.current,y="deltaX"in v?v.deltaX:w[0]-x[0],b="deltaY"in v?v.deltaY:w[1]-x[1],C,j=v.target,T=Math.abs(y)>Math.abs(b)?"h":"v";if("touches"in v&&T==="h"&&j.type==="range")return!1;var E=H0(T,j);if(!E)return!0;if(E?C=T:(C=T==="v"?"h":"v",E=H0(T,j)),!E)return!1;if(!r.current&&"changedTouches"in v&&(y||b)&&(r.current=C),!C)return!0;var R=r.current||C;return Z_(R,S,v,R==="h"?y:b,!0)},[]),c=p.useCallback(function(v){var S=v;if(!(!aa.length||aa[aa.length-1]!==i)){var x="deltaY"in S?W0(S):Nu(S),w=t.current.filter(function(C){return C.name===S.type&&(C.target===S.target||S.target===C.shadowParent)&&eD(C.delta,x)})[0];if(w&&w.should){S.cancelable&&S.preventDefault();return}if(!w){var y=(a.current.shards||[]).map(q0).filter(Boolean).filter(function(C){return C.contains(S.target)}),b=y.length>0?l(S,y[0]):!a.current.noIsolation;b&&S.cancelable&&S.preventDefault()}}},[]),u=p.useCallback(function(v,S,x,w){var y={name:v,delta:S,target:x,should:w,shadowParent:oD(x)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(b){return b!==y})},1)},[]),d=p.useCallback(function(v){n.current=Nu(v),r.current=void 0},[]),f=p.useCallback(function(v){u(v.type,W0(v),v.target,l(v,e.lockRef.current))},[]),h=p.useCallback(function(v){u(v.type,Nu(v),v.target,l(v,e.lockRef.current))},[]);p.useEffect(function(){return aa.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,sa),document.addEventListener("touchmove",c,sa),document.addEventListener("touchstart",d,sa),function(){aa=aa.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,sa),document.removeEventListener("touchmove",c,sa),document.removeEventListener("touchstart",d,sa)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(i,{styles:tD(o)}):null,m?p.createElement(q_,{gapMode:e.gapMode}):null)}function oD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const iD=A_(nj,rD);var Mf=p.forwardRef(function(e,t){return p.createElement(Nf,co({},e,{ref:t,sideCar:iD}))});Mf.classNames=Nf.classNames;function bt(e){return Object.keys(e)}function dp(e){return e&&typeof e=="object"&&!Array.isArray(e)}function iv(e,t){const n={...e},r=t;return dp(e)&&dp(t)&&Object.keys(t).forEach(o=>{dp(r[o])&&o in e?n[o]=iv(n[o],r[o]):n[o]=r[o]}),n}function sD(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function aD(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function dc(e){const t=aD(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 fp(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function aj(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?fp(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(i=>n(i)).join(",");if(r.includes(" "))return r.split(" ").map(i=>n(i)).join(" ");if(r.includes(e))return t?fp(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?fp(i):i}}return r}return n}const B=aj("rem",{shouldScale:!0}),Id=aj("em");function Li(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function lj(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 qo(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==p.Fragment:!1}function zn(e){const t=p.createContext(null);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>{const o=p.useContext(t);if(o===null)throw new Error(e);return o}]}function Ns(e=null){const t=p.createContext(e);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>p.useContext(t)]}function G0(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Ad(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function lD(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 cD(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 uD(e,t,n){return Ad(e,n)===Ad(t,n)}function cj({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:a}){return l=>{var g;n==null||n(l);const c=Array.from(((g=Ad(l.currentTarget,e))==null?void 0:g.querySelectorAll(t))||[]).filter(v=>uD(l.currentTarget,v,e)),u=c.findIndex(v=>l.currentTarget===v),d=cD(u,c,r),f=lD(u,c,r),h=i==="rtl"?f:d,m=i==="rtl"?d:f;switch(l.key){case"ArrowRight":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[h].focus(),o&&c[h].click());break}case"ArrowLeft":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[m].focus(),o&&c[m].click());break}case"ArrowUp":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[f].focus(),o&&c[f].click());break}case"ArrowDown":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[d].focus(),o&&c[d].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!c[0].disabled&&c[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const v=c.length-1;!c[v].disabled&&c[v].focus();break}}}}const dD={app:100,modal:200,popover:300,overlay:400,max:9999};function Xr(e){return dD[e]}const fD=()=>{};function hD(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||fD:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function Ne(e,t="size",n=!0){if(e!==void 0)return lj(e)?n?B(e):e:`var(--${t}-${e})`}function Yt(e){return Ne(e,"mantine-spacing")}function dt(e){return e===void 0?"var(--mantine-radius-default)":Ne(e,"mantine-radius")}function hn(e){return Ne(e,"mantine-font-size")}function uj(e){return Ne(e,"mantine-line-height",!1)}function sv(e){if(e)return Ne(e,"mantine-shadow",!1)}function Gn(e,t){return n=>{e==null||e(n),t==null||t(n)}}function av(e,t){return e in t?dc(t[e]):dc(e)}function fc(e,t){const n=e.map(r=>({value:r,px:av(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Ur(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function pD(e,t,n){var r;return n?Array.from(((r=Ad(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function mD(){const[e,t]=p.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function Mu(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 lv(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function Q0(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function is(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Of(e,t){const n=is(e),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback((...o)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...o),t)},[n,t])}const K0=["mousedown","touchstart"];function gD(e,t,n){const r=p.useRef();return p.useEffect(()=>{const o=i=>{const{target:a}=i??{};if(Array.isArray(n)){const l=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else r.current&&!r.current.contains(a)&&e()};return(t||K0).forEach(i=>document.addEventListener(i,o)),()=>{(t||K0).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function dj({timeout:e=2e3}={}){const[t,n]=p.useState(null),[r,o]=p.useState(!1),[i,a]=p.useState(null),l=d=>{window.clearTimeout(i),a(window.setTimeout(()=>o(!1),e)),o(d)};return{copy:d=>{"clipboard"in navigator?navigator.clipboard.writeText(d).then(()=>l(!0)).catch(f=>n(f)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(i)},error:t,copied:r}}function vD(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function yD(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function fj(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=p.useState(n?t:yD(e)),i=p.useRef();return p.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),vD(i.current,a=>o(a.matches))},[e]),r}function xD(e,t){return fj("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const cl=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Mo(e,t){const n=p.useRef(!1);p.useEffect(()=>()=>{n.current=!1},[]),p.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function hj({opened:e,shouldReturnFocus:t=!0}){const n=p.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Mo(()=>{let o=-1;const i=a=>{a.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}function bD(e,t="body > :not(script)"){const n=lv(),r=Array.from(document.querySelectorAll(t)).map(o=>{var c;if((c=o==null?void 0:o.shadowRoot)!=null&&c.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),a=o.getAttribute("data-hidden"),l=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!a&&!l&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:a||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}const wD=/input|select|textarea|button|object/,pj="a, input, select, textarea, button, object, [tabindex]";function SD(e){return e.style.display==="none"}function jD(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(SD(n))return!1;n=n.parentNode}return!0}function mj(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function gm(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(mj(e));return(wD.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&jD(e)}function gj(e){const t=mj(e);return(Number.isNaN(t)||t>=0)&&gm(e)}function CD(e){return Array.from(e.querySelectorAll(pj)).filter(gj)}function ED(e,t){const n=CD(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let i=r===o.activeElement||e===o.activeElement;const a=o.activeElement;if(a.tagName==="INPUT"&&a.getAttribute("type")==="radio"&&(i=n.filter(d=>d.getAttribute("type")==="radio"&&d.getAttribute("name")===a.getAttribute("name")).includes(r)),!i)return;t.preventDefault();const c=n[t.shiftKey?n.length-1:0];c&&c.focus()}function TD(e=!0){const t=p.useRef(),n=p.useRef(null),r=i=>{let a=i.querySelector("[data-autofocus]");if(!a){const l=Array.from(i.querySelectorAll(pj));a=l.find(gj)||l.find(gm)||null,!a&&gm(i)&&(a=i)}a&&a.focus({preventScroll:!0})},o=p.useCallback(i=>{if(e){if(i===null){n.current&&(n.current(),n.current=null);return}n.current=bD(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&r(i)}),t.current=i):t.current=null)}},[e]);return p.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const i=a=>{a.key==="Tab"&&t.current&&ED(t.current,a)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const PD=e=>(e+1)%1e6;function kD(){const[,e]=p.useReducer(PD,0);return e}const RD=fn.useId||(()=>{});function _D(){const e=RD();return e?`mantine-${e.replace(/:/g,"")}`:""}function Un(e){const t=_D(),[n,r]=p.useState(t);return cl(()=>{r(lv())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function vj(e,t,n){p.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Lf(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function DD(...e){return t=>{e.forEach(n=>Lf(n,t))}}function tn(...e){return p.useCallback(DD(...e),e)}function bn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=p.useState(t!==void 0?t:n),a=(l,...c)=>{i(l),r==null||r(l,...c)};return e!==void 0?[e,r,!0]:[o,a,!1]}function ii(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Ou="dots";function ID({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:i}){const a=Math.max(Math.trunc(e),0),[l,c]=bn({value:r,onChange:i,defaultValue:o,finalValue:o}),u=v=>{v<=0?c(1):v>a?c(a):c(v)},d=()=>u(l+1),f=()=>u(l-1),h=()=>u(1),m=()=>u(a);return{range:p.useMemo(()=>{if(t*2+3+n*2>=a)return ii(1,a);const S=Math.max(l-t,n),x=Math.min(l+t,a-n),w=S>n+2,y=x<a-(n+1);if(!w&&y){const b=t*2+n+2;return[...ii(1,b),Ou,...ii(a-(n-1),a)]}if(w&&!y){const b=n+1+2*t;return[...ii(1,n),Ou,...ii(a-b,a)]}return[...ii(1,n),Ou,...ii(S,x),Ou,...ii(a-n+1,a)]},[a,t,l]),active:l,setPage:u,next:d,previous:f,first:h,last:m}}function cv(e,t){return fj("(prefers-reduced-motion: reduce)",e,t)}function $f(e=!1,t){const{onOpen:n,onClose:r}={},[o,i]=p.useState(e),a=p.useCallback(()=>{i(u=>u||(n==null||n(),!0))},[n]),l=p.useCallback(()=>{i(u=>u&&(r==null||r(),!1))},[r]),c=p.useCallback(()=>{o?l():a()},[l,a,o]);return[o,{open:a,close:l,toggle:c}]}function AD(e,t,n={autoInvoke:!1}){const r=p.useRef(null),o=p.useCallback((...a)=>{r.current||(r.current=window.setTimeout(()=>{e(a),r.current=null},t))},[t]),i=p.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return p.useEffect(()=>(n.autoInvoke&&o(),i),[i,o]),{start:o,clear:i}}function ND(e,t,n){const r=p.useRef(),o=p.useRef(null);return p.useEffect(()=>{const i=typeof n=="function"?n():n;return(i||o.current)&&(r.current=new MutationObserver(e),r.current.observe(i||o.current,t)),()=>{var a;(a=r.current)==null||a.disconnect()}},[e,t]),o}function MD(){const[e,t]=p.useState(!1);return p.useEffect(()=>t(!0),[]),e}var OD={};function yj(){return typeof process<"u"&&OD?"production":"development"}function xj(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=xj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=xj(e))&&(r&&(r+=" "),r+=t);return r}const LD={};function $D(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=rt(t[r],o):t[r]=o})}),t}function Ff({theme:e,classNames:t,props:n,stylesCtx:r}){const i=(Array.isArray(t)?t:[t]).map(a=>typeof a=="function"?a(e,n,r):a||LD);return $D(i)}function Nd({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((i,a)=>typeof a=="function"?{...i,...a(e,n,r)}:{...i,...a},{})}const uv=p.createContext(null);function $i(){const e=p.useContext(uv);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function FD(){return $i().cssVariablesResolver}function zD(){return $i().classNamesPrefix}function zf(){return $i().getStyleNonce}function UD(){return $i().withStaticClasses}function BD(){return $i().headless}function VD(){var e;return(e=$i().stylesTransform)==null?void 0:e.sx}function HD(){var e;return(e=$i().stylesTransform)==null?void 0:e.styles}function WD(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function qD(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}if(t.length===8){const a=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}}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n&255;return{r,g:o,b:i,a:1}}function GD(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o||1}}function QD(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,i=parseInt(n[3],10)/100,a=n[5]?parseFloat(n[5]):void 0,l=(1-Math.abs(2*i-1))*o,c=r/60,u=l*(1-Math.abs(c%2-1)),d=i-l/2;let f,h,m;return c>=0&&c<1?(f=l,h=u,m=0):c>=1&&c<2?(f=u,h=l,m=0):c>=2&&c<3?(f=0,h=l,m=u):c>=3&&c<4?(f=0,h=u,m=l):c>=4&&c<5?(f=u,h=0,m=l):(f=l,h=0,m=u),{r:Math.round((f+d)*255),g:Math.round((h+d)*255),b:Math.round((m+d)*255),a:a||1}}function dv(e){return WD(e)?qD(e):e.startsWith("rgb")?GD(e):e.startsWith("hsl")?QD(e):{r:0,g:0,b:0,a:1}}function Lu(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=dv(e),a=1-t,l=c=>Math.round(c*a);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function hc(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function hp(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function KD(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function YD(e){if(e.startsWith("oklch("))return(KD(e)||0)/100;const{r:t,g:n,b:r}=dv(e),o=t/255,i=n/255,a=r/255,l=hp(o),c=hp(i),u=hp(a);return .2126*l+.7152*c+.0722*u}function Il(e,t=.179){return e.startsWith("var(")?!1:YD(e)>t}function jr({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:Il(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:Il(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:Il(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),i=o?Number(o):void 0,a=r in t.colors;if(a){const l=i!==void 0?t.colors[r][i]:t.colors[r][hc(t,n||"light")];return{color:r,value:l,shade:i,isThemeColor:a,isLight:Il(l,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:Il(e,t.luminanceThreshold),shade:i,variable:void 0}}function ut(e,t){const n=jr({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function vm(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)||t.defaultGradient.deg||0},r=ut(n.from,t),o=ut(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function vr(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const i=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${i}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=dv(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const la=vr,XD=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=jr({color:e,theme:t}),a=typeof o=="boolean"?o:t.autoContrast;if(n==="filled"){const l=a&&i.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return i.isThemeColor?i.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:l,border:`${B(1)} solid transparent`}:{background:`var(--mantine-color-${i.color}-${i.shade})`,hover:`var(--mantine-color-${i.color}-${i.shade===9?8:i.shade+1})`,color:l,border:`${B(1)} solid transparent`}:{background:e,hover:Lu(e,.1),color:l,border:`${B(1)} solid transparent`}}if(n==="light"){if(i.isThemeColor){if(i.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:`${B(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:vr(l,.1),hover:vr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${B(1)} solid transparent`}}return{background:vr(e,.1),hover:vr(e,.12),color:e,border:`${B(1)} solid transparent`}}if(n==="outline")return i.isThemeColor?i.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${B(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:vr(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${B(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:vr(e,.05),color:e,border:`${B(1)} solid ${e}`};if(n==="subtle"){if(i.isThemeColor){if(i.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${B(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:"transparent",hover:vr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${B(1)} solid transparent`}}return{background:"transparent",hover:vr(e,.12),color:e,border:`${B(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${B(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${B(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${B(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:Lu(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${B(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Lu(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${B(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Lu(t.white,.01),color:e,border:`${B(1)} solid transparent`}:n==="gradient"?{background:vm(r,t),hover:vm(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:`${B(1)} solid var(--mantine-color-default-border)`}:{}},JD={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"]},Y0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fv={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:JD,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:XD,autoContrast:!1,luminanceThreshold:.3,fontFamily:Y0,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:Y0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:B(34),lineHeight:"1.3"},h2:{fontSize:B(26),lineHeight:"1.35"},h3:{fontSize:B(22),lineHeight:"1.4"},h4:{fontSize:B(18),lineHeight:"1.45"},h5:{fontSize:B(16),lineHeight:"1.5"},h6:{fontSize:B(14),lineHeight:"1.5"}}},fontSizes:{xs:B(12),sm:B(14),md:B(16),lg:B(18),xl:B(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:B(2),sm:B(4),md:B(8),lg:B(16),xl:B(32)},spacing:{xs:B(10),sm:B(12),md:B(16),lg:B(20),xl:B(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), 0 ${B(1)} ${B(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(10)} ${B(15)} ${B(-5)}, rgba(0, 0, 0, 0.04) 0 ${B(7)} ${B(7)} ${B(-5)}`,md:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(20)} ${B(25)} ${B(-5)}, rgba(0, 0, 0, 0.04) 0 ${B(10)} ${B(10)} ${B(-5)}`,lg:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(28)} ${B(23)} ${B(-7)}, rgba(0, 0, 0, 0.04) 0 ${B(12)} ${B(12)} ${B(-7)}`,xl:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(36)} ${B(28)} ${B(-7)}, rgba(0, 0, 0, 0.04) 0 ${B(17)} ${B(17)} ${B(-7)}`},other:{},components:{}};function X0(e){return e==="auto"||e==="dark"||e==="light"}function ZD({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 X0(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&&X0(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const eI="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",J0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function pp(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Z0(e){if(!(e.primaryColor in e.colors))throw new Error(eI);if(typeof e.primaryShade=="object"&&(!pp(e.primaryShade.dark)||!pp(e.primaryShade.light)))throw new Error(J0);if(typeof e.primaryShade=="number"&&!pp(e.primaryShade))throw new Error(J0)}function tI(e,t){var r;if(!t)return Z0(e),e;const n=iv(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),Z0(n),n}const hv=p.createContext(null),nI=()=>p.useContext(hv)||fv;function At(){const e=p.useContext(hv);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 bj({theme:e,children:t,inherit:n=!0}){const r=nI(),o=p.useMemo(()=>tI(n?r:fv,e),[e,r,n]);return s.jsx(hv.Provider,{value:o,children:t})}bj.displayName="@mantine/core/MantineThemeProvider";function rI(){const e=At(),t=zf(),n=bt(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),a=dc(e.breakpoints[o]),l=i?`${a-.1}px`:Id(a-.1),c=i?`${a}px`:Id(a);return`${r}@media (max-width: ${l}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${c}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return s.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function mp(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Al(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function oI(e,t){const n=mp(e.variables),r=n?Al(t,n):"",o=mp(e.dark),i=mp(e.light),a=o?Al(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",l=i?Al(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,i):"";return`${r}${a}${l}`}function Go({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&jr({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function e1(e,t){return Go({color:e.colors[e.primaryColor][hc(e,t)],theme:e,autoContrast:null})}function $u({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const l=hc(e,"light"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${l===9?8:l+1})`,[`--mantine-color-${r}-light`]:la(e.colors[t][l],.1),[`--mantine-color-${r}-light-hover`]:la(e.colors[t][l],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline-hover`]:la(e.colors[t][l],.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}const i=hc(e,"dark"),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${i})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${i===9?8:i+1})`,[`--mantine-color-${r}-light`]:la(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:la(e.colors[t][Math.max(0,i-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(i-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(i-4,0)})`,[`--mantine-color-${r}-outline-hover`]:la(e.colors[t][Math.max(i-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],...a}:a}function iI(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function ca(e,t,n){bt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const wj=e=>{const t=hc(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:B(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":e1(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":e1(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)"}};ca(r.variables,e.breakpoints,"breakpoint"),ca(r.variables,e.spacing,"spacing"),ca(r.variables,e.fontSizes,"font-size"),ca(r.variables,e.lineHeights,"line-height"),ca(r.variables,e.shadows,"shadow"),ca(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((i,a)=>{r.variables[`--mantine-primary-color-${a}`]=`var(--mantine-color-${e.primaryColor}-${a})`}),bt(e.colors).forEach(i=>{const a=e.colors[i];if(iI(a)){Object.assign(r.light,$u({theme:e,name:a.name,color:a.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,$u({theme:e,name:a.name,color:a.dark,colorScheme:"dark",withColorValues:!0}));return}a.forEach((l,c)=>{r.variables[`--mantine-color-${i}-${c}`]=l}),Object.assign(r.light,$u({theme:e,color:i,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,$u({theme:e,color:i,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return bt(o).forEach(i=>{r.variables[`--mantine-${i}-font-size`]=o[i].fontSize,r.variables[`--mantine-${i}-line-height`]=o[i].lineHeight,r.variables[`--mantine-${i}-font-weight`]=o[i].fontWeight||e.headings.fontWeight}),r};function sI({theme:e,generator:t}){const n=wj(e),r=t==null?void 0:t(e);return r?iv(n,r):n}const gp=wj(fv);function aI(e){const t={variables:{},light:{},dark:{}};return bt(e.variables).forEach(n=>{gp.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),bt(e.light).forEach(n=>{gp.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),bt(e.dark).forEach(n=>{gp.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function lI(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 Sj({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=At(),r=zf(),o=FD(),i=sI({theme:n,generator:o}),a=e===":root"&&t,l=a?aI(i):i,c=oI(l,e);return c?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${c}${a?"":lI(e)}`}}):null}Sj.displayName="@mantine/CssVariables";function cI(){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 ua(e,t){var r;const n=e!=="auto"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";(r=t())==null||r.setAttribute("data-mantine-color-scheme",n)}function uI({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=p.useRef(),[i,a]=p.useState(()=>e.get(t)),l=r||i,c=p.useCallback(d=>{r||(ua(d,n),a(d),e.set(d))},[e.set,l,r]),u=p.useCallback(()=>{a(t),ua(t,n),e.clear()},[e.clear,t]);return p.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),cl(()=>{ua(e.get(t),n)},[]),p.useEffect(()=>{var f;if(r)return ua(r,n),()=>{};r===void 0&&ua(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const d=h=>{i==="auto"&&ua(h.matches?"dark":"light",n)};return(f=o.current)==null||f.addEventListener("change",d),()=>{var h;return(h=o.current)==null?void 0:h.removeEventListener("change",d)}},[i,r]),{colorScheme:l,setColorScheme:c,clearColorScheme:u}}function dI({respectReducedMotion:e,getRootElement:t}){cl(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}cI();function jj({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:i=!0,withCssVariables:a=!0,cssVariablesSelector:l=":root",classNamesPrefix:c="mantine",colorSchemeManager:u=ZD(),defaultColorScheme:d="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:m,stylesTransform:g}){const{colorScheme:v,setColorScheme:S,clearColorScheme:x}=uI({defaultColorScheme:d,forceColorScheme:m,manager:u,getRootElement:f});return dI({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:f}),s.jsx(uv.Provider,{value:{colorScheme:v,setColorScheme:S,clearColorScheme:x,getRootElement:f,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:l,withStaticClasses:r,stylesTransform:g},children:s.jsxs(bj,{theme:e,children:[a&&s.jsx(Sj,{cssVariablesSelector:l,deduplicateCssVariables:i}),o&&s.jsx(rI,{}),t]})})}jj.displayName="@mantine/core/MantineProvider";function Qc({classNames:e,styles:t,props:n,stylesCtx:r}){const o=At();return{resolvedClassNames:Ff({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Nd({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const fI={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function hI({theme:e,options:t,unstyled:n}){return rt((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||fI[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function pI({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Ff({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function t1({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Ff({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function mI({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function gI({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function vI({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function yI({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var a,l;return(l=Ff({theme:t,classNames:(a=t.components[i])==null?void 0:a.classNames,props:r,stylesCtx:o}))==null?void 0:l[n]})}function xI({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function bI({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:i,classes:a,unstyled:l,className:c,rootSelector:u,props:d,stylesCtx:f,withStaticClasses:h,headless:m,transformedStyles:g}){return rt(hI({theme:e,options:t,unstyled:l||m}),yI({theme:e,themeName:n,selector:r,props:d,stylesCtx:f}),xI({options:t,classes:a,selector:r,unstyled:l}),t1({selector:r,stylesCtx:f,theme:e,classNames:i,props:d}),t1({selector:r,stylesCtx:f,theme:e,classNames:g,props:d}),pI({selector:r,stylesCtx:f,options:t,props:d,theme:e}),mI({rootSelector:u,selector:r,className:c}),gI({selector:r,classes:a,unstyled:l||m}),h&&!m&&vI({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function wI({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var a;return Nd({theme:e,styles:(a=e.components[i])==null?void 0:a.styles,props:n,stylesCtx:r})[o]}).reduce((i,a)=>({...i,...a}),{})}function ym({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...ym({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function SI(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Li(n[r])}}),t),{})}function jI({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:a,headless:l}){var c;return(c=SI([l?{}:t==null?void 0:t(n,r,o),...a.map(u=>{var d,f,h;return(h=(f=(d=n.components)==null?void 0:d[u])==null?void 0:f.vars)==null?void 0:h.call(f,n,r,o)}),e==null?void 0:e(n,r,o)]))==null?void 0:c[i]}function CI({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:a,styles:l,style:c,vars:u,varsResolver:d,headless:f,withStylesTransform:h}){return{...!h&&wI({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...!h&&Nd({theme:e,styles:l,props:o,stylesCtx:i})[n],...!h&&Nd({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...jI({theme:e,props:o,stylesCtx:i,vars:u,varsResolver:d,selector:n,themeName:t,headless:f}),...a===n?ym({style:c,theme:e}):null,...ym({style:r==null?void 0:r.style,theme:e})}}function EI({props:e,stylesCtx:t,themeName:n}){var a;const r=At(),o=(a=HD())==null?void 0:a();return{getTransformedStyles:l=>o?[...l.map(u=>o(u,{props:e,theme:r,ctx:t})),...n.map(u=>{var d;return o((d=r.components[u])==null?void 0:d.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!o}}function de({name:e,classes:t,props:n,stylesCtx:r,className:o,style:i,rootSelector:a="root",unstyled:l,classNames:c,styles:u,vars:d,varsResolver:f}){const h=At(),m=zD(),g=UD(),v=BD(),S=(Array.isArray(e)?e:[e]).filter(y=>y),{withStylesTransform:x,getTransformedStyles:w}=EI({props:n,stylesCtx:r,themeName:S});return(y,b)=>({className:bI({theme:h,options:b,themeName:S,selector:y,classNamesPrefix:m,classNames:c,classes:t,unstyled:l,className:o,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:g,headless:v,transformedStyles:w([b==null?void 0:b.styles,u])}),style:CI({theme:h,themeName:S,selector:y,options:b,props:n,stylesCtx:r,rootSelector:a,styles:u,style:i,vars:d,varsResolver:f,headless:v,withStylesTransform:x})})}function Ms(e,t){return typeof e=="boolean"?e:t.autoContrast}function n1(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 TI({keepTransitions:e}={}){const t=p.useRef(),n=p.useRef(),r=p.useContext(uv),o=zf(),i=p.useRef(o==null?void 0:o());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const a=f=>{r.setColorScheme(f),t.current=e?()=>{}:n1(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var h;(h=t.current)==null||h.call(t)},10)},l=()=>{r.clearColorScheme(),t.current=e?()=>{}:n1(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var f;(f=t.current)==null||f.call(t)},10)},c=xD("light",{getInitialValueInEffect:!1}),u=r.colorScheme==="auto"?c:r.colorScheme,d=p.useCallback(()=>a(u==="light"?"dark":"light"),[a,u]);return p.useEffect(()=>()=>{var f;(f=t.current)==null||f.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:a,clearColorScheme:l,toggleColorScheme:d}}function V(e,t,n){var a;const r=At(),o=(a=r.components[e])==null?void 0:a.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...Li(n)}}function vp(e){return bt(e).reduce((t,n)=>e[n]!==void 0?`${t}${sD(n)}:${e[n]};`:t,"").trim()}function PI({selector:e,styles:t,media:n,container:r}){const o=t?vp(t):"",i=Array.isArray(n)?n.map(l=>`@media${l.query}{${e}{${vp(l.styles)}}}`):[],a=Array.isArray(r)?r.map(l=>`@container ${l.query}{${e}{${vp(l.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${i.join("")}${a.join("")}`.trim()}function Os(e){const t=zf();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:PI(e)}})}function Qo(e){const{m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:m,pb:g,pl:v,pr:S,pe:x,ps:w,bd:y,bg:b,c:C,opacity:j,ff:T,fz:E,fw:R,lts:_,ta:N,lh:O,fs:F,tt:z,td:H,w:D,miw:k,maw:P,h:I,mih:L,mah:$,bgsz:Q,bgp:ue,bgr:Re,bga:me,pos:ge,top:De,left:le,bottom:Ae,right:it,inset:Ue,display:Je,flex:st,hiddenFrom:Be,visibleFrom:Ze,lightHidden:at,darkHidden:ne,sx:X,...ce}=e;return{styleProps:Li({m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:m,pb:g,pl:v,pr:S,pe:x,ps:w,bd:y,bg:b,c:C,opacity:j,ff:T,fz:E,fw:R,lts:_,ta:N,lh:O,fs:F,tt:z,td:H,w:D,miw:k,maw:P,h:I,mih:L,mah:$,bgsz:Q,bgp:ue,bgr:Re,bga:me,pos:ge,top:De,left:le,bottom:Ae,right:it,inset:Ue,display:Je,flex:st,hiddenFrom:Be,visibleFrom:Ze,lightHidden:at,darkHidden:ne,sx:X}),rest:ce}}const kI={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:"identity",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 pv(e,t){const n=jr({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 RI(e,t){const n=jr({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:pv(e,t)}function _I(e,t){if(typeof e=="number")return B(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(a=>a.trim()!=="");let i=`${B(n)}`;return r&&(i+=` ${r}`),o.length>0&&(i+=` ${pv(o.join(" "),t)}`),i.trim()}return e}const r1={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 DI(e){return typeof e=="string"&&e in r1?r1[e]:e}const II=["h1","h2","h3","h4","h5","h6"];function AI(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&II.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?B(e):e}function NI(e){return e}const MI=["h1","h2","h3","h4","h5","h6"];function OI(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&MI.includes(e)?`var(--mantine-${e}-line-height)`:e}function LI(e){return typeof e=="number"?B(e):e}function $I(e,t){if(typeof e=="number")return B(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return B(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const yp={color:pv,textColor:RI,fontSize:AI,spacing:$I,identity:NI,size:LI,lineHeight:OI,fontFamily:DI,border:_I};function o1(e){return e.replace("(min-width: ","").replace("em)","")}function FI({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(o1(o))-Number(o1(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function zI(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function UI(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function BI(e){return typeof e=="object"&&e!==null?bt(e).filter(t=>t!=="base"):[]}function VI(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function Cj({styleProps:e,data:t,theme:n}){return FI(bt(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const i=t[o],a=Array.isArray(i.property)?i.property:[i.property],l=UI(e[o]);if(!zI(e[o]))return a.forEach(u=>{r.inlineStyles[u]=yp[i.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=BI(e[o]);return a.forEach(u=>{l&&(r.styles[u]=yp[i.type](l,n)),c.forEach(d=>{const f=`(min-width: ${n.breakpoints[d]})`;r.media[f]={...r.media[f],[u]:yp[i.type](VI(e[o],d),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Kc(){return`__m__-${p.useId().replace(/:/g,"")}`}function Ej(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Ej(r,t)}),{}):typeof e=="function"?e(t):e??{}}function Tj(e){return e.startsWith("data-")?e:`data-${e}`}function HI(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[Tj(n)]=e[n]),t},{})}function Pj(e){return e?typeof e=="string"?{[Tj(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...Pj(n)}),{}):HI(e):null}function xm(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...xm(r,t)}),{}):typeof e=="function"?e(t):e??{}}function WI({theme:e,style:t,vars:n,styleProps:r}){const o=xm(t,e),i=xm(n,e);return{...o,...i,...r}}const kj=p.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:i,size:a,hiddenFrom:l,visibleFrom:c,lightHidden:u,darkHidden:d,renderRoot:f,__size:h,...m},g)=>{var E;const v=At(),S=e||"div",{styleProps:x,rest:w}=Qo(m),y=VD(),b=(E=y==null?void 0:y())==null?void 0:E(x.sx),C=Kc(),j=Cj({styleProps:x,theme:v,data:kI}),T={ref:g,style:WI({theme:v,style:t,vars:n,styleProps:j.inlineStyles}),className:rt(r,b,{[C]:j.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":d,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${c}`]:c}),"data-variant":o,"data-size":lj(a)?void 0:a||void 0,size:h,...Pj(i),...w};return s.jsxs(s.Fragment,{children:[j.hasResponsiveStyles&&s.jsx(Os,{selector:`.${C}`,styles:j.styles,media:j.media}),typeof f=="function"?f(T):s.jsx(S,{...T})]})});kj.displayName="@mantine/core/Box";const q=kj;function Rj(e){return e}function Y(e){const t=p.forwardRef(e);return t.extend=Rj,t.withProps=n=>{const r=p.forwardRef((o,i)=>s.jsx(t,{...n,...o,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function _n(e){const t=p.forwardRef(e);return t.withProps=n=>{const r=p.forwardRef((o,i)=>s.jsx(t,{...n,...o,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=Rj,t}const qI=p.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Ls(){return p.useContext(qI)}var _j={exports:{}},hr={},Dj={exports:{}},Ij={};/**
|
|
61
|
+
* @license React
|
|
62
|
+
* scheduler.production.min.js
|
|
63
|
+
*
|
|
64
|
+
* Copyright (c) Facebook, Inc. and its 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
|
+
*/(function(e){function t(P,I){var L=P.length;P.push(I);e:for(;0<L;){var $=L-1>>>1,Q=P[$];if(0<o(Q,I))P[$]=I,P[L]=Q,L=$;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var I=P[0],L=P.pop();if(L!==I){P[0]=L;e:for(var $=0,Q=P.length,ue=Q>>>1;$<ue;){var Re=2*($+1)-1,me=P[Re],ge=Re+1,De=P[ge];if(0>o(me,L))ge<Q&&0>o(De,me)?(P[$]=De,P[ge]=L,$=ge):(P[$]=me,P[Re]=L,$=Re);else if(ge<Q&&0>o(De,L))P[$]=De,P[ge]=L,$=ge;else break e}}return I}function o(P,I){var L=P.sortIndex-I.sortIndex;return L!==0?L:P.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(P){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=P)r(u),I.sortIndex=I.expirationTime,t(c,I);else break;I=n(u)}}function b(P){if(v=!1,y(P),!g)if(n(c)!==null)g=!0,D(C);else{var I=n(u);I!==null&&k(b,I.startTime-P)}}function C(P,I){g=!1,v&&(v=!1,x(E),E=-1),m=!0;var L=h;try{for(y(I),f=n(c);f!==null&&(!(f.expirationTime>I)||P&&!N());){var $=f.callback;if(typeof $=="function"){f.callback=null,h=f.priorityLevel;var Q=$(f.expirationTime<=I);I=e.unstable_now(),typeof Q=="function"?f.callback=Q:f===n(c)&&r(c),y(I)}else r(c);f=n(c)}if(f!==null)var ue=!0;else{var Re=n(u);Re!==null&&k(b,Re.startTime-I),ue=!1}return ue}finally{f=null,h=L,m=!1}}var j=!1,T=null,E=-1,R=5,_=-1;function N(){return!(e.unstable_now()-_<R)}function O(){if(T!==null){var P=e.unstable_now();_=P;var I=!0;try{I=T(!0,P)}finally{I?F():(j=!1,T=null)}}else j=!1}var F;if(typeof w=="function")F=function(){w(O)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,H=z.port2;z.port1.onmessage=O,F=function(){H.postMessage(null)}}else F=function(){S(O,0)};function D(P){T=P,j||(j=!0,F())}function k(P,I){E=S(function(){P(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(P){P.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,D(C))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(P){switch(h){case 1:case 2:case 3:var I=3;break;default:I=h}var L=h;h=I;try{return P()}finally{h=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,I){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var L=h;h=P;try{return I()}finally{h=L}},e.unstable_scheduleCallback=function(P,I,L){var $=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?$+L:$):L=$,P){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=L+Q,P={id:d++,callback:I,priorityLevel:P,startTime:L,expirationTime:Q,sortIndex:-1},L>$?(P.sortIndex=L,t(u,P),n(c)===null&&P===n(u)&&(v?(x(E),E=-1):v=!0,k(b,L-$))):(P.sortIndex=Q,t(c,P),g||m||(g=!0,D(C))),P},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(P){var I=h;return function(){var L=h;h=I;try{return P.apply(this,arguments)}finally{h=L}}}})(Ij);Dj.exports=Ij;var GI=Dj.exports;/**
|
|
69
|
+
* @license React
|
|
70
|
+
* react-dom.production.min.js
|
|
71
|
+
*
|
|
72
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the MIT license found in the
|
|
75
|
+
* LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/var Aj=p,ur=GI;function ee(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Nj=new Set,pc={};function $s(e,t){Wa(e,t),Wa(e+"Capture",t)}function Wa(e,t){for(pc[e]=t,e=0;e<t.length;e++)Nj.add(t[e])}var Oo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bm=Object.prototype.hasOwnProperty,QI=/^[: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]*$/,i1={},s1={};function KI(e){return bm.call(s1,e)?!0:bm.call(i1,e)?!1:QI.test(e)?s1[e]=!0:(i1[e]=!0,!1)}function YI(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function XI(e,t,n,r){if(t===null||typeof t>"u"||YI(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Bn(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var wn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wn[e]=new Bn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wn[t]=new Bn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){wn[e]=new Bn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){wn[e]=new Bn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){wn[e]=new Bn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){wn[e]=new Bn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){wn[e]=new Bn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){wn[e]=new Bn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){wn[e]=new Bn(e,5,!1,e.toLowerCase(),null,!1,!1)});var mv=/[\-:]([a-z])/g;function gv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(mv,gv);wn[t]=new Bn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(mv,gv);wn[t]=new Bn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(mv,gv);wn[t]=new Bn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){wn[e]=new Bn(e,1,!1,e.toLowerCase(),null,!1,!1)});wn.xlinkHref=new Bn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){wn[e]=new Bn(e,1,!1,e.toLowerCase(),null,!0,!0)});function vv(e,t,n,r){var o=wn.hasOwnProperty(t)?wn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(XI(t,n,o,r)&&(n=null),r||o===null?KI(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ko=Aj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fu=Symbol.for("react.element"),xa=Symbol.for("react.portal"),ba=Symbol.for("react.fragment"),yv=Symbol.for("react.strict_mode"),wm=Symbol.for("react.profiler"),Mj=Symbol.for("react.provider"),Oj=Symbol.for("react.context"),xv=Symbol.for("react.forward_ref"),Sm=Symbol.for("react.suspense"),jm=Symbol.for("react.suspense_list"),bv=Symbol.for("react.memo"),li=Symbol.for("react.lazy"),Lj=Symbol.for("react.offscreen"),a1=Symbol.iterator;function Nl(e){return e===null||typeof e!="object"?null:(e=a1&&e[a1]||e["@@iterator"],typeof e=="function"?e:null)}var Ut=Object.assign,xp;function Ql(e){if(xp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);xp=t&&t[1]||""}return`
|
|
77
|
+
`+xp+e}var bp=!1;function wp(e,t){if(!e||bp)return"";bp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
78
|
+
`),i=r.stack.split(`
|
|
79
|
+
`),a=o.length-1,l=i.length-1;1<=a&&0<=l&&o[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(o[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||o[a]!==i[l]){var c=`
|
|
80
|
+
`+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{bp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ql(e):""}function JI(e){switch(e.tag){case 5:return Ql(e.type);case 16:return Ql("Lazy");case 13:return Ql("Suspense");case 19:return Ql("SuspenseList");case 0:case 2:case 15:return e=wp(e.type,!1),e;case 11:return e=wp(e.type.render,!1),e;case 1:return e=wp(e.type,!0),e;default:return""}}function Cm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ba:return"Fragment";case xa:return"Portal";case wm:return"Profiler";case yv:return"StrictMode";case Sm:return"Suspense";case jm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Oj:return(e.displayName||"Context")+".Consumer";case Mj:return(e._context.displayName||"Context")+".Provider";case xv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bv:return t=e.displayName||null,t!==null?t:Cm(e.type)||"Memo";case li:t=e._payload,e=e._init;try{return Cm(e(t))}catch{}}return null}function ZI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Cm(t);case 8:return t===yv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function _i(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $j(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function eA(e){var t=$j(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zu(e){e._valueTracker||(e._valueTracker=eA(e))}function Fj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$j(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Md(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Em(e,t){var n=t.checked;return Ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function l1(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=_i(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zj(e,t){t=t.checked,t!=null&&vv(e,"checked",t,!1)}function Tm(e,t){zj(e,t);var n=_i(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Pm(e,t.type,n):t.hasOwnProperty("defaultValue")&&Pm(e,t.type,_i(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function c1(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Pm(e,t,n){(t!=="number"||Md(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Kl=Array.isArray;function Ma(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+_i(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function km(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ee(91));return Ut({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function u1(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ee(92));if(Kl(n)){if(1<n.length)throw Error(ee(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:_i(n)}}function Uj(e,t){var n=_i(t.value),r=_i(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function d1(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Bj(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Rm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Bj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Uu,Vj=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Uu=Uu||document.createElement("div"),Uu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Uu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tA=["Webkit","ms","Moz","O"];Object.keys(tc).forEach(function(e){tA.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),tc[t]=tc[e]})});function Hj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||tc.hasOwnProperty(e)&&tc[e]?(""+t).trim():t+"px"}function Wj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Hj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var nA=Ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _m(e,t){if(t){if(nA[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function Dm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Im=null;function wv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Am=null,Oa=null,La=null;function f1(e){if(e=Jc(e)){if(typeof Am!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=Wf(t),Am(e.stateNode,e.type,t))}}function qj(e){Oa?La?La.push(e):La=[e]:Oa=e}function Gj(){if(Oa){var e=Oa,t=La;if(La=Oa=null,f1(e),t)for(e=0;e<t.length;e++)f1(t[e])}}function Qj(e,t){return e(t)}function Kj(){}var Sp=!1;function Yj(e,t,n){if(Sp)return e(t,n);Sp=!0;try{return Qj(e,t,n)}finally{Sp=!1,(Oa!==null||La!==null)&&(Kj(),Gj())}}function gc(e,t){var n=e.stateNode;if(n===null)return null;var r=Wf(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ee(231,t,typeof n));return n}var Nm=!1;if(Oo)try{var Ml={};Object.defineProperty(Ml,"passive",{get:function(){Nm=!0}}),window.addEventListener("test",Ml,Ml),window.removeEventListener("test",Ml,Ml)}catch{Nm=!1}function rA(e,t,n,r,o,i,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var nc=!1,Od=null,Ld=!1,Mm=null,oA={onError:function(e){nc=!0,Od=e}};function iA(e,t,n,r,o,i,a,l,c){nc=!1,Od=null,rA.apply(oA,arguments)}function sA(e,t,n,r,o,i,a,l,c){if(iA.apply(this,arguments),nc){if(nc){var u=Od;nc=!1,Od=null}else throw Error(ee(198));Ld||(Ld=!0,Mm=u)}}function Fs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Xj(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h1(e){if(Fs(e)!==e)throw Error(ee(188))}function aA(e){var t=e.alternate;if(!t){if(t=Fs(e),t===null)throw Error(ee(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return h1(o),e;if(i===r)return h1(o),t;i=i.sibling}throw Error(ee(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,l=o.child;l;){if(l===n){a=!0,n=o,r=i;break}if(l===r){a=!0,r=o,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,r=o;break}if(l===r){a=!0,r=i,n=o;break}l=l.sibling}if(!a)throw Error(ee(189))}}if(n.alternate!==r)throw Error(ee(190))}if(n.tag!==3)throw Error(ee(188));return n.stateNode.current===n?e:t}function Jj(e){return e=aA(e),e!==null?Zj(e):null}function Zj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Zj(e);if(t!==null)return t;e=e.sibling}return null}var eC=ur.unstable_scheduleCallback,p1=ur.unstable_cancelCallback,lA=ur.unstable_shouldYield,cA=ur.unstable_requestPaint,Kt=ur.unstable_now,uA=ur.unstable_getCurrentPriorityLevel,Sv=ur.unstable_ImmediatePriority,tC=ur.unstable_UserBlockingPriority,$d=ur.unstable_NormalPriority,dA=ur.unstable_LowPriority,nC=ur.unstable_IdlePriority,Uf=null,fo=null;function fA(e){if(fo&&typeof fo.onCommitFiberRoot=="function")try{fo.onCommitFiberRoot(Uf,e,void 0,(e.current.flags&128)===128)}catch{}}var Vr=Math.clz32?Math.clz32:mA,hA=Math.log,pA=Math.LN2;function mA(e){return e>>>=0,e===0?32:31-(hA(e)/pA|0)|0}var Bu=64,Vu=4194304;function Yl(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~o;l!==0?r=Yl(l):(i&=a,i!==0&&(r=Yl(i)))}else a=n&~o,a!==0?r=Yl(a):i!==0&&(r=Yl(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Vr(t),o=1<<n,r|=e[n],t&=~o;return r}function gA(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vA(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-Vr(i),l=1<<a,c=o[a];c===-1?(!(l&n)||l&r)&&(o[a]=gA(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Om(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function rC(){var e=Bu;return Bu<<=1,!(Bu&4194240)&&(Bu=64),e}function jp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Yc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Vr(t),e[t]=n}function yA(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Vr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function jv(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Vr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var pt=0;function oC(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var iC,Cv,sC,aC,lC,Lm=!1,Hu=[],wi=null,Si=null,ji=null,vc=new Map,yc=new Map,pi=[],xA="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 submit".split(" ");function m1(e,t){switch(e){case"focusin":case"focusout":wi=null;break;case"dragenter":case"dragleave":Si=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":vc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yc.delete(t.pointerId)}}function Ol(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Jc(t),t!==null&&Cv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function bA(e,t,n,r,o){switch(t){case"focusin":return wi=Ol(wi,e,t,n,r,o),!0;case"dragenter":return Si=Ol(Si,e,t,n,r,o),!0;case"mouseover":return ji=Ol(ji,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return vc.set(i,Ol(vc.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,yc.set(i,Ol(yc.get(i)||null,e,t,n,r,o)),!0}return!1}function cC(e){var t=us(e.target);if(t!==null){var n=Fs(t);if(n!==null){if(t=n.tag,t===13){if(t=Xj(n),t!==null){e.blockedOn=t,lC(e.priority,function(){sC(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$m(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Im=r,n.target.dispatchEvent(r),Im=null}else return t=Jc(n),t!==null&&Cv(t),e.blockedOn=n,!1;t.shift()}return!0}function g1(e,t,n){gd(e)&&n.delete(t)}function wA(){Lm=!1,wi!==null&&gd(wi)&&(wi=null),Si!==null&&gd(Si)&&(Si=null),ji!==null&&gd(ji)&&(ji=null),vc.forEach(g1),yc.forEach(g1)}function Ll(e,t){e.blockedOn===t&&(e.blockedOn=null,Lm||(Lm=!0,ur.unstable_scheduleCallback(ur.unstable_NormalPriority,wA)))}function xc(e){function t(o){return Ll(o,e)}if(0<Hu.length){Ll(Hu[0],e);for(var n=1;n<Hu.length;n++){var r=Hu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(wi!==null&&Ll(wi,e),Si!==null&&Ll(Si,e),ji!==null&&Ll(ji,e),vc.forEach(t),yc.forEach(t),n=0;n<pi.length;n++)r=pi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<pi.length&&(n=pi[0],n.blockedOn===null);)cC(n),n.blockedOn===null&&pi.shift()}var $a=Ko.ReactCurrentBatchConfig,zd=!0;function SA(e,t,n,r){var o=pt,i=$a.transition;$a.transition=null;try{pt=1,Ev(e,t,n,r)}finally{pt=o,$a.transition=i}}function jA(e,t,n,r){var o=pt,i=$a.transition;$a.transition=null;try{pt=4,Ev(e,t,n,r)}finally{pt=o,$a.transition=i}}function Ev(e,t,n,r){if(zd){var o=$m(e,t,n,r);if(o===null)Ap(e,t,r,Ud,n),m1(e,r);else if(bA(o,e,t,n,r))r.stopPropagation();else if(m1(e,r),t&4&&-1<xA.indexOf(e)){for(;o!==null;){var i=Jc(o);if(i!==null&&iC(i),i=$m(e,t,n,r),i===null&&Ap(e,t,r,Ud,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ap(e,t,r,null,n)}}var Ud=null;function $m(e,t,n,r){if(Ud=null,e=wv(r),e=us(e),e!==null)if(t=Fs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Xj(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ud=e,null}function uC(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(uA()){case Sv:return 1;case tC:return 4;case $d:case dA:return 16;case nC:return 536870912;default:return 16}default:return 16}}var yi=null,Tv=null,vd=null;function dC(){if(vd)return vd;var e,t=Tv,n=t.length,r,o="value"in yi?yi.value:yi.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===o[i-r];r++);return vd=o.slice(e,1<r?1-r:void 0)}function yd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Wu(){return!0}function v1(){return!1}function pr(e){function t(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Wu:v1,this.isPropagationStopped=v1,this}return Ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Wu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Wu)},persist:function(){},isPersistent:Wu}),t}var ul={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pv=pr(ul),Xc=Ut({},ul,{view:0,detail:0}),CA=pr(Xc),Cp,Ep,$l,Bf=Ut({},Xc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==$l&&($l&&e.type==="mousemove"?(Cp=e.screenX-$l.screenX,Ep=e.screenY-$l.screenY):Ep=Cp=0,$l=e),Cp)},movementY:function(e){return"movementY"in e?e.movementY:Ep}}),y1=pr(Bf),EA=Ut({},Bf,{dataTransfer:0}),TA=pr(EA),PA=Ut({},Xc,{relatedTarget:0}),Tp=pr(PA),kA=Ut({},ul,{animationName:0,elapsedTime:0,pseudoElement:0}),RA=pr(kA),_A=Ut({},ul,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DA=pr(_A),IA=Ut({},ul,{data:0}),x1=pr(IA),AA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NA={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"},MA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OA(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=MA[e])?!!t[e]:!1}function kv(){return OA}var LA=Ut({},Xc,{key:function(e){if(e.key){var t=AA[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=yd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?NA[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kv,charCode:function(e){return e.type==="keypress"?yd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?yd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$A=pr(LA),FA=Ut({},Bf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),b1=pr(FA),zA=Ut({},Xc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kv}),UA=pr(zA),BA=Ut({},ul,{propertyName:0,elapsedTime:0,pseudoElement:0}),VA=pr(BA),HA=Ut({},Bf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),WA=pr(HA),qA=[9,13,27,32],Rv=Oo&&"CompositionEvent"in window,rc=null;Oo&&"documentMode"in document&&(rc=document.documentMode);var GA=Oo&&"TextEvent"in window&&!rc,fC=Oo&&(!Rv||rc&&8<rc&&11>=rc),w1=" ",S1=!1;function hC(e,t){switch(e){case"keyup":return qA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wa=!1;function QA(e,t){switch(e){case"compositionend":return pC(t);case"keypress":return t.which!==32?null:(S1=!0,w1);case"textInput":return e=t.data,e===w1&&S1?null:e;default:return null}}function KA(e,t){if(wa)return e==="compositionend"||!Rv&&hC(e,t)?(e=dC(),vd=Tv=yi=null,wa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fC&&t.locale!=="ko"?null:t.data;default:return null}}var YA={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 j1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!YA[e.type]:t==="textarea"}function mC(e,t,n,r){qj(r),t=Bd(t,"onChange"),0<t.length&&(n=new Pv("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var oc=null,bc=null;function XA(e){TC(e,0)}function Vf(e){var t=Ca(e);if(Fj(t))return e}function JA(e,t){if(e==="change")return t}var gC=!1;if(Oo){var Pp;if(Oo){var kp="oninput"in document;if(!kp){var C1=document.createElement("div");C1.setAttribute("oninput","return;"),kp=typeof C1.oninput=="function"}Pp=kp}else Pp=!1;gC=Pp&&(!document.documentMode||9<document.documentMode)}function E1(){oc&&(oc.detachEvent("onpropertychange",vC),bc=oc=null)}function vC(e){if(e.propertyName==="value"&&Vf(bc)){var t=[];mC(t,bc,e,wv(e)),Yj(XA,t)}}function ZA(e,t,n){e==="focusin"?(E1(),oc=t,bc=n,oc.attachEvent("onpropertychange",vC)):e==="focusout"&&E1()}function eN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vf(bc)}function tN(e,t){if(e==="click")return Vf(t)}function nN(e,t){if(e==="input"||e==="change")return Vf(t)}function rN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qr=typeof Object.is=="function"?Object.is:rN;function wc(e,t){if(qr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!bm.call(t,o)||!qr(e[o],t[o]))return!1}return!0}function T1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function P1(e,t){var n=T1(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=T1(n)}}function yC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xC(){for(var e=window,t=Md();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Md(e.document)}return t}function _v(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function oN(e){var t=xC(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&yC(n.ownerDocument.documentElement,n)){if(r!==null&&_v(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=P1(n,i);var a=P1(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var iN=Oo&&"documentMode"in document&&11>=document.documentMode,Sa=null,Fm=null,ic=null,zm=!1;function k1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zm||Sa==null||Sa!==Md(r)||(r=Sa,"selectionStart"in r&&_v(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ic&&wc(ic,r)||(ic=r,r=Bd(Fm,"onSelect"),0<r.length&&(t=new Pv("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Sa)))}function qu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ja={animationend:qu("Animation","AnimationEnd"),animationiteration:qu("Animation","AnimationIteration"),animationstart:qu("Animation","AnimationStart"),transitionend:qu("Transition","TransitionEnd")},Rp={},bC={};Oo&&(bC=document.createElement("div").style,"AnimationEvent"in window||(delete ja.animationend.animation,delete ja.animationiteration.animation,delete ja.animationstart.animation),"TransitionEvent"in window||delete ja.transitionend.transition);function Hf(e){if(Rp[e])return Rp[e];if(!ja[e])return e;var t=ja[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in bC)return Rp[e]=t[n];return e}var wC=Hf("animationend"),SC=Hf("animationiteration"),jC=Hf("animationstart"),CC=Hf("transitionend"),EC=new Map,R1="abort auxClick 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(" ");function Fi(e,t){EC.set(e,t),$s(t,[e])}for(var _p=0;_p<R1.length;_p++){var Dp=R1[_p],sN=Dp.toLowerCase(),aN=Dp[0].toUpperCase()+Dp.slice(1);Fi(sN,"on"+aN)}Fi(wC,"onAnimationEnd");Fi(SC,"onAnimationIteration");Fi(jC,"onAnimationStart");Fi("dblclick","onDoubleClick");Fi("focusin","onFocus");Fi("focusout","onBlur");Fi(CC,"onTransitionEnd");Wa("onMouseEnter",["mouseout","mouseover"]);Wa("onMouseLeave",["mouseout","mouseover"]);Wa("onPointerEnter",["pointerout","pointerover"]);Wa("onPointerLeave",["pointerout","pointerover"]);$s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$s("onBeforeInput",["compositionend","keypress","textInput","paste"]);$s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xl="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(" "),lN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xl));function _1(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,sA(r,t,void 0,e),e.currentTarget=null}function TC(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;_1(o,l,u),i=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;_1(o,l,u),i=c}}}if(Ld)throw e=Mm,Ld=!1,Mm=null,e}function kt(e,t){var n=t[Wm];n===void 0&&(n=t[Wm]=new Set);var r=e+"__bubble";n.has(r)||(PC(t,e,2,!1),n.add(r))}function Ip(e,t,n){var r=0;t&&(r|=4),PC(n,e,r,t)}var Gu="_reactListening"+Math.random().toString(36).slice(2);function Sc(e){if(!e[Gu]){e[Gu]=!0,Nj.forEach(function(n){n!=="selectionchange"&&(lN.has(n)||Ip(n,!1,e),Ip(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gu]||(t[Gu]=!0,Ip("selectionchange",!1,t))}}function PC(e,t,n,r){switch(uC(t)){case 1:var o=SA;break;case 4:o=jA;break;default:o=Ev}n=o.bind(null,t,n,e),o=void 0,!Nm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ap(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;l!==null;){if(a=us(l),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}l=l.parentNode}}r=r.return}Yj(function(){var u=i,d=wv(n),f=[];e:{var h=EC.get(e);if(h!==void 0){var m=Pv,g=e;switch(e){case"keypress":if(yd(n)===0)break e;case"keydown":case"keyup":m=$A;break;case"focusin":g="focus",m=Tp;break;case"focusout":g="blur",m=Tp;break;case"beforeblur":case"afterblur":m=Tp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=y1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=TA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=UA;break;case wC:case SC:case jC:m=RA;break;case CC:m=VA;break;case"scroll":m=CA;break;case"wheel":m=WA;break;case"copy":case"cut":case"paste":m=DA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=b1}var v=(t&4)!==0,S=!v&&e==="scroll",x=v?h!==null?h+"Capture":null:h;v=[];for(var w=u,y;w!==null;){y=w;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,x!==null&&(b=gc(w,x),b!=null&&v.push(jc(w,b,y)))),S)break;w=w.return}0<v.length&&(h=new m(h,g,null,n,d),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Im&&(g=n.relatedTarget||n.fromElement)&&(us(g)||g[Lo]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?us(g):null,g!==null&&(S=Fs(g),g!==S||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=y1,b="onMouseLeave",x="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=b1,b="onPointerLeave",x="onPointerEnter",w="pointer"),S=m==null?h:Ca(m),y=g==null?h:Ca(g),h=new v(b,w+"leave",m,n,d),h.target=S,h.relatedTarget=y,b=null,us(d)===u&&(v=new v(x,w+"enter",g,n,d),v.target=y,v.relatedTarget=S,b=v),S=b,m&&g)t:{for(v=m,x=g,w=0,y=v;y;y=da(y))w++;for(y=0,b=x;b;b=da(b))y++;for(;0<w-y;)v=da(v),w--;for(;0<y-w;)x=da(x),y--;for(;w--;){if(v===x||x!==null&&v===x.alternate)break t;v=da(v),x=da(x)}v=null}else v=null;m!==null&&D1(f,h,m,v,!1),g!==null&&S!==null&&D1(f,S,g,v,!0)}}e:{if(h=u?Ca(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var C=JA;else if(j1(h))if(gC)C=nN;else{C=eN;var j=ZA}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=tN);if(C&&(C=C(e,u))){mC(f,C,n,d);break e}j&&j(e,h,u),e==="focusout"&&(j=h._wrapperState)&&j.controlled&&h.type==="number"&&Pm(h,"number",h.value)}switch(j=u?Ca(u):window,e){case"focusin":(j1(j)||j.contentEditable==="true")&&(Sa=j,Fm=u,ic=null);break;case"focusout":ic=Fm=Sa=null;break;case"mousedown":zm=!0;break;case"contextmenu":case"mouseup":case"dragend":zm=!1,k1(f,n,d);break;case"selectionchange":if(iN)break;case"keydown":case"keyup":k1(f,n,d)}var T;if(Rv)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else wa?hC(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(fC&&n.locale!=="ko"&&(wa||E!=="onCompositionStart"?E==="onCompositionEnd"&&wa&&(T=dC()):(yi=d,Tv="value"in yi?yi.value:yi.textContent,wa=!0)),j=Bd(u,E),0<j.length&&(E=new x1(E,e,null,n,d),f.push({event:E,listeners:j}),T?E.data=T:(T=pC(n),T!==null&&(E.data=T)))),(T=GA?QA(e,n):KA(e,n))&&(u=Bd(u,"onBeforeInput"),0<u.length&&(d=new x1("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=T))}TC(f,t)})}function jc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Bd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=gc(e,n),i!=null&&r.unshift(jc(e,i,o)),i=gc(e,t),i!=null&&r.push(jc(e,i,o))),e=e.return}return r}function da(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function D1(e,t,n,r,o){for(var i=t._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,o?(c=gc(n,i),c!=null&&a.unshift(jc(n,c,l))):o||(c=gc(n,i),c!=null&&a.push(jc(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var cN=/\r\n?/g,uN=/\u0000|\uFFFD/g;function I1(e){return(typeof e=="string"?e:""+e).replace(cN,`
|
|
81
|
+
`).replace(uN,"")}function Qu(e,t,n){if(t=I1(t),I1(e)!==t&&n)throw Error(ee(425))}function Vd(){}var Um=null,Bm=null;function Vm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Hm=typeof setTimeout=="function"?setTimeout:void 0,dN=typeof clearTimeout=="function"?clearTimeout:void 0,A1=typeof Promise=="function"?Promise:void 0,fN=typeof queueMicrotask=="function"?queueMicrotask:typeof A1<"u"?function(e){return A1.resolve(null).then(e).catch(hN)}:Hm;function hN(e){setTimeout(function(){throw e})}function Np(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),xc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);xc(t)}function Ci(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function N1(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var dl=Math.random().toString(36).slice(2),uo="__reactFiber$"+dl,Cc="__reactProps$"+dl,Lo="__reactContainer$"+dl,Wm="__reactEvents$"+dl,pN="__reactListeners$"+dl,mN="__reactHandles$"+dl;function us(e){var t=e[uo];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Lo]||n[uo]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=N1(e);e!==null;){if(n=e[uo])return n;e=N1(e)}return t}e=n,n=e.parentNode}return null}function Jc(e){return e=e[uo]||e[Lo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ca(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ee(33))}function Wf(e){return e[Cc]||null}var qm=[],Ea=-1;function zi(e){return{current:e}}function Dt(e){0>Ea||(e.current=qm[Ea],qm[Ea]=null,Ea--)}function Et(e,t){Ea++,qm[Ea]=e.current,e.current=t}var Di={},kn=zi(Di),Kn=zi(!1),xs=Di;function qa(e,t){var n=e.type.contextTypes;if(!n)return Di;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Yn(e){return e=e.childContextTypes,e!=null}function Hd(){Dt(Kn),Dt(kn)}function M1(e,t,n){if(kn.current!==Di)throw Error(ee(168));Et(kn,t),Et(Kn,n)}function kC(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(ee(108,ZI(e)||"Unknown",o));return Ut({},n,r)}function Wd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Di,xs=kn.current,Et(kn,e),Et(Kn,Kn.current),!0}function O1(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=kC(e,t,xs),r.__reactInternalMemoizedMergedChildContext=e,Dt(Kn),Dt(kn),Et(kn,e)):Dt(Kn),Et(Kn,n)}var To=null,qf=!1,Mp=!1;function RC(e){To===null?To=[e]:To.push(e)}function gN(e){qf=!0,RC(e)}function Ui(){if(!Mp&&To!==null){Mp=!0;var e=0,t=pt;try{var n=To;for(pt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}To=null,qf=!1}catch(o){throw To!==null&&(To=To.slice(e+1)),eC(Sv,Ui),o}finally{pt=t,Mp=!1}}return null}var Ta=[],Pa=0,qd=null,Gd=0,yr=[],xr=0,bs=null,ko=1,Ro="";function ts(e,t){Ta[Pa++]=Gd,Ta[Pa++]=qd,qd=e,Gd=t}function _C(e,t,n){yr[xr++]=ko,yr[xr++]=Ro,yr[xr++]=bs,bs=e;var r=ko;e=Ro;var o=32-Vr(r)-1;r&=~(1<<o),n+=1;var i=32-Vr(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,ko=1<<32-Vr(t)+o|n<<o|r,Ro=i+e}else ko=1<<i|n<<o|r,Ro=e}function Dv(e){e.return!==null&&(ts(e,1),_C(e,1,0))}function Iv(e){for(;e===qd;)qd=Ta[--Pa],Ta[Pa]=null,Gd=Ta[--Pa],Ta[Pa]=null;for(;e===bs;)bs=yr[--xr],yr[xr]=null,Ro=yr[--xr],yr[xr]=null,ko=yr[--xr],yr[xr]=null}var cr=null,ar=null,Ot=!1,zr=null;function DC(e,t){var n=br(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function L1(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,cr=e,ar=Ci(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,cr=e,ar=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=bs!==null?{id:ko,overflow:Ro}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=br(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,cr=e,ar=null,!0):!1;default:return!1}}function Gm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qm(e){if(Ot){var t=ar;if(t){var n=t;if(!L1(e,t)){if(Gm(e))throw Error(ee(418));t=Ci(n.nextSibling);var r=cr;t&&L1(e,t)?DC(r,n):(e.flags=e.flags&-4097|2,Ot=!1,cr=e)}}else{if(Gm(e))throw Error(ee(418));e.flags=e.flags&-4097|2,Ot=!1,cr=e}}}function $1(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;cr=e}function Ku(e){if(e!==cr)return!1;if(!Ot)return $1(e),Ot=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vm(e.type,e.memoizedProps)),t&&(t=ar)){if(Gm(e))throw IC(),Error(ee(418));for(;t;)DC(e,t),t=Ci(t.nextSibling)}if($1(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ar=Ci(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ar=null}}else ar=cr?Ci(e.stateNode.nextSibling):null;return!0}function IC(){for(var e=ar;e;)e=Ci(e.nextSibling)}function Ga(){ar=cr=null,Ot=!1}function Av(e){zr===null?zr=[e]:zr.push(e)}var vN=Ko.ReactCurrentBatchConfig;function Lr(e,t){if(e&&e.defaultProps){t=Ut({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Qd=zi(null),Kd=null,ka=null,Nv=null;function Mv(){Nv=ka=Kd=null}function Ov(e){var t=Qd.current;Dt(Qd),e._currentValue=t}function Km(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Fa(e,t){Kd=e,Nv=ka=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qn=!0),e.firstContext=null)}function Cr(e){var t=e._currentValue;if(Nv!==e)if(e={context:e,memoizedValue:t,next:null},ka===null){if(Kd===null)throw Error(ee(308));ka=e,Kd.dependencies={lanes:0,firstContext:e}}else ka=ka.next=e;return t}var ds=null;function Lv(e){ds===null?ds=[e]:ds.push(e)}function AC(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Lv(t)):(n.next=o.next,o.next=n),t.interleaved=n,$o(e,r)}function $o(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ci=!1;function $v(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function NC(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Do(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ei(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,tt&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,$o(e,n)}return o=r.interleaved,o===null?(t.next=t,Lv(r)):(t.next=o.next,o.next=t),r.interleaved=t,$o(e,n)}function xd(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jv(e,n)}}function F1(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Yd(e,t,n,r){var o=e.updateQueue;ci=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=o.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(h=t,m=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(m,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(m,f,h):g,h==null)break e;f=Ut({},f,h);break e;case 2:ci=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(d===null&&(c=f),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Ss|=a,e.lanes=a,e.memoizedState=f}}function z1(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(ee(191,o));o.call(r)}}}var MC=new Aj.Component().refs;function Ym(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ut({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gf={isMounted:function(e){return(e=e._reactInternals)?Fs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ln(),o=Pi(e),i=Do(r,o);i.payload=t,n!=null&&(i.callback=n),t=Ei(e,i,o),t!==null&&(Hr(t,e,o,r),xd(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ln(),o=Pi(e),i=Do(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ei(e,i,o),t!==null&&(Hr(t,e,o,r),xd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ln(),r=Pi(e),o=Do(n,r);o.tag=2,t!=null&&(o.callback=t),t=Ei(e,o,r),t!==null&&(Hr(t,e,r,n),xd(t,e,r))}};function U1(e,t,n,r,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!wc(n,r)||!wc(o,i):!0}function OC(e,t,n){var r=!1,o=Di,i=t.contextType;return typeof i=="object"&&i!==null?i=Cr(i):(o=Yn(t)?xs:kn.current,r=t.contextTypes,i=(r=r!=null)?qa(e,o):Di),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Gf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function B1(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gf.enqueueReplaceState(t,t.state,null)}function Xm(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=MC,$v(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Cr(i):(i=Yn(t)?xs:kn.current,o.context=qa(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ym(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Gf.enqueueReplaceState(o,o.state,null),Yd(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Fl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ee(309));var r=n.stateNode}if(!r)throw Error(ee(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=o.refs;l===MC&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(ee(284));if(!n._owner)throw Error(ee(290,e))}return e}function Yu(e,t){throw e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function V1(e){var t=e._init;return t(e._payload)}function LC(e){function t(x,w){if(e){var y=x.deletions;y===null?(x.deletions=[w],x.flags|=16):y.push(w)}}function n(x,w){if(!e)return null;for(;w!==null;)t(x,w),w=w.sibling;return null}function r(x,w){for(x=new Map;w!==null;)w.key!==null?x.set(w.key,w):x.set(w.index,w),w=w.sibling;return x}function o(x,w){return x=ki(x,w),x.index=0,x.sibling=null,x}function i(x,w,y){return x.index=y,e?(y=x.alternate,y!==null?(y=y.index,y<w?(x.flags|=2,w):y):(x.flags|=2,w)):(x.flags|=1048576,w)}function a(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,w,y,b){return w===null||w.tag!==6?(w=Bp(y,x.mode,b),w.return=x,w):(w=o(w,y),w.return=x,w)}function c(x,w,y,b){var C=y.type;return C===ba?d(x,w,y.props.children,b,y.key):w!==null&&(w.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===li&&V1(C)===w.type)?(b=o(w,y.props),b.ref=Fl(x,w,y),b.return=x,b):(b=Ed(y.type,y.key,y.props,null,x.mode,b),b.ref=Fl(x,w,y),b.return=x,b)}function u(x,w,y,b){return w===null||w.tag!==4||w.stateNode.containerInfo!==y.containerInfo||w.stateNode.implementation!==y.implementation?(w=Vp(y,x.mode,b),w.return=x,w):(w=o(w,y.children||[]),w.return=x,w)}function d(x,w,y,b,C){return w===null||w.tag!==7?(w=vs(y,x.mode,b,C),w.return=x,w):(w=o(w,y),w.return=x,w)}function f(x,w,y){if(typeof w=="string"&&w!==""||typeof w=="number")return w=Bp(""+w,x.mode,y),w.return=x,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Fu:return y=Ed(w.type,w.key,w.props,null,x.mode,y),y.ref=Fl(x,null,w),y.return=x,y;case xa:return w=Vp(w,x.mode,y),w.return=x,w;case li:var b=w._init;return f(x,b(w._payload),y)}if(Kl(w)||Nl(w))return w=vs(w,x.mode,y,null),w.return=x,w;Yu(x,w)}return null}function h(x,w,y,b){var C=w!==null?w.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return C!==null?null:l(x,w,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Fu:return y.key===C?c(x,w,y,b):null;case xa:return y.key===C?u(x,w,y,b):null;case li:return C=y._init,h(x,w,C(y._payload),b)}if(Kl(y)||Nl(y))return C!==null?null:d(x,w,y,b,null);Yu(x,y)}return null}function m(x,w,y,b,C){if(typeof b=="string"&&b!==""||typeof b=="number")return x=x.get(y)||null,l(w,x,""+b,C);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Fu:return x=x.get(b.key===null?y:b.key)||null,c(w,x,b,C);case xa:return x=x.get(b.key===null?y:b.key)||null,u(w,x,b,C);case li:var j=b._init;return m(x,w,y,j(b._payload),C)}if(Kl(b)||Nl(b))return x=x.get(y)||null,d(w,x,b,C,null);Yu(w,b)}return null}function g(x,w,y,b){for(var C=null,j=null,T=w,E=w=0,R=null;T!==null&&E<y.length;E++){T.index>E?(R=T,T=null):R=T.sibling;var _=h(x,T,y[E],b);if(_===null){T===null&&(T=R);break}e&&T&&_.alternate===null&&t(x,T),w=i(_,w,E),j===null?C=_:j.sibling=_,j=_,T=R}if(E===y.length)return n(x,T),Ot&&ts(x,E),C;if(T===null){for(;E<y.length;E++)T=f(x,y[E],b),T!==null&&(w=i(T,w,E),j===null?C=T:j.sibling=T,j=T);return Ot&&ts(x,E),C}for(T=r(x,T);E<y.length;E++)R=m(T,x,E,y[E],b),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?E:R.key),w=i(R,w,E),j===null?C=R:j.sibling=R,j=R);return e&&T.forEach(function(N){return t(x,N)}),Ot&&ts(x,E),C}function v(x,w,y,b){var C=Nl(y);if(typeof C!="function")throw Error(ee(150));if(y=C.call(y),y==null)throw Error(ee(151));for(var j=C=null,T=w,E=w=0,R=null,_=y.next();T!==null&&!_.done;E++,_=y.next()){T.index>E?(R=T,T=null):R=T.sibling;var N=h(x,T,_.value,b);if(N===null){T===null&&(T=R);break}e&&T&&N.alternate===null&&t(x,T),w=i(N,w,E),j===null?C=N:j.sibling=N,j=N,T=R}if(_.done)return n(x,T),Ot&&ts(x,E),C;if(T===null){for(;!_.done;E++,_=y.next())_=f(x,_.value,b),_!==null&&(w=i(_,w,E),j===null?C=_:j.sibling=_,j=_);return Ot&&ts(x,E),C}for(T=r(x,T);!_.done;E++,_=y.next())_=m(T,x,E,_.value,b),_!==null&&(e&&_.alternate!==null&&T.delete(_.key===null?E:_.key),w=i(_,w,E),j===null?C=_:j.sibling=_,j=_);return e&&T.forEach(function(O){return t(x,O)}),Ot&&ts(x,E),C}function S(x,w,y,b){if(typeof y=="object"&&y!==null&&y.type===ba&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Fu:e:{for(var C=y.key,j=w;j!==null;){if(j.key===C){if(C=y.type,C===ba){if(j.tag===7){n(x,j.sibling),w=o(j,y.props.children),w.return=x,x=w;break e}}else if(j.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===li&&V1(C)===j.type){n(x,j.sibling),w=o(j,y.props),w.ref=Fl(x,j,y),w.return=x,x=w;break e}n(x,j);break}else t(x,j);j=j.sibling}y.type===ba?(w=vs(y.props.children,x.mode,b,y.key),w.return=x,x=w):(b=Ed(y.type,y.key,y.props,null,x.mode,b),b.ref=Fl(x,w,y),b.return=x,x=b)}return a(x);case xa:e:{for(j=y.key;w!==null;){if(w.key===j)if(w.tag===4&&w.stateNode.containerInfo===y.containerInfo&&w.stateNode.implementation===y.implementation){n(x,w.sibling),w=o(w,y.children||[]),w.return=x,x=w;break e}else{n(x,w);break}else t(x,w);w=w.sibling}w=Vp(y,x.mode,b),w.return=x,x=w}return a(x);case li:return j=y._init,S(x,w,j(y._payload),b)}if(Kl(y))return g(x,w,y,b);if(Nl(y))return v(x,w,y,b);Yu(x,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,w!==null&&w.tag===6?(n(x,w.sibling),w=o(w,y),w.return=x,x=w):(n(x,w),w=Bp(y,x.mode,b),w.return=x,x=w),a(x)):n(x,w)}return S}var Qa=LC(!0),$C=LC(!1),Zc={},ho=zi(Zc),Ec=zi(Zc),Tc=zi(Zc);function fs(e){if(e===Zc)throw Error(ee(174));return e}function Fv(e,t){switch(Et(Tc,t),Et(Ec,e),Et(ho,Zc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rm(t,e)}Dt(ho),Et(ho,t)}function Ka(){Dt(ho),Dt(Ec),Dt(Tc)}function FC(e){fs(Tc.current);var t=fs(ho.current),n=Rm(t,e.type);t!==n&&(Et(Ec,e),Et(ho,n))}function zv(e){Ec.current===e&&(Dt(ho),Dt(Ec))}var $t=zi(0);function Xd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Op=[];function Uv(){for(var e=0;e<Op.length;e++)Op[e]._workInProgressVersionPrimary=null;Op.length=0}var bd=Ko.ReactCurrentDispatcher,Lp=Ko.ReactCurrentBatchConfig,ws=0,zt=null,sn=null,un=null,Jd=!1,sc=!1,Pc=0,yN=0;function jn(){throw Error(ee(321))}function Bv(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qr(e[n],t[n]))return!1;return!0}function Vv(e,t,n,r,o,i){if(ws=i,zt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bd.current=e===null||e.memoizedState===null?SN:jN,e=n(r,o),sc){i=0;do{if(sc=!1,Pc=0,25<=i)throw Error(ee(301));i+=1,un=sn=null,t.updateQueue=null,bd.current=CN,e=n(r,o)}while(sc)}if(bd.current=Zd,t=sn!==null&&sn.next!==null,ws=0,un=sn=zt=null,Jd=!1,t)throw Error(ee(300));return e}function Hv(){var e=Pc!==0;return Pc=0,e}function ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?zt.memoizedState=un=e:un=un.next=e,un}function Er(){if(sn===null){var e=zt.alternate;e=e!==null?e.memoizedState:null}else e=sn.next;var t=un===null?zt.memoizedState:un.next;if(t!==null)un=t,sn=e;else{if(e===null)throw Error(ee(310));sn=e,e={memoizedState:sn.memoizedState,baseState:sn.baseState,baseQueue:sn.baseQueue,queue:sn.queue,next:null},un===null?zt.memoizedState=un=e:un=un.next=e}return un}function kc(e,t){return typeof t=="function"?t(e):t}function $p(e){var t=Er(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=sn,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=a=null,c=null,u=i;do{var d=u.lane;if((ws&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,a=r):c=c.next=f,zt.lanes|=d,Ss|=d}u=u.next}while(u!==null&&u!==i);c===null?a=r:c.next=l,qr(r,t.memoizedState)||(Qn=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,zt.lanes|=i,Ss|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fp(e){var t=Er(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);qr(i,t.memoizedState)||(Qn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function zC(){}function UC(e,t){var n=zt,r=Er(),o=t(),i=!qr(r.memoizedState,o);if(i&&(r.memoizedState=o,Qn=!0),r=r.queue,Wv(HC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||un!==null&&un.memoizedState.tag&1){if(n.flags|=2048,Rc(9,VC.bind(null,n,r,o,t),void 0,null),pn===null)throw Error(ee(349));ws&30||BC(n,t,o)}return o}function BC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=zt.updateQueue,t===null?(t={lastEffect:null,stores:null},zt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function VC(e,t,n,r){t.value=n,t.getSnapshot=r,WC(t)&&qC(e)}function HC(e,t,n){return n(function(){WC(t)&&qC(e)})}function WC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qr(e,n)}catch{return!0}}function qC(e){var t=$o(e,1);t!==null&&Hr(t,e,1,-1)}function H1(e){var t=ao();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kc,lastRenderedState:e},t.queue=e,e=e.dispatch=wN.bind(null,zt,e),[t.memoizedState,e]}function Rc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=zt.updateQueue,t===null?(t={lastEffect:null,stores:null},zt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function GC(){return Er().memoizedState}function wd(e,t,n,r){var o=ao();zt.flags|=e,o.memoizedState=Rc(1|t,n,void 0,r===void 0?null:r)}function Qf(e,t,n,r){var o=Er();r=r===void 0?null:r;var i=void 0;if(sn!==null){var a=sn.memoizedState;if(i=a.destroy,r!==null&&Bv(r,a.deps)){o.memoizedState=Rc(t,n,i,r);return}}zt.flags|=e,o.memoizedState=Rc(1|t,n,i,r)}function W1(e,t){return wd(8390656,8,e,t)}function Wv(e,t){return Qf(2048,8,e,t)}function QC(e,t){return Qf(4,2,e,t)}function KC(e,t){return Qf(4,4,e,t)}function YC(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function XC(e,t,n){return n=n!=null?n.concat([e]):null,Qf(4,4,YC.bind(null,t,e),n)}function qv(){}function JC(e,t){var n=Er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ZC(e,t){var n=Er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function eE(e,t,n){return ws&21?(qr(n,t)||(n=rC(),zt.lanes|=n,Ss|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qn=!0),e.memoizedState=n)}function xN(e,t){var n=pt;pt=n!==0&&4>n?n:4,e(!0);var r=Lp.transition;Lp.transition={};try{e(!1),t()}finally{pt=n,Lp.transition=r}}function tE(){return Er().memoizedState}function bN(e,t,n){var r=Pi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},nE(e))rE(t,n);else if(n=AC(e,t,n,r),n!==null){var o=Ln();Hr(n,e,r,o),oE(n,t,r)}}function wN(e,t,n){var r=Pi(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(nE(e))rE(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(o.hasEagerState=!0,o.eagerState=l,qr(l,a)){var c=t.interleaved;c===null?(o.next=o,Lv(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=AC(e,t,o,r),n!==null&&(o=Ln(),Hr(n,e,r,o),oE(n,t,r))}}function nE(e){var t=e.alternate;return e===zt||t!==null&&t===zt}function rE(e,t){sc=Jd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oE(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jv(e,n)}}var Zd={readContext:Cr,useCallback:jn,useContext:jn,useEffect:jn,useImperativeHandle:jn,useInsertionEffect:jn,useLayoutEffect:jn,useMemo:jn,useReducer:jn,useRef:jn,useState:jn,useDebugValue:jn,useDeferredValue:jn,useTransition:jn,useMutableSource:jn,useSyncExternalStore:jn,useId:jn,unstable_isNewReconciler:!1},SN={readContext:Cr,useCallback:function(e,t){return ao().memoizedState=[e,t===void 0?null:t],e},useContext:Cr,useEffect:W1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wd(4194308,4,YC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wd(4194308,4,e,t)},useInsertionEffect:function(e,t){return wd(4,2,e,t)},useMemo:function(e,t){var n=ao();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ao();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=bN.bind(null,zt,e),[r.memoizedState,e]},useRef:function(e){var t=ao();return e={current:e},t.memoizedState=e},useState:H1,useDebugValue:qv,useDeferredValue:function(e){return ao().memoizedState=e},useTransition:function(){var e=H1(!1),t=e[0];return e=xN.bind(null,e[1]),ao().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=zt,o=ao();if(Ot){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),pn===null)throw Error(ee(349));ws&30||BC(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,W1(HC.bind(null,r,i,e),[e]),r.flags|=2048,Rc(9,VC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ao(),t=pn.identifierPrefix;if(Ot){var n=Ro,r=ko;n=(r&~(1<<32-Vr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Pc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=yN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},jN={readContext:Cr,useCallback:JC,useContext:Cr,useEffect:Wv,useImperativeHandle:XC,useInsertionEffect:QC,useLayoutEffect:KC,useMemo:ZC,useReducer:$p,useRef:GC,useState:function(){return $p(kc)},useDebugValue:qv,useDeferredValue:function(e){var t=Er();return eE(t,sn.memoizedState,e)},useTransition:function(){var e=$p(kc)[0],t=Er().memoizedState;return[e,t]},useMutableSource:zC,useSyncExternalStore:UC,useId:tE,unstable_isNewReconciler:!1},CN={readContext:Cr,useCallback:JC,useContext:Cr,useEffect:Wv,useImperativeHandle:XC,useInsertionEffect:QC,useLayoutEffect:KC,useMemo:ZC,useReducer:Fp,useRef:GC,useState:function(){return Fp(kc)},useDebugValue:qv,useDeferredValue:function(e){var t=Er();return sn===null?t.memoizedState=e:eE(t,sn.memoizedState,e)},useTransition:function(){var e=Fp(kc)[0],t=Er().memoizedState;return[e,t]},useMutableSource:zC,useSyncExternalStore:UC,useId:tE,unstable_isNewReconciler:!1};function Ya(e,t){try{var n="",r=t;do n+=JI(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
82
|
+
Error generating stack: `+i.message+`
|
|
83
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function zp(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Jm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var EN=typeof WeakMap=="function"?WeakMap:Map;function iE(e,t,n){n=Do(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){tf||(tf=!0,lg=r),Jm(e,t)},n}function sE(e,t,n){n=Do(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Jm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Jm(e,t),typeof r!="function"&&(Ti===null?Ti=new Set([this]):Ti.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function q1(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new EN;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=FN.bind(null,e,t,n),t.then(e,e))}function G1(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Q1(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Do(-1,1),t.tag=2,Ei(n,t,1))),n.lanes|=1),e)}var TN=Ko.ReactCurrentOwner,Qn=!1;function An(e,t,n,r){t.child=e===null?$C(t,null,n,r):Qa(t,e.child,n,r)}function K1(e,t,n,r,o){n=n.render;var i=t.ref;return Fa(t,o),r=Vv(e,t,n,r,i,o),n=Hv(),e!==null&&!Qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Fo(e,t,o)):(Ot&&n&&Dv(t),t.flags|=1,An(e,t,r,o),t.child)}function Y1(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!ey(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,aE(e,t,i,r,o)):(e=Ed(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:wc,n(a,r)&&e.ref===t.ref)return Fo(e,t,o)}return t.flags|=1,e=ki(i,r),e.ref=t.ref,e.return=t,t.child=e}function aE(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(wc(i,r)&&e.ref===t.ref)if(Qn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Qn=!0);else return t.lanes=e.lanes,Fo(e,t,o)}return Zm(e,t,n,r,o)}function lE(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Et(_a,ir),ir|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Et(_a,ir),ir|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Et(_a,ir),ir|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Et(_a,ir),ir|=r;return An(e,t,o,n),t.child}function cE(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Zm(e,t,n,r,o){var i=Yn(n)?xs:kn.current;return i=qa(t,i),Fa(t,o),n=Vv(e,t,n,r,i,o),r=Hv(),e!==null&&!Qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Fo(e,t,o)):(Ot&&r&&Dv(t),t.flags|=1,An(e,t,n,o),t.child)}function X1(e,t,n,r,o){if(Yn(n)){var i=!0;Wd(t)}else i=!1;if(Fa(t,o),t.stateNode===null)Sd(e,t),OC(t,n,r),Xm(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Cr(u):(u=Yn(n)?xs:kn.current,u=qa(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==u)&&B1(t,a,r,u),ci=!1;var h=t.memoizedState;a.state=h,Yd(t,r,a,o),c=t.memoizedState,l!==r||h!==c||Kn.current||ci?(typeof d=="function"&&(Ym(t,n,d,r),c=t.memoizedState),(l=ci||U1(t,n,l,r,h,c,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,NC(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Lr(t.type,l),a.props=u,f=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Cr(c):(c=Yn(n)?xs:kn.current,c=qa(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||h!==c)&&B1(t,a,r,c),ci=!1,h=t.memoizedState,a.state=h,Yd(t,r,a,o);var g=t.memoizedState;l!==f||h!==g||Kn.current||ci?(typeof m=="function"&&(Ym(t,n,m,r),g=t.memoizedState),(u=ci||U1(t,n,u,r,h,g,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,g,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,g,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return eg(e,t,n,r,i,o)}function eg(e,t,n,r,o,i){cE(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&O1(t,n,!1),Fo(e,t,i);r=t.stateNode,TN.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Qa(t,e.child,null,i),t.child=Qa(t,null,l,i)):An(e,t,l,i),t.memoizedState=r.state,o&&O1(t,n,!0),t.child}function uE(e){var t=e.stateNode;t.pendingContext?M1(e,t.pendingContext,t.pendingContext!==t.context):t.context&&M1(e,t.context,!1),Fv(e,t.containerInfo)}function J1(e,t,n,r,o){return Ga(),Av(o),t.flags|=256,An(e,t,n,r),t.child}var tg={dehydrated:null,treeContext:null,retryLane:0};function ng(e){return{baseLanes:e,cachePool:null,transitions:null}}function dE(e,t,n){var r=t.pendingProps,o=$t.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Et($t,o&1),e===null)return Qm(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Xf(a,r,0,null),e=vs(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ng(n),t.memoizedState=tg,e):Gv(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return PN(e,t,a,r,l,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=ki(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=ki(l,i):(i=vs(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?ng(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=tg,r}return i=e.child,e=i.sibling,r=ki(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Gv(e,t){return t=Xf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xu(e,t,n,r){return r!==null&&Av(r),Qa(t,e.child,null,n),e=Gv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function PN(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=zp(Error(ee(422))),Xu(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Xf({mode:"visible",children:r.children},o,0,null),i=vs(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Qa(t,e.child,null,a),t.child.memoizedState=ng(a),t.memoizedState=tg,i);if(!(t.mode&1))return Xu(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(ee(419)),r=zp(i,r,void 0),Xu(e,t,a,r)}if(l=(a&e.childLanes)!==0,Qn||l){if(r=pn,r!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,$o(e,o),Hr(r,e,o,-1))}return Zv(),r=zp(Error(ee(421))),Xu(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=zN.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ar=Ci(o.nextSibling),cr=t,Ot=!0,zr=null,e!==null&&(yr[xr++]=ko,yr[xr++]=Ro,yr[xr++]=bs,ko=e.id,Ro=e.overflow,bs=t),t=Gv(t,r.children),t.flags|=4096,t)}function Z1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Km(e.return,t,n)}function Up(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function fE(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(An(e,t,r.children,n),r=$t.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Z1(e,n,t);else if(e.tag===19)Z1(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Et($t,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Xd(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Up(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Xd(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Up(t,!0,n,null,i);break;case"together":Up(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Sd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Fo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ss|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kN(e,t,n){switch(t.tag){case 3:uE(t),Ga();break;case 5:FC(t);break;case 1:Yn(t.type)&&Wd(t);break;case 4:Fv(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Et(Qd,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Et($t,$t.current&1),t.flags|=128,null):n&t.child.childLanes?dE(e,t,n):(Et($t,$t.current&1),e=Fo(e,t,n),e!==null?e.sibling:null);Et($t,$t.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return fE(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Et($t,$t.current),r)break;return null;case 22:case 23:return t.lanes=0,lE(e,t,n)}return Fo(e,t,n)}var hE,rg,pE,mE;hE=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};rg=function(){};pE=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,fs(ho.current);var i=null;switch(n){case"input":o=Em(e,o),r=Em(e,r),i=[];break;case"select":o=Ut({},o,{value:void 0}),r=Ut({},r,{value:void 0}),i=[];break;case"textarea":o=km(e,o),r=km(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Vd)}_m(n,r);var a;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(pc.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(pc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&kt("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};mE=function(e,t,n,r){n!==r&&(t.flags|=4)};function zl(e,t){if(!Ot)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Cn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function RN(e,t,n){var r=t.pendingProps;switch(Iv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cn(t),null;case 1:return Yn(t.type)&&Hd(),Cn(t),null;case 3:return r=t.stateNode,Ka(),Dt(Kn),Dt(kn),Uv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ku(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zr!==null&&(dg(zr),zr=null))),rg(e,t),Cn(t),null;case 5:zv(t);var o=fs(Tc.current);if(n=t.type,e!==null&&t.stateNode!=null)pE(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return Cn(t),null}if(e=fs(ho.current),Ku(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[uo]=t,r[Cc]=i,e=(t.mode&1)!==0,n){case"dialog":kt("cancel",r),kt("close",r);break;case"iframe":case"object":case"embed":kt("load",r);break;case"video":case"audio":for(o=0;o<Xl.length;o++)kt(Xl[o],r);break;case"source":kt("error",r);break;case"img":case"image":case"link":kt("error",r),kt("load",r);break;case"details":kt("toggle",r);break;case"input":l1(r,i),kt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},kt("invalid",r);break;case"textarea":u1(r,i),kt("invalid",r)}_m(n,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Qu(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Qu(r.textContent,l,e),o=["children",""+l]):pc.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&kt("scroll",r)}switch(n){case"input":zu(r),c1(r,i,!0);break;case"textarea":zu(r),d1(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Vd)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Bj(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[uo]=t,e[Cc]=r,hE(e,t,!1,!1),t.stateNode=e;e:{switch(a=Dm(n,r),n){case"dialog":kt("cancel",e),kt("close",e),o=r;break;case"iframe":case"object":case"embed":kt("load",e),o=r;break;case"video":case"audio":for(o=0;o<Xl.length;o++)kt(Xl[o],e);o=r;break;case"source":kt("error",e),o=r;break;case"img":case"image":case"link":kt("error",e),kt("load",e),o=r;break;case"details":kt("toggle",e),o=r;break;case"input":l1(e,r),o=Em(e,r),kt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ut({},r,{value:void 0}),kt("invalid",e);break;case"textarea":u1(e,r),o=km(e,r),kt("invalid",e);break;default:o=r}_m(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Wj(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Vj(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&mc(e,c):typeof c=="number"&&mc(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(pc.hasOwnProperty(i)?c!=null&&i==="onScroll"&&kt("scroll",e):c!=null&&vv(e,i,c,a))}switch(n){case"input":zu(e),c1(e,r,!1);break;case"textarea":zu(e),d1(e);break;case"option":r.value!=null&&e.setAttribute("value",""+_i(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Ma(e,!!r.multiple,i,!1):r.defaultValue!=null&&Ma(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Vd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Cn(t),null;case 6:if(e&&t.stateNode!=null)mE(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ee(166));if(n=fs(Tc.current),fs(ho.current),Ku(t)){if(r=t.stateNode,n=t.memoizedProps,r[uo]=t,(i=r.nodeValue!==n)&&(e=cr,e!==null))switch(e.tag){case 3:Qu(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Qu(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[uo]=t,t.stateNode=r}return Cn(t),null;case 13:if(Dt($t),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ot&&ar!==null&&t.mode&1&&!(t.flags&128))IC(),Ga(),t.flags|=98560,i=!1;else if(i=Ku(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(ee(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ee(317));i[uo]=t}else Ga(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cn(t),i=!1}else zr!==null&&(dg(zr),zr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||$t.current&1?an===0&&(an=3):Zv())),t.updateQueue!==null&&(t.flags|=4),Cn(t),null);case 4:return Ka(),rg(e,t),e===null&&Sc(t.stateNode.containerInfo),Cn(t),null;case 10:return Ov(t.type._context),Cn(t),null;case 17:return Yn(t.type)&&Hd(),Cn(t),null;case 19:if(Dt($t),i=t.memoizedState,i===null)return Cn(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)zl(i,!1);else{if(an!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Xd(e),a!==null){for(t.flags|=128,zl(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Et($t,$t.current&1|2),t.child}e=e.sibling}i.tail!==null&&Kt()>Xa&&(t.flags|=128,r=!0,zl(i,!1),t.lanes=4194304)}else{if(!r)if(e=Xd(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Ot)return Cn(t),null}else 2*Kt()-i.renderingStartTime>Xa&&n!==1073741824&&(t.flags|=128,r=!0,zl(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Kt(),t.sibling=null,n=$t.current,Et($t,r?n&1|2:n&1),t):(Cn(t),null);case 22:case 23:return Jv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ir&1073741824&&(Cn(t),t.subtreeFlags&6&&(t.flags|=8192)):Cn(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function _N(e,t){switch(Iv(t),t.tag){case 1:return Yn(t.type)&&Hd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ka(),Dt(Kn),Dt(kn),Uv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return zv(t),null;case 13:if(Dt($t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));Ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Dt($t),null;case 4:return Ka(),null;case 10:return Ov(t.type._context),null;case 22:case 23:return Jv(),null;case 24:return null;default:return null}}var Ju=!1,En=!1,DN=typeof WeakSet=="function"?WeakSet:Set,we=null;function Ra(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Wt(e,t,r)}else n.current=null}function og(e,t,n){try{n()}catch(r){Wt(e,t,r)}}var eb=!1;function IN(e,t){if(Um=zd,e=xC(),_v(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||o!==0&&f.nodeType!==3||(l=a+o),f!==i||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===o&&(l=a),h===i&&++d===r&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bm={focusedElem:e,selectionRange:n},zd=!1,we=t;we!==null;)if(t=we,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,we=e;else for(;we!==null;){t=we;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,S=g.memoizedState,x=t.stateNode,w=x.getSnapshotBeforeUpdate(t.elementType===t.type?v:Lr(t.type,v),S);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(b){Wt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,we=e;break}we=t.return}return g=eb,eb=!1,g}function ac(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&og(t,n,i)}o=o.next}while(o!==r)}}function Kf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ig(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function gE(e){var t=e.alternate;t!==null&&(e.alternate=null,gE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[uo],delete t[Cc],delete t[Wm],delete t[pN],delete t[mN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function vE(e){return e.tag===5||e.tag===3||e.tag===4}function tb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function sg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vd));else if(r!==4&&(e=e.child,e!==null))for(sg(e,t,n),e=e.sibling;e!==null;)sg(e,t,n),e=e.sibling}function ag(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ag(e,t,n),e=e.sibling;e!==null;)ag(e,t,n),e=e.sibling}var gn=null,$r=!1;function si(e,t,n){for(n=n.child;n!==null;)yE(e,t,n),n=n.sibling}function yE(e,t,n){if(fo&&typeof fo.onCommitFiberUnmount=="function")try{fo.onCommitFiberUnmount(Uf,n)}catch{}switch(n.tag){case 5:En||Ra(n,t);case 6:var r=gn,o=$r;gn=null,si(e,t,n),gn=r,$r=o,gn!==null&&($r?(e=gn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):gn.removeChild(n.stateNode));break;case 18:gn!==null&&($r?(e=gn,n=n.stateNode,e.nodeType===8?Np(e.parentNode,n):e.nodeType===1&&Np(e,n),xc(e)):Np(gn,n.stateNode));break;case 4:r=gn,o=$r,gn=n.stateNode.containerInfo,$r=!0,si(e,t,n),gn=r,$r=o;break;case 0:case 11:case 14:case 15:if(!En&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&og(n,t,a),o=o.next}while(o!==r)}si(e,t,n);break;case 1:if(!En&&(Ra(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Wt(n,t,l)}si(e,t,n);break;case 21:si(e,t,n);break;case 22:n.mode&1?(En=(r=En)||n.memoizedState!==null,si(e,t,n),En=r):si(e,t,n);break;default:si(e,t,n)}}function nb(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new DN),t.forEach(function(r){var o=UN.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Nr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:gn=l.stateNode,$r=!1;break e;case 3:gn=l.stateNode.containerInfo,$r=!0;break e;case 4:gn=l.stateNode.containerInfo,$r=!0;break e}l=l.return}if(gn===null)throw Error(ee(160));yE(i,a,o),gn=null,$r=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){Wt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)xE(t,e),t=t.sibling}function xE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nr(t,e),ro(e),r&4){try{ac(3,e,e.return),Kf(3,e)}catch(v){Wt(e,e.return,v)}try{ac(5,e,e.return)}catch(v){Wt(e,e.return,v)}}break;case 1:Nr(t,e),ro(e),r&512&&n!==null&&Ra(n,n.return);break;case 5:if(Nr(t,e),ro(e),r&512&&n!==null&&Ra(n,n.return),e.flags&32){var o=e.stateNode;try{mc(o,"")}catch(v){Wt(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&zj(o,i),Dm(l,a);var u=Dm(l,i);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?Wj(o,f):d==="dangerouslySetInnerHTML"?Vj(o,f):d==="children"?mc(o,f):vv(o,d,f,u)}switch(l){case"input":Tm(o,i);break;case"textarea":Uj(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Ma(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?Ma(o,!!i.multiple,i.defaultValue,!0):Ma(o,!!i.multiple,i.multiple?[]:"",!1))}o[Cc]=i}catch(v){Wt(e,e.return,v)}}break;case 6:if(Nr(t,e),ro(e),r&4){if(e.stateNode===null)throw Error(ee(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Wt(e,e.return,v)}}break;case 3:if(Nr(t,e),ro(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{xc(t.containerInfo)}catch(v){Wt(e,e.return,v)}break;case 4:Nr(t,e),ro(e);break;case 13:Nr(t,e),ro(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Yv=Kt())),r&4&&nb(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(En=(u=En)||d,Nr(t,e),En=u):Nr(t,e),ro(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(we=e,d=e.child;d!==null;){for(f=we=d;we!==null;){switch(h=we,m=h.child,h.tag){case 0:case 11:case 14:case 15:ac(4,h,h.return);break;case 1:Ra(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){Wt(r,n,v)}}break;case 5:Ra(h,h.return);break;case 22:if(h.memoizedState!==null){ob(f);continue}}m!==null?(m.return=h,we=m):ob(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{o=f.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Hj("display",a))}catch(v){Wt(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){Wt(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Nr(t,e),ro(e),r&4&&nb(e);break;case 21:break;default:Nr(t,e),ro(e)}}function ro(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(vE(n)){var r=n;break e}n=n.return}throw Error(ee(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(mc(o,""),r.flags&=-33);var i=tb(e);ag(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,l=tb(e);sg(e,l,a);break;default:throw Error(ee(161))}}catch(c){Wt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function AN(e,t,n){we=e,bE(e)}function bE(e,t,n){for(var r=(e.mode&1)!==0;we!==null;){var o=we,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||Ju;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||En;l=Ju;var u=En;if(Ju=a,(En=c)&&!u)for(we=o;we!==null;)a=we,c=a.child,a.tag===22&&a.memoizedState!==null?ib(o):c!==null?(c.return=a,we=c):ib(o);for(;i!==null;)we=i,bE(i),i=i.sibling;we=o,Ju=l,En=u}rb(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,we=i):rb(e)}}function rb(e){for(;we!==null;){var t=we;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:En||Kf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!En)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Lr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&z1(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}z1(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&xc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ee(163))}En||t.flags&512&&ig(t)}catch(h){Wt(t,t.return,h)}}if(t===e){we=null;break}if(n=t.sibling,n!==null){n.return=t.return,we=n;break}we=t.return}}function ob(e){for(;we!==null;){var t=we;if(t===e){we=null;break}var n=t.sibling;if(n!==null){n.return=t.return,we=n;break}we=t.return}}function ib(e){for(;we!==null;){var t=we;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Kf(4,t)}catch(c){Wt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){Wt(t,o,c)}}var i=t.return;try{ig(t)}catch(c){Wt(t,i,c)}break;case 5:var a=t.return;try{ig(t)}catch(c){Wt(t,a,c)}}}catch(c){Wt(t,t.return,c)}if(t===e){we=null;break}var l=t.sibling;if(l!==null){l.return=t.return,we=l;break}we=t.return}}var NN=Math.ceil,ef=Ko.ReactCurrentDispatcher,Qv=Ko.ReactCurrentOwner,wr=Ko.ReactCurrentBatchConfig,tt=0,pn=null,Jt=null,yn=0,ir=0,_a=zi(0),an=0,_c=null,Ss=0,Yf=0,Kv=0,lc=null,qn=null,Yv=0,Xa=1/0,Eo=null,tf=!1,lg=null,Ti=null,Zu=!1,xi=null,nf=0,cc=0,cg=null,jd=-1,Cd=0;function Ln(){return tt&6?Kt():jd!==-1?jd:jd=Kt()}function Pi(e){return e.mode&1?tt&2&&yn!==0?yn&-yn:vN.transition!==null?(Cd===0&&(Cd=rC()),Cd):(e=pt,e!==0||(e=window.event,e=e===void 0?16:uC(e.type)),e):1}function Hr(e,t,n,r){if(50<cc)throw cc=0,cg=null,Error(ee(185));Yc(e,n,r),(!(tt&2)||e!==pn)&&(e===pn&&(!(tt&2)&&(Yf|=n),an===4&&mi(e,yn)),Xn(e,r),n===1&&tt===0&&!(t.mode&1)&&(Xa=Kt()+500,qf&&Ui()))}function Xn(e,t){var n=e.callbackNode;vA(e,t);var r=Fd(e,e===pn?yn:0);if(r===0)n!==null&&p1(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&p1(n),t===1)e.tag===0?gN(sb.bind(null,e)):RC(sb.bind(null,e)),fN(function(){!(tt&6)&&Ui()}),n=null;else{switch(oC(r)){case 1:n=Sv;break;case 4:n=tC;break;case 16:n=$d;break;case 536870912:n=nC;break;default:n=$d}n=kE(n,wE.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function wE(e,t){if(jd=-1,Cd=0,tt&6)throw Error(ee(327));var n=e.callbackNode;if(za()&&e.callbackNode!==n)return null;var r=Fd(e,e===pn?yn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=rf(e,r);else{t=r;var o=tt;tt|=2;var i=jE();(pn!==e||yn!==t)&&(Eo=null,Xa=Kt()+500,gs(e,t));do try{LN();break}catch(l){SE(e,l)}while(!0);Mv(),ef.current=i,tt=o,Jt!==null?t=0:(pn=null,yn=0,t=an)}if(t!==0){if(t===2&&(o=Om(e),o!==0&&(r=o,t=ug(e,o))),t===1)throw n=_c,gs(e,0),mi(e,r),Xn(e,Kt()),n;if(t===6)mi(e,r);else{if(o=e.current.alternate,!(r&30)&&!MN(o)&&(t=rf(e,r),t===2&&(i=Om(e),i!==0&&(r=i,t=ug(e,i))),t===1))throw n=_c,gs(e,0),mi(e,r),Xn(e,Kt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(ee(345));case 2:ns(e,qn,Eo);break;case 3:if(mi(e,r),(r&130023424)===r&&(t=Yv+500-Kt(),10<t)){if(Fd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ln(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Hm(ns.bind(null,e,qn,Eo),t);break}ns(e,qn,Eo);break;case 4:if(mi(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-Vr(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Kt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*NN(r/1960))-r,10<r){e.timeoutHandle=Hm(ns.bind(null,e,qn,Eo),r);break}ns(e,qn,Eo);break;case 5:ns(e,qn,Eo);break;default:throw Error(ee(329))}}}return Xn(e,Kt()),e.callbackNode===n?wE.bind(null,e):null}function ug(e,t){var n=lc;return e.current.memoizedState.isDehydrated&&(gs(e,t).flags|=256),e=rf(e,t),e!==2&&(t=qn,qn=n,t!==null&&dg(t)),e}function dg(e){qn===null?qn=e:qn.push.apply(qn,e)}function MN(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!qr(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function mi(e,t){for(t&=~Kv,t&=~Yf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Vr(t),r=1<<n;e[n]=-1,t&=~r}}function sb(e){if(tt&6)throw Error(ee(327));za();var t=Fd(e,0);if(!(t&1))return Xn(e,Kt()),null;var n=rf(e,t);if(e.tag!==0&&n===2){var r=Om(e);r!==0&&(t=r,n=ug(e,r))}if(n===1)throw n=_c,gs(e,0),mi(e,t),Xn(e,Kt()),n;if(n===6)throw Error(ee(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ns(e,qn,Eo),Xn(e,Kt()),null}function Xv(e,t){var n=tt;tt|=1;try{return e(t)}finally{tt=n,tt===0&&(Xa=Kt()+500,qf&&Ui())}}function js(e){xi!==null&&xi.tag===0&&!(tt&6)&&za();var t=tt;tt|=1;var n=wr.transition,r=pt;try{if(wr.transition=null,pt=1,e)return e()}finally{pt=r,wr.transition=n,tt=t,!(tt&6)&&Ui()}}function Jv(){ir=_a.current,Dt(_a)}function gs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,dN(n)),Jt!==null)for(n=Jt.return;n!==null;){var r=n;switch(Iv(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Hd();break;case 3:Ka(),Dt(Kn),Dt(kn),Uv();break;case 5:zv(r);break;case 4:Ka();break;case 13:Dt($t);break;case 19:Dt($t);break;case 10:Ov(r.type._context);break;case 22:case 23:Jv()}n=n.return}if(pn=e,Jt=e=ki(e.current,null),yn=ir=t,an=0,_c=null,Kv=Yf=Ss=0,qn=lc=null,ds!==null){for(t=0;t<ds.length;t++)if(n=ds[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=o,r.next=a}n.pending=r}ds=null}return e}function SE(e,t){do{var n=Jt;try{if(Mv(),bd.current=Zd,Jd){for(var r=zt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Jd=!1}if(ws=0,un=sn=zt=null,sc=!1,Pc=0,Qv.current=null,n===null||n.return===null){an=1,_c=t,Jt=null;break}e:{var i=e,a=n.return,l=n,c=t;if(t=yn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=G1(a);if(m!==null){m.flags&=-257,Q1(m,a,l,i,t),m.mode&1&&q1(i,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){q1(i,u,t),Zv();break e}c=Error(ee(426))}}else if(Ot&&l.mode&1){var S=G1(a);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Q1(S,a,l,i,t),Av(Ya(c,l));break e}}i=c=Ya(c,l),an!==4&&(an=2),lc===null?lc=[i]:lc.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=iE(i,c,t);F1(i,x);break e;case 1:l=c;var w=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ti===null||!Ti.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=sE(i,l,t);F1(i,b);break e}}i=i.return}while(i!==null)}EE(n)}catch(C){t=C,Jt===n&&n!==null&&(Jt=n=n.return);continue}break}while(!0)}function jE(){var e=ef.current;return ef.current=Zd,e===null?Zd:e}function Zv(){(an===0||an===3||an===2)&&(an=4),pn===null||!(Ss&268435455)&&!(Yf&268435455)||mi(pn,yn)}function rf(e,t){var n=tt;tt|=2;var r=jE();(pn!==e||yn!==t)&&(Eo=null,gs(e,t));do try{ON();break}catch(o){SE(e,o)}while(!0);if(Mv(),tt=n,ef.current=r,Jt!==null)throw Error(ee(261));return pn=null,yn=0,an}function ON(){for(;Jt!==null;)CE(Jt)}function LN(){for(;Jt!==null&&!lA();)CE(Jt)}function CE(e){var t=PE(e.alternate,e,ir);e.memoizedProps=e.pendingProps,t===null?EE(e):Jt=t,Qv.current=null}function EE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=_N(n,t),n!==null){n.flags&=32767,Jt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{an=6,Jt=null;return}}else if(n=RN(n,t,ir),n!==null){Jt=n;return}if(t=t.sibling,t!==null){Jt=t;return}Jt=t=e}while(t!==null);an===0&&(an=5)}function ns(e,t,n){var r=pt,o=wr.transition;try{wr.transition=null,pt=1,$N(e,t,n,r)}finally{wr.transition=o,pt=r}return null}function $N(e,t,n,r){do za();while(xi!==null);if(tt&6)throw Error(ee(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ee(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(yA(e,i),e===pn&&(Jt=pn=null,yn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Zu||(Zu=!0,kE($d,function(){return za(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=wr.transition,wr.transition=null;var a=pt;pt=1;var l=tt;tt|=4,Qv.current=null,IN(e,n),xE(n,e),oN(Bm),zd=!!Um,Bm=Um=null,e.current=n,AN(n),cA(),tt=l,pt=a,wr.transition=i}else e.current=n;if(Zu&&(Zu=!1,xi=e,nf=o),i=e.pendingLanes,i===0&&(Ti=null),fA(n.stateNode),Xn(e,Kt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(tf)throw tf=!1,e=lg,lg=null,e;return nf&1&&e.tag!==0&&za(),i=e.pendingLanes,i&1?e===cg?cc++:(cc=0,cg=e):cc=0,Ui(),null}function za(){if(xi!==null){var e=oC(nf),t=wr.transition,n=pt;try{if(wr.transition=null,pt=16>e?16:e,xi===null)var r=!1;else{if(e=xi,xi=null,nf=0,tt&6)throw Error(ee(331));var o=tt;for(tt|=4,we=e.current;we!==null;){var i=we,a=i.child;if(we.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(we=u;we!==null;){var d=we;switch(d.tag){case 0:case 11:case 15:ac(8,d,i)}var f=d.child;if(f!==null)f.return=d,we=f;else for(;we!==null;){d=we;var h=d.sibling,m=d.return;if(gE(d),d===u){we=null;break}if(h!==null){h.return=m,we=h;break}we=m}}}var g=i.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var S=v.sibling;v.sibling=null,v=S}while(v!==null)}}we=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,we=a;else e:for(;we!==null;){if(i=we,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ac(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,we=x;break e}we=i.return}}var w=e.current;for(we=w;we!==null;){a=we;var y=a.child;if(a.subtreeFlags&2064&&y!==null)y.return=a,we=y;else e:for(a=w;we!==null;){if(l=we,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Kf(9,l)}}catch(C){Wt(l,l.return,C)}if(l===a){we=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,we=b;break e}we=l.return}}if(tt=o,Ui(),fo&&typeof fo.onPostCommitFiberRoot=="function")try{fo.onPostCommitFiberRoot(Uf,e)}catch{}r=!0}return r}finally{pt=n,wr.transition=t}}return!1}function ab(e,t,n){t=Ya(n,t),t=iE(e,t,1),e=Ei(e,t,1),t=Ln(),e!==null&&(Yc(e,1,t),Xn(e,t))}function Wt(e,t,n){if(e.tag===3)ab(e,e,n);else for(;t!==null;){if(t.tag===3){ab(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ti===null||!Ti.has(r))){e=Ya(n,e),e=sE(t,e,1),t=Ei(t,e,1),e=Ln(),t!==null&&(Yc(t,1,e),Xn(t,e));break}}t=t.return}}function FN(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ln(),e.pingedLanes|=e.suspendedLanes&n,pn===e&&(yn&n)===n&&(an===4||an===3&&(yn&130023424)===yn&&500>Kt()-Yv?gs(e,0):Kv|=n),Xn(e,t)}function TE(e,t){t===0&&(e.mode&1?(t=Vu,Vu<<=1,!(Vu&130023424)&&(Vu=4194304)):t=1);var n=Ln();e=$o(e,t),e!==null&&(Yc(e,t,n),Xn(e,n))}function zN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),TE(e,n)}function UN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ee(314))}r!==null&&r.delete(t),TE(e,n)}var PE;PE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Kn.current)Qn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qn=!1,kN(e,t,n);Qn=!!(e.flags&131072)}else Qn=!1,Ot&&t.flags&1048576&&_C(t,Gd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Sd(e,t),e=t.pendingProps;var o=qa(t,kn.current);Fa(t,n),o=Vv(null,t,r,e,o,n);var i=Hv();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yn(r)?(i=!0,Wd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,$v(t),o.updater=Gf,t.stateNode=o,o._reactInternals=t,Xm(t,r,e,n),t=eg(null,t,r,!0,i,n)):(t.tag=0,Ot&&i&&Dv(t),An(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Sd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=VN(r),e=Lr(r,e),o){case 0:t=Zm(null,t,r,e,n);break e;case 1:t=X1(null,t,r,e,n);break e;case 11:t=K1(null,t,r,e,n);break e;case 14:t=Y1(null,t,r,Lr(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lr(r,o),Zm(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lr(r,o),X1(e,t,r,o,n);case 3:e:{if(uE(t),e===null)throw Error(ee(387));r=t.pendingProps,i=t.memoizedState,o=i.element,NC(e,t),Yd(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ya(Error(ee(423)),t),t=J1(e,t,r,n,o);break e}else if(r!==o){o=Ya(Error(ee(424)),t),t=J1(e,t,r,n,o);break e}else for(ar=Ci(t.stateNode.containerInfo.firstChild),cr=t,Ot=!0,zr=null,n=$C(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ga(),r===o){t=Fo(e,t,n);break e}An(e,t,r,n)}t=t.child}return t;case 5:return FC(t),e===null&&Qm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Vm(r,o)?a=null:i!==null&&Vm(r,i)&&(t.flags|=32),cE(e,t),An(e,t,a,n),t.child;case 6:return e===null&&Qm(t),null;case 13:return dE(e,t,n);case 4:return Fv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qa(t,null,r,n):An(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lr(r,o),K1(e,t,r,o,n);case 7:return An(e,t,t.pendingProps,n),t.child;case 8:return An(e,t,t.pendingProps.children,n),t.child;case 12:return An(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Et(Qd,r._currentValue),r._currentValue=a,i!==null)if(qr(i.value,a)){if(i.children===o.children&&!Kn.current){t=Fo(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Do(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Km(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(ee(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Km(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}An(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Fa(t,n),o=Cr(o),r=r(o),t.flags|=1,An(e,t,r,n),t.child;case 14:return r=t.type,o=Lr(r,t.pendingProps),o=Lr(r.type,o),Y1(e,t,r,o,n);case 15:return aE(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lr(r,o),Sd(e,t),t.tag=1,Yn(r)?(e=!0,Wd(t)):e=!1,Fa(t,n),OC(t,r,o),Xm(t,r,o,n),eg(null,t,r,!0,e,n);case 19:return fE(e,t,n);case 22:return lE(e,t,n)}throw Error(ee(156,t.tag))};function kE(e,t){return eC(e,t)}function BN(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function br(e,t,n,r){return new BN(e,t,n,r)}function ey(e){return e=e.prototype,!(!e||!e.isReactComponent)}function VN(e){if(typeof e=="function")return ey(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xv)return 11;if(e===bv)return 14}return 2}function ki(e,t){var n=e.alternate;return n===null?(n=br(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ed(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")ey(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ba:return vs(n.children,o,i,t);case yv:a=8,o|=8;break;case wm:return e=br(12,n,t,o|2),e.elementType=wm,e.lanes=i,e;case Sm:return e=br(13,n,t,o),e.elementType=Sm,e.lanes=i,e;case jm:return e=br(19,n,t,o),e.elementType=jm,e.lanes=i,e;case Lj:return Xf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mj:a=10;break e;case Oj:a=9;break e;case xv:a=11;break e;case bv:a=14;break e;case li:a=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=br(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function vs(e,t,n,r){return e=br(7,e,r,t),e.lanes=n,e}function Xf(e,t,n,r){return e=br(22,e,r,t),e.elementType=Lj,e.lanes=n,e.stateNode={isHidden:!1},e}function Bp(e,t,n){return e=br(6,e,null,t),e.lanes=n,e}function Vp(e,t,n){return t=br(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function HN(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jp(0),this.expirationTimes=jp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ty(e,t,n,r,o,i,a,l,c){return e=new HN(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=br(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},$v(i),e}function WN(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xa,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function RE(e){if(!e)return Di;e=e._reactInternals;e:{if(Fs(e)!==e||e.tag!==1)throw Error(ee(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ee(171))}if(e.tag===1){var n=e.type;if(Yn(n))return kC(e,n,t)}return t}function _E(e,t,n,r,o,i,a,l,c){return e=ty(n,r,!0,e,o,i,a,l,c),e.context=RE(null),n=e.current,r=Ln(),o=Pi(n),i=Do(r,o),i.callback=t??null,Ei(n,i,o),e.current.lanes=o,Yc(e,o,r),Xn(e,r),e}function Jf(e,t,n,r){var o=t.current,i=Ln(),a=Pi(o);return n=RE(n),t.context===null?t.context=n:t.pendingContext=n,t=Do(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ei(o,t,a),e!==null&&(Hr(e,o,a,i),xd(e,o,a)),a}function of(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function lb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ny(e,t){lb(e,t),(e=e.alternate)&&lb(e,t)}function qN(){return null}var DE=typeof reportError=="function"?reportError:function(e){console.error(e)};function ry(e){this._internalRoot=e}Zf.prototype.render=ry.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));Jf(e,t,null,null)};Zf.prototype.unmount=ry.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;js(function(){Jf(null,e,null,null)}),t[Lo]=null}};function Zf(e){this._internalRoot=e}Zf.prototype.unstable_scheduleHydration=function(e){if(e){var t=aC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<pi.length&&t!==0&&t<pi[n].priority;n++);pi.splice(n,0,e),n===0&&cC(e)}};function oy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function eh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function cb(){}function GN(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=of(a);i.call(u)}}var a=_E(t,r,e,0,null,!1,!1,"",cb);return e._reactRootContainer=a,e[Lo]=a.current,Sc(e.nodeType===8?e.parentNode:e),js(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=of(c);l.call(u)}}var c=ty(e,0,!1,null,null,!1,!1,"",cb);return e._reactRootContainer=c,e[Lo]=c.current,Sc(e.nodeType===8?e.parentNode:e),js(function(){Jf(t,c,n,r)}),c}function th(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var l=o;o=function(){var c=of(a);l.call(c)}}Jf(t,a,e,o)}else a=GN(n,t,e,o,r);return of(a)}iC=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Yl(t.pendingLanes);n!==0&&(jv(t,n|1),Xn(t,Kt()),!(tt&6)&&(Xa=Kt()+500,Ui()))}break;case 13:js(function(){var r=$o(e,1);if(r!==null){var o=Ln();Hr(r,e,1,o)}}),ny(e,1)}};Cv=function(e){if(e.tag===13){var t=$o(e,134217728);if(t!==null){var n=Ln();Hr(t,e,134217728,n)}ny(e,134217728)}};sC=function(e){if(e.tag===13){var t=Pi(e),n=$o(e,t);if(n!==null){var r=Ln();Hr(n,e,t,r)}ny(e,t)}};aC=function(){return pt};lC=function(e,t){var n=pt;try{return pt=e,t()}finally{pt=n}};Am=function(e,t,n){switch(t){case"input":if(Tm(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Wf(r);if(!o)throw Error(ee(90));Fj(r),Tm(r,o)}}}break;case"textarea":Uj(e,n);break;case"select":t=n.value,t!=null&&Ma(e,!!n.multiple,t,!1)}};Qj=Xv;Kj=js;var QN={usingClientEntryPoint:!1,Events:[Jc,Ca,Wf,qj,Gj,Xv]},Ul={findFiberByHostInstance:us,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},KN={bundleType:Ul.bundleType,version:Ul.version,rendererPackageName:Ul.rendererPackageName,rendererConfig:Ul.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ko.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Jj(e),e===null?null:e.stateNode},findFiberByHostInstance:Ul.findFiberByHostInstance||qN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ed=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ed.isDisabled&&ed.supportsFiber)try{Uf=ed.inject(KN),fo=ed}catch{}}hr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QN;hr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!oy(t))throw Error(ee(200));return WN(e,t,null,n)};hr.createRoot=function(e,t){if(!oy(e))throw Error(ee(299));var n=!1,r="",o=DE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ty(e,1,!1,null,null,n,!1,r,o),e[Lo]=t.current,Sc(e.nodeType===8?e.parentNode:e),new ry(t)};hr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=Jj(t),e=e===null?null:e.stateNode,e};hr.flushSync=function(e){return js(e)};hr.hydrate=function(e,t,n){if(!eh(t))throw Error(ee(200));return th(null,e,t,!0,n)};hr.hydrateRoot=function(e,t,n){if(!oy(e))throw Error(ee(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=DE;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=_E(t,null,e,1,n??null,o,!1,i,a),e[Lo]=t.current,Sc(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Zf(t)};hr.render=function(e,t,n){if(!eh(t))throw Error(ee(200));return th(null,e,t,!1,n)};hr.unmountComponentAtNode=function(e){if(!eh(e))throw Error(ee(40));return e._reactRootContainer?(js(function(){th(null,null,e,!1,function(){e._reactRootContainer=null,e[Lo]=null})}),!0):!1};hr.unstable_batchedUpdates=Xv;hr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!eh(n))throw Error(ee(200));if(e==null||e._reactInternals===void 0)throw Error(ee(38));return th(e,t,n,!1,r)};hr.version="18.2.0-next-9e3b772b8-20220608";function IE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(IE)}catch(e){console.error(e)}}IE(),_j.exports=hr;var eu=_j.exports;const Da=ev(eu),YN=BS({__proto__:null,default:Da},[eu]),[XN,kr]=zn("ScrollArea.Root component was not found in tree");function Ja(e,t){const n=is(t);cl(()=>{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 JN=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=kr(),[i,a]=p.useState(0),[l,c]=p.useState(0),u=!!(i&&l);return Ja(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),Ja(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),u?s.jsx("div",{...r,ref:t,style:{...n,width:i,height:l}}):null}),ZN=p.forwardRef((e,t)=>{const n=kr(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(JN,{...e,ref:t}):null}),e4={scrollHideDelay:1e3,type:"hover"},AE=p.forwardRef((e,t)=>{const n=V("ScrollAreaRoot",e4,e),{type:r,scrollHideDelay:o,scrollbars:i,...a}=n,[l,c]=p.useState(null),[u,d]=p.useState(null),[f,h]=p.useState(null),[m,g]=p.useState(null),[v,S]=p.useState(null),[x,w]=p.useState(0),[y,b]=p.useState(0),[C,j]=p.useState(!1),[T,E]=p.useState(!1),R=tn(t,_=>c(_));return s.jsx(XN,{value:{type:r,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:C,onScrollbarXEnabledChange:j,scrollbarY:v,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:E,onCornerWidthChange:w,onCornerHeightChange:b},children:s.jsx(q,{...a,ref:R,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${x}px`,"--sa-corner-height":i!=="xy"?"0px":`${y}px`}})})});AE.displayName="@mantine/core/ScrollAreaRoot";function NE(e,t){const n=e/t;return Number.isNaN(n)?0:n}function nh(e){const t=NE(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ME(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 t4(e,[t,n]){return Math.min(n,Math.max(t,e))}function ub(e,t,n="ltr"){const r=nh(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],u=t4(e,c);return ME([0,a],[0,l])(u)}function n4(e,t,n,r="ltr"){const o=nh(n),i=o/2,a=t||i,l=o-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return ME([c,u],f)(e)}function OE(e,t){return e>0&&e<t}function sf(e){return e?parseInt(e,10):0}function ys(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[r4,LE]=zn("ScrollAreaScrollbar was not found in tree"),$E=p.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=kr(),[m,g]=p.useState(null),v=tn(t,E=>g(E)),S=p.useRef(null),x=p.useRef(""),{viewport:w}=h,y=n.content-n.viewport,b=is(u),C=is(l),j=Of(d,10),T=E=>{if(S.current){const R=E.clientX-S.current.left,_=E.clientY-S.current.top;c({x:R,y:_})}};return p.useEffect(()=>{const E=R=>{const _=R.target;(m==null?void 0:m.contains(_))&&b(R,y)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[w,m,y,b]),p.useEffect(C,[n,C]),Ja(m,j),Ja(h.content,j),s.jsx(r4,{value:{scrollbar:m,hasThumb:r,onThumbChange:is(o),onThumbPointerUp:is(i),onThumbPositionChange:C,onThumbPointerDown:is(a)},children:s.jsx("div",{...f,ref:v,"data-mantine-scrollbar":!0,style:{position:"absolute",...f.style},onPointerDown:ys(e.onPointerDown,E=>{E.preventDefault(),E.button===0&&(E.target.setPointerCapture(E.pointerId),S.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",T(E))}),onPointerMove:ys(e.onPointerMove,T),onPointerUp:ys(e.onPointerUp,E=>{E.preventDefault();const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=x.current,S.current=null})})})}),FE=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=kr(),[l,c]=p.useState(),u=p.useRef(null),d=tn(t,u,a.onScrollbarXChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),s.jsx($E,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{...o,"--sa-thumb-width":`${nh(n)}px`},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(a.viewport){const m=a.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),OE(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&a.viewport&&l&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:sf(l.paddingLeft),paddingEnd:sf(l.paddingRight)}})}})});FE.displayName="@mantine/core/ScrollAreaScrollbarX";const zE=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=kr(),[l,c]=p.useState(),u=p.useRef(null),d=tn(t,u,a.onScrollbarYChange);return p.useEffect(()=>{u.current&&c(window.getComputedStyle(u.current))},[]),s.jsx($E,{...i,"data-orientation":"vertical",ref:d,sizes:n,style:{"--sa-thumb-height":`${nh(n)}px`,...o},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(a.viewport){const m=a.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),OE(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&a.viewport&&l&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:sf(l.paddingTop),paddingEnd:sf(l.paddingBottom)}})}})});zE.displayName="@mantine/core/ScrollAreaScrollbarY";const rh=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=Ls(),i=kr(),a=p.useRef(null),l=p.useRef(0),[c,u]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=NE(c.viewport,c.content),f={...r,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>{a.current=m},onThumbPointerUp:()=>{l.current=0},onThumbPointerDown:m=>{l.current=m}},h=(m,g)=>n4(m,l.current,c,g);return n==="horizontal"?s.jsx(FE,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollLeft,g=ub(m,c,o);a.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=h(m,o))}}):n==="vertical"?s.jsx(zE,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollTop,g=ub(m,c);c.scrollbar.size===0?a.current.style.opacity="0":a.current.style.opacity="1",a.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=h(m))}}):null});rh.displayName="@mantine/core/ScrollAreaScrollbarVisible";const iy=p.forwardRef((e,t)=>{const n=kr(),{forceMount:r,...o}=e,[i,a]=p.useState(!1),l=e.orientation==="horizontal",c=Of(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?u:d)}},10);return Ja(n.viewport,c),Ja(n.content,c),r||i?s.jsx(rh,{"data-state":i?"visible":"hidden",...o,ref:t}):null});iy.displayName="@mantine/core/ScrollAreaScrollbarAuto";const UE=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=kr(),[i,a]=p.useState(!1);return p.useEffect(()=>{const{scrollArea:l}=o;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),n||i?s.jsx(iy,{"data-state":i?"visible":"hidden",...r,ref:t}):null});UE.displayName="@mantine/core/ScrollAreaScrollbarHover";const o4=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=kr(),i=e.orientation==="horizontal",[a,l]=p.useState("hidden"),c=Of(()=>l("idle"),100);return p.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay]),p.useEffect(()=>{const{viewport:u}=o,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(l("scrolling"),c()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c]),n||a!=="hidden"?s.jsx(rh,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ys(e.onPointerEnter,()=>l("interacting")),onPointerLeave:ys(e.onPointerLeave,()=>l("idle"))}):null}),fg=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=kr(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,l=e.orientation==="horizontal";return p.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),o.type==="hover"?s.jsx(UE,{...r,ref:t,forceMount:n}):o.type==="scroll"?s.jsx(o4,{...r,ref:t,forceMount:n}):o.type==="auto"?s.jsx(iy,{...r,ref:t,forceMount:n}):o.type==="always"?s.jsx(rh,{...r,ref:t}):null});fg.displayName="@mantine/core/ScrollAreaScrollbar";function i4(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,l=n.top!==i.top;(a||l)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const BE=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=kr(),i=LE(),{onThumbPositionChange:a}=i,l=tn(t,d=>i.onThumbChange(d)),c=p.useRef(),u=Of(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const{viewport:d}=o;if(d){const f=()=>{if(u(),!c.current){const h=i4(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,u,a]),s.jsx("div",{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:ys(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,g=d.clientY-h.top;i.onThumbPointerDown({x:m,y:g})}),onPointerUp:ys(e.onPointerUp,i.onThumbPointerUp)})});BE.displayName="@mantine/core/ScrollAreaThumb";const hg=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=LE();return n||o.hasThumb?s.jsx(BE,{ref:t,...r}):null});hg.displayName="@mantine/core/ScrollAreaThumb";const VE=p.forwardRef(({children:e,style:t,...n},r)=>{const o=kr(),i=tn(r,o.onViewportChange);return s.jsx(q,{...n,ref:i,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:s.jsx("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange,children:e})})});VE.displayName="@mantine/core/ScrollAreaViewport";var sy={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const HE={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},s4=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":B(t)}}),Rr=Y((e,t)=>{const n=V("ScrollArea",HE,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,scrollbarSize:c,vars:u,type:d,scrollHideDelay:f,viewportProps:h,viewportRef:m,onScrollPositionChange:g,children:v,offsetScrollbars:S,scrollbars:x,onBottomReached:w,onTopReached:y,...b}=n,[C,j]=p.useState(!1),T=de({name:"ScrollArea",props:n,classes:sy,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:s4});return s.jsxs(AE,{type:d==="never"?"always":d,scrollHideDelay:f,ref:t,scrollbars:x,...T("root"),...b,children:[s.jsx(VE,{...h,...T("viewport",{style:h==null?void 0:h.style}),ref:m,"data-offset-scrollbars":S===!0?"xy":S||void 0,"data-scrollbars":x||void 0,onScroll:E=>{var O;(O=h==null?void 0:h.onScroll)==null||O.call(h,E),g==null||g({x:E.currentTarget.scrollLeft,y:E.currentTarget.scrollTop});const{scrollTop:R,scrollHeight:_,clientHeight:N}=E.currentTarget;R-(_-N)>=0&&(w==null||w()),R===0&&(y==null||y())},children:v}),(x==="xy"||x==="x")&&s.jsx(fg,{...T("scrollbar"),orientation:"horizontal","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:s.jsx(hg,{...T("thumb")})}),(x==="xy"||x==="y")&&s.jsx(fg,{...T("scrollbar"),orientation:"vertical","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:s.jsx(hg,{...T("thumb")})}),s.jsx(ZN,{...T("corner"),"data-hovered":C||void 0,"data-hidden":d==="never"||void 0})]})});Rr.displayName="@mantine/core/ScrollArea";const oh=Y((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:i,scrollHideDelay:a,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,scrollbars:v,style:S,vars:x,onBottomReached:w,onTopReached:y,...b}=V("ScrollAreaAutosize",HE,e);return s.jsx(q,{...b,ref:t,style:[{display:"flex",overflow:"auto"},S],children:s.jsx(q,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(Rr,{classNames:r,styles:o,scrollHideDelay:a,scrollbarSize:i,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,vars:x,scrollbars:v,onBottomReached:w,onTopReached:y,children:n})})})});Rr.classes=sy;oh.displayName="@mantine/core/ScrollAreaAutosize";oh.classes=sy;Rr.Autosize=oh;var WE={root:"m_87cf2631"};const a4={__staticSelector:"UnstyledButton"},Sn=_n((e,t)=>{const n=V("UnstyledButton",a4,e),{className:r,component:o="button",__staticSelector:i,unstyled:a,classNames:l,styles:c,style:u,...d}=n,f=de({name:i,props:n,classes:WE,className:r,style:u,classNames:l,styles:c,unstyled:a});return s.jsx(q,{...f("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...d})});Sn.classes=WE;Sn.displayName="@mantine/core/UnstyledButton";var qE={root:"m_515a97f8"};const l4={},ay=Y((e,t)=>{const n=V("VisuallyHidden",l4,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,...u}=n,d=de({name:"VisuallyHidden",classes:qE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l});return s.jsx(q,{component:"span",ref:t,...d("root"),...u})});ay.classes=qE;ay.displayName="@mantine/core/VisuallyHidden";var GE={root:"m_1b7284a3"};const c4={},u4=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:dt(t),"--paper-shadow":sv(n)}}),Jn=_n((e,t)=>{const n=V("Paper",c4,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,withBorder:c,vars:u,radius:d,shadow:f,variant:h,mod:m,...g}=n,v=de({name:"Paper",props:n,classes:GE,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:u4});return s.jsx(q,{ref:t,mod:[{"data-with-border":c},m],...v("root"),variant:h,...g})});Jn.classes=GE;Jn.displayName="@mantine/core/Paper";function ih(){return typeof window<"u"}function fl(e){return QE(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wo(e){var t;return(t=(QE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function QE(e){return ih()?e instanceof Node||e instanceof Zn(e).Node:!1}function Rt(e){return ih()?e instanceof Element||e instanceof Zn(e).Element:!1}function dr(e){return ih()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function pg(e){return!ih()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function tu(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Tr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function d4(e){return["table","td","th"].includes(fl(e))}function sh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ly(e){const t=ah(),n=Rt(e)?Tr(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function f4(e){let t=zo(e);for(;dr(t)&&!Ii(t);){if(ly(t))return t;if(sh(t))return null;t=zo(t)}return null}function ah(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ii(e){return["html","body","#document"].includes(fl(e))}function Tr(e){return Zn(e).getComputedStyle(e)}function lh(e){return Rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zo(e){if(fl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pg(e)&&e.host||wo(e);return pg(t)?t.host:t}function KE(e){const t=zo(e);return Ii(t)?e.ownerDocument?e.ownerDocument.body:e.body:dr(t)&&tu(t)?t:KE(t)}function Io(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=KE(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Zn(o);if(i){const l=mg(a);return t.concat(a,a.visualViewport||[],tu(o)?o:[],l&&n?Io(l):[])}return t.concat(o,Io(o,[],n))}function mg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function db(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 Dc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&pg(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function YE(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function XE(){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 h4(e){return g4()?!1:!fb()&&e.width===0&&e.height===0||fb()&&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 p4(){return/apple/i.test(navigator.vendor)}function fb(){const e=/android/i;return e.test(YE())||e.test(XE())}function m4(){return YE().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function g4(){return XE().includes("jsdom/")}function gg(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function v4(e){return"nativeEvent"in e}function y4(e){return e.matches("html,body")}function hs(e){return(e==null?void 0:e.ownerDocument)||document}function Hp(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 va(e){return"composedPath"in e?e.composedPath()[0]:e.target}const x4="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function b4(e){return dr(e)&&e.matches(x4)}const Gr=Math.min,Tn=Math.max,af=Math.round,td=Math.floor,Ai=e=>({x:e,y:e}),w4={left:"right",right:"left",bottom:"top",top:"bottom"},S4={start:"end",end:"start"};function vg(e,t,n){return Tn(e,Gr(t,n))}function Uo(e,t){return typeof e=="function"?e(t):e}function Qr(e){return e.split("-")[0]}function hl(e){return e.split("-")[1]}function cy(e){return e==="x"?"y":"x"}function uy(e){return e==="y"?"height":"width"}function Bo(e){return["top","bottom"].includes(Qr(e))?"y":"x"}function dy(e){return cy(Bo(e))}function j4(e,t,n){n===void 0&&(n=!1);const r=hl(e),o=dy(e),i=uy(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=lf(a)),[a,lf(a)]}function C4(e){const t=lf(e);return[yg(e),t,yg(t)]}function yg(e){return e.replace(/start|end/g,t=>S4[t])}function E4(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function T4(e,t,n,r){const o=hl(e);let i=E4(Qr(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(yg)))),i}function lf(e){return e.replace(/left|right|bottom|top/g,t=>w4[t])}function P4(e){return{top:0,right:0,bottom:0,left:0,...e}}function fy(e){return typeof e!="number"?P4(e):{top:e,right:e,bottom:e,left:e}}function Za(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 hb(e,t,n){let{reference:r,floating:o}=e;const i=Bo(t),a=dy(t),l=uy(a),c=Qr(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(hl(t)){case"start":m[a]-=h*(n&&u?-1:1);break;case"end":m[a]+=h*(n&&u?-1:1);break}return m}const k4=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=hb(u,r,c),h=r,m={},g=0;for(let v=0;v<l.length;v++){const{name:S,fn:x}=l[v],{x:w,y,data:b,reset:C}=await x({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});d=w??d,f=y??f,m={...m,[S]:{...m[S],...b}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(u=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:f}=hb(u,h,c)),v=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:m}};async function hy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Uo(t,e),g=fy(m),S=l[h?f==="floating"?"reference":"floating":f],x=Za(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),b=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},C=Za(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:y,strategy:c}):w);return{top:(x.top-C.top+g.top)/b.y,bottom:(C.bottom-x.bottom+g.bottom)/b.y,left:(x.left-C.left+g.left)/b.x,right:(C.right-x.right+g.right)/b.x}}const R4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Uo(e,t)||{};if(u==null)return{};const f=fy(d),h={x:n,y:r},m=dy(o),g=uy(m),v=await a.getDimensions(u),S=m==="y",x=S?"top":"left",w=S?"bottom":"right",y=S?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[m]-h[m]-i.floating[g],C=h[m]-i.reference[m],j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let T=j?j[y]:0;(!T||!await(a.isElement==null?void 0:a.isElement(j)))&&(T=l.floating[y]||i.floating[g]);const E=b/2-C/2,R=T/2-v[g]/2-1,_=Gr(f[x],R),N=Gr(f[w],R),O=_,F=T-v[g]-N,z=T/2-v[g]/2+E,H=vg(O,z,F),D=!c.arrow&&hl(o)!=null&&z!==H&&i.reference[g]/2-(z<O?_:N)-v[g]/2<0,k=D?z<O?z-O:z-F:0;return{[m]:h[m]+k,data:{[m]:H,centerOffset:z-H-k,...D&&{alignmentOffset:k}},reset:D}}}),_4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...S}=Uo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Qr(o),w=Bo(l),y=Qr(l)===l,b=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=h||(y||!v?[lf(l)]:C4(l)),j=g!=="none";!h&&j&&C.push(...T4(l,v,g,b));const T=[l,...C],E=await hy(t,S),R=[];let _=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&R.push(E[x]),f){const z=j4(o,a,b);R.push(E[z[0]],E[z[1]])}if(_=[..._,{placement:o,overflows:R}],!R.every(z=>z<=0)){var N,O;const z=(((N=i.flip)==null?void 0:N.index)||0)+1,H=T[z];if(H)return{data:{index:z,overflows:_},reset:{placement:H}};let D=(O=_.filter(k=>k.overflows[0]<=0).sort((k,P)=>k.overflows[1]-P.overflows[1])[0])==null?void 0:O.placement;if(!D)switch(m){case"bestFit":{var F;const k=(F=_.filter(P=>{if(j){const I=Bo(P.placement);return I===w||I==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(I=>I>0).reduce((I,L)=>I+L,0)]).sort((P,I)=>P[1]-I[1])[0])==null?void 0:F[0];k&&(D=k);break}case"initialPlacement":D=l;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function JE(e){const t=Gr(...e.map(i=>i.left)),n=Gr(...e.map(i=>i.top)),r=Tn(...e.map(i=>i.right)),o=Tn(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function D4(e){const t=e.slice().sort((o,i)=>o.y-i.y),n=[];let r=null;for(let o=0;o<t.length;o++){const i=t[o];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(o=>Za(JE(o)))}const I4=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:l=2,x:c,y:u}=Uo(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),f=D4(d),h=Za(JE(d)),m=fy(l);function g(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&u!=null)return f.find(S=>c>S.left-m.left&&c<S.right+m.right&&u>S.top-m.top&&u<S.bottom+m.bottom)||h;if(f.length>=2){if(Bo(n)==="y"){const _=f[0],N=f[f.length-1],O=Qr(n)==="top",F=_.top,z=N.bottom,H=O?_.left:N.left,D=O?_.right:N.right,k=D-H,P=z-F;return{top:F,bottom:z,left:H,right:D,width:k,height:P,x:H,y:F}}const S=Qr(n)==="left",x=Tn(...f.map(_=>_.right)),w=Gr(...f.map(_=>_.left)),y=f.filter(_=>S?_.left===w:_.right===x),b=y[0].top,C=y[y.length-1].bottom,j=w,T=x,E=T-j,R=C-b;return{top:b,bottom:C,left:j,right:T,width:E,height:R,x:j,y:b}}return h}const v=await i.getElementRects({reference:{getBoundingClientRect:g},floating:r.floating,strategy:a});return o.reference.x!==v.reference.x||o.reference.y!==v.reference.y||o.reference.width!==v.reference.width||o.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};async function A4(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Qr(n),l=hl(n),c=Bo(n)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,f=Uo(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const N4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:l}=t,c=await A4(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},M4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x,y:w}=S;return{x,y:w}}},...c}=Uo(e,t),u={x:n,y:r},d=await hy(t,c),f=Bo(Qr(o)),h=cy(f);let m=u[h],g=u[f];if(i){const S=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=m+d[S],y=m-d[x];m=vg(w,m,y)}if(a){const S=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=g+d[S],y=g-d[x];g=vg(w,g,y)}const v=l.fn({...t,[h]:m,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[f]:a}}}}}},O4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Uo(e,t),d={x:n,y:r},f=Bo(o),h=cy(f);let m=d[h],g=d[f];const v=Uo(l,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const y=h==="y"?"height":"width",b=i.reference[h]-i.floating[y]+S.mainAxis,C=i.reference[h]+i.reference[y]-S.mainAxis;m<b?m=b:m>C&&(m=C)}if(u){var x,w;const y=h==="y"?"width":"height",b=["top","left"].includes(Qr(o)),C=i.reference[f]-i.floating[y]+(b&&((x=a.offset)==null?void 0:x[f])||0)+(b?0:S.crossAxis),j=i.reference[f]+i.reference[y]+(b?0:((w=a.offset)==null?void 0:w[f])||0)-(b?S.crossAxis:0);g<C?g=C:g>j&&(g=j)}return{[h]:m,[f]:g}}}},L4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:l}=t,{apply:c=()=>{},...u}=Uo(e,t),d=await hy(t,u),f=Qr(o),h=hl(o),m=Bo(o)==="y",{width:g,height:v}=i.floating;let S,x;f==="top"||f==="bottom"?(S=f,x=h===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,S=h==="end"?"top":"bottom");const w=v-d.top-d.bottom,y=g-d.left-d.right,b=Gr(v-d[S],w),C=Gr(g-d[x],y),j=!t.middlewareData.shift;let T=b,E=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),j&&!h){const _=Tn(d.left,0),N=Tn(d.right,0),O=Tn(d.top,0),F=Tn(d.bottom,0);m?E=g-2*(_!==0||N!==0?_+N:Tn(d.left,d.right)):T=v-2*(O!==0||F!==0?O+F:Tn(d.top,d.bottom))}await c({...t,availableWidth:E,availableHeight:T});const R=await a.getDimensions(l.floating);return g!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function ZE(e){const t=Tr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=dr(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=af(n)!==i||af(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function py(e){return Rt(e)?e:e.contextElement}function Ua(e){const t=py(e);if(!dr(t))return Ai(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ZE(t);let a=(i?af(n.width):n.width)/r,l=(i?af(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const $4=Ai(0);function eT(e){const t=Zn(e);return!ah()||!t.visualViewport?$4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function F4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function Cs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=py(e);let a=Ai(1);t&&(r?Rt(r)&&(a=Ua(r)):a=Ua(e));const l=F4(i,n,r)?eT(i):Ai(0);let c=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(i){const h=Zn(i),m=r&&Rt(r)?Zn(r):r;let g=h,v=mg(g);for(;v&&r&&m!==g;){const S=Ua(v),x=v.getBoundingClientRect(),w=Tr(v),y=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*S.x,b=x.top+(v.clientTop+parseFloat(w.paddingTop))*S.y;c*=S.x,u*=S.y,d*=S.x,f*=S.y,c+=y,u+=b,g=Zn(v),v=mg(g)}}return Za({width:d,height:f,x:c,y:u})}function z4(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=wo(r),l=t?sh(t.floating):!1;if(r===a||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ai(1);const d=Ai(0),f=dr(r);if((f||!f&&!i)&&((fl(r)!=="body"||tu(a))&&(c=lh(r)),dr(r))){const h=Cs(r);u=Ua(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function U4(e){return Array.from(e.getClientRects())}function xg(e,t){const n=lh(e).scrollLeft;return t?t.left+n:Cs(wo(e)).left+n}function B4(e){const t=wo(e),n=lh(e),r=e.ownerDocument.body,o=Tn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Tn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xg(e);const l=-n.scrollTop;return Tr(r).direction==="rtl"&&(a+=Tn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}function V4(e,t){const n=Zn(e),r=wo(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const u=ah();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function H4(e,t){const n=Cs(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=dr(e)?Ua(e):Ai(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:a,height:l,x:c,y:u}}function pb(e,t,n){let r;if(t==="viewport")r=V4(e,n);else if(t==="document")r=B4(wo(e));else if(Rt(t))r=H4(t,n);else{const o=eT(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Za(r)}function tT(e,t){const n=zo(e);return n===t||!Rt(n)||Ii(n)?!1:Tr(n).position==="fixed"||tT(n,t)}function W4(e,t){const n=t.get(e);if(n)return n;let r=Io(e,[],!1).filter(l=>Rt(l)&&fl(l)!=="body"),o=null;const i=Tr(e).position==="fixed";let a=i?zo(e):e;for(;Rt(a)&&!Ii(a);){const l=Tr(a),c=ly(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||tu(a)&&!c&&tT(e,a))?r=r.filter(d=>d!==a):o=l,a=zo(a)}return t.set(e,r),r}function q4(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?sh(t)?[]:W4(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((u,d)=>{const f=pb(t,d,o);return u.top=Tn(f.top,u.top),u.right=Gr(f.right,u.right),u.bottom=Gr(f.bottom,u.bottom),u.left=Tn(f.left,u.left),u},pb(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function G4(e){const{width:t,height:n}=ZE(e);return{width:t,height:n}}function Q4(e,t,n){const r=dr(t),o=wo(t),i=n==="fixed",a=Cs(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ai(0);if(r||!r&&!i)if((fl(t)!=="body"||tu(o))&&(l=lh(t)),r){const m=Cs(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&(c.x=xg(o));let u=0,d=0;if(o&&!r&&!i){const m=o.getBoundingClientRect();d=m.top+l.scrollTop,u=m.left+l.scrollLeft-xg(o,m)}const f=a.left+l.scrollLeft-c.x-u,h=a.top+l.scrollTop-c.y-d;return{x:f,y:h,width:a.width,height:a.height}}function Wp(e){return Tr(e).position==="static"}function mb(e,t){if(!dr(e)||Tr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wo(e)===n&&(n=n.ownerDocument.body),n}function nT(e,t){const n=Zn(e);if(sh(e))return n;if(!dr(e)){let o=zo(e);for(;o&&!Ii(o);){if(Rt(o)&&!Wp(o))return o;o=zo(o)}return n}let r=mb(e,t);for(;r&&d4(r)&&Wp(r);)r=mb(r,t);return r&&Ii(r)&&Wp(r)&&!ly(r)?n:r||f4(e)||n}const K4=async function(e){const t=this.getOffsetParent||nT,n=this.getDimensions,r=await n(e.floating);return{reference:Q4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Y4(e){return Tr(e).direction==="rtl"}const X4={convertOffsetParentRelativeRectToViewportRelativeRect:z4,getDocumentElement:wo,getClippingRect:q4,getOffsetParent:nT,getElementRects:K4,getClientRects:U4,getDimensions:G4,getScale:Ua,isElement:Rt,isRTL:Y4};function J4(e,t){let n=null,r;const o=wo(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:f,height:h}=e.getBoundingClientRect();if(l||t(),!f||!h)return;const m=td(d),g=td(o.clientWidth-(u+f)),v=td(o.clientHeight-(d+h)),S=td(u),w={rootMargin:-m+"px "+-g+"px "+-v+"px "+-S+"px",threshold:Tn(0,Gr(1,c))||1};let y=!0;function b(C){const j=C[0].intersectionRatio;if(j!==c){if(!y)return a();j?a(!1,j):r=setTimeout(()=>{a(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(b,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,w)}n.observe(e)}return a(!0),i}function Z4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=py(e),d=o||i?[...u?Io(u):[],...Io(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=u&&l?J4(u,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g,v=c?Cs(e):null;c&&S();function S(){const x=Cs(e);v&&(x.x!==v.x||x.y!==v.y||x.width!==v.width||x.height!==v.height)&&n(),v=x,g=requestAnimationFrame(S)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const e3=N4,t3=M4,n3=_4,r3=L4,gb=R4,o3=I4,i3=O4,s3=(e,t,n)=>{const r=new Map,o={platform:X4,...n},i={...o.platform,_c:r};return k4(e,t,{...o,platform:i})};var Td=typeof document<"u"?p.useLayoutEffect:p.useEffect;function cf(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(!cf(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!cf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function rT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vb(e,t){const n=rT(e);return Math.round(t*n)/n}function qp(e){const t=p.useRef(e);return Td(()=>{t.current=e}),t}function a3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);cf(h,r)||m(r);const[g,v]=p.useState(null),[S,x]=p.useState(null),w=p.useCallback(P=>{P!==j.current&&(j.current=P,v(P))},[]),y=p.useCallback(P=>{P!==T.current&&(T.current=P,x(P))},[]),b=i||g,C=a||S,j=p.useRef(null),T=p.useRef(null),E=p.useRef(d),R=c!=null,_=qp(c),N=qp(o),O=qp(u),F=p.useCallback(()=>{if(!j.current||!T.current)return;const P={placement:t,strategy:n,middleware:h};N.current&&(P.platform=N.current),s3(j.current,T.current,P).then(I=>{const L={...I,isPositioned:O.current!==!1};z.current&&!cf(E.current,L)&&(E.current=L,eu.flushSync(()=>{f(L)}))})},[h,t,n,N,O]);Td(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[u]);const z=p.useRef(!1);Td(()=>(z.current=!0,()=>{z.current=!1}),[]),Td(()=>{if(b&&(j.current=b),C&&(T.current=C),b&&C){if(_.current)return _.current(b,C,F);F()}},[b,C,F,_,R]);const H=p.useMemo(()=>({reference:j,floating:T,setReference:w,setFloating:y}),[w,y]),D=p.useMemo(()=>({reference:b,floating:C}),[b,C]),k=p.useMemo(()=>{const P={position:n,left:0,top:0};if(!D.floating)return P;const I=vb(D.floating,d.x),L=vb(D.floating,d.y);return l?{...P,transform:"translate("+I+"px, "+L+"px)",...rT(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:L}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:F,refs:H,elements:D,floatingStyles:k}),[d,F,H,D,k])}const l3=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?gb({element:r.current,padding:o}).fn(n):{}:r?gb({element:r,padding:o}).fn(n):{}}}},oT=(e,t)=>({...e3(e),options:[e,t]}),my=(e,t)=>({...t3(e),options:[e,t]}),yb=(e,t)=>({...i3(e),options:[e,t]}),bg=(e,t)=>({...n3(e),options:[e,t]}),c3=(e,t)=>({...r3(e),options:[e,t]}),wg=(e,t)=>({...o3(e),options:[e,t]}),iT=(e,t)=>({...l3(e),options:[e,t]}),sT={...JS},u3=sT.useInsertionEffect,d3=u3||(e=>e());function gi(e){const t=p.useRef(()=>{});return d3(()=>{t.current=e}),p.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 po=typeof document<"u"?p.useLayoutEffect:p.useEffect;let xb=!1,f3=0;const bb=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+f3++;function h3(){const[e,t]=p.useState(()=>xb?bb():void 0);return po(()=>{e==null&&t(bb())},[]),p.useEffect(()=>{xb=!0},[]),e}const p3=sT.useId,aT=p3||h3;function m3(){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 g3=p.createContext(null),v3=p.createContext(null),gy=()=>{var e;return((e=p.useContext(g3))==null?void 0:e.id)||null},vy=()=>p.useContext(v3);function yy(e){return"data-floating-ui-"+e}function Gp(e){const t=p.useRef(e);return po(()=>{t.current=e}),t}const wb=yy("safe-polygon");function Pd(e,t,n){return n&&!gg(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function y3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:a}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:h=!0}=t,m=vy(),g=gy(),v=Gp(u),S=Gp(c),x=Gp(n),w=p.useRef(),y=p.useRef(-1),b=p.useRef(),C=p.useRef(-1),j=p.useRef(!0),T=p.useRef(!1),E=p.useRef(()=>{}),R=p.useRef(!1),_=p.useCallback(()=>{var D;const k=(D=o.current.openEvent)==null?void 0:D.type;return(k==null?void 0:k.includes("mouse"))&&k!=="mousedown"},[o]);p.useEffect(()=>{if(!l)return;function D(k){let{open:P}=k;P||(clearTimeout(y.current),clearTimeout(C.current),j.current=!0,R.current=!1)}return i.on("openchange",D),()=>{i.off("openchange",D)}},[l,i]),p.useEffect(()=>{if(!l||!v.current||!n)return;function D(P){_()&&r(!1,P,"hover")}const k=hs(a.floating).documentElement;return k.addEventListener("mouseleave",D),()=>{k.removeEventListener("mouseleave",D)}},[a.floating,n,r,l,v,_]);const N=p.useCallback(function(D,k,P){k===void 0&&(k=!0),P===void 0&&(P="hover");const I=Pd(S.current,"close",w.current);I&&!b.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,D,P),I)):k&&(clearTimeout(y.current),r(!1,D,P))},[S,r]),O=gi(()=>{E.current(),b.current=void 0}),F=gi(()=>{if(T.current){const D=hs(a.floating).body;D.style.pointerEvents="",D.removeAttribute(wb),T.current=!1}});p.useEffect(()=>{if(!l)return;function D(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function k($){if(clearTimeout(y.current),j.current=!1,d&&!gg(w.current)||f>0&&!Pd(S.current,"open"))return;const Q=Pd(S.current,"open",w.current);Q?y.current=window.setTimeout(()=>{x.current||r(!0,$,"hover")},Q):r(!0,$,"hover")}function P($){if(D())return;E.current();const Q=hs(a.floating);if(clearTimeout(C.current),R.current=!1,v.current&&o.current.floatingContext){n||clearTimeout(y.current),b.current=v.current({...o.current.floatingContext,tree:m,x:$.clientX,y:$.clientY,onClose(){F(),O(),N($,!0,"safe-polygon")}});const Re=b.current;Q.addEventListener("mousemove",Re),E.current=()=>{Q.removeEventListener("mousemove",Re)};return}(w.current==="touch"?!Dc(a.floating,$.relatedTarget):!0)&&N($)}function I($){D()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:m,x:$.clientX,y:$.clientY,onClose(){F(),O(),N($)}})($))}if(Rt(a.domReference)){var L;const $=a.domReference;return n&&$.addEventListener("mouseleave",I),(L=a.floating)==null||L.addEventListener("mouseleave",I),h&&$.addEventListener("mousemove",k,{once:!0}),$.addEventListener("mouseenter",k),$.addEventListener("mouseleave",P),()=>{var Q;n&&$.removeEventListener("mouseleave",I),(Q=a.floating)==null||Q.removeEventListener("mouseleave",I),h&&$.removeEventListener("mousemove",k),$.removeEventListener("mouseenter",k),$.removeEventListener("mouseleave",P)}}},[a,l,e,d,f,h,N,O,F,r,n,x,m,S,v,o]),po(()=>{var D;if(l&&n&&(D=v.current)!=null&&D.__options.blockPointerEvents&&_()){T.current=!0;const P=a.floating;if(Rt(a.domReference)&&P){var k;const I=hs(a.floating).body;I.setAttribute(wb,"");const L=a.domReference,$=m==null||(k=m.nodesRef.current.find(Q=>Q.id===g))==null||(k=k.context)==null?void 0:k.elements.floating;return $&&($.style.pointerEvents=""),I.style.pointerEvents="none",L.style.pointerEvents="auto",P.style.pointerEvents="auto",()=>{I.style.pointerEvents="",L.style.pointerEvents="",P.style.pointerEvents=""}}}},[l,n,g,a,m,v,_]),po(()=>{n||(w.current=void 0,R.current=!1,O(),F())},[n,O,F]),p.useEffect(()=>()=>{O(),clearTimeout(y.current),clearTimeout(C.current),F()},[l,a.domReference,O,F]);const z=p.useMemo(()=>{function D(k){w.current=k.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(k){const{nativeEvent:P}=k;function I(){!j.current&&!x.current&&r(!0,P,"hover")}d&&!gg(w.current)||n||f===0||R.current&&k.movementX**2+k.movementY**2<2||(clearTimeout(C.current),w.current==="touch"?I():(R.current=!0,C.current=window.setTimeout(I,f)))}}},[d,r,n,x,f]),H=p.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(D){N(D.nativeEvent,!1)}}),[N]);return p.useMemo(()=>l?{reference:z,floating:H}:{},[l,z,H])}const Sg=()=>{},lT=p.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Sg,setState:Sg,isInstantPhase:!1}),cT=()=>p.useContext(lT);function x3(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=p.useReducer((c,u)=>({...c,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),a=p.useRef(null),l=p.useCallback(c=>{i({currentId:c})},[]);return po(()=>{o.currentId?a.current===null?a.current=o.currentId:o.isInstantPhase||i({isInstantPhase:!0}):(o.isInstantPhase&&i({isInstantPhase:!1}),a.current=null)},[o.currentId,o.isInstantPhase]),p.createElement(lT.Provider,{value:p.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,l])},t)}function b3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:i,enabled:a=!0}=t,l=i??o,c=cT(),{currentId:u,setCurrentId:d,initialDelay:f,setState:h,timeoutMs:m}=c;return po(()=>{a&&u&&(h({delay:{open:1,close:Pd(f,"close")}}),u!==l&&r(!1))},[a,l,r,h,u,f]),po(()=>{function g(){r(!1),h({delay:f,currentId:null})}if(a&&u&&!n&&u===l){if(m){const v=window.setTimeout(g,m);return()=>{clearTimeout(v)}}g()}},[a,n,h,u,l,r,f,m]),po(()=>{a&&(d===Sg||!n||d(l))},[a,n,d,l]),c}function Qp(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)}),r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(a=>{var l;return o.parentId===a.id&&((l=o.context)==null?void 0:l.open)})}),n=n.concat(r);return n}const w3="data-floating-ui-focusable",S3={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},j3={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Sb=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function C3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:m,capture:g}=t,v=vy(),S=gi(typeof c=="function"?c:()=>!1),x=typeof c=="function"?S:c,w=p.useRef(!1),y=p.useRef(!1),{escapeKey:b,outsidePress:C}=Sb(m),{escapeKey:j,outsidePress:T}=Sb(g),E=p.useRef(!1),R=gi(H=>{var D;if(!n||!a||!l||H.key!=="Escape"||E.current)return;const k=(D=i.current.floatingContext)==null?void 0:D.nodeId,P=v?Qp(v.nodesRef.current,k):[];if(!b&&(H.stopPropagation(),P.length>0)){let I=!0;if(P.forEach(L=>{var $;if(($=L.context)!=null&&$.open&&!L.context.dataRef.current.__escapeKeyBubbles){I=!1;return}}),!I)return}r(!1,v4(H)?H.nativeEvent:H,"escape-key")}),_=gi(H=>{var D;const k=()=>{var P;R(H),(P=va(H))==null||P.removeEventListener("keydown",k)};(D=va(H))==null||D.addEventListener("keydown",k)}),N=gi(H=>{var D;const k=w.current;w.current=!1;const P=y.current;if(y.current=!1,u==="click"&&P||k||typeof x=="function"&&!x(H))return;const I=va(H),L="["+yy("inert")+"]",$=hs(o.floating).querySelectorAll(L);let Q=Rt(I)?I:null;for(;Q&&!Ii(Q);){const ge=zo(Q);if(Ii(ge)||!Rt(ge))break;Q=ge}if($.length&&Rt(I)&&!y4(I)&&!Dc(I,o.floating)&&Array.from($).every(ge=>!Dc(Q,ge)))return;if(dr(I)&&z){const ge=I.clientWidth>0&&I.scrollWidth>I.clientWidth,De=I.clientHeight>0&&I.scrollHeight>I.clientHeight;let le=De&&H.offsetX>I.clientWidth;if(De&&Tr(I).direction==="rtl"&&(le=H.offsetX<=I.offsetWidth-I.clientWidth),le||ge&&H.offsetY>I.clientHeight)return}const ue=(D=i.current.floatingContext)==null?void 0:D.nodeId,Re=v&&Qp(v.nodesRef.current,ue).some(ge=>{var De;return Hp(H,(De=ge.context)==null?void 0:De.elements.floating)});if(Hp(H,o.floating)||Hp(H,o.domReference)||Re)return;const me=v?Qp(v.nodesRef.current,ue):[];if(me.length>0){let ge=!0;if(me.forEach(De=>{var le;if((le=De.context)!=null&&le.open&&!De.context.dataRef.current.__outsidePressBubbles){ge=!1;return}}),!ge)return}r(!1,H,"outside-press")}),O=gi(H=>{var D;const k=()=>{var P;N(H),(P=va(H))==null||P.removeEventListener(u,k)};(D=va(H))==null||D.addEventListener(u,k)});p.useEffect(()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=b,i.current.__outsidePressBubbles=C;let H=-1;function D($){r(!1,$,"ancestor-scroll")}function k(){window.clearTimeout(H),E.current=!0}function P(){H=window.setTimeout(()=>{E.current=!1},ah()?5:0)}const I=hs(o.floating);l&&(I.addEventListener("keydown",j?_:R,j),I.addEventListener("compositionstart",k),I.addEventListener("compositionend",P)),x&&I.addEventListener(u,T?O:N,T);let L=[];return h&&(Rt(o.domReference)&&(L=Io(o.domReference)),Rt(o.floating)&&(L=L.concat(Io(o.floating))),!Rt(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(Io(o.reference.contextElement)))),L=L.filter($=>{var Q;return $!==((Q=I.defaultView)==null?void 0:Q.visualViewport)}),L.forEach($=>{$.addEventListener("scroll",D,{passive:!0})}),()=>{l&&(I.removeEventListener("keydown",j?_:R,j),I.removeEventListener("compositionstart",k),I.removeEventListener("compositionend",P)),x&&I.removeEventListener(u,T?O:N,T),L.forEach($=>{$.removeEventListener("scroll",D)}),window.clearTimeout(H)}},[i,o,l,x,u,n,r,h,a,b,C,R,j,_,N,T,O]),p.useEffect(()=>{w.current=!1},[x,u]);const F=p.useMemo(()=>({onKeyDown:R,[S3[f]]:H=>{d&&r(!1,H.nativeEvent,"reference-press")}}),[R,r,d,f]),z=p.useMemo(()=>({onKeyDown:R,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[j3[u]]:()=>{w.current=!0}}),[R,u]);return p.useMemo(()=>a?{reference:F,floating:z}:{},[a,F,z])}function E3(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=aT(),i=p.useRef({}),[a]=p.useState(()=>m3()),l=gy()!=null,[c,u]=p.useState(r.reference),d=gi((m,g,v)=>{i.current.openEvent=m?g:void 0,a.emit("openchange",{open:m,event:g,reason:v,nested:l}),n==null||n(m,g,v)}),f=p.useMemo(()=>({setPositionReference:u}),[]),h=p.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return p.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:h,events:a,floatingId:o,refs:f}),[t,d,h,a,o,f])}function xy(e){e===void 0&&(e={});const{nodeId:t}=e,n=E3({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,a]=p.useState(null),[l,c]=p.useState(null),d=(o==null?void 0:o.reference)||i,f=p.useRef(null),h=vy();po(()=>{d&&(f.current=d)},[d]);const m=a3({...e,elements:{...o,...l&&{reference:l}}}),g=p.useCallback(y=>{const b=Rt(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;c(b),m.refs.setReference(b)},[m.refs]),v=p.useCallback(y=>{(Rt(y)||y===null)&&(f.current=y,a(y)),(Rt(m.refs.reference.current)||m.refs.reference.current===null||y!==null&&!Rt(y))&&m.refs.setReference(y)},[m.refs]),S=p.useMemo(()=>({...m.refs,setReference:v,setPositionReference:g,domReference:f}),[m.refs,v,g]),x=p.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),w=p.useMemo(()=>({...m,...r,refs:S,elements:x,nodeId:t}),[m,S,x,t,r]);return po(()=>{r.dataRef.current.floatingContext=w;const y=h==null?void 0:h.nodesRef.current.find(b=>b.id===t);y&&(y.context=w)}),p.useMemo(()=>({...m,context:w,refs:S,elements:x}),[m,S,x,w])}function T3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=p.useRef(!1),d=p.useRef(),f=p.useRef(!0);p.useEffect(()=>{if(!l)return;const m=Zn(a.domReference);function g(){!n&&dr(a.domReference)&&a.domReference===db(hs(a.domReference))&&(u.current=!0)}function v(){f.current=!0}return m.addEventListener("blur",g),m.addEventListener("keydown",v,!0),()=>{m.removeEventListener("blur",g),m.removeEventListener("keydown",v,!0)}},[a.domReference,n,l]),p.useEffect(()=>{if(!l)return;function m(g){let{reason:v}=g;(v==="reference-press"||v==="escape-key")&&(u.current=!0)}return o.on("openchange",m),()=>{o.off("openchange",m)}},[o,l]),p.useEffect(()=>()=>{clearTimeout(d.current)},[]);const h=p.useMemo(()=>({onPointerDown(m){h4(m.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(m){if(u.current)return;const g=va(m.nativeEvent);if(c&&Rt(g))try{if(p4()&&m4())throw Error();if(!g.matches(":focus-visible"))return}catch{if(!f.current&&!b4(g))return}r(!0,m.nativeEvent,"focus")},onBlur(m){u.current=!1;const g=m.relatedTarget,v=m.nativeEvent,S=Rt(g)&&g.hasAttribute(yy("focus-guard"))&&g.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var x;const w=db(a.domReference?a.domReference.ownerDocument:document);!g&&w===a.domReference||Dc((x=i.current.floatingContext)==null?void 0:x.refs.floating.current,w)||Dc(a.domReference,w)||S||r(!1,v,"focus")})}}),[i,a.domReference,r,c]);return p.useMemo(()=>l?{reference:h}:{},[l,h])}const jb="active",Cb="selected";function Kp(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[jb]:a,[Cb]:l,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1,[w3]:""},...i,...t.map(a=>{const l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(c=>{let[u,d]=c;if(!(o&&[jb,Cb].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var f;(f=r.get(u))==null||f.push(d),a[u]=function(){for(var h,m=arguments.length,g=new Array(m),v=0;v<m;v++)g[v]=arguments[v];return(h=r.get(u))==null?void 0:h.map(S=>S(...g)).find(S=>S!==void 0)}}}else a[u]=d}),a),{})}}function P3(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),o=p.useCallback(l=>Kp(l,e,"reference"),t),i=p.useCallback(l=>Kp(l,e,"floating"),n),a=p.useCallback(l=>Kp(l,e,"item"),r);return p.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a}),[o,i,a])}const k3=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function R3(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:a="dialog"}=t,l=(n=k3.get(a))!=null?n:a,c=aT(),d=gy()!=null,f=p.useMemo(()=>l==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":l==="alertdialog"?"dialog":l,"aria-controls":r?o:void 0,...l==="listbox"&&{role:"combobox"},...l==="menu"&&{id:c},...l==="menu"&&d&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[l,o,d,r,c,a]),h=p.useMemo(()=>{const g={id:o,...l&&{role:l}};return l==="tooltip"||a==="label"?g:{...g,...l==="menu"&&{"aria-labelledby":c}}},[l,o,c,a]),m=p.useCallback(g=>{let{active:v,selected:S}=g;const x={role:"option",...v&&{id:o+"-option"}};switch(a){case"select":return{...x,"aria-selected":v&&S};case"combobox":return{...x,...v&&{"aria-selected":!0}}}return{}},[o,a]);return p.useMemo(()=>i?{reference:f,floating:h,item:m}:{},[i,f,h,m])}function uT(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 Eb(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function Tb(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 _3={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function D3({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:a,dir:l}){const[c,u="center"]=e.split("-"),d={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[_3[c]]:r},f=-t/2;return c==="left"?{...d,...Eb(u,a,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:c==="right"?{...d,...Eb(u,a,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:c==="top"?{...d,...Tb(u,i,n,o,l),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:c==="bottom"?{...d,...Tb(u,i,n,o,l),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const by=p.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:a,arrowY:l,style:c,...u},d)=>{const{dir:f}=Ls();return i?s.jsx("div",{...u,ref:d,style:{...c,...D3({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:a,arrowY:l})}}):null});by.displayName="@mantine/core/FloatingArrow";const[I3,dT]=zn("Popover component was not found in the tree");function ch({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=TD(t),i=tn(o,r);return qo(e)?p.cloneElement(e,{[n]:i}):e}function fT(e){return s.jsx(ay,{tabIndex:-1,"data-autofocus":!0,...e})}ch.displayName="@mantine/core/FocusTrap";fT.displayName="@mantine/core/FocusTrapInitialFocus";ch.InitialFocus=fT;function A3(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}const N3={},hT=p.forwardRef((e,t)=>{const{children:n,target:r,...o}=V("Portal",N3,e),[i,a]=p.useState(!1),l=p.useRef(null);return cl(()=>(a(!0),l.current=r?typeof r=="string"?document.querySelector(r):r:A3(o),Lf(t,l.current),!r&&l.current&&document.body.appendChild(l.current),()=>{!r&&l.current&&document.body.removeChild(l.current)}),[r]),!i||!l.current?null:eu.createPortal(s.jsx(s.Fragment,{children:n}),l.current)});hT.displayName="@mantine/core/Portal";function zs({withinPortal:e=!0,children:t,...n}){return e?s.jsx(hT,{...n,children:t}):s.jsx(s.Fragment,{children:t})}zs.displayName="@mantine/core/OptionalPortal";const Bl=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${B(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),nd={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${B(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${B(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${B(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${B(-30)}`},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(${B(-20)}) 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(${B(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${B(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${B(20)}) 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:{...Bl("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Bl("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Bl("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Bl("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Bl("top"),common:{transformOrigin:"top right"}}},Pb={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function M3({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in nd?{transitionProperty:nd[e].transitionProperty,...o,...nd[e].common,...nd[e][Pb[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[Pb[t]]}}function O3({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:a,onExited:l,enterDelay:c,exitDelay:u}){const d=At(),f=cv(),h=d.respectReducedMotion?f:!1,[m,g]=p.useState(h?0:e),[v,S]=p.useState(r?"entered":"exited"),x=p.useRef(-1),w=p.useRef(-1),y=p.useRef(-1),b=j=>{const T=j?o:i,E=j?a:l;window.clearTimeout(x.current);const R=h?0:j?e:t;g(R),R===0?(typeof T=="function"&&T(),typeof E=="function"&&E(),S(j?"entered":"exited")):y.current=requestAnimationFrame(()=>{Da.flushSync(()=>{S(j?"pre-entering":"pre-exiting")}),y.current=requestAnimationFrame(()=>{typeof T=="function"&&T(),S(j?"entering":"exiting"),x.current=window.setTimeout(()=>{typeof E=="function"&&E(),S(j?"entered":"exited")},R)})})},C=j=>{if(window.clearTimeout(w.current),typeof(j?c:u)!="number"){b(j);return}w.current=window.setTimeout(()=>{b(j)},j?c:u)};return Mo(()=>{C(r)},[r]),p.useEffect(()=>()=>{window.clearTimeout(x.current),cancelAnimationFrame(y.current)},[]),{transitionDuration:m,transitionStatus:v,transitionTimingFunction:n||"ease"}}function Yo({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:a="ease",onExit:l,onEntered:c,onEnter:u,onExited:d,enterDelay:f,exitDelay:h}){const{transitionDuration:m,transitionStatus:g,transitionTimingFunction:v}=O3({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d,enterDelay:f,exitDelay:h});return m===0?o?s.jsx(s.Fragment,{children:i({})}):e?i({display:"none"}):null:g==="exited"?e?i({display:"none"}):null:s.jsx(s.Fragment,{children:i(M3({transition:t,duration:m,state:g,timingFunction:v}))})}Yo.displayName="@mantine/core/Transition";var pT={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const L3={},wy=Y((e,t)=>{var S,x,w,y;const n=V("PopoverDropdown",L3,e),{className:r,style:o,vars:i,children:a,onKeyDownCapture:l,variant:c,classNames:u,styles:d,...f}=n,h=dT(),m=hj({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},v=tn(t,h.floating);return h.disabled?null:s.jsx(zs,{...h.portalProps,withinPortal:h.withinPortal,children:s.jsx(Yo,{mounted:h.opened,...h.transitionProps,transition:((S=h.transitionProps)==null?void 0:S.transition)||"fade",duration:((x=h.transitionProps)==null?void 0:x.duration)??150,keepMounted:h.keepMounted,exitDuration:typeof((w=h.transitionProps)==null?void 0:w.exitDuration)=="number"?h.transitionProps.exitDuration:(y=h.transitionProps)==null?void 0:y.duration,children:b=>s.jsx(ch,{active:h.trapFocus&&h.opened,innerRef:v,children:s.jsxs(q,{...g,...f,variant:c,onKeyDownCapture:hD(h.onClose,{active:h.closeOnEscape,onTrigger:m,onKeyDown:l}),"data-position":h.placement,"data-fixed":h.floatingStrategy==="fixed"||void 0,...h.getStyles("dropdown",{className:r,props:n,classNames:u,styles:d,style:[{...b,zIndex:h.zIndex,top:h.y??0,left:h.x??0,width:h.width==="target"?void 0:B(h.width)},o]}),children:[a,s.jsx(by,{ref:h.arrowRef,arrowX:h.arrowX,arrowY:h.arrowY,visible:h.withArrow,position:h.placement,arrowSize:h.arrowSize,arrowRadius:h.arrowRadius,arrowOffset:h.arrowOffset,arrowPosition:h.arrowPosition,...h.getStyles("arrow",{props:n,classNames:u,styles:d})})]})})})})});wy.classes=pT;wy.displayName="@mantine/core/PopoverDropdown";const $3={refProp:"ref",popupType:"dialog"},mT=Y((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=V("PopoverTarget",$3,e);if(!qo(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 a=i,l=dT(),c=tn(l.reference,n.ref,t),u=l.withRoles?{"aria-haspopup":o,"aria-expanded":l.opened,"aria-controls":l.getDropdownId(),id:l.getTargetId()}:{};return p.cloneElement(n,{...a,...u,...l.targetProps,className:rt(l.targetProps.className,a.className,n.props.className),[r]:c,...l.controlled?null:{onClick:l.onToggle}})});mT.displayName="@mantine/core/PopoverTarget";function gT({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=p.useState(0);p.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return Z4(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Mo(()=>{t.update()},r),Mo(()=>{i(a=>a+1)},[e])}function F3(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 z3(e,t){const n=F3(e.middlewares),r=[oT(e.offset)];return n.shift&&r.push(my(typeof n.shift=="boolean"?{limiter:yb(),padding:5}:{limiter:yb(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?bg():bg(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?wg():wg(n.inline)),r.push(iT({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(c3({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,availableWidth:i,availableHeight:a,...l}){var d;const u=((d=t().refs.floating.current)==null?void 0:d.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:o,availableWidth:i,availableHeight:a,...l}):Object.assign(u,{maxWidth:`${i}px`,maxHeight:`${a}px`})),e.width==="target"&&Object.assign(u,{width:`${o.reference.width}px`})}})),r}function U3(e){const[t,n]=bn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{t&&n(!1)},o=()=>n(!t),i=xy({strategy:e.strategy,placement:e.position,middleware:z3(e,()=>i)});return gT({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:i}),Mo(()=>{var a;(a=e.onPositionChange)==null||a.call(e,i.placement)},[i.placement]),Mo(()=>{var a,l;t?(l=e.onOpen)==null||l.call(e):(a=e.onClose)==null||a.call(e)},[t,e.onClose,e.onOpen]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const B3={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,clickOutsideEvents:["mousedown","touchstart"],zIndex:Xr("popover"),__staticSelector:"Popover",width:"max-content"},V3=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:dt(t),"--popover-shadow":sv(n)}});function Jr(e){var ne,X,ce,ke,J,se;const t=V("Popover",B3,e),{children:n,position:r,offset:o,onPositionChange:i,positionDependencies:a,opened:l,transitionProps:c,width:u,middlewares:d,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:v,unstyled:S,classNames:x,styles:w,closeOnClickOutside:y,withinPortal:b,portalProps:C,closeOnEscape:j,clickOutsideEvents:T,trapFocus:E,onClose:R,onOpen:_,onChange:N,zIndex:O,radius:F,shadow:z,id:H,defaultOpened:D,__staticSelector:k,withRoles:P,disabled:I,returnFocus:L,variant:$,keepMounted:Q,vars:ue,floatingStrategy:Re,...me}=t,ge=de({name:k,props:t,classes:pT,classNames:x,styles:w,unstyled:S,rootSelector:"dropdown",vars:ue,varsResolver:V3}),De=p.useRef(null),[le,Ae]=p.useState(null),[it,Ue]=p.useState(null),{dir:Je}=Ls(),st=Un(H),Be=U3({middlewares:d,width:u,position:uT(Je,r),offset:typeof o=="number"?o+(f?h/2:0):o,arrowRef:De,arrowOffset:m,onPositionChange:i,positionDependencies:a,opened:l,defaultOpened:D,onChange:N,onOpen:_,onClose:R,strategy:Re});gD(()=>y&&Be.onClose(),T,[le,it]);const Ze=p.useCallback(G=>{Ae(G),Be.floating.refs.setReference(G)},[Be.floating.refs.setReference]),at=p.useCallback(G=>{Ue(G),Be.floating.refs.setFloating(G)},[Be.floating.refs.setFloating]);return s.jsx(I3,{value:{returnFocus:L,disabled:I,controlled:Be.controlled,reference:Ze,floating:at,x:Be.floating.x,y:Be.floating.y,arrowX:(ce=(X=(ne=Be.floating)==null?void 0:ne.middlewareData)==null?void 0:X.arrow)==null?void 0:ce.x,arrowY:(se=(J=(ke=Be.floating)==null?void 0:ke.middlewareData)==null?void 0:J.arrow)==null?void 0:se.y,opened:Be.opened,arrowRef:De,transitionProps:c,width:u,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:v,placement:Be.floating.placement,trapFocus:E,withinPortal:b,portalProps:C,zIndex:O,radius:F,shadow:z,closeOnEscape:j,onClose:Be.onClose,onToggle:Be.onToggle,getTargetId:()=>`${st}-target`,getDropdownId:()=>`${st}-dropdown`,withRoles:P,targetProps:me,__staticSelector:k,classNames:x,styles:w,unstyled:S,variant:$,keepMounted:Q,getStyles:ge,floatingStrategy:Re},children:n})}Jr.Target=mT;Jr.Dropdown=wy;Jr.displayName="@mantine/core/Popover";Jr.extend=e=>e;var Br={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 vT=p.forwardRef(({className:e,...t},n)=>s.jsxs(q,{component:"span",className:rt(Br.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Br.bar}),s.jsx("span",{className:Br.bar}),s.jsx("span",{className:Br.bar})]}));vT.displayName="@mantine/core/Bars";const yT=p.forwardRef(({className:e,...t},n)=>s.jsxs(q,{component:"span",className:rt(Br.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Br.dot}),s.jsx("span",{className:Br.dot}),s.jsx("span",{className:Br.dot})]}));yT.displayName="@mantine/core/Dots";const xT=p.forwardRef(({className:e,...t},n)=>s.jsx(q,{component:"span",className:rt(Br.ovalLoader,e),...t,ref:n}));xT.displayName="@mantine/core/Oval";const bT={bars:vT,oval:xT,dots:yT},H3={loaders:bT,type:"oval"},W3=(e,{size:t,color:n})=>({root:{"--loader-size":Ne(t,"loader-size"),"--loader-color":n?ut(n,e):void 0}}),tr=Y((e,t)=>{const n=V("Loader",H3,e),{size:r,color:o,type:i,vars:a,className:l,style:c,classNames:u,styles:d,unstyled:f,loaders:h,variant:m,children:g,...v}=n,S=de({name:"Loader",props:n,classes:Br,className:l,style:c,classNames:u,styles:d,unstyled:f,vars:a,varsResolver:W3});return g?s.jsx(q,{...S("root"),ref:t,...v,children:g}):s.jsx(q,{...S("root"),ref:t,component:h[i],variant:m,size:r,...v})});tr.defaultLoaders=bT;tr.classes=Br;tr.displayName="@mantine/core/Loader";var uh={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21"};const kb={orientation:"horizontal"},q3=(e,{borderWidth:t})=>({group:{"--ai-border-width":B(t)}}),Sy=Y((e,t)=>{const n=V("ActionIconGroup",kb,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=V("ActionIconGroup",kb,e),g=de({name:"ActionIconGroup",props:n,classes:uh,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:q3,rootSelector:"group"});return s.jsx(q,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});Sy.classes=uh;Sy.displayName="@mantine/core/ActionIconGroup";const G3={},Q3=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:a});return{root:{"--ai-size":Ne(t,"ai-size"),"--ai-radius":n===void 0?void 0:dt(n),"--ai-bg":i||r?l.background:void 0,"--ai-hover":i||r?l.hover:void 0,"--ai-hover-color":i||r?l.hoverColor:void 0,"--ai-color":l.color,"--ai-bd":i||r?l.border:void 0}}},Zt=_n((e,t)=>{const n=V("ActionIcon",G3,e),{className:r,unstyled:o,variant:i,classNames:a,styles:l,style:c,loading:u,loaderProps:d,size:f,color:h,radius:m,__staticSelector:g,gradient:v,vars:S,children:x,disabled:w,"data-disabled":y,autoContrast:b,mod:C,...j}=n,T=de({name:["ActionIcon",g],props:n,className:r,style:c,classes:uh,classNames:a,styles:l,unstyled:o,vars:S,varsResolver:Q3});return s.jsxs(Sn,{...T("root",{active:!w&&!u&&!y}),...j,unstyled:o,variant:i,size:f,disabled:w||u,ref:t,mod:[{loading:u,disabled:w||y},C],children:[s.jsx(Yo,{mounted:!!u,transition:"slide-down",duration:150,children:E=>s.jsx(q,{component:"span",...T("loader",{style:E}),"aria-hidden":!0,children:s.jsx(tr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d})})}),s.jsx(q,{component:"span",mod:{loading:u},...T("icon"),children:x})]})});Zt.classes=uh;Zt.displayName="@mantine/core/ActionIcon";Zt.Group=Sy;const wT=p.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>s.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:s.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"})}));wT.displayName="@mantine/core/CloseIcon";var ST={root:"m_86a44da5","root--subtle":"m_220c80f2"};const K3={variant:"subtle"},Y3=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Ne(t,"cb-size"),"--cb-radius":n===void 0?void 0:dt(n),"--cb-icon-size":B(r)}}),Us=_n((e,t)=>{const n=V("CloseButton",K3,e),{iconSize:r,children:o,vars:i,radius:a,className:l,classNames:c,style:u,styles:d,unstyled:f,"data-disabled":h,disabled:m,variant:g,icon:v,mod:S,...x}=n,w=de({name:"CloseButton",props:n,className:l,style:u,classes:ST,classNames:c,styles:d,unstyled:f,vars:i,varsResolver:Y3});return s.jsxs(Sn,{ref:t,...x,unstyled:f,variant:g,disabled:m,mod:[{disabled:m||h},S],...w("root",{variant:g,active:!m&&!h}),children:[v||s.jsx(wT,{}),o]})});Us.classes=ST;Us.displayName="@mantine/core/CloseButton";function X3(e){return p.Children.toArray(e).filter(Boolean)}var jT={root:"m_4081bf90"};const J3={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},Z3=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:i,wrap:a},{childWidth:l})=>({root:{"--group-child-width":t&&n?l:void 0,"--group-gap":Yt(r),"--group-align":o,"--group-justify":i,"--group-wrap":a}}),te=Y((e,t)=>{const n=V("Group",J3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,children:c,gap:u,align:d,justify:f,wrap:h,grow:m,preventGrowOverflow:g,vars:v,variant:S,__size:x,mod:w,...y}=n,b=X3(c),C=b.length,j=Yt(u??"md"),E={childWidth:`calc(${100/C}% - (${j} - ${j} / ${C}))`},R=de({name:"Group",props:n,stylesCtx:E,className:o,style:i,classes:jT,classNames:r,styles:a,unstyled:l,vars:v,varsResolver:Z3});return s.jsx(q,{...R("root"),ref:t,variant:S,mod:[{grow:m},w],size:x,...y,children:b})});te.classes=jT;te.displayName="@mantine/core/Group";var CT={root:"m_9814e45f"};const eM={zIndex:Xr("modal")},tM=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:a})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&vr(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${B(o)})`:void 0,"--overlay-radius":i===void 0?void 0:dt(i),"--overlay-z-index":a==null?void 0:a.toString()}}),Ic=_n((e,t)=>{const n=V("Overlay",eM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,fixed:u,center:d,children:f,radius:h,zIndex:m,gradient:g,blur:v,color:S,backgroundOpacity:x,mod:w,...y}=n,b=de({name:"Overlay",props:n,classes:CT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:tM});return s.jsx(q,{ref:t,...b("root"),mod:[{center:d,fixed:u},w],...y,children:f})});Ic.classes=CT;Ic.displayName="@mantine/core/Overlay";const[nM,Xo]=zn("ModalBase component was not found in tree");function rM({opened:e,transitionDuration:t}){const[n,r]=p.useState(e),o=p.useRef(),a=cv()?0:t;return p.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):a===0?r(!1):o.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(o.current)),[e,a]),n}function oM({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:a}){const l=Un(e),[c,u]=p.useState(!1),[d,f]=p.useState(!1),h=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,m=rM({opened:n,transitionDuration:h});return vj("keydown",g=>{var v;g.key==="Escape"&&o&&n&&((v=g.target)==null?void 0:v.getAttribute("data-mantine-stop-propagation"))!=="true"&&i()},{capture:!0}),hj({opened:n,shouldReturnFocus:r&&a}),{_id:l,titleMounted:c,bodyMounted:d,shouldLockScroll:m,setTitleMounted:u,setBodyMounted:f}}const ET=p.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,trapFocus:i,closeOnEscape:a,returnFocus:l,closeOnClickOutside:c,withinPortal:u,portalProps:d,lockScroll:f,children:h,zIndex:m,shadow:g,padding:v,__vars:S,unstyled:x,removeScrollProps:w,...y},b)=>{const{_id:C,titleMounted:j,bodyMounted:T,shouldLockScroll:E,setTitleMounted:R,setBodyMounted:_}=oM({id:r,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:a,onClose:n,returnFocus:l}),{key:N,...O}=w||{};return s.jsx(zs,{...d,withinPortal:u,children:s.jsx(nM,{value:{opened:t,onClose:n,closeOnClickOutside:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:j,bodyMounted:T,setTitleMounted:R,setBodyMounted:_,trapFocus:i,closeOnEscape:a,zIndex:m,unstyled:x},children:s.jsx(Mf,{enabled:E&&f,...O,children:s.jsx(q,{ref:b,...y,__vars:{...S,"--mb-z-index":(m||Xr("modal")).toString(),"--mb-shadow":sv(g),"--mb-padding":Yt(v)},children:h})},N)})})});ET.displayName="@mantine/core/ModalBase";function iM(){const e=Xo();return p.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var el={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const TT=p.forwardRef(({className:e,...t},n)=>{const r=iM(),o=Xo();return s.jsx(q,{ref:n,...t,id:r,className:rt({[el.body]:!o.unstyled},e)})});TT.displayName="@mantine/core/ModalBaseBody";const PT=p.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Xo();return s.jsx(Us,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:rt({[el.close]:!o.unstyled},e),unstyled:o.unstyled})});PT.displayName="@mantine/core/ModalBaseCloseButton";const kT=p.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},a)=>{const l=Xo();return s.jsx(Yo,{mounted:l.opened,transition:"pop",...l.transitionProps,...e,children:c=>s.jsx("div",{...n,className:rt({[el.inner]:!l.unstyled},n.className),children:s.jsx(ch,{active:l.opened&&l.trapFocus,innerRef:a,children:s.jsx(Jn,{...i,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":l.bodyMounted?l.getBodyId():void 0,"aria-labelledby":l.titleMounted?l.getTitleId():void 0,style:[o,c],className:rt({[el.content]:!l.unstyled},t),unstyled:l.unstyled,children:i.children})})})})});kT.displayName="@mantine/core/ModalBaseContent";const RT=p.forwardRef(({className:e,...t},n)=>{const r=Xo();return s.jsx(q,{component:"header",ref:n,className:rt({[el.header]:!r.unstyled},e),...t})});RT.displayName="@mantine/core/ModalBaseHeader";const sM={duration:200,timingFunction:"ease",transition:"fade"};function aM(e){const t=Xo();return{...sM,...t.transitionProps,...e}}const _T=p.forwardRef(({onClick:e,transitionProps:t,style:n,...r},o)=>{const i=Xo(),a=aM(t);return s.jsx(Yo,{mounted:i.opened,...a,transition:"fade",children:l=>s.jsx(Ic,{ref:o,fixed:!0,style:[n,l],zIndex:i.zIndex,unstyled:i.unstyled,onClick:c=>{e==null||e(c),i.closeOnClickOutside&&i.onClose()},...r})})});_T.displayName="@mantine/core/ModalBaseOverlay";function lM(){const e=Xo();return p.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const DT=p.forwardRef(({className:e,...t},n)=>{const r=lM(),o=Xo();return s.jsx(q,{component:"h2",ref:n,className:rt({[el.title]:!o.unstyled},e),...t,id:r})});DT.displayName="@mantine/core/ModalBaseTitle";function cM({children:e}){return s.jsx(s.Fragment,{children:e})}const[uM,pl]=Ns({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var _r={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 Rb={},dM=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${hn(t)} - ${B(2)})`}}),dh=Y((e,t)=>{const n=V("InputDescription",Rb,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=V("InputDescription",Rb,n),g=pl(),v=de({name:["InputWrapper",d],props:n,classes:_r,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"description",vars:c,varsResolver:dM}),S=f&&(g==null?void 0:g.getStyles)||v;return s.jsx(q,{component:"p",ref:t,variant:h,size:u,...S("description",g!=null&&g.getStyles?{className:o,style:i}:void 0),...m})});dh.classes=_r;dh.displayName="@mantine/core/InputDescription";const fM={},hM=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${hn(t)} - ${B(2)})`}}),fh=Y((e,t)=>{const n=V("InputError",fM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=n,g=de({name:["InputWrapper",d],props:n,classes:_r,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"error",vars:c,varsResolver:hM}),v=pl(),S=f&&(v==null?void 0:v.getStyles)||g;return s.jsx(q,{component:"p",ref:t,variant:h,size:u,...S("error",v!=null&&v.getStyles?{className:o,style:i}:void 0),...m})});fh.classes=_r;fh.displayName="@mantine/core/InputError";const _b={labelElement:"label"},pM=(e,{size:t})=>({label:{"--input-label-size":hn(t),"--input-asterisk-color":void 0}}),hh=Y((e,t)=>{const n=V("InputLabel",_b,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,labelElement:u,size:d,required:f,htmlFor:h,onMouseDown:m,children:g,__staticSelector:v,variant:S,mod:x,...w}=V("InputLabel",_b,n),y=de({name:["InputWrapper",v],props:n,classes:_r,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"label",vars:c,varsResolver:pM}),b=pl(),C=(b==null?void 0:b.getStyles)||y;return s.jsxs(q,{...C("label",b!=null&&b.getStyles?{className:o,style:i}:void 0),component:u,variant:S,size:d,ref:t,htmlFor:u==="label"?h:void 0,mod:[{required:f},x],onMouseDown:j=>{m==null||m(j),!j.defaultPrevented&&j.detail>1&&j.preventDefault()},...w,children:[g,f&&s.jsx("span",{...C("required"),"aria-hidden":!0,children:" *"})]})});hh.classes=_r;hh.displayName="@mantine/core/InputLabel";const Db={},jy=Y((e,t)=>{const n=V("InputPlaceholder",Db,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,__staticSelector:u,variant:d,error:f,mod:h,...m}=V("InputPlaceholder",Db,n),g=de({name:["InputPlaceholder",u],props:n,classes:_r,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"placeholder"});return s.jsx(q,{...g("placeholder"),mod:[{error:!!f},h],component:"span",variant:d,ref:t,...m})});jy.classes=_r;jy.displayName="@mantine/core/InputPlaceholder";function mM(e,{hasDescription:t,hasError:n}){const r=e.findIndex(c=>c==="input"),o=e.slice(0,r),i=e.slice(r+1),a=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&i.includes("description")||n&&i.includes("error"),offsetTop:a}}const gM={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},vM=(e,{size:t})=>({label:{"--input-label-size":hn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${hn(t)} - ${B(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${hn(t)} - ${B(2)})`}}),Cy=Y((e,t)=>{const n=V("InputWrapper",gM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,variant:d,__staticSelector:f,inputContainer:h,inputWrapperOrder:m,label:g,error:v,description:S,labelProps:x,descriptionProps:w,errorProps:y,labelElement:b,children:C,withAsterisk:j,id:T,required:E,__stylesApiProps:R,mod:_,...N}=n,O=de({name:["InputWrapper",f],props:R||n,classes:_r,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:vM}),F={size:u,variant:d,__staticSelector:f},z=Un(T),H=typeof j=="boolean"?j:E,D=(y==null?void 0:y.id)||`${z}-error`,k=(w==null?void 0:w.id)||`${z}-description`,P=z,I=!!v&&typeof v!="boolean",L=!!S,$=`${I?D:""} ${L?k:""}`,Q=$.trim().length>0?$.trim():void 0,ue=(x==null?void 0:x.id)||`${z}-label`,Re=g&&s.jsx(hh,{labelElement:b,id:ue,htmlFor:P,required:H,...F,...x,children:g},"label"),me=L&&s.jsx(dh,{...w,...F,size:(w==null?void 0:w.size)||F.size,id:(w==null?void 0:w.id)||k,children:S},"description"),ge=s.jsx(p.Fragment,{children:h(C)},"input"),De=I&&p.createElement(fh,{...y,...F,size:(y==null?void 0:y.size)||F.size,key:"error",id:(y==null?void 0:y.id)||D},v),le=m.map(Ae=>{switch(Ae){case"label":return Re;case"input":return ge;case"description":return me;case"error":return De;default:return null}});return s.jsx(uM,{value:{getStyles:O,describedBy:Q,inputId:P,labelId:ue,...mM(m,{hasDescription:L,hasError:I})},children:s.jsx(q,{ref:t,variant:d,size:u,mod:[{error:!!v},_],...O("root"),...N,children:le})})});Cy.classes=_r;Cy.displayName="@mantine/core/InputWrapper";const yM={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},xM=(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":Ne(t.size,"input-height"),"--input-fz":hn(t.size),"--input-radius":t.radius===void 0?void 0:dt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?B(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?B(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?Ne(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),Lt=_n((e,t)=>{const n=V("Input",yM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,required:c,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:h,error:m,disabled:g,leftSection:v,leftSectionProps:S,leftSectionWidth:x,rightSection:w,rightSectionProps:y,rightSectionWidth:b,rightSectionPointerEvents:C,leftSectionPointerEvents:j,variant:T,vars:E,pointer:R,multiline:_,radius:N,id:O,withAria:F,withErrorStyles:z,mod:H,inputSize:D,...k}=n,{styleProps:P,rest:I}=Qo(k),L=pl(),$={offsetBottom:L==null?void 0:L.offsetBottom,offsetTop:L==null?void 0:L.offsetTop},Q=de({name:["Input",u],props:d||n,classes:_r,className:o,style:i,classNames:r,styles:a,unstyled:l,stylesCtx:$,rootSelector:"wrapper",vars:E,varsResolver:xM}),ue=F?{required:c,disabled:g,"aria-invalid":!!m,"aria-describedby":L==null?void 0:L.describedBy,id:(L==null?void 0:L.inputId)||O}:{};return s.jsxs(q,{...Q("wrapper"),...P,...h,mod:[{error:!!m&&z,pointer:R,disabled:g,multiline:_,"data-with-right-section":!!w,"data-with-left-section":!!v},H],variant:T,size:f,children:[v&&s.jsx("div",{...S,"data-position":"left",...Q("section",{className:S==null?void 0:S.className,style:S==null?void 0:S.style}),children:v}),s.jsx(q,{component:"input",...I,...ue,ref:t,required:c,mod:{disabled:g,error:!!m&&z},variant:T,__size:D,...Q("input")}),w&&s.jsx("div",{...y,"data-position":"right",...Q("section",{className:y==null?void 0:y.className,style:y==null?void 0:y.style}),children:w})]})});Lt.classes=_r;Lt.Wrapper=Cy;Lt.Label=hh;Lt.Error=fh;Lt.Description=dh;Lt.Placeholder=jy;Lt.displayName="@mantine/core/Input";function bM(e,t,n){const r=V(e,t,n),{label:o,description:i,error:a,required:l,classNames:c,styles:u,className:d,unstyled:f,__staticSelector:h,__stylesApiProps:m,errorProps:g,labelProps:v,descriptionProps:S,wrapperProps:x,id:w,size:y,style:b,inputContainer:C,inputWrapperOrder:j,withAsterisk:T,variant:E,vars:R,mod:_,...N}=r,{styleProps:O,rest:F}=Qo(N),z={label:o,description:i,error:a,required:l,classNames:c,className:d,__staticSelector:h,__stylesApiProps:m||r,errorProps:g,labelProps:v,descriptionProps:S,unstyled:f,styles:u,size:y,style:b,inputContainer:C,inputWrapperOrder:j,withAsterisk:T,variant:E,id:w,mod:_,...x};return{...F,classNames:c,styles:u,unstyled:f,wrapperProps:{...z,...O},inputProps:{required:l,classNames:c,styles:u,unstyled:f,size:y,__staticSelector:h,__stylesApiProps:m||r,error:a,variant:E,id:w}}}const wM={__staticSelector:"InputBase",withAria:!0},rr=_n((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=bM("InputBase",wM,e);return s.jsx(Lt.Wrapper,{...r,children:s.jsx(Lt,{...n,...o,ref:t})})});rr.classes={...Lt.classes,...Lt.Wrapper.classes};rr.displayName="@mantine/core/InputBase";const SM={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 IT={root:"m_8bffd616"};const jM={},Es=_n((e,t)=>{const n=V("Flex",jM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:v,...S}=n,x=de({name:"Flex",classes:IT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),w=At(),y=Kc(),b=Cj({styleProps:{gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:v},theme:w,data:SM});return s.jsxs(s.Fragment,{children:[b.hasResponsiveStyles&&s.jsx(Os,{selector:`.${y}`,styles:b.styles,media:b.media}),s.jsx(q,{ref:t,...x("root",{className:y,style:Li(b.inlineStyles)}),...S})]})});Es.classes=IT;Es.displayName="@mantine/core/Flex";function CM(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 EM({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=p.useRef(),[i,a]=p.useState(!1),[l,c]=p.useState(typeof r=="boolean"?r:!1),u=()=>{if(!e||!t)return;const m=e.getBoundingClientRect(),g=t.getBoundingClientRect(),v={top:m.top-g.top,left:m.left-g.left,width:m.width,height:m.height};n.current&&(n.current.style.transform=`translateY(${v.top}px) translateX(${v.left}px)`,n.current.style.width=`${v.width}px`,n.current.style.height=`${v.height}px`)},d=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),u(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},f=p.useRef(),h=p.useRef();return p.useEffect(()=>{if(u(),e)return f.current=new ResizeObserver(d),f.current.observe(e),t&&(h.current=new ResizeObserver(d),h.current.observe(t)),()=>{var m,g;(m=f.current)==null||m.disconnect(),(g=h.current)==null||g.disconnect()}},[t,e]),p.useEffect(()=>{if(t){const m=g=>{CM(g.target,t)&&(d(),c(!1))};return t.addEventListener("transitionend",m),()=>{t.removeEventListener("transitionend",m)}}},[t]),AD(()=>{yj()!=="test"&&a(!0)},20,{autoInvoke:!0}),ND(m=>{m.forEach(g=>{g.type==="attributes"&&g.attributeName==="dir"&&d()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:i,hidden:l}}var AT={root:"m_96b553a6"};const TM={},PM=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Ey=Y((e,t)=>{const n=V("FloatingIndicator",TM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,target:u,parent:d,transitionDuration:f,mod:h,displayAfterTransitionEnd:m,...g}=n,v=de({name:"FloatingIndicator",classes:AT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:PM}),S=p.useRef(null),{initialized:x,hidden:w}=EM({target:u,parent:d,ref:S,displayAfterTransitionEnd:m}),y=tn(t,S);return!u||!d?null:s.jsx(q,{ref:y,mod:[{initialized:x,hidden:w},h],...v("root"),...g})});Ey.displayName="@mantine/core/FloatingIndicator";Ey.classes=AT;var NT={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 kM={},RM=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const i=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:dt(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},Bi=Y((e,t)=>{const n=V("Alert",kM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,radius:u,color:d,title:f,children:h,id:m,icon:g,withCloseButton:v,onClose:S,closeButtonLabel:x,variant:w,autoContrast:y,...b}=n,C=de({name:"Alert",classes:NT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:RM}),j=Un(m),T=f&&`${j}-title`||void 0,E=`${j}-body`;return s.jsx(q,{id:j,...C("root",{variant:w}),variant:w,ref:t,...b,role:"alert","aria-describedby":E,"aria-labelledby":T,children:s.jsxs("div",{...C("wrapper"),children:[g&&s.jsx("div",{...C("icon"),children:g}),s.jsxs("div",{...C("body"),children:[f&&s.jsx("div",{...C("title"),"data-with-close-button":v||void 0,children:s.jsx("span",{id:T,...C("label"),children:f})}),h&&s.jsx("div",{id:E,...C("message"),"data-variant":w,children:h})]}),v&&s.jsx(Us,{...C("closeButton"),onClick:S,variant:"transparent",size:16,iconSize:16,"aria-label":x,unstyled:l})]})})});Bi.classes=NT;Bi.displayName="@mantine/core/Alert";var MT={root:"m_b6d8b162"};function _M(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const DM={inherit:!1},IM=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":hn(o),"--text-lh":uj(o),"--text-gradient":t==="gradient"?vm(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?ut(i,e):void 0}}),he=_n((e,t)=>{const n=V("Text",DM,e),{lineClamp:r,truncate:o,inline:i,inherit:a,gradient:l,span:c,__staticSelector:u,vars:d,className:f,style:h,classNames:m,styles:g,unstyled:v,variant:S,mod:x,size:w,...y}=n,b=de({name:["Text",u],props:n,classes:MT,className:f,style:h,classNames:m,styles:g,unstyled:v,vars:d,varsResolver:IM});return s.jsx(q,{...b("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:S,mod:[{"data-truncate":_M(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":a},x],size:w,...y})});he.classes=MT;he.displayName="@mantine/core/Text";var OT={root:"m_849cf0da"};const AM={underline:"hover"},Xe=_n((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...a}=V("Anchor",AM,e);return s.jsx(he,{component:"a",ref:t,className:rt({[OT.root]:!o},r),...a,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});Xe.classes=OT;Xe.displayName="@mantine/core/Anchor";const[NM,ml]=zn("AppShell was not found in tree");var Vi={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const MM={},Ty=Y((e,t)=>{const n=V("AppShellAside",MM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=ml();return m.disabled?null:s.jsx(q,{component:"aside",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("aside",{className:o,classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-aside-z-index":`calc(${d??m.zIndex} + 1)`}})});Ty.classes=Vi;Ty.displayName="@mantine/core/AppShellAside";const OM={},Py=Y((e,t)=>{var g;const n=V("AppShellFooter",OM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=ml();return m.disabled?null:s.jsx(q,{component:"footer",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("footer",{className:rt({[Mf.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-footer-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});Py.classes=Vi;Py.displayName="@mantine/core/AppShellFooter";const LM={},ky=Y((e,t)=>{var g;const n=V("AppShellHeader",LM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=ml();return m.disabled?null:s.jsx(q,{component:"header",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("header",{className:rt({[Mf.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-header-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});ky.classes=Vi;ky.displayName="@mantine/core/AppShellHeader";const $M={},Ry=Y((e,t)=>{const n=V("AppShellMain",$M,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=ml();return s.jsx(q,{component:"main",ref:t,...u.getStyles("main",{className:o,style:i,classNames:r,styles:a}),...c})});Ry.classes=Vi;Ry.displayName="@mantine/core/AppShellMain";function nu(e){return typeof e=="object"?e.base:e}function ru(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 ou(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function FM({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,a="translateX(var(--app-shell-aside-width))",l="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((c=r==null?void 0:r.collapsed)!=null&&c.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-aside-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-aside-offset"]="0px"),ru(i)){const f=B(nu(i));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(ou(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=B(i.base),e["--app-shell-aside-offset"]=B(i.base)),bt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=B(i[f]),t[f]["--app-shell-aside-offset"]=B(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=a,t[f]["--app-shell-aside-transform-rtl"]=l,t[f]["--app-shell-aside-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=av(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"]=a,n[f]["--app-shell-aside-transform-rtl"]=l}}function zM({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,o="translateY(var(--app-shell-footer-height))",i=(n==null?void 0:n.offset)??!0;if(ru(r)){const a=B(nu(r));e["--app-shell-footer-height"]=a,i&&(e["--app-shell-footer-offset"]=a)}ou(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=B(r.base),i&&(e["--app-shell-footer-offset"]=B(r.base))),bt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-footer-height"]=B(r[a]),i&&(t[a]["--app-shell-footer-offset"]=B(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function UM({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,o="translateY(calc(var(--app-shell-header-height) * -1))",i=(n==null?void 0:n.offset)??!0;if(ru(r)){const a=B(nu(r));e["--app-shell-header-height"]=a,i&&(e["--app-shell-header-offset"]=a)}ou(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=B(r.base),i&&(e["--app-shell-header-offset"]=B(r.base))),bt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-header-height"]=B(r[a]),i&&(t[a]["--app-shell-header-offset"]=B(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function BM({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,a="translateX(calc(var(--app-shell-navbar-width) * -1))",l="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((c=r==null?void 0:r.collapsed)!=null&&c.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-navbar-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-navbar-offset"]="0px"),ru(i)){const f=B(nu(i));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(ou(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=B(i.base),e["--app-shell-navbar-offset"]=B(i.base)),bt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=B(i[f]),t[f]["--app-shell-navbar-offset"]=B(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=a,t[f]["--app-shell-navbar-transform-rtl"]=l,t[f]["--app-shell-navbar-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=av(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"]=a,n[f]["--app-shell-navbar-transform-rtl"]=l}}function Yp(e){return Number(e)===0?"0px":Yt(e)}function VM({padding:e,baseStyles:t,minMediaStyles:n}){ru(e)&&(t["--app-shell-padding"]=Yp(nu(e))),ou(e)&&(e.base&&(t["--app-shell-padding"]=Yp(e.base)),bt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Yp(e[r]))}))}function HM({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const a={},l={},c={};BM({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,navbar:e,theme:i}),FM({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,aside:r,theme:i}),UM({baseStyles:c,minMediaStyles:a,header:t}),zM({baseStyles:c,minMediaStyles:a,footer:n}),VM({baseStyles:c,minMediaStyles:a,padding:o});const u=fc(bt(a),i.breakpoints).map(h=>({query:`(min-width: ${Id(h.px)})`,styles:a[h.value]})),d=fc(bt(l),i.breakpoints).map(h=>({query:`(max-width: ${Id(h.px)})`,styles:l[h.value]})),f=[...u,...d];return{baseStyles:c,media:f}}function WM({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=At(),a=$i(),{media:l,baseStyles:c}=HM({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return s.jsx(Os,{media:l,styles:c,selector:a.cssVariablesSelector})}const qM={},_y=Y((e,t)=>{const n=V("AppShellNavbar",qM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=ml();return m.disabled?null:s.jsx(q,{component:"nav",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("navbar",{className:o,classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-navbar-z-index":`calc(${d??m.zIndex} + 1)`}})});_y.classes=Vi;_y.displayName="@mantine/core/AppShellNavbar";const GM={},Dy=_n((e,t)=>{const n=V("AppShellSection",GM,e),{classNames:r,className:o,style:i,styles:a,vars:l,grow:c,mod:u,...d}=n,f=ml();return s.jsx(q,{ref:t,mod:[{grow:c},u],...f.getStyles("section",{className:o,style:i,classNames:r,styles:a}),...d})});Dy.classes=Vi;Dy.displayName="@mantine/core/AppShellSection";function QM({transitionDuration:e,disabled:t}){const[n,r]=p.useState(!0),o=p.useRef(),i=p.useRef();return vj("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>p.startTransition(()=>{r(!1)}),200)}),cl(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>p.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const KM={withBorder:!0,offsetScrollbars:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Xr("app")},YM=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),er=Y((e,t)=>{const n=V("AppShell",KM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,navbar:u,withBorder:d,padding:f,transitionDuration:h,transitionTimingFunction:m,header:g,zIndex:v,layout:S,disabled:x,aside:w,footer:y,offsetScrollbars:b,mod:C,...j}=n,T=de({name:"AppShell",classes:Vi,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:YM}),E=QM({disabled:x,transitionDuration:h});return s.jsxs(NM,{value:{getStyles:T,withBorder:d,zIndex:v,disabled:x,offsetScrollbars:b},children:[s.jsx(WM,{navbar:u,header:g,aside:w,footer:y,padding:f}),s.jsx(q,{ref:t,...T("root"),mod:[{resizing:E,layout:S,disabled:x},C],...j})]})});er.classes=Vi;er.displayName="@mantine/core/AppShell";er.Navbar=_y;er.Header=ky;er.Main=Ry;er.Aside=Ty;er.Footer=Py;er.Section=Dy;function LT(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=>LT(t))}:e}function $T(e){return e?e.map(t=>LT(t)):[]}function FT(e){return e.reduce((t,n)=>"group"in n?{...t,...FT(n.items)}:(t[n.value]=n,t),{})}var nr={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 XM={error:null},JM=(e,{size:t})=>({chevron:{"--combobox-chevron-size":Ne(t,"combobox-chevron-size")}}),ph=Y((e,t)=>{const n=V("ComboboxChevron",XM,e),{size:r,error:o,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,mod:f,...h}=n,m=de({name:"ComboboxChevron",classes:nr,props:n,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,varsResolver:JM,rootSelector:"chevron"});return s.jsx(q,{component:"svg",...h,...m("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},f],ref:t,children:s.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"})})});ph.classes=nr;ph.displayName="@mantine/core/ComboboxChevron";const[ZM,Dr]=zn("Combobox component was not found in tree"),zT=p.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>s.jsx(Us,{ref:i,size:e||"sm",variant:"transparent",tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:a=>{a.preventDefault(),t==null||t(a)},onClick:a=>{r(),n==null||n(a)}}));zT.displayName="@mantine/core/ComboboxClearButton";const eO={},Iy=Y((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:a,...l}=V("ComboboxDropdown",eO,e),c=Dr();return s.jsx(Jr.Dropdown,{...l,ref:t,role:"presentation","data-hidden":a||void 0,...c.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});Iy.classes=nr;Iy.displayName="@mantine/core/ComboboxDropdown";const tO={refProp:"ref"},UT=Y((e,t)=>{const{children:n,refProp:r}=V("ComboboxDropdownTarget",tO,e);if(Dr(),!qo(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 s.jsx(Jr.Target,{ref:t,refProp:r,children:n})});UT.displayName="@mantine/core/ComboboxDropdownTarget";const nO={},Ay=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("ComboboxEmpty",nO,e),c=Dr();return s.jsx(q,{ref:t,...c.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...l})});Ay.classes=nr;Ay.displayName="@mantine/core/ComboboxEmpty";function Ny({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const a=Dr(),[l,c]=p.useState(null),u=f=>{if(e==null||e(f),!a.readOnly&&t){if(f.nativeEvent.isComposing)return;if(f.nativeEvent.code==="ArrowDown"&&(f.preventDefault(),a.store.dropdownOpened?c(a.store.selectNextOption()):(a.store.openDropdown("keyboard"),c(a.store.selectActiveOption()))),f.nativeEvent.code==="ArrowUp"&&(f.preventDefault(),a.store.dropdownOpened?c(a.store.selectPreviousOption()):(a.store.openDropdown("keyboard"),c(a.store.selectActiveOption()))),f.nativeEvent.code==="Enter"||f.nativeEvent.code==="NumpadEnter"){if(f.nativeEvent.keyCode===229)return;const h=a.store.getSelectedOptionIndex();a.store.dropdownOpened&&h!==-1?(f.preventDefault(),a.store.clickSelectedOption()):o==="button"&&(f.preventDefault(),a.store.openDropdown("keyboard"))}f.nativeEvent.code==="Escape"&&a.store.closeDropdown("keyboard"),f.nativeEvent.code==="Space"&&o==="button"&&(f.preventDefault(),a.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(a.store.listId&&a.store.dropdownOpened)||void 0,"aria-controls":a.store.listId,"aria-activedescendant":a.store.dropdownOpened&&l||void 0,autoComplete:i,"data-expanded":a.store.dropdownOpened||void 0,"data-mantine-stop-propagation":a.store.dropdownOpened||void 0}:{},onKeyDown:u}}const rO={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},BT=Y((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=V("ComboboxEventsTarget",rO,e);if(!qo(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 d=Dr(),f=Ny({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c});return p.cloneElement(n,{...f,...u,[r]:tn(t,d.store.targetRef,n==null?void 0:n.ref)})});BT.displayName="@mantine/core/ComboboxEventsTarget";const oO={},My=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("ComboboxFooter",oO,e),c=Dr();return s.jsx(q,{ref:t,...c.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...l,onMouseDown:u=>{u.preventDefault()}})});My.classes=nr;My.displayName="@mantine/core/ComboboxFooter";const iO={},Oy=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,children:l,label:c,...u}=V("ComboboxGroup",iO,e),d=Dr();return s.jsxs(q,{ref:t,...d.getStyles("group",{className:r,classNames:n,style:o,styles:i}),...u,children:[c&&s.jsx("div",{...d.getStyles("groupLabel",{classNames:n,styles:i}),children:c}),l]})});Oy.classes=nr;Oy.displayName="@mantine/core/ComboboxGroup";const sO={},Ly=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("ComboboxHeader",sO,e),c=Dr();return s.jsx(q,{ref:t,...c.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...l,onMouseDown:u=>{u.preventDefault()}})});Ly.classes=nr;Ly.displayName="@mantine/core/ComboboxHeader";function VT({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}VT.displayName="@mantine/core/ComboboxHiddenInput";const aO={},$y=Y((e,t)=>{const n=V("ComboboxOption",aO,e),{classNames:r,className:o,style:i,styles:a,vars:l,onClick:c,id:u,active:d,onMouseDown:f,onMouseOver:h,disabled:m,selected:g,mod:v,...S}=n,x=Dr(),w=p.useId(),y=u||w;return s.jsx(q,{...x.getStyles("option",{className:o,classNames:r,styles:a,style:i}),...S,ref:t,id:y,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":m,"combobox-selected":g},v],role:"option",onClick:b=>{var C;m?b.preventDefault():((C=x.onOptionSubmit)==null||C.call(x,n.value,n),c==null||c(b))},onMouseDown:b=>{b.preventDefault(),f==null||f(b)},onMouseOver:b=>{x.resetSelectionOnOptionHover&&x.store.resetSelectedOption(),h==null||h(b)}})});$y.classes=nr;$y.displayName="@mantine/core/ComboboxOption";const lO={},Fy=Y((e,t)=>{const n=V("ComboboxOptions",lO,e),{classNames:r,className:o,style:i,styles:a,id:l,onMouseDown:c,labelledBy:u,...d}=n,f=Dr(),h=Un(l);return p.useEffect(()=>{f.store.setListId(h)},[h]),s.jsx(q,{ref:t,...f.getStyles("options",{className:o,style:i,classNames:r,styles:a}),...d,id:h,role:"listbox","aria-labelledby":u,onMouseDown:m=>{m.preventDefault(),c==null||c(m)}})});Fy.classes=nr;Fy.displayName="@mantine/core/ComboboxOptions";const cO={withAriaAttributes:!0,withKeyboardNavigation:!0},zy=Y((e,t)=>{const n=V("ComboboxSearch",cO,e),{classNames:r,styles:o,unstyled:i,vars:a,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:u,size:d,...f}=n,h=Dr(),m=h.getStyles("search"),g=Ny({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return s.jsx(Lt,{ref:tn(t,h.store.searchRef),classNames:[{input:m.className},r],styles:[{input:m.style},o],size:d||h.size,...g,...f,__staticSelector:"Combobox"})});zy.classes=nr;zy.displayName="@mantine/core/ComboboxSearch";const uO={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},HT=Y((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=V("ComboboxTarget",uO,e);if(!qo(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 d=Dr(),f=Ny({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c}),h=p.cloneElement(n,{...f,...u});return s.jsx(Jr.Target,{ref:tn(t,d.store.targetRef),children:h})});HT.displayName="@mantine/core/ComboboxTarget";function dO(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 fO(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 hO(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function iu({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:a="instant"}={}){const[l,c]=bn({value:t,defaultValue:e,finalValue:!1,onChange:n}),u=p.useRef(null),d=p.useRef(-1),f=p.useRef(null),h=p.useRef(null),m=p.useRef(-1),g=p.useRef(-1),v=p.useRef(-1),S=p.useCallback((D="unknown")=>{l||(c(!0),o==null||o(D))},[c,o,l]),x=p.useCallback((D="unknown")=>{l&&(c(!1),r==null||r(D))},[c,r,l]),w=p.useCallback((D="unknown")=>{l?x(D):S(D)},[x,S,l]),y=p.useCallback(()=>{const D=document.querySelector(`#${u.current} [data-combobox-selected]`);D==null||D.removeAttribute("data-combobox-selected"),D==null||D.removeAttribute("aria-selected")},[]),b=p.useCallback(D=>{const k=document.getElementById(u.current),P=k==null?void 0:k.querySelectorAll("[data-combobox-option]");if(!P)return null;const I=D>=P.length?0:D<0?P.length-1:D;return d.current=I,P!=null&&P[I]&&!P[I].hasAttribute("data-combobox-disabled")?(y(),P[I].setAttribute("data-combobox-selected","true"),P[I].setAttribute("aria-selected","true"),P[I].scrollIntoView({block:"nearest",behavior:a}),P[I].id):null},[a,y]),C=p.useCallback(()=>{const D=document.querySelector(`#${u.current} [data-combobox-active]`);if(D){const k=document.querySelectorAll(`#${u.current} [data-combobox-option]`),P=Array.from(k).findIndex(I=>I===D);return b(P)}return b(0)},[b]),j=p.useCallback(()=>b(fO(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),T=p.useCallback(()=>b(dO(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),E=p.useCallback(()=>b(hO(document.querySelectorAll(`#${u.current} [data-combobox-option]`))),[b]),R=p.useCallback((D="selected",k)=>{v.current=window.setTimeout(()=>{var L;const P=document.querySelectorAll(`#${u.current} [data-combobox-option]`),I=Array.from(P).findIndex($=>$.hasAttribute(`data-combobox-${D}`));d.current=I,k!=null&&k.scrollIntoView&&((L=P[I])==null||L.scrollIntoView({block:"nearest",behavior:a}))},0)},[]),_=p.useCallback(()=>{d.current=-1,y()},[y]),N=p.useCallback(()=>{const D=document.querySelectorAll(`#${u.current} [data-combobox-option]`),k=D==null?void 0:D[d.current];k==null||k.click()},[]),O=p.useCallback(D=>{u.current=D},[]),F=p.useCallback(()=>{m.current=window.setTimeout(()=>f.current.focus(),0)},[]),z=p.useCallback(()=>{g.current=window.setTimeout(()=>h.current.focus(),0)},[]),H=p.useCallback(()=>d.current,[]);return p.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),{dropdownOpened:l,openDropdown:S,closeDropdown:x,toggleDropdown:w,selectedOptionIndex:d.current,getSelectedOptionIndex:H,selectOption:b,selectFirstOption:E,selectActiveOption:C,selectNextOption:j,selectPreviousOption:T,resetSelectedOption:_,updateSelectedOptionIndex:R,listId:u.current,setListId:O,clickSelectedOption:N,searchRef:f,focusSearchInput:F,targetRef:h,focusTarget:z}}const pO={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},mO=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":hn(t),"--combobox-option-padding":Ne(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:B(n),"--combobox-option-fz":hn(t),"--combobox-option-padding":Ne(t,"combobox-option-padding")}});function Oe(e){const t=V("Combobox",pO,e),{classNames:n,styles:r,unstyled:o,children:i,store:a,vars:l,onOptionSubmit:c,onClose:u,size:d,dropdownPadding:f,resetSelectionOnOptionHover:h,__staticSelector:m,readOnly:g,...v}=t,S=iu(),x=a||S,w=de({name:m||"Combobox",classes:nr,props:t,classNames:n,styles:r,unstyled:o,vars:l,varsResolver:mO}),y=()=>{u==null||u(),x.closeDropdown()};return s.jsx(ZM,{value:{getStyles:w,store:x,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:h,readOnly:g},children:s.jsx(Jr,{opened:x.dropdownOpened,...v,onChange:b=>!b&&y(),withRoles:!1,unstyled:o,children:i})})}const gO=e=>e;Oe.extend=gO;Oe.classes=nr;Oe.displayName="@mantine/core/Combobox";Oe.Target=HT;Oe.Dropdown=Iy;Oe.Options=Fy;Oe.Option=$y;Oe.Search=zy;Oe.Empty=Ay;Oe.Chevron=ph;Oe.Footer=My;Oe.Header=Ly;Oe.EventsTarget=BT;Oe.DropdownTarget=UT;Oe.Group=Oy;Oe.ClearButton=zT;Oe.HiddenInput=VT;var WT={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const qT=WT,mh=p.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:i,children:a,label:l,description:c,id:u,disabled:d,error:f,size:h,labelPosition:m="left",bodyElement:g="div",labelElement:v="label",variant:S,style:x,vars:w,mod:y,...b},C)=>{const j=de({name:e,props:t,className:n,style:x,classes:WT,classNames:r,styles:o,unstyled:i});return s.jsx(q,{...j("root"),ref:C,__vars:{"--label-fz":hn(h),"--label-lh":Ne(h,"label-lh")},mod:[{"label-position":m},y],variant:S,size:h,...b,children:s.jsxs(q,{component:g,htmlFor:g==="label"?u:void 0,...j("body"),children:[a,s.jsxs("div",{...j("labelWrapper"),"data-disabled":d||void 0,children:[l&&s.jsx(q,{component:v,htmlFor:v==="label"?u:void 0,...j("label"),"data-disabled":d||void 0,children:l}),c&&s.jsx(Lt.Description,{size:h,__inheritStyles:!1,...j("description"),children:c}),f&&typeof f!="boolean"&&s.jsx(Lt.Error,{size:h,__inheritStyles:!1,...j("error"),children:f})]})]})})});mh.displayName="@mantine/core/InlineInput";const GT=p.createContext(null),vO=GT.Provider,QT=()=>p.useContext(GT),[yO,xO]=Ns();var KT={card:"m_26775b0a"};const bO={withBorder:!0},wO=(e,{radius:t})=>({card:{"--card-radius":dt(t)}}),Uy=Y((e,t)=>{const n=V("CheckboxCard",bO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,checked:u,mod:d,withBorder:f,value:h,onClick:m,...g}=n,v=de({name:"CheckboxCard",classes:KT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:wO,rootSelector:"card"}),S=QT(),x=typeof u=="boolean"?u:(S==null?void 0:S.value.includes(h||""))||!1;return s.jsx(yO,{value:{checked:x},children:s.jsx(Sn,{ref:t,mod:[{"with-border":f,checked:x},d],...v("card"),...g,role:"checkbox","aria-checked":x,onClick:w=>{m==null||m(w),S==null||S.onChange(h||"")}})})});Uy.displayName="@mantine/core/CheckboxCard";Uy.classes=KT;function By({children:e,role:t}){const n=pl();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const SO={},Vy=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=V("CheckboxGroup",SO,e),[d,f]=bn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=typeof m=="string"?m:m.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return s.jsx(vO,{value:{value:d,onChange:h,size:i},children:s.jsx(Lt.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(By,{role:"group",children:l})})})});Vy.classes=Lt.Wrapper.classes;Vy.displayName="@mantine/core/CheckboxGroup";function gh({size:e,style:t,...n}){const r=e!==void 0?{width:B(e),height:B(e),...t}:t;return s.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:s.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 YT({indeterminate:e,...t}){return e?s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:s.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):s.jsx(gh,{...t})}var XT={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const jO={icon:YT},CO=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=jr({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":Ne(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:dt(t),"--checkbox-color":i==="outline"?c:ut(n,e),"--checkbox-icon-color":o?ut(o,e):Ms(a,e)?Go({color:n,theme:e,autoContrast:a}):void 0}}},Hy=Y((e,t)=>{const n=V("CheckboxIndicator",jO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,icon:u,indeterminate:d,radius:f,color:h,iconColor:m,autoContrast:g,checked:v,mod:S,variant:x,disabled:w,...y}=n,b=u,C=de({name:"CheckboxIndicator",classes:XT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:CO,rootSelector:"indicator"}),j=xO(),T=typeof v=="boolean"||typeof d=="boolean"?v||d:(j==null?void 0:j.checked)||!1;return s.jsx(q,{ref:t,...C("indicator",{variant:x}),variant:x,mod:[{checked:T,disabled:w},S],...y,children:s.jsx(b,{indeterminate:d,...C("icon")})})});Hy.displayName="@mantine/core/CheckboxIndicator";Hy.classes=XT;var JT={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const EO={labelPosition:"right",icon:YT},TO=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=jr({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":Ne(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:dt(t),"--checkbox-color":i==="outline"?c:ut(n,e),"--checkbox-icon-color":o?ut(o,e):Ms(a,e)?Go({color:n,theme:e,autoContrast:a}):void 0}}},Rn=Y((e,t)=>{const n=V("Checkbox",EO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,label:d,id:f,size:h,radius:m,wrapperProps:g,checked:v,labelPosition:S,description:x,error:w,disabled:y,variant:b,indeterminate:C,icon:j,rootRef:T,iconColor:E,onChange:R,autoContrast:_,mod:N,...O}=n,F=QT(),z=h||(F==null?void 0:F.size),H=j,D=de({name:"Checkbox",props:n,classes:JT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:TO}),{styleProps:k,rest:P}=Qo(O),I=Un(f),L=F?{checked:F.value.includes(P.value),onChange:$=>{F.onChange($),R==null||R($)}}:{};return s.jsx(mh,{...D("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:I,size:z,labelPosition:S,label:d,description:x,error:w,disabled:y,classNames:r,styles:a,unstyled:l,"data-checked":L.checked||v||void 0,variant:b,ref:T,mod:N,...k,...g,children:s.jsxs(q,{...D("inner"),mod:{"data-label-position":S},children:[s.jsx(q,{component:"input",id:I,ref:t,checked:v,disabled:y,mod:{error:!!w,indeterminate:C},...D("input",{focusable:!0,variant:b}),onChange:R,...P,...L,type:"checkbox"}),s.jsx(H,{indeterminate:C,...D("icon")})]})})});Rn.classes={...JT,...qT};Rn.displayName="@mantine/core/Checkbox";Rn.Group=Vy;Rn.Indicator=Hy;Rn.Card=Uy;function tl(e){return"group"in e}function ZT({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let i=0;i<e.length;i+=1){const a=e[i];if(o.length===n)return o;tl(a)&&o.push({group:a.group,items:ZT({options:a.items,search:t,limit:n-o.length})}),tl(a)||a.label.toLowerCase().includes(r)&&o.push(a)}return o}function PO(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 eP(e,t=new Set){if(Array.isArray(e))for(const n of e)if(tl(n))eP(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 kO(e,t){return Array.isArray(e)?e.includes(t):e===t}function tP({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!tl(e)){const l=kO(n,e.value),c=t&&l&&s.jsx(gh,{className:nr.optionsDropdownCheckIcon}),u=s.jsxs(s.Fragment,{children:[r==="left"&&c,s.jsx("span",{children:e.label}),r==="right"&&c]});return s.jsx(Oe.Option,{value:e.value,disabled:e.disabled,className:rt({[nr.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":l||void 0,"aria-selected":l,active:l,children:typeof i=="function"?i({option:e,checked:l}):u})}const a=e.items.map(l=>s.jsx(tP,{data:l,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i},l.value));return s.jsx(Oe.Group,{label:e.group,children:a})}function RO({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:i,maxDropdownHeight:a,withScrollArea:l=!0,filterOptions:c=!0,withCheckIcon:u=!1,value:d,checkIconPosition:f,nothingFoundMessage:h,unstyled:m,labelId:g,renderOption:v,scrollAreaProps:S,"aria-label":x}){eP(e);const y=typeof o=="string"?(r||ZT)({options:e,search:c?o:"",limit:i??1/0}):e,b=PO(y),C=y.map(j=>s.jsx(tP,{data:j,withCheckIcon:u,value:d,checkIconPosition:f,unstyled:m,renderOption:v},tl(j)?j.group:j.value));return s.jsx(Oe.Dropdown,{hidden:t||n&&b,children:s.jsxs(Oe.Options,{labelledBy:g,"aria-label":x,children:[l?s.jsx(Rr.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S,children:C}):C,b&&h&&s.jsx(Oe.Empty,{children:h})]})})}const nP=p.createContext(null),_O=nP.Provider;function DO(){return{withinGroup:!!p.useContext(nP)}}var vh={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const IO={},AO=(e,{spacing:t})=>({group:{"--ag-spacing":Yt(t)}}),Wy=Y((e,t)=>{const n=V("AvatarGroup",IO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,spacing:u,...d}=n,f=de({name:"AvatarGroup",classes:vh,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:AO,rootSelector:"group"});return s.jsx(_O,{value:!0,children:s.jsx(q,{ref:t,...f("group"),...d})})});Wy.classes=vh;Wy.displayName="@mantine/core/AvatarGroup";function NO(e){return s.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.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 rP(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()}function MO(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 OO=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function LO(e,t=OO){const n=MO(rP(e)),r=Math.abs(n)%t.length;return t[r]}const $O={},FO=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a,name:l,allowedInitialsColors:c})=>{const u=i==="initials"&&typeof l=="string"?LO(l,c):i,d=e.variantColorResolver({color:u||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:a});return{root:{"--avatar-size":Ne(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:dt(n),"--avatar-bg":u||r?d.background:void 0,"--avatar-color":u||r?d.color:void 0,"--avatar-bd":u||r?d.border:void 0}}},Ts=_n((e,t)=>{const n=V("Avatar",$O,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,src:u,alt:d,radius:f,color:h,gradient:m,imageProps:g,children:v,autoContrast:S,mod:x,name:w,allowedInitialsColors:y,...b}=n,C=DO(),[j,T]=p.useState(!u),E=de({name:"Avatar",props:n,classes:vh,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:FO});return p.useEffect(()=>T(!u),[u]),s.jsx(q,{...E("root"),mod:[{"within-group":C.withinGroup},x],ref:t,...b,children:j?s.jsx("span",{...E("placeholder"),title:d,children:v||typeof w=="string"&&rP(w)||s.jsx(NO,{})}):s.jsx("img",{...g,...E("image"),src:u,alt:d,onError:R=>{var _;T(!0),(_=g==null?void 0:g.onError)==null||_.call(g,R)}})})});Ts.classes=vh;Ts.displayName="@mantine/core/Avatar";Ts.Group=Wy;var oP={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const zO={},UO=(e,{radius:t,color:n,gradient:r,variant:o,size:i,autoContrast:a})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:a});return{root:{"--badge-height":Ne(i,"badge-height"),"--badge-padding-x":Ne(i,"badge-padding-x"),"--badge-fz":Ne(i,"badge-fz"),"--badge-radius":t===void 0?void 0:dt(t),"--badge-bg":n||o?l.background:void 0,"--badge-color":n||o?l.color:void 0,"--badge-bd":n||o?l.border:void 0,"--badge-dot-color":o==="dot"?ut(n,e):void 0}}},su=_n((e,t)=>{const n=V("Badge",zO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,radius:u,color:d,gradient:f,leftSection:h,rightSection:m,children:g,variant:v,fullWidth:S,autoContrast:x,circle:w,mod:y,...b}=n,C=de({name:"Badge",props:n,classes:oP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:UO});return s.jsxs(q,{variant:v,mod:[{block:S,circle:w,"with-right-section":!!m,"with-left-section":!!h},y],...C("root",{variant:v}),ref:t,...b,children:[h&&s.jsx("span",{...C("section"),"data-position":"left",children:h}),s.jsx("span",{...C("label"),children:g}),m&&s.jsx("span",{...C("section"),"data-position":"right",children:m})]})});su.classes=oP;su.displayName="@mantine/core/Badge";var iP={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const BO={iconSize:48},VO=(e,{color:t,iconSize:n,radius:r})=>{const o=jr({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=jr({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":vr(i.value,.07),"--bq-bg-dark":vr(o.value,.06),"--bq-bd":ut(t,e),"--bq-icon-size":B(n),"--bq-radius":dt(r)}}},qy=Y((e,t)=>{const n=V("Blockquote",BO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,icon:d,iconSize:f,cite:h,...m}=n,g=de({name:"Blockquote",classes:iP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:VO});return s.jsxs(q,{component:"blockquote",ref:t,...g("root"),...m,children:[d&&s.jsx("span",{...g("icon"),children:d}),u,h&&s.jsx("cite",{...g("cite"),children:h})]})});qy.classes=iP;qy.displayName="@mantine/core/Blockquote";var yh={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844"};const Ib={orientation:"horizontal"},HO=(e,{borderWidth:t})=>({group:{"--button-border-width":B(t)}}),Gy=Y((e,t)=>{const n=V("ButtonGroup",Ib,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=V("ButtonGroup",Ib,e),g=de({name:"ButtonGroup",props:n,classes:yh,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:HO,rootSelector:"group"});return s.jsx(q,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});Gy.classes=yh;Gy.displayName="@mantine/core/ButtonGroup";const WO={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${B(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},qO={},GO=(e,{radius:t,color:n,gradient:r,variant:o,size:i,justify:a,autoContrast:l})=>{const c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{root:{"--button-justify":a,"--button-height":Ne(i,"button-height"),"--button-padding-x":Ne(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?hn(i.replace("compact-","")):hn(i),"--button-radius":t===void 0?void 0:dt(t),"--button-bg":n||o?c.background:void 0,"--button-hover":n||o?c.hover:void 0,"--button-color":c.color,"--button-bd":n||o?c.border:void 0,"--button-hover-color":n||o?c.hoverColor:void 0}}},ie=_n((e,t)=>{const n=V("Button",qO,e),{style:r,vars:o,className:i,color:a,disabled:l,children:c,leftSection:u,rightSection:d,fullWidth:f,variant:h,radius:m,loading:g,loaderProps:v,gradient:S,classNames:x,styles:w,unstyled:y,"data-disabled":b,autoContrast:C,mod:j,...T}=n,E=de({name:"Button",props:n,classes:yh,className:i,style:r,classNames:x,styles:w,unstyled:y,vars:o,varsResolver:GO}),R=!!u,_=!!d;return s.jsxs(Sn,{ref:t,...E("root",{active:!l&&!g&&!b}),unstyled:y,variant:h,disabled:l||g,mod:[{disabled:l||b,loading:g,block:f,"with-left-section":R,"with-right-section":_},j],...T,children:[s.jsx(Yo,{mounted:!!g,transition:WO,duration:150,children:N=>s.jsx(q,{component:"span",...E("loader",{style:N}),"aria-hidden":!0,children:s.jsx(tr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...v})})}),s.jsxs("span",{...E("inner"),children:[u&&s.jsx(q,{component:"span",...E("section"),mod:{position:"left"},children:u}),s.jsx(q,{component:"span",mod:{loading:g},...E("label"),children:c}),d&&s.jsx(q,{component:"span",...E("section"),mod:{position:"right"},children:d})]})]})});ie.classes=yh;ie.displayName="@mantine/core/Button";ie.Group=Gy;var sP={root:"m_4451eb3a"};const QO={},vn=_n((e,t)=>{const n=V("Center",QO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,inline:u,mod:d,...f}=n,h=de({name:"Center",props:n,classes:sP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c});return s.jsx(q,{ref:t,mod:[{inline:u},d],...h("root"),...f})});vn.classes=sP;vn.displayName="@mantine/core/Center";const[KO,YO]=Ns(),XO={};function aP(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=V("ChipGroup",XO,e),[a,l]=bn({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),c=d=>Array.isArray(a)?a.includes(d):d===a,u=d=>{const f=d.currentTarget.value;Array.isArray(a)?l(a.includes(f)?a.filter(h=>h!==f):[...a,f]):l(f)};return s.jsx(KO,{value:{isChipSelected:c,onChange:u,multiple:o},children:i})}aP.displayName="@mantine/core/ChipGroup";var lP={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 JO={type:"checkbox"},ZO=(e,{size:t,radius:n,variant:r,color:o,autoContrast:i})=>{const a=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:i});return{root:{"--chip-fz":hn(t),"--chip-size":Ne(t,"chip-size"),"--chip-radius":n===void 0?void 0:dt(n),"--chip-checked-padding":Ne(t,"chip-checked-padding"),"--chip-padding":Ne(t,"chip-padding"),"--chip-icon-size":Ne(t,"chip-icon-size"),"--chip-bg":o||r?a.background:void 0,"--chip-hover":o||r?a.hover:void 0,"--chip-color":o||r?a.color:void 0,"--chip-bd":o||r?a.border:void 0,"--chip-spacing":Ne(t,"chip-spacing")}}},Ac=Y((e,t)=>{const n=V("Chip",JO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,id:u,checked:d,defaultChecked:f,onChange:h,value:m,wrapperProps:g,type:v,disabled:S,children:x,size:w,variant:y,icon:b,rootRef:C,autoContrast:j,mod:T,...E}=n,R=de({name:"Chip",classes:lP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:ZO}),_=YO(),N=Un(u),{styleProps:O,rest:F}=Qo(E),[z,H]=bn({value:d,defaultValue:f,finalValue:!1,onChange:h}),D=_?{checked:_.isChipSelected(m),onChange:P=>{_.onChange(P),h==null||h(P.currentTarget.checked)},type:_.multiple?"checkbox":"radio"}:{},k=D.checked||z;return s.jsxs(q,{size:w,variant:y,ref:C,mod:T,...R("root"),...O,...g,children:[s.jsx("input",{type:v,...R("input"),checked:k,onChange:P=>H(P.currentTarget.checked),id:N,disabled:S,ref:t,value:m,...D,...F}),s.jsxs("label",{htmlFor:N,"data-checked":k||void 0,"data-disabled":S||void 0,...R("label",{variant:y||"filled"}),children:[k&&s.jsx("span",{...R("iconWrapper"),children:b||s.jsx(gh,{...R("checkIcon")})}),s.jsx("span",{children:x})]})]})});Ac.classes=lP;Ac.displayName="@mantine/core/Chip";Ac.Group=aP;var cP={root:"m_b183c0a2"};const e5={},t5=(e,{color:t})=>({root:{"--code-bg":t?ut(t,e):void 0}}),Qy=Y((e,t)=>{const n=V("Code",e5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,block:d,variant:f,mod:h,...m}=n,g=de({name:"Code",props:n,classes:cP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:t5});return s.jsx(q,{component:d?"pre":"code",variant:f,ref:t,mod:[{block:d},h],...g("root"),...m,dir:"ltr"})});Qy.classes=cP;Qy.displayName="@mantine/core/Code";var uP={root:"m_7485cace"};const n5={},r5=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:Ne(t,"container-size")}}),Ky=Y((e,t)=>{const n=V("Container",n5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,fluid:u,mod:d,...f}=n,h=de({name:"Container",classes:uP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:r5});return s.jsx(q,{ref:t,mod:[{fluid:u},d],...h("root"),...f})});Ky.classes=uP;Ky.displayName="@mantine/core/Container";const o5={timeout:1e3};function dP(e){const{children:t,timeout:n,value:r,...o}=V("CopyButton",o5,e),i=dj({timeout:n}),a=()=>i.copy(r);return s.jsx(s.Fragment,{children:t({copy:a,copied:i.copied,...o})})}dP.displayName="@mantine/core/CopyButton";var fP={root:"m_3eebeb36",label:"m_9e365f20"};const i5={orientation:"horizontal"},s5=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?ut(t,e):void 0,"--divider-border-style":n,"--divider-size":Ne(r,"divider-size")}}),dn=Y((e,t)=>{const n=V("Divider",i5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,orientation:d,label:f,labelPosition:h,mod:m,...g}=n,v=de({name:"Divider",classes:fP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:s5});return s.jsx(q,{ref:t,mod:[{orientation:d,"with-label":!!f},m],...v("root"),...g,role:"separator",children:f&&s.jsx(q,{component:"span",mod:{position:h},...v("label"),children:f})})});dn.classes=fP;dn.displayName="@mantine/core/Divider";function a5({open:e,close:t,openDelay:n,closeDelay:r}){const o=p.useRef(-1),i=p.useRef(-1),a=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{a(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},c=()=>{a(),r===0||r===void 0?t():i.current=window.setTimeout(t,r)};return p.useEffect(()=>a,[]),{openDropdown:l,closeDropdown:c}}const[Ab,hP]=zn("Grid component was not found in tree"),jg=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,Nb=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":jg(e,t),Mb=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},Ob=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function l5({span:e,order:t,offset:n,selector:r}){var m;const o=At(),i=hP(),a=i.breakpoints||o.breakpoints,c=Ur(e)===void 0?12:Ur(e),u=Li({"--col-order":(m=Ur(t))==null?void 0:m.toString(),"--col-flex-grow":Mb(c,i.grow),"--col-flex-basis":jg(c,i.columns),"--col-width":c==="content"?"auto":void 0,"--col-max-width":Nb(c,i.columns,i.grow),"--col-offset":Ob(Ur(n),i.columns)}),d=bt(a).reduce((g,v)=>{var S;return g[v]||(g[v]={}),typeof t=="object"&&t[v]!==void 0&&(g[v]["--col-order"]=(S=t[v])==null?void 0:S.toString()),typeof e=="object"&&e[v]!==void 0&&(g[v]["--col-flex-grow"]=Mb(e[v],i.grow),g[v]["--col-flex-basis"]=jg(e[v],i.columns),g[v]["--col-width"]=e[v]==="content"?"auto":void 0,g[v]["--col-max-width"]=Nb(e[v],i.columns,i.grow)),typeof n=="object"&&n[v]!==void 0&&(g[v]["--col-offset"]=Ob(n[v],i.columns)),g},{}),h=fc(bt(d),a).filter(g=>bt(d[g.value]).length>0).map(g=>({query:i.type==="container"?`mantine-grid (min-width: ${a[g.value]})`:`(min-width: ${a[g.value]})`,styles:d[g.value]}));return s.jsx(Os,{styles:u,media:i.type==="container"?void 0:h,container:i.type==="container"?h:void 0,selector:r})}var Yy={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const c5={span:12},Xy=Y((e,t)=>{const n=V("GridCol",c5,e),{classNames:r,className:o,style:i,styles:a,vars:l,span:c,order:u,offset:d,...f}=n,h=hP(),m=Kc();return s.jsxs(s.Fragment,{children:[s.jsx(l5,{selector:`.${m}`,span:c,order:u,offset:d}),s.jsx(q,{ref:t,...h.getStyles("col",{className:rt(o,m),style:i,classNames:r,styles:a}),...f})]})});Xy.classes=Yy;Xy.displayName="@mantine/core/GridCol";function Lb({gutter:e,selector:t,breakpoints:n,type:r}){const o=At(),i=n||o.breakpoints,a=Li({"--grid-gutter":Yt(Ur(e))}),l=bt(i).reduce((d,f)=>(d[f]||(d[f]={}),typeof e=="object"&&e[f]!==void 0&&(d[f]["--grid-gutter"]=Yt(e[f])),d),{}),u=fc(bt(l),i).filter(d=>bt(l[d.value]).length>0).map(d=>({query:r==="container"?`mantine-grid (min-width: ${i[d.value]})`:`(min-width: ${i[d.value]})`,styles:l[d.value]}));return s.jsx(Os,{styles:a,media:r==="container"?void 0:u,container:r==="container"?u:void 0,selector:t})}const u5={gutter:"md",grow:!1,columns:12},d5=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),lr=Y((e,t)=>{const n=V("Grid",u5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,grow:u,gutter:d,columns:f,align:h,justify:m,children:g,breakpoints:v,type:S,...x}=n,w=de({name:"Grid",classes:Yy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:d5}),y=Kc();return S==="container"&&v?s.jsxs(Ab,{value:{getStyles:w,grow:u,columns:f||12,breakpoints:v,type:S},children:[s.jsx(Lb,{selector:`.${y}`,...n}),s.jsx("div",{...w("container"),children:s.jsx(q,{ref:t,...w("root",{className:y}),...x,children:s.jsx("div",{...w("inner"),children:g})})})]}):s.jsxs(Ab,{value:{getStyles:w,grow:u,columns:f||12,breakpoints:v,type:S},children:[s.jsx(Lb,{selector:`.${y}`,...n}),s.jsx(q,{ref:t,...w("root",{className:y}),...x,children:s.jsx("div",{...w("inner"),children:g})})]})});lr.classes=Yy;lr.displayName="@mantine/core/Grid";lr.Col=Xy;function uf(){return uf=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},uf.apply(null,arguments)}function Jy(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var f5=p.useLayoutEffect,h5=function(t){var n=p.useRef(t);return f5(function(){n.current=t}),n},$b=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},p5=function(t,n){var r=p.useRef();return p.useCallback(function(o){t.current=o,r.current&&$b(r.current,null),r.current=n,n&&$b(n,o)},[n])},Fb={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},m5=function(t){Object.keys(Fb).forEach(function(n){t.style.setProperty(n,Fb[n],"important")})},zb=m5,In=null,Ub=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function g5(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),In||(In=document.createElement("textarea"),In.setAttribute("tabindex","-1"),In.setAttribute("aria-hidden","true"),zb(In)),In.parentNode===null&&document.body.appendChild(In);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,l=a.boxSizing;Object.keys(a).forEach(function(h){var m=h;In.style[m]=a[m]}),zb(In),In.value=t;var c=Ub(In,e);In.value=t,c=Ub(In,e),In.value="x";var u=In.scrollHeight-o,d=u*n;l==="border-box"&&(d=d+o+i),c=Math.max(d,c);var f=u*r;return l==="border-box"&&(f=f+o+i),c=Math.min(f,c),[c,u]}var Bb=function(){},v5=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},y5=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],x5=!!document.documentElement.currentStyle,b5=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=v5(y5,n),o=r.boxSizing;if(o==="")return null;x5&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),a=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:a}},w5=b5;function pP(e,t,n){var r=h5(n);p.useLayoutEffect(function(){var o=function(a){return r.current(a)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var S5=function(t){pP(window,"resize",t)},j5=function(t){pP(document.fonts,"loadingdone",t)},C5=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],E5=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,a=t.onChange,l=a===void 0?Bb:a,c=t.onHeightChange,u=c===void 0?Bb:c,d=Jy(t,C5),f=d.value!==void 0,h=p.useRef(null),m=p5(h,n),g=p.useRef(0),v=p.useRef(),S=function(){var y=h.current,b=r&&v.current?v.current:w5(y);if(b){v.current=b;var C=g5(b,y.value||y.placeholder||"x",i,o),j=C[0],T=C[1];g.current!==j&&(g.current=j,y.style.setProperty("height",j+"px","important"),u(j,{rowHeight:T}))}},x=function(y){f||S(),l(y)};return p.useLayoutEffect(S),S5(S),j5(S),p.createElement("textarea",uf({},d,{onChange:x,ref:m}))},T5=p.forwardRef(E5);const P5={},Bs=Y((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:a,...l}=V("Textarea",P5,e),c=n&&yj()!=="test",u=c?{maxRows:r,minRows:o}:{};return s.jsx(rr,{component:c?T5:"textarea",ref:t,...l,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":a},...u})});Bs.classes=rr.classes;Bs.displayName="@mantine/core/Textarea";function Vb(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const k5={serialize:JSON.stringify,deserialize:JSON.parse},gl=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:i,validationError:a,serialize:l,deserialize:c,onFocus:u,onBlur:d,readOnly:f,error:h,...m}=V("JsonInput",k5,e),[g,v]=bn({value:n,defaultValue:r,finalValue:"",onChange:o}),[S,x]=p.useState(Vb(g,c)),w=b=>{u==null||u(b),x(!0)},y=b=>{typeof d=="function"&&d(b);const C=Vb(b.currentTarget.value,c);i&&!f&&C&&b.currentTarget.value.trim()!==""&&v(l(c(b.currentTarget.value),null,2)),x(C)};return s.jsx(Bs,{value:g,onChange:b=>v(b.currentTarget.value),onFocus:w,onBlur:y,ref:t,readOnly:f,...m,autoComplete:"off",__staticSelector:"JsonInput",error:S?h:a||!0,"data-monospace":!0})});gl.classes=rr.classes;gl.displayName="@mantine/core/JsonInput";const[R5,_5]=zn("List component was not found in tree");var Zy={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const D5={},ex=Y((e,t)=>{const n=V("ListItem",D5,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,children:u,mod:d,...f}=n,h=_5(),m=c||h.icon,g={classNames:r,styles:a};return s.jsx(q,{...h.getStyles("item",{...g,className:o,style:i}),component:"li",mod:[{"with-icon":!!m,centered:h.center},d],ref:t,...f,children:s.jsxs("div",{...h.getStyles("itemWrapper",g),children:[m&&s.jsx("span",{...h.getStyles("itemIcon",g),children:m}),s.jsx("span",{...h.getStyles("itemLabel",g),children:u})]})})});ex.classes=Zy;ex.displayName="@mantine/core/ListItem";const I5={type:"unordered"},A5=(e,{size:t,spacing:n})=>({root:{"--list-fz":hn(t),"--list-lh":uj(t),"--list-spacing":Yt(n)}}),On=Y((e,t)=>{const n=V("List",I5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,type:d,withPadding:f,icon:h,spacing:m,center:g,listStyleType:v,mod:S,...x}=n,w=de({name:"List",classes:Zy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:A5});return s.jsx(R5,{value:{center:g,icon:h,getStyles:w},children:s.jsx(q,{...w("root",{style:{listStyleType:v}}),component:d==="unordered"?"ul":"ol",mod:[{"with-padding":f},S],ref:t,...x,children:u})})});On.classes=Zy;On.displayName="@mantine/core/List";On.Item=ex;var mP={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const Hb={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Xr("overlay")},N5=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),tx=Y((e,t)=>{const n=V("LoadingOverlay",Hb,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,transitionProps:u,loaderProps:d,overlayProps:f,visible:h,zIndex:m,...g}=n,v=At(),S=de({name:"LoadingOverlay",classes:mP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:N5}),x={...Hb.overlayProps,...f};return s.jsx(Yo,{transition:"fade",...u,mounted:!!h,children:w=>s.jsxs(q,{...S("root",{style:w}),ref:t,...g,children:[s.jsx(tr,{...S("loader"),unstyled:l,...d}),s.jsx(Ic,{...x,...S("overlay"),darkHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.white}),s.jsx(Ic,{...x,...S("overlay"),lightHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.colors.dark[5]})]})})});tx.classes=mP;tx.displayName="@mantine/core/LoadingOverlay";const[M5,au]=zn("Menu component was not found in the tree");var vl={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const O5={},nx=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("MenuDivider",O5,e),c=au();return s.jsx(q,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...l})});nx.classes=vl;nx.displayName="@mantine/core/MenuDivider";const L5={},rx=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,onMouseEnter:l,onMouseLeave:c,onKeyDown:u,children:d,...f}=V("MenuDropdown",L5,e),h=p.useRef(null),m=au(),g=Gn(u,x=>{var w,y;(x.key==="ArrowUp"||x.key==="ArrowDown")&&(x.preventDefault(),(y=(w=h.current)==null?void 0:w.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||y.focus())}),v=Gn(l,()=>(m.trigger==="hover"||m.trigger==="click-hover")&&m.openDropdown()),S=Gn(c,()=>(m.trigger==="hover"||m.trigger==="click-hover")&&m.closeDropdown());return s.jsxs(Jr.Dropdown,{...f,onMouseEnter:v,onMouseLeave:S,role:"menu","aria-orientation":"vertical",ref:tn(t,h),...m.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:g,children:[s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),d]})});rx.classes=vl;rx.displayName="@mantine/core/MenuDropdown";const $5={},ox=_n((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,color:l,closeMenuOnClick:c,leftSection:u,rightSection:d,children:f,disabled:h,...m}=V("MenuItem",$5,e),g=au(),v=At(),{dir:S}=Ls(),x=p.useRef(),w=g.getItemIndex(x.current),y=m,b=Gn(y.onMouseLeave,()=>g.setHovered(-1)),C=Gn(y.onMouseEnter,()=>g.setHovered(g.getItemIndex(x.current))),j=Gn(y.onClick,()=>{typeof c=="boolean"?c&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately()}),T=Gn(y.onFocus,()=>g.setHovered(g.getItemIndex(x.current))),E=l?v.variantColorResolver({color:l,theme:v,variant:"light"}):void 0,R=l?jr({color:l,theme:v}):null;return s.jsxs(Sn,{...m,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,onFocus:T,...g.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:tn(x,t),role:"menuitem",disabled:h,"data-menu-item":!0,"data-disabled":h||void 0,"data-hovered":g.hovered===w?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:C,onMouseLeave:b,onClick:j,onKeyDown:cj({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:S,orientation:"vertical",onKeyDown:y.onKeyDown}),__vars:{"--menu-item-color":R!=null&&R.isThemeColor&&(R==null?void 0:R.shade)===void 0?`var(--mantine-color-${R.color}-6)`:E==null?void 0:E.color,"--menu-item-hover":E==null?void 0:E.hover},children:[u&&s.jsx("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:u}),f&&s.jsx("div",{...g.getStyles("itemLabel",{styles:i,classNames:n}),children:f}),d&&s.jsx("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:d})]})});ox.classes=vl;ox.displayName="@mantine/core/MenuItem";const F5={},ix=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("MenuLabel",F5,e),c=au();return s.jsx(q,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...l})});ix.classes=vl;ix.displayName="@mantine/core/MenuLabel";const z5={refProp:"ref"},gP=p.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=V("MenuTarget",z5,e);if(!qo(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 i=au(),a=Gn(n.props.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),l=Gn(n.props.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),c=Gn(n.props.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return s.jsx(Jr.Target,{refProp:r,popupType:"menu",ref:t,...o,children:p.cloneElement(n,{onClick:a,onMouseEnter:l,onMouseLeave:c,"data-expanded":i.opened?!0:void 0})})});gP.displayName="@mantine/core/MenuTarget";const U5={trapFocus:!0,closeOnItemClick:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Z(e){const t=V("Menu",U5,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:a,trapFocus:l,onChange:c,closeOnItemClick:u,loop:d,closeOnEscape:f,trigger:h,openDelay:m,closeDelay:g,classNames:v,styles:S,unstyled:x,variant:w,vars:y,menuItemTabIndex:b,keepMounted:C,...j}=t,T=de({name:"Menu",classes:vl,props:t,classNames:v,styles:S,unstyled:x}),[E,{setHovered:R,resetHovered:_}]=mD(),[N,O]=bn({value:i,defaultValue:a,finalValue:!1,onChange:c}),[F,z]=p.useState(!1),H=()=>{O(!1),z(!1),N&&(o==null||o())},D=()=>{O(!0),!N&&(r==null||r())},k=()=>{N?H():D()},{openDropdown:P,closeDropdown:I}=a5({open:D,close:H,closeDelay:g,openDelay:m}),L=ue=>pD("[data-menu-item]","[data-menu-dropdown]",ue),{resolvedClassNames:$,resolvedStyles:Q}=Qc({classNames:v,styles:S,props:t});return Mo(()=>{_()},[N]),s.jsx(M5,{value:{getStyles:T,opened:N,toggleDropdown:k,getItemIndex:L,hovered:E,setHovered:R,openedViaClick:F,setOpenedViaClick:z,closeOnItemClick:u,closeDropdown:h==="click"?H:I,openDropdown:h==="click"?D:P,closeDropdownImmediately:H,loop:d,trigger:h,unstyled:x,menuItemTabIndex:b},children:s.jsx(Jr,{...j,opened:N,onChange:k,defaultOpened:a,trapFocus:C?!1:l,closeOnEscape:f,__staticSelector:"Menu",classNames:$,styles:Q,unstyled:x,variant:w,keepMounted:C,children:n})})}Z.extend=e=>e;Z.classes=vl;Z.displayName="@mantine/core/Menu";Z.Item=ox;Z.Label=ix;Z.Dropdown=rx;Z.Target=gP;Z.Divider=nx;const[B5,yl]=zn("Modal component was not found in tree");var Jo={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const V5={},xh=Y((e,t)=>{const n=V("ModalBody",V5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=yl();return s.jsx(TT,{ref:t,...u.getStyles("body",{classNames:r,style:i,styles:a,className:o}),...c})});xh.classes=Jo;xh.displayName="@mantine/core/ModalBody";const H5={},bh=Y((e,t)=>{const n=V("ModalCloseButton",H5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=yl();return s.jsx(PT,{ref:t,...u.getStyles("close",{classNames:r,style:i,styles:a,className:o}),...c})});bh.classes=Jo;bh.displayName="@mantine/core/ModalCloseButton";const W5={},wh=Y((e,t)=>{const n=V("ModalContent",W5,e),{classNames:r,className:o,style:i,styles:a,vars:l,children:c,...u}=n,d=yl(),f=d.scrollAreaComponent||cM;return s.jsx(kT,{...d.getStyles("content",{className:o,style:i,styles:a,classNames:r}),innerProps:d.getStyles("inner",{className:o,style:i,styles:a,classNames:r}),"data-full-screen":d.fullScreen||void 0,"data-modal-content":!0,ref:t,...u,children:s.jsx(f,{style:{maxHeight:d.fullScreen?"100dvh":`calc(100dvh - (${B(d.yOffset)} * 2))`},children:c})})});wh.classes=Jo;wh.displayName="@mantine/core/ModalContent";const q5={},Sh=Y((e,t)=>{const n=V("ModalHeader",q5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=yl();return s.jsx(RT,{ref:t,...u.getStyles("header",{classNames:r,style:i,styles:a,className:o}),...c})});Sh.classes=Jo;Sh.displayName="@mantine/core/ModalHeader";const G5={},jh=Y((e,t)=>{const n=V("ModalOverlay",G5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=yl();return s.jsx(_T,{ref:t,...u.getStyles("overlay",{classNames:r,style:i,styles:a,className:o}),...c})});jh.classes=Jo;jh.displayName="@mantine/core/ModalOverlay";const Q5={__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"},K5=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:dt(t),"--modal-size":Ne(n,"modal-size"),"--modal-y-offset":B(r),"--modal-x-offset":B(o)}}),Ch=Y((e,t)=>{const n=V("ModalRoot",Q5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,yOffset:u,scrollAreaComponent:d,radius:f,fullScreen:h,centered:m,xOffset:g,__staticSelector:v,...S}=n,x=de({name:v,classes:Jo,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:K5});return s.jsx(B5,{value:{yOffset:u,scrollAreaComponent:d,getStyles:x,fullScreen:h},children:s.jsx(ET,{ref:t,...x("root"),"data-full-screen":h||void 0,"data-centered":m||void 0,unstyled:l,...S})})});Ch.classes=Jo;Ch.displayName="@mantine/core/ModalRoot";const Y5={},Eh=Y((e,t)=>{const n=V("ModalTitle",Y5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=yl();return s.jsx(DT,{ref:t,...u.getStyles("title",{classNames:r,style:i,styles:a,className:o}),...c})});Eh.classes=Jo;Eh.displayName="@mantine/core/ModalTitle";const X5={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},mn=Y((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:a,children:l,radius:c,...u}=V("Modal",X5,e),d=!!n||i;return s.jsxs(Ch,{ref:t,radius:c,...u,children:[r&&s.jsx(jh,{...o}),s.jsxs(wh,{radius:c,children:[d&&s.jsxs(Sh,{children:[n&&s.jsx(Eh,{children:n}),i&&s.jsx(bh,{...a})]}),s.jsx(xh,{children:l})]})]})});mn.classes=Jo;mn.displayName="@mantine/core/Modal";mn.Root=Ch;mn.Overlay=jh;mn.Content=wh;mn.Body=xh;mn.Header=Sh;mn.Title=Eh;mn.CloseButton=bh;const[J5,sx]=Ns(),[Z5,e9]=Ns();var Th={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const t9={},n9=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?Ne(t):Ne(n,"pg-gap")}}),ax=Y((e,t)=>{const n=V("PillGroup",t9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,disabled:d,...f}=n,h=sx(),m=(h==null?void 0:h.size)||u||void 0,g=de({name:"PillGroup",classes:Th,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:n9,stylesCtx:{size:m},rootSelector:"group"});return s.jsx(Z5,{value:{size:m,disabled:d},children:s.jsx(q,{ref:t,size:m,...g("group"),...f})})});ax.classes=Th;ax.displayName="@mantine/core/PillGroup";const r9={variant:"default"},o9=(e,{radius:t},{size:n})=>({root:{"--pill-fz":Ne(n,"pill-fz"),"--pill-height":Ne(n,"pill-height"),"--pill-radius":t===void 0?void 0:dt(t)}}),Ps=Y((e,t)=>{const n=V("Pill",r9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,variant:u,children:d,withRemoveButton:f,onRemove:h,removeButtonProps:m,radius:g,size:v,disabled:S,mod:x,...w}=n,y=e9(),b=sx(),C=v||(y==null?void 0:y.size)||void 0,j=(b==null?void 0:b.variant)==="filled"?"contrast":u||"default",T=de({name:"Pill",classes:Th,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:o9,stylesCtx:{size:C}});return s.jsxs(q,{component:"span",ref:t,variant:j,size:C,...T("root",{variant:j}),mod:[{"with-remove":f&&!S,disabled:S||(y==null?void 0:y.disabled)},x],...w,children:[s.jsx("span",{...T("label"),children:d}),f&&s.jsx(Us,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...m,...T("remove",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),onMouseDown:E=>{var R;E.preventDefault(),E.stopPropagation(),(R=m==null?void 0:m.onMouseDown)==null||R.call(m,E)},onClick:E=>{var R;E.stopPropagation(),h==null||h(),(R=m==null?void 0:m.onClick)==null||R.call(m,E)}})]})});Ps.classes=Th;Ps.displayName="@mantine/core/Pill";Ps.Group=ax;var vP={field:"m_45c4369d"};const i9={type:"visible"},lx=Y((e,t)=>{const n=V("PillsInputField",i9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,type:u,disabled:d,id:f,pointer:h,mod:m,...g}=n,v=sx(),S=pl(),x=de({name:"PillsInputField",classes:vP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"field"}),w=d||(v==null?void 0:v.disabled);return s.jsx(q,{component:"input",ref:tn(t,v==null?void 0:v.fieldRef),"data-type":u,disabled:w,mod:[{disabled:w,pointer:h},m],...x("field"),...g,id:(S==null?void 0:S.inputId)||f,"aria-invalid":v==null?void 0:v.hasError,"aria-describedby":S==null?void 0:S.describedBy,type:"text",onMouseDown:y=>!h&&y.stopPropagation()})});lx.classes=vP;lx.displayName="@mantine/core/PillsInputField";const s9={},nl=Y((e,t)=>{const n=V("PillsInput",s9,e),{children:r,onMouseDown:o,onClick:i,size:a,disabled:l,__staticSelector:c,error:u,variant:d,...f}=n,h=p.useRef();return s.jsx(J5,{value:{fieldRef:h,size:a,disabled:l,hasError:!!u,variant:d},children:s.jsx(rr,{size:a,error:u,variant:d,component:"div",ref:t,onMouseDown:m=>{var g;m.preventDefault(),o==null||o(m),(g=h.current)==null||g.focus()},onClick:m=>{var g;m.preventDefault(),i==null||i(m),(g=h.current)==null||g.focus()},...f,multiline:!0,disabled:l,__staticSelector:c||"PillsInput",withAria:!1,children:r})})});nl.displayName="@mantine/core/PillsInput";nl.Field=lx;function a9({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(tl(i)?o.push({group:i.group,items:i.items.filter(a=>n.indexOf(a.value.toLowerCase().trim())===-1)}):n.indexOf(i.value.toLowerCase().trim())===-1&&o.push(i),o),[])}const l9={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Ph=Y((e,t)=>{const n=V("MultiSelect",l9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,value:d,defaultValue:f,onChange:h,onKeyDown:m,variant:g,data:v,dropdownOpened:S,defaultDropdownOpened:x,onDropdownOpen:w,onDropdownClose:y,selectFirstOptionOnChange:b,onOptionSubmit:C,comboboxProps:j,filter:T,limit:E,withScrollArea:R,maxDropdownHeight:_,searchValue:N,defaultSearchValue:O,onSearchChange:F,readOnly:z,disabled:H,onFocus:D,onBlur:k,onPaste:P,radius:I,rightSection:L,rightSectionWidth:$,rightSectionPointerEvents:Q,rightSectionProps:ue,leftSection:Re,leftSectionWidth:me,leftSectionPointerEvents:ge,leftSectionProps:De,inputContainer:le,inputWrapperOrder:Ae,withAsterisk:it,labelProps:Ue,descriptionProps:Je,errorProps:st,wrapperProps:Be,description:Ze,label:at,error:ne,maxValues:X,searchable:ce,nothingFoundMessage:ke,withCheckIcon:J,checkIconPosition:se,hidePickedOptions:G,withErrorStyles:Se,name:We,form:Pt,id:lt,clearable:Nt,clearButtonProps:nn,hiddenInputProps:ln,placeholder:to,hiddenInputValuesDivider:Vn,required:Js,mod:ku,renderOption:Ru,onRemove:Ar,onClear:Zs,scrollAreaProps:ea,...kl}=n,Qi=Un(lt),Ki=$T(v),oi=FT(Ki),Dn=iu({opened:S,defaultOpened:x,onDropdownOpen:w,onDropdownClose:()=>{y==null||y(),Dn.resetSelectedOption()}}),{styleProps:op,rest:{type:ip,autoComplete:ta,...na}}=Qo(kl),[cn,Yi]=bn({value:d,defaultValue:f,finalValue:[],onChange:h}),[A,M]=bn({value:N,defaultValue:O,finalValue:"",onChange:F}),U=de({name:"MultiSelect",classes:{},props:n,classNames:r,styles:a,unstyled:l}),{resolvedClassNames:K,resolvedStyles:ve}=Qc({props:n,styles:a,classNames:r}),_e=re=>{m==null||m(re),re.key===" "&&!ce&&(re.preventDefault(),Dn.toggleDropdown()),re.key==="Backspace"&&A.length===0&&cn.length>0&&(Ar==null||Ar(cn[cn.length-1]),Yi(cn.slice(0,cn.length-1)))},$e=cn.map((re,Pe)=>{var Ve,Ge;return s.jsx(Ps,{withRemoveButton:!z&&!((Ve=oi[re])!=null&&Ve.disabled),onRemove:()=>{Yi(cn.filter(rn=>re!==rn)),Ar==null||Ar(re)},unstyled:l,disabled:H,...U("pill"),children:((Ge=oi[re])==null?void 0:Ge.label)||re},`${re}-${Pe}`)});p.useEffect(()=>{b&&Dn.selectFirstOption()},[b,cn]);const be=Nt&&cn.length>0&&!H&&!z&&s.jsx(Oe.ClearButton,{size:u,...nn,onClear:()=>{Zs==null||Zs(),Yi([]),M("")}}),je=a9({data:Ki,value:cn});return s.jsxs(s.Fragment,{children:[s.jsxs(Oe,{store:Dn,classNames:K,styles:ve,unstyled:l,size:u,readOnly:z,__staticSelector:"MultiSelect",onOptionSubmit:re=>{C==null||C(re),M(""),Dn.updateSelectedOptionIndex("selected"),cn.includes(oi[re].value)?(Yi(cn.filter(Pe=>Pe!==oi[re].value)),Ar==null||Ar(oi[re].value)):cn.length<X&&Yi([...cn,oi[re].value])},...j,children:[s.jsx(Oe.DropdownTarget,{children:s.jsx(nl,{...op,__staticSelector:"MultiSelect",classNames:K,styles:ve,unstyled:l,size:u,className:o,style:i,variant:g,disabled:H,radius:I,rightSection:L||be||s.jsx(Oe.Chevron,{size:u,error:ne,unstyled:l}),rightSectionPointerEvents:Q||(be?"all":"none"),rightSectionWidth:$,rightSectionProps:ue,leftSection:Re,leftSectionWidth:me,leftSectionPointerEvents:ge,leftSectionProps:De,inputContainer:le,inputWrapperOrder:Ae,withAsterisk:it,labelProps:Ue,descriptionProps:Je,errorProps:st,wrapperProps:Be,description:Ze,label:at,error:ne,multiline:!0,withErrorStyles:Se,__stylesApiProps:{...n,rightSectionPointerEvents:Q||(be?"all":"none"),multiline:!0},pointer:!ce,onClick:()=>ce?Dn.openDropdown():Dn.toggleDropdown(),"data-expanded":Dn.dropdownOpened||void 0,id:Qi,required:Js,mod:ku,children:s.jsxs(Ps.Group,{disabled:H,unstyled:l,...U("pillsList"),children:[$e,s.jsx(Oe.EventsTarget,{autoComplete:ta,children:s.jsx(nl.Field,{...na,ref:t,id:Qi,placeholder:to,type:!ce&&!to?"hidden":"visible",...U("inputField"),unstyled:l,onFocus:re=>{D==null||D(re),ce&&Dn.openDropdown()},onBlur:re=>{k==null||k(re),Dn.closeDropdown(),M("")},onKeyDown:_e,value:A,onChange:re=>{M(re.currentTarget.value),ce&&Dn.openDropdown(),b&&Dn.selectFirstOption()},disabled:H,readOnly:z||!ce,pointer:!ce})})]})})}),s.jsx(RO,{data:G?je:Ki,hidden:z||H,filter:T,search:A,limit:E,hiddenWhenEmpty:!ke,withScrollArea:R,maxDropdownHeight:_,filterOptions:ce,value:cn,checkIconPosition:se,withCheckIcon:J,nothingFoundMessage:ke,unstyled:l,labelId:at?`${Qi}-label`:void 0,"aria-label":at?void 0:kl["aria-label"],renderOption:Ru,scrollAreaProps:ea})]}),s.jsx(Oe.HiddenInput,{name:We,valuesDivider:Vn,value:cn,form:Pt,disabled:H,...ln})]})});Ph.classes={...rr.classes,...Oe.classes};Ph.displayName="@mantine/core/MultiSelect";function c9(e){return"group"in e}function cx({data:e}){if(c9(e)){const o=e.items.map(i=>s.jsx(cx,{data:i},i.value));return s.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return s.jsx("option",{value:e.value,...r,children:e.label},e.value)}cx.displayName="@mantine/core/NativeSelectOption";const u9={rightSectionPointerEvents:"none"},It=Y((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:a,unstyled:l,...c}=V("NativeSelect",u9,e),u=$T(n).map((d,f)=>s.jsx(cx,{data:d},f));return s.jsx(rr,{component:"select",ref:t,...c,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:l,rightSection:a||s.jsx(ph,{size:o,error:i,unstyled:l}),children:r||u})});It.classes=rr.classes;It.displayName="@mantine/core/NativeSelect";var yP={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const d9={withCloseButton:!0},f9=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:dt(t),"--notification-color":n?ut(n,e):void 0}}),ux=Y((e,t)=>{const n=V("Notification",d9,e),{className:r,color:o,radius:i,loading:a,withCloseButton:l,withBorder:c,title:u,icon:d,children:f,onClose:h,closeButtonProps:m,classNames:g,style:v,styles:S,unstyled:x,variant:w,vars:y,mod:b,...C}=n,j=de({name:"Notification",classes:yP,props:n,className:r,style:v,classNames:g,styles:S,unstyled:x,vars:y,varsResolver:f9});return s.jsxs(q,{...j("root"),mod:[{"data-with-icon":!!d||a,"data-with-border":c},b],ref:t,variant:w,...C,role:"alert",children:[d&&!a&&s.jsx("div",{...j("icon"),children:d}),a&&s.jsx(tr,{size:28,color:o,...j("loader")}),s.jsxs("div",{...j("body"),children:[u&&s.jsx("div",{...j("title"),children:u}),s.jsx(q,{...j("description"),mod:{"data-with-title":!!u},children:f})]}),l&&s.jsx(Us,{iconSize:16,color:"gray",...m,unstyled:x,onClick:h,...j("closeButton")})]})});ux.classes=yP;ux.displayName="@mantine/core/Notification";function xP(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 Nc;(function(e){e.event="event",e.props="prop"})(Nc||(Nc={}));function vi(){}function h9(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(i,a){return i===t[a]})||(t=r,n=e.apply(void 0,r)),n}}function Mc(e){return!!(e||"").match(/\d/)}function Ba(e){return e==null}function p9(e){return typeof e=="number"&&isNaN(e)}function bP(e){return Ba(e)||p9(e)||typeof e=="number"&&!isFinite(e)}function wP(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function m9(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 g9(e,t,n){var r=m9(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 v9(e){var t=p.useRef(e);t.current=e;var n=p.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function dx(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),i=o[0],a=o[1]||"";return{beforeDecimal:i,afterDecimal:a,hasNegation:n,addNegation:r}}function y9(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 SP(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function Wb(e,t){return Array(t+1).join(e)}function jP(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],i=r[1];if(i=Number(i),!i)return n+o;o=o.replace(".","");var a=1+i,l=o.length;return a<0?o="0."+Wb("0",Math.abs(a))+o:a>=l?o=o+Wb("0",a-l):o=(o.substring(0,a)||"0")+"."+o.substring(a),n+o}function qb(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=dx(e),i=o.beforeDecimal,a=o.afterDecimal,l=o.hasNegation,c=parseFloat("0."+(a||"0")),u=a.length<=t?"0."+a:c.toFixed(t),d=u.split("."),f=i;i&&Number(d[0])&&(f=i.split("").reverse().reduce(function(v,S,x){return v.length>x?(Number(v[0])+Number(S)).toString()+v.substring(1,v.length):S+v},d[0]));var h=SP(d[1]||"",t,n),m=l?"-":"",g=r?".":"";return""+m+f+g+h}function ss(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 CP=h9(function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:i-r}}}),x9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function b9(e,t,n){return Math.min(Math.max(e,t),n)}function Xp(e){return Math.max(e.selectionStart,e.selectionEnd)}function w9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function S9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function j9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function C9(e,t,n,r,o,i,a){a===void 0&&(a=j9);var l=o.findIndex(function(b){return b}),c=e.slice(0,l);!t&&!n.startsWith(c)&&(t=c,n=c+n,r=r+c.length);for(var u=n.length,d=e.length,f={},h=new Array(u),m=0;m<u;m++){h[m]=-1;for(var g=0,v=d;g<v;g++){var S=a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:m,formattedValueIndex:g});if(S&&f[g]!==!0){h[m]=g,f[g]=!0;break}}}for(var x=r;x<u&&(h[x]===-1||!i(n[x]));)x++;var w=x===u||h[x]===-1?d:h[x];for(x=r-1;x>0&&h[x]===-1;)x--;var y=x===-1||h[x]===-1?0:h[x]+1;return y>w?w:r-y<w-r?y:w}function Gb(e,t,n,r){var o=e.length;if(t=b9(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 E9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(Mc(e[n])||Mc(e[n-1]));return t}function EP(e,t,n,r,o,i){i===void 0&&(i=vi);var a=v9(function(g,v){var S,x;return bP(g)?(x="",S=""):typeof g=="number"||v?(x=typeof g=="number"?jP(g):g,S=r(x)):(x=o(g,void 0),S=r(x)),{formattedValue:S,numAsString:x}}),l=p.useState(function(){return a(Ba(e)?t:e,n)}),c=l[0],u=l[1],d=function(g,v){g.formattedValue!==c.formattedValue&&u({formattedValue:g.formattedValue,numAsString:g.value}),i(g,v)},f=e,h=n;Ba(e)&&(f=c.numAsString,h=!0);var m=a(f,h);return p.useMemo(function(){u(m)},[m.formattedValue]),[c,d]}function T9(e){return e.replace(/[^0-9]/g,"")}function P9(e){return e}function k9(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,i=e.getInputRef,a=e.format;a===void 0&&(a=P9);var l=e.removeFormatting;l===void 0&&(l=T9);var c=e.defaultValue,u=e.valueIsNumericString,d=e.onValueChange,f=e.isAllowed,h=e.onChange;h===void 0&&(h=vi);var m=e.onKeyDown;m===void 0&&(m=vi);var g=e.onMouseUp;g===void 0&&(g=vi);var v=e.onFocus;v===void 0&&(v=vi);var S=e.onBlur;S===void 0&&(S=vi);var x=e.value,w=e.getCaretBoundary;w===void 0&&(w=E9);var y=e.isValidInputCharacter;y===void 0&&(y=Mc);var b=e.isCharacterSame,C=xP(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),j=EP(x,c,!!u,a,l,d),T=j[0],E=T.formattedValue,R=T.numAsString,_=j[1],N=p.useRef(),O=p.useRef({formattedValue:E,numAsString:R}),F=function(ne,X){O.current={formattedValue:ne.formattedValue,numAsString:ne.value},_(ne,X)},z=p.useState(!1),H=z[0],D=z[1],k=p.useRef(null),P=p.useRef({setCaretTimeout:null,focusTimeout:null});p.useEffect(function(){return D(!0),function(){clearTimeout(P.current.setCaretTimeout),clearTimeout(P.current.focusTimeout)}},[]);var I=a,L=function(ne,X){var ce=parseFloat(X);return{formattedValue:ne,value:X,floatValue:isNaN(ce)?void 0:ce}},$=function(ne,X,ce){ne.selectionStart===0&&ne.selectionEnd===ne.value.length||(ss(ne,X),P.current.setCaretTimeout=setTimeout(function(){ne.value===ce&&ne.selectionStart!==X&&ss(ne,X)},0))},Q=function(ne,X,ce){return Gb(ne,X,w(ne),ce)},ue=function(ne,X,ce){var ke=w(X),J=C9(X,E,ne,ce,ke,y,b);return J=Gb(X,J,ke),J},Re=function(ne){var X=ne.formattedValue;X===void 0&&(X="");var ce=ne.input,ke=ne.source,J=ne.event,se=ne.numAsString,G;if(ce){var Se=ne.inputValue||ce.value,We=Xp(ce);ce.value=X,G=ue(Se,X,We),G!==void 0&&$(ce,G,X)}X!==E&&F(L(X,se),{event:J,source:ke})};p.useEffect(function(){var ne=O.current,X=ne.formattedValue,ce=ne.numAsString;(E!==X||R!==ce)&&F(L(E,R),{event:void 0,source:Nc.props})},[E,R]);var me=k.current?Xp(k.current):void 0,ge=typeof window<"u"?p.useLayoutEffect:p.useEffect;ge(function(){var ne=k.current;if(E!==O.current.formattedValue&&ne){var X=ue(O.current.formattedValue,E,me);ne.value=E,$(ne,X,E)}},[E]);var De=function(ne,X,ce){var ke=X.target,J=N.current?x9(N.current,ke.selectionEnd):CP(E,ne),se=Object.assign(Object.assign({},J),{lastValue:E}),G=l(ne,se),Se=I(G);if(G=l(Se,void 0),f&&!f(L(Se,G))){var We=X.target,Pt=Xp(We),lt=ue(ne,E,Pt);return We.value=E,$(We,lt,E),!1}return Re({formattedValue:Se,numAsString:G,inputValue:ne,event:X,source:ce,input:X.target}),!0},le=function(ne,X){X===void 0&&(X=0);var ce=ne.selectionStart,ke=ne.selectionEnd;N.current={selectionStart:ce,selectionEnd:ke+X}},Ae=function(ne){var X=ne.target,ce=X.value,ke=De(ce,ne,Nc.event);ke&&h(ne),N.current=void 0},it=function(ne){var X=ne.target,ce=ne.key,ke=X.selectionStart,J=X.selectionEnd,se=X.value;se===void 0&&(se="");var G;ce==="ArrowLeft"||ce==="Backspace"?G=Math.max(ke-1,0):ce==="ArrowRight"?G=Math.min(ke+1,se.length):ce==="Delete"&&(G=ke);var Se=0;ce==="Delete"&&ke===J&&(Se=1);var We=ce==="ArrowLeft"||ce==="ArrowRight";if(G===void 0||ke!==J&&!We){m(ne),le(X,Se);return}var Pt=G;if(We){var lt=ce==="ArrowLeft"?"left":"right";Pt=Q(se,G,lt),Pt!==G&&ne.preventDefault()}else ce==="Delete"&&!y(se[G])?Pt=Q(se,G,"right"):ce==="Backspace"&&!y(se[G])&&(Pt=Q(se,G,"left"));Pt!==G&&$(X,Pt,se),m(ne),le(X,Se)},Ue=function(ne){var X=ne.target,ce=function(){var ke=X.selectionStart,J=X.selectionEnd,se=X.value;if(se===void 0&&(se=""),ke===J){var G=Q(se,ke);G!==ke&&$(X,G,se)}};ce(),requestAnimationFrame(function(){ce()}),g(ne),le(X)},Je=function(ne){ne.persist&&ne.persist();var X=ne.target,ce=ne.currentTarget;k.current=X,P.current.focusTimeout=setTimeout(function(){var ke=X.selectionStart,J=X.selectionEnd,se=X.value;se===void 0&&(se="");var G=Q(se,ke);G!==ke&&!(ke===0&&J===se.length)&&$(X,G,se),v(Object.assign(Object.assign({},ne),{currentTarget:ce}))},0)},st=function(ne){k.current=null,clearTimeout(P.current.focusTimeout),clearTimeout(P.current.setCaretTimeout),S(ne)},Be=H&&w9()?"numeric":void 0,Ze=Object.assign({inputMode:Be},C,{type:t,value:E,onChange:Ae,onKeyDown:it,onMouseUp:Ue,onFocus:Je,onBlur:st});if(n==="text")return o?fn.createElement(fn.Fragment,null,o(E,C)||null):fn.createElement("span",Object.assign({},C,{ref:i}),E);if(r){var at=r;return fn.createElement(at,Object.assign({},Ze,{ref:i}))}return fn.createElement("input",Object.assign({},Ze,{ref:i}))}function Qb(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var i=t.suffix;i===void 0&&(i="");var a=t.allowNegative,l=t.thousandsGroupStyle;if(l===void 0&&(l="thousand"),e===""||e==="-")return e;var c=kh(t),u=c.thousandSeparator,d=c.decimalSeparator,f=n!==0&&e.indexOf(".")!==-1||n&&r,h=dx(e,a),m=h.beforeDecimal,g=h.afterDecimal,v=h.addNegation;return n!==void 0&&(g=SP(g,n,!!r)),u&&(m=g9(m,u,l)),o&&(m=o+m),i&&(g=g+i),v&&(m="-"+m),e=m+(f&&d||"")+g,e}function kh(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 R9(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}function _9(e,t){return new RegExp("(^-)|[0-9]|"+wP(e),"g")}function D9(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function I9(e,t,n){var r;t===void 0&&(t=S9(e));var o=n.allowNegative,i=n.prefix;i===void 0&&(i="");var a=n.suffix;a===void 0&&(a="");var l=n.decimalScale,c=t.from,u=t.to,d=u.start,f=u.end,h=kh(n),m=h.allowedDecimalSeparators,g=h.decimalSeparator,v=e[f]===g;if(Mc(e)&&(e===i||e===a)&&t.lastValue==="")return e;if(f-d===1&&m.indexOf(e[d])!==-1){var S=l===0?"":g;e=e.substring(0,d)+S+e.substring(d+1,e.length)}var x=function(k,P,I){var L=!1,$=!1;i.startsWith("-")?L=!1:k.startsWith("--")?(L=!1,$=!0):a.startsWith("-")&&k.length===a.length?L=!1:k[0]==="-"&&(L=!0);var Q=L?1:0;return $&&(Q=2),Q&&(k=k.substring(Q),P-=Q,I-=Q),{value:k,start:P,end:I,hasNegation:L}},w=x(e,d,f),y=w.hasNegation;r=w,e=r.value,d=r.start,f=r.end;var b=x(t.lastValue,c.start,c.end),C=b.start,j=b.end,T=b.value,E=e.substring(d,f);e.length&&T.length&&(C>T.length-a.length||j<i.length)&&!(E&&a.startsWith(E))&&(e=T);var R=0;e.startsWith(i)?R+=i.length:d<i.length&&(R=d),e=e.substring(R),f-=R;var _=e.length,N=e.length-a.length;e.endsWith(a)?_=N:(f>N||f>e.length-a.length)&&(_=f),e=e.substring(0,_),e=R9(y?"-"+e:e,o),e=(e.match(_9(g))||[]).join("");var O=e.indexOf(g);e=e.replace(new RegExp(wP(g),"g"),function(k,P){return P===O?".":""});var F=dx(e,o),z=F.beforeDecimal,H=F.afterDecimal,D=F.addNegation;return u.end-u.start<c.end-c.start&&z===""&&v&&!parseFloat(H)&&(e=D?"-":""),e}function A9(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}),i=e[0]==="-";o.fill(!1,0,n.length+(i?1:0));var a=e.length;return o.fill(!1,a-r.length+1,a+1),o}function N9(e){var t=kh(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var i=e.allowNegative;if(i===void 0&&(i=!0),n===r)throw new Error(`
|
|
84
|
+
Decimal separator can't be same as thousand separator.
|
|
85
|
+
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
86
|
+
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
87
|
+
`);return o.startsWith("-")&&i&&(console.error(`
|
|
88
|
+
Prefix can't start with '-' when allowNegative is true.
|
|
89
|
+
prefix: `+o+`
|
|
90
|
+
allowNegative: `+i+`
|
|
91
|
+
`),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}function M9(e){e=N9(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=vi);var i=e.onBlur;i===void 0&&(i=vi);var a=e.thousandSeparator,l=e.decimalScale,c=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var d=e.defaultValue,f=e.value,h=e.valueIsNumericString,m=e.onValueChange,g=xP(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=kh(e),S=v.decimalSeparator,x=v.allowedDecimalSeparators,w=function(D){return Qb(D,e)},y=function(D,k){return I9(D,k,e)},b=Ba(f)?d:f,C=h??D9(b,u,t);Ba(f)?Ba(d)||(C=C||typeof d=="number"):C=C||typeof f=="number";var j=function(D){return bP(D)?D:(typeof D=="number"&&(D=jP(D)),C&&typeof l=="number"?qb(D,l,!!c):D)},T=EP(j(f),j(d),!!C,w,y,m),E=T[0],R=E.numAsString,_=E.formattedValue,N=T[1],O=function(D){var k=D.target,P=D.key,I=k.selectionStart,L=k.selectionEnd,$=k.value;if($===void 0&&($=""),(P==="Backspace"||P==="Delete")&&L<u.length){D.preventDefault();return}if(I!==L){o(D);return}P==="Backspace"&&$[0]==="-"&&I===u.length+1&&n&&ss(k,1),l&&c&&(P==="Backspace"&&$[I-1]===S?(ss(k,I-1),D.preventDefault()):P==="Delete"&&$[I]===S&&D.preventDefault()),x!=null&&x.includes(P)&&$[I]===S&&ss(k,I+1);var Q=a===!0?",":a;P==="Backspace"&&$[I-1]===Q&&ss(k,I-1),P==="Delete"&&$[I]===Q&&ss(k,I+1),o(D)},F=function(D){var k=R;if(k.match(/\d/g)||(k=""),r||(k=y9(k)),c&&l&&(k=qb(k,l,c)),k!==R){var P=Qb(k,e);N({formattedValue:P,value:k,floatValue:parseFloat(k)},{event:D,source:Nc.event})}i(D)},z=function(D){return D===S?!0:Mc(D)},H=function(D){var k=D.currentValue,P=D.lastValue,I=D.formattedValue,L=D.currentValueIndex,$=D.formattedValueIndex,Q=k[L],ue=I[$],Re=CP(P,k),me=Re.to,ge=function(De){return y(De).indexOf(".")+u.length};return f===0&&c&&l&&k[me.start]===S&&ge(k)<L&&ge(I)>$?!1:L>=me.start&&L<me.end&&x&&x.includes(Q)&&ue===S?!0:Q===ue};return Object.assign(Object.assign({},g),{value:_,valueIsNumericString:!1,isValidInputCharacter:z,isCharacterSame:H,onValueChange:N,format:w,removeFormatting:y,getCaretBoundary:function(D){return A9(D,e)},onKeyDown:O,onBlur:F})}function O9(e){var t=M9(e);return fn.createElement(k9,Object.assign({},t))}function Kb({direction:e,style:t,...n}){return s.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:s.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 Cg={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const L9=/^(0\.0*|-0(\.0*)?)$/,$9=/^-?0\d+(\.\d+)?\.?$/;function F9(e){return e.toString().replace(".","").length}function z9(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&F9(t)<14&&t!==""}function Yb(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 U9={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},B9=(e,{size:t})=>({controls:{"--ni-chevron-size":Ne(t,"ni-chevron-size")}}),fx=Y((e,t)=>{const n=V("NumberInput",U9,e),{className:r,classNames:o,styles:i,unstyled:a,vars:l,onChange:c,onValueChange:u,value:d,defaultValue:f,max:h,min:m,step:g,hideControls:v,rightSection:S,isAllowed:x,clampBehavior:w,onBlur:y,allowDecimal:b,decimalScale:C,onKeyDown:j,onKeyDownCapture:T,handlersRef:E,startValue:R,disabled:_,rightSectionPointerEvents:N,allowNegative:O,readOnly:F,size:z,rightSectionWidth:H,stepHoldInterval:D,stepHoldDelay:k,allowLeadingZeros:P,withKeyboardEvents:I,trimLeadingZeroesOnBlur:L,...$}=n,Q=de({name:"NumberInput",classes:Cg,props:n,classNames:o,styles:i,unstyled:a,vars:l,varsResolver:B9}),{resolvedClassNames:ue,resolvedStyles:Re}=Qc({classNames:o,styles:i,props:n}),[me,ge]=bn({value:d,defaultValue:f,onChange:c}),De=k!==void 0&&D!==void 0,le=p.useRef(null),Ae=p.useRef(null),it=p.useRef(0),Ue=(G,Se)=>{Se.source==="event"&&ge(z9(G.floatValue,G.value)&&!L9.test(G.value)&&!(P&&$9.test(G.value))?G.floatValue:G.value),u==null||u(G,Se)},Je=G=>{const Se=String(G).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Se?Math.max(0,(Se[1]?Se[1].length:0)-(Se[2]?+Se[2]:0)):0},st=G=>{le.current&&typeof G<"u"&&le.current.setSelectionRange(G,G)},Be=p.useRef();Be.current=()=>{let G;const Se=Je(me),We=Je(g),Pt=Math.max(Se,We),lt=10**Pt;if(typeof me!="number"||Number.isNaN(me))G=Mu(R,m,h);else if(h!==void 0){const nn=(Math.round(me*lt)+Math.round(g*lt))/lt;G=nn<=h?nn:h}else G=(Math.round(me*lt)+Math.round(g*lt))/lt;const Nt=G.toFixed(Pt);ge(parseFloat(Nt)),u==null||u({floatValue:parseFloat(Nt),formattedValue:Nt,value:Nt},{source:"increment"}),setTimeout(()=>{var nn;return st((nn=le.current)==null?void 0:nn.value.length)},0)};const Ze=p.useRef();Ze.current=()=>{let G;const Se=m!==void 0?m:O?Number.MIN_SAFE_INTEGER:0,We=Je(me),Pt=Je(g),lt=Math.max(We,Pt),Nt=10**lt;if(typeof me!="number"||Number.isNaN(me))G=Mu(R,Se,h);else{const ln=(Math.round(me*Nt)-Math.round(g*Nt))/Nt;G=Se!==void 0&&ln<Se?Se:ln}const nn=G.toFixed(lt);ge(parseFloat(nn)),u==null||u({floatValue:parseFloat(nn),formattedValue:nn,value:nn},{source:"decrement"}),setTimeout(()=>{var ln;return st((ln=le.current)==null?void 0:ln.value.length)},0)};const at=G=>{j==null||j(G),!(F||!I)&&(G.key==="ArrowUp"&&(G.preventDefault(),Be.current()),G.key==="ArrowDown"&&(G.preventDefault(),Ze.current()))},ne=G=>{if(T==null||T(G),G.key==="Backspace"){const Se=le.current;Se.selectionStart===0&&Se.selectionStart===Se.selectionEnd&&(G.preventDefault(),window.setTimeout(()=>st(0),0))}};Lf(E,{increment:Be.current,decrement:Ze.current});const X=G=>{G?Be.current():Ze.current(),it.current+=1},ce=G=>{if(X(G),De){const Se=typeof D=="number"?D:D(it.current);Ae.current=window.setTimeout(()=>ce(G),Se)}},ke=(G,Se)=>{var We;G.preventDefault(),(We=le.current)==null||We.focus(),X(Se),De&&(Ae.current=window.setTimeout(()=>ce(Se),k))},J=()=>{Ae.current&&window.clearTimeout(Ae.current),Ae.current=null,it.current=0},se=s.jsxs("div",{...Q("controls"),children:[s.jsx(Sn,{...Q("control"),tabIndex:-1,"aria-hidden":!0,disabled:_||typeof me=="number"&&h!==void 0&&me>=h,mod:{direction:"up"},onMouseDown:G=>G.preventDefault(),onPointerDown:G=>{ke(G,!0)},onPointerUp:J,onPointerLeave:J,children:s.jsx(Kb,{direction:"up"})}),s.jsx(Sn,{...Q("control"),tabIndex:-1,"aria-hidden":!0,disabled:_||typeof me=="number"&&m!==void 0&&me<=m,mod:{direction:"down"},onMouseDown:G=>G.preventDefault(),onPointerDown:G=>{ke(G,!1)},onPointerUp:J,onPointerLeave:J,children:s.jsx(Kb,{direction:"down"})})]});return s.jsx(rr,{component:O9,allowNegative:O,className:rt(Cg.root,r),size:z,...$,readOnly:F,disabled:_,value:me,getInputRef:tn(t,le),onValueChange:Ue,rightSection:v||F?S:S||se,classNames:ue,styles:Re,unstyled:a,__staticSelector:"NumberInput",decimalScale:b?C:0,onKeyDown:at,onKeyDownCapture:ne,rightSectionPointerEvents:N??(_?"none":void 0),rightSectionWidth:H??`var(--ni-right-section-width-${z||"sm"})`,allowLeadingZeros:P,onBlur:G=>{if(y==null||y(G),w==="blur"&&typeof me=="number"&&Mu(me,m,h)!==me&&ge(Mu(me,m,h)),L&&typeof me=="string"&&Je(me)<15){const Se=me.replace(/^0+/,""),We=parseFloat(Se);ge(Number.isNaN(We)||We>Number.MAX_SAFE_INTEGER?Se:We)}},isAllowed:G=>w==="strict"?x?x(G)&&Yb(G.floatValue,m,h):Yb(G.floatValue,m,h):x?x(G):!0})});fx.classes={...rr.classes,...Cg};fx.displayName="@mantine/core/NumberInput";const[V9,Rh]=zn("Pagination.Root component was not found in tree");var lu={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const H9={withPadding:!0},cu=Y((e,t)=>{const n=V("PaginationControl",H9,e),{classNames:r,className:o,style:i,styles:a,vars:l,active:c,disabled:u,withPadding:d,mod:f,...h}=n,m=Rh(),g=u||m.disabled;return s.jsx(Sn,{ref:t,disabled:g,mod:[{active:c,disabled:g,"with-padding":d},f],...m.getStyles("control",{className:o,style:i,classNames:r,styles:a,active:!g}),...h})});cu.classes=lu;cu.displayName="@mantine/core/PaginationControl";function uu({style:e,children:t,path:n,...r}){return s.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:s.jsx("path",{d:n,fill:"currentColor"})})}const W9=e=>s.jsx(uu,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),q9=e=>s.jsx(uu,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),G9=e=>s.jsx(uu,{...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"}),Q9=e=>s.jsx(uu,{...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"}),K9=e=>s.jsx(uu,{...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"}),Y9={icon:K9},_h=Y((e,t)=>{const n=V("PaginationDots",Y9,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,...u}=n,d=Rh(),f=c;return s.jsx(q,{ref:t,...d.getStyles("dots",{className:o,style:i,styles:a,classNames:r}),...u,children:s.jsx(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});_h.classes=lu;_h.displayName="@mantine/core/PaginationDots";function Dh({icon:e,name:t,action:n,type:r}){const o={icon:e},i=p.forwardRef((a,l)=>{const{icon:c,...u}=V(t,o,a),d=c,f=Rh(),h=r==="next"?f.active===f.total:f.active===1;return s.jsx(cu,{disabled:f.disabled||h,ref:l,onClick:f[n],withPadding:!1,...u,children:s.jsx(d,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return i.displayName=`@mantine/core/${t}`,i}const TP=Dh({icon:W9,name:"PaginationNext",action:"onNext",type:"next"}),PP=Dh({icon:q9,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),kP=Dh({icon:G9,name:"PaginationFirst",action:"onFirst",type:"previous"}),RP=Dh({icon:Q9,name:"PaginationLast",action:"onLast",type:"next"});function hx({dotsIcon:e}){const t=Rh(),n=t.range.map((r,o)=>{var i,a,l;return r==="dots"?s.jsx(_h,{icon:e},o):s.jsx(cu,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(i=t.getItemProps)==null?void 0:i.call(t,r),children:((l=(a=t.getItemProps)==null?void 0:a.call(t,r))==null?void 0:l.children)??r},o)});return s.jsx(s.Fragment,{children:n})}hx.displayName="@mantine/core/PaginationItems";const X9={siblings:1,boundaries:1},J9=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:dt(n),"--pagination-control-size":Ne(t,"pagination-control-size"),"--pagination-control-fz":hn(t),"--pagination-active-bg":r?ut(r,e):void 0,"--pagination-active-color":Ms(o,e)?Go({color:r,theme:e,autoContrast:o}):void 0}}),Ih=Y((e,t)=>{const n=V("PaginationRoot",X9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,total:u,value:d,defaultValue:f,onChange:h,disabled:m,siblings:g,boundaries:v,color:S,radius:x,onNextPage:w,onPreviousPage:y,onFirstPage:b,onLastPage:C,getItemProps:j,autoContrast:T,...E}=n,R=de({name:"Pagination",classes:lu,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:J9}),{range:_,setPage:N,next:O,previous:F,active:z,first:H,last:D}=ID({page:d,initialPage:f,onChange:h,total:u,siblings:g,boundaries:v}),k=Gn(w,O),P=Gn(y,F),I=Gn(b,H),L=Gn(C,D);return s.jsx(V9,{value:{total:u,range:_,active:z,disabled:m,getItemProps:j,onChange:N,onNext:k,onPrevious:P,onFirst:I,onLast:L,getStyles:R},children:s.jsx(q,{ref:t,...R("root"),...E})})});Ih.classes=lu;Ih.displayName="@mantine/core/PaginationRoot";const Z9={withControls:!0,siblings:1,boundaries:1,gap:8},Zr=Y((e,t)=>{const n=V("Pagination",Z9,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:a,previousIcon:l,lastIcon:c,firstIcon:u,dotsIcon:d,total:f,gap:h,hideWithOnePage:m,...g}=n;return f<=0||m&&f===1?null:s.jsx(Ih,{ref:t,total:f,...g,children:s.jsxs(te,{gap:h,children:[r&&s.jsx(kP,{icon:u,...i==null?void 0:i("first")}),o&&s.jsx(PP,{icon:l,...i==null?void 0:i("previous")}),s.jsx(hx,{dotsIcon:d}),o&&s.jsx(TP,{icon:a,...i==null?void 0:i("next")}),r&&s.jsx(RP,{icon:c,...i==null?void 0:i("last")})]})})});Zr.classes=lu;Zr.displayName="@mantine/core/Pagination";Zr.Root=Ih;Zr.Control=cu;Zr.Dots=_h;Zr.First=kP;Zr.Last=RP;Zr.Next=TP;Zr.Previous=PP;Zr.Items=hx;const eL=({reveal:e})=>s.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:s.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 Eg={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const tL={visibilityToggleIcon:eL},nL=(e,{size:t})=>({root:{"--psi-icon-size":Ne(t,"psi-icon-size"),"--psi-button-size":Ne(t,"psi-button-size")}}),Wr=Y((e,t)=>{const n=V("PasswordInput",tL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,required:u,error:d,leftSection:f,disabled:h,id:m,variant:g,inputContainer:v,description:S,label:x,size:w,errorProps:y,descriptionProps:b,labelProps:C,withAsterisk:j,inputWrapperOrder:T,wrapperProps:E,radius:R,rightSection:_,rightSectionWidth:N,rightSectionPointerEvents:O,leftSectionWidth:F,visible:z,defaultVisible:H,onVisibilityChange:D,visibilityToggleIcon:k,visibilityToggleButtonProps:P,rightSectionProps:I,leftSectionProps:L,leftSectionPointerEvents:$,withErrorStyles:Q,mod:ue,...Re}=n,me=Un(m),[ge,De]=bn({value:z,defaultValue:H,finalValue:!1,onChange:D}),le=()=>De(!ge),Ae=de({name:"PasswordInput",classes:Eg,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:nL}),{resolvedClassNames:it,resolvedStyles:Ue}=Qc({classNames:r,styles:a,props:n}),{styleProps:Je,rest:st}=Qo(Re),Be=k,Ze=s.jsx(Zt,{...Ae("visibilityToggle"),disabled:h,radius:R,"aria-hidden":!P,tabIndex:-1,...P,variant:"subtle",color:"gray",unstyled:l,onTouchEnd:at=>{var ne;at.preventDefault(),(ne=P==null?void 0:P.onTouchEnd)==null||ne.call(P,at),le()},onMouseDown:at=>{var ne;at.preventDefault(),(ne=P==null?void 0:P.onMouseDown)==null||ne.call(P,at),le()},onKeyDown:at=>{var ne;(ne=P==null?void 0:P.onKeyDown)==null||ne.call(P,at),at.key===" "&&(at.preventDefault(),le())},children:s.jsx(Be,{reveal:ge})});return s.jsx(Lt.Wrapper,{required:u,id:me,label:x,error:d,description:S,size:w,classNames:it,styles:Ue,__staticSelector:"PasswordInput",errorProps:y,descriptionProps:b,unstyled:l,withAsterisk:j,inputWrapperOrder:T,inputContainer:v,variant:g,labelProps:{...C,htmlFor:me},mod:ue,...Ae("root"),...Je,...E,children:s.jsx(Lt,{component:"div",error:d,leftSection:f,size:w,classNames:{...it,input:rt(Eg.input,it.input)},styles:Ue,radius:R,disabled:h,__staticSelector:"PasswordInput",rightSectionWidth:N,rightSection:_??Ze,variant:g,unstyled:l,leftSectionWidth:F,rightSectionPointerEvents:O||"all",rightSectionProps:I,leftSectionProps:L,leftSectionPointerEvents:$,withAria:!1,withErrorStyles:Q,children:s.jsx("input",{required:u,"data-invalid":!!d||void 0,"data-with-left-section":!!f||void 0,...Ae("innerInput"),disabled:h,id:me,ref:t,...st,autoComplete:st.autoComplete||"off",type:ge?"text":"password"})})})});Wr.classes={...rr.classes,...Eg};Wr.displayName="@mantine/core/PasswordInput";const[rL,_P]=Ns(),[oL,iL]=Ns();var DP={card:"m_9dc8ae12"};const sL={withBorder:!0},aL=(e,{radius:t})=>({card:{"--card-radius":dt(t)}}),px=Y((e,t)=>{const n=V("RadioCard",sL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,checked:u,mod:d,withBorder:f,value:h,onClick:m,name:g,onKeyDown:v,...S}=n,x=de({name:"RadioCard",classes:DP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:aL,rootSelector:"card"}),{dir:w}=Ls(),y=_P(),b=typeof u=="boolean"?u:(y==null?void 0:y.value)===h||!1,C=g||(y==null?void 0:y.name),j=T=>{if(v==null||v(T),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(T.nativeEvent.code)){T.preventDefault();const E=Array.from(document.querySelectorAll(`[role="radio"][name="${C||"__mantine"}"]`)),R=E.findIndex(O=>O===T.target),_=R+1>=E.length?0:R+1,N=R-1<0?E.length-1:R-1;T.nativeEvent.code==="ArrowDown"&&(E[_].focus(),E[_].click()),T.nativeEvent.code==="ArrowUp"&&(E[N].focus(),E[N].click()),T.nativeEvent.code==="ArrowLeft"&&(E[w==="ltr"?N:_].focus(),E[w==="ltr"?N:_].click()),T.nativeEvent.code==="ArrowRight"&&(E[w==="ltr"?_:N].focus(),E[w==="ltr"?_:N].click())}};return s.jsx(oL,{value:{checked:b},children:s.jsx(Sn,{ref:t,mod:[{"with-border":f,checked:b},d],...x("card"),...S,role:"radio","aria-checked":b,name:C,onClick:T=>{m==null||m(T),y==null||y.onChange(h||"")},onKeyDown:j})})});px.displayName="@mantine/core/RadioCard";px.classes=DP;const lL={},mx=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,name:c,readOnly:u,...d}=V("RadioGroup",lL,e),f=Un(c),[h,m]=bn({value:n,defaultValue:r,finalValue:"",onChange:o}),g=v=>!u&&m(typeof v=="string"?v:v.currentTarget.value);return s.jsx(rL,{value:{value:h,onChange:g,size:i,name:f},children:s.jsx(Lt.Wrapper,{size:i,ref:t,...a,...d,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(By,{role:"radiogroup",children:l})})})});mx.classes=Lt.Wrapper.classes;mx.displayName="@mantine/core/RadioGroup";function IP({size:e,style:t,...n}){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:B(e),height:B(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var AP={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const cL={icon:IP},uL=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=jr({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--radio-size":Ne(r,"radio-size"),"--radio-radius":t===void 0?void 0:dt(t),"--radio-color":i==="outline"?c:ut(n,e),"--radio-icon-size":Ne(r,"radio-icon-size"),"--radio-icon-color":o?ut(o,e):Ms(a,e)?Go({color:n,theme:e,autoContrast:a}):void 0}}},gx=Y((e,t)=>{const n=V("RadioIndicator",cL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,icon:u,radius:d,color:f,iconColor:h,autoContrast:m,checked:g,mod:v,variant:S,disabled:x,...w}=n,y=u,b=de({name:"RadioIndicator",classes:AP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:uL,rootSelector:"indicator"}),C=iL(),j=typeof g=="boolean"?g:(C==null?void 0:C.checked)||!1;return s.jsx(q,{ref:t,...b("indicator",{variant:S}),variant:S,mod:[{checked:j,disabled:x},v],...w,children:s.jsx(y,{...b("icon")})})});gx.displayName="@mantine/core/RadioIndicator";gx.classes=AP;var NP={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const dL={labelPosition:"right"},fL=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:a})=>{const l=jr({color:r||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--radio-size":Ne(t,"radio-size"),"--radio-radius":n===void 0?void 0:dt(n),"--radio-color":i==="outline"?c:ut(r,e),"--radio-icon-color":o?ut(o,e):Ms(a,e)?Go({color:r,theme:e,autoContrast:a}):void 0,"--radio-icon-size":Ne(t,"radio-icon-size")}}},ks=Y((e,t)=>{const n=V("Radio",dL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,id:u,size:d,label:f,labelPosition:h,description:m,error:g,radius:v,color:S,variant:x,disabled:w,wrapperProps:y,icon:b=IP,rootRef:C,iconColor:j,onChange:T,mod:E,...R}=n,_=de({name:"Radio",classes:NP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:fL}),N=_P(),O=(N==null?void 0:N.size)??d,F=n.size?d:O,{styleProps:z,rest:H}=Qo(R),D=Un(u),k=N?{checked:N.value===H.value,name:H.name??N.name,onChange:P=>{N.onChange(P),T==null||T(P)}}:{};return s.jsx(mh,{..._("root"),__staticSelector:"Radio",__stylesApiProps:n,id:D,size:F,labelPosition:h,label:f,description:m,error:g,disabled:w,classNames:r,styles:a,unstyled:l,"data-checked":k.checked||void 0,variant:x,ref:C,mod:E,...z,...y,children:s.jsxs(q,{..._("inner"),mod:{"label-position":h},children:[s.jsx(q,{..._("radio",{focusable:!0,variant:x}),onChange:T,...H,...k,component:"input",mod:{error:!!g},ref:t,id:D,disabled:w,type:"radio"}),s.jsx(b,{..._("icon"),"aria-hidden":!0})]})})});ks.classes=NP;ks.displayName="@mantine/core/Radio";ks.Group=mx;ks.Card=px;ks.Indicator=gx;const hL={duration:100,transition:"fade"};function pL(e,t){return{...hL,...t,...e}}function mL({offset:e,position:t,defaultOpened:n}){const[r,o]=p.useState(n),i=p.useRef(),{x:a,y:l,elements:c,refs:u,update:d,placement:f}=xy({placement:t,middleware:[my({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=f.includes("right")?e:t.includes("left")?e*-1:0,m=f.includes("bottom")?e:t.includes("top")?e*-1:0,g=p.useCallback(({clientX:v,clientY:S})=>{u.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:v,y:S,left:v+h,top:S+m,right:v,bottom:S}}})},[c.reference]);return p.useEffect(()=>{if(u.floating.current){const v=i.current;v.addEventListener("mousemove",g);const S=Io(u.floating.current);return S.forEach(x=>{x.addEventListener("scroll",d)}),()=>{v.removeEventListener("mousemove",g),S.forEach(x=>{x.removeEventListener("scroll",d)})}}},[c.reference,u.floating.current,d,g,r]),{handleMouseMove:g,x:a,y:l,opened:r,setOpened:o,boundaryRef:i,floating:u.setFloating}}var Ah={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const gL={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Xr("popover")},vL=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:dt(t),"--tooltip-bg":n?ut(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),vx=Y((e,t)=>{const n=V("TooltipFloating",gL,e),{children:r,refProp:o,withinPortal:i,style:a,className:l,classNames:c,styles:u,unstyled:d,radius:f,color:h,label:m,offset:g,position:v,multiline:S,zIndex:x,disabled:w,defaultOpened:y,variant:b,vars:C,portalProps:j,...T}=n,E=At(),R=de({name:"TooltipFloating",props:n,classes:Ah,className:l,style:a,classNames:c,styles:u,unstyled:d,rootSelector:"tooltip",vars:C,varsResolver:vL}),{handleMouseMove:_,x:N,y:O,opened:F,boundaryRef:z,floating:H,setOpened:D}=mL({offset:g,position:v,defaultOpened:y});if(!qo(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 k=tn(z,r.ref,t),P=L=>{var $,Q;(Q=($=r.props).onMouseEnter)==null||Q.call($,L),_(L),D(!0)},I=L=>{var $,Q;(Q=($=r.props).onMouseLeave)==null||Q.call($,L),D(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(zs,{...j,withinPortal:i,children:s.jsx(q,{...T,...R("tooltip",{style:{...Ej(a,E),zIndex:x,display:!w&&F?"block":"none",top:(O&&Math.round(O))??"",left:(N&&Math.round(N))??""}}),variant:b,ref:H,mod:{multiline:S},children:m})}),p.cloneElement(r,{...r.props,[o]:k,onMouseEnter:P,onMouseLeave:I})]})});vx.classes=Ah;vx.displayName="@mantine/core/TooltipFloating";const MP=p.createContext(!1),yL=MP.Provider,xL=()=>p.useContext(MP),bL={openDelay:0,closeDelay:0};function yx(e){const{openDelay:t,closeDelay:n,children:r}=V("TooltipGroup",bL,e);return s.jsx(yL,{value:!0,children:s.jsx(x3,{delay:{open:t,close:n},children:r})})}yx.displayName="@mantine/core/TooltipGroup";yx.extend=e=>e;function wL(e){var j,T,E;const[t,n]=p.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,i=xL(),a=Un(),{delay:l,currentId:c,setCurrentId:u}=cT(),d=p.useCallback(R=>{n(R),R&&u(a)},[u,a]),{x:f,y:h,context:m,refs:g,update:v,placement:S,middlewareData:{arrow:{x,y:w}={}}}=xy({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:[oT(e.offset),my({padding:8}),bg(),iT({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[wg()]:[]]}),{getReferenceProps:y,getFloatingProps:b}=P3([y3(m,{enabled:(j=e.events)==null?void 0:j.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((T=e.events)!=null&&T.touch)}),T3(m,{enabled:(E=e.events)==null?void 0:E.focus,visibleOnly:!0}),R3(m,{role:"tooltip"}),C3(m,{enabled:typeof e.opened>"u"}),b3(m,{id:a})]);gT({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),Mo(()=>{var R;(R=e.onPositionChange)==null||R.call(e,S)},[S]);const C=o&&c&&c!==a;return{x:f,y:h,arrowX:x,arrowY:w,reference:g.setReference,floating:g.setFloating,getFloatingProps:b,getReferenceProps:y,isGroupPhase:C,opened:o,placement:S}}const Xb={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:[]},SL=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:dt(t),"--tooltip-bg":n?ut(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Vs=Y((e,t)=>{const n=V("Tooltip",Xb,e),{children:r,position:o,refProp:i,label:a,openDelay:l,closeDelay:c,onPositionChange:u,opened:d,defaultOpened:f,withinPortal:h,radius:m,color:g,classNames:v,styles:S,unstyled:x,style:w,className:y,withArrow:b,arrowSize:C,arrowOffset:j,arrowRadius:T,arrowPosition:E,offset:R,transitionProps:_,multiline:N,events:O,zIndex:F,disabled:z,positionDependencies:H,onClick:D,onMouseEnter:k,onMouseLeave:P,inline:I,variant:L,keepMounted:$,vars:Q,portalProps:ue,mod:Re,floatingStrategy:me,...ge}=V("Tooltip",Xb,n),{dir:De}=Ls(),le=p.useRef(null),Ae=wL({position:uT(De,o),closeDelay:c,openDelay:l,onPositionChange:u,opened:d,defaultOpened:f,events:O,arrowRef:le,arrowOffset:j,offset:typeof R=="number"?R+(b?C/2:0):R,positionDependencies:[...H,r],inline:I,strategy:me}),it=de({name:"Tooltip",props:n,classes:Ah,className:y,style:w,classNames:v,styles:S,unstyled:x,rootSelector:"tooltip",vars:Q,varsResolver:SL});if(!qo(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 Ue=tn(Ae.reference,r.ref,t),Je=pL(_,{duration:100,transition:"fade"});return s.jsxs(s.Fragment,{children:[s.jsx(zs,{...ue,withinPortal:h,children:s.jsx(Yo,{...Je,keepMounted:$,mounted:!z&&!!Ae.opened,duration:Ae.isGroupPhase?10:Je.duration,children:st=>s.jsxs(q,{...ge,"data-fixed":me==="fixed"||void 0,variant:L,mod:[{multiline:N},Re],...Ae.getFloatingProps({ref:Ae.floating,className:it("tooltip").className,style:{...it("tooltip").style,...st,zIndex:F,top:Ae.y??0,left:Ae.x??0}}),children:[a,s.jsx(by,{ref:le,arrowX:Ae.arrowX,arrowY:Ae.arrowY,visible:b,position:Ae.placement,arrowSize:C,arrowOffset:j,arrowRadius:T,arrowPosition:E,...it("arrow")})]})})}),p.cloneElement(r,Ae.getReferenceProps({onClick:D,onMouseEnter:k,onMouseLeave:P,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[i]:Ue,className:rt(y,r.props.className),...r.props}))]})});Vs.classes=Ah;Vs.displayName="@mantine/core/Tooltip";Vs.Floating=vx;Vs.Group=yx;function jL({size:e,thickness:t,sum:n,value:r,root:o,offset:i}){const a=(e*.9-t*2)/2,l=Math.PI*a*2/100,c=o||r===void 0?`${(100-n)*l}, ${n*l}`:`${r*l}, ${(100-r)*l}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:a||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:c,strokeDashoffset:o?0:i||0}}function OP({size:e,value:t,offset:n,sum:r,thickness:o,root:i,color:a,lineRoundCaps:l,tooltip:c,getStyles:u,display:d,...f}){const h=At();return s.jsx(Vs.Floating,{disabled:!c,label:c,children:s.jsx(q,{component:"circle",...f,...u("curve"),__vars:{"--curve-color":a?ut(a,h):void 0},fill:"none",strokeLinecap:l?"round":"butt",...jL({sum:r,size:e,thickness:o,value:t,offset:n,root:i})})})}OP.displayName="@mantine/core/Curve";function CL({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const i=n.reduce((d,f)=>d+f.value,0),a=Math.PI*((e*.9-t*2)/2)*2;let l=a;const c=[],u=[];for(let d=0;d<n.length;d+=1)c.push({sum:i,offset:l,data:n[d],root:!1}),l-=n[d].value/100*a;if(c.push({sum:i,offset:l,data:{color:o},root:!0}),u.push({...c[c.length-1],lineRoundCaps:!1}),c.length>2){u.push({...c[0],lineRoundCaps:r}),u.push({...c[c.length-2],lineRoundCaps:r});for(let d=1;d<=c.length-3;d+=1)u.push({...c[d],lineRoundCaps:!1})}else u.push({...c[0],lineRoundCaps:r});return u}var LP={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function EL(e,t){return Math.min(e||12,(t||120)/4)}const TL={size:120,thickness:12},PL=(e,{size:t,thickness:n})=>({root:{"--rp-size":B(t),"--rp-label-offset":B(n*2)}}),Nh=Y((e,t)=>{const n=V("RingProgress",TL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,label:u,sections:d,size:f,thickness:h,roundCaps:m,rootColor:g,...v}=n,S=de({name:"RingProgress",classes:LP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:PL}),x=EL(h,f),w=CL({size:f,thickness:x,sections:d,renderRoundedLineCaps:m,rootColor:g}).map(({data:y,sum:b,root:C,lineRoundCaps:j,offset:T},E)=>p.createElement(OP,{...y,key:E,size:f,thickness:x,sum:b,offset:T,color:y==null?void 0:y.color,root:C,lineRoundCaps:j,getStyles:S}));return s.jsxs(q,{...S("root"),size:f,ref:t,...v,children:[s.jsx("svg",{...S("svg"),children:w}),u&&s.jsx("div",{...S("label"),children:u})]})});Nh.classes=LP;Nh.displayName="@mantine/core/RingProgress";var $P={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const kL={withItemsBorders:!0},RL=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:dt(t),"--sc-color":n?ut(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":i,"--sc-padding":Ne(o,"sc-padding"),"--sc-font-size":hn(o)}}),xx=Y((e,t)=>{var ge,De;const n=V("SegmentedControl",kL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,data:u,value:d,defaultValue:f,onChange:h,size:m,name:g,disabled:v,readOnly:S,fullWidth:x,orientation:w,radius:y,color:b,transitionDuration:C,transitionTimingFunction:j,variant:T,autoContrast:E,withItemsBorders:R,mod:_,...N}=n,O=de({name:"SegmentedControl",props:n,classes:$P,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:RL}),F=At(),z=u.map(le=>typeof le=="string"?{label:le,value:le}:le),H=MD(),[D,k]=p.useState(null),[P,I]=p.useState({}),L=(le,Ae)=>{P[Ae]=le,I(P)},[$,Q]=bn({value:d,defaultValue:f,finalValue:Array.isArray(u)?((ge=z.find(le=>!le.disabled))==null?void 0:ge.value)??((De=u[0])==null?void 0:De.value)??null:null,onChange:h}),ue=Un(g),Re=z.map(le=>p.createElement(q,{...O("control"),mod:{active:$===le.value,orientation:w},key:le.value},p.createElement("input",{...O("input"),disabled:v||le.disabled,type:"radio",name:ue,value:le.value,id:`${ue}-${le.value}`,checked:$===le.value,onChange:()=>!S&&Q(le.value),"data-focus-ring":F.focusRing,key:`${le.value}-input`}),p.createElement(q,{component:"label",...O("label"),mod:{active:$===le.value&&!(v||le.disabled),disabled:v||le.disabled,"read-only":S},htmlFor:`${ue}-${le.value}`,ref:Ae=>L(Ae,le.value),__vars:{"--sc-label-color":b!==void 0?Go({color:b,theme:F,autoContrast:E}):void 0},key:`${le.value}-label`},s.jsx("span",{...O("innerLabel"),children:le.label})))),me=tn(t,le=>k(le));return u.length===0?null:s.jsxs(q,{...O("root"),variant:T,size:m,ref:me,mod:[{"full-width":x,orientation:w,initialized:H,"with-items-borders":R},_],...N,role:"radiogroup","data-disabled":v,children:[typeof $=="string"&&s.jsx(Ey,{target:P[$],parent:D,component:"span",transitionDuration:"var(--sc-transition-duration)",...O("indicator")}),Re]})});xx.classes=$P;xx.displayName="@mantine/core/SegmentedControl";function _L({spacing:e,verticalSpacing:t,cols:n,selector:r}){var d;const o=At(),i=t===void 0?e:t,a=Li({"--sg-spacing-x":Yt(Ur(e)),"--sg-spacing-y":Yt(Ur(i)),"--sg-cols":(d=Ur(n))==null?void 0:d.toString()}),l=bt(o.breakpoints).reduce((f,h)=>(f[h]||(f[h]={}),typeof e=="object"&&e[h]!==void 0&&(f[h]["--sg-spacing-x"]=Yt(e[h])),typeof i=="object"&&i[h]!==void 0&&(f[h]["--sg-spacing-y"]=Yt(i[h])),typeof n=="object"&&n[h]!==void 0&&(f[h]["--sg-cols"]=n[h]),f),{}),u=fc(bt(l),o.breakpoints).filter(f=>bt(l[f.value]).length>0).map(f=>({query:`(min-width: ${o.breakpoints[f.value]})`,styles:l[f.value]}));return s.jsx(Os,{styles:a,media:u,selector:r})}function Jp(e){return typeof e=="object"&&e!==null?bt(e):[]}function DL(e){return e.sort((t,n)=>dc(t)-dc(n))}function IL({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Jp(e),...Jp(t),...Jp(n)]));return DL(r)}function AL({spacing:e,verticalSpacing:t,cols:n,selector:r}){var u;const o=t===void 0?e:t,i=Li({"--sg-spacing-x":Yt(Ur(e)),"--sg-spacing-y":Yt(Ur(o)),"--sg-cols":(u=Ur(n))==null?void 0:u.toString()}),a=IL({spacing:e,verticalSpacing:t,cols:n}),l=a.reduce((d,f)=>(d[f]||(d[f]={}),typeof e=="object"&&e[f]!==void 0&&(d[f]["--sg-spacing-x"]=Yt(e[f])),typeof o=="object"&&o[f]!==void 0&&(d[f]["--sg-spacing-y"]=Yt(o[f])),typeof n=="object"&&n[f]!==void 0&&(d[f]["--sg-cols"]=n[f]),d),{}),c=a.map(d=>({query:`simple-grid (min-width: ${d})`,styles:l[d]}));return s.jsx(Os,{styles:i,container:c,selector:r})}var FP={container:"m_925c2d2c",root:"m_2415a157"};const NL={cols:1,spacing:"md",type:"media"},bx=Y((e,t)=>{const n=V("SimpleGrid",NL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,cols:u,verticalSpacing:d,spacing:f,type:h,...m}=n,g=de({name:"SimpleGrid",classes:FP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),v=Kc();return h==="container"?s.jsxs(s.Fragment,{children:[s.jsx(AL,{...n,selector:`.${v}`}),s.jsx("div",{...g("container"),children:s.jsx(q,{ref:t,...g("root",{className:v}),...m})})]}):s.jsxs(s.Fragment,{children:[s.jsx(_L,{...n,selector:`.${v}`}),s.jsx(q,{ref:t,...g("root",{className:v}),...m})]})});bx.classes=FP;bx.displayName="@mantine/core/SimpleGrid";const ML={},Mh=Y((e,t)=>{const{w:n,h:r,miw:o,mih:i,...a}=V("Space",ML,e);return s.jsx(q,{ref:t,...a,w:n,miw:o??n,h:r,mih:i??r})});Mh.displayName="@mantine/core/Space";var zP={root:"m_6d731127"};const OL={gap:"md",align:"stretch",justify:"flex-start"},LL=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Yt(t),"--stack-align":n,"--stack-justify":r}}),Le=Y((e,t)=>{const n=V("Stack",OL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,align:u,justify:d,gap:f,variant:h,...m}=n,g=de({name:"Stack",props:n,classes:zP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:LL});return s.jsx(q,{ref:t,...g("root"),variant:h,...m})});Le.classes=zP;Le.displayName="@mantine/core/Stack";const[$L,FL]=zn("Stepper component was not found in tree"),df=()=>null;df.displayName="@mantine/core/StepperCompleted";var wx={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 rd=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,zL={withIcon:!0,allowStepClick:!0,iconPosition:"left"},Sx=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,step:l,state:c,color:u,icon:d,completedIcon:f,progressIcon:h,label:m,description:g,withIcon:v,iconSize:S,loading:x,allowStepClick:w,allowStepSelect:y,iconPosition:b,orientation:C,mod:j,...T}=V("StepperStep",zL,e),E=FL(),R=At(),_={classNames:n,styles:i},N=c==="stepCompleted"?null:c==="stepProgress"?h:d,O={"data-progress":c==="stepProgress"||void 0,"data-completed":c==="stepCompleted"||void 0};return s.jsxs(Sn,{...E.getStyles("step",{className:r,style:o,variant:E.orientation,..._}),mod:[{"icon-position":b||E.iconPosition,"allow-click":w},j],ref:t,...O,...T,__vars:{"--step-color":u?ut(u,R):void 0},tabIndex:w?0:-1,children:[v&&s.jsxs("span",{...E.getStyles("stepWrapper",_),children:[s.jsxs("span",{...E.getStyles("stepIcon",_),...O,children:[s.jsx(Yo,{mounted:c==="stepCompleted",transition:"pop",duration:200,children:F=>s.jsx("span",{...E.getStyles("stepCompletedIcon",{style:F,..._}),children:x?s.jsx(tr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...E.getStyles("stepLoader",_)}):rd(f,l)||s.jsx(gh,{size:"60%"})})}),c!=="stepCompleted"?x?s.jsx(tr,{...E.getStyles("stepLoader",_),size:"calc(var(--stepper-icon-size) / 2)",color:u}):rd(N||d,l):null]}),C==="vertical"&&s.jsx("span",{...E.getStyles("verticalSeparator",_),"data-active":c==="stepCompleted"||void 0})]}),(m||g)&&s.jsxs("span",{...E.getStyles("stepBody",_),"data-orientation":E.orientation,"data-icon-position":b||E.iconPosition,children:[m&&s.jsx("span",{...E.getStyles("stepLabel",_),children:rd(m,l)}),g&&s.jsx("span",{...E.getStyles("stepDescription",_),children:rd(g,l)})]})]})});Sx.classes=wx;Sx.displayName="@mantine/core/StepperStep";const UL={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},BL=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:a})=>({root:{"--stepper-color":t?ut(t,e):void 0,"--stepper-icon-color":Ms(a,e)?Go({color:t,theme:e,autoContrast:a}):void 0,"--stepper-icon-size":n===void 0?Ne(r,"stepper-icon-size"):B(n),"--stepper-content-padding":Yt(o),"--stepper-radius":i===void 0?void 0:dt(i),"--stepper-fz":hn(r),"--stepper-spacing":Yt(r)}}),rl=Y((e,t)=>{var P,I,L;const n=V("Stepper",UL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,onStepClick:d,active:f,icon:h,completedIcon:m,progressIcon:g,color:v,iconSize:S,contentPadding:x,orientation:w,iconPosition:y,size:b,radius:C,allowNextStepsSelect:j,wrap:T,autoContrast:E,...R}=n,_=de({name:"Stepper",classes:wx,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:BL}),N=p.Children.toArray(u),O=N.filter($=>$.type!==df),F=N.find($=>$.type===df),z=O.reduce(($,Q,ue)=>{const Re=f===ue?"stepProgress":f>ue?"stepCompleted":"stepInactive",ge=typeof d!="function"?!1:typeof Q.props.allowStepSelect=="boolean"?Q.props.allowStepSelect:Re==="stepCompleted"||j;return $.push(p.cloneElement(Q,{icon:Q.props.icon||h||ue+1,key:ue,step:ue,state:Re,onClick:()=>ge&&(d==null?void 0:d(ue)),allowStepClick:ge,completedIcon:Q.props.completedIcon||m,progressIcon:Q.props.progressIcon||g,color:Q.props.color||v,iconSize:S,radius:C,iconPosition:Q.props.iconPosition||y,orientation:w,unstyled:l})),w==="horizontal"&&ue!==O.length-1&&$.push(p.createElement("div",{..._("separator"),"data-active":ue<f||void 0,"data-orientation":w,key:`separator-${ue}`})),$},[]),H=(I=(P=O[f])==null?void 0:P.props)==null?void 0:I.children,D=(L=F==null?void 0:F.props)==null?void 0:L.children,k=f>O.length-1?D:H;return s.jsx($L,{value:{getStyles:_,orientation:w,iconPosition:y},children:s.jsxs(q,{..._("root"),ref:t,size:b,...R,children:[s.jsx(q,{..._("steps"),mod:{orientation:w,"icon-position":y,wrap:T&&w!=="vertical"},children:z}),k&&s.jsx("div",{..._("content"),children:k})]})})});rl.classes=wx;rl.displayName="@mantine/core/Stepper";rl.Completed=df;rl.Step=Sx;const UP=p.createContext(null),VL=UP.Provider,HL=()=>p.useContext(UP),WL={},jx=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=V("SwitchGroup",WL,e),[d,f]=bn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=m.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return s.jsx(VL,{value:{value:d,onChange:h,size:i},children:s.jsx(Lt.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(By,{role:"group",children:l})})})});jx.classes=Lt.Wrapper.classes;jx.displayName="@mantine/core/SwitchGroup";var BP={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const qL={labelPosition:"right"},GL=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:dt(t),"--switch-height":Ne(r,"switch-height"),"--switch-width":Ne(r,"switch-width"),"--switch-thumb-size":Ne(r,"switch-thumb-size"),"--switch-label-font-size":Ne(r,"switch-label-font-size"),"--switch-track-label-padding":Ne(r,"switch-track-label-padding"),"--switch-color":n?ut(n,e):void 0}}),du=Y((e,t)=>{const n=V("Switch",qL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,label:d,offLabel:f,onLabel:h,id:m,size:g,radius:v,wrapperProps:S,thumbIcon:x,checked:w,defaultChecked:y,onChange:b,labelPosition:C,description:j,error:T,disabled:E,variant:R,rootRef:_,mod:N,...O}=n,F=HL(),z=g||(F==null?void 0:F.size),H=de({name:"Switch",props:n,classes:BP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:GL}),{styleProps:D,rest:k}=Qo(O),P=Un(m),I=F?{checked:F.value.includes(k.value),onChange:F.onChange}:{},[L,$]=bn({value:I.checked??w,defaultValue:y,finalValue:!1});return s.jsxs(mh,{...H("root"),__staticSelector:"Switch",__stylesApiProps:n,id:P,size:z,labelPosition:C,label:d,description:j,error:T,disabled:E,bodyElement:"label",labelElement:"span",classNames:r,styles:a,unstyled:l,"data-checked":I.checked||void 0,variant:R,ref:_,mod:N,...D,...S,children:[s.jsx("input",{...k,disabled:E,checked:L,onChange:Q=>{var ue;F?(ue=I.onChange)==null||ue.call(I,Q):b==null||b(Q),$(Q.currentTarget.checked)},id:P,ref:t,type:"checkbox",role:"switch",...H("input")}),s.jsxs(q,{"aria-hidden":"true",mod:{error:T,"label-position":C,"without-labels":!h&&!f},...H("track"),children:[s.jsx(q,{component:"span",mod:"reduce-motion",...H("thumb"),children:x}),s.jsx("span",{...H("trackLabel"),children:L?h:f})]})]})});du.classes={...BP,...qT};du.displayName="@mantine/core/Switch";du.Group=jx;const[QL,KL]=zn("Table component was not found in the tree");var fu={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 YL(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 Hs(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=Y((o,i)=>{const a=V(n,{},o),{classNames:l,className:c,style:u,styles:d,...f}=a,h=KL();return s.jsx(q,{component:e,ref:i,...YL(h,t),...h.getStyles(e,{className:c,classNames:l,style:u,styles:d,props:a}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=fu,r}const Tg=Hs("th",{columnBorder:!0}),VP=Hs("td",{columnBorder:!0}),kd=Hs("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),HP=Hs("thead",{stickyHeader:!0}),WP=Hs("tbody"),qP=Hs("tfoot"),GP=Hs("caption",{captionSide:!0});function Cx({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(GP,{children:e.caption}),e.head&&s.jsx(HP,{children:s.jsx(kd,{children:e.head.map((t,n)=>s.jsx(Tg,{children:t},n))})}),e.body&&s.jsx(WP,{children:e.body.map((t,n)=>s.jsx(kd,{children:t.map((r,o)=>s.jsx(VP,{children:r},o))},n))}),e.foot&&s.jsx(qP,{children:s.jsx(kd,{children:e.foot.map((t,n)=>s.jsx(Tg,{children:t},n))})})]})}Cx.displayName="@mantine/core/TableDataRenderer";const XL={type:"scrollarea"},JL=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":B(t),"--table-overflow":n==="native"?"auto":void 0}}),Ex=Y((e,t)=>{const n=V("TableScrollContainer",XL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,minWidth:d,type:f,...h}=n,m=de({name:"TableScrollContainer",classes:fu,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:JL,rootSelector:"scrollContainer"});return s.jsx(q,{component:f==="scrollarea"?Rr:"div",...f==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...m("scrollContainer"),...h,children:s.jsx("div",{...m("scrollContainerInner"),children:u})})});Ex.classes=fu;Ex.displayName="@mantine/core/TableScrollContainer";const ZL={withRowBorders:!0,verticalSpacing:7},e$=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:i,stripedColor:a,highlightOnHoverColor:l,striped:c,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Yt(r),"--table-vertical-spacing":Yt(o),"--table-border-color":i?ut(i,e):void 0,"--table-striped-color":c&&a?ut(a,e):void 0,"--table-highlight-on-hover-color":u&&l?ut(l,e):void 0,"--table-sticky-header-offset":f?B(d):void 0}}),fe=Y((e,t)=>{const n=V("Table",ZL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,horizontalSpacing:u,verticalSpacing:d,captionSide:f,stripedColor:h,highlightOnHoverColor:m,striped:g,highlightOnHover:v,withColumnBorders:S,withRowBorders:x,withTableBorder:w,borderColor:y,layout:b,variant:C,data:j,children:T,stickyHeader:E,stickyHeaderOffset:R,mod:_,...N}=n,O=de({name:"Table",props:n,className:o,style:i,classes:fu,classNames:r,styles:a,unstyled:l,rootSelector:"table",vars:c,varsResolver:e$});return s.jsx(QL,{value:{getStyles:O,stickyHeader:E,striped:g===!0?"odd":g||void 0,highlightOnHover:v,withColumnBorders:S,withRowBorders:x,captionSide:f||"bottom"},children:s.jsx(q,{component:"table",variant:C,ref:t,mod:[{"data-with-table-border":w},_],...O("table"),...N,children:T||!!j&&s.jsx(Cx,{data:j})})})});fe.classes=fu;fe.displayName="@mantine/core/Table";fe.Td=VP;fe.Th=Tg;fe.Tr=kd;fe.Thead=HP;fe.Tbody=WP;fe.Tfoot=qP;fe.Caption=GP;fe.ScrollContainer=Ex;fe.DataRenderer=Cx;const[t$,Tx]=zn("Tabs component was not found in the tree");var hu={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 n$={},Px=Y((e,t)=>{const n=V("TabsList",n$,e),{children:r,className:o,grow:i,justify:a,classNames:l,styles:c,style:u,mod:d,...f}=n,h=Tx();return s.jsx(q,{...f,...h.getStyles("list",{className:o,style:u,classNames:l,styles:c,props:n,variant:h.variant}),ref:t,role:"tablist",variant:h.variant,mod:[{grow:i,orientation:h.orientation,placement:h.orientation==="vertical"&&h.placement,inverted:h.inverted},d],"aria-orientation":h.orientation,__vars:{"--tabs-justify":a},children:r})});Px.classes=hu;Px.displayName="@mantine/core/TabsList";const r$={},kx=Y((e,t)=>{const n=V("TabsPanel",r$,e),{children:r,className:o,value:i,classNames:a,styles:l,style:c,mod:u,keepMounted:d,...f}=n,h=Tx(),m=h.value===i,g=h.keepMounted||d||m?r:null;return s.jsx(q,{...f,...h.getStyles("panel",{className:o,classNames:a,styles:l,style:[c,m?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:h.orientation},u],role:"tabpanel",id:h.getPanelId(i),"aria-labelledby":h.getTabId(i),children:g})});kx.classes=hu;kx.displayName="@mantine/core/TabsPanel";const o$={},Rx=Y((e,t)=>{const n=V("TabsTab",o$,e),{className:r,children:o,rightSection:i,leftSection:a,value:l,onClick:c,onKeyDown:u,disabled:d,color:f,style:h,classNames:m,styles:g,vars:v,mod:S,...x}=n,w=At(),{dir:y}=Ls(),b=Tx(),C=l===b.value,j=E=>{b.onChange(b.allowTabDeactivation&&l===b.value?null:l),c==null||c(E)},T={classNames:m,styles:g,props:n};return s.jsxs(Sn,{...x,...b.getStyles("tab",{className:r,style:h,variant:b.variant,...T}),disabled:d,unstyled:b.unstyled,variant:b.variant,mod:[{active:C,disabled:d,orientation:b.orientation,inverted:b.inverted,placement:b.orientation==="vertical"&&b.placement},S],ref:t,role:"tab",id:b.getTabId(l),"aria-selected":C,tabIndex:C||b.value===null?0:-1,"aria-controls":b.getPanelId(l),onClick:j,__vars:{"--tabs-color":f?ut(f,w):void 0},onKeyDown:cj({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:b.activateTabWithKeyboard,loop:b.loop,orientation:b.orientation||"horizontal",dir:y,onKeyDown:u}),children:[a&&s.jsx("span",{...b.getStyles("tabSection",T),"data-position":"left",children:a}),o&&s.jsx("span",{...b.getStyles("tabLabel",T),children:o}),i&&s.jsx("span",{...b.getStyles("tabSection",T),"data-position":"right",children:i})]})});Rx.classes=hu;Rx.displayName="@mantine/core/TabsTab";const Jb="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",i$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},s$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":dt(t),"--tabs-color":ut(n,e),"--tabs-text-color":Ms(r,e)?Go({color:n,theme:e,autoContrast:r}):void 0}}),et=Y((e,t)=>{const n=V("Tabs",i$,e),{defaultValue:r,value:o,onChange:i,orientation:a,children:l,loop:c,id:u,activateTabWithKeyboard:d,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:v,placement:S,keepMounted:x,classNames:w,styles:y,unstyled:b,className:C,style:j,vars:T,autoContrast:E,mod:R,..._}=n,N=Un(u),[O,F]=bn({value:o,defaultValue:r,finalValue:null,onChange:i}),z=de({name:"Tabs",props:n,classes:hu,className:C,style:j,classNames:w,styles:y,unstyled:b,vars:T,varsResolver:s$});return s.jsx(t$,{value:{placement:S,value:O,orientation:a,id:N,loop:c,activateTabWithKeyboard:d,getTabId:G0(`${N}-tab`,Jb),getPanelId:G0(`${N}-panel`,Jb),onChange:F,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:v,keepMounted:x,unstyled:b,getStyles:z},children:s.jsx(q,{ref:t,id:N,variant:h,mod:[{orientation:a,inverted:a==="horizontal"&&v,placement:a==="vertical"&&S},R],...z("root"),..._,children:l})})});et.classes=hu;et.displayName="@mantine/core/Tabs";et.Tab=Rx;et.Panel=kx;et.List=Px;const a$={},xe=Y((e,t)=>{const n=V("TextInput",a$,e);return s.jsx(rr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});xe.classes=rr.classes;xe.displayName="@mantine/core/TextInput";var QP={root:"m_7341320d"};const l$={},c$=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:a});return{root:{"--ti-size":Ne(t,"ti-size"),"--ti-radius":n===void 0?void 0:dt(n),"--ti-bg":i||r?l.background:void 0,"--ti-color":i||r?l.color:void 0,"--ti-bd":i||r?l.border:void 0}}},_x=Y((e,t)=>{const n=V("ThemeIcon",l$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,autoContrast:u,...d}=n,f=de({name:"ThemeIcon",classes:QP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:c$});return s.jsx(q,{ref:t,...f("root"),...d})});_x.classes=QP;_x.displayName="@mantine/core/ThemeIcon";const u$=["h1","h2","h3","h4","h5","h6"],d$=["xs","sm","md","lg","xl"];function f$(e,t){const n=t!==void 0?t:`h${e}`;return u$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:d$.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:B(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var KP={root:"m_8a5d1357"};const h$={order:1},p$=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=f$(t,n);return{root:{"--title-fw":i.fontWeight,"--title-lh":i.lineHeight,"--title-fz":i.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},ye=Y((e,t)=>{const n=V("Title",h$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,order:c,vars:u,size:d,variant:f,lineClamp:h,textWrap:m,mod:g,...v}=n,S=de({name:"Title",props:n,classes:KP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:p$});return[1,2,3,4,5,6].includes(c)?s.jsx(q,{...S("root"),component:`h${c}`,variant:f,ref:t,mod:[{order:c,"data-line-clamp":typeof h=="number"},g],size:d,...v}):null});ye.classes=KP;ye.displayName="@mantine/core/Title";function m$(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(i=>i(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function g$(e){return p.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function v$(e,t,n){const r=[],o=[],i={};for(const a of e){const l=a.position||t;i[l]=i[l]||0,i[l]+=1,i[l]<=n?o.push(a):r.push(a)}return{notifications:o,queue:r}}const y$=()=>m$({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Ws=y$(),x$=(e=Ws)=>g$(e);function xl(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=v$(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function pe(e,t=Ws){const n=e.id||lv();return xl(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function YP(e,t=Ws){return xl(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function Jl(e,t=Ws){return xl(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function b$(e=Ws){xl(e,()=>[])}function w$(e=Ws){xl(e,t=>t.slice(0,e.getState().limit))}const mo={show:pe,hide:YP,update:Jl,clean:b$,cleanQueue:w$,updateState:xl};function Pg(e,t){return Pg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Pg(e,t)}function XP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Pg(e,t)}var JP={exports:{}},S$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",j$=S$,C$=j$;function ZP(){}function ek(){}ek.resetWarningCache=ZP;var E$=function(){function e(r,o,i,a,l,c){if(c!==C$){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ek,resetWarningCache:ZP};return n.PropTypes=n,n};JP.exports=E$();var T$=JP.exports;const vt=ev(T$),Zb={disabled:!1},ff=fn.createContext(null);var P$=function(t){return t.scrollTop},Zl="unmounted",rs="exited",os="entering",ya="entered",kg="exiting",Zo=function(e){XP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o,l=a&&!a.isMounting?r.enter:r.appear,c;return i.appearStatus=null,r.in?l?(c=rs,i.appearStatus=os):c=ya:r.unmountOnExit||r.mountOnEnter?c=Zl:c=rs,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Zl?{status:rs}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==os&&a!==ya&&(i=os):(a===os||a===ya)&&(i=kg)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===os){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Da.findDOMNode(this);a&&P$(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===rs&&this.setState({status:Zl})},n.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[Da.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!o&&!a||Zb.disabled){this.safeSetState({status:ya},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:os},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:ya},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:Da.findDOMNode(this);if(!i||Zb.disabled){this.safeSetState({status:rs},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:kg},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:rs},function(){o.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:Da.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Zl)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=Jy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return fn.createElement(ff.Provider,{value:null},typeof a=="function"?a(o,l):fn.cloneElement(fn.Children.only(a),l))},t}(fn.Component);Zo.contextType=ff;Zo.propTypes={};function fa(){}Zo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fa,onEntering:fa,onEntered:fa,onExit:fa,onExiting:fa,onExited:fa};Zo.UNMOUNTED=Zl;Zo.EXITED=rs;Zo.ENTERING=os;Zo.ENTERED=ya;Zo.EXITING=kg;function k$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dx(e,t){var n=function(i){return t&&p.isValidElement(i)?t(i):i},r=Object.create(null);return e&&p.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function R$(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var a,l={};for(var c in t){if(r[c])for(a=0;a<r[c].length;a++){var u=r[c][a];l[r[c][a]]=n(u)}l[c]=n(c)}for(a=0;a<o.length;a++)l[o[a]]=n(o[a]);return l}function ps(e,t,n){return n[t]!=null?n[t]:e.props[t]}function _$(e,t){return Dx(e.children,function(n){return p.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ps(n,"appear",e),enter:ps(n,"enter",e),exit:ps(n,"exit",e)})})}function D$(e,t,n){var r=Dx(e.children),o=R$(t,r);return Object.keys(o).forEach(function(i){var a=o[i];if(p.isValidElement(a)){var l=i in t,c=i in r,u=t[i],d=p.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=p.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:ps(a,"exit",e),enter:ps(a,"enter",e)}):!c&&l&&!d?o[i]=p.cloneElement(a,{in:!1}):c&&l&&p.isValidElement(u)&&(o[i]=p.cloneElement(a,{onExited:n.bind(null,a),in:u.props.in,exit:ps(a,"exit",e),enter:ps(a,"enter",e)}))}}),o}var I$=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},A$={component:"div",childFactory:function(t){return t}},ui=function(e){XP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=i.handleExited.bind(k$(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}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,i){var a=i.children,l=i.handleExited,c=i.firstRender;return{children:c?_$(o,l):D$(o,a,l),firstRender:!1}},n.handleExited=function(o,i){var a=Dx(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=uf({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=Jy(o,["component","childFactory"]),c=this.state.contextValue,u=I$(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?fn.createElement(ff.Provider,{value:c},u):fn.createElement(ff.Provider,{value:c},fn.createElement(i,l,u))},t}(fn.Component);ui.propTypes={};ui.defaultProps=A$;const tk=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function N$(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),tk.reduce((n,r)=>(n[r]=[],n),{}))}const ew={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},M$={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function O$({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,i]=n.split("-"),a=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:ew[a],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"},c={opacity:1,transform:M$[a]},u={opacity:0,maxHeight:0,transform:ew[a]};return{...l,...{entering:c,entered:c,exiting:u,exited:u}[e]}}function L$(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const nk=p.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:a,...l}=e,c=L$(n,e.autoClose),u=p.useRef(),d=()=>window.clearTimeout(u.current),f=()=>{t(e.id),d()},h=()=>{typeof c=="number"&&(u.current=window.setTimeout(f,c))};return p.useEffect(()=>{var m;(m=e.onOpen)==null||m.call(e,e)},[]),p.useEffect(()=>(h(),d),[c]),s.jsx(ux,{...r,...l,onClose:f,ref:o,onMouseEnter:d,onMouseLeave:h,children:a})});nk.displayName="@mantine/notifications/NotificationContainer";var rk={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const $$=Zo,F$={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Xr("overlay"),store:Ws,withinPortal:!0},z$=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":B(n)}}),ei=Y((e,t)=>{const n=V("Notifications",F$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,position:u,autoClose:d,transitionDuration:f,containerWidth:h,notificationMaxHeight:m,limit:g,zIndex:v,store:S,portalProps:x,withinPortal:w,...y}=n,b=At(),C=x$(S),j=kD(),T=cv(),E=p.useRef({}),R=p.useRef(0),N=(b.respectReducedMotion?T:!1)?1:f,O=de({name:"Notifications",classes:rk,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:z$});p.useEffect(()=>{S==null||S.updateState(H=>({...H,limit:g||5,defaultPosition:u}))},[g,u]),Mo(()=>{C.notifications.length>R.current&&setTimeout(()=>j(),0),R.current=C.notifications.length},[C.notifications]);const F=N$(C.notifications,u),z=tk.reduce((H,D)=>(H[D]=F[D].map(({style:k,...P})=>s.jsx($$,{timeout:N,onEnter:()=>E.current[P.id].offsetHeight,nodeRef:{current:E.current[P.id]},children:I=>s.jsx(nk,{ref:L=>{E.current[P.id]=L},data:P,onHide:L=>YP(L,S),autoClose:d,...O("notification",{style:{...O$({state:I,position:D,transitionDuration:N,maxHeight:m}),...k}})})},P.id)),H),{});return s.jsxs(zs,{withinPortal:w,...x,children:[s.jsx(q,{...O("root"),"data-position":"top-center",ref:t,...y,children:s.jsx(ui,{children:z["top-center"]})}),s.jsx(q,{...O("root"),"data-position":"top-left",...y,children:s.jsx(ui,{children:z["top-left"]})}),s.jsx(q,{...O("root"),"data-position":"top-right",...y,children:s.jsx(ui,{children:z["top-right"]})}),s.jsx(q,{...O("root"),"data-position":"bottom-right",...y,children:s.jsx(ui,{children:z["bottom-right"]})}),s.jsx(q,{...O("root"),"data-position":"bottom-left",...y,children:s.jsx(ui,{children:z["bottom-left"]})}),s.jsx(q,{...O("root"),"data-position":"bottom-center",...y,children:s.jsx(ui,{children:z["bottom-center"]})})]})});ei.classes=rk;ei.displayName="@mantine/notifications/Notifications";ei.show=mo.show;ei.hide=mo.hide;ei.update=mo.update;ei.clean=mo.clean;ei.cleanQueue=mo.cleanQueue;ei.updateState=mo.updateState;class U${constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class pu{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class B${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,i){const a=o.consumeAndParse(n);return r(i,a)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,i,a){const l=o.consumeAndParse(n);return r(i,a,l)},precedence:n})}construct(t){return new V$(t,this.prefixParselets,this.infixParselets)}}class V${constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){const n=this.peek();return(n==null?void 0:n.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 i=this.consume();o=this.getInfixParselet(i).parse(this,o,i)}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){var r,o;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const i=this.peek();throw Error(`Expected ${t} but got "${i.id}" (${i.value}) at line ${i.line} column ${i.column}.`)}if(n&&((o=this.peek())==null?void 0:o.value)!==n){const i=this.peek();throw Error(`Expected "${n}" but got "${i.value}" at line ${i.line} column ${i.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]}}const H$="http://hl7.org",ok="ok",W$="created",q$="gone",G$="not-modified",Q$="not-found",K$="unauthorized",Y$="forbidden",X$="accepted",J$={resourceType:"OperationOutcome",id:ok,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Z$={resourceType:"OperationOutcome",id:Q$,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},Oc={resourceType:"OperationOutcome",id:K$,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},e7={...Oc,issue:[...Oc.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},tw={...Oc,issue:[...Oc.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},ik={resourceType:"OperationOutcome",id:Y$,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function go(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function _t(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function t7(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Oh(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function sk(e){return e.id===ok||e.id===W$||e.id===G$||e.id===X$}function n7(e){return e.id===q$}class Fe extends Error{constructor(t,n){super(ak(t)),this.outcome=t,this.cause=n}}function mt(e){return e instanceof Fe?e.outcome:Oh(e)?e:go(Ie(e))}function Ie(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Oh(e)?ak(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function ak(e){var n;const t=((n=e.issue)==null?void 0:n.map(lk))??[];return t.length>0?t.join("; "):"Unknown error"}function lk(e){var n,r;let t;return(n=e.details)!=null&&n.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(r=e.expression)!=null&&r.length&&(t+=` (${e.expression.join(", ")})`),t}function r7(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 o7(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,i])=>[o,r7(o,i)])),constraints:[],innerTypes:[]};return t}const i7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},s7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},a7={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"}]}}},l7={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"}]}}},c7={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"}]}}},u7={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"}]}}},d7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},f7={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"}]}}},h7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},p7={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"}]}}},m7={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"}]}}},g7={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"}]}}},v7={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"}]}}},y7={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"}]}}},x7={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"]}]}}},b7={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"}]}}},w7={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"}]}}},S7={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"}]}}},j7={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"}]}}},C7={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"}]}}},E7={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"]}]}}},T7={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"}]}}},P7={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"}]}}},k7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},R7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},_7={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"]}]}}},D7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},I7={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"}]}}},A7={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"}]}}},N7={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"}]}}},M7={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"}]}}},O7={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"]}]}}},L7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},$7={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"}]}}},F7={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"]}]}}},z7={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"}]}}},U7={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"}]}}},B7={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"}]}}},V7={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"}]}}},H7={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"}]}}},W7={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"]}]}}},q7={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"}]}}},G7={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"}]}}},Q7={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"}]}}},K7={Element:i7,BackboneElement:s7,Address:a7,Age:l7,Annotation:c7,Attachment:u7,CodeableConcept:d7,Coding:f7,ContactDetail:h7,ContactPoint:p7,Contributor:m7,Count:g7,DataRequirement:v7,Distance:y7,Dosage:x7,Duration:b7,ElementDefinition:w7,Expression:S7,Extension:j7,HumanName:C7,Identifier:E7,MarketingStatus:T7,Meta:P7,Money:k7,Narrative:R7,ParameterDefinition:_7,Period:D7,Population:I7,ProdCharacteristic:A7,ProductShelfLife:N7,Quantity:M7,Range:O7,Ratio:L7,Reference:$7,RelatedArtifact:F7,SampledData:z7,Signature:U7,SubstanceAmount:B7,Timing:V7,TriggerDefinition:H7,UsageContext:W7,MoneyQuantity:q7,SimpleQuantity:G7,IdentityProvider:Q7};function Y7(e){return new J7(e).parse()}const hf=o7(K7),Ix=Object.create(null),nw=Object.create(null),X7={"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 ck(e){let t;return t=nw[e],t||(t=nw[e]=Object.create(null)),t}function rw(e){var n;const t=Array.isArray(e)?e:((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];for(const r of t)uk(r)}function uk(e){var i,a;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=Y7(e),n=X7[e.url];let r,o;n?(r=hf,o=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(i=e.type)!=null&&i.startsWith("http://")||(a=e.type)!=null&&a.startsWith("https://")?(r=hf,o=e.type):(r=ck(e.url),o=e.type),r[o]=t;for(const l of t.innerTypes)l.parentType=t,r[l.name]=l;Ix[e.url]=t}function dk(e){return!!hf[e]}function Lh(e,t){if(t){const n=ck(t)[e];if(n)return n}return hf[e]}function fk(e,t){const n=Lh(e,t);if(!n)throw new Fe(go("Unknown data type: "+e));return n}function Ax(e){return!!Ix[e]}function bl(e){return Ix[e]}class J7{constructor(t){var n;if(!((n=t.snapshot)!=null&&n.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,kind:t.kind,description:t6(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,o,i,a;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((n=t.id)!=null&&n.includes(":")){if((r=this.slicingContext)!=null&&r.current){const l=Zp(t,this.slicingContext.path);this.slicingContext.current.elements[l]=this.parseElementDefinition(t)}}else{const l=this.parseElementDefinition(t);this.checkFieldEnter(t,l);let c=this.backboneContext;for(;c;){if((o=t.path)!=null&&o.startsWith(c.path+".")){c.type.elements[Zp(t,c.path)]=l;break}c=c.parent}if(!c){const u=Zp(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((a=this.resourceSchema.mandatoryProperties)==null||a.add(u.replace("[x]",""))),this.resourceSchema.elements[u]=l}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&&!ha(this.slicingContext.path,t==null?void 0:t.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var r,o,i;for(;this.backboneContext&&!ha((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=fw(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:ha((o=this.backboneContext)==null?void 0:o.path,t.path)?this.backboneContext:(i=this.backboneContext)==null?void 0:i.parent}}enterSlice(t,n){var r,o,i,a;e6(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((o=t.slicing)==null?void 0:o.discriminator)??[]).map(l=>{if(l.type!=="value"&&l.type!=="pattern"&&l.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${l.type}`);return{path:l.path,type:l.type}}),slices:[],ordered:((i=t.slicing)==null?void 0:i.ordered)??!1,rule:(a=t.slicing)==null?void 0:a.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!ha(this.backboneContext.path,t==null?void 0:t.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!ha(this.backboneContext.path,t==null?void 0: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(){var n,r,o,i,a;const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const l=t.contentReference.slice(t.contentReference.indexOf("#")+1),c=this.elementIndex[l];return c?{...c,id:t.id,path:t.path,min:t.min??c.min,max:t.max??c.max,base:{path:((n=c.base)==null?void 0:n.path)??l,min:((r=t.base)==null?void 0:r.min)??((o=c.base)==null?void 0:o.min)??c.min,max:((i=t.base)==null?void 0:i.max)??((a=c.base)==null?void 0:a.max)??c.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(ha(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(o=>["BackboneElement","Element"].includes(o.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=>{var o;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=fw(t)),r||(r=(o=wl(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:o.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var i,a;const n=ow(t.max),r=(i=t.base)!=null&&i.max?ow(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((a=t.base)==null?void 0:a.path)||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(l=>({key:l.key??"",severity:l.severity??"error",expression:l.expression??"",description:l.human??""})),type:this.parseElementDefinitionType(t),fixed:iw(xn(o,"fixed[x]")),pattern:iw(xn(o,"pattern[x]")),binding:t.binding}}}function ow(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Zp(e,t=""){return Z7(e.path,t)}function Z7(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function ha(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function iw(e){return Array.isArray(e)&&e.length>0?e[0]:qt(e)?void 0:e}function e6(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function t6(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function n6(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?r6:xn,[o,...i]=t.split(".");let a=[r(e,o,n)];for(const l of i){const c=[];for(const u of a)if(Array.isArray(u))for(const d of u)c.push(r(d,l,n));else(n!=null&&n.withPath&&u&&u.value!==void 0||!(n!=null&&n.withPath)&&u!==void 0)&&c.push(r(u,l,n));a=c}return a}function r6(e,t,n){const r=e.path;return o6(xn(e,t,n),r,t)}function o6(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,i)=>({...o,path:`${r}${n}[${i}]`})):{...e,path:`${r}${n}`}}const hk={base64Binary:/^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/,canonical:/^\S*$/,code:/^[^\s]+( [^\s]+)*$/,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)?)?)?$/,id:/^[A-Za-z0-9\-.]{1,64}$/,instant:/^(\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))$/,markdown:/^[\s\S]+$/,oid:/^urn:oid:[0-2](\.(0|[1-9]\d*))+$/,string:/^[\s\S]+$/,time:/^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/,uri:/^\S*$/,url:/^\S*$/,uuid:/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,xhtml:/.*/};function i6(e,t,n,r){var a;if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const i=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return Ox(e,o.pattern);if(o.fixed)return Ni(e,o.fixed);if(((a=o.binding)==null?void 0:a.strength)==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!(i!=null&&i.length)?!1:i.some(l=>l.code===e.type)}return!1}function Te(e){return[{type:W.boolean,value:e}]}function xo(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:W.integer,value:e}:typeof e=="number"?{type:W.decimal,value:e}:typeof e=="boolean"?{type:W.boolean,value:e}:typeof e=="string"?{type:W.string,value:e}:Sr(e)?{type:W.Quantity,value:e}:ti(e)?{type:e.resourceType,value:e}:{type:W.BackboneElement,value:e}}function _o(e){return e.length===0?!1:!!e[0].value}function Vo(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 xn(e,t,n){if(!e.value)return;const r=Gs(e.type,t,n==null?void 0:n.profileUrl);return r?pk(e,t,r):s6(e,t)}function pk(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let i,a="undefined",l;const c=n.path.lastIndexOf("."),u=n.path.substring(c+1);for(const d of o){const f=u.replace("[x]",en(d.code));if(i=r[f],l=r["_"+f],i!==void 0||l!==void 0){a=d.code;break}}if(l)if(Array.isArray(i)){i=i.slice();for(let d=0;d<Math.max(i.length,l.length);d++)i[d]=cw(i[d],l[d])}else i=cw(i,l);if(!qt(i))return(a==="Element"||a==="BackboneElement")&&(a=n.type[0].code),Array.isArray(i)?i.map(d=>sw(d,a)):sw(i,a)}function sw(e,t){return t==="Resource"&&ti(e)&&(t=e.resourceType),{type:t,value:e}}function s6(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n)r=n[t];else for(const o in W){const i=t+en(o);if(i in n){r=n[i];break}}if(!qt(r))return Array.isArray(r)?r.map(xo):xo(r)}function mk(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(_o(Nx(n,o))){r=!0;break}r||t.push(n)}return t}function a6(e){return Te(!_o(e))}function l6(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Te(!1):Te(e.every((n,r)=>_o(Nx(n,t[r]))))}function c6(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Te(!0):Te(e.some((n,r)=>!_o(Nx(n,t[r]))))}function Nx(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?Te(Math.abs(n-r)<1e-8):Sr(n)&&Sr(r)?Te(yk(n,r)):Te(typeof n=="object"&&typeof r=="object"?Mx(e,t):n===r)}function gk(e,t){return e.length===0&&t.length===0?Te(!0):e.length!==t.length?Te(!1):(e.sort(aw),t.sort(aw),Te(e.every((n,r)=>_o(u6(n,t[r])))))}function u6(e,t){const{type:n,value:r}=e,{type:o,value:i}=t,a=r==null?void 0:r.valueOf(),l=i==null?void 0:i.valueOf();return typeof a=="number"&&typeof l=="number"?Te(Math.abs(a-l)<.01):Sr(a)&&Sr(l)?Te(yk(a,l)):Te(n==="Coding"&&o==="Coding"?typeof a!="object"||typeof l!="object"?!1:a.code===l.code&&a.system===l.system:typeof a=="object"&&typeof l=="object"?Mx({...a,id:void 0},{...l,id:void 0}):typeof a=="string"&&typeof l=="string"?a.toLowerCase()===l.toLowerCase():a===l)}function aw(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function vk(e,t){const{value:n}=e;if(n==null)return!1;switch(t){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return d6(n);case"DateTime":return pf(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return f6(n);case"Quantity":return Sr(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function d6(e){return typeof e=="string"&&!!hk.date.exec(e)}function pf(e){return typeof e=="string"&&!!hk.dateTime.exec(e)}function f6(e){return!!(e&&typeof e=="object"&&("start"in e&&pf(e.start)||"end"in e&&pf(e.end)))}function Sr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function yk(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 Mx(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o],a=t[o];if(lw(i)&&lw(a)){if(!Mx(i,a))return!1}else if(i!==a)return!1}return!0}function lw(e){return e!==null&&typeof e=="object"}function cw(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return h6(e??{},t)}return e}function h6(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function Tt(e){const t=ct(e),n=Ho(e);return n===t?{reference:t}:{reference:t,display:n}}function ct(e){return Qs(e)?e.reference:`${e.resourceType}/${e.id}`}function ol(e){if(e)return Qs(e)?e.reference.split("/")[1]:e.id}function p6(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Ho(e){if(p6(e)){const t=m6(e);if(t)return t}if(e.resourceType==="Device"){const t=g6(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Mi(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]),T6(t))return Mi(t);if(P6(t))return t.text}return ct(e)}function m6(e){const t=e.name;if(t&&t.length>0)return mu(t[0])}function g6(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function v6(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=uw(n);if(r)return r}else return uw(t)}function uw(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function xk(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(),i=n.getUTCMonth(),a=n.getUTCDate(),l=r.getUTCFullYear(),c=r.getUTCMonth(),u=r.getUTCDate();let d=l-o;(c<i||c===i&&u<a)&&d--;let f=l*12+c-(o*12+i);u<a&&f--;const h=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:d,months:f,days:h}}function y6(e,t){const{years:n,months:r,days:o}=xk(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 wl(e,...t){var r;let n=e;for(let o=0;o<t.length&&n;o++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(i=>i.url===t[o]);return n}function fr(e,t){return JSON.stringify(e,x6,t?2:void 0)}function x6(e,t){return!b6(e)&&qt(t)?void 0:t}function b6(e){return!!/\d+$/.exec(e)}function qt(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Ft(e):!1}function Ft(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 Ni(e,t,n){return e===t||qt(e)&&qt(t)?!0:qt(e)||qt(t)?!1:Array.isArray(e)&&Array.isArray(t)?w6(e,t):Array.isArray(e)||Array.isArray(t)?!1:Pn(e)&&Pn(t)?S6(e,t,n):(Pn(e)||Pn(t),!1)}function w6(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ni(e[n],t[n]))return!1;return!0}function S6(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 i=e[o],a=t[o];if(!Ni(i,a,o))return!1}return!0}function Ox(e,t){return qt(e)?!0:qt(t)?!1:Array.isArray(e)&&Array.isArray(t)?j6(e,t):Array.isArray(e)||Array.isArray(t)?!1:Pn(e)&&Pn(t)?C6(e,t):Pn(e)||Pn(t)?!1:e===t}function j6(e,t){return t.every(n=>e.some(r=>Ox(r,n)))}function C6(e,t){return Object.entries(t).every(([n,r])=>n in e&&Ox(e[n],r))}function Kr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function bk(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function Pn(e){return e!==null&&typeof e=="object"}function E6(e){return Pn(e)&&"code"in e&&typeof e.code=="string"}function T6(e){return Pn(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(E6)}function P6(e){return Pn(e)&&"text"in e&&typeof e.text=="string"}const wk=[];for(let e=0;e<256;e++)wk.push(e.toString(16).padStart(2,"0"));function k6(e){const t=new Uint8Array(e),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=wk[t[r]];return n.join("")}function R6(e){const t=new Uint8Array(e),n=[];for(let r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return window.btoa(n.join(""))}function en(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function Lx(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function Lc(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function _6(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(o=>o.system===t))==null?void 0:r.code}function D6(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const dw=e=>new Promise(t=>{setTimeout(t,e)});function Rg(e,t,n){const r=[];for(let o=0;o<n-1;o++){const i=e.indexOf(t);if(i<0)break;r.push(e.slice(0,i)),e=e.slice(i+t.length)}return r.push(e),r}function I6(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Vl(e,t){return e?(e.push(t),e):[t]}function $c(e){return e.sort((t,n)=>t.localeCompare(n))}function Sk(e){return e.endsWith("/")?e:e+"/"}function A6(e){return e.startsWith("/")?e.slice(1):e}function so(e,t){return new URL(A6(t),Sk(e.toString())).toString()}function N6(e,t){return so(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function M6(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 jk(e,t){var n,r;return(r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function O6(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const o=e.meta.profile.indexOf(t);e.meta.profile.splice(o,1)}return e}function L6(e,t){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!=null&&t.use)&&n.push("["+e.use+"]"),n.join(", ").trim()}function mu(e,t){const n=[];if(e.prefix&&(t==null?void 0:t.prefix)!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&n.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&n.push("["+e.use+"]"),n.length===0){const r=zc(e.text);if(r)return r}return n.join(" ").trim()}function $h(e){return e instanceof Date&&!isNaN(e.getTime())}function $6(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return $h(r)?r.toLocaleTimeString(t,n):""}function $n(e,t,n){if(!e)return"";const r=new Date(e);return $h(r)?r.toLocaleString(t,n):""}function F6(e,t,n){return!e||!e.start&&!e.end?"":$n(e.start,t,n)+" - "+$n(e.end,t,n)}const z6={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},U6={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},B6={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function Ck(e){if(!e)return"";const t=[];return V6(t,e.repeat),e.event&&t.push(e.event.map(n=>$n(n)).join(", ")),en(t.join(" ").trim())}function V6(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(z6[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+U6[o]):e.push("per "+r+" "+B6[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(en).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>$6(i)).join(", "))}function Fc(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},o=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(o==null?void 0:o.value)===void 0?n&&t!==void 0?(r.value=q6(r.value,t),`> ${di(r)}`):`>= ${di(r)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=W6(o.value,t),`< ${di(o)}`):`<= ${di(o)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${di(r)} - ${di(o)}`)}function di(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 H6(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Mi(e){if(!e)return"";const t=zc(e.text);return t||(e.coding?e.coding.map(n=>qs(n)).join(", "):"")}function qs(e,t){const n=zc(e==null?void 0:e.display);return n?`${n}`:zc(e==null?void 0:e.code)??""}function Ek(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(di(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Mi(e.valueCodeableConcept));else{const n=zc(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>Ek(n)).join(" / ")),t.join(" / ").trim()}function zc(e){return typeof e=="string"?e:void 0}function W6(e,t,n=1){return(Tk(e)+n)*Math.pow(10,-t)}function q6(e,t,n=1){return(Tk(e)-n)*Math.pow(10,-t)}function Tk(e,t){return e}const W={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 G6(e){let t=bo.types[e];return t||(t={searchParamsDetails:{}},bo.types[e]=t),t.searchParams||(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 Q6(e){for(const t of e.base??[]){const n=G6(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function fw(e){var n,r,o,i;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?K6((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function K6(e){return e.length===1?e[0]:e.map(en).join("")}function $x(e){var t;return(t=bo.types[e])==null?void 0:t.searchParams}function Y6(e,t){var n,r;return(r=(n=bo.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function Rs(e){const t=e.replaceAll("[x]","").split(".").pop();return Pk(t)}function Pk(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(J6).join(" ").replace("_"," ").replace(/\s+/g," ")}const X6=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function J6(e){const t=e.toUpperCase();return e===t?e:X6.has(t)?t:t.charAt(0)+e.slice(1)}function Gs(e,t,n){const r=Lh(e,n);if(r)return Z6(r.elements,t)}function Z6(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 i=t.slice(0,r)+"[x]",a=e[i];if(a)return a}}}function ti(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function Qs(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const bo={types:{}};function Rd(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 jo=()=>[],Hn={empty:(e,t)=>Te(t.length===0||t.every(n=>qt(n.value))),hasValue:(e,t)=>Te(t.length!==0),exists:(e,t,n)=>Te(n?t.filter(r=>_o(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!qt(r.value))),all:(e,t,n)=>Te(t.every(r=>_o(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Te(!1);return Te(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Te(!0);return Te(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Te(!1);return Te(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Te(!0);return Te(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Te(!0);const r=n.eval(e,Ji(e));return r.length===0?Te(!1):Te(t.every(o=>r.some(i=>i.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Ji(e));return r.length===0?Te(!0):t.length===0?Te(!1):Te(r.every(o=>t.some(i=>i.value===o.value)))},count:(e,t)=>[{type:W.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)=>Te(t.length===Hn.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>_o(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:jo,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)=>{var o;const r=(o=n.eval(e,t)[0])==null?void 0:o.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)=>{var o;const r=(o=n.eval(e,t)[0])==null?void 0:o.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,Ji(e)),o=[];for(const i of t)!o.some(a=>a.value===i.value)&&r.some(a=>a.value===i.value)&&o.push(i);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ji(e)),o=[];for(const i of t)r.some(a=>a.value===i.value)||o.push(i);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ji(e));return mk([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ji(e));return[...t,...r]},htmlChecks:(e,t,n)=>[xo(!0)],iif:(e,t,n,r,o)=>{const i=n.eval(e,t);if(i.length>1||i.length===1&&typeof i[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return _o(i)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=lo(t,1);if(typeof n=="boolean")return[{type:W.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Te(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Te(!0);if(["false","f","no","n","0","0.0"].includes(r))return Te(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Te(Hn.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=lo(t,1);return typeof n=="number"?[{type:W.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:W.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:W.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Te(Hn.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=lo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:W.date,value:Rd(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Te(Hn.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=lo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:W.dateTime,value:Rd(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Te(Hn.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=lo(t,1);return typeof n=="number"?[{type:W.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:W.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:W.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Te(Hn.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=lo(t,1);return Sr(n)?[{type:W.Quantity,value:n}]:typeof n=="number"?[{type:W.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:W.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:W.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Te(Hn.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=lo(t,1);return n==null?[]:Sr(n)?[{type:W.string,value:`${n.value} '${n.unit}'`}]:[{type:W.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Te(Hn.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=lo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:W.time,value:Rd("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Te(Hn.toTime(e,t).length===1),indexOf:(e,t,n)=>mr((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>mr((o,i,a)=>{const l=i,c=a?l+a:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,n,r),startsWith:(e,t,n)=>mr((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>mr((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>mr((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>mr(n=>n.toUpperCase(),e,t),lower:(e,t)=>mr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>mr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),matches:(e,t,n)=>mr((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>mr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),length:(e,t)=>mr(n=>n.length,e,t),toChars:(e,t)=>mr(n=>n?n.split(""):void 0,e,t),encode:jo,decode:jo,escape:jo,unescape:jo,trim:jo,split:jo,join:(e,t,n)=>{var o;const r=((o=n==null?void 0:n.eval(e,Ji(e))[0])==null?void 0:o.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:W.string,value:t.map(i=>{var a;return((a=i.value)==null?void 0:a.toString())??""}).join(r)}]},abs:(e,t)=>oo(Math.abs,e,t),ceiling:(e,t)=>oo(Math.ceil,e,t),exp:(e,t)=>oo(Math.exp,e,t),floor:(e,t)=>oo(Math.floor,e,t),ln:(e,t)=>oo(Math.log,e,t),log:(e,t,n)=>oo((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>oo(Math.pow,e,t,n),round:(e,t)=>oo(Math.round,e,t),sqrt:(e,t)=>oo(Math.sqrt,e,t),truncate:(e,t)=>oo(n=>n|0,e,t),children:jo,descendants:jo,trace:(e,t,n)=>t,now:()=>[{type:W.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:W.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:W.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var u;const i=Hn.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const a=Hn.toDateTime(e,r.eval(e,t));if(a.length===0)throw new Error("Invalid end date");const l=(u=o.eval(e,t)[0])==null?void 0:u.value;if(l!=="years"&&l!=="months"&&l!=="days")throw new Error("Invalid units");const c=xk(i[0].value,a[0].value);return[{type:W.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,n)=>{let r="";return n instanceof mf?r=n.name:n instanceof zx&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:W.boolean,value:vk(o,r)})):[]},not:(e,t)=>Hn.toBoolean(e,t).map(n=>({type:W.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 i=r;if(i.resource)return xo(i.resource);i.reference?o=i.reference:i.type&&i.identifier&&(o=`${i.type}?identifier=${i.identifier.system}|${i.identifier.value}`)}if(o!=null&&o.includes("?")){const[i]=o.split("?");return{type:i,value:{resourceType:i}}}if(o!=null&&o.includes("/")){const[i,a]=o.split("/");return{type:i,value:{resourceType:i,id:a}}}return{type:W.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:W.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:W.BackboneElement,value:{namespace:"System",name:"Integer"}}:ti(n)?{type:W.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:W.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(i=>{var a;return{type:W.boolean,value:((a=i.value)==null?void 0:a.resourceType)===o}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:W.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let o="";return n instanceof mf&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:W.id,value:ol(r)}]},extension:(e,t,n)=>{var i;const r=n.eval(e,t)[0].value,o=(i=t==null?void 0:t[0])==null?void 0:i.value;if(o){const a=wl(o,r);if(a)return[{type:W.Extension,value:a}]}return[]}};function mr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=lo(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...r.map(a=>{var l;return(l=a==null?void 0:a.eval(t,n)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(xo):[xo(i)]}function oo(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=lo(n,1),i=Sr(o),a=i?o.value:o;if(typeof a!="number")throw new Error("Math function cannot be called with non-number");const l=e(a,...r.map(d=>{var f;return(f=d.eval(t,n)[0])==null?void 0:f.value})),c=i?W.Quantity:n[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function lo(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 Ji(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class eF{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 pa{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class mf{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==null?void 0: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 ti(n)&&n.resourceType===this.name?t:xn(t,this.name)}toString(){return this.name}}class tF{eval(){return[]}toString(){return"{}"}}class nF extends U${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 Fx extends pu{constructor(t,n){super("as",t,n)}eval(t,n){return Hn.ofType(t,this.left.eval(t,n),this.right)}}class or extends pu{}class Mr extends or{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 i=r[0].value,a=o[0].value,l=Sr(i)?i.value:i,c=Sr(a)?a.value:a,u=this.impl(l,c);return typeof u=="boolean"?Te(u):Sr(i)?[{type:W.Quantity,value:{...i,value:u}}]:[xo(u)]}}class rF extends pu{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),i=[...r,...o];return i.length>0&&i.every(a=>typeof a.value=="string")?[{type:W.string,value:i.map(a=>a.value).join("")}]:i}}class oF extends or{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Te(r.some(i=>i.value===o[0].value))}}class iF extends or{constructor(t,n){super("in",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Te(o.some(i=>i.value===r.value)):[]}}class zx extends pu{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 kk extends pu{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return mk([...r,...o])}}class sF extends or{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return l6(r,o)}}class aF extends or{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return c6(r,o)}}class lF extends or{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return gk(r,o)}}class cF extends or{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return a6(gk(r,o))}}class Ux extends or{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.name;return Te(vk(r[0],o))}}class uF extends or{constructor(t,n){super("and",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n),"boolean"),o=Vo(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(o==null?void 0:o.value)===!0?Te(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?Te(!1):[]}}class dF extends or{constructor(t,n){super("or",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n),"boolean"),o=Vo(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(o==null?void 0:o.value)===!1?Te(!1):r!=null&&r.value||o!=null&&o.value?Te(!0):[]}}class fF extends or{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n),"boolean"),o=Vo(this.right.eval(t,n),"boolean");return!r||!o?[]:Te(r.value!==o.value)}}class hF extends or{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n),"boolean"),o=Vo(this.right.eval(t,n),"boolean");return(o==null?void 0:o.value)===!0||(r==null?void 0:r.value)===!1?Te(!0):!r||!o?[]:Te(!1)}}class Bx{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Hn[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 Vx{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 i=this.left.eval(t,n);return o in i?[i[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const pF=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class mF{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!=null&&o.dateTimeLiterals),this.symbolRegex=(o==null?void 0: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==='"'?this.consumeString(t):t==="`"?this.consumeBacktickSymbol():t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():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()!==`
|
|
92
|
+
`))}consumeString(t){this.advance();const n=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t));return this.advance(),n}consumeBacktickSymbol(){this.advance();const t=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),t}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()===" "&&gF(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){var n;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((n=this.prevToken())==null?void 0:n.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
|
|
93
|
+
`?(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 gF(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&pF.includes(e.value)))}const vF=["true","false"],yF=["!=","!~","<=",">=","{}","->"];function xF(e){return new mF(e,vF,yF).tokenize()}const ht={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,IntegerDivide: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,Arrow:100,Semicolon:200},bF={parse(e){var n;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((n=e.peek())==null?void 0:n.value)+"`");return t}},wF={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new Vx(t,n)},precedence:ht.Indexer},SF={parse(e,t){if(!(t instanceof mf))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new Bx(t.name,n)},precedence:ht.FunctionCall};function jF(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r!=null&&r.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function CF(){return new B$().registerPrefix("String",{parse:(e,t)=>new pa({type:W.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new pa({type:W.dateTime,value:Rd(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new pa({type:W.Quantity,value:jF(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new pa({type:t.value.includes(".")?W.decimal:W.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new pa({type:W.boolean,value:!0})}).registerPrefix("false",{parse:()=>new pa({type:W.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new mf(t.value)}).registerPrefix("{}",{parse:()=>new tF}).registerPrefix("(",bF).registerInfix("[",wF).registerInfix("(",SF).prefix("+",ht.UnaryAdd,(e,t)=>new nF("+",t,n=>n)).prefix("-",ht.UnarySubtract,(e,t)=>new Mr("-",t,t,(n,r)=>-r)).infixLeft(".",ht.Dot,(e,t,n)=>new zx(e,n)).infixLeft("/",ht.Divide,(e,t,n)=>new Mr("/",e,n,(r,o)=>r/o)).infixLeft("*",ht.Multiply,(e,t,n)=>new Mr("*",e,n,(r,o)=>r*o)).infixLeft("+",ht.Add,(e,t,n)=>new Mr("+",e,n,(r,o)=>r+o)).infixLeft("-",ht.Subtract,(e,t,n)=>new Mr("-",e,n,(r,o)=>r-o)).infixLeft("|",ht.Union,(e,t,n)=>new kk(e,n)).infixLeft("=",ht.Equals,(e,t,n)=>new sF(e,n)).infixLeft("!=",ht.NotEquals,(e,t,n)=>new aF(e,n)).infixLeft("~",ht.Equivalent,(e,t,n)=>new lF(e,n)).infixLeft("!~",ht.NotEquivalent,(e,t,n)=>new cF(e,n)).infixLeft("<",ht.LessThan,(e,t,n)=>new Mr("<",e,n,(r,o)=>r<o)).infixLeft("<=",ht.LessThanOrEquals,(e,t,n)=>new Mr("<=",e,n,(r,o)=>r<=o)).infixLeft(">",ht.GreaterThan,(e,t,n)=>new Mr(">",e,n,(r,o)=>r>o)).infixLeft(">=",ht.GreaterThanOrEquals,(e,t,n)=>new Mr(">=",e,n,(r,o)=>r>=o)).infixLeft("&",ht.Ampersand,(e,t,n)=>new rF(e,n)).infixLeft("and",ht.And,(e,t,n)=>new uF(e,n)).infixLeft("as",ht.As,(e,t,n)=>new Fx(e,n)).infixLeft("contains",ht.Contains,(e,t,n)=>new oF(e,n)).infixLeft("div",ht.Divide,(e,t,n)=>new Mr("div",e,n,(r,o)=>r/o|0)).infixLeft("in",ht.In,(e,t,n)=>new iF(e,n)).infixLeft("is",ht.Is,(e,t,n)=>new Ux(e,n)).infixLeft("mod",ht.Modulo,(e,t,n)=>new Mr("mod",e,n,(r,o)=>r%o)).infixLeft("or",ht.Or,(e,t,n)=>new dF(e,n)).infixLeft("xor",ht.Xor,(e,t,n)=>new fF(e,n)).infixLeft("implies",ht.Implies,(e,t,n)=>new hF(e,n))}const EF=CF();function Rk(e){return new eF(e,EF.construct(xF(e)).consumeAndParse())}function Sl(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]=xo(n[r]))}return Uc(e,n).map(r=>r.value)}function Uc(e,t,n={}){return Rk(e).eval({variables:n},t).map(o=>{var i;return{type:o.type,value:(i=o.value)==null?void 0:i.valueOf()}})}var Po=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.QUANTITY="QUANTITY",e.TEXT="TEXT",e.REFERENCE="REFERENCE",e.CANONICAL="CANONICAL",e.DATE="DATE",e.DATETIME="DATETIME",e.PERIOD="PERIOD",e.UUID="UUID",e))(Po||{});function jl(e,t){var r,o;let n=(o=(r=bo.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=PF(e,t)),n}function TF(e,t,n){let r=bo.types[e];r||(r={},bo.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function PF(e,t){const n=t.code,r=_F(n),o=IF(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=uc(l),u=I6(()=>c.join("."));c.length===1&&c[0]instanceof or?i.propertyTypes.add("boolean"):u().endsWith("extension.value.code")||u().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):_k(i,uc(l),e,1),u().endsWith("extension.valueDateTime")&&(i.array=!1)}const a={columnName:r,type:DF(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return TF(e,n,a),a}function _k(e,t,n,r){const o=t[r];if(o instanceof Fx){e.propertyTypes.add(o.right.toString());return}if(o instanceof Bx){kF(e,o);return}const i=o.toString(),a=Gs(n,i);if(!a)throw new Error(`Element definition not found for ${n} ${i}`);let l=!1,c=r+1;if(c<t.length&&t[c]instanceof Vx&&(l=!0,c++),a.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(a);for(const u of a.type)e.propertyTypes.add(u.code);return}for(const u of a.type){let d=u.code;RF(d)&&(d=a.type[0].code),_k(e,t,d,c)}}function kF(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 Ux){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function RF(e){return e==="Element"||e==="BackboneElement"}function _F(e){return e.split("-").reduce((t,n,r)=>t+(r?en(n):n),"")}function DF(e,t){switch(e.type){case"date":return t.size===1&&t.has(W.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(W.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(W.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function IF(e,t){const n=[],r=Rk(t);return _g(e,r.child,n),n}function _g(e,t,n){t instanceof kk?(_g(e,t.left,n),_g(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function uc(e){if(e instanceof Fx||e instanceof Vx)return[uc(e.left),e].flat();if(e instanceof or)return[e];if(e instanceof zx)return[uc(e.left),uc(e.right)].flat();if(e instanceof Bx){if(e.name==="where"&&!(e.args[0]instanceof Ux))return[];if(e.name==="last")return[]}return[e]}const Fh=20;var oe=(e=>(e.EQUALS="eq",e.NOT_EQUALS="ne",e.GREATER_THAN="gt",e.LESS_THAN="lt",e.GREATER_THAN_OR_EQUALS="ge",e.LESS_THAN_OR_EQUALS="le",e.STARTS_AFTER="sa",e.ENDS_BEFORE="eb",e.APPROXIMATELY="ap",e.CONTAINS="contains",e.EXACT="exact",e.TEXT="text",e.NOT="not",e.ABOVE="above",e.BELOW="below",e.IN="in",e.NOT_IN="not-in",e.OF_TYPE="of-type",e.MISSING="missing",e.PRESENT="present",e.IDENTIFIER="identifier",e.ITERATE="iterate",e))(oe||{});const Dk={contains:"contains",exact:"exact",above:"above",below:"below",text:"text",not:"not",in:"in","not-in":"not-in","of-type":"of-type",missing:"missing",identifier:"identifier",iterate:"iterate"},Hx={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function Ik(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[a,l]=e.split("?");n=a,r=new URLSearchParams(l)}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 i=[];return r&&i.push(...r.entries()),AF(o,i)}function AF(e,t){const n={resourceType:e};for(const[r,o]of t)NF(n,r,o);return n}function NF(e,t,n){var a,l;let r,o;const i=t.indexOf(":");if(i>=0?(r=t.substring(0,i),o=t.substring(i+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Vl(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":MF(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=hw(n);o==="iterate"&&(c.modifier="iterate"),e.include=Vl(e.include,c);break}case"_revinclude":{const c=hw(n);o==="iterate"&&(c.modifier="iterate"),e.revInclude=Vl(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=(l=(a=bo.types[e.resourceType])==null?void 0:a.searchParams)==null?void 0:l[r];c?e.filters=Vl(e.filters,OF(c,o,n)):e.filters=Vl(e.filters,LF(r,o,n))}}}}function MF(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})}}function OF(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=$F(n);if(!pw(e,o))throw new Fe(go(`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(!pw(e,n))throw new Fe(go(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:FF(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function LF(e,t,n){var o;let r="eq";if(t)r=t;else if(n.length>=2){const i=n.substring(0,2);i in Hx&&(n.length===2||(o=n.at(2))!=null&&o.match(/\d/))&&(r=i,n=n.substring(i.length))}return{code:e,operator:r,value:n}}function $F(e){const t=e.substring(0,2),n=Hx[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function FF(e){return Dk[e]??"eq"}function hw(e){const t=e.split(":");if(t.includes("*"))throw new Fe(go("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new Fe(go(`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 Fe(go(`Invalid include value '${e}'`))}function pw(e,t){switch(e.type){case"date":return pf(t);default:return!0}}function Ia(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(zF(n))),e.sortRules&&e.sortRules.length>0&&t.push(UF(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.include&&e.include.forEach(n=>t.push(mw("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(mw("_revinclude",n))),t.length===0?"":($c(t),"?"+t.join("&"))}function zF(e){const t=e.operator in Dk?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in Hx?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function UF(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function mw(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Wx(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 BF(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!VF(e,t,n))return!1}return!0}function VF(e,t,n){var o,i;const r=(i=(o=bo.types[t.resourceType])==null?void 0:o.searchParams)==null?void 0:i[n.code];if(!r)return!1;if(n.operator===oe.MISSING||n.operator===oe.PRESENT)return HF(e,n,r);switch(r.type){case"reference":return WF(e,n,r);case"string":case"uri":return Ak(e,n,r);case"token":return qF(e,n,r);case"date":return YF(e,n,r);default:return!1}}function HF(e,t,n){const o=Sl(n.expression,e).length>0;return(t.operator===oe.MISSING&&t.value==="false"||t.operator===oe.PRESENT&&t.value==="true")===o}function WF(e,t,n){const r=Sl(n.expression,e),o=zh(t.operator);if(t.value===""&&r.length===0)return t.operator===oe.EQUALS;const i=r.map(a=>typeof a=="string"?a:a.reference);for(const a of Wx(t.value)){let l=i.includes(a);if(!l&&t.code==="_compartment"&&(l=i.some(c=>c==null?void 0:c.endsWith("/"+a))),l)return!o}return o}function qF(e,t,n){return jl(e.resourceType,n).type===Po.BOOLEAN?GF(e,t,n):Ak(e,t,n,!0)}function GF(e,t,n){const r=Sl(n.expression,e),o=t.value==="true",i=r.includes(o);return zh(t.operator)?!i:i}function Ak(e,t,n,r){var u,d,f,h;const i=(h=(f=(d=(u=jl(e.resourceType,n).elementDefinitions)==null?void 0:u[0])==null?void 0:d.type)==null?void 0:f[0])==null?void 0:h.code,a=Sl(n.expression,e),l=Wx(t.value),c=zh(t.operator);for(const m of a)for(const g of l){let v;if(i===W.Identifier?v=QF(m,t.operator,g):i===W.CodeableConcept?v=KF(m,t.operator,g):v=Dg(m,t.operator,g,r),v)return!c}return c}function Dg(e,t,n,r){if(r&&n.includes("|")){const[i,a]=n.split("|");return Dg(e,t,i,!1)&&(!a||Dg(e,t,a,!1))}let o="";return e&&(typeof e=="string"?o=e:typeof e=="object"&&(o=JSON.stringify(e))),o.toLowerCase().includes(n.toLowerCase())}function QF(e,t,n){var r,o,i,a;if(n.includes("|")){const[l,c]=n.split("|").map(u=>u.toLowerCase());return!l&&!c?!1:l?((o=e.system)==null?void 0:o.toLowerCase())===l&&(!c||((i=e.value)==null?void 0:i.toLowerCase())===c):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===c}return((a=e.value)==null?void 0:a.toLowerCase())===n.toLowerCase()}function KF(e,t,n){var r,o,i,a;if(n.includes("|")){const[l,c]=n.split("|").map(u=>u.toLowerCase());return!l&&!c?!1:l?((o=e.coding)==null?void 0:o.some(u=>{var d,f;return((d=u.system)==null?void 0:d.toLowerCase())===l&&(!c||((f=u.code)==null?void 0:f.toLowerCase())===c)}))??!1:((r=e.coding)==null?void 0:r.some(u=>{var d;return!u.system&&((d=u.code)==null?void 0:d.toLowerCase())===c}))??!1}return((i=e.text)==null?void 0:i.toLowerCase())===n.toLowerCase()||(((a=e.coding)==null?void 0:a.some(l=>{var c;return((c=l.code)==null?void 0:c.toLowerCase())===n.toLowerCase()}))??!1)}function YF(e,t,n){const r=Sl(n.expression,e),o=Wx(t.value),i=zh(t.operator);for(const a of r)for(const l of o)if(XF(a,t.operator,l))return!i;return i}function XF(e,t,n){switch(t){case oe.STARTS_AFTER:case oe.GREATER_THAN:return e>n;case oe.GREATER_THAN_OR_EQUALS:return e>=n;case oe.ENDS_BEFORE:case oe.LESS_THAN:return e<n;case oe.LESS_THAN_OR_EQUALS:return e<=n;case oe.EQUALS:case oe.NOT_EQUALS:return e===n;default:return!1}}function zh(e){return e===oe.NOT_EQUALS||e===oe.NOT}const JF={resourceType:"*"},ZF=["DomainConfiguration","JsonWebKey","Login"],e8=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"];var qx=(e=>(e.READ="read",e.VREAD="vread",e.UPDATE="update",e.PATCH="patch",e.DELETE="delete",e.HISTORY="history",e.HISTORY_INSTANCE="history-instance",e.HISTORY_TYPE="history-type",e.HISTORY_SYSTEM="history-system",e.CREATE="create",e.SEARCH="search",e.SEARCH_TYPE="search-type",e.SEARCH_SYSTEM="search-system",e.SEARCH_COMPARTMENT="search-compartment",e.CAPABILITIES="capabilities",e.TRANSACTION="transaction",e.BATCH="batch",e.OPERATION="operation",e))(qx||{});const t8=["read","vread","history","history-instance"];function n8(e,t){if(ZF.includes(t))return!1;if(e.resource){for(const n of e.resource)if(Mk(n.resourceType,t)&&!n.readonly)return!0}return!1}function Nk(e,t,n){if(!n)return JF;if(n.resource){for(const r of n.resource)if(r8(e,t,r))return r}}function r8(e,t,n){var o,i;const r=e.resourceType;return!(!Mk(n.resourceType,r)||n.readonly&&!t8.includes(t)||n.compartment&&!((i=(o=e.meta)==null?void 0:o.compartment)!=null&&i.find(a=>{var l;return a.reference===((l=n.compartment)==null?void 0:l.reference)}))||n.criteria&&!BF(e,Ik(n.criteria)))}function Mk(e,t){return e===t||e==="*"&&!e8.includes(t)}function o8(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 i8(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 gw(){const e=new Uint32Array(28);return crypto.getRandomValues(e),k6(e.buffer)}async function s8(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function Ok(){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 Lk(e){var o,i,a;const t={};e=Kr(e);for(const l of e.entry||[]){((o=l.resource)==null?void 0:o.meta)!==void 0&&(delete l.resource.meta.author,delete l.resource.meta.compartment,delete l.resource.meta.lastUpdated,delete l.resource.meta.project,delete l.resource.meta.versionId);const c=(i=l.resource)==null?void 0:i.id;c&&(t[c]=Ok(),l.fullUrl="urn:uuid:"+t[c],(a=l.resource)==null||delete a.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(l=>({fullUrl:l.fullUrl,request:{method:"POST",url:l.resource.resourceType},resource:l.resource}))},(l,c)=>a8(l,c,t),2);return l8(JSON.parse(r))}function a8(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 l8(e){const t=u8(e),{sorted:n,cycles:r}=c8(t),o={};for(const a of e.entry||[])a.fullUrl&&(o[a.fullUrl]=a);const i=n.map(a=>o[a]);for(const a of r)for(const l of a){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function c8(e){const t=[],n={},r=[];for(const i of Object.keys(e))n[i]=0;function o(i,a){if(n[i]===2)return!0;if(n[i]===1){const c=a.lastIndexOf(i);return c!==-1&&r.push(a.slice(c)),!0}n[i]=1,a.push(i);let l=!1;for(const c of e[i])o(c,a)||(l=!0);return n[i]=2,a.pop(),t.unshift(i),!l}for(const i in e)n[i]===0&&o(i,[]);return{sorted:t,cycles:r}}function $k(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Qs(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else $k(r,t)}}function u8(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&&$k(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class Fk{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 on={CSS:"text/css",DICOM:"application/dicom",FAVICON:"image/vnd.microsoft.icon",FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",HTML:"text/html",JAVASCRIPT:"text/javascript",JSON:"application/json",JSON_PATCH:"application/json-patch+json",PNG:"image/png",SCIM_JSON:"application/scim+json",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript",PING:"x-application/ping"};class d8{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 Uh{constructor(){this.emitter=new d8}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 Ig={"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"},f8=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],Gx=["DiagnosticReport-update"];function h8(e){return Gx.includes(e)}function p8(e){if(Gx.includes(e))throw new Fe(_t(`'context.version' is required for '${e}'.`))}const m8={"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"},select:{resourceType:"*",isArray:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport"},patient:{resourceType:"Patient",optional:!0},study:{resourceType:"ImagingStudy",optional:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function g8(e){return f8.includes(e)}function zk(e){return!!e.endpoint}function vw(e){if(!Qx(e))throw new Fe(_t("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,i={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return zk(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function Qx(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 i of o)if(!Ig[i])return!1;return!(zk(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function yw(e,t,n,r){if(typeof t!="object")throw new Fe(_t(`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 Fe(_t(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new Fe(_t(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!g8(t.resourceType))throw new Fe(_t(`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 Fe(_t(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function v8(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)yw(e,t.resource,n,r);else{const{resources:i}=t;if(!i)throw new Fe(_t(`context[${n}] is invalid. context[${n}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(const a of i)yw(e,a,n,r)}}function y8(e,t){const n=new Map,r=m8[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new Fe(_t(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));v8(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new Fe(_t(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)||0)>1)throw new Fe(_t(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function xw(e,t,n,r){if(!(e&&typeof e=="string"))throw new Fe(_t("Must provide a topic."));if(!Ig[t])throw new Fe(_t(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Ig).join(", ")}`));if(typeof n!="object")throw new Fe(_t("context must be a context object or array of context objects."));if(Gx.includes(t)&&!r)throw new Fe(_t(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return y8(t,o),{timestamp:new Date().toISOString(),id:Ok(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class x8 extends Uh{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new Fe(_t("Subscription request should contain an endpoint."));if(!Qx(t))throw new Fe(_t("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 i=o;i.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:i}),n.send(JSON.stringify({id:o==null?void 0:o.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function b8(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=o8(t),r=Array.from(n).reduce((i,a)=>{const l=("00"+a.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(r);return JSON.parse(o)}function w8(e){return e.split(".").length===3}function Kx(e){const[t,n,r]=e.split(".");return b8(n)}function S8(e){try{return typeof Kx(e).login_id=="string"}catch{return!1}}function j8(e){try{const n=Kx(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class C8{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,on.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var Uk;Uk=Symbol.toStringTag;class Or{constructor(t){this[Uk]="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 E8{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new T8)}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?fr(n):void 0)}}class T8{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]}}/*!
|
|
94
|
+
* Reconnecting WebSocket
|
|
95
|
+
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
96
|
+
* https://github.com/pladaria/reconnecting-websocket
|
|
97
|
+
* License MIT
|
|
98
|
+
*
|
|
99
|
+
* Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
|
|
100
|
+
* https://github.com/partykit/partykit/blob/main/packages/partysocket
|
|
101
|
+
*/const Va={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let bw=!1;function P8(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");Va.Event=globalThis.Event,Va.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},Va.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function k8(e,t){if(!e)throw new Error(t)}function od(e){return new e.constructor(e.type,e)}const Zi={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1};let ww=!1;class fi extends Uh{constructor(t,n,r={}){bw||(P8(),bw=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",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:i=Zi.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),i),k8(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(a=>{var l;return(l=this._ws)==null?void 0:l.send(a)}),this._messageQueue=[],this.onopen&&this.onopen(o),this.dispatchEvent(od(o))},this._handleMessage=o=>{this._debug("message event"),this.onmessage&&this.onmessage(o),this.dispatchEvent(od(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(od(o)),this._connect()},this._handleClose=o=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(o),this.dispatchEvent(od(o))},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),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 fi.CONNECTING}get OPEN(){return fi.OPEN}get CLOSING(){return fi.CLOSING}get CLOSED(){return fi.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(){var n;return this._messageQueue.reduce((r,o)=>(typeof o=="string"?r+=o.length:o instanceof Blob?r+=o.size:r+=o.byteLength,r),0)+(((n=this._ws)==null?void 0:n.bufferedAmount)??0)}get extensions(){var t;return((t=this._ws)==null?void 0:t.extensions)??""}get protocol(){var t;return((t=this._ws)==null?void 0:t.protocol)??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?fi.CLOSED:fi.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=Zi.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=Zi.reconnectionDelayGrowFactor,minReconnectionDelay:n=Zi.minReconnectionDelay,maxReconnectionDelay:r=Zi.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=Zi.maxRetries,connectionTimeout:n=Zi.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"&&!ww&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),ww=!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 Va.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Va.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new Va.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 R8=5e3;class Ag extends Uh{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 _8{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new Ag(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class D8{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof Bk))throw new Fe(_t("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new Fe(_t("Not a valid URL"))}const i=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new fi(o,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=i,this.masterSubEmitter=new Ag,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??R8,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,o,i,a,l,c;try{const u=JSON.parse(n.data);if(u.type==="pong"){this.waitingForPong=!1;return}const d=u,f=(o=(r=d==null?void 0:d.entry)==null?void 0:r[0])==null?void 0:o.resource;if(f.type==="heartbeat"){(i=this.masterSubEmitter)==null||i.dispatchEvent({type:"heartbeat",payload:d});return}if(f.type==="handshake"){const m=ol(f.subscription),g={type:"connect",payload:{subscriptionId:m}};(a=this.masterSubEmitter)==null||a.dispatchEvent(g);const v=this.criteriaEntriesBySubscriptionId.get(m);if(!v){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}v.connecting=!1,v.emitter.dispatchEvent({...g});return}(l=this.masterSubEmitter)==null||l.dispatchEvent({type:"message",payload:d});const h=this.criteriaEntriesBySubscriptionId.get(ol(f.subscription));if(!h){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}h.emitter.dispatchEvent({type:"message",payload:d})}catch(u){console.error(u);const d={type:"error",payload:u};(c=this.masterSubEmitter)==null||c.dispatchEvent(d);for(const f of this.getAllCriteriaEmitters())f.dispatchEvent({...d})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new Fe(t7(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,o;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const i of this.getAllCriteriaEmitters())i.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(o=this.masterSubEmitter)==null||o.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.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",()=>{var r;const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&((r=this.currentProfile)==null?void 0:r.id)!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){var o;const r={type:"error",payload:n};(o=this.masterSubEmitter)==null||o.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const o={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(o),t.emitter.dispatchEvent({...o})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var a,l;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${ct(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=(a=r==null?void 0:r.find(c=>c.name==="token"))==null?void 0:a.valueString,i=(l=r==null?void 0:r.find(c=>c.name==="websocket-url"))==null?void 0:l.valueUrl;if(!o)throw new Fe(_t("Failed to get token"));if(!i)throw new Fe(_t("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(Ni(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){var l;const{criteria:n,subscriptionProps:r,subscriptionId:o,token:i}=t;if(!this.criteriaEntries.has(n))return;const a=this.criteriaEntries.get(n);r?a.criteriaWithProps=a.criteriaWithProps.filter(c=>{const u=c.subscriptionProps;return!Ni(r,u)}):a.bareCriteria=void 0,!a.bareCriteria&&a.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(l=this.masterSubEmitter)==null||l._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),i&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:i}}))}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(Ie(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 _8(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 Ag(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const I8="3.2.18-8ca5b55b2",A8=on.FHIR_JSON+", */*; q=0.1",N8="https://api.medplum.com/",M8=1e3,O8=6e4,L8=0,$8=3e5,F8="Binary/",Sw={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class Bk extends Uh{constructor(t){if(super(),this.initComplete=!0,t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??z8(),this.storage=(t==null?void 0:t.storage)??new E8,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=Sk((t==null?void 0:t.baseUrl)??N8),this.fhirBaseUrl=so(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=so(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=so(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=so(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=so(this.baseUrl,(t==null?void 0:t.fhircastHubUrl)??"fhircast/STU3"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.refreshGracePeriod=(t==null?void 0:t.refreshGracePeriod)??$8,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?L8:O8),this.cacheTime>0?this.requestCache=new Fk((t==null?void 0:t.resourceCacheSize)??M8):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t!=null&&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!=null&&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}clear(){this.storage.clear(),typeof window<"u"&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.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){var n;t=t.toString(),(n=this.requestCache)==null||n.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const n=so(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?o=new Promise((a,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:a,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const i=new Or(o);return this.setCacheEntry(t,i),i}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,on.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,i=!0){let a=o;i&&(a=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,a,i))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");const r=new URLSearchParams;return r.set("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),r.set("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),r.set("client_id",n),r.set("subject_token",t),this.fetchTokens(r)}getExternalAuthRedirectUri(t,n,r,o,i=!0){const a=new URL(t);if(a.searchParams.set("response_type","code"),a.searchParams.set("client_id",n),a.searchParams.set("redirect_uri",r),a.searchParams.set("scope",o.scope??"openid profile email"),a.searchParams.set("state",JSON.stringify(o)),i){const{codeChallenge:l,codeChallengeMethod:c}=o;if(!c)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!l)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");a.searchParams.set("code_challenge_method",c),a.searchParams.set("code_challenge",l)}return a.toString()}fhirUrl(...t){return new URL(so(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=M6(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),i="search-"+o.toString(),a=this.getCacheEntry(i,r);if(a)return a.value;const l=new Or((async()=>{const c=await this.get(o,r);if(c.entry)for(const u of c.entry)this.cacheResource(u.resource);return c})());return this.setCacheEntry(i,l),l}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const i="searchOne-"+o.toString(),a=this.getCacheEntry(i,r);if(a)return a.value;const l=new Or(this.search(t,o.searchParams,r).then(c=>{var u,d;return(d=(u=c.entry)==null?void 0:u[0])==null?void 0:d.resource}));return this.setCacheEntry(i,l),l}searchResources(t,n,r){const i="searchResources-"+this.fhirSearchUrl(t,n).toString(),a=this.getCacheEntry(i,r);if(a)return a.value;const l=new Or(this.search(t,n,r).then(Ew));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,n,r){var i,a;let o=this.fhirSearchUrl(t,n);for(;o;){const l=new URL(o).searchParams,c=await this.search(t,l,r),u=(i=c.link)==null?void 0:i.find(d=>d.relation==="next");if(!((a=c.entry)!=null&&a.length)&&!u)break;yield Ew(c),o=u!=null&&u.url?new URL(u.url):void 0}}searchValueSet(t,n,r){return this.valueSetExpand({url:t,filter:n},r)}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){var o,i;const r=(i=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,n).toString()))==null?void 0:i.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return Sw;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 Or(Promise.reject(new Error("Missing reference")));if(r==="system")return new Or(Promise.resolve(Sw));const[o,i]=r.split("/");return!o||!i?new Or(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(dk(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Or((async()=>{const i=`{
|
|
102
|
+
StructureDefinitionList(name: "${t}") {
|
|
103
|
+
resourceType,
|
|
104
|
+
name,
|
|
105
|
+
kind,
|
|
106
|
+
description,
|
|
107
|
+
type,
|
|
108
|
+
url,
|
|
109
|
+
snapshot {
|
|
110
|
+
element {
|
|
111
|
+
id,
|
|
112
|
+
path,
|
|
113
|
+
definition,
|
|
114
|
+
min,
|
|
115
|
+
max,
|
|
116
|
+
base {
|
|
117
|
+
path,
|
|
118
|
+
min,
|
|
119
|
+
max
|
|
120
|
+
},
|
|
121
|
+
contentReference,
|
|
122
|
+
type {
|
|
123
|
+
code,
|
|
124
|
+
profile,
|
|
125
|
+
targetProfile
|
|
126
|
+
},
|
|
127
|
+
binding {
|
|
128
|
+
strength,
|
|
129
|
+
valueSet
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
SearchParameterList(base: "${t}", _count: 100) {
|
|
135
|
+
base,
|
|
136
|
+
code,
|
|
137
|
+
type,
|
|
138
|
+
expression,
|
|
139
|
+
target
|
|
140
|
+
}
|
|
141
|
+
}`.replace(/\s+/g," "),a=await this.graphql(i);rw(a.data.StructureDefinitionList);for(const l of a.data.SearchParameterList)Q6(l)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&Ax(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const i=new Or((async()=>{if(n!=null&&n.expandProfile){const a=this.fhirUrl("StructureDefinition","$expand-profile");a.search=new URLSearchParams({url:t}).toString();const l=await this.post(a.toString(),{});rw(l)}else{const a=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!a){console.warn(`No StructureDefinition found for ${t}!`);return}uk(a)}})());return this.setCacheEntry(r,i),i}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}readPatientEverything(t,n){return this.get(this.fhirUrl("Patient",t,"$everything"),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){return await this.searchOne(t.resourceType,n,r)??this.createResource(t,r)}async upsertResource(t,n,r){const o=this.fhirSearchUrl(t.resourceType,n);let i=await this.put(o,t,void 0,r);return i||(i=t),this.cacheResource(i),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),i}async createAttachment(t,n,r,o,i){const a=Tw(t,n,r,o),l=i??(typeof n=="object"?n:{}),c=await this.createBinary(a,l);return{contentType:a.contentType,url:c.url,title:a.filename}}createBinary(t,n,r,o,i){const a=Tw(t,n,r,o),l=i??(typeof n=="object"?n:{}),{data:c,contentType:u,filename:d,securityContext:f,onProgress:h}=a,m=this.fhirUrl("Binary");return d&&m.searchParams.set("_filename",d),f!=null&&f.reference&&this.setRequestHeader(l,"X-Security-Context",f.reference),h?this.uploadwithProgress(m,c,u,h,l):this.post(m,c,u,l)}uploadwithProgress(t,n,r,o,i){return new Promise((a,l)=>{var f;const c=new XMLHttpRequest,u=()=>c.abort();(f=i==null?void 0:i.signal)==null||f.addEventListener("abort",u);const d=h=>{var m;(m=i==null?void 0:i.signal)==null||m.removeEventListener("abort",u),h instanceof Error?l(h):a(h)};if(c.responseType="json",c.onabort=()=>d(new DOMException("Request aborted","AbortError")),c.onerror=()=>d(new Error("Request error")),o&&(c.upload.onprogress=h=>o(h),c.upload.onload=h=>o(h)),c.onload=()=>{c.status>=200&&c.status<300?d(c.response):d(new Fe(mt(c.response||c.statusText)))},c.open("POST",t),c.withCredentials=!0,c.setRequestHeader("Authorization","Bearer "+this.accessToken),c.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),c.setRequestHeader("Content-Type",r),c.setRequestHeader("X-Medplum","extended"),i!=null&&i.headers){const h=i.headers;for(const[m,g]of Object.entries(h))c.setRequestHeader(m,g)}c.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=V8(t,n,r,o),a=typeof n=="object"?n:{},{docDefinition:l,tableLayouts:c,fonts:u,...d}=i,f=await this.createPdfImpl(l,c,u),h={...d,data:f,contentType:"application/pdf"};return this.createBinary(h,a)}createComment(t,n,r){const o=this.getProfile();let i,a;return t.resourceType==="Encounter"&&(i=Tt(t),a=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,a=t.subject),t.resourceType==="Patient"&&(a=Tt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Tt(t)],encounter:i,subject:a,sender:o?Tt(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 i=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(i),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),i}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 i;if(typeof t=="string"){const a=t;i=this.fhirUrl("Bot",a,"$execute")}else{const a=t;i=this.fhirUrl("Bot","$execute"),i.searchParams.set("identifier",a.system+"|"+a.value)}return this.post(i,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,on.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},on.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,i,a){return this.post(this.fhirUrl("Agent",ol(t),"$push"),{destination:typeof n=="string"?n:ct(n),body:r,contentType:o,waitForResponse:i},on.FHIR_JSON,a)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||ct(this.sessionDetails.profile)!==((r=t.profile)==null?void 0:r.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}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=j8(t),this.medplumServer=S8(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var o,i;return((o=r.profile)==null?void 0:o.reference)!==((i=t.profile)==null?void 0:i.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=>{var i,a;this.profilePromise=void 0;const o=((a=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:a.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(){var t;return!this.isInitialized||!!this.profilePromise&&!((t=this.sessionDetails)!=null&&t.profile)}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(F8)&&(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,i=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=Tt(i));const a=await this.createAttachment(o,n);return this.updateResource({...i,status:"completed",content:a})}async uploadMedia(t,n,r,o,i){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},i)}async bulkExport(t="",n,r,o){const i=t&&`${t}/`,a=this.fhirUrl(`${i}$export`);return n&&a.searchParams.set("_type",n),r&&a.searchParams.set("_since",r),this.startAsyncRequest(a.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 C8(this)),this.keyValueClient}getCacheEntry(t,n){if(!this.requestCache||(n==null?void 0:n.cache)==="no-cache"||(n==null?void 0: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){var n,r;t!=null&&t.id&&!((r=(n=t.meta)==null?void 0:n.tag)!=null&&r.some(o=>o.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Or(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 i=await this.fetchWithRetry(n,r);if(i.status===401)return this.handleUnauthenticated(t,n,r);if(i.status===204||i.status===304)return;const a=i.headers.get("content-type"),l=a==null?void 0:a.includes("json");if(i.status===404&&!l)throw new Fe(Z$);const c=await this.parseBody(i,l);if(i.status===200&&r.followRedirectOnOk||i.status===201&&r.followRedirectOnCreated){const u=await Cw(i,c);if(u)return this.request("GET",u,{...r,body:void 0})}if(i.status===202&&r.pollStatusOnAccepted){const d=await Cw(i,c)??o.statusUrl;if(d)return this.pollStatus(d,r,o)}if(i.status>=400)throw new Fe(mt(c));return c}async parseBody(t,n){let r;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=so(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2,o=200;for(let i=0;i<=r;i++){try{this.options.verbose&&this.logRequest(t,n);const a=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(a),a.status<500||i===r)return a}catch(a){if(a.message==="Failed to fetch"&&i===0&&this.dispatchEvent({type:"offline"}),a.name==="AbortError"||i===r)throw a}await dw(o)}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of $c(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}`))}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 i=n.pollStatusPeriod??1e3;await dw(i),r.pollCount++}return this.request("GET",t,o,r)}async executeAutoBatch(){var o,i;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const a=t[0];try{a.resolve(await this.request(a.method,so(this.fhirBaseUrl,a.url),a.options))}catch(l){a.reject(new Fe(mt(l)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(a=>({request:{method:a.method,url:a.url},resource:a.options.body?JSON.parse(a.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let a=0;a<t.length;a++){const l=t[a],c=(o=r.entry)==null?void 0:o[a];(i=c==null?void 0:c.response)!=null&&i.outcome&&!sk(c.response.outcome)?l.reject(new Fe(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){this.setRequestHeader(t,"X-Medplum","extended"),this.setRequestHeader(t,"Accept",A8,!0),t.body&&this.setRequestHeader(t,"Content-Type",on.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 i=t.headers;o&&i[n]||(i[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||(n==null?void 0:n.constructor.name)==="Blob")||typeof File<"u"&&(n instanceof File||(n==null?void 0:n.constructor.name)==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||(n==null?void 0: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 Fe(Oc)))}async startPkce(){const t=gw();sessionStorage.setItem("pkceState",t);const n=gw().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await s8(n),o=R6(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",o),{codeChallengeMethod:"S256",codeChallenge:o}}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??jw()),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=new URLSearchParams;if(r.set("grant_type","authorization_code"),r.set("code",t),r.set("client_id",(n==null?void 0:n.clientId)??this.clientId),r.set("redirect_uri",(n==null?void 0:n.redirectUri)??jw()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&r.set("code_verifier",o)}return this.fetchTokens(r)}refreshIfExpired(t){return t===void 0&&(t=this.refreshGracePeriod),!this.refreshPromise&&this.accessTokenExpires!==void 0&&Date.now()>this.accessTokenExpires-t&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){const t=new URLSearchParams;return t.set("grant_type","refresh_token"),t.set("client_id",this.clientId),t.set("refresh_token",this.refreshToken),this.refreshPromise=this.fetchTokens(t),this.refreshPromise}if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){this.clientId=t,this.clientSecret=n;const r=new URLSearchParams;return r.set("grant_type","client_credentials"),r.set("client_id",t),r.set("client_secret",n),this.fetchTokens(r)}async startJwtBearerLogin(t,n,r){this.clientId=t;const o=new URLSearchParams;return o.set("grant_type","urn:ietf:params:oauth:grant-type:jwt-bearer"),o.set("client_id",t),o.set("assertion",n),o.set("scope",r),this.fetchTokens(o)}async startJwtAssertionLogin(t){const n=new URLSearchParams;return n.append("grant_type","client_credentials"),n.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),n.append("client_assertion",t),this.fetchTokens(n)}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=i8(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new Fe(_t("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new Fe(_t("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},i=(await this.post(this.fhircastHubUrl,vw(r),on.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!Qx(t))throw new Fe(_t("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new Fe(_t("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,vw(t),on.FORM_URL_ENCODED)}fhircastConnect(t){return new x8(t)}async fhircastPublish(t,n,r,o){return h8(n)?this.post(this.fhircastHubUrl,xw(t,n,r,o),on.JSON):(p8(n),this.post(this.fhircastHubUrl,xw(t,n,r),on.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`)}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n={method:"POST",headers:{"Content-Type":on.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},r=n.headers;this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`);let o;try{o=await this.fetchWithRetry(this.tokenUrl,n)}catch(a){throw this.refreshPromise=void 0,a}if(!o.ok){this.clearActiveLogin();try{const a=await o.json();throw new Fe(go(a.error_description))}catch(a){throw new Fe(go("Failed to fetch tokens"),a)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(w8(n)){const r=Kx(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new Fe(e7);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new Fe(tw)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new Fe(tw)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){var n,r;return this.sessionDetails&&t?((r=(n=t.profile)==null?void 0:n.reference)==null?void 0:r.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==null?void 0:n.profile.reference)!==(r==null?void 0: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 D8(this,N6(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 z8(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function jw(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function Cw(e,t){var o,i;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Oh(t)&&((i=(o=t.issue)==null?void 0:o[0])!=null&&i.diagnostics))return t.issue[0].diagnostics}function Ew(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function U8(e){return Pn(e)&&"data"in e&&"contentType"in e}function Tw(e,t,n,r){return U8(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function B8(e){return Pn(e)&&"docDefinition"in e}function V8(e,t,n,r){return B8(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function il({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:i}){if(t===(e==null?void 0:e.path))return;o??(o=(e==null?void 0:e.debugMode)??!1),i??(i=e==null?void 0:e.accessPolicyResource);let a=H8(t,n,e,!!o);const l=Rg(t,".",2)[1];a=W8(a,i,l),a=q8(a,i,l);const c=Object.create(null);for(const[d,f]of Object.entries(a))c[t+"."+d]=f;let u;if(e&&!e.isDefaultContext)u=e.getExtendedProps;else{const d=Object.create(null);u=f=>{const h=Rg(f,".",2)[1];if(h){if(!d[h]){const m=gf(h,i==null?void 0:i.hiddenFields);d[h]={hidden:m,readonly:m||gf(h,i==null?void 0:i.readonlyFields)}}return d[h]}}}return{path:t,elements:a,elementsByPath:c,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:o,getExtendedProps:u,accessPolicyResource:i}}function H8(e,t,n,r){const o=Object.create(null);if(n)for(const[a,l]of Object.entries(n.elementsByPath)){const c=Lc(e,a);c!==void 0&&(o[c]=l)}let i=!1;if(t)for(const[a,l]of Object.entries(t))a in o||(o[a]=l,i=!0);return r&&console.assert(i,"Unnecessary ElementsContext; not using any newly provided elements"),o}function W8(e,t,n){var o;if(!((o=t==null?void 0:t.hiddenFields)!=null&&o.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([i])=>!gf(r+i,t.hiddenFields)))}function q8(e,t,n){var i;if(!((i=t==null?void 0:t.readonlyFields)!=null&&i.length))return e;const r=Object.create(null),o=n?n+".":"";for(const[a,l]of Object.entries(e))gf(o+a,t.readonlyFields)?r[a]={...l,readonly:!0}:r[a]=l;return r}function gf(e,t){if(!(t!=null&&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 Vk(e){return e.type!==void 0&&e.type.length>0}function G8(e,t,n,r){var i;const o=n6(e,t.path,{profileUrl:r});if(o){const a=((i=n.typeSchema)==null?void 0:i.elements)??n.elements;return o.some(l=>i6(l,t,n,a))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function Hk(e,t,n,r){var o,i;if(e)for(const a of t){const l={value:e,type:((o=a.typeSchema)==null?void 0:o.type)??((i=a.type)==null?void 0:i[0].code)};if(n.every(c=>{var u;return G8(l,c,a,((u=a.typeSchema)==null?void 0:u.url)??r)}))return a.name}}class Q8{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=il({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(([i])=>i.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(!Ft(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=K8(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){var o,i;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const a of t.children)this.crawlElementNode(a,n);Ft((i=(o=t.element)==null?void 0:o.slicing)==null?void 0:i.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var i,a;const r=[];for(const l of t){if(!Vk(l))continue;const c=(a=(i=l.type.find(u=>Ft(u.profile)))==null?void 0:i.profile)==null?void 0:a[0];if(Ft(c)){const u=bl(c);u&&(l.typeSchema=u)}r.push(l)}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 i;const a=(o==null?void 0:o.elements)??t.elements;Ft(a)&&(i=il({path:n,parentContext:this.elementsContext,elements:a})),i&&this.elementsContextStack.push(i),this.crawlElementsImpl(a,n),i&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function K8(e){const t=[];function n(i,a){return a.startsWith(i+".")}function r(i,a){for(const l of i.children)if(n(l.key,a.key)){r(l,a);return}i.children.push(a)}const o=Object.entries(e);o.sort((i,a)=>i[0].localeCompare(a[0]));for(const[i,a]of o){const l={key:i,element:a,children:[]};let c=!1;for(const u of t)if(n(u.key,i)){r(u,l),c=!0;break}c||t.push(l)}return t}const em="__sliceName";function Y8(e,t){const n=new X8(e,e.resourceType,"resource");return new Q8(t,n).crawlResource(),n.getDefaultValue()}function Pw(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){vf(e,r,o,t);continue}const i=Lc(n,r);i!==void 0&&vf(e,i,o,t)}return e}class X8{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,i=this.value.path,a=Lc(i,t);if(a===void 0)throw new Error(`Expected ${t} to be prefixed by ${i}`);const l=[];for(const c of o){if(c===void 0)continue;const u=Array.isArray(c)?c:[c];for(const d of u){J8(d,a,n,r.elements),vf(d,a,n,r.elements);const f=Mg(d,a,n,r.elements);f!==void 0&&l.push(f)}}this.valueStack.push({type:"element",path:t,values:l})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const i=Lc(this.value.path,t);if(i===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);for(const a of this.value.values){const l=Mg(a,i,n,r.elements);if(Array.isArray(l))for(let c=l.length-1;c>=0;c--){const u=l[c];Ft(u)||l.splice(c,1)}qt(l)&&Ng(a,void 0,i,n)}}onEnterSlice(t,n,r){const o=this.value.values,i=[];for(const a of o){if(a===void 0)continue;if(!Array.isArray(a))throw new Error("Expected array value for sliced element");const l=this.getMatchingSliceValues(a,n,r);i.push(l)}this.valueStack.push({type:"slice",path:t,values:i})}getMatchingSliceValues(t,n,r){const o=[];for(const i of t)(i[em]??Hk(i,[n],r.discriminator,this.schema.url))===n.name&&o.push(i);for(let i=o.length;i<n.min;i++)if(Lx(n.type[0].code)){const a=Object.create(null);o.push(a),t.push(a)}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];em in o&&delete o[em]}}getDefaultValue(){return this.rootValue}}function J8(e,t,n,r){const o=Mg(e,t,n,r);n.min>0&&o===void 0&&Lx(n.type[0].code)&&(n.isArray?Ng(e,[Object.create(null)],t,n):Ng(e,Object.create(null),t,n))}function Ng(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const i=r.type[0].code;o=n.replace("[x]",en(i))}t===void 0?delete e[o]:e[o]=t}function Mg(e,t,n,r){const o=t.split(".");let i=e,a;for(let l=0;l<o.length;l++){let c=o[l];if(c.includes("[x]")){const d=r[o.slice(0,l+1).join(".")].type[0].code;c=c.replace("[x]",en(d))}if(l===o.length-1){Array.isArray(i)?a=i.map(u=>u[c]):a=i[c];continue}if(Array.isArray(i))i=i.map(u=>u[c]);else if(Pn(i)){if(i[c]===void 0)return;i=i[c]}else return}return a}function vf(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(l=>vf(l,t,n,r));e==null&&(e=Object.create(null));const o=e,i=t.split(".");let a=o;for(let l=0;l<i.length;l++){let c=i[l];if(c.includes("[x]")){const d=r[i.slice(0,l+1).join(".")].type[0].code;c=c.replace("[x]",en(d))}if(l===i.length-1){const u=Array.isArray(a)?a:[a];for(const d of u)n.fixed?d[c]??(d[c]=n.fixed.value):n.pattern&&(d[c]=Wk(d[c],n.pattern.value))}else{if(!(c in a)){const u=i.slice(0,l+1).join(".");a[c]=r[u].isArray?[Object.create(null)]:Object.create(null)}a=a[c]}}return o}function Wk(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Kr(t);if(Pn(t)&&(Pn(e)&&!Array.isArray(e)||e===void 0)){const n=Kr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=Wk(n[r],t[r]);return n}return e}const Z8="https://api.github.com/repos/medplum/medplum/releases",tm=new Map;function ez(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!(n!=null&&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 tz(e){let t=tm.get("latest");if(!t){const r=await fetch(`${Z8}/latest`);if(r.status!==200){let i;try{i=(await r.json()).message}catch(a){console.error(`Failed to parse message from body: ${Ie(a)}`)}throw new Error(`Received status code ${r.status} while fetching manifest for version 'latest'. Message: ${i}`)}const o=await r.json();ez(o),t=o,tm.set("latest",t),tm.set(t.tag_name.slice(1),t)}return t}async function nz(){const e=await tz();if(!e.tag_name.startsWith("v"))throw new Error(`Invalid release name found. Release tag '${e.tag_name}' did not start with 'v'`);return e.tag_name.slice(1)}const qk=p.createContext(void 0);function Bh(){return p.useContext(qk)}function ae(){return Bh().medplum}function Vh(){return Bh().navigate}function Hh(){return Bh().profile}const kw=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function rz(e){const t=e.medplum,n=e.navigate??oz,[r,o]=p.useState({profile:t.getProfile(),loading:t.isLoading()});p.useEffect(()=>{function a(){o(l=>({...l,profile:t.getProfile(),loading:t.isLoading()}))}for(const l of kw)t.addEventListener(l,a);return()=>{for(const l of kw)t.removeEventListener(l,a)}},[t]);const i=p.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(qk.Provider,{value:i,children:e.children})}function oz(e){window.location.assign(e)}const Rw=new Map,Gk=e=>p.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=Rw.get(t);if(o){const a=new URLSearchParams(new URL(o).search).get("Expires");if(a&&parseInt(a,10)*1e3-5e3>Date.now())return o}return Rw.set(t,e),e},[e]);function St(e,t){const n=ae(),[r,o]=p.useState(()=>_w(n,e)),i=p.useCallback(a=>{Ni(a,r)||o(a)},[r]);return p.useEffect(()=>{let a=!0;const l=_w(n,e);return!l&&Qs(e)?n.readReference(e).then(c=>{a&&i(c)}).catch(c=>{a&&(i(void 0),t&&t(mt(c)))}):i(l),()=>a=!1},[n,e,i,t]),r}function _w(e,t){if(t){if(ti(t))return t;if(Qs(t))return e.getCachedReference(t)}}function iz(e,t,n={leading:!1}){const[r,o]=p.useState(e),i=p.useRef(!1),a=p.useRef(),l=p.useRef(!1),c=p.useCallback(()=>window.clearTimeout(a.current),[]);return p.useEffect(()=>{i.current&&(!l.current&&n.leading?(l.current=!0,o(e)):(c(),a.current=setTimeout(()=>{l.current=!1,o(e)},t)))},[e,n.leading,t,c]),p.useEffect(()=>(i.current=!0,c),[c]),[r,c]}const sz=250;function az(e,t,n){return Qk("searchOne",e,t)}function sl(e,t,n){return Qk("searchResources",e,t)}function Qk(e,t,n,r){const o=ae(),[i,a]=p.useState(),[l,c]=p.useState(!0),[u,d]=p.useState(),[f,h]=p.useState(),m=o.fhirSearchUrl(t,n).toString(),[g]=iz(m,sz,{leading:!0});return p.useEffect(()=>{g!==i&&(a(g),o[e](t,n).then(v=>{c(!1),d(v),h(J$)}).catch(v=>{c(!1),d(void 0),h(mt(v))}))},[o,e,t,n,i,g]),[u,l,f]}function lz(e){const t=e.value;return t?s.jsx(s.Fragment,{children:L6(t)}):null}const Kk=["meta","implicitRules","contained","extension","modifierExtension"],Yk=["language","text"],wt=p.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});wt.displayName="ElementsContext";const Yx=["extension","modifierExtension"],cz=["id",...Kk].filter(e=>!Yx.includes(e));function uz(e){return Object.entries(e).filter(([n,r])=>{var o;return!Ft(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||Yx.includes(n)&&!Ft((o=r.slicing)==null?void 0:o.slices)||cz.includes(n)?!1:!(Yk.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function Dw(e,t){return e.line&&e.line.length>t?e.line[t]:""}function Iw(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function dz(e){const[t,n]=p.useState(e.defaultValue||{}),r=p.useRef();r.current=t;const{getExtendedProps:o}=p.useContext(wt),[i,a,l,c,u,d,f]=p.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(b=>o(e.path+"."+b)),[o,e.path]);function h(b){n(b),e.onChange&&e.onChange(b)}function m(b){h({...r.current,use:b})}function g(b){h({...r.current,type:b})}function v(b){h(Iw(r.current||{},0,b))}function S(b){h(Iw(r.current||{},1,b))}function x(b){h({...r.current,city:b})}function w(b){h({...r.current,state:b})}function y(b){h({...r.current,postalCode:b})}return s.jsxs(te,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(It,{disabled:e.disabled||(i==null?void 0:i.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:b=>m(b.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(It,{disabled:e.disabled||(a==null?void 0:a.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:b=>g(b.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(xe,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Line 1",defaultValue:Dw(t,0),onChange:b=>v(b.currentTarget.value)}),s.jsx(xe,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Line 2",defaultValue:Dw(t,1),onChange:b=>S(b.currentTarget.value)}),s.jsx(xe,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"City",defaultValue:t.city,onChange:b=>x(b.currentTarget.value)}),s.jsx(xe,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"State",defaultValue:t.state,onChange:b=>w(b.currentTarget.value)}),s.jsx(xe,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:b=>y(b.currentTarget.value)})]})}function fz(e){const t=Hh(),[n,r]=p.useState(e.defaultValue||{});function o(i){const a=i?{text:i,authorReference:t&&Tt(t),time:new Date().toISOString()}:{};r(a),e.onChange&&e.onChange(a)}return s.jsx(xe,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}/**
|
|
142
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the MIT license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/var hz={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"}};/**
|
|
147
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the MIT license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const Ce=(e,t,n,r)=>{const o=p.forwardRef(({color:i="currentColor",size:a=24,stroke:l=2,title:c,className:u,children:d,...f},h)=>p.createElement("svg",{ref:h,...hz[e],width:a,height:a,className:["tabler-icon",`tabler-icon-${t}`,u].join(" "),...e==="filled"?{fill:i}:{strokeWidth:l,stroke:i},...f},[c&&p.createElement("title",{key:"svg-title"},c),...r.map(([m,g])=>p.createElement(m,g)),...Array.isArray(d)?d:[d]]));return o.displayName=`${n}`,o};/**
|
|
152
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the MIT license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/var pz=Ce("outline","adjustments-horizontal","IconAdjustmentsHorizontal",[["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"}]]);/**
|
|
157
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the MIT license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/var Cl=Ce("outline","alert-circle","IconAlertCircle",[["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"}]]);/**
|
|
162
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the MIT license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/var mz=Ce("outline","arrow-down","IconArrowDown",[["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"}]]);/**
|
|
167
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the MIT license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/var gz=Ce("outline","arrow-up","IconArrowUp",[["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"}]]);/**
|
|
172
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the MIT license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/var vz=Ce("outline","bleach-off","IconBleachOff",[["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"}]]);/**
|
|
177
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the MIT license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/var yz=Ce("outline","bleach","IconBleach",[["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"}]]);/**
|
|
182
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the MIT license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/var xz=Ce("outline","box-multiple","IconBoxMultiple",[["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"}]]);/**
|
|
187
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the MIT license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/var bz=Ce("outline","brackets-contain","IconBracketsContain",[["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"}]]);/**
|
|
192
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the MIT license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/var wz=Ce("outline","brand-asana","IconBrandAsana",[["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"}]]);/**
|
|
197
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the MIT license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/var Sz=Ce("outline","bucket-off","IconBucketOff",[["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"}]]);/**
|
|
202
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the MIT license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/var jz=Ce("outline","bucket","IconBucket",[["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"}]]);/**
|
|
207
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the MIT license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/var Cz=Ce("outline","building","IconBuilding",[["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"}]]);/**
|
|
212
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the MIT license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/var es=Ce("outline","calendar","IconCalendar",[["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"}]]);/**
|
|
217
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the MIT license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/var Ks=Ce("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
222
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the MIT license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/var Ez=Ce("outline","checkbox","IconCheckbox",[["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"}]]);/**
|
|
227
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the MIT license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/var Xx=Ce("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
232
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the MIT license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/var yf=Ce("outline","circle-minus","IconCircleMinus",[["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"}]]);/**
|
|
237
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the MIT license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/var xf=Ce("outline","circle-plus","IconCirclePlus",[["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"}]]);/**
|
|
242
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the MIT license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/var Jx=Ce("outline","cloud-upload","IconCloudUpload",[["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"}]]);/**
|
|
247
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the MIT license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/var Tz=Ce("outline","columns","IconColumns",[["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"}]]);/**
|
|
252
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the MIT license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/var Xk=Ce("outline","copy","IconCopy",[["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"}]]);/**
|
|
257
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the MIT license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/var Pz=Ce("outline","currency-dollar","IconCurrencyDollar",[["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"}]]);/**
|
|
262
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the MIT license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/var kz=Ce("outline","device-floppy","IconDeviceFloppy",[["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"}]]);/**
|
|
267
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the MIT license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/var Rz=Ce("outline","dots","IconDots",[["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"}]]);/**
|
|
272
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the MIT license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/var Jk=Ce("outline","edit","IconEdit",[["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"}]]);/**
|
|
277
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the MIT license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/var gu=Ce("outline","equal-not","IconEqualNot",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]]);/**
|
|
282
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the MIT license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/var vu=Ce("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
287
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the MIT license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/var Aw=Ce("outline","file-alert","IconFileAlert",[["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"}]]);/**
|
|
292
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the MIT license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/var _z=Ce("outline","file-plus","IconFilePlus",[["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"}]]);/**
|
|
297
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the MIT license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/var Dz=Ce("outline","filter","IconFilter",[["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"}]]);/**
|
|
302
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the MIT license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/var Iz=Ce("outline","forms","IconForms",[["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"}]]);/**
|
|
307
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the MIT license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/var Az=Ce("outline","id","IconId",[["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"}]]);/**
|
|
312
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the MIT license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/var Nw=Ce("outline","list-details","IconListDetails",[["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"}]]);/**
|
|
317
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
318
|
+
*
|
|
319
|
+
* This source code is licensed under the MIT license.
|
|
320
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
+
*/var Nz=Ce("outline","lock-access","IconLockAccess",[["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"}]]);/**
|
|
322
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the MIT license.
|
|
325
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/var Mz=Ce("outline","lock","IconLock",[["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"}]]);/**
|
|
327
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
328
|
+
*
|
|
329
|
+
* This source code is licensed under the MIT license.
|
|
330
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
+
*/var Oz=Ce("outline","logout","IconLogout",[["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"}]]);/**
|
|
332
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
333
|
+
*
|
|
334
|
+
* This source code is licensed under the MIT license.
|
|
335
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
+
*/var Zk=Ce("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
337
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
338
|
+
*
|
|
339
|
+
* This source code is licensed under the MIT license.
|
|
340
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
+
*/var eR=Ce("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
342
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
343
|
+
*
|
|
344
|
+
* This source code is licensed under the MIT license.
|
|
345
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
+
*/var Lz=Ce("outline","message","IconMessage",[["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"}]]);/**
|
|
347
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the MIT license.
|
|
350
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
+
*/var $z=Ce("outline","microscope","IconMicroscope",[["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"}]]);/**
|
|
352
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the MIT license.
|
|
355
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
+
*/var Fz=Ce("outline","packages","IconPackages",[["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"}]]);/**
|
|
357
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
358
|
+
*
|
|
359
|
+
* This source code is licensed under the MIT license.
|
|
360
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
+
*/var zz=Ce("outline","pin","IconPin",[["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"}]]);/**
|
|
362
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
363
|
+
*
|
|
364
|
+
* This source code is licensed under the MIT license.
|
|
365
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
+
*/var Uz=Ce("outline","pinned-off","IconPinnedOff",[["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"}]]);/**
|
|
367
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the MIT license.
|
|
370
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/var Bz=Ce("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
372
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
373
|
+
*
|
|
374
|
+
* This source code is licensed under the MIT license.
|
|
375
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
+
*/var Vz=Ce("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
|
|
377
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
378
|
+
*
|
|
379
|
+
* This source code is licensed under the MIT license.
|
|
380
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
+
*/var Hz=Ce("outline","receipt","IconReceipt",[["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"}]]);/**
|
|
382
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
383
|
+
*
|
|
384
|
+
* This source code is licensed under the MIT license.
|
|
385
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
+
*/var Wz=Ce("outline","refresh","IconRefresh",[["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"}]]);/**
|
|
387
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
388
|
+
*
|
|
389
|
+
* This source code is licensed under the MIT license.
|
|
390
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
+
*/var qz=Ce("outline","repeat","IconRepeat",[["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"}]]);/**
|
|
392
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
393
|
+
*
|
|
394
|
+
* This source code is licensed under the MIT license.
|
|
395
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
+
*/var Gz=Ce("outline","report-medical","IconReportMedical",[["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"}]]);/**
|
|
397
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
398
|
+
*
|
|
399
|
+
* This source code is licensed under the MIT license.
|
|
400
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
+
*/var Qz=Ce("outline","router","IconRouter",[["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"}]]);/**
|
|
402
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
403
|
+
*
|
|
404
|
+
* This source code is licensed under the MIT license.
|
|
405
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
+
*/var Kz=Ce("outline","search","IconSearch",[["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"}]]);/**
|
|
407
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
408
|
+
*
|
|
409
|
+
* This source code is licensed under the MIT license.
|
|
410
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
+
*/var Og=Ce("outline","settings","IconSettings",[["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"}]]);/**
|
|
412
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
413
|
+
*
|
|
414
|
+
* This source code is licensed under the MIT license.
|
|
415
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
+
*/var Zx=Ce("outline","sort-ascending","IconSortAscending",[["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"}]]);/**
|
|
417
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
418
|
+
*
|
|
419
|
+
* This source code is licensed under the MIT license.
|
|
420
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
+
*/var e0=Ce("outline","sort-descending","IconSortDescending",[["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"}]]);/**
|
|
422
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
423
|
+
*
|
|
424
|
+
* This source code is licensed under the MIT license.
|
|
425
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
+
*/var Yz=Ce("outline","square","IconSquare",[["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"}]]);/**
|
|
427
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
428
|
+
*
|
|
429
|
+
* This source code is licensed under the MIT license.
|
|
430
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
+
*/var Xz=Ce("outline","star","IconStar",[["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"}]]);/**
|
|
432
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
433
|
+
*
|
|
434
|
+
* This source code is licensed under the MIT license.
|
|
435
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
+
*/var Jz=Ce("outline","switch-horizontal","IconSwitchHorizontal",[["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"}]]);/**
|
|
437
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
438
|
+
*
|
|
439
|
+
* This source code is licensed under the MIT license.
|
|
440
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
+
*/var Zz=Ce("outline","table-export","IconTableExport",[["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"}]]);/**
|
|
442
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
443
|
+
*
|
|
444
|
+
* This source code is licensed under the MIT license.
|
|
445
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
+
*/var eU=Ce("outline","text-recognition","IconTextRecognition",[["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"}]]);/**
|
|
447
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
448
|
+
*
|
|
449
|
+
* This source code is licensed under the MIT license.
|
|
450
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
+
*/var t0=Ce("outline","trash","IconTrash",[["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"}]]);/**
|
|
452
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
453
|
+
*
|
|
454
|
+
* This source code is licensed under the MIT license.
|
|
455
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
+
*/var Mw=Ce("outline","upload","IconUpload",[["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"}]]);/**
|
|
457
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
458
|
+
*
|
|
459
|
+
* This source code is licensed under the MIT license.
|
|
460
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
+
*/var tU=Ce("outline","webhook","IconWebhook",[["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"}]]);/**
|
|
462
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
463
|
+
*
|
|
464
|
+
* This source code is licensed under the MIT license.
|
|
465
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
+
*/var bf=Ce("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
|
|
467
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
468
|
+
*
|
|
469
|
+
* This source code is licensed under the MIT license.
|
|
470
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
+
*/var nU=Ce("filled","circle-filled","IconCircleFilled",[["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"}]]);class tR extends p.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?s.jsx(Bi,{icon:s.jsx(Cl,{size:16}),title:"Something went wrong",color:"red",children:Ie(this.state.error)}):this.props.children}}function Pr(){return s.jsx(vn,{style:{width:"100%",height:"100vh"},children:s.jsx(tr,{})})}const rU="_main_g2hyx_1",oU={main:rU};function xt(e){e.preventDefault(),e.stopPropagation()}function nR(e){if(Ow(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&Ow(t[0]))return!0}return!1}function Ow(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function qe(e){const t=Vh(),{to:n,suffix:r,label:o,onClick:i,children:a,...l}=e;let c=iU(n);return r&&(c+="/"+r),s.jsx(Xe,{href:c,"aria-label":o,onClick:u=>{xt(u),i?i(u):n&&t(c)},...l,children:a})}function iU(e){if(e){if(typeof e=="string")return sU(e);if(ti(e))return aU(e);if(Qs(e))return lU(e)}return"#"}function sU(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function aU(e){return`/${e.resourceType}/${e.id}`}function lU(e){return`/${e.reference}`}function cU(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 Hi(e){const t=St(e.value),n=t?Ho(t):e.alt??"",r=cU(n),o=(t&&v6(t))??e.src,i=Gk(o??void 0),a=e.radius??"xl",l={...e,value:void 0,link:void 0};return e.link?s.jsx(qe,{to:t,children:s.jsx(Ts,{src:i,alt:n,radius:a,...l,children:r})}):s.jsx(Ts,{src:i,alt:n,radius:a,...l,children:r})}const uU="_logoButton_189g3_1",dU="_user_189g3_11",fU="_userName_189g3_21",hU="_userActive_189g3_31",id={logoButton:uU,user:dU,userName:fU,userActive:hU};function n0(e){const t=e.value;return t?s.jsx(s.Fragment,{children:mu(t,e.options)}):null}function pU(e){var c,u,d;const t=Bh(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),{colorScheme:a,setColorScheme:l}=TI();return s.jsxs(s.Fragment,{children:[s.jsxs(Le,{align:"center",p:"xl",children:[s.jsx(Hi,{size:"xl",radius:100,value:t.profile}),s.jsx(n0,{value:(u=(c=t.profile)==null?void 0:c.name)==null?void 0:u[0]}),s.jsx(he,{c:"dimmed",size:"xs",children:(d=n.getActiveLogin())==null?void 0:d.project.display})]}),i.length>1&&s.jsx(Z.Divider,{}),i.map(f=>f.profile.reference!==ct(t.profile)&&s.jsx(Z.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(te,{children:[s.jsx(Ts,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(he,{size:"sm",fw:500,children:f.profile.display}),s.jsx(he,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),s.jsx(Z.Divider,{}),s.jsx(te,{justify:"center",children:s.jsx(xx,{size:"xs",value:a,onChange:f=>l(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(Jz,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(Z.Item,{leftSection:s.jsx(Og,{size:14,stroke:1.5}),onClick:()=>o(`/${ct(r)}`),children:"Account settings"}),s.jsx(Z.Item,{leftSection:s.jsx(Oz,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),s.jsx(he,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const Lw={selectedItems:"selected-items",options:"options"};function r0(e){const t=iu({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:i,defaultValue:a,toOption:l,loadOptions:c,itemComponent:u,pillComponent:d,emptyComponent:f,onChange:h,onCreate:m,creatable:g,clearable:v,required:S,placeholder:x,leftSection:w,maxValues:y,optionsDropdownMaxHeight:b=320,minInputLength:C=0,...j}=e,T=j.disabled,E=mU(a),[R,_]=p.useState(""),[N,O]=p.useState(),[F,z]=p.useState(),[H,D]=p.useState(),[k,P]=p.useState(E.map(l)),[I,L]=p.useState([]),$=u??gU,Q=d??vU,ue=f??yU,Re=p.useRef();Re.current=R;const me=p.useRef(),ge=p.useRef(),De=p.useRef();De.current=N;const le=p.useRef();le.current=F;const Ae=p.useRef();Ae.current=H;const it=p.useRef();it.current=I;const Ue=p.useCallback(()=>{var ce;if(O(void 0),Re.current===ge.current&&c===me.current||(((ce=Re.current)==null?void 0:ce.length)??0)<C)return;ge.current=Re.current,me.current=c;const X=new AbortController;z(X),c(Re.current??"",X.signal).then(ke=>{X.signal.aborted||(L(ke.map(l)),Ae.current?(ke.length>0&&h(ke.slice(0,1)),D(!1)):ke.length>0&&t.openDropdown())}).catch(ke=>{X.signal.aborted||ke.message.includes("aborted")||pe({color:"red",message:Ie(ke)})}).finally(()=>{X.signal.aborted||z(void 0)})},[t,c,h,l,C]),Je=p.useCallback(X=>{(I&&I.length>0||g)&&t.openDropdown(),t.updateSelectedOptionIndex(),_(X.currentTarget.value),le.current&&(le.current.abort(),z(void 0)),De.current!==void 0&&window.clearTimeout(De.current);const ce=window.setTimeout(()=>Ue(),100);O(ce)},[t,I,g,Ue]),st=p.useCallback(X=>{const ce=k.some(se=>se.value===X),ke=ce?k.filter(se=>se.value!==X):[...k];let J=I==null?void 0:I.find(se=>se.value===X);if(!J&&g!==!1&&m){const se=m(X);J=l(se)}if(J){if(y===0){h([J.resource]),k.length>0&&P([]);return}ce||ke.push(J)}if(y!==void 0)for(;ke.length>y;)ke.shift();h(ke.map(se=>se.resource)),P(ke)},[g,I,k,y,h,m,l]),Be=p.useMemo(()=>{if(!T)return X=>{T||(y===1&&(_(""),L([]),t.closeDropdown()),ge.current=void 0,st(X==="$create"?R:X))}},[st,t,T,y,R]),Ze=p.useCallback(X=>{const ce=k.filter(ke=>ke.value!==X.value);h(ce.map(ke=>ke.resource)),P(ce)},[k,h]),at=p.useCallback(X=>{X.key==="Enter"?(N||F)&&D(!0):X.key==="Backspace"&&R.length===0&&(xt(X),Ze(k[k.length-1]))},[F,Ze,R.length,k,N]);p.useEffect(()=>()=>{le.current&&le.current.abort()},[]);const ne=!T&&v&&k.length>0&&s.jsx(Oe.ClearButton,{title:"Clear all",size:16,onClear:()=>{_(""),P([]),h([]),t.closeDropdown()}});return s.jsxs(Oe,{store:t,onOptionSubmit:Be,withinPortal:!0,shadow:"xl",...j,children:[s.jsx(Oe.DropdownTarget,{children:s.jsx(nl,{label:r,description:o,error:i,className:e.className,leftSection:w,rightSection:F?s.jsx(tr,{size:16}):ne,required:S,disabled:T,children:s.jsxs(Ps.Group,{"data-testid":Lw.selectedItems,children:[k.map(X=>s.jsx(Q,{item:X,disabled:T,onRemove:()=>Ze(X)},X.value)),!T&&(y===void 0||y===0||k.length<y)&&s.jsx(Oe.EventsTarget,{children:s.jsx(nl.Field,{role:"searchbox",name:n,value:R,placeholder:x,onFocus:Je,onBlur:()=>{t.closeDropdown(),_("")},onKeyDown:at,onChange:Je})})]})})}),s.jsx(Oe.Dropdown,{hidden:I.length===0,"data-testid":Lw.options,children:s.jsx(Oe.Options,{children:s.jsxs(oh,{type:"scroll",mah:b,children:[I.map(X=>{const ce=k.some(ke=>ke.value===X.value);return s.jsx(Oe.Option,{value:X.value,active:ce,children:s.jsx($,{...X,active:ce})},X.value)}),g&&R.trim().length>0&&s.jsxs(Oe.Option,{value:"$create",children:["+ Create ",R]}),!g&&R.trim().length>0&&I.length===0&&s.jsx(ue,{search:R})]})})})]})}function mU(e){return e?Array.isArray(e)?e:[e]:[]}function gU(e){return s.jsxs(te,{gap:"xs",children:[e.active&&s.jsx(Ks,{size:12}),s.jsx("span",{children:e.label})]})}function vU({item:e,disabled:t,onRemove:n}){return s.jsx(Ps,{withRemoveButton:!t,onRemove:n,children:e.label})}function yU(){return s.jsx(Oe.Empty,{children:"Nothing found"})}const xU="_searchInput_dick8_1",bU={searchInput:xU};function wU(e){return{value:e.id,label:Ho(e),resource:e}}function SU(e){const t=Vh(),n=ae(),r=p.useCallback(async(i,a)=>{const l=CU(i),c={signal:a},u=await n.graphql(l,void 0,void 0,c);return EU(u,i)},[n]),o=p.useCallback(i=>{i.length>0&&t(`/${ct(i[0])}`)},[t]);return s.jsx(r0,{size:"sm",radius:"md",className:bU.searchInput,leftSection:s.jsx(Kz,{size:16}),placeholder:"Search",itemComponent:jU,toOption:wU,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const jU=p.forwardRef(({resource:e,active:t,...n},r)=>{var i;let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=(i=e.subject)==null?void 0:i.display),s.jsx("div",{ref:r,...n,children:s.jsxs(te,{wrap:"nowrap",children:[s.jsx(Hi,{value:e}),s.jsxs("div",{children:[s.jsx(he,{children:Ho(e)}),s.jsx(he,{size:"xs",c:"dimmed",children:o})]})]})})});function CU(e){const t=JSON.stringify(e);return bk(e)?`{
|
|
472
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
473
|
+
resourceType
|
|
474
|
+
id
|
|
475
|
+
identifier {
|
|
476
|
+
system
|
|
477
|
+
value
|
|
478
|
+
}
|
|
479
|
+
name {
|
|
480
|
+
given
|
|
481
|
+
family
|
|
482
|
+
}
|
|
483
|
+
birthDate
|
|
484
|
+
}
|
|
485
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
486
|
+
resourceType
|
|
487
|
+
id
|
|
488
|
+
identifier {
|
|
489
|
+
system
|
|
490
|
+
value
|
|
491
|
+
}
|
|
492
|
+
subject {
|
|
493
|
+
display
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}`.replace(/\s+/g," "):`{
|
|
497
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
498
|
+
resourceType
|
|
499
|
+
id
|
|
500
|
+
identifier {
|
|
501
|
+
system
|
|
502
|
+
value
|
|
503
|
+
}
|
|
504
|
+
name {
|
|
505
|
+
given
|
|
506
|
+
family
|
|
507
|
+
}
|
|
508
|
+
birthDate
|
|
509
|
+
}
|
|
510
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
511
|
+
resourceType
|
|
512
|
+
id
|
|
513
|
+
identifier {
|
|
514
|
+
system
|
|
515
|
+
value
|
|
516
|
+
}
|
|
517
|
+
name {
|
|
518
|
+
given
|
|
519
|
+
family
|
|
520
|
+
}
|
|
521
|
+
birthDate
|
|
522
|
+
}
|
|
523
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
524
|
+
resourceType
|
|
525
|
+
id
|
|
526
|
+
identifier {
|
|
527
|
+
system
|
|
528
|
+
value
|
|
529
|
+
}
|
|
530
|
+
subject {
|
|
531
|
+
display
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}`.replace(/\s+/g," ")}function EU(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),PU(TU(n),t).slice(0,5)}function TU(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 PU(e,t){return e.sort((n,r)=>$w(r,t)-$w(n,t))}function $w(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,Fw(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,Fw(mu(r),t));return n}function Fw(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function kU(e){var o;const t=Hh(),[n,r]=p.useState(!1);return s.jsx(er.Header,{p:8,style:{zIndex:101},children:s.jsxs(te,{justify:"space-between",children:[s.jsxs(te,{gap:"xs",children:[s.jsx(Sn,{className:id.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(SU,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(te,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(Z,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(Z.Target,{children:s.jsx(Sn,{className:rt(id.user,{[id.userActive]:n}),onClick:()=>r(i=>!i),children:s.jsxs(te,{gap:7,children:[s.jsx(Hi,{value:t,radius:"xl",size:24}),s.jsx(he,{size:"sm",className:id.userName,children:mu((o=t==null?void 0:t.name)==null?void 0:o[0])}),s.jsx(Xx,{size:12,stroke:1.5})]})})}),s.jsx(Z.Dropdown,{children:s.jsx(pU,{version:e.version})})]})]})]})})}function RU(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?_U(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&DU(t,n);return t}function _U(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function DU(e,t){e[t.name]=t.value}function Qe(e){return s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=RU(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function IU(e){const t=ae(),n=t.getUserConfiguration();function r(o){var d,f;const{menuname:i,bookmarkname:a}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=Kr(n),u=(d=c.menu)==null?void 0:d.find(({title:h})=>h===i);(f=u==null?void 0:u.link)==null||f.push({name:a,target:l}),t.updateResource(c).then(h=>{n.menu=h.menu,t.dispatchEvent({type:"change"}),pe({color:"green",message:"Success"}),e.onOk()}).catch(h=>{pe({color:"red",message:Ie(h)})})}return s.jsx(mn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(Qe,{onSubmit:r,children:s.jsxs(Le,{children:[s.jsx(AU,{config:n}),s.jsx(xe,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(te,{justify:"flex-end",children:s.jsx(ie,{mt:"sm",type:"submit",children:"OK"})})]})})})}function AU(e){function t(r){var o;return(o=r==null?void 0:r.menu)==null?void 0:o.map(i=>i.title)}const n=t(e.config);return s.jsx(It,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function rR(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function NU(e){return typeof e.display=="string"?e.display:rR(e)}function MU(e){return{value:rR(e),label:NU(e),resource:e}}function OU(e){return{code:e,display:e}}function o0(e){const t=ae(),{binding:n,creatable:r,clearable:o,expandParams:i,withHelpText:a,...l}=e,c=p.useCallback(async(u,d)=>{var g;if(!n)return[];const h=(g=(await t.valueSetExpand({...i,url:n,filter:u},{signal:d})).expansion)==null?void 0:g.contains,m=[];for(const v of h)v.code&&!m.some(S=>S.code===v.code)&&m.push(v);return m},[t,i,n]);return s.jsx(r0,{...l,creatable:r??!0,clearable:o??!0,toOption:MU,loadOptions:c,onCreate:OU,itemComponent:a?LU:void 0})}const LU=p.forwardRef(({label:e,resource:t,active:n,...r},o)=>s.jsx("div",{ref:o,...r,children:s.jsxs(te,{wrap:"nowrap",gap:"xs",children:[n&&s.jsx(Ks,{size:12}),s.jsxs("div",{children:[s.jsx(he,{children:e}),s.jsx(he,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function oR(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=FU(u);a(d),n&&n(d)}return s.jsx(o0,{defaultValue:$U(i),onChange:l,withHelpText:r??!0,...o})}function $U(e){return e?{code:e}:void 0}function FU(e){return e==null?void 0:e.code}function i0(e){const[t,n]=p.useState(e.defaultValue),r=e.onChange,o=p.useCallback(i=>{n(i),r&&r(i)},[r]);return s.jsx(oR,{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 zU="_menuTitle_9g6l5_1",UU="_link_9g6l5_9",BU="_linkActive_9g6l5_38",Lg={menuTitle:zU,link:UU,linkActive:BU};function VU(e){var l;const t=Vh(),n=qU(e.pathname,e.searchParams,e.menus),[r,o]=p.useState(!1);function i(c,u){c.stopPropagation(),c.preventDefault(),t(u),window.innerWidth<768&&e.closeNavbar()}function a(c){c&&t(`/${c}`)}return s.jsxs(s.Fragment,{children:[s.jsx(er.Navbar,{children:s.jsxs(Rr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(er.Section,{mb:"sm",children:s.jsx(i0,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:c=>a(c)},window.location.pathname)}),s.jsxs(er.Section,{grow:!0,children:[(l=e.menus)==null?void 0:l.map(c=>{var u;return s.jsxs(p.Fragment,{children:[s.jsx(he,{className:Lg.menuTitle,children:c.title}),(u=c.links)==null?void 0:u.map(d=>s.jsxs(HU,{to:d.href,active:d.href===(n==null?void 0:n.href),onClick:f=>i(f,d.href),children:[s.jsx(WU,{to:d.href,icon:d.icon}),s.jsx("span",{children:d.label})]},d.href))]},`menu-${c.title}`)}),e.displayAddBookmark&&s.jsx(ie,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(Vz,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(IU,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function HU(e){return s.jsx(qe,{onClick:e.onClick,to:e.to,className:rt(Lg.link,{[Lg.linkActive]:e.active}),children:e.children})}function WU(e){return e.icon?e.icon:s.jsx(Mh,{w:30})}function qU(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const i of n)if(i.links)for(const a of i.links){const l=GU(e,t,a.href);l>o&&(o=l,r=a)}return r}function GU(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[a,l]of r.searchParams.entries())if(!o.includes(a)&&t.get(a)!==l)return 0;let i=1;for(const[a,l]of t.entries())o.includes(a)||r.searchParams.get(a)===l&&i++;return i}function QU(e){const[t,n]=p.useState(localStorage.navbarOpen==="true"),r=ae(),o=Hh();p.useEffect(()=>{function c(){pe({color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",c),()=>r.removeEventListener("offline",c)},[r]);function i(c){localStorage.navbarOpen=c.toString(),n(c)}function a(){i(!1)}function l(){i(!t)}return r.isLoading()?s.jsx(Pr,{}):s.jsxs(er,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&s.jsx(kU,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:l,notifications:e.notifications}),o&&t?s.jsx(VU,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:a,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(er.Main,{className:oU.main,children:s.jsx(tR,{children:s.jsx(p.Suspense,{fallback:s.jsx(Pr,{}),children:e.children})})})]})}function yu(e){const{contentType:t,url:n,title:r}=e.value??{},o=Gk(n);return o?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:o})}),((t==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&s.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Xe,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:KU(r),children:r||"Download"})})]}):null}function KU(e){return e!=null&&e.includes(".")?e:void 0}const YU="_root_17n8t_1",XU="_compact_17n8t_25",zw={root:YU,compact:XU};function s0(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:rt(zw.root,{[zw.compact]:n}),children:t})}function Ao(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function JU(e){var r;const t=(r=e.values)==null?void 0:r.map((o,i)=>s.jsx("div",{children:s.jsx(yu,{value:o,maxWidth:e.maxWidth})},"attatchment-"+i));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!Ft(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=s.jsx(Ao,{term:Rs(o),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function a0(e){const t=ae(),n=p.useRef(null);function r(a){var l;xt(a),(l=n.current)==null||l.click()}function o(a){xt(a);const l=a.target.files;l&&Array.from(l).forEach(i)}function i(a){!a||!a.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:a,contentType:a.type||"application/octet-stream",filename:a.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(c=>e.onUpload(c)).catch(c=>{e.onUploadError&&e.onUploadError(mt(c))}))}return s.jsxs(s.Fragment,{children:[s.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:a=>o(a)}),e.children({onClick:r,disabled:e.disabled})]})}function ZU(e){const[t,n]=p.useState(e.defaultValue??[]),r=p.useRef();r.current=t;function o(i){n(i),e.onChange&&e.onChange(i)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((i,a)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(yu,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(Zt,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:l=>{xt(l);const c=t.slice();c.splice(a,1),o(c)},children:s.jsx(yf,{})})})]},`${a}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(a0,{disabled:e.disabled,onUpload:i=>{o([...r.current,i])},children:i=>s.jsx(Zt,{...i,title:"Add",variant:"subtle",size:"sm",color:i.disabled?"gray":"green",children:s.jsx(Jx,{})})})})]})]})]})}function iR(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?s.jsxs(s.Fragment,{children:[s.jsx(yu,{value:t,maxWidth:200}),s.jsx(ie,{disabled:e.disabled,onClick:o=>{xt(o),r(void 0)},children:"Remove"})]}):s.jsx(a0,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>s.jsx(ie,{...o,children:"Upload..."})})}function vo(e){return s.jsx(s.Fragment,{children:Mi(e.value)})}function eB(e){return s.jsx(s.Fragment,{children:qs(e.value)})}function sR(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("]")),s.jsx(s.Fragment,{children:n.join("").trim()})}function tB(e){var n;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>s.jsx(sR,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function nB(e){var t,n;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function rB(e){return s.jsx(s.Fragment,{children:H6(e.value)})}function Bc(e){return s.jsx(s.Fragment,{children:di(e.value)})}function l0(e){return s.jsx(s.Fragment,{children:Fc(e.value)})}function oB(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(Bc,{value:t.numerator})," / ",s.jsx(Bc,{value:t.denominator})]}):null}function wf(e){if(!e.value)return null;const t=e.value.display||e.value.reference||fr(e.value);return e.link!==!1&&e.value.reference?s.jsx(qe,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function aR(e,t,n,r){if(!Ft(n==null?void 0:n.slices))return[e];const o=new Array(t.length+1);for(let i=0;i<o.length;i++)o[i]=[];for(const i of e){const a=Hk(i,t,n.discriminator,r);let l=a?t.findIndex(c=>c.name===a):-1;l===-1&&(l=t.length),o[l].push(i)}return o}async function lR({medplum:e,property:t}){return new Promise((n,r)=>{var l,c;if(!t.slicing){n([]);return}const o=[],i=[],a=[];for(const u of t.slicing.slices){if(!Vk(u)){console.debug("Unsupported slice definition",u);continue}let d;Ft(u.elements)||(d=(c=(l=u.type[0])==null?void 0:l.profile)==null?void 0:c[0]),o.push(u),i.push(d),d&&a.push(e.requestProfileSchema(d))}Promise.all(a).then(()=>{for(let u=0;u<o.length;u++){const d=o[u],f=i[u];if(f){const h=bl(f);d.typeSchema=h}}n(o)}).catch(r)})}function Wh(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function iB(e){var a,l;const{slice:t,property:n}=e,r=((a=t.typeSchema)==null?void 0:a.elements)??t.elements,o=p.useContext(wt),i=p.useMemo(()=>{var c;if(Ft(r))return il({parentContext:o,elements:r,path:e.path,profileUrl:(c=t.typeSchema)==null?void 0:c.url})},[o,e.path,(l=t.typeSchema)==null?void 0:l.url,r]);return Wh(wt.Provider,i,s.jsx(s.Fragment,{children:e.value.map((c,u)=>s.jsx("div",{children:s.jsx(Yr,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${u}-${e.value.length}`))}))}function sB(e){var g;const{property:t,propertyType:n}=e,r=ae(),o=p.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[i,a]=p.useState(!0),[l,c]=p.useState([]),[u,d]=p.useState(()=>[o]),f=p.useContext(wt);if(p.useEffect(()=>{lR({medplum:r,property:t}).then(v=>{c(v);const S=aR(o,v,t.slicing,f.profileUrl);d(S),a(!1)}).catch(v=>{console.error(v),a(!1)})},[r,t,f.profileUrl,d,o]),i)return s.jsx("div",{children:"Loading..."});let h;if(((g=t.type[0])==null?void 0:g.code)!=="Extension"){const v=u[l.length],S=v.map((x,w)=>s.jsx("div",{children:s.jsx(Yr,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:x,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${w}-${v.length}`));if(e.includeDescriptionListEntry){if(!Ft(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const x=e.path.split(".").pop();h=s.jsx(Ao,{term:Rs(x),children:S})}else h=s.jsx(s.Fragment,{children:S})}return s.jsxs(s.Fragment,{children:[l.map((v,S)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let x=s.jsx(iB,{path:e.path,slice:v,property:t,value:u[S],ignoreMissingValues:e.ignoreMissingValues,link:e.link},v.name);return e.includeDescriptionListEntry&&(x=s.jsx(Ao,{term:Rs(v.name),children:x},v.name)),x}),h]})}function xu(e,t,n){const r=xn(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 aB(e,t,n){const r=pk(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function lB(e){const{elementDefinitionType:t}=e,n=ae(),r=p.useContext(wt),[o,i]=p.useState(fk("Extension")),a=p.useMemo(()=>{if(Ft(t==null?void 0:t.profile))return t.profile[0]},[t]),[l,c]=p.useState(a!==void 0);if(p.useEffect(()=>{a&&(c(!0),n.requestProfileSchema(a).then(()=>{const f=bl(a);c(!1),f&&i(f)}).catch(f=>{c(!1),console.warn(f)}))},[n,a]),a&&(l||!Ax(a)))return s.jsx("div",{children:"Loading..."});const u=o.elements["value[x]"];if((u==null?void 0:u.max)!==0){const[f,h]=xu({type:"Extension",value:e.value},"value[x]",a??r.profileUrl);return s.jsx(Yr,{propertyType:h,value:f})}return s.jsx(Sf,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:a})}function Yr(e){var i;const{property:t,propertyType:n,value:r}=e;if((i=t==null?void 0:t.path)==null?void 0:i.endsWith(".id"))return s.jsxs(q,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!qt(r)&&s.jsx(dP,{value:r,timeout:2e3,children:({copied:a,copy:l})=>s.jsx(Vs,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(Zt,{variant:"subtle",color:a?"teal":"gray",onClick:l,children:a?s.jsx(Ks,{size:"1rem"}):s.jsx(Xk,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===W.Attachment?s.jsx(JU,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(sB,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case W.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case W.SystemString:case W.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case W.code:case W.date:case W.decimal:case W.id:case W.integer:case W.positiveInt:case W.unsignedInt:case W.uri:case W.url:return s.jsx(s.Fragment,{children:r});case W.canonical:return s.jsx(wf,{value:{reference:r},link:e.link});case W.dateTime:case W.instant:return s.jsx(s.Fragment,{children:$n(r)});case W.markdown:return s.jsx("pre",{children:r});case W.Address:return s.jsx(lz,{value:r});case W.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case W.Attachment:return s.jsx(yu,{value:r,maxWidth:e.maxWidth});case W.CodeableConcept:return s.jsx(vo,{value:r});case W.Coding:return s.jsx(eB,{value:r});case W.ContactDetail:return s.jsx(tB,{value:r});case W.ContactPoint:return s.jsx(sR,{value:r});case W.HumanName:return s.jsx(n0,{value:r});case W.Identifier:return s.jsx(nB,{value:r});case W.Money:return s.jsx(rB,{value:r});case W.Period:return s.jsx(s.Fragment,{children:F6(r)});case W.Quantity:case W.Duration:return s.jsx(Bc,{value:r});case W.Range:return s.jsx(l0,{value:r});case W.Ratio:return s.jsx(oB,{value:r});case W.Reference:return s.jsx(wf,{value:r,link:e.link});case W.Timing:return s.jsx(s.Fragment,{children:Ck(r)});case W.Dosage:case W.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Sf,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case W.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(lB,{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 s.jsx(Sf,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const cR=["extension","modifierExtension"],cB=Kk.filter(e=>!cR.includes(e));function Sf(e){const t=e.value,{value:n,type:r}=t,o=p.useContext(wt),i=e.profileUrl??(o==null?void 0:o.profileUrl),a=p.useMemo(()=>Lh(r,i),[i,r]),l=p.useMemo(()=>{if(a)return il({parentContext:o,elements:a.elements,path:e.path,profileUrl:a.url,accessPolicyResource:e.accessPolicyResource})},[a,o,e.path,e.accessPolicyResource]);if(qt(n))return null;if(!a)return s.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return s.jsx("div",{children:n.name});const c=l??o;return Wh(wt.Provider,l,s.jsx(s0,{compact:e.compact,children:Object.entries(c.elements).map(([u,d])=>{var v;if(cR.includes(u)&&qt((v=d.slicing)==null?void 0:v.slices))return null;if(cB.includes(u))return null;if(Yk.includes(u)&&d.path.split(".").length===2||u.includes("."))return null;const[f,h]=xu(t,u,c.profileUrl);if((e.ignoreMissingValues||d.max===0)&&qt(f)||e.path.endsWith(".extension")&&(u==="url"||u==="id"))return null;const m=d.max>1||d.isArray,g=s.jsx(Yr,{property:d,propertyType:h,path:e.path+"."+u,value:f,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:m,link:e.link},u);return m?g:s.jsx(Ao,{term:Rs(u),children:g},u)})}))}const uR="Read Only";function dR(e,t){return e?s.jsx(Vs.Floating,{label:e,children:t}):t}const uB="_dimmed_1pxw4_1",fR={dimmed:uB};function hR(e){const{debugMode:t}=p.useContext(wt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,dR(e!=null&&e.readonly?uR:void 0,s.jsxs(te,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(Lt.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?fR.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Ye(e,t){var n,r,o;return(o=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(i=>{var a;return pR((a=i.expression)==null?void 0:a[0],t)}))==null?void 0:r.map(i=>{var a;return(a=i.details)==null?void 0:a.text}))==null?void 0:o.join(`
|
|
535
|
+
`)}function bu(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return pR((o=r.expression)==null?void 0:o[0],t)})}const sd=/\[\d+\]/;function pR(e,t){const n=typeof e=="string"&&sd.test(e),r=typeof t=="string"&&sd.test(t);if(n!==r&&(e=e==null?void 0:e.replace(sd,""),t=t==null?void 0:t.replace(sd,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const i=t.indexOf(".");return i>=0&&t.substring(i+1)===e}function yt(e){const{debugMode:t}=p.useContext(wt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,dR(e!=null&&e.readonly?uR:void 0,s.jsx(Lt.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?fR.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,error:Ye(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function mR(e,t,n,r,o){const i=r.type;if(i.length>1)for(const a of i){const l=t.replace("[x]",en(a.code));l in e&&delete e[l]}return e[n]=o,e}function dB(e){return!!e&&!qt(e.url)&&!qt(e.name)}function fB(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:i,valuePath:a,...l}=e,[c,u]=p.useState(t);function d(f){const h=pB(f);u(h),n&&n(h)}return s.jsx(o0,{defaultValue:c&&hB(c),onChange:d,withHelpText:r??!0,...l})}function hB(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function pB(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function gR(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=u&&gB(u);a(d),n&&n(d)}return s.jsx(o0,{defaultValue:i&&mB(i),maxValues:1,onChange:l,withHelpText:r??!0,...o})}function mB(e){return{system:e.system,code:e.code,display:e.display}}function gB(e){return{system:e.system,code:e.code,display:e.display}}function vR(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=p.useContext(wt),[i,a]=p.useState(e.defaultValue),l=p.useRef();l.current=i;const[c,u,d]=p.useMemo(()=>["system","use","value"].map(y=>r[t+"."+y]),[r,t]),[f,h,m]=p.useMemo(()=>["system","use","value"].map(y=>o(t+"."+y)),[o,t]);function g(y){y&&Object.keys(y).length===0&&(y=void 0),a(y),e.onChange&&e.onChange(y)}function v(y){const b={...l.current,system:y};y||delete b.system,g(b)}function S(y){const b={...l.current,use:y};y||delete b.use,g(b)}function x(y){const b={...l.current,value:y};y||delete b.value,g(b)}const w=e.valuePath??t;return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(It,{disabled:e.disabled||(f==null?void 0:f.readonly),"data-testid":"system",defaultValue:i==null?void 0:i.system,required:((c==null?void 0:c.min)??0)>0,onChange:y=>v(y.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Ye(n,w+".system")}),s.jsx(It,{disabled:e.disabled||(h==null?void 0:h.readonly),"data-testid":"use",defaultValue:i==null?void 0:i.use,required:((u==null?void 0:u.min)??0)>0,onChange:y=>S(y.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Ye(n,w+".use")}),s.jsx(xe,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Value",defaultValue:i==null?void 0:i.value,required:((d==null?void 0:d.min)??0)>0,onChange:y=>x(y.currentTarget.value),error:Ye(n,w+".value")})]})}function vB(e){var d;const[t,n]=p.useState(e.defaultValue),r=p.useRef();r.current=t;const{getExtendedProps:o}=p.useContext(wt),[i,a]=p.useMemo(()=>["name","telecom"].map(f=>o(e.path+"."+f)),[o,e.path]);function l(f){n(f),e.onChange&&e.onChange(f)}function c(f){const h={...r.current,name:f};f||delete h.name,l(h)}function u(f){const h={...r.current,telecom:f&&[f]};f||delete h.telecom,l(h)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(xe,{disabled:e.disabled||(i==null?void 0:i.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:f=>c(f.currentTarget.value)}),s.jsx(vR,{disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(d=t==null?void 0:t.telecom)==null?void 0:d[0],onChange:u,outcome:e.outcome})]})}function yB(e){if(!e)return"";const t=new Date(e);return $h(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function yR(e){if(!e)return"";const t=new Date(e);return $h(t)?t.toISOString():""}function _s(e){return s.jsx(xe,{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:xB(),defaultValue:yB(e.defaultValue),autoFocus:e.autoFocus,error:Ye(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(yR(n))}}})}function xB(){return"datetime-local"}function bB(e){const{propertyType:t}=e,n=ae(),r=p.useMemo(()=>{if(Ft(t.profile))return t.profile[0]},[t]),[o,i]=p.useState(r!==void 0);return p.useEffect(()=>{r&&(i(!0),n.requestProfileSchema(r).then(()=>i(!1)).catch(a=>{i(!1),console.warn(a)}))},[n,r]),r&&(o||!Ax(r))?s.jsx("div",{children:"Loading..."}):s.jsx(d0,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function wB(e){var w,y,b;const{outcome:t,path:n}=e,[r,o]=p.useState(e.defaultValue),{getExtendedProps:i}=p.useContext(wt),[a,l,c,u,d]=p.useMemo(()=>["use","prefix","given","family","suffix"].map(C=>i(e.path+"."+C)),[i,e.path]);function f(C){o(C),e.onChange&&e.onChange(C)}function h(C){f({...r,use:C||void 0})}function m(C){f({...r,prefix:C?C.split(" "):void 0})}function g(C){f({...r,given:C?C.split(" "):void 0})}function v(C){f({...r,family:C||void 0})}function S(C){f({...r,suffix:C?C.split(" "):void 0})}const x=e.valuePath??n;return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(It,{disabled:e.disabled||(a==null?void 0:a.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:C=>h(C.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Ye(t,x+".use")}),s.jsx(xe,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(w=r==null?void 0:r.prefix)==null?void 0:w.join(" "),onChange:C=>m(C.currentTarget.value),error:Ye(t,x+".prefix")}),s.jsx(xe,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(y=r==null?void 0:r.given)==null?void 0:y.join(" "),onChange:C=>g(C.currentTarget.value),error:Ye(t,x+".given")}),s.jsx(xe,{disabled:e.disabled||(u==null?void 0:u.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:C=>v(C.currentTarget.value),error:Ye(t,x+".family")}),s.jsx(xe,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(b=r==null?void 0:r.suffix)==null?void 0:b.join(" "),onChange:C=>S(C.currentTarget.value),error:Ye(t,x+".suffix")})]})}function SB(e){const[t,n]=p.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=p.useContext(wt),[i,a]=p.useMemo(()=>["system","value"].map(f=>r[e.path+"."+f]),[r,e.path]),[l,c]=p.useMemo(()=>["system","value"].map(f=>o(e.path+"."+f)),[o,e.path]);function u(f){n(f),e.onChange&&e.onChange(f)}const d=e.valuePath??e.path;return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(xe,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"System",required:((i==null?void 0:i.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:f=>u({...t,system:f.currentTarget.value}),error:Ye(e.outcome,d+".system")}),s.jsx(xe,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Value",required:((a==null?void 0:a.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:f=>u({...t,value:f.currentTarget.value}),error:Ye(e.outcome,d+".value")})]})}const jB=["USD","EUR","CAD","GBP","AUD"];function CB(e){var f;const{onChange:t}=e,[n,r]=p.useState(e.defaultValue),{getExtendedProps:o}=p.useContext(wt),[i,a]=p.useMemo(()=>["currency","value"].map(h=>o(e.path+"."+h)),[o,e.path]),l=p.useCallback(h=>{r(h),t&&t(h)},[t]),c=p.useCallback(h=>{l({...n,currency:h.currentTarget.value})},[n,l]),u=p.useCallback(h=>{l({...n,value:h.currentTarget.valueAsNumber})},[n,l]),d=s.jsx(It,{disabled:e.disabled||(i==null?void 0:i.readonly),defaultValue:n==null?void 0:n.currency,data:jB,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:c});return s.jsx(xe,{disabled:e.disabled||(a==null?void 0:a.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((f=n==null?void 0:n.value)==null?void 0:f.toString())??"USD",leftSection:s.jsx(Pz,{size:14}),rightSection:d,rightSectionWidth:92,onChange:u})}function EB(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(wt),[o,i]=p.useMemo(()=>["start","end"].map(l=>r(e.path+"."+l)),[r,e.path]);function a(l){n(l),e.onChange&&e.onChange(l)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(_s,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:l=>a({...t,start:l})}),s.jsx(_s,{disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:l=>a({...t,end:l})})]})}function Ds(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(wt),[o,i,a]=p.useMemo(()=>["comparator","value","unit"].map(c=>r(e.path+"."+c)),[r,e.path]);function l(c){n(c),e.onChange&&e.onChange(c)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(It,{disabled:e.disabled||(o==null?void 0:o.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:c=>l({...t,comparator:c.currentTarget.value})}),s.jsx(xe,{disabled:e.disabled||(i==null?void 0:i.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==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:c=>{e.disableWheel&&c.currentTarget.blur()},onChange:c=>{l({...t,value:TB(c.currentTarget.value)})}}),s.jsx(xe,{disabled:e.disabled||(a==null?void 0:a.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:c=>l({...t,unit:c.currentTarget.value})})]})}function TB(e){if(e)return parseFloat(e)}function c0(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(wt),[o,i]=p.useMemo(()=>["low","high"].map(l=>r(e.path+"."+l)),[r,e.path]);function a(l){n(l),e.onChange&&e.onChange(l)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Ds,{path:e.path+".low",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:l=>a({...t,low:l})}),s.jsx(Ds,{path:e.path+".high",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:l=>a({...t,high:l})})]})}function PB(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(wt),[o,i]=p.useMemo(()=>["numerator","denominator"].map(l=>r(e.path+"."+l)),[r,e.path]);function a(l){n(l),e.onChange&&e.onChange(l)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Ds,{path:e.path+".numerator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:l=>a({...t,numerator:l})}),s.jsx(Ds,{path:e.path+".denominator",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:l=>a({...t,denominator:l})})]})}const kB={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},RB=["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 _B(e){return{value:ct(e),label:Ho(e),resource:e}}function Ys(e){const t=ae(),{resourceType:n,searchCriteria:r}=e,[o,i]=p.useState(),a=St(e.defaultValue,i),l=e.itemComponent??DB,c=e.onChange,u=p.useCallback(async(f,h)=>{const m=IB(n),g=new URLSearchParams({[m]:f??"",_count:"10",...r});return await t.searchResources(n,g,{signal:h})},[t,n,r]),d=p.useCallback(f=>{c&&c(f[0])},[c]);return Ft(e.defaultValue)&&!o&&!a?null:s.jsx(r0,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:l,defaultValue:a,placeholder:e.placeholder,maxValues:1,toOption:_B,loadOptions:u,onChange:d,clearable:!0})}const DB=p.forwardRef(({label:e,resource:t,active:n,...r},o)=>s.jsx("div",{ref:o,...r,children:s.jsxs(te,{wrap:"nowrap",children:[s.jsx(Hi,{value:t}),s.jsxs("div",{children:[s.jsx(he,{children:e}),s.jsx(he,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function IB(e){return kB[e]??(RB.includes(e)?"name":"_id")}function qh(e){const{onChange:t}=e,n=ae(),[r,o]=p.useState(e.defaultValue),[i,a]=p.useState(()=>AB(e.targetTypes)),[l,c]=p.useState(()=>NB(e.defaultValue,i)),u=p.useRef(new Fk),d=p.useMemo(()=>(l==null?void 0:l.type)==="profile"?{...e.searchCriteria,_profile:l.value}:e.searchCriteria,[e.searchCriteria,l]);p.useEffect(()=>{let m=!1;const g=i==null?void 0:i.map(v=>{if(!OB(v))return Promise.resolve(v);m=!0;const S=v.value,x=u.current.get(S);if(x)return x;const w=MB(n,v.value).then(b=>{const C={...v};return b?Ft(b.type)?(C.resourceType=b.type,C.name=b.name,C.title=b.title):(console.error(`StructureDefinition.type missing for ${v.value}`),C.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${v.value}`),C.error="StructureDefinition not found"),C}).catch(b=>(console.error(b),{...v,error:b})),y=new Or(w);return u.current.set(S,y),y});!g||!m||Promise.all(g).then(v=>{if(a(v),!l)return;const S=v.findIndex(x=>x.value===l.value||x.resourceType===l.resourceType);if(S===-1){console.debug(`defaultValue had unexpected resourceType: ${l.resourceType}`);return}c(v[S])}).catch(console.error)},[n,l,i]);const f=p.useCallback(m=>{const g=m?Tt(m):void 0;o(g),t&&t(g)},[t]),h=p.useMemo(()=>i?i.map(m=>({value:m.value,label:m.type==="profile"?m.title??m.name??m.resourceType??m.value:m.value})):[],[i]);return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&s.jsx(It,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:l==null?void 0:l.resourceType,autoFocus:e.autoFocus,onChange:m=>{const g=m.currentTarget.value,v=i.find(S=>S.value===g);c(v)},data:h}),!i&&s.jsx(i0,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:l==null?void 0:l.resourceType,onChange:m=>{c(m?{type:"resourceType",value:m,resourceType:m}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(Ys,{resourceType:l==null?void 0:l.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:d,onChange:f,disabled:e.disabled})]})}function AB(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 NB(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const o=t==null?void 0:t.find(i=>i.resourceType===n);return o||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function MB(e,t){const n=bl(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
536
|
+
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
537
|
+
type,
|
|
538
|
+
name,
|
|
539
|
+
title,
|
|
540
|
+
}
|
|
541
|
+
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function OB(e){return e.type==="profile"&&!(e!=null&&e.error)&&qt(e.resourceType)}const LB="_indented_ldk1d_1",xR={indented:LB};function bR({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(ie,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(xf,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(Zt,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(xf,{size:"1.25rem"})})}function wR({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(Zt,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(yf,{size:"1.25rem"})})}function $B(e){var m,g;const{slice:t,property:n}=e,[r,o]=p.useState(e.defaultValue),i=((m=t.typeSchema)==null?void 0:m.elements)??t.elements,a=p.useContext(wt),l=p.useMemo(()=>{var v;if(Ft(i))return il({parentContext:a,elements:i,path:e.path,profileUrl:(v=t.typeSchema)==null?void 0:v.url})},[a,e.path,(g=t.typeSchema)==null?void 0:g.url,i]);function c(v){o(v),e.onChange&&e.onChange(v)}const u=t.min>0,d=qt(t.elements),f=Pk(t.name),h=e.property.readonly&&r.length===0;return Wh(wt.Provider,l,s.jsx(yt,{title:f,description:t.definition,withAsterisk:u,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:h?s.jsx(he,{c:"dimmed",children:"(empty)"}):s.jsxs(Le,{className:d?xR.indented:void 0,children:[r.map((v,S)=>s.jsxs(te,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${S}`,children:s.jsx(u0,{elementDefinitionType:t.type[0],name:t.name,defaultValue:v,onChange:x=>{const w=[...r];w[S]=x,c(w)},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&&s.jsx(wR,{propertyDisplayName:f,testId:e.testId&&`${e.testId}-remove-${S}`,onClick:x=>{xt(x);const w=[...r];w.splice(S,1),c(w)}})]},`${S}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(te,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(bR,{propertyDisplayName:f,onClick:v=>{xt(v);const S=[...r,void 0];c(S)},testId:e.testId&&`${e.testId}-add`})})]})}))}function FB(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function zB(e){var w;const{property:t}=e,n=ae(),[r,o]=p.useState(!0),[i,a]=p.useState([]),[l]=p.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[c,u]=p.useState(()=>[l]),d=p.useContext(wt),f=(w=t.type[0])==null?void 0:w.code;p.useEffect(()=>{lR({medplum:n,property:t}).then(y=>{a(y);const b=aR(l,y,t.slicing,d.profileUrl);UB(b,y),u(b),o(!1)}).catch(y=>{console.error(y),o(!1)})},[n,t,l,d.profileUrl,u]);function h(y,b){const C=[...c];if(C[b]=y,u(C),e.onChange){const j=C.flat().filter(T=>T!==void 0);e.onChange(j)}}if(r)return s.jsx("div",{children:"Loading..."});const m=i.length,g=c[m],v=!(e.hideNonSliceValues??(f==="Extension"&&i.length>0)),S=Rs(t.path),x=e.property.readonly&&i.length===0&&l.length===0;return s.jsxs(Le,{className:e.indent?xR.indented:void 0,children:[x&&s.jsx(he,{c:"dimmed",children:"(empty)"}),i.map((y,b)=>s.jsx($B,{slice:y,path:e.path,valuePath:e.valuePath,property:t,defaultValue:c[b],onChange:C=>{h(C,b)},testId:`slice-${y.name}`},y.name)),v&&g.map((y,b)=>s.jsxs(te,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(El,{arrayElement:!0,property:e.property,name:e.name+"."+b,path:e.path,valuePath:FB(e.path,e.valuePath,b),defaultValue:y,onChange:C=>{const j=[...g];j[b]=C,h(j,m)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(wR,{propertyDisplayName:S,testId:`nonsliced-remove-${b}`,onClick:C=>{xt(C);const j=[...g];j.splice(b,1),h(j,m)}})]},`${b}-${g.length}`)),!e.property.readonly&&v&&c.flat().length<t.max&&s.jsx(te,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(bR,{propertyDisplayName:S,onClick:y=>{xt(y);const b=[...g];b.push(void 0),h(b,m)},testId:"nonsliced-add"})})]})}function UB(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 BB(e){const[t,n]=p.useState(!1),r=dj(),o=p.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),s.jsxs(Es,{gap:"xs",children:[s.jsx(Bs,{...e,styles:{...i,root:{...i.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(Zt,{title:"Copy secret",onClick:()=>{var a;r.copy((a=o.current)==null?void 0:a.value),pe({color:"green",message:"Copied"})},children:s.jsx(Xk,{})})]})}const VB=["sun","mon","tue","wed","thu","fri","sat"];function HB(e){const[t,n]=p.useState(e.defaultValue),[r,o]=p.useState(!e.disabled&&(e.defaultModalOpen??!1)),i=p.useRef();return i.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:Ck(i.current)||"No repeat"}),s.jsx(ie,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&s.jsx(WB,{path:e.path,visible:r,defaultValue:i.current,onOk:a=>{e.onChange&&e.onChange(a),n(a),o(!1)},onCancel:()=>o(!1)})]})}const Uw={repeat:{period:1,periodUnit:"d"}};function WB(e){const[t,n]=p.useState(e.defaultValue||Uw),{getExtendedProps:r}=p.useContext(wt),[o,i,a,l,c]=p.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(v=>r(e.path+"."+v)),[r,e.path]),u=p.useRef();u.current=t;function d(v){n({...u.current,event:[v]})}function f(v){n({...u.current,repeat:v})}function h(v){var S;f({...(S=u.current)==null?void 0:S.repeat,period:v})}function m(v){var S;f({...(S=u.current)==null?void 0:S.repeat,periodUnit:v})}function g(v){var S;f({...(S=u.current)==null?void 0:S.repeat,dayOfWeek:v})}return s.jsx(mn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(Le,{children:[s.jsx(yt,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(_s,{disabled:o==null?void 0:o.readonly,name:"timing-dialog-start",onChange:v=>d(v)})}),s.jsx(du,{disabled:i==null?void 0:i.readonly,label:"Repeat",checked:!!t.repeat,onChange:v=>f(v.currentTarget.checked?Uw.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(xe,{disabled:a==null?void 0:a.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:v=>h(parseInt(v.currentTarget.value,10)||1)}),s.jsx(It,{disabled:l==null?void 0:l.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:v=>m(v.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"&&s.jsx(yt,{title:"Repeat on",children:s.jsx(Ac.Group,{multiple:!0,onChange:g,children:s.jsx(te,{justify:"space-between",mt:"md",gap:"xs",children:VB.map(v=>s.jsx(Ac,{value:v,size:"xs",radius:"xl",disabled:c==null?void 0:c.readonly,children:v.charAt(0).toUpperCase()},v))})})})]}),s.jsx(te,{justify:"flex-end",children:s.jsx(ie,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function El(e){var l;const{property:t,name:n,onChange:r,defaultValue:o}=e,i=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,a=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(i===W.Attachment)return s.jsx(ZU,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const c=((l=a[0])==null?void 0:l.code)!==W.Extension;return s.jsx(zB,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:c,onChange:r,outcome:e.outcome})}else return a.length>1?s.jsx(qB,{elementDefinitionTypes:a,...e}):s.jsx(u0,{name:n,defaultValue:o,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",en(a[0].code));e.onChange(c,u)}},outcome:e.outcome,elementDefinitionType:a[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function qB(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(i=>i.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=p.useState(n);return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(It,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:i=>{o(t.find(a=>a.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),s.jsx(u0,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",en(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 u0(e){const{name:t,onChange:n,outcome:r,binding:o,path:i,valuePath:a,readOnly:l}=e,c=e.min!==void 0&&e.min>0,u=e.elementDefinitionType.code,d=p.useContext(wt),f=p.useMemo(()=>{if(!Lx(u)||!qt(e.defaultValue))return e.defaultValue;const g=Object.create(null);if(d.path===e.path)Pw(g,d.elements);else{const v=Lc(d.path,e.path);if(v===void 0)return e.defaultValue;Pw(g,d.elements,v)}return Ft(g)?g:e.defaultValue},[u,d.path,d.elements,e.path,e.defaultValue]);if(!u)return s.jsx("div",{children:"Property type not specified "});function h(){return{name:t,defaultValue:f,onChange:n,outcome:r,path:i,valuePath:a,disabled:l}}function m(){const g=Ye(e.outcome,a??i);return{id:t,name:t,"data-testid":t,defaultValue:f,required:c,error:g,disabled:l}}switch(u){case W.SystemString:case W.canonical:case W.string:case W.time:case W.uri:case W.url:return e.path==="Project.secret.value[x]"?s.jsx(BB,{...m(),onChange:g=>{e.onChange&&e.onChange(g.currentTarget.value)}}):s.jsx(xe,{...m(),onChange:g=>{n&&n(g.currentTarget.value)}});case W.date:return s.jsx(xe,{...m(),type:"date",onChange:g=>{n&&n(g.currentTarget.value)}});case W.dateTime:case W.instant:return s.jsx(_s,{...m(),onChange:n,outcome:r});case W.decimal:case W.integer:case W.positiveInt:case W.unsignedInt:return s.jsx(xe,{...m(),type:"number",step:u===W.decimal?"any":"1",onChange:g=>{if(n){const v=g.currentTarget.valueAsNumber;n(Number.isNaN(v)?void 0:v)}}});case W.code:return s.jsx(oR,{...m(),error:void 0,onChange:n,binding:o==null?void 0:o.valueSet});case W.boolean:return s.jsx(Rn,{...m(),defaultChecked:!!f,onChange:g=>{n&&n(g.currentTarget.checked)}});case W.base64Binary:case W.markdown:return s.jsx(Bs,{...m(),spellCheck:u!==W.base64Binary,onChange:g=>{n&&n(g.currentTarget.value)}});case W.Address:return s.jsx(dz,{...h()});case W.Annotation:return s.jsx(fz,{...h()});case W.Attachment:return s.jsx(iR,{...h()});case W.CodeableConcept:return s.jsx(fB,{binding:o==null?void 0:o.valueSet,...h()});case W.Coding:return s.jsx(gR,{binding:o==null?void 0:o.valueSet,...h()});case W.ContactDetail:return s.jsx(vB,{...h()});case W.ContactPoint:return s.jsx(vR,{...h()});case W.Extension:return s.jsx(bB,{...h(),propertyType:e.elementDefinitionType});case W.HumanName:return s.jsx(wB,{...h()});case W.Identifier:return s.jsx(SB,{...h()});case W.Money:return s.jsx(CB,{...h()});case W.Period:return s.jsx(EB,{...h()});case W.Duration:case W.Quantity:return s.jsx(Ds,{...h()});case W.Range:return s.jsx(c0,{...h()});case W.Ratio:return s.jsx(PB,{...h()});case W.Reference:return s.jsx(qh,{...h(),targetTypes:QB(e.elementDefinitionType)});case W.Timing:return s.jsx(HB,{...h()});case W.Dosage:case W.UsageContext:default:return s.jsx(d0,{...h(),typeName:u})}}const GB=[`${H$}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function QB(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=GB.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}function KB(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useContext(wt),o=p.useMemo(()=>uz(r.elements),[r.elements]);function i(l){n(l),e.onChange&&e.onChange(l)}const a={type:e.type,value:t};return s.jsx(Le,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([l,c])=>{const[u,d]=aB(a,l,c),f=c.min!==void 0&&c.min>0,h=e.valuePath?e.valuePath+"."+l:void 0,m=s.jsx(El,{property:c,name:l,path:e.path+"."+l,valuePath:h,defaultValue:u,defaultPropertyType:d,onChange:(g,v)=>{i(mR({...t},l,v??l,c,g))},outcome:e.outcome},l);return e.type==="Extension"||Yx.includes(l)?m:c.type.length===1&&c.type[0].code==="boolean"?s.jsx(hR,{title:Rs(l),description:c.description,htmlFor:l,fhirPath:c.path,withAsterisk:f,readonly:c.readonly,children:m},l):s.jsx(yt,{title:Rs(l),description:c.description,withAsterisk:f,htmlFor:l,outcome:e.outcome,fhirPath:c.path,errorExpression:h,readonly:c.readonly,children:m},l)})})}function d0(e){const[t]=p.useState(()=>e.defaultValue??{}),n=p.useContext(wt),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=p.useMemo(()=>Lh(e.typeName,r),[e.typeName,r]),i=(o==null?void 0:o.type)??e.typeName,a=p.useMemo(()=>{if(o)return il({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);return o?Wh(wt.Provider,a,s.jsx(KB,{path:e.path,valuePath:e.valuePath,type:i,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[i," not implemented"]})}const YB="_root_1vii2_1",XB={root:YB};function wu(e){const{children:t,...n}=e;return s.jsx(Ky,{className:XB.root,...n,children:t})}const JB="_noteBody_10swh_1",ZB="_noteCite_10swh_5",eV="_noteRoot_10swh_10",Bw={noteBody:JB,noteCite:ZB,noteRoot:eV};function SR({value:e}){return e?s.jsx(Le,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(qy,{classNames:{cite:Bw.noteCite,root:Bw.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Tl(e){const{value:t,link:n,...r}=e,[o,i]=p.useState(),a=St(t,i);let l;if(o&&!sk(o))l=`[${Ie(o)}]`;else if(a)l=Ho(a);else return null;return n?s.jsx(qe,{to:t,...r,children:l}):s.jsx(he,{component:"span",...r,children:l})}function Ha(e){return s.jsxs(te,{gap:"xs",children:[s.jsx(Hi,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Tl,{value:e.value,link:e.link})]})}const tV={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"};function f0(e){return s.jsx(su,{color:tV[e.status],children:e.status})}const nV="_table_pe9td_1",rV="_criticalRow_pe9td_12",oV="_noteBody_pe9td_23",iV="_noteCite_pe9td_27",sV="_noteRoot_pe9td_32",jR={table:nV,criticalRow:rV,noteBody:oV,noteCite:iV,noteRoot:sV};h0.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function h0(e){var a;const t=ae(),n=St(e.value),[r,o]=p.useState();if(p.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,n]),!n)return null;const i=(r==null?void 0:r.flatMap(l=>l.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const l=n.presentedForm[0];(a=l.contentType)!=null&&a.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return s.jsxs(Le,{children:[s.jsx(ye,{children:"Diagnostic Report"}),s.jsx(aV,{value:n}),r&&!e.hideSpecimenInfo&&lV(r),n.result&&s.jsx(cV,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&s.jsx(SR,{value:i})]})}function aV({value:e}){var t,n;return s.jsxs(te,{mt:"md",gap:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(he,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(Ha,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>s.jsxs("div",{children:[s.jsx(he,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(Ha,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>s.jsxs("div",{children:[s.jsx(he,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(Ha,{value:r,link:!0})]},r.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(he,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(he,{children:$n(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(he,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(he,{children:en(e.status)})]})]})}function lV(e){return s.jsxs(Le,{gap:"xs",children:[s.jsx(ye,{order:2,size:"h6",children:"Specimens"}),s.jsx(On,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(On.Item,{ml:"sm",children:s.jsxs(te,{gap:20,children:[s.jsxs(te,{gap:5,children:[s.jsx(he,{fw:500,children:"Collected:"})," ",$n((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(te,{gap:5,children:[s.jsx(he,{fw:500,children:"Received:"})," ",$n(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function cV(e){return s.jsxs("table",{className:jR.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(CR,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function CR(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(uV,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Qs(n)?n.reference:n.id}`))})}function uV(e){var o,i;const t=St(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=hV(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:rt({[jR.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(qe,{to:t,children:s.jsx(vo,{value:t.code})})}),s.jsx("td",{children:s.jsx(dV,{value:t})}),s.jsx("td",{children:s.jsx(fV,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(vo,{value:t.interpretation[0]})}),s.jsx("td",{children:t.category&&t.category.length>0&&s.jsx(s.Fragment,{children:t.category.map(a=>s.jsx("div",{children:s.jsx(vo,{value:a})},`category-${Mi(a)}`))})}),s.jsx("td",{children:(i=t.performer)==null?void 0:i.map(a=>s.jsx(wf,{value:a},a.reference))}),s.jsx("td",{children:t.status&&s.jsx(f0,{status:t.status})})]}),t.hasMember&&s.jsx(CR,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(SR,{value:t.note})})})]})}function dV(e){const t=e.value;return s.jsx(s.Fragment,{children:Ek(t)})}function fV(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(l0,{value:t}):null}function hV(e){var n,r,o,i;const t=(i=(o=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}const pV="_paper_1igaj_1",mV="_fill_1igaj_20",Vw={paper:pV,fill:mV};function p0(e){const{width:t,fill:n,className:r,children:o,...i}=e,a=t?{maxWidth:t}:void 0;return s.jsx(Jn,{className:rt(Vw.paper,n&&Vw.fill,r),style:a,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}var m0={},No={};Object.defineProperty(No,"__esModule",{value:!0});No.Pointer=No.escapeToken=No.unescapeToken=void 0;function ER(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}No.unescapeToken=ER;function TR(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}No.escapeToken=TR;var gV=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var n=t.split("/").map(ER);if(n[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(n)},e.prototype.toString=function(){return this.tokens.map(TR).join("/")},e.prototype.evaluate=function(t){for(var n=null,r="",o=t,i=1,a=this.tokens.length;i<a;i++)n=o,r=this.tokens[i],!(r=="__proto__"||r=="constructor"||r=="prototype")&&(o=(n||{})[r]);return{parent:n,key:r,value:o}},e.prototype.get=function(t){return this.evaluate(t).value},e.prototype.set=function(t,n){var r=this.evaluate(t);r.parent&&(r.parent[r.key]=n)},e.prototype.push=function(t){this.tokens.push(t)},e.prototype.add=function(t){var n=this.tokens.concat(String(t));return new e(n)},e}();No.Pointer=gV;var Ht={},g0={};(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 i=o.length,a=new Array(i),l=0;l<i;l++)a[l]=r(o[l]);return a}if(o.constructor==Date){var c=new Date(+o);return c}var u={};for(var d in o)e.hasOwnProperty.call(o,d)&&(u[d]=r(o[d]));return u}e.clone=r})(g0);var Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.diffAny=Mn.diffObjects=Mn.diffArrays=Mn.intersection=Mn.subtract=Mn.isDestructive=void 0;var Vc=g0;function vV(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}Mn.isDestructive=vV;function $g(e,t){var n={};for(var r in e)Vc.hasOwnProperty.call(e,r)&&e[r]!==void 0&&(n[r]=1);for(var o in t)Vc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete n[o];return Object.keys(n)}Mn.subtract=$g;function PR(e){for(var t=e.length,n={},r=0;r<t;r++){var o=e[r];for(var i in o)Vc.hasOwnProperty.call(o,i)&&o[i]!==void 0&&(n[i]=(n[i]||0)+1)}for(var i in n)n[i]<t&&delete n[i];return Object.keys(n)}Mn.intersection=PR;function yV(e){return e.op==="add"}function xV(e){return e.op==="remove"}function nm(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function kR(e,t,n,r){r===void 0&&(r=Gh);var o={"0,0":{operations:[],cost:0}};function i(d,f){var h="".concat(d,",").concat(f),m=o[h];if(m===void 0){if(d>0&&f>0&&!r(e[d-1],t[f-1],n.add(String(d-1))).length)m=i(d-1,f-1);else{var g=[];if(d>0){var v=i(d-1,f),S={op:"remove",index:d-1};g.push(nm(v,S))}if(f>0){var x=i(d,f-1),w={op:"add",index:d-1,value:t[f-1]};g.push(nm(x,w))}if(d>0&&f>0){var y=i(d-1,f-1),b={op:"replace",index:d-1,original:e[d-1],value:t[f-1]};g.push(nm(y,b))}var C=g.sort(function(j,T){return j.cost-T.cost})[0];m=C}o[h]=m}return m}var a=isNaN(e.length)||e.length<=0?0:e.length,l=isNaN(t.length)||t.length<=0?0:t.length,c=i(a,l).operations,u=c.reduce(function(d,f){var h=d[0],m=d[1];if(yV(f)){var g=f.index+1+m,v=g<a+m?String(g):"-",S={op:f.op,path:n.add(v).toString(),value:f.value};return[h.concat(S),m+1]}else if(xV(f)){var S={op:f.op,path:n.add(String(f.index+m)).toString()};return[h.concat(S),m-1]}else{var x=n.add(String(f.index+m)),w=r(f.original,f.value,x);return[h.concat.apply(h,w),m]}},[[],0])[0];return u}Mn.diffArrays=kR;function RR(e,t,n,r){r===void 0&&(r=Gh);var o=[];return $g(e,t).forEach(function(i){o.push({op:"remove",path:n.add(i).toString()})}),$g(t,e).forEach(function(i){o.push({op:"add",path:n.add(i).toString(),value:t[i]})}),PR([e,t]).forEach(function(i){o.push.apply(o,r(e[i],t[i],n.add(i)))}),o}Mn.diffObjects=RR;function Gh(e,t,n,r){if(r===void 0&&(r=Gh),e===t)return[];var o=(0,Vc.objectType)(e),i=(0,Vc.objectType)(t);return o=="array"&&i=="array"?kR(e,t,n,r):o=="object"&&i=="object"?RR(e,t,n,r):[{op:"replace",path:n.toString(),value:t}]}Mn.diffAny=Gh;var v0=$0&&$0.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Ht,"__esModule",{value:!0});Ht.apply=Ht.InvalidOperationError=Ht.test=Ht.copy=Ht.move=Ht.replace=Ht.remove=Ht.add=Ht.TestError=Ht.MissingError=void 0;var Wo=No,y0=g0,bV=Mn,yo=function(e){v0(t,e);function t(n){var r=e.call(this,"Value required at path: ".concat(n))||this;return r.path=n,r.name="MissingError",r}return t}(Error);Ht.MissingError=yo;var _R=function(e){v0(t,e);function t(n,r){var o=e.call(this,"Test failed: ".concat(n," != ").concat(r))||this;return o.actual=n,o.expected=r,o.name="TestError",o}return t}(Error);Ht.TestError=_R;function x0(e,t,n){if(Array.isArray(e))if(t=="-")e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function DR(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function IR(e,t){var n=Wo.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new yo(t.path):(x0(n.parent,n.key,(0,y0.clone)(t.value)),null)}Ht.add=IR;function AR(e,t){var n=Wo.Pointer.fromJSON(t.path).evaluate(e);return n.value===void 0?new yo(t.path):(DR(n.parent,n.key),null)}Ht.remove=AR;function NR(e,t){var n=Wo.Pointer.fromJSON(t.path).evaluate(e);if(n.parent===null)return new yo(t.path);if(Array.isArray(n.parent)){if(parseInt(n.key,10)>=n.parent.length)return new yo(t.path)}else if(n.value===void 0)return new yo(t.path);return n.parent[n.key]=(0,y0.clone)(t.value),null}Ht.replace=NR;function MR(e,t){var n=Wo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new yo(t.from);var r=Wo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new yo(t.path):(DR(n.parent,n.key),x0(r.parent,r.key,n.value),null)}Ht.move=MR;function OR(e,t){var n=Wo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new yo(t.from);var r=Wo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new yo(t.path):(x0(r.parent,r.key,(0,y0.clone)(n.value)),null)}Ht.copy=OR;function LR(e,t){var n=Wo.Pointer.fromJSON(t.path).evaluate(e);return(0,bV.diffAny)(n.value,t.value,new Wo.Pointer).length?new _R(n.value,t.value):null}Ht.test=LR;var $R=function(e){v0(t,e);function t(n){var r=e.call(this,"Invalid operation: ".concat(n.op))||this;return r.operation=n,r.name="InvalidOperationError",r}return t}(Error);Ht.InvalidOperationError=$R;function wV(e,t){switch(t.op){case"add":return IR(e,t);case"remove":return AR(e,t);case"replace":return NR(e,t);case"move":return MR(e,t);case"copy":return OR(e,t);case"test":return LR(e,t)}return new $R(t)}Ht.apply=wV;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=No;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=Ht,r=Mn;function o(u,d){return d.map(function(f){return(0,n.apply)(u,f)})}e.applyPatch=o;function i(u){function d(f,h,m){var g=u(f,h,m);return Array.isArray(g)?g:(0,r.diffAny)(f,h,m,d)}return d}function a(u,d,f){var h=new t.Pointer;return(f?i(f):r.diffAny)(u,d,h)}e.createPatch=a;function l(u,d){var f=t.Pointer.fromJSON(d).evaluate(u);if(f!==void 0)return{op:"test",path:d,value:f.value}}function c(u,d){var f=new Array;return d.filter(r.isDestructive).forEach(function(h){var m=l(u,h.path);if(m&&f.push(m),"from"in h){var g=l(u,h.from);g&&f.push(g)}}),f}e.createTests=c})(m0);const SV="_root_w6lfx_1",jV="_removed_w6lfx_16",CV="_added_w6lfx_21",rm={root:SV,removed:jV,added:CV};function EV(e){const t=ae(),{original:n,revised:r}=e,[o,i]=p.useState(!1);p.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>i(!0)).catch(console.log)},[t,e.original.resourceType]);const a=p.useMemo(()=>{if(!o)return null;const l=[xo(n)],c=[xo(r)],u=[],d=TV(m0.createPatch(n,r));for(const f of d){const h=f.path,m=PV(h),g=kV(n.resourceType,m),v=f.op==="add"?void 0:Uc(m,l),S=f.op==="remove"?void 0:Uc(m,c);u.push({key:`op-${f.op}-${f.path}`,name:`${en(f.op)} ${m}`,path:(g==null?void 0:g.path)??n.resourceType+"."+m,property:g,originalValue:Hw(g,v),revisedValue:Hw(g,S)})}return u},[o,n,r]);return a?s.jsxs(fe,{className:rm.root,children:[s.jsx(fe.Thead,{children:s.jsxs(fe.Tr,{children:[s.jsx(fe.Th,{}),s.jsx(fe.Th,{children:"Before"}),s.jsx(fe.Th,{children:"After"})]})}),s.jsx(fe.Tbody,{children:a.map(l=>s.jsxs(fe.Tr,{children:[s.jsx(fe.Td,{children:l.name}),s.jsx(fe.Td,{className:rm.removed,children:l.originalValue&&s.jsx(Yr,{path:l.path,property:l.property,propertyType:l.originalValue.type,value:l.originalValue.value,ignoreMissingValues:!0})}),s.jsx(fe.Td,{className:rm.added,children:l.revisedValue&&s.jsx(Yr,{path:l.path,property:l.property,propertyType:l.revisedValue.type,value:l.revisedValue.value,ignoreMissingValues:!0})})]},l.key))})]}):null}function TV(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 i=e.filter(l=>l.op===r&&l.path===o).length,a={op:r,path:o};i>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(a.op="replace",a.path=o.replace(/\/[^/]+$/,"")),t.some(l=>l.op===a.op&&l.path===a.path)||t.push(a)}return t}function PV(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 kV(e,t){var r;const n=jl(e,{resourceType:"SearchParameter",base:[e],code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function Hw(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:RV(t,!!(e!=null&&e.isArray))}}function RV(e,t){const n=D6(e).flatMap(r=>r.value);return t?n:n[0]}function b0(e){const{profileUrl:t}=e,n=ae(),r=n.getAccessPolicy(),o=St(e.value),[i,a]=p.useState(!1);p.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{bl(t)?a(!0):console.error(`Schema not found for ${t}`)}).catch(c=>{console.error("Error in requestProfileSchema",c)});else{const c=o.resourceType;n.requestSchema(c).then(()=>{a(!0)}).catch(console.error)}},[n,t,o]);const l=p.useMemo(()=>o&&Nk(o,qx.READ,r),[r,o]);return!i||!o?null:s.jsx(Sf,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:l})}const _V="_item_5q6yx_1",DV="_itemPadding_5q6yx_5",Ww={item:_V,itemPadding:DV};function IV(e){return s.jsx(wu,{children:e.children})}function Is(e){var c,u;const{resource:t,profile:n,padding:r,popupMenuItems:o,...i}=e,a=n??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return s.jsxs(p0,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(te,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Hi,{value:a,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(he,{size:"sm",children:s.jsx(Tl,{c:"dark",fw:500,value:a,link:!0})}),s.jsxs(he,{size:"xs",children:[s.jsx(qe,{c:"dimmed",to:e.resource,children:$n(l)}),s.jsx(he,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(qe,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(Z,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(Z.Target,{children:s.jsx(Zt,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${ct(e.resource)}`,children:s.jsx(Rz,{})})}),o]})]}),s.jsx(tR,{children:s.jsx("div",{className:rt(Ww.item,{[Ww.itemPadding]:r}),children:e.children})})]})}function FR(e,t){e.sort((n,r)=>{const o=qw(n,t),i=qw(r,t);return o>i?1:o<i?-1:Gw(n,t)-Gw(r,t)})}function qw(e,t){if(!zR(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function Gw(e,t){var r;if(!zR(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=(r=e.meta)==null?void 0:r.lastUpdated;return n?new Date(n).getTime():0}function zR(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const AV="_pinnedComment_5uxzi_2",NV={pinnedComment:AV};function Qh(e){const t=ae(),n=t.getProfile(),r=p.useRef(null),o=St(e.value),[i,a]=p.useState(),[l,c]=p.useState([]),u=e.loadTimelineResources,d=p.useRef(l);d.current=l;const f=p.useCallback(b=>{FR(b,o),b.reverse(),c(b)},[o]),h=p.useCallback(b=>{const C=[];for(const j of b){if(j.status!=="fulfilled")continue;const T=j.value;if(T.type==="history"&&a(T),T.entry)for(const E of T.entry)C.push(E.resource)}f(C)},[f]),m=p.useCallback(b=>f([...d.current,b]),[f]),g=p.useCallback(()=>{var j;let b,C;"resourceType"in e.value?(b=e.value.resourceType,C=e.value.id):[b,C]=(j=e.value.reference)==null?void 0:j.split("/"),u(t,b,C).then(h).catch(console.error)},[t,e.value,u,h]);p.useEffect(()=>g(),[g]);function v(b){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,b)).then(C=>m(C)).catch(console.error)}function S(b){!o||!e.createMedia||t.createResource(e.createMedia(o,n,b)).then(C=>m(C)).then(()=>Jl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(Ks,{size:16}),autoClose:2e3})).catch(C=>Jl({id:"upload-notification",color:"red",title:"Upload error",message:Ie(C),icon:s.jsx(Aw,{size:16}),autoClose:2e3}))}function x(){pe({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function w(b){Jl({id:"upload-notification",loading:!0,title:"Uploading...",message:UV(b),autoClose:!1,withCloseButton:!1})}function y(b){Jl({id:"upload-notification",color:"red",title:"Upload error",message:Ie(b),icon:s.jsx(Aw,{size:16}),autoClose:2e3})}return o?s.jsxs(IV,{children:[e.createCommunication&&s.jsx(p0,{children:s.jsx(Qe,{testid:"timeline-form",onSubmit:b=>{v(b.text);const C=r.current;C&&(C.value="",C.focus())},children:s.jsxs(te,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Hi,{value:n}),s.jsx(xe,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(Zt,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(Lz,{size:16})}),s.jsx(a0,{securityContext:Tt(o),onUpload:S,onUploadStart:x,onUploadProgress:w,onUploadError:y,children:b=>s.jsx(Zt,{...b,radius:"xl",color:"blue",variant:"filled",children:s.jsx(Jx,{size:16})})})]})})}),l.map(b=>{var T;if(!b)return null;const C=`${b.resourceType}/${b.id}/${(T=b.meta)==null?void 0:T.versionId}`,j=e.getMenu?e.getMenu({primaryResource:o,currentResource:b,reloadTimeline:g}):void 0;if(b.resourceType===o.resourceType&&b.id===o.id)return s.jsx(MV,{history:i,resource:b,popupMenuItems:j},C);switch(b.resourceType){case"AuditEvent":return s.jsx(FV,{resource:b,popupMenuItems:j},C);case"Communication":return s.jsx(LV,{resource:b,popupMenuItems:j},C);case"DiagnosticReport":return s.jsx(zV,{resource:b,popupMenuItems:j},C);case"Media":return s.jsx($V,{resource:b,popupMenuItems:j},C);default:return s.jsx(Is,{resource:b,padding:!0,children:s.jsx(b0,{value:b,ignoreMissingValues:!0})},C)}})]}):s.jsx(vn,{style:{width:"100%",height:"100%"},children:s.jsx(tr,{})})}function MV(e){const{history:t,resource:n,...r}=e,o=OV(t,n);return o?s.jsx(Is,{resource:n,padding:!0,...r,children:s.jsx(EV,{original:o,revised:e.resource})}):s.jsxs(Is,{resource:n,padding:!0,...r,children:[s.jsx("h3",{children:"Created"}),s.jsx(b0,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function OV(e,t){const n=e.entry,r=n.findIndex(o=>{var i,a,l;return((a=(i=o.resource)==null?void 0:i.meta)==null?void 0:a.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function LV(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:NV.pinnedComment;return s.jsx(Is,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:s.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function $V(e){var r;const t=(r=e.resource.content)==null?void 0:r.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(Is,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:s.jsx(yu,{value:e.resource.content})})}function FV(e){return s.jsx(Is,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Rr,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function zV(e){return s.jsx(Is,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(h0,{value:e.resource})})}function UV(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${om(e.loaded)} / ${om(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${om(e.loaded)}`}function om(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 BV(e){const{resource:t,...n}=e;return s.jsx(Qh,{value:t,loadTimelineResources:async(r,o,i)=>{const a=`${o}/${i}`;return Promise.allSettled([r.readHistory(o,i),r.search("Task",{_filter:`based-on eq ${a} or focus eq ${a} or subject eq ${a}`,_count:100})])},...n})}function Me(e){const{children:t,...n}=e;return s.jsx(wu,{children:s.jsx(p0,{...n,children:t})})}function VV(e){const{encounter:t,...n}=e;return s.jsx(Qh,{value:t,loadTimelineResources:async(r,o,i)=>Promise.allSettled([r.readHistory("Encounter",i),r.search("Communication","encounter=Encounter/"+i),r.search("Media","encounter=Encounter/"+i)]),createCommunication:(r,o,i)=>({resourceType:"Communication",status:"completed",encounter:Tt(r),subject:r.subject,sender:Tt(o),sent:new Date().toISOString(),payload:[{contentString:i}]}),createMedia:(r,o,i)=>({resourceType:"Media",status:"completed",encounter:Tt(r),subject:r.subject,operator:Tt(o),issued:new Date().toISOString(),content:i}),...n})}function HV(e){let t;try{t=Sl(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 s.jsx(Yr,{value:t[0]||"",propertyType:e.propertyType})}function Ir(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Bi,{icon:s.jsx(Cl,{size:16}),color:"red",children:t.map(r=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:lk(r)},(o=r.details)==null?void 0:o.text)})})}function WV(e){return s.jsxs(mn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(q,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(Qw,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(Qw,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(he,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function Qw(e){return s.jsx(ie,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const qV={string:[oe.EQUALS,oe.NOT,oe.CONTAINS,oe.EXACT],fulltext:[oe.EQUALS,oe.NOT,oe.CONTAINS,oe.EXACT],token:[oe.EQUALS,oe.NOT],reference:[oe.EQUALS,oe.NOT],numeric:[oe.EQUALS,oe.NOT_EQUALS,oe.GREATER_THAN,oe.LESS_THAN,oe.GREATER_THAN_OR_EQUALS,oe.LESS_THAN_OR_EQUALS],quantity:[oe.EQUALS,oe.NOT_EQUALS,oe.GREATER_THAN,oe.LESS_THAN,oe.GREATER_THAN_OR_EQUALS,oe.LESS_THAN_OR_EQUALS],date:[oe.EQUALS,oe.NOT_EQUALS,oe.GREATER_THAN,oe.LESS_THAN,oe.GREATER_THAN_OR_EQUALS,oe.LESS_THAN_OR_EQUALS,oe.STARTS_AFTER,oe.ENDS_BEFORE,oe.APPROXIMATELY],datetime:[oe.EQUALS,oe.NOT_EQUALS,oe.GREATER_THAN,oe.LESS_THAN,oe.GREATER_THAN_OR_EQUALS,oe.LESS_THAN_OR_EQUALS,oe.STARTS_AFTER,oe.ENDS_BEFORE,oe.APPROXIMATELY]},GV={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",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 w0(e,t){return{...e,filters:t,offset:0,name:void 0}}function UR(e,t){return w0(e,(e.filters??[]).filter(n=>n.code!==t))}function Kh(e,t,n,r,o){const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),w0(e,i)}function QV(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function KV(e,t){return S0(e,t,-1)}function YV(e,t){return S0(e,t,0)}function XV(e,t){return S0(e,t,1)}function S0(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),C0(e,t,r,o)}function JV(e,t){return j0(e,t,-1)}function ZV(e,t){return j0(e,t,0)}function eH(e,t){return j0(e,t,1)}function j0(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),C0(e,t,r,o)}function tH(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),C0(e,t,n,new Date)}function C0(e,t,n,r){return e=UR(e,t),e=Kw(e,t,oe.GREATER_THAN_OR_EQUALS,n),e=Kw(e,t,oe.LESS_THAN_OR_EQUALS,r),e}function Kw(e,t,n,r){return Kh(e,t,n,r.toISOString())}function Yw(e,t,n=!0){return Kh(e,t,oe.MISSING,n.toString())}function nH(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function rH(e,t){const n=e.count??Fh,r=(t-1)*n;return nH(e,r)}function oH(e,t,n){return t===iH(e)&&n!==void 0&&n===sH(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function iH(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function sH(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function aH(e){return qV[e.type]}function E0(e){return GV[e]??""}function Oi(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(en).join(" "))}function lH(e,t){var r,o;const n=t.name;return n==="id"?e.id:n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?$n((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?cH(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?uH(e,t.searchParams[0]):null}function cH(e,t){var i,a,l;const n=((l=(a=(i=t.path)==null?void 0:i.split("."))==null?void 0:a.pop())==null?void 0:l.replaceAll("[x]",""))??"",[r,o]=xu({type:e.resourceType,value:e},n);return r?s.jsx(Yr,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function uH(e,t){const n=Uc(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,o)=>s.jsx(Yr,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function dH(e){const t=p.useRef(!1),[n,r]=p.useState({search:JSON.parse(fr(e.search))}),[o,i]=p.useState(!1);p.useEffect(()=>{r({search:e.search})},[e.search]);const a=p.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=fk(c),d=$x(c);return $c(fH(u,d)).map(f=>({value:f,label:Oi(f)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){r({search:{...n.search,fields:c}})}return s.jsx(mn,{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:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(Le,{children:[s.jsx(Ph,{style:{width:550},placeholder:"Select fields to display",data:a,value:n.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(te,{justify:"flex-end",children:s.jsx(ie,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function fH(e,t){const n=[],r=new Set,o=new Set;for(const i of Object.keys(e.elements))n.push(i),r.add(i.toLowerCase()),o.add(Oi(i));if(t)for(const i of Object.keys(t)){const a=Oi(i);!r.has(i)&&!o.has(a)&&(n.push(i),r.add(i),o.add(a))}return n}function BR(e){var o;const{resourceType:t,filter:n}=e,r=(o=bo.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===oe.EQUALS||n.operator===oe.NOT_EQUALS))return s.jsx(Tl,{value:{reference:n.value}});const i=jl(t,r);if(n.code==="_lastUpdated"||i.type===Po.DATETIME)return s.jsx(s.Fragment,{children:$n(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function VR(e){const t=jl(e.resourceType,e.searchParam),n="filter-value";switch(t.type){case Po.REFERENCE:return s.jsx(qh,{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 Po.BOOLEAN:return s.jsx(Rn,{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 Po.DATE:return s.jsx(xe,{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 Po.DATETIME:return s.jsx(_s,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Po.NUMBER:return s.jsx(xe,{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 Po.QUANTITY:return s.jsx(Ds,{name:n,path:"",defaultValue:hH(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx(xe,{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 hH(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function pH(e){const[t,n]=p.useState(JSON.parse(fr(e.search))),[r,o]=p.useState(-1),i=p.useRef(t);i.current=t,p.useEffect(()=>{n(JSON.parse(fr(e.search)))},[e.search]);function a(d){n(Kh(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=$x(l)??{},u=t.filters||[];return s.jsxs(mn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[s.jsx("div",{children:s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:120}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[u.map((d,f)=>f===r?s.jsx(Xw,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[f]=h,n(w0(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(mH,{resourceType:l,filter:d,onEdit:()=>o(f),onDelete:()=>n(QV(i.current,f))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(Xw,{resourceType:l,searchParams:c,okText:"Add",onOk:a})]})]})}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ie,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function mH(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:Oi(t.code)}),s.jsx("td",{children:E0(t.operator)}),s.jsx("td",{children:s.jsx(BR,{resourceType:e.resourceType,filter:t})}),s.jsxs("td",{children:[s.jsx(ie,{size:"compact-md",variant:"outline",onClick:e.onEdit,children:"Edit"}),s.jsx(ie,{size:"compact-md",variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function Xw(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useRef(t);r.current=t;function o(u){n({...r.current,code:u})}function i(u){n({...r.current,operator:u})}function a(u){n({...r.current,value:u})}const l=e.searchParams[t.code],c=l&&aH(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(It,{"data-testid":"filter-field",defaultValue:r.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:Oi(u)}))]})}),s.jsx("td",{children:c&&s.jsx(It,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:E0(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(VR,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:a})}),s.jsxs("td",{children:[t.code&&t.operator&&s.jsx(ie,{size:"compact-md",variant:"outline",onClick:()=>{e.onOk(r.current),n({})},children:e.okText}),e.onCancel&&s.jsx(ie,{size:"compact-md",variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function gH(e){const[t,n]=p.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return s.jsx(mn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(Qe,{onSubmit:r,children:s.jsxs(lr,{children:[s.jsx(lr.Col,{span:10,children:s.jsx(VR,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(lr.Col,{span:2,children:s.jsx(ie,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function vH(e){if(!e.searchParams)return null;function t(i,a){o(oH(e.search,i.code,a))}function n(i){o(UR(e.search,i.code))}function r(i,a){e.onPrompt(i,{code:i.code,operator:a,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?s.jsx(yH,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):s.jsx(Z.Dropdown,{children:e.searchParams.map(i=>s.jsx(Z.Item,{children:Oi(i.code)},i.code))})}function yH(e){switch(e.searchParam.type){case"date":return s.jsx(xH,{...e});case"number":case"quantity":return s.jsx(bH,{...e});case"reference":return s.jsx(wH,{...e});case"string":return s.jsx(SH,{...e});case"token":case"uri":return s.jsx(jH,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function xH(e){const{searchParam:t}=e,n=t.code;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(Zx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(Z.Item,{leftSection:s.jsx(e0,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(vu,{size:14}),onClick:()=>e.onPrompt(t,oe.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,oe.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(eR,{size:14}),onClick:()=>e.onPrompt(t,oe.ENDS_BEFORE),children:"Before..."}),s.jsx(Z.Item,{leftSection:s.jsx(Zk,{size:14}),onClick:()=>e.onPrompt(t,oe.STARTS_AFTER),children:"After..."}),s.jsx(Z.Item,{leftSection:s.jsx(bz,{size:14}),onClick:()=>e.onPrompt(t,oe.EQUALS),children:"Between..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(es,{size:14}),onClick:()=>e.onChange(XV(e.search,n)),children:"Tomorrow"}),s.jsx(Z.Item,{leftSection:s.jsx(es,{size:14}),onClick:()=>e.onChange(YV(e.search,n)),children:"Today"}),s.jsx(Z.Item,{leftSection:s.jsx(es,{size:14}),onClick:()=>e.onChange(KV(e.search,n)),children:"Yesterday"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(es,{size:14}),onClick:()=>e.onChange(eH(e.search,n)),children:"Next Month"}),s.jsx(Z.Item,{leftSection:s.jsx(es,{size:14}),onClick:()=>e.onChange(ZV(e.search,n)),children:"This Month"}),s.jsx(Z.Item,{leftSection:s.jsx(es,{size:14}),onClick:()=>e.onChange(JV(e.search,n)),children:"Last Month"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(es,{size:14}),onClick:()=>e.onChange(tH(e.search,n)),children:"Year to date"}),s.jsx(Su,{...e})]})}function bH(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(Zx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(Z.Item,{leftSection:s.jsx(e0,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(vu,{size:14}),onClick:()=>e.onPrompt(t,oe.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,oe.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(Zk,{size:14}),onClick:()=>e.onPrompt(t,oe.GREATER_THAN),children:"Greater than..."}),s.jsx(Z.Item,{leftSection:s.jsx(Og,{size:14}),onClick:()=>e.onPrompt(t,oe.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(Z.Item,{leftSection:s.jsx(eR,{size:14}),onClick:()=>e.onPrompt(t,oe.LESS_THAN),children:"Less than..."}),s.jsx(Z.Item,{leftSection:s.jsx(Og,{size:14}),onClick:()=>e.onPrompt(t,oe.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Su,{...e})]})}function wH(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(vu,{size:14}),onClick:()=>e.onPrompt(t,oe.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,oe.NOT),children:"Does not equal..."}),s.jsx(Su,{...e})]})}function SH(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(Zx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(Z.Item,{leftSection:s.jsx(e0,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(vu,{size:14}),onClick:()=>e.onPrompt(t,oe.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,oe.NOT),children:"Does not equal..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(jz,{size:14}),onClick:()=>e.onPrompt(t,oe.CONTAINS),children:"Contains..."}),s.jsx(Z.Item,{leftSection:s.jsx(Sz,{size:14}),onClick:()=>e.onPrompt(t,oe.EQUALS),children:"Does not contain..."}),s.jsx(Su,{...e})]})}function jH(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(vu,{size:14}),onClick:()=>e.onPrompt(t,oe.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,oe.NOT),children:"Does not equal..."}),s.jsx(Su,{...e})]})}function Su(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(yz,{size:14}),onClick:()=>e.onChange(Yw(e.search,n)),children:"Missing"}),s.jsx(Z.Item,{leftSection:s.jsx(vz,{size:14}),onClick:()=>e.onChange(Yw(e.search,n,!1)),children:"Not missing"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(bf,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const CH="_root_vlout_1",EH="_table_vlout_8",TH="_tr_vlout_12",PH="_th_vlout_18",kH="_control_vlout_22",RH="_icon_vlout_31",Hl={root:CH,table:EH,tr:TH,th:PH,control:kH,icon:RH};function _H(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(DH(t,r));return n}function DH(e,t){var o;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=Gs(e,t),r=Y6(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=$x(e);let a;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);a=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),a.length===0&&(a=void 0)}return{name:t,elementDefinition:n,searchParams:a}}if(r){const i=jl(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class IH extends Event{constructor(t){super("change"),this.definition=t}}class AH extends Event{constructor(t){super("load"),this.response=t}}class jf extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function ju(e){var z,H,D;const t=ae(),[n,r]=p.useState(),{search:o,onLoad:i}=e,[a,l]=p.useState(o);Ni(o,a)||l(o);const[c,u]=p.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),d=p.useRef(c);d.current=c;const f=a.total??"accurate",h=p.useCallback(k=>{r(void 0),t.requestSchema(a.resourceType).then(()=>t.search(a.resourceType,Ia({...a,total:f,fields:void 0}),k)).then(P=>{u({...d.current,searchResponse:P}),i&&i(new AH(P))}).catch(P=>{u({...d.current,searchResponse:void 0}),r(mt(P))})},[t,a,f,i]),m=p.useCallback(()=>{u({...d.current,searchResponse:void 0}),h({cache:"reload"})},[h]);p.useEffect(()=>{h()},[h]);function g(k,P){k.stopPropagation();const L=k.target.checked,$={...d.current.selected};L?$[P]=!0:delete $[P],u({...d.current,selected:$})}function v(k){k.stopPropagation();const I=k.target.checked,L={},$=d.current.searchResponse;I&&($!=null&&$.entry)&&$.entry.forEach(Q=>{var ue;(ue=Q.resource)!=null&&ue.id&&(L[Q.resource.id]=!0)}),u({...d.current,selected:L})}function S(){var P,I;const k=d.current;if(!((P=k.searchResponse)!=null&&P.entry)||k.searchResponse.entry.length===0)return!1;for(const L of k.searchResponse.entry)if((I=L.resource)!=null&&I.id&&!k.selected[L.resource.id])return!1;return!0}function x(k){e.onChange&&e.onChange(new IH(k))}function w(k,P){if(nR(k.target)||k.button===2)return;xt(k);const I=k.button===1||k.ctrlKey||k.metaKey;!I&&e.onClick&&e.onClick(new jf(P,k)),I&&e.onAuxClick&&e.onAuxClick(new jf(P,k))}function y(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return s.jsx(Ir,{outcome:n});if(!dk(a.resourceType))return s.jsx(vn,{style:{width:"100%",height:"100%"},children:s.jsx(tr,{})});const b=e.checkboxesEnabled,C=_H(a),j=a.resourceType,T=c.searchResponse,E=T==null?void 0:T.entry,R=E==null?void 0:E.map(k=>k.resource),_="subtle",N="gray",O=16,F=window.innerWidth<768;return s.jsxs("div",{className:Hl.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(te,{justify:"space-between",mb:"xl",children:[s.jsxs(te,{gap:2,children:[s.jsx(ie,{size:"compact-md",variant:_,color:N,leftSection:s.jsx(Tz,{size:O}),onClick:()=>u({...d.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(ie,{size:"compact-md",variant:_,color:N,leftSection:s.jsx(Dz,{size:O}),onClick:()=>u({...d.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(ie,{size:"compact-md",variant:_,color:N,leftSection:s.jsx(_z,{size:O}),onClick:e.onNew,children:"New..."}),!F&&y()&&s.jsx(ie,{size:"compact-md",variant:_,color:N,leftSection:s.jsx(Zz,{size:O}),onClick:e.onExport?e.onExport:()=>u({...d.current,exportDialogVisible:!0}),children:"Export..."}),!F&&e.onDelete&&s.jsx(ie,{size:"compact-md",variant:_,color:N,leftSection:s.jsx(t0,{size:O}),onClick:()=>e.onDelete(Object.keys(c.selected)),children:"Delete..."}),!F&&e.onBulk&&s.jsx(ie,{size:"compact-md",variant:_,color:N,leftSection:s.jsx(xz,{size:O}),onClick:()=>e.onBulk(Object.keys(c.selected)),children:"Bulk..."})]}),s.jsxs(te,{gap:2,children:[T&&s.jsxs(he,{size:"xs",c:"dimmed","data-testid":"count-display",children:[HR(a,T).toLocaleString(),"-",$H(a,T).toLocaleString(),T.total!==void 0&&` of ${a.total==="estimate"?"~":""}${(z=T.total)==null?void 0:z.toLocaleString()}`]}),s.jsx(Zt,{variant:_,color:N,title:"Refresh",onClick:m,children:s.jsx(Wz,{size:O})})]})]}),s.jsxs(fe,{className:Hl.table,children:[s.jsxs(fe.Thead,{children:[s.jsxs(fe.Tr,{children:[b&&s.jsx(fe.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:k=>v(k)})}),C.map(k=>s.jsx(fe.Th,{children:s.jsxs(Z,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(Z.Target,{children:s.jsx(Sn,{className:Hl.control,p:2,children:s.jsxs(te,{justify:"space-between",wrap:"nowrap",children:[s.jsx(he,{fw:500,children:Oi(k.name)}),s.jsx(vn,{className:Hl.icon,children:s.jsx(pz,{size:14,stroke:1.5})})]})})}),s.jsx(vH,{search:a,searchParams:k.searchParams,onPrompt:(P,I)=>{u({...d.current,filterDialogVisible:!0,filterDialogSearchParam:P,filterDialogFilter:I})},onChange:P=>{x(P)}})]})},k.name))]}),!e.hideFilters&&s.jsxs(fe.Tr,{children:[b&&s.jsx(fe.Th,{}),C.map(k=>s.jsx(fe.Th,{children:k.searchParams&&s.jsx(MH,{resourceType:j,searchParams:k.searchParams,filters:a.filters})},k.name))]})]}),s.jsx(fe.Tbody,{children:R==null?void 0:R.map(k=>k&&s.jsxs(fe.Tr,{className:Hl.tr,"data-testid":"search-control-row",onClick:P=>w(P,k),onAuxClick:P=>w(P,k),children:[b&&s.jsx(fe.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${k.id}`,checked:!!c.selected[k.id],onChange:P=>g(P,k.id)})}),C.map(P=>s.jsx(fe.Td,{children:lH(k,P)},P.name))]},k.id))})]}),(R==null?void 0:R.length)===0&&s.jsx(wu,{children:s.jsx(vn,{style:{height:150},children:s.jsx(he,{size:"xl",c:"dimmed",children:"No results"})})}),T&&s.jsx(vn,{m:"md",p:"md",children:s.jsx(Zr,{value:OH(a),total:LH(a,T),onChange:k=>x(rH(a,k)),getControlProps:k=>{switch(k){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),s.jsx(dH,{search:a,visible:d.current.fieldEditorVisible,onOk:k=>{x(k),u({...d.current,fieldEditorVisible:!1})},onCancel:()=>{u({...d.current,fieldEditorVisible:!1})}}),s.jsx(pH,{search:a,visible:d.current.filterEditorVisible,onOk:k=>{x(k),u({...d.current,filterEditorVisible:!1})},onCancel:()=>{u({...d.current,filterEditorVisible:!1})}}),s.jsx(WV,{visible:d.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{u({...d.current,exportDialogVisible:!1})}}),s.jsx(gH,{visible:d.current.filterDialogVisible,title:(H=c.filterDialogSearchParam)!=null&&H.code?Oi(c.filterDialogSearchParam.code):"",resourceType:j,searchParam:c.filterDialogSearchParam,filter:c.filterDialogFilter,defaultValue:"",onOk:k=>{x(Kh(a,k.code,k.operator,k.value)),u({...d.current,filterDialogVisible:!1})},onCancel:()=>{u({...d.current,filterDialogVisible:!1})}},(D=c.filterDialogSearchParam)==null?void 0:D.code)]})}const NH=ju;function MH(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(n=>s.jsxs("div",{children:[E0(n.operator)," ",s.jsx(BR,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function OH(e){return Math.floor((e.offset??0)/(e.count??Fh))+1}function LH(e,t){const n=e.count??Fh,r=WR(e,t);return Math.ceil(r/n)}function HR(e,t){return Math.min(WR(e,t),(e.offset??0)+1)}function $H(e,t){var n;return Math.max(HR(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function WR(e,t){var r,o;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((o=t.link)!=null&&o.some(i=>i.relation==="next")?1:0)),n}function FH(e){const t=ae(),[n,r]=p.useState(!1),[o,i]=p.useState(),{query:a,fields:l}=e,[c,u]=p.useState(),[d,f]=p.useState({}),h=p.useRef();h.current=c;const m=p.useRef({});m.current=d,p.useEffect(()=>{i(void 0),t.graphql(a).then(u).catch(y=>i(mt(y)))},[t,a]);function g(y,b){y.stopPropagation();const j=y.target.checked,T={...m.current};j?T[b]=!0:delete T[b],f(T)}function v(y){var E;y.stopPropagation();const C=y.target.checked,j={},T=(E=h.current)==null?void 0:E.data.ResourceList;C&&T&&T.forEach(R=>{R.id&&(j[R.id]=!0)}),f(j)}function S(){var b;const y=(b=h.current)==null?void 0:b.data.ResourceList;if(!y||y.length===0)return!1;for(const C of y)if(C.id&&!m.current[C.id])return!1;return!0}function x(y,b){nR(y.target)||(xt(y),y.button!==1&&e.onClick&&e.onClick(new jf(b,y)),y.button===1&&e.onAuxClick&&e.onAuxClick(new jf(b,y)))}if(p.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(tr,{});const w=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:y=>xt(y),"data-testid":"search-control",children:[s.jsxs(fe,{children:[s.jsx(fe.Thead,{children:s.jsxs(fe.Tr,{children:[w&&s.jsx(fe.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:y=>v(y)})}),l.map(y=>s.jsx(fe.Th,{children:y.name},y.name))]})}),s.jsx(fe.Tbody,{children:c==null?void 0:c.data.ResourceList.map(y=>y&&s.jsxs(fe.Tr,{"data-testid":"search-control-row",onClick:b=>x(b,y),onAuxClick:b=>x(b,y),children:[w&&s.jsx(fe.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${y.id}`,checked:!!d[y.id],onChange:b=>g(b,y.id)})}),l.map(b=>s.jsx(fe.Td,{children:s.jsx(HV,{propertyType:b.propertyType,path:b.fhirPath,resource:y})},b.name))]},y.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&s.jsx(ie,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const zH=p.memo(FH);function eo(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),s.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function UH(e){const{group:t}=e;return s.jsx(Jn,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(te,{children:[t.measureScore&&s.jsx(HH,{group:t}),!t.measureScore&&s.jsx(VH,{group:t})]})})}function BH(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(he,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(he,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function VH(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(c=>Mi(c.code)==="numerator"),o=n==null?void 0:n.find(c=>Mi(c.code)==="denominator"),i=r==null?void 0:r.count,a=o==null?void 0:o.count;if(a===0)return s.jsxs(q,{children:[s.jsx(ye,{order:3,children:"Not Applicable"}),s.jsx(he,{children:`Denominator: ${a}`})]});if(i===void 0||a===void 0)return s.jsxs(q,{children:[s.jsx(ye,{order:3,children:"Insufficient Data"}),s.jsx(he,{children:`Numerator: ${i}`}),s.jsx(he,{children:`Denominator: ${a}`})]});const l=i/a*100;return s.jsx(Nh,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:qR(l)}],label:s.jsx(Es,{justify:"center",children:s.jsxs(he,{fw:700,fz:18,children:[i," / ",a]})})})}function HH(e){var r,o,i;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((o=t.measureScore)==null?void 0:o.code);return s.jsx(s.Fragment,{children:n==="%"?s.jsx(Nh,{size:120,thickness:12,roundCaps:!0,sections:[{value:WH(t),color:qR(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(Es,{justify:"center",children:s.jsx(he,{fw:700,fz:18,children:s.jsx(Bc,{value:t.measureScore})})})}):s.jsx(Es,{h:120,align:"center",children:s.jsx(ye,{order:3,children:s.jsx(Bc,{value:t.measureScore})})})})}function WH(e){var r,o;const t=(r=e.measureScore)==null?void 0:r.value,n=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&n==="%"?t*100:t:0}function qR(e){return e<=33?"red":e<=67?"yellow":"green"}function qH(e){var r;const t=St(e.measureReport),[n]=az("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(q,{children:[n&&s.jsx(BH,{measure:n}),s.jsx(bx,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>s.jsx(UH,{group:o},o.id??i))})]}):null}function GH(e){const{patient:t,...n}=e,r=p.useCallback((o,i,a)=>{const l=`${i}/${a}`,c=100;return Promise.allSettled([o.readHistory("Patient",a),o.search("Communication",{subject:l,_count:c}),o.search("Device",{patient:l,_count:c}),o.search("DeviceRequest",{patient:l,_count:c}),o.search("DiagnosticReport",{subject:l,_count:c}),o.search("Media",{subject:l,_count:c}),o.search("ServiceRequest",{subject:l,_count:c}),o.search("Task",{subject:l,_count:c})])},[]);return s.jsx(Qh,{value:t,loadTimelineResources:r,createCommunication:(o,i,a)=>({resourceType:"Communication",status:"completed",subject:Tt(o),sender:Tt(i),sent:new Date().toISOString(),payload:[{contentString:a}]}),createMedia:(o,i,a)=>({resourceType:"Media",status:"completed",subject:Tt(o),operator:Tt(i),issued:new Date().toISOString(),content:a}),...n})}const QH="_section_14dzq_2",KH="_hovering_14dzq_11",YH="_editing_14dzq_15",XH="_bottomActions_14dzq_20",Aa={section:QH,hovering:KH,editing:YH,bottomActions:XH};function JH(e){const t=ae(),n=St(e.value),[r,o]=p.useState(!1),[i,a]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){c(void 0)}function h(){a(void 0)}const m=p.useRef();if(m.current=u,p.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(d(oW(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]),!r||!u)return null;function g(v,S){d({...m.current,[v]:S})}return s.jsx("div",{children:s.jsxs(Qe,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[s.jsx(xe,{label:"Plan Title",defaultValue:u.title,onChange:v=>g("title",v.currentTarget.value)}),s.jsx(GR,{actions:u.action||[],selectedKey:i,setSelectedKey:a,hoverKey:l,setHoverKey:c,onChange:v=>g("action",v)}),s.jsx(ie,{type:"submit",children:"Save"})]})})}function GR(e){const t=p.useRef();t.current=e.actions;function n(i){e.onChange(t.current.map(a=>a.id===i.id?i:a))}function r(i){e.onChange([...t.current,i]),e.setSelectedKey(i.id)}function o(i){e.onChange(t.current.filter(a=>a!==i))}return s.jsxs("div",{className:Aa.section,children:[e.actions.map(i=>s.jsx("div",{children:s.jsx(ZH,{action:i,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(i)})},i.id)),s.jsx("div",{className:Aa.bottomActions,children:s.jsx(Xe,{href:"#",onClick:i=>{xt(i),r({id:KR()})},children:"Add action"})})]})}function ZH(e){const{action:t}=e,n=rW(t),r=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function i(c){c.stopPropagation(),e.setSelectedKey(e.action.id)}function a(c){xt(c),e.setHoverKey(e.action.id)}const l=rt(Aa.section,{[Aa.editing]:r,[Aa.hovering]:o&&!r});return s.jsxs("div",{"data-testid":t.id,className:l,onClick:i,onMouseOver:a,onFocus:a,children:[r?s.jsx(tW,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx(eW,{action:t,actionType:n}),s.jsx("div",{className:Aa.bottomActions,children:s.jsx(Xe,{href:"#",onClick:c=>{c.preventDefault(),e.onRemove()},children:"Remove"})})]})}const Fg={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function eW(e){const{action:t,actionType:n}=e,[r,o]=QR(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(wf,{value:{reference:t.definitionCanonical}})}),r&&s.jsx("div",{children:s.jsx(Yr,{property:Fg,propertyType:o,value:r})})]})}function tW(e){const{action:t}=e,[n,r]=p.useState(e.actionType);function o(i,a){e.onChange({...t,[i]:a})}return s.jsxs(Le,{gap:"xl",children:[s.jsx(xe,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),s.jsx(xe,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),s.jsx(It,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:n,onChange:i=>r(i.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&s.jsx(GR,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:i=>o("action",i)}),(()=>{switch(n){case"appointment":return s.jsx(ad,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(ad,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(ad,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(ad,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(yt,{title:"Timing",description:"When the action should take place.",children:s.jsx(nW,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function ad(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(Ys,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:ct(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function nW(e){const t=e.action,n="timing",[r,o]=QR(t);return s.jsx(El,{property:Fg,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(i,a)=>{e.onChange(mR(t,n,a??n,Fg,i))},outcome:void 0})}function rW(e){var t,n,r;if((t=e.definitionCanonical)!=null&&t.startsWith("Schedule"))return"appointment";if((n=e.definitionCanonical)!=null&&n.startsWith("Questionnaire/"))return"questionnaire";if((r=e.definitionCanonical)!=null&&r.startsWith("ActivityDefinition/"))return"task"}function QR(e){return xu({type:"PlanDefinitionAction",value:e},"timing")}let im=1;function KR(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(im=Math.max(im,t+1))}return e}return"id-"+im++}function oW(e){return{...e,action:YR(e.action)}}function YR(e){if(e)return e.map(t=>({...t,id:KR(t.id),action:YR(t.action)}))}var Ct=(e=>(e.group="group",e.display="display",e.question="question",e.boolean="boolean",e.decimal="decimal",e.integer="integer",e.date="date",e.dateTime="dateTime",e.time="time",e.string="string",e.text="text",e.url="url",e.choice="choice",e.openChoice="open-choice",e.attachment="attachment",e.reference="reference",e.quantity="quantity",e))(Ct||{});function iW(e){return e.type==="choice"||e.type==="open-choice"}function sW(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=XR(t,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(o!=null&&o.length)){if(n==="any")return!0;continue}const{anyMatch:i,allMatch:a}=cW(r,o,n);if(n==="any"&&i)return!0;if(n==="all"&&!a)return!1}return n!=="any"}function aW(e,t,n){return e.map(r=>{var a;const o=(a=n.answerOption)==null?void 0:a.find(l=>qs(l.valueCoding)===r||l[t]===r),i=xn({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function XR(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=XR(n.item,t);if(r)return r}}}function lW(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:o}]=Uc(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function cW(e,t,n){const r=t||[],o=xn({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,a=!0;for(const l of r){const c=xn({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(lW(c,o,u)?i=!0:a=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:a}}function JR(e){var n,r;const t=wl(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(r=(n=t.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:r.map(o=>o.code)}}function sm(e,t){var o;const n=Kr(e);let r=wl(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(o=n.extension)==null?void 0:o.filter(i=>i!==r)),n):(r||(n.extension||(n.extension=[]),r={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(i=>({code:i}))},delete r.valueCode),n)}function uW(e,t,n){const r=wl(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(r!=null&&r.valueString))return;let o=r.valueString;t!=null&&t.reference&&(o=o.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(o=o.replaceAll("$encounter",n.reference));const i={},a=o.split("&");for(const l of a){const[c,u]=Rg(l,"=",2);i[c]=u}return i}function dW(e){return{resourceType:"QuestionnaireResponse",questionnaire:ct(e),item:ZR(e.item),status:"in-progress"}}function ZR(e){return(e==null?void 0:e.map(e2))??[]}function e2(e){var t;return{id:hW(),linkId:e.linkId,text:e.text,item:ZR(e.item),answer:((t=e.initial)==null?void 0:t.map(pW))??[]}}let fW=1;function hW(){return"id-"+fW++}function pW(e){return{...e}}function mW(e){return e.value.display||e.value.reference||fr(e.value)}function gW(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const a=wl(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(r=a==null?void 0:a.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}const t2=p.createContext({});function zg(e){const t=p.useContext(t2),n=e.item,r=e.response;function o(u){var f,h,m,g;let d;Array.isArray(u)?d=u:e.index>=(((h=(f=e.response)==null?void 0:f.answer)==null?void 0:h.length)??0)?d=(((m=e.response)==null?void 0:m.answer)??[]).concat([u]):d=(((g=e.response)==null?void 0:g.answer)??[]).map((S,x)=>x===e.index?u:S)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:d})}const i=n.type;if(!i)return null;const a=n.linkId;if(!a)return null;const l=n.initial&&n.initial.length>0?n.initial[0]:void 0,c=T0(r,e.index)??xn({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case Ct.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case Ct.boolean:return s.jsx(hR,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Rn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:c==null?void 0:c.value,onChange:u=>o({valueBoolean:u.currentTarget.checked})})},e.item.linkId);case Ct.decimal:return s.jsx(xe,{type:"number",step:"any",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDecimal:u.currentTarget.valueAsNumber})});case Ct.integer:return s.jsx(xe,{type:"number",step:1,id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueInteger:u.currentTarget.valueAsNumber})});case Ct.date:return s.jsx(xe,{type:"date",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case Ct.dateTime:return s.jsx(_s,{name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case Ct.time:return s.jsx(xe,{type:"time",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case Ct.string:case Ct.url:return s.jsx(xe,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case Ct.text:return s.jsx(Bs,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case Ct.attachment:return s.jsx(te,{py:4,children:s.jsx(iR,{path:"",name:a,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case Ct.reference:return s.jsx(qh,{name:a,required:n.required,targetTypes:JR(n),searchCriteria:uW(n,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case Ct.quantity:return s.jsx(Ds,{path:"",name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case Ct.choice:case Ct.openChoice:return SW(n)&&!n.answerValueSet?s.jsx(vW,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)}):s.jsx(yW,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)});default:return null}}function vW(e){var c;const{name:t,item:n,initial:r,response:o}=e;if(!((c=n.answerOption)!=null&&c.length))return s.jsx(n2,{});const i=xn({type:"QuestionnaireItemInitial",value:r},"value"),a=[""];for(const u of n.answerOption){const d=xn({type:"QuestionnaireItemAnswerOption",value:u},"value");a.push(Jw(d))}const l=T0(o)??i;if(n.repeats){const{propertyName:u,data:d}=jW(e.item),f=bW(o);return s.jsx(Ph,{data:d,placeholder:"Select items",searchable:!0,defaultValue:f||[Jw(i)],onChange:h=>{const m=aW(h,u,n);e.onChangeAnswer(m)}})}return s.jsx(It,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const f=n.answerOption[d-1],h=xn({type:"QuestionnaireItemAnswerOption",value:f},"value"),m="value"+en(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:qs(l==null?void 0:l.value)||(l==null?void 0:l.value),data:a})}function yW(e){var a;const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e;return!((a=n.answerOption)!=null&&a.length)&&!n.answerValueSet?s.jsx(n2,{}):n.answerValueSet?s.jsx(gR,{path:"",name:t,binding:n.answerValueSet,onChange:l=>o({valueCoding:l}),creatable:n.type===Ct.openChoice}):s.jsx(xW,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function xW(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,a=Gs("QuestionnaireItemAnswerOption","value[x]"),l=xn({type:"QuestionnaireItemInitial",value:r},"value"),c=[];let u;if(n.answerOption)for(let h=0;h<n.answerOption.length;h++){const m=n.answerOption[h],g=`${t}-option-${h}`,v=xn({type:"QuestionnaireItemAnswerOption",value:m},"value");v!=null&&v.value&&(l&&fr(v)===fr(l)&&(u=g),c.push([g,v]))}const d=T0(i),f=wW(c,d);return s.jsx(ks.Group,{name:t,value:f??u,onChange:h=>{const m=c.find(g=>g[0]===h);if(m){const g=m[1],v="value"+en(g.type);o({[v]:g.value})}},children:c.map(([h,m])=>s.jsx(ks,{id:h,value:h,py:4,label:s.jsx(Yr,{property:a,propertyType:m.type,value:m.value})},h))})}function n2(){return s.jsx(xe,{disabled:!0,placeholder:"No Answers Defined"})}function r2(e){return xn({type:"QuestionnaireItemAnswer",value:e},"value")}function T0(e,t=0){const n=e.answer;return r2((n==null?void 0:n[t])??{})}function bW(e){const t=e.answer;return t?t.map(r=>r2(r)).map(r=>qs(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function wW(e,t){var n;return(n=e.find(r=>Ni(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function Jw(e){if(e)return e.type==="CodeableConcept"?Mi(e.value):e.type==="Coding"?qs(e.value):e.type==="Reference"?mW(e):e.value.toString()}function SW(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,o,i;return n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="drop-down"}))}function jW(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=xn({type:"QuestionnaireItemAnswerOption",value:t},"value"),r="value"+en(n.type),o=(e.answerOption??[]).map(a=>({value:Zw(a,r),label:Zw(a,r)}));return{propertyName:r,data:o}}function Zw(e,t){var n;return qs(e.valueCoding)||((n=e[t])==null?void 0:n.toString())}const CW="_section_1gp92_1",EW="_hovering_1gp92_10",TW="_editing_1gp92_14",PW="_questionBody_1gp92_20",kW="_topActions_1gp92_24",RW="_bottomActions_1gp92_33",_W="_movementActions_1gp92_44",DW="_movementIcons_1gp92_56",IW="_columnAlignment_1gp92_60",AW="_linkIdInput_1gp92_65",NW="_typeSelect_1gp92_70",gr={section:CW,hovering:EW,editing:TW,questionBody:PW,topActions:kW,bottomActions:RW,movementActions:_W,movementIcons:DW,columnAlignment:IW,linkIdInput:AW,typeSelect:NW};function MW(e){const t=ae(),n=St(e.questionnaire),[r,o]=p.useState(!1),[i,a]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){d(void 0)}function h(){c(void 0)}p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(a(FW(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]);const m=(g,v)=>{a(g),e.autoSave&&!v&&e.onSubmit&&e.onSubmit(g)};return!r||!i?null:s.jsx("div",{children:s.jsxs(Qe,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[s.jsx(o2,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:m}),s.jsx(ie,{type:"submit",children:"Save"})]})})}function o2(e){var y;const t=e.item,n=e.item,r=ti(e.item),o=r||n.type===Ct.group,i=n.linkId??"[untitled]",a=e.selectedKey===e.item.id,l=e.hoverKey===e.item.id,c=p.useRef();c.current=e.item;function u(b){xt(b),e.setSelectedKey(e.item.id)}function d(b){xt(b),e.setHoverKey(e.item.id)}function f(b){var j;const C=c.current;e.onChange({...C,item:(j=C.item)==null?void 0:j.map(T=>T.id===b.id?b:T)})}function h(b,C){e.onChange({...e.item,item:[...e.item.item??[],b]},C)}function m(b){var C;e.onChange({...e.item,item:(C=e.item.item)==null?void 0:C.filter(j=>j!==b)})}function g(b,C){e.onChange({...c.current,[b]:C})}function v(b){e.onChange({...e.item,...b})}function S(b){var C;e.onChange({...e.item,item:(C=e.item.item)==null?void 0:C.map(j=>j===b?{...j,repeats:!j.repeats}:j)})}function x(b,C){const j=BW(e.item.item,b,C);e.onChange({...e.item,item:j})}const w=rt(gr.section,{[gr.editing]:a,[gr.hovering]:l&&!a});return s.jsxs("div",{"data-testid":n.linkId,className:w,onClick:u,onMouseOver:d,onFocus:d,children:[s.jsx("div",{className:gr.questionBody,children:a?s.jsxs(s.Fragment,{children:[r&&s.jsx(xe,{size:"xl",defaultValue:t.title,onBlur:b=>g("title",b.currentTarget.value)}),!r&&s.jsx(Bs,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:b=>g("text",b.currentTarget.value)}),n.type==="reference"&&s.jsx($W,{item:n,onChange:v}),iW(n)&&s.jsx(OW,{item:n,onChange:b=>v(b)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(ye,{children:t.title}),n.text&&s.jsx("div",{children:n.text}),!o&&s.jsx(zg,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(y=n.item)==null?void 0:y.map((b,C)=>s.jsx("div",{children:s.jsx(o2,{item:b,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:C===0,isLast:C===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:f,onRemove:()=>m(b),onRepeatable:S,onMoveUp:()=>x(C,-1),onMoveDown:()=>x(C,1)})},b.id)),!o&&s.jsx("div",{className:gr.topActions,children:a?s.jsxs(s.Fragment,{children:[s.jsx(xe,{size:"xs",className:gr.linkIdInput,defaultValue:n.linkId,onBlur:b=>g("linkId",b.currentTarget.value)}),!o&&s.jsx(It,{size:"xs",className:gr.typeSelect,defaultValue:n.type,onChange:b=>g("type",b.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"}]})]}):s.jsx("div",{children:i})}),!r&&s.jsx(q,{className:gr.movementActions,children:s.jsxs(q,{className:gr.columnAlignment,children:[!e.isFirst&&s.jsx(Xe,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(gz,{"data-testid":"up-button",size:15,className:gr.movementIcons})}),!e.isLast&&s.jsx(Xe,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(mz,{"data-testid":"down-button",size:15,className:gr.movementIcons})})]})}),s.jsxs("div",{className:gr.bottomActions,children:[o&&s.jsxs(s.Fragment,{children:[s.jsx(Xe,{href:"#",onClick:b=>{b.preventDefault(),h({id:As(),linkId:Vg("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Xe,{href:"#",onClick:b=>{b.preventDefault(),h({id:As(),linkId:Vg("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Xe,{href:"#",onClick:b=>{b.preventDefault(),h(UW(),!0)},children:"Add Page"}),a&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Xe,{href:"#",onClick:b=>{b.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Xe,{href:"#",onClick:b=>{b.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function OW(e){const t=Gs("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(xe,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(LW,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(q,{display:"flex",children:[s.jsx(Xe,{href:"#",onClick:r=>{xt(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:As()}]})},children:"Add choice"}),s.jsx(Mh,{w:"lg"}),s.jsx(Xe,{href:"#",onClick:r=>{xt(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function LW(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=xu({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(El,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,i)=>{const a=[...e.options],l=a.findIndex(c=>c.id===t.id);a[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:a})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Xe,{href:"#",onClick:o=>{xt(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function $W(e){const t=JR(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(te,{children:[s.jsx(i0,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(sm(e.item,t.map(i=>i===n?o:i)))}}),s.jsx(Xe,{href:"#",onClick:o=>{xt(o),e.onChange(sm(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Xe,{href:"#",onClick:n=>{xt(n),e.onChange(sm(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Ug=1,Bg=1;function Vg(e){return e+Ug++}function As(){return"id-"+Bg++}function FW(e){return{...e,id:e.id||As(),item:i2(e.item)}}function i2(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Bg=Math.max(Bg,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Ug=Math.max(Ug,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||As(),item:i2(t.item),answerOption:zW(t.answerOption)}))}function zW(e){if(e)return e.map(t=>({...t,id:t.id||As()}))}function UW(){return{id:As(),linkId:Vg("s"),type:"group",text:"New Page",extension:[{url:"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function BW(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const i=[...r];return[i[t],i[o]]=[i[o],i[t]],i}function s2(e){const{item:t,response:n,onChange:r}=e,[o,i]=p.useState(VW(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===Ct.display)return s.jsx("p",{children:t.text},t.linkId);const a=(t==null?void 0:t.repeats)&&t.type!==Ct.choice&&t.type!==Ct.openChoice;return t.type===Ct.boolean?s.jsx(zg,{item:t,response:n,onChange:l=>r([l]),index:0},t.linkId):s.jsxs(yt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx(zg,{item:t,response:n,onChange:u=>r([u]),index:c},`${t.linkId}-${c}`)),a&&s.jsx(Xe,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function VW(e,t){if(e.type===Ct.choice||e.type===Ct.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function a2(e){const[t,n]=p.useState(e.response);if(t.length===0)return null;function r(i,a){const l=t.map((c,u)=>u===a?i[0]:c);n(l),e.onChange(l)}function o(){const i=e2(e.item);n([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,a)=>s.jsx(l2,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>r(l,a)},i.id)),e.item.repeats&&s.jsx(Xe,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function l2(e){var i;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function o(a){var d;const l=(d=t.item)==null?void 0:d.map(f=>a.find(m=>m.id===f.id)??f),c=l==null?void 0:l.concat(a.slice(1)),u={...t,item:c};r([u])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(ye,{order:3,mb:"md",children:e.item.text}),s.jsx(Le,{children:(i=e.item.item)==null?void 0:i.map(a=>{var l,c,u;return a.type===Ct.group?a.repeats?s.jsx(a2,{item:a,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===a.linkId))??[],checkForQuestionEnabled:n,onChange:o},a.linkId):s.jsx(l2,{item:a,checkForQuestionEnabled:n,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===a.linkId))??{linkId:a.linkId},onChange:o},a.linkId):s.jsx(s2,{item:a,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===a.linkId),onChange:o,checkForQuestionEnabled:n},a.linkId)})})]},e.item.linkId):null}function HW(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:i,prevStep:a,numberOfPages:l,renderPages:c,submitButtonText:u,excludeButtons:d,checkForQuestionEnabled:f}=e,h=t.map(m=>{var S;const g=((S=n==null?void 0:n.item)==null?void 0:S.filter(x=>x.linkId===m.linkId))??[],v=m.type===Ct.group?s.jsx(a2,{item:m,response:g,onChange:o,checkForQuestionEnabled:f},m.linkId):s.jsx(s2,{item:m,response:g==null?void 0:g[0],onChange:o,checkForQuestionEnabled:f},m.linkId);return c?s.jsx(rl.Step,{label:m.text,children:v},m.linkId):v});return s.jsxs(s.Fragment,{children:[c&&s.jsx(rl,{active:r??0,allowNextStepsSelect:!1,p:6,children:h}),!c&&s.jsx(Le,{children:h}),!d&&s.jsx(WW,{activePage:r??0,numberOfPages:l,nextStep:c?i:void 0,prevStep:c?a:void 0,renderPages:c,submitButtonText:u})]})}function WW(e){const t=e.renderPages&&e.activePage>0,n=e.renderPages&&e.activePage<e.numberOfPages-1,r=!e.renderPages||e.activePage===e.numberOfPages-1;return s.jsxs(te,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&s.jsx(ie,{onClick:e.prevStep,children:"Back"}),n&&s.jsx(ie,{onClick:o=>{const i=o.currentTarget.closest("form");e.nextStep&&i.reportValidity()&&e.nextStep()},children:"Next"}),r&&s.jsx(ie,{type:"submit",children:e.submitButtonText??"Submit"})]})}function c2(e){const t=ae(),{subject:n,source:r}=e,o=St(e.questionnaire),[i,a]=p.useState(),[l,c]=p.useState(0),u=p.useRef(e.onChange);u.current=e.onChange;const d=p.useRef(e.onSubmit);d.current=e.onSubmit,p.useEffect(()=>{a(o?dW(o):void 0)},[o]);const f=p.useCallback(x=>{a(w=>{const y=(w==null?void 0:w.item)??[],C={resourceType:"QuestionnaireResponse",status:"in-progress",item:u2(y,Array.isArray(x)?x:[x])},j=u.current;if(j)try{j(C)}catch(T){console.error("Error invoking QuestionnaireForm.onChange callback",T)}return C})},[]),h=p.useCallback(()=>{const x=d.current;if(x&&i){let w=r;if(!w){const y=t.getProfile();y&&(w=Tt(y))}x({...i,questionnaire:ct(o),subject:n,source:w,authored:new Date().toISOString(),status:"completed"})}},[t,o,i,n,r]);function m(x){return sW(x,(i==null?void 0:i.item)??[])}if(!o||!i)return null;const g=gW(o),v=()=>c(x=>x+1),S=()=>c(x=>x-1);return s.jsx(t2.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(Qe,{testid:"questionnaire-form",onSubmit:h,children:[o.title&&s.jsx(ye,{children:o.title}),s.jsx(HW,{items:o.item??[],response:i,onChange:f,renderPages:!e.disablePagination&&g>1,activePage:l,numberOfPages:g,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:m,nextStep:v,prevStep:S})]})})}function qW(e,t){const n=u2(e.item??[],t.item??[]);return{...t,item:n.length>0?n:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function u2(e,t){const n=[],r=new Set;for(const o of e){const i=o.id,a=t.find(l=>l.id===i);a?(n.push(qW(o,a)),r.add(a.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}const GW="_section_4m5it_1",QW={section:GW},KW=["gender","age","gestationalAge","context","appliesTo","category"],YW={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function XW(e){e=Object.assign(YW,e);const t=e.definition,[n,r]=p.useState([]),[o,i]=p.useState(1),[a,l]=p.useState(1);return p.useEffect(()=>{const g=eq(t,l);r(tq(g.qualifiedInterval||[],i))},[t]),s.jsxs(Qe,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx(Le,{children:n.map(g=>{var v;return s.jsx(JW,{unit:rq((v=t.quantitativeDetails)==null?void 0:v.unit),onChange:f,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:g},`group-${g.id}`)})}),s.jsx(Zt,{title:"Add Group",variant:"subtle",size:"sm",onClick:g=>{xt(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(v=>v+1)},children:s.jsx(xf,{})}),s.jsx(te,{justify:"flex-end",children:s.jsx(ie,{type:"submit",children:"Save"})})]});function c(){const g=n.flatMap(v=>v.intervals).filter(v=>!oq(v));e.onSubmit({...t,qualifiedInterval:g})}function u(g){r(v=>[...v,g])}function d(g){r(v=>v.filter(S=>S.id!==g.id))}function f(g,v){r(S=>{S=[...S];const x=S.find(y=>y.id===g),w=x==null?void 0:x.intervals.findIndex(y=>y.id===v.id);return w!==void 0&&(x!=null&&x.intervals[w])&&(x.intervals[w]=v),S})}function h(g,v){v.id===void 0&&(v.id=`id-${a}`,l(S=>S+1)),r(S=>{S=[...S];const x=S.findIndex(w=>w.id===g);if(x!==-1){const w={...S[x]};v={...v,...w.filters},w.intervals=[...w.intervals,v],S[x]=w}return S})}function m(g,v){r(S=>{S=[...S];const x=S.find(w=>w.id===g);return x&&(x.intervals=x.intervals.filter(w=>w.id!==v.id)),S})}}function JW(e){const{intervalGroup:t,unit:n}=e;return s.jsx(wu,{"data-testid":t.id,className:QW.section,children:s.jsxs(Le,{gap:"lg",children:[s.jsx(te,{justify:"flex-end",children:s.jsx(Zt,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{xt(r),e.onRemoveGroup(t)},children:s.jsx(yf,{})},`remove-group-button-${t.id}`)}),s.jsx(ZW,{intervalGroup:t,onChange:e.onChange}),s.jsx(dn,{}),t.intervals.map(r=>s.jsxs(Le,{gap:"xs",children:[s.jsxs(te,{children:[s.jsx(xe,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{xt(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(Zt,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{xt(o),e.onRemove(t.id,r)},children:s.jsx(yf,{})},`remove-interval-${r.id}`)]}),s.jsx(c0,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(Zt,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{xt(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(xf,{})})]})})}function ZW(e){var r,o;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const i of["low","high"])(r=t.filters.age[i])!=null&&r.unit||(t.filters.age[i]={...t.filters.age[i],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(Le,{style:{maxWidth:"50%"},children:[s.jsx(te,{children:s.jsx(It,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),n(t.id,{...a,gender:l})}}})}),s.jsxs(te,{gap:"xs",children:[s.jsx(he,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(c0,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const a of t.intervals)n(t.id,{...a,age:i})}},`age-${t.id}`)})]}),s.jsx(It,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,n(t.id,{...a,context:void 0})):n(t.id,{...a,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(It,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const a of t.intervals){const l=i.currentTarget.value;l===""?n(t.id,{...a,category:void 0}):n(t.id,{...a,category:l})}}})]})}function eq(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{var a;const i=parseInt(((a=o.id)==null?void 0:a.substring(3))||"",10);return isNaN(i)?Number.NEGATIVE_INFINITY:i}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function tq(e,t){let n=1;const r={};for(const o of e){const i=nq(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(KW.map(a=>[a,o[a]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function nq(e){var n,r;return[`gender=${e.gender}`,`age=${Fc(e.age)}`,`gestationalAge=${Fc(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function rq(e){return e&&(_6(e,"http://unitsofmeasure.org")||e.text)}function oq(e){var t,n,r,o;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((o=(r=e.range)==null?void 0:r.high)==null?void 0:o.value)===void 0}function iq(e){var u;const t=ae(),n=St(e.value),[r,o]=p.useState(!1),[i,a]=p.useState();if(p.useEffect(()=>{n&&!r&&(t.executeBatch(l(n)).then(a).catch(console.log),o(!0))},[t,n,r]),!n||!i)return null;return s.jsx(lr,{children:(u=n.action)==null?void 0:u.map((d,f)=>{var v,S,x,w,y,b;const h=d.resource&&c(d.resource),m=(S=(v=h==null?void 0:h.input)==null?void 0:v[0])==null?void 0:S.valueReference,g=(w=(x=h==null?void 0:h.output)==null?void 0:x[0])==null?void 0:w.valueReference;return s.jsxs(p.Fragment,{children:[s.jsx(lr.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(Ez,{}):s.jsx(Yz,{color:"gray"})}),s.jsxs(lr.Col,{span:9,p:"xs",children:[s.jsx(he,{fw:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Tl,{value:(y=h==null?void 0:h.meta)==null?void 0:y.author})," on ",$n((b=h==null?void 0:h.meta)==null?void 0:b.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(f0,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(lr.Col,{span:2,p:"md",children:[m&&!g&&s.jsx(ie,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&g&&s.jsx(ie,{onClick:()=>e.onEdit(h,m,g),children:"Edit"})]})]},`action-${f}`)})});function l(d){var h;const f=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&f.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:f}}function c(d){for(const f of i==null?void 0:i.entry)if(f.resource&&d.reference===ct(f.resource))return f.resource}}function d2(e,t){const n=sq(e,t);return aq(n,e,t)}function sq(e,t){const n=e.length,r=t.length,o=n+r+1,i=1+2*o,a=i/2|0,l=new Array(i);l[a+1]={i:0,j:-1,prev:void 0,snake:!0};for(let c=0;c<o;c++){for(let u=-c;u<=c;u+=2){const d=a+u,f=d+1,h=d-1,m=l[f],g=l[h];let v,S=0;u===-c||u!==c&&g.i<m.i?(S=m.i,v=m):(S=g.i+1,v=g),l[h]=void 0;let x=S-u,w={i:S,j:x,prev:lq(v),snake:!1};for(;S<n&&x<r&&e[S]===t[x];)S++,x++;if(S>w.i&&(w={i:S,j:x,prev:w,snake:!0}),l[d]=w,S>=n&&x>=r)return l[d]}l[a+c-1]=void 0}}function aq(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const i=o.i,a=o.j;o=o.prev;const l=o.i,c=o.j,u={position:l,lines:t.slice(l,i)},d={position:c,lines:n.slice(c,a)};let f;u.lines.length===0&&d.lines.length>0?f="insert":u.lines.length>0&&d.lines.length===0?f="delete":f="change",r.push({original:u,revised:d,type:f}),o.snake&&(o=o.prev)}return r}function lq(e){return e&&!e.snake&&e.prev?e.prev:e}function cq(e){const t=e.entry.filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:fr(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.meta.lastUpdated)),n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return uq(n,t),dq(n),n}function uq(e,t){for(let n=1;n<t.length;n++){const r=d2(t[n-1].lines,t[n].lines);for(const o of r){const i=o.original.position,a=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,a.length),o.type==="insert"||o.type==="change")for(let c=0;c<o.revised.lines.length;c++)e.splice(i+c,0,{id:t[n].meta.versionId,meta:t[n].meta,value:l[c],span:1})}}}function dq(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 fq="_container_1oj0p_1",hq="_root_1oj0p_5",pq="_startRow_1oj0p_20",mq="_normalRow_1oj0p_24",gq="_author_1oj0p_28",vq="_dateTime_1oj0p_32",yq="_lineNumber_1oj0p_37",xq="_line_1oj0p_37",bq="_pre_1oj0p_52",Co={container:fq,root:hq,startRow:pq,normalRow:mq,author:gq,dateTime:vq,lineNumber:yq,line:xq,pre:bq};function wq(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function Sq(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return ma(n,"year");const r=Math.floor(t/2592e3);if(r>0)return ma(r,"month");const o=Math.floor(t/86400);if(o>0)return ma(o,"day");const i=Math.floor(t/3600);if(i>0)return ma(i,"hour");const a=Math.floor(t/60);return a>0?ma(a,"minute"):ma(t,"second")}function ma(e,t){return`${e} ${e===1?t:t+"s"} ago`}function jq(e){var a,l;const t=ae(),[n,r]=p.useState(e.history);if(p.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 s.jsx("div",{children:"Loading..."});const o=(l=(a=n.entry)==null?void 0:a[0])==null?void 0:l.resource;if(!o)return null;const i=cq(n);return s.jsx("div",{className:Co.container,children:s.jsx("table",{className:Co.root,children:s.jsx("tbody",{children:i.map((c,u)=>s.jsxs("tr",{className:c.span>0?Co.startRow:Co.normalRow,children:[c.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:Co.author,rowSpan:c.span,children:s.jsx(Ha,{value:c.meta.author,link:!0})}),s.jsx("td",{className:Co.dateTime,rowSpan:c.span,children:s.jsx(qe,{to:wq(o,c.meta.versionId),children:Sq(c.meta.lastUpdated)})})]}),s.jsx("td",{className:Co.lineNumber,children:u+1}),s.jsx("td",{className:Co.line,children:s.jsx("pre",{className:Co.pre,children:c.value})})]},"row-"+u))})})})}const Cq="_removed_mgz0k_2",Eq="_added_mgz0k_7",eS={removed:Cq,added:Eq};function Tq(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=fr(t,!0).match(/[^\r\n]+/g),o=fr(n,!0).match(/[^\r\n]+/g),i=d2(r,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((a,l)=>s.jsx(Pq,{delta:a},"delta"+l))})}function Pq(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:eS.removed,children:e.delta.original.lines.join(`
|
|
542
|
+
`)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:eS.added,children:e.delta.revised.lines.join(`
|
|
543
|
+
`)}),"...",s.jsx("br",{})]})}const kq="_splitButton_1i0gi_1",Rq="_menuControl_1i0gi_6",tS={splitButton:kq,menuControl:Rq};function Cf(e){const{outcome:t}=e,n=ae(),r=St(e.defaultValue),o=r==null?void 0:r.resourceType,[i,a]=p.useState(!1),[l,c]=p.useState(),u=n.getAccessPolicy(),d=At();p.useEffect(()=>{if(r)if(e.profileUrl){const m=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const g=bl(m);if(g){a(!0);const v=Y8(r,g);c(v)}else console.error(`Schema not found for ${m}`)}).catch(g=>{console.error("Error in requestProfileSchema",g)})}else n.requestSchema(o).then(()=>{c(r),a(!0)}).catch(console.log)},[n,r,o,e.profileUrl]);const f=p.useMemo(()=>r&&Nk(r,qx.READ,u),[u,r]),h=p.useMemo(()=>n.isSuperAdmin()||!u||!Ft(l==null?void 0:l.resourceType)?!0:n8(u,l==null?void 0:l.resourceType),[n,u,l==null?void 0:l.resourceType]);return!i||!l?s.jsx("div",{children:"Loading..."}):h?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:m=>{m.preventDefault(),e.onSubmit&&e.onSubmit(l)},children:[s.jsxs(Le,{mb:"xl",children:[s.jsx(yt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(xe,{name:"resourceType",defaultValue:l.resourceType,disabled:!0})}),s.jsx(yt,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(xe,{name:"id",defaultValue:l.id,disabled:!0})})]}),s.jsx(d0,{path:l.resourceType,valuePath:l.resourceType,typeName:o,defaultValue:l,outcome:t,onChange:c,profileUrl:e.profileUrl,accessPolicyResource:f}),s.jsxs(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[s.jsx(ie,{type:"submit",className:rt((e.onPatch||e.onDelete)&&tS.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&s.jsxs(Z,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[s.jsx(Z.Target,{children:s.jsx(Zt,{variant:"filled",color:d.primaryColor,size:36,className:tS.menuControl,"aria-label":"More actions",children:s.jsx(Xx,{size:14,stroke:1.5})})}),s.jsxs(Z.Dropdown,{children:[e.onPatch&&s.jsx(Z.Item,{leftSection:s.jsx(Jk,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(l)},children:"Patch"}),e.onDelete&&s.jsx(Z.Item,{color:"red",leftSection:s.jsx(t0,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(l)},children:"Delete"})]})]})]})]}):s.jsxs(Bi,{color:"red",title:"Permission denied",icon:s.jsx(Cl,{}),children:["Your access level prevents you from editing and creating ",l.resourceType," resources."]})}function _q(e){var o;const t=ae(),[n,r]=p.useState(e.history);return p.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?s.jsxs(fe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(fe.Thead,{children:s.jsxs(fe.Tr,{children:[s.jsx(fe.Th,{children:"Author"}),s.jsx(fe.Th,{children:"Date"}),s.jsx(fe.Th,{children:"Version"})]})}),s.jsx(fe.Tbody,{children:(o=n.entry)==null?void 0:o.map((i,a)=>s.jsx(Dq,{entry:i},"entry-"+a))})]}):s.jsx("div",{children:"Loading..."})}function Dq(e){var r,o,i;const{response:t,resource:n}=e.entry;return n?s.jsxs(fe.Tr,{children:[s.jsx(fe.Td,{children:s.jsx(Ha,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(fe.Td,{children:$n((o=n.meta)==null?void 0:o.lastUpdated)}),s.jsx(fe.Td,{children:s.jsx(qe,{to:Iq(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):s.jsx(fe.Tr,{children:s.jsx(fe.Td,{colSpan:3,children:Ie(t==null?void 0:t.outcome)})})}function Iq(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function Aq(e){const{serviceRequest:t,...n}=e;return s.jsx(Qh,{value:t,loadTimelineResources:async(r,o,i)=>{const a=`${o}/${i}`,l=100;return Promise.allSettled([r.readHistory("ServiceRequest",i),r.search("Communication",{"based-on":a,_count:l}),r.search("DiagnosticReport",{"based-on":a,_count:l}),r.search("Media",{"based-on":a,_count:l}),r.search("DocumentReference",{related:a,_count:l}),r.search("Task",{_filter:`based-on eq ${a} or focus eq ${a} or subject eq ${a}`,_count:l})])},createCommunication:(r,o,i)=>({resourceType:"Communication",status:"completed",basedOn:[Tt(r)],subject:r.subject,sender:Tt(o),sent:new Date().toISOString(),payload:[{contentString:i}]}),createMedia:(r,o,i)=>({resourceType:"Media",status:"completed",basedOn:[Tt(r)],subject:r.subject,operator:Tt(o),issued:new Date().toISOString(),content:i}),...n})}function Nq(e){const t=ae(),{client:n,patient:r,encounter:o,children:i,...a}=e;function l(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(c=>{const u=new URL(n.launchUri);u.searchParams.set("iss",t.getBaseUrl()+"fhir/R4"),u.searchParams.set("launch",c.id),window.location.assign(u.toString())}).catch(c=>pe({color:"red",message:Ie(c),autoClose:!1}))}return s.jsx(Xe,{onClick:()=>l(),...a,children:i})}function f2(e){const t=ae(),[n,r]=p.useState();return s.jsxs(Qe,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){r(mt(i))}},children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(eo,{size:32}),s.jsx(ye,{children:"Create project"})]}),s.jsxs(Le,{gap:"xl",children:[s.jsx(xe,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Ye(n,"projectName")}),s.jsxs(he,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Xe,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Xe,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ie,{type:"submit",children:"Create project"})})]})}function h2(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 p2(e){const t=ae(),{googleClientId:n,handleGoogleCredential:r}=e,o=p.useRef(null),[i,a]=p.useState(typeof google<"u"),[l,c]=p.useState(!1),[u,d]=p.useState(!1);return p.useEffect(()=>{if(typeof google>"u"){h2("https://accounts.google.com/gsi/client",()=>a(!0));return}l||(google.accounts.id.initialize({client_id:n,callback:r}),c(!0)),o.current&&!u&&(google.accounts.id.renderButton(o.current,{}),d(!0))},[t,n,l,i,o,u,r]),n?s.jsx("div",{ref:o}):null}function m2(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 g2(e){typeof grecaptcha>"u"&&h2("https://www.google.com/recaptcha/api.js?render="+e)}function v2(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function Mq(e){const t=m2(e.googleClientId),n=e.recaptchaSiteKey,r=ae(),[o,i]=p.useState(),a=bu(o,void 0);return p.useEffect(()=>{n&&g2(n)},[n]),s.jsxs(Qe,{onSubmit:async l=>{try{let c="";n&&(c=await v2(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:l.firstName,lastName:l.lastName,email:l.email,password:l.password,remember:l.remember==="true",recaptchaSiteKey:n,recaptchaToken:c}))}catch(c){i(mt(c))}},children:[s.jsx(vn,{style:{flexDirection:"column"},children:e.children}),s.jsx(Ir,{issues:a}),t&&s.jsxs(s.Fragment,{children:[s.jsx(te,{justify:"center",p:"xl",style:{height:70},children:s.jsx(p2,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,projectId:e.projectId,createUser:!0}))}catch(c){i(mt(c))}}})}),s.jsx(dn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(Le,{gap:"xl",children:[s.jsx(xe,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Ye(o,"firstName")}),s.jsx(xe,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Ye(o,"lastName")}),s.jsx(xe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Ye(o,"email")}),s.jsx(Wr,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Ye(o,"password")}),s.jsxs(he,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Xe,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Xe,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(he,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Xe,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Xe,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(te,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Rn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(ie,{type:"submit",children:"Create account"})]})]})}function Oq(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:a}=e,l=ae(),[c,u]=p.useState(),[d,f]=p.useState();p.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:n}).then(m=>l.processCode(m.code)).then(()=>a()).catch(m=>f(mt(m)))},[l,t,n,c,a]);function h(m){m.code?l.processCode(m.code).then(()=>a()).catch(console.log):m.login&&u(m.login)}return s.jsxs(Me,{width:450,children:[d&&s.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&s.jsx(Mq,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&s.jsx(f2,{login:c,handleAuthResponse:h})]})}function Lq(e){const[t,n]=p.useState();return t?s.jsx(Fq,{email:t,...e}):s.jsx($q,{setEmail:n,...e})}function $q(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...a}=e,l=ae(),c=!e.disableGoogleAuth&&m2(e.googleClientId),[u,d]=p.useState(),f=bu(u,void 0),h=p.useCallback(async v=>{if(!v.authorizeUrl)return!1;const S=JSON.stringify({...await l.ensureCodeChallenge(a),domain:v.domain}),x=new URL(v.authorizeUrl);return x.searchParams.set("state",S),window.location.assign(x.toString()),!0},[l,a]),m=p.useCallback(async v=>{const S=await l.post("auth/method",{email:v.email});await h(S)||t(v.email)},[l,h,t]),g=p.useCallback(async v=>{try{const S=await l.startGoogleLogin({...a,googleCredential:v.credential});await h(S)||r(S)}catch(S){d(mt(S))}},[l,a,h,r]);return s.jsxs(Qe,{onSubmit:m,children:[s.jsx(vn,{style:{flexDirection:"column"},children:o}),s.jsx(Ir,{issues:f}),c&&s.jsxs(s.Fragment,{children:[s.jsx(te,{justify:"center",p:"xl",style:{height:70},children:s.jsx(p2,{googleClientId:c,handleGoogleCredential:g})}),!i&&s.jsx(dn,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&s.jsx(xe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Ye(u,"email")}),s.jsxs(te,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Xe,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&s.jsx(ie,{type:"submit",children:"Next"})]})]})}function Fq(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=ae(),[a,l]=p.useState(),c=bu(a,void 0),u=p.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(n).catch(f=>l(mt(f)))},[i,o,n]);return s.jsxs(Qe,{onSubmit:u,children:[s.jsx(vn,{style:{flexDirection:"column"},children:r}),s.jsx(Ir,{issues:c}),s.jsx(Le,{gap:"xl",children:s.jsx(Wr,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Ye(a,"password")})}),s.jsxs(te,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Xe,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Rn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(ie,{type:"submit",children:"Sign in"})]})]})}function zq(e){const t=ae(),n=iu(),[r,o]=p.useState(""),[i,a]=p.useState();function l(f){var h;return!!((h=f==null?void 0:f.toLowerCase())!=null&&h.includes(r.toLowerCase()))}function c(f){var h,m;return l((h=f.profile)==null?void 0:h.display)||l((m=f.project)==null?void 0:m.display)}function u(f){t.post("auth/profile",{login:e.login,profile:f}).then(e.handleAuthResponse).catch(h=>a(mt(h)))}const d=e.memberships.filter(c).slice(0,10).map(f=>s.jsx(Oe.Option,{value:f.id,children:s.jsx(Uq,{...f})},f.id));return s.jsxs(Le,{children:[s.jsxs(Es,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(eo,{size:32}),s.jsx(ye,{order:3,children:"Choose profile"})]}),s.jsx(Ir,{outcome:i}),s.jsxs(Oe,{store:n,onOptionSubmit:u,children:[s.jsx(Oe.EventsTarget,{children:s.jsx(xe,{placeholder:"Search",value:r,onChange:f=>{o(f.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(Oe.Options,{children:d.length>0?d:s.jsx(Oe.Empty,{children:"Nothing found..."})})})]})]})}function Uq(e){var t,n;return s.jsxs(te,{children:[s.jsx(Ts,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(he,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(he,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}function Bq(e){const t=ae();return s.jsx(Qe,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(Le,{children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(eo,{size:32}),s.jsx(ye,{children:"Choose scope"})]}),s.jsx(Le,{children:(e.scope??"openid").split(" ").map(n=>s.jsx(Rn,{id:n,name:n,label:n,defaultChecked:!0},n))}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ie,{type:"submit",children:"Set scope"})})]})})}function Vq(e){const t=ae(),[n,r]=p.useState();return s.jsx(Qe,{onSubmit:o=>{r(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>r(Ie(i)))},children:s.jsxs(Le,{children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(eo,{size:32}),s.jsx(ye,{children:"Enter MFA code"})]}),n&&s.jsx(Bi,{icon:s.jsx(Cl,{size:16}),title:"Error",color:"red",children:n}),s.jsx(Le,{children:s.jsx(xe,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ie,{type:"submit",children:"Submit code"})})]})})}function y2(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:a,...l}=e,c=ae(),[u,d]=p.useState(),f=p.useRef(!1),[h,m]=p.useState(!1),[g,v]=p.useState(),S=p.useCallback(y=>{a?a(y):c.processCode(y).then(()=>{r&&r()}).catch(b=>pe({color:"red",message:Ie(b)}))},[c,a,r]),x=p.useCallback(y=>{m(!!y.mfaRequired),y.login&&d(y.login),y.memberships&&v(y.memberships),y.code&&(n?v(void 0):S(y.code))},[n,S]),w=p.useCallback(y=>{S(y.code)},[S]);return p.useEffect(()=>{t&&!f.current&&!u&&(f.current=!0,c.get("auth/login/"+t).then(x).catch(y=>pe({color:"red",message:Ie(y)})))},[c,t,f,u,x]),s.jsx(Me,{width:450,px:"sm",py:"md",children:u?h?s.jsx(Vq,{login:u,handleAuthResponse:x}):g?s.jsx(zq,{login:u,memberships:g,handleAuthResponse:x}):e.projectId==="new"?s.jsx(f2,{login:u,handleAuthResponse:x}):e.chooseScopes?s.jsx(Bq,{login:u,scope:e.scope,handleAuthResponse:w}):s.jsx("div",{children:"Success"}):s.jsx(Lq,{onForgotPassword:o,onRegister:i,handleAuthResponse:x,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var x2,nS=eu;x2=nS.createRoot,nS.hydrateRoot;/**
|
|
544
|
+
* @remix-run/router v1.20.0
|
|
545
|
+
*
|
|
546
|
+
* Copyright (c) Remix Software Inc.
|
|
547
|
+
*
|
|
548
|
+
* This source code is licensed under the MIT license found in the
|
|
549
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
550
|
+
*
|
|
551
|
+
* @license MIT
|
|
552
|
+
*/function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mt.apply(this,arguments)}var Qt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qt||(Qt={}));const rS="popstate";function Hq(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:a,hash:l}=r.location;return Hc("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Cu(o)}return qq(t,n,null,e)}function He(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function al(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Wq(){return Math.random().toString(36).substr(2,8)}function oS(e,t){return{usr:e.state,key:e.key,idx:t}}function Hc(e,t,n,r){return n===void 0&&(n=null),Mt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ni(t):t,{state:n,key:t&&t.key||r||Wq()})}function Cu(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ni(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function qq(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=Qt.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Mt({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){l=Qt.Pop;let S=d(),x=S==null?null:S-u;u=S,c&&c({action:l,location:v.location,delta:x})}function h(S,x){l=Qt.Push;let w=Hc(v.location,S,x);u=d()+1;let y=oS(w,u),b=v.createHref(w);try{a.pushState(y,"",b)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(b)}i&&c&&c({action:l,location:v.location,delta:1})}function m(S,x){l=Qt.Replace;let w=Hc(v.location,S,x);u=d();let y=oS(w,u),b=v.createHref(w);a.replaceState(y,"",b),i&&c&&c({action:l,location:v.location,delta:0})}function g(S){let x=o.location.origin!=="null"?o.location.origin:o.location.href,w=typeof S=="string"?S:Cu(S);return w=w.replace(/ $/,"%20"),He(x,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,x)}let v={get action(){return l},get location(){return e(o,a)},listen(S){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(rS,f),c=S,()=>{o.removeEventListener(rS,f),c=null}},createHref(S){return t(o,S)},createURL:g,encodeLocation(S){let x=g(S);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:m,go(S){return a.go(S)}};return v}var gt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gt||(gt={}));const Gq=new Set(["lazy","caseSensitive","path","id","index","children"]);function Qq(e){return e.index===!0}function Ef(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let a=[...n,String(i)],l=typeof o.id=="string"?o.id:a.join("-");if(He(o.index!==!0||!o.children,"Cannot specify children on an index route"),He(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),Qq(o)){let c=Mt({},o,t(o),{id:l});return r[l]=c,c}else{let c=Mt({},o,t(o),{id:l,children:void 0});return r[l]=c,o.children&&(c.children=Ef(o.children,t,a,r)),c}})}function as(e,t,n){return n===void 0&&(n="/"),_d(e,t,n,!1)}function _d(e,t,n,r){let o=typeof t=="string"?ni(t):t,i=Eu(o.pathname||"/",n);if(i==null)return null;let a=b2(e);Yq(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let u=aG(i);l=iG(a[c],u,r)}return l}function Kq(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function b2(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,a,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(He(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Ri([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(He(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),b2(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:rG(u,i.index),routesMeta:d})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let c of w2(i.path))o(i,a,c)}),t}function w2(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=w2(r.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Yq(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:oG(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Xq=/^:[\w-]+$/,Jq=3,Zq=2,eG=1,tG=10,nG=-2,iS=e=>e==="*";function rG(e,t){let n=e.split("/"),r=n.length;return n.some(iS)&&(r+=nG),t&&(r+=Zq),n.filter(o=>!iS(o)).reduce((o,i)=>o+(Xq.test(i)?Jq:i===""?eG:tG),r)}function oG(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 iG(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=sS({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=sS({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(o,f.params),a.push({params:o,pathname:Ri([i,f.pathname]),pathnameBase:uG(Ri([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=Ri([i,f.pathnameBase]))}return a}function sS(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=sG(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let v=l[f]||"";a=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[f];return m&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function sG(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),al(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,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function aG(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return al(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Eu(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 lG(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?ni(e):e;return{pathname:n?n.startsWith("/")?n:cG(n,t):t,search:dG(r),hash:fG(o)}}function cG(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 am(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 S2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function j2(e,t){let n=S2(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function C2(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=ni(e):(o=Mt({},e),He(!o.pathname||!o.pathname.includes("?"),am("?","pathname","search",o)),He(!o.pathname||!o.pathname.includes("#"),am("#","pathname","hash",o)),He(!o.search||!o.search.includes("#"),am("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(a==null)l=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=lG(o,l),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Ri=e=>e.join("/").replace(/\/\/+/g,"/"),uG=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),dG=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fG=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Tf{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Yh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const E2=["post","put","patch","delete"],hG=new Set(E2),pG=["get",...E2],mG=new Set(pG),gG=new Set([301,302,303,307,308]),vG=new Set([307,308]),lm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yG={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Wl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},P0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xG=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),T2="remix-router-transitions";function bG(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",r=!n;He(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let A=e.detectErrorBoundary;o=M=>({hasErrorBoundary:A(M)})}else o=xG;let i={},a=Ef(e.routes,o,void 0,i),l,c=e.basename||"/",u=e.dataStrategy||CG,d=e.patchRoutesOnNavigation,f=Mt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,m=new Set,g=null,v=null,S=null,x=e.hydrationData!=null,w=as(a,e.history.location,c),y=null;if(w==null&&!d){let A=Wn(404,{pathname:e.history.location.pathname}),{matches:M,route:U}=vS(a);w=M,y={[U.id]:A}}w&&!e.hydrationData&&ta(w,a,e.history.location.pathname).active&&(w=null);let b;if(w)if(w.some(A=>A.route.lazy))b=!1;else if(!w.some(A=>A.route.loader))b=!0;else if(f.v7_partialHydration){let A=e.hydrationData?e.hydrationData.loaderData:null,M=e.hydrationData?e.hydrationData.errors:null;if(M){let U=w.findIndex(K=>M[K.route.id]!==void 0);b=w.slice(0,U+1).every(K=>!Wg(K.route,A,M))}else b=w.every(U=>!Wg(U.route,A,M))}else b=e.hydrationData!=null;else if(b=!1,w=[],f.v7_partialHydration){let A=ta(null,a,e.history.location.pathname);A.active&&A.matches&&(w=A.matches)}let C,j={historyAction:e.history.action,location:e.history.location,matches:w,initialized:b,navigation:lm,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||y,fetchers:new Map,blockers:new Map},T=Qt.Pop,E=!1,R,_=!1,N=new Map,O=null,F=!1,z=!1,H=[],D=new Set,k=new Map,P=0,I=-1,L=new Map,$=new Set,Q=new Map,ue=new Map,Re=new Set,me=new Map,ge=new Map,De;function le(){if(h=e.history.listen(A=>{let{action:M,location:U,delta:K}=A;if(De){De(),De=void 0;return}al(ge.size===0||K!=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=kl({currentLocation:j.location,nextLocation:U,historyAction:M});if(ve&&K!=null){let _e=new Promise($e=>{De=$e});e.history.go(K*-1),ea(ve,{state:"blocked",location:U,proceed(){ea(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),_e.then(()=>e.history.go(K))},reset(){let $e=new Map(j.blockers);$e.set(ve,Wl),Ue({blockers:$e})}});return}return Ze(M,U)}),n){$G(t,N);let A=()=>FG(t,N);t.addEventListener("pagehide",A),O=()=>t.removeEventListener("pagehide",A)}return j.initialized||Ze(Qt.Pop,j.location,{initialHydration:!0}),C}function Ae(){h&&h(),O&&O(),m.clear(),R&&R.abort(),j.fetchers.forEach((A,M)=>ln(M)),j.blockers.forEach((A,M)=>Zs(M))}function it(A){return m.add(A),()=>m.delete(A)}function Ue(A,M){M===void 0&&(M={}),j=Mt({},j,A);let U=[],K=[];f.v7_fetcherPersist&&j.fetchers.forEach((ve,_e)=>{ve.state==="idle"&&(Re.has(_e)?K.push(_e):U.push(_e))}),[...m].forEach(ve=>ve(j,{deletedFetchers:K,viewTransitionOpts:M.viewTransitionOpts,flushSync:M.flushSync===!0})),f.v7_fetcherPersist&&(U.forEach(ve=>j.fetchers.delete(ve)),K.forEach(ve=>ln(ve)))}function Je(A,M,U){var K,ve;let{flushSync:_e}=U===void 0?{}:U,$e=j.actionData!=null&&j.navigation.formMethod!=null&&Fr(j.navigation.formMethod)&&j.navigation.state==="loading"&&((K=A.state)==null?void 0:K._isRedirect)!==!0,be;M.actionData?Object.keys(M.actionData).length>0?be=M.actionData:be=null:$e?be=j.actionData:be=null;let je=M.loaderData?mS(j.loaderData,M.loaderData,M.matches||[],M.errors):j.loaderData,re=j.blockers;re.size>0&&(re=new Map(re),re.forEach((Ge,rn)=>re.set(rn,Wl)));let Pe=E===!0||j.navigation.formMethod!=null&&Fr(j.navigation.formMethod)&&((ve=A.state)==null?void 0:ve._isRedirect)!==!0;l&&(a=l,l=void 0),F||T===Qt.Pop||(T===Qt.Push?e.history.push(A,A.state):T===Qt.Replace&&e.history.replace(A,A.state));let Ve;if(T===Qt.Pop){let Ge=N.get(j.location.pathname);Ge&&Ge.has(A.pathname)?Ve={currentLocation:j.location,nextLocation:A}:N.has(A.pathname)&&(Ve={currentLocation:A,nextLocation:j.location})}else if(_){let Ge=N.get(j.location.pathname);Ge?Ge.add(A.pathname):(Ge=new Set([A.pathname]),N.set(j.location.pathname,Ge)),Ve={currentLocation:j.location,nextLocation:A}}Ue(Mt({},M,{actionData:be,loaderData:je,historyAction:T,location:A,initialized:!0,navigation:lm,revalidation:"idle",restoreScrollPosition:ip(A,M.matches||j.matches),preventScrollReset:Pe,blockers:re}),{viewTransitionOpts:Ve,flushSync:_e===!0}),T=Qt.Pop,E=!1,_=!1,F=!1,z=!1,H=[]}async function st(A,M){if(typeof A=="number"){e.history.go(A);return}let U=Hg(j.location,j.matches,c,f.v7_prependBasename,A,f.v7_relativeSplatPath,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:K,submission:ve,error:_e}=aS(f.v7_normalizeFormMethod,!1,U,M),$e=j.location,be=Hc(j.location,K,M&&M.state);be=Mt({},be,e.history.encodeLocation(be));let je=M&&M.replace!=null?M.replace:void 0,re=Qt.Push;je===!0?re=Qt.Replace:je===!1||ve!=null&&Fr(ve.formMethod)&&ve.formAction===j.location.pathname+j.location.search&&(re=Qt.Replace);let Pe=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,Ve=(M&&M.flushSync)===!0,Ge=kl({currentLocation:$e,nextLocation:be,historyAction:re});if(Ge){ea(Ge,{state:"blocked",location:be,proceed(){ea(Ge,{state:"proceeding",proceed:void 0,reset:void 0,location:be}),st(A,M)},reset(){let rn=new Map(j.blockers);rn.set(Ge,Wl),Ue({blockers:rn})}});return}return await Ze(re,be,{submission:ve,pendingError:_e,preventScrollReset:Pe,replace:M&&M.replace,enableViewTransition:M&&M.viewTransition,flushSync:Ve})}function Be(){if(Pt(),Ue({revalidation:"loading"}),j.navigation.state!=="submitting"){if(j.navigation.state==="idle"){Ze(j.historyAction,j.location,{startUninterruptedRevalidation:!0});return}Ze(T||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:_===!0})}}async function Ze(A,M,U){R&&R.abort(),R=null,T=A,F=(U&&U.startUninterruptedRevalidation)===!0,op(j.location,j.matches),E=(U&&U.preventScrollReset)===!0,_=(U&&U.enableViewTransition)===!0;let K=l||a,ve=U&&U.overrideNavigation,_e=as(K,M,c),$e=(U&&U.flushSync)===!0,be=ta(_e,K,M.pathname);if(be.active&&be.matches&&(_e=be.matches),!_e){let{error:jt,notFoundMatches:ot,route:Bt}=Qi(M.pathname);Je(M,{matches:ot,loaderData:{},errors:{[Bt.id]:jt}},{flushSync:$e});return}if(j.initialized&&!z&&_G(j.location,M)&&!(U&&U.submission&&Fr(U.submission.formMethod))){Je(M,{matches:_e},{flushSync:$e});return}R=new AbortController;let je=ga(e.history,M,R.signal,U&&U.submission),re;if(U&&U.pendingError)re=[ls(_e).route.id,{type:gt.error,error:U.pendingError}];else if(U&&U.submission&&Fr(U.submission.formMethod)){let jt=await at(je,M,U.submission,_e,be.active,{replace:U.replace,flushSync:$e});if(jt.shortCircuited)return;if(jt.pendingActionResult){let[ot,Bt]=jt.pendingActionResult;if(sr(Bt)&&Yh(Bt.error)&&Bt.error.status===404){R=null,Je(M,{matches:jt.matches,loaderData:{},errors:{[ot]:Bt.error}});return}}_e=jt.matches||_e,re=jt.pendingActionResult,ve=cm(M,U.submission),$e=!1,be.active=!1,je=ga(e.history,je.url,je.signal)}let{shortCircuited:Pe,matches:Ve,loaderData:Ge,errors:rn}=await ne(je,M,_e,be.active,ve,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,$e,re);Pe||(R=null,Je(M,Mt({matches:Ve||_e},gS(re),{loaderData:Ge,errors:rn})))}async function at(A,M,U,K,ve,_e){_e===void 0&&(_e={}),Pt();let $e=OG(M,U);if(Ue({navigation:$e},{flushSync:_e.flushSync===!0}),ve){let re=await na(K,M.pathname,A.signal);if(re.type==="aborted")return{shortCircuited:!0};if(re.type==="error"){let Pe=ls(re.partialMatches).route.id;return{matches:re.partialMatches,pendingActionResult:[Pe,{type:gt.error,error:re.error}]}}else if(re.matches)K=re.matches;else{let{notFoundMatches:Pe,error:Ve,route:Ge}=Qi(M.pathname);return{matches:Pe,pendingActionResult:[Ge.id,{type:gt.error,error:Ve}]}}}let be,je=ec(K,M);if(!je.route.action&&!je.route.lazy)be={type:gt.error,error:Wn(405,{method:A.method,pathname:M.pathname,routeId:je.route.id})};else if(be=(await Se("action",j,A,[je],K,null))[je.route.id],A.signal.aborted)return{shortCircuited:!0};if(ms(be)){let re;return _e&&_e.replace!=null?re=_e.replace:re=fS(be.response.headers.get("Location"),new URL(A.url),c)===j.location.pathname+j.location.search,await G(A,be,!0,{submission:U,replace:re}),{shortCircuited:!0}}if(bi(be))throw Wn(400,{type:"defer-action"});if(sr(be)){let re=ls(K,je.route.id);return(_e&&_e.replace)!==!0&&(T=Qt.Push),{matches:K,pendingActionResult:[re.route.id,be]}}return{matches:K,pendingActionResult:[je.route.id,be]}}async function ne(A,M,U,K,ve,_e,$e,be,je,re,Pe){let Ve=ve||cm(M,_e),Ge=_e||$e||xS(Ve),rn=!F&&(!f.v7_partialHydration||!je);if(K){if(rn){let Vt=X(Pe);Ue(Mt({navigation:Ve},Vt!==void 0?{actionData:Vt}:{}),{flushSync:re})}let nt=await na(U,M.pathname,A.signal);if(nt.type==="aborted")return{shortCircuited:!0};if(nt.type==="error"){let Vt=ls(nt.partialMatches).route.id;return{matches:nt.partialMatches,loaderData:{},errors:{[Vt]:nt.error}}}else if(nt.matches)U=nt.matches;else{let{error:Vt,notFoundMatches:oa,route:Dl}=Qi(M.pathname);return{matches:oa,loaderData:{},errors:{[Dl.id]:Vt}}}}let jt=l||a,[ot,Bt]=cS(e.history,j,U,Ge,M,f.v7_partialHydration&&je===!0,f.v7_skipActionErrorRevalidation,z,H,D,Re,Q,$,jt,c,Pe);if(Ki(nt=>!(U&&U.some(Vt=>Vt.route.id===nt))||ot&&ot.some(Vt=>Vt.route.id===nt)),I=++P,ot.length===0&&Bt.length===0){let nt=ku();return Je(M,Mt({matches:U,loaderData:{},errors:Pe&&sr(Pe[1])?{[Pe[0]]:Pe[1].error}:null},gS(Pe),nt?{fetchers:new Map(j.fetchers)}:{}),{flushSync:re}),{shortCircuited:!0}}if(rn){let nt={};if(!K){nt.navigation=Ve;let Vt=X(Pe);Vt!==void 0&&(nt.actionData=Vt)}Bt.length>0&&(nt.fetchers=ce(Bt)),Ue(nt,{flushSync:re})}Bt.forEach(nt=>{Vn(nt.key),nt.controller&&k.set(nt.key,nt.controller)});let ra=()=>Bt.forEach(nt=>Vn(nt.key));R&&R.signal.addEventListener("abort",ra);let{loaderResults:Rl,fetcherResults:So}=await We(j,U,ot,Bt,A);if(A.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",ra),Bt.forEach(nt=>k.delete(nt.key));let no=ld(Rl);if(no)return await G(A,no.result,!0,{replace:be}),{shortCircuited:!0};if(no=ld(So),no)return $.add(no.key),await G(A,no.result,!0,{replace:be}),{shortCircuited:!0};let{loaderData:sp,errors:_l}=pS(j,U,Rl,Pe,Bt,So,me);me.forEach((nt,Vt)=>{nt.subscribe(oa=>{(oa||nt.done)&&me.delete(Vt)})}),f.v7_partialHydration&&je&&j.errors&&(_l=Mt({},j.errors,_l));let Xi=ku(),_u=Ru(I),Du=Xi||_u||Bt.length>0;return Mt({matches:U,loaderData:sp,errors:_l},Du?{fetchers:new Map(j.fetchers)}:{})}function X(A){if(A&&!sr(A[1]))return{[A[0]]:A[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function ce(A){return A.forEach(M=>{let U=j.fetchers.get(M.key),K=ql(void 0,U?U.data:void 0);j.fetchers.set(M.key,K)}),new Map(j.fetchers)}function ke(A,M,U,K){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Vn(A);let ve=(K&&K.flushSync)===!0,_e=l||a,$e=Hg(j.location,j.matches,c,f.v7_prependBasename,U,f.v7_relativeSplatPath,M,K==null?void 0:K.relative),be=as(_e,$e,c),je=ta(be,_e,$e);if(je.active&&je.matches&&(be=je.matches),!be){Nt(A,M,Wn(404,{pathname:$e}),{flushSync:ve});return}let{path:re,submission:Pe,error:Ve}=aS(f.v7_normalizeFormMethod,!0,$e,K);if(Ve){Nt(A,M,Ve,{flushSync:ve});return}let Ge=ec(be,re),rn=(K&&K.preventScrollReset)===!0;if(Pe&&Fr(Pe.formMethod)){J(A,M,re,Ge,be,je.active,ve,rn,Pe);return}Q.set(A,{routeId:M,path:re}),se(A,M,re,Ge,be,je.active,ve,rn,Pe)}async function J(A,M,U,K,ve,_e,$e,be,je){Pt(),Q.delete(A);function re(Xt){if(!Xt.route.action&&!Xt.route.lazy){let ia=Wn(405,{method:je.formMethod,pathname:U,routeId:M});return Nt(A,M,ia,{flushSync:$e}),!0}return!1}if(!_e&&re(K))return;let Pe=j.fetchers.get(A);lt(A,LG(je,Pe),{flushSync:$e});let Ve=new AbortController,Ge=ga(e.history,U,Ve.signal,je);if(_e){let Xt=await na(ve,U,Ge.signal);if(Xt.type==="aborted")return;if(Xt.type==="error"){Nt(A,M,Xt.error,{flushSync:$e});return}else if(Xt.matches){if(ve=Xt.matches,K=ec(ve,U),re(K))return}else{Nt(A,M,Wn(404,{pathname:U}),{flushSync:$e});return}}k.set(A,Ve);let rn=P,ot=(await Se("action",j,Ge,[K],ve,A))[K.route.id];if(Ge.signal.aborted){k.get(A)===Ve&&k.delete(A);return}if(f.v7_fetcherPersist&&Re.has(A)){if(ms(ot)||sr(ot)){lt(A,ai(void 0));return}}else{if(ms(ot))if(k.delete(A),I>rn){lt(A,ai(void 0));return}else return $.add(A),lt(A,ql(je)),G(Ge,ot,!1,{fetcherSubmission:je,preventScrollReset:be});if(sr(ot)){Nt(A,M,ot.error);return}}if(bi(ot))throw Wn(400,{type:"defer-action"});let Bt=j.navigation.location||j.location,ra=ga(e.history,Bt,Ve.signal),Rl=l||a,So=j.navigation.state!=="idle"?as(Rl,j.navigation.location,c):j.matches;He(So,"Didn't find any matches after fetcher action");let no=++P;L.set(A,no);let sp=ql(je,ot.data);j.fetchers.set(A,sp);let[_l,Xi]=cS(e.history,j,So,je,Bt,!1,f.v7_skipActionErrorRevalidation,z,H,D,Re,Q,$,Rl,c,[K.route.id,ot]);Xi.filter(Xt=>Xt.key!==A).forEach(Xt=>{let ia=Xt.key,L0=j.fetchers.get(ia),n_=ql(void 0,L0?L0.data:void 0);j.fetchers.set(ia,n_),Vn(ia),Xt.controller&&k.set(ia,Xt.controller)}),Ue({fetchers:new Map(j.fetchers)});let _u=()=>Xi.forEach(Xt=>Vn(Xt.key));Ve.signal.addEventListener("abort",_u);let{loaderResults:Du,fetcherResults:nt}=await We(j,So,_l,Xi,ra);if(Ve.signal.aborted)return;Ve.signal.removeEventListener("abort",_u),L.delete(A),k.delete(A),Xi.forEach(Xt=>k.delete(Xt.key));let Vt=ld(Du);if(Vt)return G(ra,Vt.result,!1,{preventScrollReset:be});if(Vt=ld(nt),Vt)return $.add(Vt.key),G(ra,Vt.result,!1,{preventScrollReset:be});let{loaderData:oa,errors:Dl}=pS(j,So,Du,void 0,Xi,nt,me);if(j.fetchers.has(A)){let Xt=ai(ot.data);j.fetchers.set(A,Xt)}Ru(no),j.navigation.state==="loading"&&no>I?(He(T,"Expected pending action"),R&&R.abort(),Je(j.navigation.location,{matches:So,loaderData:oa,errors:Dl,fetchers:new Map(j.fetchers)})):(Ue({errors:Dl,loaderData:mS(j.loaderData,oa,So,Dl),fetchers:new Map(j.fetchers)}),z=!1)}async function se(A,M,U,K,ve,_e,$e,be,je){let re=j.fetchers.get(A);lt(A,ql(je,re?re.data:void 0),{flushSync:$e});let Pe=new AbortController,Ve=ga(e.history,U,Pe.signal);if(_e){let ot=await na(ve,U,Ve.signal);if(ot.type==="aborted")return;if(ot.type==="error"){Nt(A,M,ot.error,{flushSync:$e});return}else if(ot.matches)ve=ot.matches,K=ec(ve,U);else{Nt(A,M,Wn(404,{pathname:U}),{flushSync:$e});return}}k.set(A,Pe);let Ge=P,jt=(await Se("loader",j,Ve,[K],ve,A))[K.route.id];if(bi(jt)&&(jt=await k0(jt,Ve.signal,!0)||jt),k.get(A)===Pe&&k.delete(A),!Ve.signal.aborted){if(Re.has(A)){lt(A,ai(void 0));return}if(ms(jt))if(I>Ge){lt(A,ai(void 0));return}else{$.add(A),await G(Ve,jt,!1,{preventScrollReset:be});return}if(sr(jt)){Nt(A,M,jt.error);return}He(!bi(jt),"Unhandled fetcher deferred data"),lt(A,ai(jt.data))}}async function G(A,M,U,K){let{submission:ve,fetcherSubmission:_e,preventScrollReset:$e,replace:be}=K===void 0?{}:K;M.response.headers.has("X-Remix-Revalidate")&&(z=!0);let je=M.response.headers.get("Location");He(je,"Expected a Location header on the redirect Response"),je=fS(je,new URL(A.url),c);let re=Hc(j.location,je,{_isRedirect:!0});if(n){let ot=!1;if(M.response.headers.has("X-Remix-Reload-Document"))ot=!0;else if(P0.test(je)){const Bt=e.history.createURL(je);ot=Bt.origin!==t.location.origin||Eu(Bt.pathname,c)==null}if(ot){be?t.location.replace(je):t.location.assign(je);return}}R=null;let Pe=be===!0||M.response.headers.has("X-Remix-Replace")?Qt.Replace:Qt.Push,{formMethod:Ve,formAction:Ge,formEncType:rn}=j.navigation;!ve&&!_e&&Ve&&Ge&&rn&&(ve=xS(j.navigation));let jt=ve||_e;if(vG.has(M.response.status)&&jt&&Fr(jt.formMethod))await Ze(Pe,re,{submission:Mt({},jt,{formAction:je}),preventScrollReset:$e||E,enableViewTransition:U?_:void 0});else{let ot=cm(re,ve);await Ze(Pe,re,{overrideNavigation:ot,fetcherSubmission:_e,preventScrollReset:$e||E,enableViewTransition:U?_:void 0})}}async function Se(A,M,U,K,ve,_e){let $e,be={};try{$e=await EG(u,A,M,U,K,ve,_e,i,o)}catch(je){return K.forEach(re=>{be[re.route.id]={type:gt.error,error:je}}),be}for(let[je,re]of Object.entries($e))if(DG(re)){let Pe=re.result;be[je]={type:gt.redirect,response:kG(Pe,U,je,ve,c,f.v7_relativeSplatPath)}}else be[je]=await PG(re);return be}async function We(A,M,U,K,ve){let _e=A.matches,$e=Se("loader",A,ve,U,M,null),be=Promise.all(K.map(async Pe=>{if(Pe.matches&&Pe.match&&Pe.controller){let Ge=(await Se("loader",A,ga(e.history,Pe.path,Pe.controller.signal),[Pe.match],Pe.matches,Pe.key))[Pe.match.route.id];return{[Pe.key]:Ge}}else return Promise.resolve({[Pe.key]:{type:gt.error,error:Wn(404,{pathname:Pe.path})}})})),je=await $e,re=(await be).reduce((Pe,Ve)=>Object.assign(Pe,Ve),{});return await Promise.all([NG(M,je,ve.signal,_e,A.loaderData),MG(M,re,K)]),{loaderResults:je,fetcherResults:re}}function Pt(){z=!0,H.push(...Ki()),Q.forEach((A,M)=>{k.has(M)&&D.add(M),Vn(M)})}function lt(A,M,U){U===void 0&&(U={}),j.fetchers.set(A,M),Ue({fetchers:new Map(j.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Nt(A,M,U,K){K===void 0&&(K={});let ve=ls(j.matches,M);ln(A),Ue({errors:{[ve.route.id]:U},fetchers:new Map(j.fetchers)},{flushSync:(K&&K.flushSync)===!0})}function nn(A){return f.v7_fetcherPersist&&(ue.set(A,(ue.get(A)||0)+1),Re.has(A)&&Re.delete(A)),j.fetchers.get(A)||yG}function ln(A){let M=j.fetchers.get(A);k.has(A)&&!(M&&M.state==="loading"&&L.has(A))&&Vn(A),Q.delete(A),L.delete(A),$.delete(A),Re.delete(A),D.delete(A),j.fetchers.delete(A)}function to(A){if(f.v7_fetcherPersist){let M=(ue.get(A)||0)-1;M<=0?(ue.delete(A),Re.add(A)):ue.set(A,M)}else ln(A);Ue({fetchers:new Map(j.fetchers)})}function Vn(A){let M=k.get(A);M&&(M.abort(),k.delete(A))}function Js(A){for(let M of A){let U=nn(M),K=ai(U.data);j.fetchers.set(M,K)}}function ku(){let A=[],M=!1;for(let U of $){let K=j.fetchers.get(U);He(K,"Expected fetcher: "+U),K.state==="loading"&&($.delete(U),A.push(U),M=!0)}return Js(A),M}function Ru(A){let M=[];for(let[U,K]of L)if(K<A){let ve=j.fetchers.get(U);He(ve,"Expected fetcher: "+U),ve.state==="loading"&&(Vn(U),L.delete(U),M.push(U))}return Js(M),M.length>0}function Ar(A,M){let U=j.blockers.get(A)||Wl;return ge.get(A)!==M&&ge.set(A,M),U}function Zs(A){j.blockers.delete(A),ge.delete(A)}function ea(A,M){let U=j.blockers.get(A)||Wl;He(U.state==="unblocked"&&M.state==="blocked"||U.state==="blocked"&&M.state==="blocked"||U.state==="blocked"&&M.state==="proceeding"||U.state==="blocked"&&M.state==="unblocked"||U.state==="proceeding"&&M.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+M.state);let K=new Map(j.blockers);K.set(A,M),Ue({blockers:K})}function kl(A){let{currentLocation:M,nextLocation:U,historyAction:K}=A;if(ge.size===0)return;ge.size>1&&al(!1,"A router only supports one blocker at a time");let ve=Array.from(ge.entries()),[_e,$e]=ve[ve.length-1],be=j.blockers.get(_e);if(!(be&&be.state==="proceeding")&&$e({currentLocation:M,nextLocation:U,historyAction:K}))return _e}function Qi(A){let M=Wn(404,{pathname:A}),U=l||a,{matches:K,route:ve}=vS(U);return Ki(),{notFoundMatches:K,route:ve,error:M}}function Ki(A){let M=[];return me.forEach((U,K)=>{(!A||A(K))&&(U.cancel(),M.push(K),me.delete(K))}),M}function oi(A,M,U){if(g=A,S=M,v=U||null,!x&&j.navigation===lm){x=!0;let K=ip(j.location,j.matches);K!=null&&Ue({restoreScrollPosition:K})}return()=>{g=null,S=null,v=null}}function Dn(A,M){return v&&v(A,M.map(K=>Kq(K,j.loaderData)))||A.key}function op(A,M){if(g&&S){let U=Dn(A,M);g[U]=S()}}function ip(A,M){if(g){let U=Dn(A,M),K=g[U];if(typeof K=="number")return K}return null}function ta(A,M,U){if(d)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:_d(M,U,c,!0)}}else return{active:!0,matches:_d(M,U,c,!0)||[]};return{active:!1,matches:null}}async function na(A,M,U){if(!d)return{type:"success",matches:A};let K=A;for(;;){let ve=l==null,_e=l||a,$e=i;try{await d({path:M,matches:K,patch:(re,Pe)=>{U.aborted||dS(re,Pe,_e,$e,o)}})}catch(re){return{type:"error",error:re,partialMatches:K}}finally{ve&&!U.aborted&&(a=[...a])}if(U.aborted)return{type:"aborted"};let be=as(_e,M,c);if(be)return{type:"success",matches:be};let je=_d(_e,M,c,!0);if(!je||K.length===je.length&&K.every((re,Pe)=>re.route.id===je[Pe].route.id))return{type:"success",matches:null};K=je}}function cn(A){i={},l=Ef(A,o,void 0,i)}function Yi(A,M){let U=l==null;dS(A,M,l||a,i,o),U&&(a=[...a],Ue({}))}return C={get basename(){return c},get future(){return f},get state(){return j},get routes(){return a},get window(){return t},initialize:le,subscribe:it,enableScrollRestoration:oi,navigate:st,fetch:ke,revalidate:Be,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:nn,deleteFetcher:to,dispose:Ae,getBlocker:Ar,deleteBlocker:Zs,patchRoutes:Yi,_internalFetchControllers:k,_internalActiveDeferreds:me,_internalSetRoutes:cn},C}function wG(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Hg(e,t,n,r,o,i,a,l){let c,u;if(a){c=[];for(let f of t)if(c.push(f),f.route.id===a){u=f;break}}else c=t,u=t[t.length-1];let d=C2(o||".",j2(c,i),Eu(e.pathname,n)||e.pathname,l==="path");if(o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u){let f=R0(d.search);if(u.route.index&&!f)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&f){let h=new URLSearchParams(d.search),m=h.getAll("index");h.delete("index"),m.filter(v=>v).forEach(v=>h.append("index",v));let g=h.toString();d.search=g?"?"+g:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Ri([n,d.pathname])),Cu(d)}function aS(e,t,n,r){if(!r||!wG(r))return{path:n};if(r.formMethod&&!AG(r.formMethod))return{path:n,error:Wn(405,{method:r.formMethod})};let o=()=>({path:n,error:Wn(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=R2(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Fr(a))return o();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,g)=>{let[v,S]=g;return""+m+v+"="+S+`
|
|
553
|
+
`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Fr(a))return o();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}He(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=qg(r.formData),u=r.formData;else if(r.body instanceof FormData)c=qg(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=hS(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=hS(c)}catch{return o()}let d={formMethod:a,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Fr(d.formMethod))return{path:n,submission:d};let f=ni(n);return t&&f.search&&R0(f.search)&&c.append("index",""),f.search="?"+c,{path:Cu(f),submission:d}}function lS(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(o=>o.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function cS(e,t,n,r,o,i,a,l,c,u,d,f,h,m,g,v){let S=v?sr(v[1])?v[1].error:v[1].data:void 0,x=e.createURL(t.location),w=e.createURL(o),y=n;i&&t.errors?y=lS(n,Object.keys(t.errors)[0],!0):v&&sr(v[1])&&(y=lS(n,v[0]));let b=v?v[1].statusCode:void 0,C=a&&b&&b>=400,j=y.filter((E,R)=>{let{route:_}=E;if(_.lazy)return!0;if(_.loader==null)return!1;if(i)return Wg(_,t.loaderData,t.errors);if(SG(t.loaderData,t.matches[R],E)||c.some(F=>F===E.route.id))return!0;let N=t.matches[R],O=E;return uS(E,Mt({currentUrl:x,currentParams:N.params,nextUrl:w,nextParams:O.params},r,{actionResult:S,actionStatus:b,defaultShouldRevalidate:C?!1:l||x.pathname+x.search===w.pathname+w.search||x.search!==w.search||P2(N,O)}))}),T=[];return f.forEach((E,R)=>{if(i||!n.some(z=>z.route.id===E.routeId)||d.has(R))return;let _=as(m,E.path,g);if(!_){T.push({key:R,routeId:E.routeId,path:E.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(R),O=ec(_,E.path),F=!1;h.has(R)?F=!1:u.has(R)?(u.delete(R),F=!0):N&&N.state!=="idle"&&N.data===void 0?F=l:F=uS(O,Mt({currentUrl:x,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:n[n.length-1].params},r,{actionResult:S,actionStatus:b,defaultShouldRevalidate:C?!1:l})),F&&T.push({key:R,routeId:E.routeId,path:E.path,matches:_,match:O,controller:new AbortController})}),[j,T]}function Wg(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function SG(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function P2(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function uS(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function dS(e,t,n,r,o){var i;let a;if(e){let u=r[e];He(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),a=u.children}else a=n;let l=t.filter(u=>!a.some(d=>k2(u,d))),c=Ef(l,o,[e||"_","patch",String(((i=a)==null?void 0:i.length)||"0")],r);a.push(...c)}function k2(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)=>{var o;return(o=t.children)==null?void 0:o.some(i=>k2(n,i))}):!1}async function jG(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];He(o,"No route found in manifest");let i={};for(let a in r){let c=o[a]!==void 0&&a!=="hasErrorBoundary";al(!c,'Route "'+o.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!c&&!Gq.has(a)&&(i[a]=r[a])}Object.assign(o,i),Object.assign(o,Mt({},t(o),{lazy:void 0}))}async function CG(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,i,a)=>Object.assign(o,{[n[a].route.id]:i}),{})}async function EG(e,t,n,r,o,i,a,l,c,u){let d=i.map(m=>m.route.lazy?jG(m.route,c,l):void 0),f=i.map((m,g)=>{let v=d[g],S=o.some(w=>w.route.id===m.route.id);return Mt({},m,{shouldLoad:S,resolve:async w=>(w&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(S=!0),S?TG(t,r,m,v,w,u):Promise.resolve({type:gt.data,result:void 0}))})}),h=await e({matches:f,request:r,params:i[0].params,fetcherKey:a,context:u});try{await Promise.all(d)}catch{}return h}async function TG(e,t,n,r,o,i){let a,l,c=u=>{let d,f=new Promise((g,v)=>d=v);l=()=>d(),t.signal.addEventListener("abort",l);let h=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:i},...g!==void 0?[g]:[]),m=(async()=>{try{return{type:"data",result:await(o?o(v=>h(v)):h())}}catch(g){return{type:"error",result:g}}})();return Promise.race([m,f])};try{let u=n.route[e];if(r)if(u){let d,[f]=await Promise.all([c(u).catch(h=>{d=h}),r]);if(d!==void 0)throw d;a=f}else if(await r,u=n.route[e],u)a=await c(u);else if(e==="action"){let d=new URL(t.url),f=d.pathname+d.search;throw Wn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:gt.data,result:void 0};else if(u)a=await c(u);else{let d=new URL(t.url),f=d.pathname+d.search;throw Wn(404,{pathname:f})}He(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:gt.error,result:u}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function PG(e){let{result:t,type:n}=e;if(_2(t)){let u;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(d){return{type:gt.error,error:d}}return n===gt.error?{type:gt.error,error:new Tf(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:gt.data,data:u,statusCode:t.status,headers:t.headers}}if(n===gt.error){if(yS(t)){var r;if(t.data instanceof Error){var o;return{type:gt.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new Tf(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:gt.error,error:t,statusCode:Yh(t)?t.status:void 0}}if(IG(t)){var i,a;return{type:gt.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(yS(t)){var l,c;return{type:gt.data,data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}}return{type:gt.data,data:t}}function kG(e,t,n,r,o,i){let a=e.headers.get("Location");if(He(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!P0.test(a)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=Hg(new URL(t.url),l,o,!0,a,i),e.headers.set("Location",a)}return e}function fS(e,t,n){if(P0.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=Eu(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function ga(e,t,n,r){let o=e.createURL(R2(t)).toString(),i={signal:n};if(r&&Fr(r.formMethod)){let{formMethod:a,formEncType:l}=r;i.method=a.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(r.json)):l==="text/plain"?i.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?i.body=qg(r.formData):i.body=r.formData}return new Request(o,i)}function qg(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function hS(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function RG(e,t,n,r,o){let i={},a=null,l,c=!1,u={},d=n&&sr(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,m=t[h];if(He(!ms(m),"Cannot handle redirect results in processLoaderData"),sr(m)){let g=m.error;d!==void 0&&(g=d,d=void 0),a=a||{};{let v=ls(e,h);a[v.route.id]==null&&(a[v.route.id]=g)}i[h]=void 0,c||(c=!0,l=Yh(m.error)?m.error.status:500),m.headers&&(u[h]=m.headers)}else bi(m)?(r.set(h,m.deferredData),i[h]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!c&&(l=m.statusCode),m.headers&&(u[h]=m.headers)):(i[h]=m.data,m.statusCode&&m.statusCode!==200&&!c&&(l=m.statusCode),m.headers&&(u[h]=m.headers))}),d!==void 0&&n&&(a={[n[0]]:d},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:u}}function pS(e,t,n,r,o,i,a){let{loaderData:l,errors:c}=RG(t,n,r,a);return o.forEach(u=>{let{key:d,match:f,controller:h}=u,m=i[d];if(He(m,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(sr(m)){let g=ls(e.matches,f==null?void 0:f.route.id);c&&c[g.route.id]||(c=Mt({},c,{[g.route.id]:m.error})),e.fetchers.delete(d)}else if(ms(m))He(!1,"Unhandled fetcher revalidation redirect");else if(bi(m))He(!1,"Unhandled fetcher deferred data");else{let g=ai(m.data);e.fetchers.set(d,g)}}),{loaderData:l,errors:c}}function mS(e,t,n,r){let o=Mt({},t);for(let i of n){let a=i.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(o[a]=t[a]):e[a]!==void 0&&i.route.loader&&(o[a]=e[a]),r&&r.hasOwnProperty(a))break}return o}function gS(e){return e?sr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ls(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 vS(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 Wn(e,t){let{pathname:n,routeId:r,method:o,type:i,message:a}=t===void 0?{}:t,l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",o&&n&&r?c="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",c='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?c="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(c='Invalid request method "'+o.toUpperCase()+'"')),new Tf(e||500,l,new Error(c),!0)}function ld(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(ms(o))return{key:r,result:o}}}function R2(e){let t=typeof e=="string"?ni(e):e;return Cu(Mt({},t,{hash:""}))}function _G(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function DG(e){return _2(e.result)&&gG.has(e.result.status)}function bi(e){return e.type===gt.deferred}function sr(e){return e.type===gt.error}function ms(e){return(e&&e.type)===gt.redirect}function yS(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function IG(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function _2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function AG(e){return mG.has(e.toLowerCase())}function Fr(e){return hG.has(e.toLowerCase())}async function NG(e,t,n,r,o){let i=Object.entries(t);for(let a=0;a<i.length;a++){let[l,c]=i[a],u=e.find(h=>(h==null?void 0:h.route.id)===l);if(!u)continue;let d=r.find(h=>h.route.id===u.route.id),f=d!=null&&!P2(d,u)&&(o&&o[u.route.id])!==void 0;bi(c)&&f&&await k0(c,n,!1).then(h=>{h&&(t[l]=h)})}}async function MG(e,t,n){for(let r=0;r<n.length;r++){let{key:o,routeId:i,controller:a}=n[r],l=t[o];e.find(u=>(u==null?void 0:u.route.id)===i)&&bi(l)&&(He(a,"Expected an AbortController for revalidating fetcher deferred result"),await k0(l,a.signal,!0).then(u=>{u&&(t[o]=u)}))}}async function k0(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:gt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:gt.error,error:o}}return{type:gt.data,data:e.deferredData.data}}}function R0(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ec(e,t){let n=typeof t=="string"?ni(t).search:t.search;if(e[e.length-1].route.index&&R0(n||""))return e[e.length-1];let r=S2(e);return r[r.length-1]}function xS(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:a}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function cm(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 OG(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 ql(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 LG(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 ai(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 $G(e,t){try{let n=e.sessionStorage.getItem(T2);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function FG(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(T2,JSON.stringify(n))}catch(r){al(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
554
|
+
* React Router v6.27.0
|
|
555
|
+
*
|
|
556
|
+
* Copyright (c) Remix Software Inc.
|
|
557
|
+
*
|
|
558
|
+
* This source code is licensed under the MIT license found in the
|
|
559
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
560
|
+
*
|
|
561
|
+
* @license MIT
|
|
562
|
+
*/function Wc(){return Wc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wc.apply(this,arguments)}const Xh=p.createContext(null),D2=p.createContext(null),Jh=p.createContext(null),Zh=p.createContext(null),Wi=p.createContext({outlet:null,matches:[],isDataRoute:!1}),I2=p.createContext(null);function ep(){return p.useContext(Zh)!=null}function ri(){return ep()||He(!1),p.useContext(Zh).location}function A2(e){p.useContext(Jh).static||p.useLayoutEffect(e)}function Gt(){let{isDataRoute:e}=p.useContext(Wi);return e?ZG():zG()}function zG(){ep()||He(!1);let e=p.useContext(Xh),{basename:t,future:n,navigator:r}=p.useContext(Jh),{matches:o}=p.useContext(Wi),{pathname:i}=ri(),a=JSON.stringify(j2(o,n.v7_relativeSplatPath)),l=p.useRef(!1);return A2(()=>{l.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=C2(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ri([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,a,i,e])}const UG=p.createContext(null);function BG(e){let t=p.useContext(Wi).outlet;return t&&p.createElement(UG.Provider,{value:e},t)}function ft(){let{matches:e}=p.useContext(Wi),t=e[e.length-1];return t?t.params:{}}function VG(e,t){return N2(e,t)}function N2(e,t,n,r){ep()||He(!1);let{navigator:o}=p.useContext(Jh),{matches:i}=p.useContext(Wi),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=ri(),d;if(t){var f;let S=typeof t=="string"?ni(t):t;c==="/"||(f=S.pathname)!=null&&f.startsWith(c)||He(!1),d=S}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let S=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let g=as(e,{pathname:m}),v=QG(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:Ri([c,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:Ri([c,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&v?p.createElement(Zh.Provider,{value:{location:Wc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Qt.Pop}},v):v}function HG(){let e=JG(),t=Yh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:o},n):null,null)}const WG=p.createElement(HG,null);class qG extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(Wi.Provider,{value:this.props.routeContext},p.createElement(I2.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function GG(e){let{routeContext:t,match:n,children:r}=e,o=p.useContext(Xh);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Wi.Provider,{value:t},r)}function QG(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let d=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||He(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<a.length;d++){let f=a[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:m}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,f,h)=>{let m,g=!1,v=null,S=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,v=f.route.errorElement||WG,c&&(u<0&&h===0?(eQ("route-fallback"),g=!0,S=null):u===h&&(g=!0,S=f.route.hydrateFallbackElement||null)));let x=t.concat(a.slice(0,h+1)),w=()=>{let y;return m?y=v:g?y=S:f.route.Component?y=p.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=d,p.createElement(GG,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:n!=null},children:y})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(qG,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):w()},null)}var M2=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(M2||{}),Pf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Pf||{});function KG(e){let t=p.useContext(Xh);return t||He(!1),t}function YG(e){let t=p.useContext(D2);return t||He(!1),t}function XG(e){let t=p.useContext(Wi);return t||He(!1),t}function O2(e){let t=XG(),n=t.matches[t.matches.length-1];return n.route.id||He(!1),n.route.id}function JG(){var e;let t=p.useContext(I2),n=YG(Pf.UseRouteError),r=O2(Pf.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function ZG(){let{router:e}=KG(M2.UseNavigateStable),t=O2(Pf.UseNavigateStable),n=p.useRef(!1);return A2(()=>{n.current=!0}),p.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Wc({fromRouteId:t},i)))},[e,t])}const bS={};function eQ(e,t,n){bS[e]||(bS[e]=!0)}function _0(e){return BG(e.context)}function Ee(e){He(!1)}function tQ(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Qt.Pop,navigator:i,static:a=!1,future:l}=e;ep()&&He(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:i,static:a,future:Wc({v7_relativeSplatPath:!1},l)}),[c,l,i,a]);typeof r=="string"&&(r=ni(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:g="default"}=r,v=p.useMemo(()=>{let S=Eu(d,c);return S==null?null:{location:{pathname:S,search:f,hash:h,state:m,key:g},navigationType:o}},[c,d,f,h,m,g,o]);return v==null?null:p.createElement(Jh.Provider,{value:u},p.createElement(Zh.Provider,{children:n,value:v}))}function nQ(e){let{children:t,location:n}=e;return VG(Gg(t),n)}new Promise(()=>{});function Gg(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,o)=>{if(!p.isValidElement(r))return;let i=[...t,o];if(r.type===p.Fragment){n.push.apply(n,Gg(r.props.children,i));return}r.type!==Ee&&He(!1),!r.props.index||!r.props.children||He(!1);let a={id:r.props.id||i.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,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=Gg(r.props.children,i)),n.push(a)}),n}function rQ(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
563
|
+
* React Router DOM v6.27.0
|
|
564
|
+
*
|
|
565
|
+
* Copyright (c) Remix Software Inc.
|
|
566
|
+
*
|
|
567
|
+
* This source code is licensed under the MIT license found in the
|
|
568
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
569
|
+
*
|
|
570
|
+
* @license MIT
|
|
571
|
+
*/function kf(){return kf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kf.apply(this,arguments)}function Qg(e){return e===void 0&&(e=""),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 oQ(e,t){let n=Qg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const iQ="6";try{window.__reactRouterVersion=iQ}catch{}function sQ(e,t){return bG({basename:void 0,future:kf({},void 0,{v7_prependBasename:!0}),history:Hq({window:void 0}),hydrationData:aQ(),routes:e,mapRouteProperties:rQ,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function aQ(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=kf({},t,{errors:lQ(t.errors)})),t}function lQ(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 Tf(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const cQ=p.createContext({isTransitioning:!1}),uQ=p.createContext(new Map),dQ="startTransition",wS=JS[dQ],fQ="flushSync",SS=YN[fQ];function hQ(e){wS?wS(e):e()}function Gl(e){SS?SS(e):e()}class pQ{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function mQ(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=p.useState(n.state),[a,l]=p.useState(),[c,u]=p.useState({isTransitioning:!1}),[d,f]=p.useState(),[h,m]=p.useState(),[g,v]=p.useState(),S=p.useRef(new Map),{v7_startTransition:x}=r||{},w=p.useCallback(E=>{x?hQ(E):E()},[x]),y=p.useCallback((E,R)=>{let{deletedFetchers:_,flushSync:N,viewTransitionOpts:O}=R;_.forEach(z=>S.current.delete(z)),E.fetchers.forEach((z,H)=>{z.data!==void 0&&S.current.set(H,z.data)});let F=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!O||F){N?Gl(()=>i(E)):w(()=>i(E));return}if(N){Gl(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let z=n.window.document.startViewTransition(()=>{Gl(()=>i(E))});z.finished.finally(()=>{Gl(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})})}),Gl(()=>m(z));return}h?(d&&d.resolve(),h.skipTransition(),v({state:E,currentLocation:O.currentLocation,nextLocation:O.nextLocation})):(l(E),u({isTransitioning:!0,flushSync:!1,currentLocation:O.currentLocation,nextLocation:O.nextLocation}))},[n.window,h,d,S,w]);p.useLayoutEffect(()=>n.subscribe(y),[n,y]),p.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new pQ)},[c]),p.useEffect(()=>{if(d&&a&&n.window){let E=a,R=d.promise,_=n.window.document.startViewTransition(async()=>{w(()=>i(E)),await R});_.finished.finally(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})}),m(_)}},[w,a,d,n.window]),p.useEffect(()=>{d&&a&&o.location.key===a.location.key&&d.resolve()},[d,h,o.location,a]),p.useEffect(()=>{!c.isTransitioning&&g&&(l(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[c.isTransitioning,g]),p.useEffect(()=>{},[]);let b=p.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,R,_)=>n.navigate(E,{state:R,preventScrollReset:_==null?void 0:_.preventScrollReset}),replace:(E,R,_)=>n.navigate(E,{replace:!0,state:R,preventScrollReset:_==null?void 0:_.preventScrollReset})}),[n]),C=n.basename||"/",j=p.useMemo(()=>({router:n,navigator:b,static:!1,basename:C}),[n,b,C]),T=p.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return p.createElement(p.Fragment,null,p.createElement(Xh.Provider,{value:j},p.createElement(D2.Provider,{value:o},p.createElement(uQ.Provider,{value:S.current},p.createElement(cQ.Provider,{value:c},p.createElement(tQ,{basename:C,location:o.location,navigationType:o.historyAction,navigator:b,future:T},o.initialized||n.future.v7_partialHydration?p.createElement(gQ,{routes:n.routes,future:n.future,state:o}):t))))),null)}const gQ=p.memo(vQ);function vQ(e){let{routes:t,future:n,state:r}=e;return N2(t,void 0,r,n)}var jS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(jS||(jS={}));var CS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(CS||(CS={}));function D0(e){let t=p.useRef(Qg(e)),n=p.useRef(!1),r=ri(),o=p.useMemo(()=>oQ(r.search,n.current?null:t.current),[r.search]),i=Gt(),a=p.useCallback((l,c)=>{const u=Qg(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,c)},[i,o]);return[o,a]}const yQ=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Tu(e,t){const n=xQ(e);if(typeof n.path!="string"){const{webkitRelativePath:r}=e;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function xQ(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=yQ.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Pl=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(u){o(u)}},a=c=>{try{l(n.throw(c))}catch(u){o(u)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const bQ=[".DS_Store","Thumbs.db"];function wQ(e){return Pl(this,null,function*(){return Rf(e)&&SQ(e.dataTransfer)?TQ(e.dataTransfer,e.type):jQ(e)?CQ(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?EQ(e):[]})}function SQ(e){return Rf(e)}function jQ(e){return Rf(e)&&Rf(e.target)}function Rf(e){return typeof e=="object"&&e!==null}function CQ(e){return Kg(e.target.files).map(t=>Tu(t))}function EQ(e){return Pl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Tu(n))})}function TQ(e,t){return Pl(this,null,function*(){if(e.items){const n=Kg(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(PQ));return ES(L2(r))}return ES(Kg(e.files).map(n=>Tu(n)))})}function ES(e){return e.filter(t=>bQ.indexOf(t.name)===-1)}function Kg(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 PQ(e){if(typeof e.webkitGetAsEntry!="function")return TS(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?$2(t):TS(e)}function L2(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?L2(n):[n]],[])}function TS(e){const t=e.getAsFile();if(!t)return Promise.reject(`${e} is not a File`);const n=Tu(t);return Promise.resolve(n)}function kQ(e){return Pl(this,null,function*(){return e.isDirectory?$2(e):RQ(e)})}function $2(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(a=>Pl(this,null,function*(){if(a.length){const l=Promise.all(a.map(kQ));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),a=>{r(a)})}i()})}function RQ(e){return Pl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Tu(r,e.fullPath);t(o)},r=>{n(r)})})})}function _Q(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(a=>{const l=a.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):o===l})}return!0}var DQ=Object.defineProperty,IQ=Object.defineProperties,AQ=Object.getOwnPropertyDescriptors,PS=Object.getOwnPropertySymbols,NQ=Object.prototype.hasOwnProperty,MQ=Object.prototype.propertyIsEnumerable,kS=(e,t,n)=>t in e?DQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OQ=(e,t)=>{for(var n in t||(t={}))NQ.call(t,n)&&kS(e,n,t[n]);if(PS)for(var n of PS(t))MQ.call(t,n)&&kS(e,n,t[n]);return e},LQ=(e,t)=>IQ(e,AQ(t));const $Q="file-invalid-type",FQ="file-too-large",zQ="file-too-small",UQ="too-many-files",BQ=e=>{e=Array.isArray(e)&&e.length===1?e[0]:e;const t=Array.isArray(e)?`one of ${e.join(", ")}`:e;return{code:$Q,message:`File type must be ${t}`}},RS=e=>({code:FQ,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),_S=e=>({code:zQ,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),VQ={code:UQ,message:"Too many files"};function F2(e,t){const n=e.type==="application/x-moz-file"||_Q(e,t);return[n,n?null:BQ(t)]}function z2(e,t,n){if(cs(e.size))if(cs(t)&&cs(n)){if(e.size>n)return[!1,RS(n)];if(e.size<t)return[!1,_S(t)]}else{if(cs(t)&&e.size<t)return[!1,_S(t)];if(cs(n)&&e.size>n)return[!1,RS(n)]}return[!0,null]}function cs(e){return e!=null}function HQ({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:i,validator:a}){return!o&&e.length>1||o&&i>=1&&e.length>i?!1:e.every(l=>{const[c]=F2(l,t),[u]=z2(l,n,r),d=a?a(l):null;return c&&u&&!d})}function _f(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function cd(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 DS(e){e.preventDefault()}function WQ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function qQ(e){return e.indexOf("Edge/")!==-1}function GQ(e=window.navigator.userAgent){return WQ(e)||qQ(e)}function io(...e){return(t,...n)=>e.some(r=>(!_f(t)&&r&&r(t,...n),_f(t)))}function QQ(){return"showOpenFilePicker"in window}function KQ(e){return cs(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return U2(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(B2))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>LQ(OQ({},n),{[r]:o}),{})}]:e}function YQ(e){if(cs(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>U2(t)||B2(t)).join(",")}function XQ(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function JQ(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function U2(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function B2(e){return/^.*\.[\w]+$/.test(e)}var ZQ=Object.defineProperty,eK=Object.defineProperties,tK=Object.getOwnPropertyDescriptors,Df=Object.getOwnPropertySymbols,V2=Object.prototype.hasOwnProperty,H2=Object.prototype.propertyIsEnumerable,IS=(e,t,n)=>t in e?ZQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nn=(e,t)=>{for(var n in t||(t={}))V2.call(t,n)&&IS(e,n,t[n]);if(Df)for(var n of Df(t))H2.call(t,n)&&IS(e,n,t[n]);return e},hi=(e,t)=>eK(e,tK(t)),If=(e,t)=>{var n={};for(var r in e)V2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Df)for(var r of Df(e))t.indexOf(r)<0&&H2.call(e,r)&&(n[r]=e[r]);return n};const I0=p.forwardRef((e,t)=>{var n=e,{children:r}=n,o=If(n,["children"]);const i=q2(o),{open:a}=i,l=If(i,["open"]);return p.useImperativeHandle(t,()=>({open:a}),[a]),fn.createElement(p.Fragment,null,r(hi(Nn({},l),{open:a})))});I0.displayName="Dropzone";const W2={disabled:!1,getFilesFromEvent:wQ,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};I0.defaultProps=W2;I0.propTypes={children:vt.func,accept:vt.objectOf(vt.arrayOf(vt.string)),multiple:vt.bool,preventDropOnDocument:vt.bool,noClick:vt.bool,noKeyboard:vt.bool,noDrag:vt.bool,noDragEventsBubbling:vt.bool,minSize:vt.number,maxSize:vt.number,maxFiles:vt.number,disabled:vt.bool,getFilesFromEvent:vt.func,onFileDialogCancel:vt.func,onFileDialogOpen:vt.func,useFsAccessApi:vt.bool,autoFocus:vt.bool,onDragEnter:vt.func,onDragLeave:vt.func,onDragOver:vt.func,onDrop:vt.func,onDropAccepted:vt.func,onDropRejected:vt.func,onError:vt.func,validator:vt.func};const Yg={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function q2(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:i,multiple:a,maxFiles:l,onDragEnter:c,onDragLeave:u,onDragOver:d,onDrop:f,onDropAccepted:h,onDropRejected:m,onFileDialogCancel:g,onFileDialogOpen:v,useFsAccessApi:S,autoFocus:x,preventDropOnDocument:w,noClick:y,noKeyboard:b,noDrag:C,noDragEventsBubbling:j,onError:T,validator:E}=Nn(Nn({},W2),e),R=p.useMemo(()=>YQ(t),[t]),_=p.useMemo(()=>KQ(t),[t]),N=p.useMemo(()=>typeof v=="function"?v:AS,[v]),O=p.useMemo(()=>typeof g=="function"?g:AS,[g]),F=p.useRef(null),z=p.useRef(null),[H,D]=p.useReducer(nK,Yg),{isFocused:k,isFileDialogActive:P}=H,I=p.useRef(typeof window<"u"&&window.isSecureContext&&S&&QQ()),L=()=>{!I.current&&P&&setTimeout(()=>{if(z.current){const{files:J}=z.current;J.length||(D({type:"closeDialog"}),O())}},300)};p.useEffect(()=>(window.addEventListener("focus",L,!1),()=>{window.removeEventListener("focus",L,!1)}),[z,P,O,I]);const $=p.useRef([]),Q=J=>{F.current&&F.current.contains(J.target)||(J.preventDefault(),$.current=[])};p.useEffect(()=>(w&&(document.addEventListener("dragover",DS,!1),document.addEventListener("drop",Q,!1)),()=>{w&&(document.removeEventListener("dragover",DS),document.removeEventListener("drop",Q))}),[F,w]),p.useEffect(()=>(!n&&x&&F.current&&F.current.focus(),()=>{}),[F,x,n]);const ue=p.useCallback(J=>{T?T(J):console.error(J)},[T]),Re=p.useCallback(J=>{J.preventDefault(),J.persist(),ne(J),$.current=[...$.current,J.target],cd(J)&&Promise.resolve(r(J)).then(se=>{if(_f(J)&&!j)return;const G=se.length,Se=G>0&&HQ({files:se,accept:R,minSize:i,maxSize:o,multiple:a,maxFiles:l,validator:E}),We=G>0&&!Se;D({isDragAccept:Se,isDragReject:We,isDragActive:!0,type:"setDraggedFiles"}),c&&c(J)}).catch(se=>ue(se))},[r,c,ue,j,R,i,o,a,l,E]),me=p.useCallback(J=>{J.preventDefault(),J.persist(),ne(J);const se=cd(J);if(se&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return se&&d&&d(J),!1},[d,j]),ge=p.useCallback(J=>{J.preventDefault(),J.persist(),ne(J);const se=$.current.filter(Se=>F.current&&F.current.contains(Se)),G=se.indexOf(J.target);G!==-1&&se.splice(G,1),$.current=se,!(se.length>0)&&(D({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),cd(J)&&u&&u(J))},[F,u,j]),De=p.useCallback((J,se)=>{const G=[],Se=[];J.forEach(We=>{const[Pt,lt]=F2(We,R),[Nt,nn]=z2(We,i,o),ln=E?E(We):null;if(Pt&&Nt&&!ln)G.push(We);else{let to=[lt,nn];ln&&(to=to.concat(ln)),Se.push({file:We,errors:to.filter(Vn=>Vn)})}}),(!a&&G.length>1||a&&l>=1&&G.length>l)&&(G.forEach(We=>{Se.push({file:We,errors:[VQ]})}),G.splice(0)),D({acceptedFiles:G,fileRejections:Se,type:"setFiles"}),f&&f(G,Se,se),Se.length>0&&m&&m(Se,se),G.length>0&&h&&h(G,se)},[D,a,R,i,o,l,f,h,m,E]),le=p.useCallback(J=>{J.preventDefault(),J.persist(),ne(J),$.current=[],cd(J)&&Promise.resolve(r(J)).then(se=>{_f(J)&&!j||De(se,J)}).catch(se=>ue(se)),D({type:"reset"})},[r,De,ue,j]),Ae=p.useCallback(()=>{if(I.current){D({type:"openDialog"}),N();const J={multiple:a,types:_};window.showOpenFilePicker(J).then(se=>r(se)).then(se=>{De(se,null),D({type:"closeDialog"})}).catch(se=>{XQ(se)?(O(se),D({type:"closeDialog"})):JQ(se)?(I.current=!1,z.current?(z.current.value=null,z.current.click()):ue(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."))):ue(se)});return}z.current&&(D({type:"openDialog"}),N(),z.current.value=null,z.current.click())},[D,N,O,S,De,ue,_,a]),it=p.useCallback(J=>{!F.current||!F.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),Ae())},[F,Ae]),Ue=p.useCallback(()=>{D({type:"focus"})},[]),Je=p.useCallback(()=>{D({type:"blur"})},[]),st=p.useCallback(()=>{y||(GQ()?setTimeout(Ae,0):Ae())},[y,Ae]),Be=J=>n?null:J,Ze=J=>b?null:Be(J),at=J=>C?null:Be(J),ne=J=>{j&&J.stopPropagation()},X=p.useMemo(()=>(J={})=>{var se=J,{refKey:G="ref",role:Se,onKeyDown:We,onFocus:Pt,onBlur:lt,onClick:Nt,onDragEnter:nn,onDragOver:ln,onDragLeave:to,onDrop:Vn}=se,Js=If(se,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return Nn(Nn({onKeyDown:Ze(io(We,it)),onFocus:Ze(io(Pt,Ue)),onBlur:Ze(io(lt,Je)),onClick:Be(io(Nt,st)),onDragEnter:at(io(nn,Re)),onDragOver:at(io(ln,me)),onDragLeave:at(io(to,ge)),onDrop:at(io(Vn,le)),role:typeof Se=="string"&&Se!==""?Se:"presentation",[G]:F},!n&&!b?{tabIndex:0}:{}),Js)},[F,it,Ue,Je,st,Re,me,ge,le,b,C,n]),ce=p.useCallback(J=>{J.stopPropagation()},[]),ke=p.useMemo(()=>(J={})=>{var se=J,{refKey:G="ref",onChange:Se,onClick:We}=se,Pt=If(se,["refKey","onChange","onClick"]);const lt={accept:R,multiple:a,type:"file",style:{display:"none"},onChange:Be(io(Se,le)),onClick:Be(io(We,ce)),tabIndex:-1,[G]:z};return Nn(Nn({},lt),Pt)},[z,t,a,le,n]);return hi(Nn({},H),{isFocused:k&&!n,getRootProps:X,getInputProps:ke,rootRef:F,inputRef:z,open:Be(Ae)})}function nK(e,t){switch(t.type){case"focus":return hi(Nn({},e),{isFocused:!0});case"blur":return hi(Nn({},e),{isFocused:!1});case"openDialog":return hi(Nn({},Yg),{isFileDialogActive:!0});case"closeDialog":return hi(Nn({},e),{isFileDialogActive:!1});case"setDraggedFiles":return hi(Nn({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return hi(Nn({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Nn({},Yg);default:return e}}function AS(){}const[rK,oK]=zn("Dropzone component was not found in tree");function A0(e){const t=n=>{const{children:r,...o}=V(`Dropzone${Q0(e)}`,{},n),i=oK(),a=qo(r)?r:s.jsx("span",{children:r});return i[e]?p.cloneElement(a,o):null};return t.displayName=`@mantine/dropzone/${Q0(e)}`,t}const iK=A0("accept"),sK=A0("reject"),aK=A0("idle");var qc={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const lK={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},cK=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const i=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),a=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":dt(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":a.color,"--dropzone-reject-bg":a.background}}},qi=Y((e,t)=>{const n=V("Dropzone",lK,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,radius:u,disabled:d,loading:f,multiple:h,maxSize:m,accept:g,children:v,onDropAny:S,onDrop:x,onReject:w,openRef:y,name:b,maxFiles:C,autoFocus:j,activateOnClick:T,activateOnDrag:E,dragEventsBubbling:R,activateOnKeyboard:_,onDragEnter:N,onDragLeave:O,onDragOver:F,onFileDialogCancel:z,onFileDialogOpen:H,preventDropOnDocument:D,useFsAccessApi:k,getFilesFromEvent:P,validator:I,rejectColor:L,acceptColor:$,enablePointerEvents:Q,loaderProps:ue,inputProps:Re,mod:me,...ge}=n,De=de({name:"Dropzone",classes:qc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:cK}),{getRootProps:le,getInputProps:Ae,isDragAccept:it,isDragReject:Ue,open:Je}=q2({onDrop:S,onDropAccepted:x,onDropRejected:w,disabled:d||f,accept:Array.isArray(g)?g.reduce((Be,Ze)=>({...Be,[Ze]:[]}),{}):g,multiple:h,maxSize:m,maxFiles:C,autoFocus:j,noClick:!T,noDrag:!E,noDragEventsBubbling:!R,noKeyboard:!_,onDragEnter:N,onDragLeave:O,onDragOver:F,onFileDialogCancel:z,onFileDialogOpen:H,preventDropOnDocument:D,useFsAccessApi:k,validator:I,...P?{getFilesFromEvent:P}:null});Lf(y,Je);const st=!it&&!Ue;return s.jsx(rK,{value:{accept:it,reject:Ue,idle:st},children:s.jsxs(q,{...le(),...De("root",{focusable:!0}),...ge,mod:[{accept:it,reject:Ue,idle:st,disabled:d,loading:f,"activate-on-click":T},me],children:[s.jsx(tx,{visible:f,overlayProps:{radius:u},unstyled:l,loaderProps:ue}),s.jsx("input",{...Ae(Re),name:b}),s.jsx("div",{...De("inner"),ref:t,"data-enable-pointer-events":Q||void 0,children:v})]})})});qi.classes=qc;qi.displayName="@mantine/dropzone/Dropzone";qi.Accept=iK;qi.Idle=aK;qi.Reject=sK;const uK={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Xr("max"),withinPortal:!0},N0=Y((e,t)=>{const n=V("DropzoneFullScreen",uK,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,active:u,onDrop:d,onReject:f,zIndex:h,withinPortal:m,portalProps:g,...v}=n,S=de({name:"DropzoneFullScreen",classes:qc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"fullScreen"}),{resolvedClassNames:x,resolvedStyles:w}=Qc({classNames:r,styles:a,props:n}),[y,b]=p.useState(0),[C,{open:j,close:T}]=$f(!1),E=_=>{var N;(N=_.dataTransfer)!=null&&N.types.includes("Files")&&(b(O=>O+1),j())},R=()=>{b(_=>_-1)};return p.useEffect(()=>{y===0&&T()},[y]),p.useEffect(()=>{if(u)return document.addEventListener("dragenter",E,!1),document.addEventListener("dragleave",R,!1),()=>{document.removeEventListener("dragenter",E,!1),document.removeEventListener("dragleave",R,!1)}},[u]),s.jsx(zs,{...g,withinPortal:m,children:s.jsx(q,{...S("fullScreen",{style:{opacity:C?1:0,pointerEvents:C?"all":"none",zIndex:h}}),ref:t,children:s.jsx(qi,{...v,classNames:x,styles:w,unstyled:l,className:qc.dropzone,onDrop:_=>{d==null||d(_),T(),b(0)},onReject:_=>{f==null||f(_),T(),b(0)}})})})});N0.classes=qc;N0.displayName="@mantine/dropzone/DropzoneFullScreen";qi.FullScreen=N0;const ud=qi,dK='{"resourceType": "Bundle"}';function um({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:a="show",loading:l}){mo[a]({id:e,loading:l,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function fK(){const e=At(),t=ae(),[n,r]=p.useState({}),o=p.useCallback(async(l,c)=>{const u="batch-upload";um({id:u,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let d=JSON.parse(l);d.type!=="batch"&&d.type!=="transaction"&&(d=Lk(d));const f=await t.executeBatch(d);r(h=>({...h,[c]:f})),um({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(Ks,{size:"1rem"}),withCloseButton:!0})}catch(d){um({id:u,title:"Batch Upload Failed",color:"red",message:Ie(d),method:"update",icon:s.jsx(bf,{size:"1rem"}),withCloseButton:!0})}},[t]),i=p.useCallback(async l=>{for(const c of l){const u=new FileReader;u.onload=d=>{var f;return o((f=d.target)==null?void 0:f.result,c.name)},u.readAsText(c)}},[o]),a=p.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return s.jsxs(Me,{children:[s.jsx(ye,{children:"Batch Create"}),s.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",s.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(et,{defaultValue:"upload",children:[s.jsxs(et.List,{children:[s.jsx(et.Tab,{value:"upload",children:"File Upload"}),s.jsx(et.Tab,{value:"json",children:"JSON"})]}),s.jsx(et.Panel,{value:"upload",pt:"xs",children:s.jsx(ud,{onDrop:i,accept:["application/json"],children:s.jsxs(te,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(ud.Accept,{children:s.jsx(Mw,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(ud.Reject,{children:s.jsx(bf,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(ud.Idle,{children:s.jsx(Mw,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(he,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(he,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(et.Panel,{value:"json",pt:"xs",children:s.jsxs(Qe,{onSubmit:a,children:[s.jsx(gl,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:dK,deserialize:JSON.parse}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ie,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(et,{defaultValue:Object.keys(n)[0],children:[s.jsx(et.List,{children:Object.keys(n).map(l=>s.jsx(et.Tab,{value:l,children:l},l))}),Object.keys(n).map(l=>s.jsx(et.Panel,{value:l,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[l],void 0,2)})},l))]}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ie,{onClick:()=>r({}),children:"Start over"})})]})]})}function hK(){const{resourceType:e}=ft(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=sl("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(Me,{children:[s.jsxs(ye,{children:["No apps for ",e]}),s.jsx(qe,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(Me,{children:s.jsx("div",{children:r.map(o=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(qe,{to:`/forms/${o.id}?subject=`+n.map(i=>`${e}/${i}`).join(","),children:o.name})}),s.jsx("p",{children:o.description})]},o.id))})}):s.jsx(Pr,{})}function pK(){const e=ae(),[t,n]=p.useState(),[r,o]=p.useState(!1);return s.jsx(Me,{width:450,children:s.jsxs(Qe,{onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(a=>n(mt(a)))},children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(eo,{size:32}),s.jsx(ye,{children:"Change password"})]}),!r&&s.jsxs(Le,{gap:"xl",mt:"xl",children:[s.jsx(Wr,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Ye(t,"oldPassword")}),s.jsx(Wr,{name:"newPassword",label:"New password",required:!0,error:Ye(t,"newPassword")}),s.jsx(Wr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ye(t,"confirmPassword")}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ie,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const Xg=["Form","JSON","Profiles"],mK=["Profiles"],dm=Xg[0].toLowerCase();function gK(){const e=Gt(),t=At(),{resourceType:n}=ft(),[r,o]=p.useState(()=>{const a=window.location.pathname.split("/").pop();return a&&Xg.map(l=>l.toLowerCase()).includes(a)?a:dm});function i(a){a||(a=dm),o(a),e(`/${n}/new/${a}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(Jn,{children:[s.jsxs(he,{p:"md",fw:500,children:["New ",n]}),s.jsx(Rr,{children:s.jsx(et,{defaultValue:dm,value:r,onChange:i,children:s.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Xg.map(a=>s.jsx(et.Tab,{value:a.toLowerCase(),px:"md",children:mK.includes(a)?s.jsxs(te,{gap:"xs",wrap:"nowrap",children:[a,s.jsx(su,{color:t.primaryColor,size:"sm",children:"Beta"})]}):a},a))})})})]}),s.jsx(_0,{})]})}function vK(){return s.jsx(Me,{children:s.jsxs(Le,{children:[s.jsx(ye,{order:1,children:"Unexpected Error"}),s.jsx(he,{children:"We're sorry, something went wrong."}),s.jsxs(he,{children:["Please contact ",s.jsx(Xe,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const yK="_root_1fbwr_1",xK="_entry_1fbwr_8",bK="_key_1fbwr_13",wK="_value_1fbwr_20",tp={root:yK,entry:xK,key:bK,value:wK};function ze(e){return s.jsx(Rr,{children:s.jsx("div",{className:tp.root,children:e.children})})}ze.Entry=function(t){return s.jsx("div",{className:tp.entry,children:t.children})};ze.Key=function(t){return s.jsx("div",{className:tp.key,children:t.children})};ze.Value=function(t){return s.jsx("div",{className:tp.value,children:t.children})};function SK(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function G2(e){var n,r;const t=St(e.patient);return t?s.jsxs(ze,{children:[s.jsx(Hi,{value:t,size:"lg",color:SK(t)}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Name"}),s.jsx(ze.Value,{children:s.jsx(qe,{to:t,fw:500,children:t.name?s.jsx(n0,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"DoB"}),s.jsx(ze.Value,{children:t.birthDate})]}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Age"}),s.jsx(ze.Value,{children:y6(t.birthDate)})]})]}),t.gender&&s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Gender"}),s.jsx(ze.Value,{children:t.gender})]}),t.address&&s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"State"}),s.jsx(ze.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:o==null?void 0:o.system}),s.jsx(ze.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function Q2(e){const t=St(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(qe,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(a,l){a&&l&&n.push({key:a,value:l})}function o(a){a&&r(a.system,a.value)}function i(a,l){Array.isArray(l)?l.forEach(c=>i(a,c)):typeof l=="string"?r(a,l):l&&(Array.isArray(l.coding)?r(a,l.coding.map(c=>c.display||c.code).join(", ")):r(a,l.text))}if("name"in t){const a=Ho(t);a!==ct(t)&&r("Name",a)}return"category"in t&&i("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&i("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}),s.jsx(ze,{children:n.map(a=>s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:a.key}),s.jsx(ze.Value,{children:a.value})]},`${a.key}-${a.value}`))})}function M0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function jK(e){var t;if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return(t=e.specimen)==null?void 0:t[0]}function Dd(e,t){return new Promise((n,r)=>{var i;const o=new MessageChannel;o.port1.onmessage=({data:a})=>{o.port1.close(),a.error?r(a.error):n(a.result)},(i=e.contentWindow)==null||i.postMessage(t,"https://codeeditor.medplum.com",[o.port2])})}function Gi(e){var t;return ol((t=e.getActiveLogin())==null?void 0:t.project)}function CK(e,t){const n=new Blob([e],{type:on.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const i=new Date().toISOString().replace(/\D/g,"");o.download=`${i}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function EK(){const{id:e}=ft(),t=ri(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=ae(),[i,a]=p.useState(!0),[l,c]=p.useState(),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[v,S]=p.useState();if(p.useEffect(()=>{const y={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const b=r.split(",").filter(C=>!!C);b.length===1&&y.entry.push({request:{method:"GET",url:b[0]}}),d(b)}o.executeBatch(y).then(b=>{var C,j,T,E,R,_,N,O;((T=(j=(C=b.entry)==null?void 0:C[0])==null?void 0:j.response)==null?void 0:T.status)!=="200"?g((_=(R=(E=b.entry)==null?void 0:E[0])==null?void 0:R.response)==null?void 0:_.outcome):(c((N=b.entry[0])==null?void 0:N.resource),h((O=b.entry[1])==null?void 0:O.resource)),a(!1)}).catch(b=>{g(b),a(!1)})},[o,e,r]),m)return s.jsx(Me,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(v)return s.jsxs(Me,{children:[s.jsx(ye,{children:l==null?void 0:l.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[v.length===1&&s.jsx("li",{children:s.jsx(qe,{to:v[0],children:"Review your answers"})}),v.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:v.map(y=>s.jsx("li",{children:s.jsx(qe,{to:y,children:ct(y)})},y.id))})]}),f&&s.jsx("li",{children:s.jsxs(qe,{to:f,children:["Back to ",Ho(f)]})}),s.jsx("li",{children:s.jsx(qe,{to:"/",children:"Go back home"})})]})]});if(i||!l)return s.jsx(Pr,{});const x=f&&M0(f);return s.jsxs(s.Fragment,{children:[s.jsxs(Jn,{shadow:"xs",radius:0,children:[x&&s.jsx(G2,{patient:x}),f&&f.resourceType!=="Patient"&&s.jsx(Q2,{resource:f}),s.jsx(q,{px:"xl",py:"md",children:s.jsxs(he,{children:[Ho(l),u&&u.length>1&&s.jsxs(s.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),s.jsx(Me,{children:s.jsx(c2,{questionnaire:l,subject:f&&Tt(f),onSubmit:w})})]});async function w(y){const b=[];if(!u||u.length===0)b.push(await o.createResource(y));else for(const C of u)b.push(await o.createResource({...y,subject:{reference:C}}));S(b)}}const TK="_paper_unw9o_1",PK={paper:TK},kK={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function K2(e,t){const n=e.resourceType||RK(t),r=e.fields??_K(n),o=e.filters??(e.resourceType?void 0:DK(n)),i=e.sortRules??IK(n),a=e.offset??0,l=e.count??Fh;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:a,count:l}}function RK(e){var t,n;return localStorage.getItem("defaultResourceType")??((n=(t=e==null?void 0:e.option)==null?void 0:t.find(r=>r.id==="defaultResourceType"))==null?void 0:n.valueString)??"Patient"}function _K(e){const t=O0(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");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 DK(e){var t;return(t=O0(e))==null?void 0:t.filters}function IK(e){const t=O0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function O0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function AK(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function NK(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=K2(n,t.getUserConfiguration()),o=await t.search(r.resourceType,Ia({...r,total:"accurate",fields:void 0}));return Lk(o)}function NS(){const e=ae(),t=Gt(),n=ri(),[r,o]=p.useState();return p.useEffect(()=>{const i=Ik(n.pathname+n.search),a=K2(i,e.getUserConfiguration());n.pathname===`/${a.resourceType}`&&n.search===Ia(a)?(AK(a),o(a)):t(`/${a.resourceType}${Ia(a)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(Pr,{}):s.jsx(Jn,{shadow:"xs",m:"md",p:"xs",className:PK.paper,children:s.jsx(ju,{checkboxesEnabled:!0,search:r,onClick:i=>t(`/${i.resource.resourceType}/${i.resource.id}`),onAuxClick:i=>window.open(`/${i.resource.resourceType}/${i.resource.id}`,"_blank"),onChange:i=>{t(`/${r.resourceType}${Ia(i.definition)}`)},onNew:()=>{t(kK[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+Ia(r);e.download(i).then(a=>{window.open(window.URL.createObjectURL(a),"_blank")}).catch(a=>pe({color:"red",message:Ie(a),autoClose:!1}))},onExportTransactionBundle:async()=>{NK(r,e).then(i=>CK(JSON.stringify(i,void 0,2))).catch(i=>pe({color:"red",message:Ie(i),autoClose:!1}))},onDelete:i=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:i.map(a=>({request:{method:"DELETE",url:`${r.resourceType}/${a}`}}))}).then(()=>o({...r})).catch(a=>pe({color:"red",message:Ie(a),autoClose:!1})))},onBulk:i=>{t(`/bulk/${r.resourceType}?ids=${i.join(",")}`)}})})}function MK(){const e=ae(),[t,n]=p.useState(),[r,o]=p.useState(void 0);p.useEffect(()=>{e.get("auth/mfa/status").then(l=>{n(l.enrollQrCode),o(l.enrolled)}).catch(l=>pe({color:"red",message:Ie(l),autoClose:!1}))},[e]);const i=p.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),pe({color:"green",message:"Success"})}).catch(c=>pe({color:"red",message:Ie(c),autoClose:!1}))},[e]),a=p.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return r===void 0?null:r?s.jsx(Me,{children:s.jsxs(te,{children:[s.jsx(ye,{children:"MFA is enabled"}),s.jsx(ie,{onClick:a,children:"Disable MFA"})]})}):s.jsx(Me,{width:400,children:s.jsxs(Qe,{onSubmit:i,children:[s.jsx(ye,{children:"Multi Factor Auth Setup"}),s.jsx(vn,{children:s.jsx("img",{src:t})}),s.jsx(xe,{name:"token",label:"Code"}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ie,{type:"submit",children:"Enroll"})})]})})}const fm={BASE_URL:"/",DEV:!1,GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.2.18-8ca5b55b2",MODE:"production",PROD:!0,RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",SSR:!1},Jg={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:fm==null?void 0:fm.MEDPLUM_AWS_TEXTRACT_ENABLED};function Pu(){return Jg}function Y2(){return X2("registerEnabled")}function OK(){return X2("awsTextractEnabled")}function X2(e){try{return Jg[e]!==!1&&Jg[e]!=="false"}catch{return!0}}function LK(){const e=Gt(),[t]=D0(),n=t.get("client_id");if(!n)return null;const r=t.get("scope")||"openid";function o(i){const a=new URL(t.get("redirect_uri"));for(const l of["scope","state","nonce"])t.has(l)&&a.searchParams.set(l,t.get(l));a.searchParams.set("code",i),window.location.assign(a.toString())}return s.jsxs(y2,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Pu().googleClientId,clientId:n||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",children:[s.jsx(eo,{size:32}),s.jsx(ye,{children:"Sign in to Medplum"})]})}function $K(){const e=ae(),t=Gt(),n=Pu();return p.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),Y2()?s.jsxs(Oq,{type:"project",projectId:"new",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(eo,{size:32}),s.jsx(ye,{children:"Create a new account"})]}):s.jsx(Me,{width:450,children:s.jsx(Bi,{icon:s.jsx(Cl,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function FK(){const e=Gt(),t=ae(),[n,r]=p.useState(),[o,i]=p.useState(!1),a=Pu().recaptchaSiteKey;return p.useEffect(()=>{a&&g2(a)},[a]),s.jsx(Me,{width:450,children:s.jsxs(Qe,{onSubmit:async l=>{let c="";a&&(c=await v2(a)),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>r(mt(u)))},children:[s.jsxs(Le,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(eo,{size:32}),s.jsx(ye,{children:"Medplum Password Reset"})]}),s.jsxs(Le,{gap:"xl",children:[s.jsx(Ir,{issues:bu(n,void 0)}),!o&&s.jsxs(s.Fragment,{children:[s.jsx(xe,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Ye(n,"email")}),s.jsxs(te,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Xe,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),s.jsx(ie,{type:"submit",children:"Reset password"})]})]}),o&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function zK(){var i;const e=Gt(),t=ae(),[n,r]=p.useState();p.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(a=>pe({color:"red",message:Ie(a),autoClose:!1}))},[t]);function o(a){t.post("auth/revoke",{loginId:a}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>pe({color:"green",message:"Login revoked"})).catch(l=>pe({color:"red",message:Ie(l),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(Me,{children:[s.jsx(ye,{children:"Security"}),s.jsxs(s0,{children:[s.jsx(Ao,{term:"ID",children:s.jsx(Xe,{href:`/${ct(n.profile)}`,children:n.profile.id})}),s.jsx(Ao,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(Ao,{term:"Name",children:mu((i=n.profile.name)==null?void 0:i[0])})]})]}),s.jsxs(Me,{children:[s.jsx(ye,{children:"Sessions"}),s.jsxs(fe,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:n.security.sessions.map(a=>s.jsxs("tr",{children:[s.jsx("td",{children:a.os}),s.jsx("td",{children:a.browser}),s.jsx("td",{children:a.remoteAddress}),s.jsx("td",{children:a.authMethod}),s.jsx("td",{children:$n(a.lastUpdated)}),s.jsx("td",{children:s.jsx(Xe,{href:"#",onClick:()=>o(a.id),children:"Revoke"})})]},a.id))})]})]}),s.jsxs(Me,{children:[s.jsx(ye,{children:"Password"}),s.jsx(ie,{onClick:()=>e("/changepassword"),children:"Change password"})]}),s.jsxs(Me,{children:[s.jsx(ye,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(ie,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function UK(){const{id:e,secret:t}=ft(),n=ae(),[r,o]=p.useState(),[i,a]=p.useState(!1),l=bu(r,void 0);return s.jsxs(Me,{width:450,children:[s.jsx(Ir,{issues:l}),s.jsxs(Qe,{onSubmit:c=>{if(c.password!==c.confirmPassword){o(go("Passwords do not match","confirmPassword"));return}o(void 0);const u={id:e,secret:t,password:c.password};n.post("auth/setpassword",u).then(()=>a(!0)).catch(d=>o(mt(d)))},children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(eo,{size:32}),s.jsx(ye,{children:"Set password"})]}),!i&&s.jsxs(Le,{children:[s.jsx(Wr,{name:"password",label:"New password",required:!0,error:Ye(r,"password")}),s.jsx(Wr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ye(r,"confirmPassword")}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ie,{type:"submit",children:"Set password"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(qe,{to:"/signin",children:"sign in"}),"."]})]})]})}function BK(){const e=Hh(),t=Gt(),[n]=D0(),r=Pu(),o=p.useCallback(()=>{const i=n.get("next");t(i!=null&&i.startsWith("/")?i:"/")},[n,t]);return p.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),s.jsxs(y2,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:Y2()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(eo,{size:32}),s.jsx(ye,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function VK(){const e=Gt(),t=ri(),[n,r]=p.useState(),[o,i]=p.useState(),[a,l]=p.useState();return p.useEffect(()=>{const c=Object.fromEntries(new URLSearchParams(t.search).entries());r(c.resourceType),i(c.query),l(JSON.parse(c.fields))},[t]),!n||!o||!a?null:s.jsx(zH,{resourceType:n,checkboxesEnabled:!0,query:o,fields:a,onClick:c=>e(`/${n}/${c.resource.id}`),onAuxClick:c=>window.open(`/${n}/${c.resource.id}`,"_blank"),onBulk:c=>{e(`/bulk/${n}?ids=${c.join(",")}`)}})}function np(e){const t=ae(),n=Gi(t),r=Gt(),[o,i]=p.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:oe.EQUALS,value:"Project/"+n},{code:"profile-type",operator:oe.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(ju,{search:o,onClick:a=>r(`/admin/members/${a.resource.id}`),onChange:a=>i(a.definition),hideFilters:!0,hideToolbar:!0})}function HK(){return s.jsxs(s.Fragment,{children:[s.jsx(ye,{children:"Bots"}),s.jsx(np,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(qe,{to:"/admin/bots/new",children:"Create new bot"})})]})}function WK(){return s.jsxs(s.Fragment,{children:[s.jsx(ye,{children:"Clients"}),s.jsx(np,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(qe,{to:"/admin/clients/new",children:"Create new client"})})]})}function rp(e){return s.jsx(Ys,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{ti(t)?e.onChange(Tt(t)):e.onChange(void 0)}})}function qK(){const e=ae(),t=Gi(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[a,l]=p.useState(),[c,u]=p.useState(),[d,f]=p.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(ye,{children:"Create new Bot"}),s.jsxs(Qe,{onSubmit:()=>{const h={name:n,description:o,accessPolicy:a};e.post("admin/projects/"+t+"/bot",h).then(m=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),f(m),pe({color:"green",message:"Bot created"})}).catch(m=>{pe({color:"red",message:Ie(m),autoClose:!1}),u(mt(m))})},children:[!d&&s.jsxs(Le,{children:[s.jsx(yt,{title:"Name",htmlFor:"name",outcome:c,children:s.jsx(xe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>r(h.currentTarget.value),error:Ye(c,"name")})}),s.jsx(yt,{title:"Description",htmlFor:"description",outcome:c,children:s.jsx(xe,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:Ye(c,"description")})}),s.jsx(yt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:s.jsx(rp,{name:"accessPolicy",onChange:l})}),s.jsx(te,{justify:"flex-end",children:s.jsx(ie,{type:"submit",children:"Create Bot"})})]}),d&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(he,{children:"Bot created"}),s.jsxs(On,{children:[s.jsx(On.Item,{children:s.jsx(qe,{to:d,children:"Go to new bot"})}),s.jsx(On.Item,{children:s.jsx(qe,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function GK(){const e=ae(),t=Gi(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(),[d,f]=p.useState(),[h,m]=p.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(ye,{children:"Create new Client"}),s.jsxs(Qe,{onSubmit:()=>{const g={name:n,description:o,redirectUri:a,accessPolicy:c};e.post("admin/projects/"+t+"/client",g).then(v=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),m(v),pe({color:"green",message:"Client created"})}).catch(v=>{pe({color:"red",message:Ie(v),autoClose:!1}),f(mt(v))})},children:[!h&&s.jsxs(Le,{children:[s.jsx(yt,{title:"Name",htmlFor:"name",outcome:d,children:s.jsx(xe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>r(g.currentTarget.value),error:Ye(d,"name")})}),s.jsx(yt,{title:"Description",htmlFor:"description",outcome:d,children:s.jsx(xe,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:Ye(d,"description")})}),s.jsx(yt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:s.jsx(xe,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:Ye(d,"redirectUri")})}),s.jsx(yt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:s.jsx(rp,{name:"accessPolicy",onChange:u})}),s.jsx(te,{justify:"flex-end",children:s.jsx(ie,{type:"submit",children:"Create Client"})})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(he,{children:"Client created"}),s.jsxs(On,{children:[s.jsx(On.Item,{children:s.jsx(qe,{to:h,children:"Go to new client"})}),s.jsx(On.Item,{children:s.jsx(qe,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function QK(e){return s.jsx(Ys,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{ti(t)?e.onChange(Tt(t)):e.onChange(void 0)}})}function KK(){const{membershipId:e}=ft(),t=ae(),n=Gi(t),r=Gt(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[i,a]=p.useState(o.accessPolicy),[l,c]=p.useState(o.userConfiguration),[u,d]=p.useState(o.admin),[f,h]=p.useState(),[m,g]=p.useState(!1);function v(){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(S=>h(mt(S)))}return s.jsxs(s.Fragment,{children:[s.jsx(ye,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(Ha,{value:o.profile,link:!0})}),s.jsxs(Qe,{onSubmit:()=>{const S={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${n}/members/${e}`,S).then(()=>g(!0)).catch(x=>h(mt(x)))},children:[!m&&s.jsxs(Le,{children:[s.jsx(yt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(rp,{name:"accessPolicy",defaultValue:i,onChange:a})}),s.jsx(yt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:f,children:s.jsx(QK,{name:"userConfiguration",defaultValue:l,onChange:c})}),s.jsx(yt,{title:"Admin",htmlFor:"admin",outcome:f,children:s.jsx(Rn,{id:"admin",name:"admin",defaultChecked:u,onChange:S=>d(S.currentTarget.checked)})}),s.jsxs(te,{justify:"flex-end",mt:"xl",children:[s.jsx(ie,{type:"submit",children:"Save"}),s.jsx(ie,{type:"button",color:"red",variant:"outline",onClick:v,children:"Remove user"})]})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(f,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(qe,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function YK(){const e=ae(),[t,n]=p.useState(e.getProject()),[r,o]=p.useState(),[i,a]=p.useState(),[l,c]=p.useState(!1),[u,d]=p.useState(void 0),f=p.useCallback(h=>{const m={resourceType:h.resourceType,firstName:h.firstName,lastName:h.lastName,email:h.email,sendEmail:h.sendEmail==="on",accessPolicy:r,admin:h.isAdmin==="on"};e.invite(t==null?void 0:t.id,m).then(g=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Oh(g)?a(g):d(g),c(m.sendEmail??!1),pe({color:"green",message:"Invite success"})}).catch(g=>{pe({color:"red",message:Ie(g),autoClose:!1}),a(mt(g))})},[e,t,r]);return s.jsxs(Qe,{onSubmit:f,children:[!u&&!i&&s.jsxs(Le,{children:[s.jsx(ye,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(yt,{title:"Project",htmlFor:"project",outcome:i,children:s.jsx(Ys,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(It,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Ye(i,"resourceType")}),s.jsx(xe,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Ye(i,"firstName")}),s.jsx(xe,{name:"lastName",label:"Last Name",required:!0,error:Ye(i,"lastName")}),s.jsx(xe,{name:"email",type:"email",label:"Email",required:!0,error:Ye(i,"email")}),s.jsx(yt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:s.jsx(rp,{name:"accessPolicy",onChange:o})}),s.jsx(Rn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Rn,{name:"isAdmin",label:"Admin"}),s.jsx(te,{justify:"flex-end",children:s.jsx(ie,{type:"submit",children:"Invite"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx(qe,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(he,{children:"User created"}),l&&s.jsx(he,{children:"Email sent"}),s.jsxs(On,{children:[s.jsx(On.Item,{children:s.jsx(qe,{to:u,children:"Go to new membership"})}),s.jsx(On.Item,{children:s.jsx(qe,{to:u.profile,children:"Go to new profile"})}),s.jsx(On.Item,{children:s.jsx(qe,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function XK(){return s.jsxs(s.Fragment,{children:[s.jsx(ye,{children:"Patients"}),s.jsx(np,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(qe,{to:"/admin/invite",children:"Invite new patient"})})]})}function JK(){const e=ae();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(Ir,{outcome:ik});function t(n){e.post("admin/projects/setpassword",n).then(()=>pe({color:"green",message:"Done"})).catch(r=>pe({color:"red",message:Ie(r),autoClose:!1}))}return s.jsxs(Me,{width:600,children:[s.jsx(ye,{order:1,children:"Project Admin"}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Force Set Password"}),s.jsx(he,{children:"Sets the password for the specified user in this project."}),s.jsx(he,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),s.jsx(Qe,{onSubmit:t,children:s.jsxs(Le,{children:[s.jsx(xe,{name:"email",label:"Email",required:!0}),s.jsx(Wr,{name:"password",label:"Password",required:!0}),s.jsx(ie,{type:"submit",children:"Force Set Password"})]})})]})}function MS(){const e=ae(),t=Gi(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(ye,{children:"Details"}),s.jsxs(s0,{children:[s.jsx(Ao,{term:"ID",children:n.project.id}),s.jsx(Ao,{term:"Name",children:n.project.name})]})]})}const OS=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function ZK(){const e=Gt(),n=ri().pathname.replace("/admin/","")||OS[0],r=ae(),o=Gi(r),i=p.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function a(l){e(`/admin/${l}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(Jn,{children:[s.jsx(ze,{children:s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Project"}),s.jsx(ze.Value,{children:i.project.name})]})}),s.jsx(Rr,{children:s.jsx(et,{value:n.toLowerCase(),onChange:a,children:s.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:OS.map(l=>s.jsx(et.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),s.jsx(Me,{children:s.jsx(_0,{})})]})}function eY(){const e=ae(),t=Gi(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,a]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&a(Kr(n.project.secret||[]))},[e,n]),!r||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/secrets`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>pe({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(ye,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(El,{property:Gs("Project","secret"),name:"secret",path:"Project.secret",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(ie,{type:"submit",children:"Save"})]})}function tY(){const e=ae(),t=Gi(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,a]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&a(Kr(n.project.site||[]))},[e,n]),!r||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/sites`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>pe({color:"green",message:"Saved"})).catch(c=>{var d,f,h,m;const u=mt(c);pe({color:"red",message:`Error ${(f=(d=u.issue)==null?void 0:d[0].details)==null?void 0:f.text} ${(m=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:m[0]}`,autoClose:!1})})},children:[s.jsx(ye,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(El,{property:Gs("Project","site"),name:"site",path:"Project.site",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(ie,{type:"submit",children:"Save"})]})}function nY(){const e=ae(),[t,{open:n,close:r}]=$f(!1),[o,i]=p.useState(""),[a,l]=p.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(Ir,{outcome:ik});function c(){dd(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function u(){dd(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function d(){dd(e,"Rebuilding Value Sets","admin/super/valuesets")}function f(S){dd(e,"Reindexing Resources","admin/super/reindex",S)}function h(S){e.post("admin/super/removebotidjobsfromqueue",S).then(()=>pe({color:"green",message:"Done"})).catch(x=>pe({color:"red",message:Ie(x),autoClose:!1}))}function m(S){e.post("admin/super/purge",{...S,before:yR(S.before)}).then(()=>pe({color:"green",message:"Done"})).catch(x=>pe({color:"red",message:Ie(x),autoClose:!1}))}function g(S){e.post("admin/super/setpassword",S).then(()=>pe({color:"green",message:"Done"})).catch(x=>pe({color:"red",message:Ie(x),autoClose:!1}))}function v(){e.post("fhir/R4/$db-stats",{}).then(S=>{var x,w;i("Database Stats"),l(s.jsx("pre",{children:(w=(x=S.parameter)==null?void 0:x.find(y=>y.name==="tableString"))==null?void 0:w.valueString})),n()}).catch(S=>pe({color:"red",message:Ie(S),autoClose:!1}))}return s.jsxs(Me,{width:600,children:[s.jsx(ye,{order:1,children:"Super Admin"}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Structure Definitions"}),s.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."}),s.jsx(Qe,{children:s.jsx(ie,{onClick:c,children:"Rebuild StructureDefinitions"})}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Search Parameters"}),s.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."}),s.jsx(Qe,{children:s.jsx(ie,{onClick:u,children:"Rebuild SearchParameters"})}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Value Sets"}),s.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."}),s.jsx(Qe,{children:s.jsx(ie,{onClick:d,children:"Rebuild ValueSets"})}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Reindex Resources"}),s.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),s.jsx(Qe,{onSubmit:f,children:s.jsxs(Le,{children:[s.jsx(yt,{title:"Resource Type",htmlFor:"resourceType",children:s.jsx(xe,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(yt,{title:"Search Filter",htmlFor:"filter",children:s.jsx(xe,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),s.jsx(ie,{type:"submit",children:"Reindex"})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Purge Resources"}),s.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),s.jsx(Qe,{onSubmit:m,children:s.jsxs(Le,{children:[s.jsx(yt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(It,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(yt,{title:"Purge Before",htmlFor:"before",children:s.jsx(_s,{name:"before",placeholder:"Before Date"})}),s.jsx(ie,{type:"submit",children:"Purge"})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(Qe,{onSubmit:h,children:s.jsxs(Le,{children:[s.jsx(yt,{title:"Bot ID",children:s.jsx(xe,{name:"botId",placeholder:"Bot Id"})}),s.jsx(ie,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Force Set Password"}),s.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.'}),s.jsx(Qe,{onSubmit:g,children:s.jsxs(Le,{children:[s.jsx(xe,{name:"email",label:"Email",required:!0}),s.jsx(Wr,{name:"password",label:"Password",required:!0}),s.jsx(xe,{name:"projectId",label:"Project ID"}),s.jsx(ie,{type:"submit",children:"Force Set Password"})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(Qe,{onSubmit:v,children:s.jsx(ie,{type:"submit",children:"Get Database Stats"})}),s.jsx(mn,{opened:t,onClose:r,title:o,centered:!0,children:a})]})}function dd(e,t,n,r){mo.show({id:n,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST",pollStatusOnAccepted:!0};r&&(o.body=JSON.stringify(r)),e.startAsyncRequest(n,o).then(()=>{mo.update({id:n,color:"green",title:t,message:"Done",icon:s.jsx(Ks,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(i=>{mo.update({id:n,color:"red",title:t,message:Ie(i),icon:s.jsx(bf,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function rY(){return s.jsxs(s.Fragment,{children:[s.jsx(ye,{children:"Users"}),s.jsx(np,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(qe,{to:"/admin/invite",children:"Invite new user"})})]})}function oY(){const[e]=sl("ObservationDefinition","_count=100");return e?s.jsxs(fe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var n,r,o,i;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(vo,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(vo,{value:t.code})}),s.jsx("td",{children:s.jsx(vo,{value:t.method})}),s.jsx("td",{children:(o=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:o.text}),s.jsx("td",{children:(i=t.quantitativeDetails)==null?void 0:i.decimalPrecision}),s.jsx("td",{children:s.jsx(Zg,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(Pr,{})}function Zg(e){const{ranges:t}=e;if(!t)return null;const n=LS(t.map(o=>o.gender));if(n.length>1)return $c(n),s.jsx(s.Fragment,{children:n.map(o=>{var i;return s.jsxs(p.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:en(o)})}),s.jsx(Zg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>a.gender===o)})]},o)})});const r=LS(t.map(o=>o.age&&Fc(o.age)));return r.length>1?($c(r),s.jsx(s.Fragment,{children:r.map(o=>{var i;return s.jsxs(p.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:en(o)})}),s.jsx(Zg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>Fc(a.age)===o)})]},o)})})):s.jsx(s.Fragment,{children:t.map(o=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:o.condition}),s.jsx("td",{children:s.jsx(l0,{value:o.range})})]})})},`range-${o.condition}`))})}function LS(e){return[...new Set(e.filter(t=>!!t))]}function iY(){const[e]=sl("ActivityDefinition","_count=100"),[t]=sl("ObservationDefinition","_count=100");return!e||!t?s.jsx(Pr,{}):s.jsxs(fe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(n=>s.jsx("th",{children:n.name},n.id))]})}),s.jsx("tbody",{children:t.map(n=>{var r;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(vo,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(vo,{value:n.code})}),e.map(o=>{var i;return s.jsx("td",{children:(i=o.observationResultRequirement)!=null&&i.find(a=>{var l;return(l=a.reference)==null?void 0:l.includes(n.id)})?"✅":""},o.id)})]},n.id)})})]})}function sY(e){var a;const t=ae(),[n,r]=p.useState(),[o,i]=p.useState();return o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx(qe,{to:o,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(qe,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(Qe,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(i).catch(console.log)},children:s.jsxs(Le,{children:[s.jsxs(ye,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(he,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(he,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(a=e.planDefinition.action)==null?void 0:a.map((l,c)=>{var u;return s.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&s.jsx(s.Fragment,{children:l.title}),l.code&&s.jsx(vo,{value:l.code[0]})]},`action-${c}`)})}),s.jsx(yt,{title:"Subject",children:s.jsx(qh,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ie,{type:"submit",children:"Go"})})]})})}function aY(){const{resourceType:e,id:t}=ft(),n=St({reference:e+"/"+t});return n?s.jsx(Me,{children:s.jsx(sY,{planDefinition:n})}):null}function lY(){const{resourceType:e,id:t}=ft(),n=St({reference:e+"/"+t}),[r,o]=sl("Questionnaire","subject-type="+e),[i,a]=sl("ClientApplication",{_count:1e3});if(!n||o||a)return s.jsx(Pr,{});const l=i==null?void 0:i.filter(d=>cY(e)&&!!d.launchUri);if((!r||r.length===0)&&(!l||l.length===0))return s.jsxs(Me,{children:[s.jsx(ye,{children:"Apps"}),s.jsxs("p",{children:["No apps found. Contact your administrator or ",s.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let c,u;return n.resourceType==="Patient"?c=Tt(n):n.resourceType==="Encounter"&&(c=n.subject,u=Tt(n)),s.jsxs(Me,{children:[r==null?void 0:r.map(d=>s.jsxs("div",{children:[s.jsx(ye,{order:3,children:s.jsx(qe,{to:`/forms/${d.id}?subject=${ct(n)}`,children:d.title||d.name})}),s.jsx(he,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>s.jsxs("div",{children:[s.jsx(ye,{order:3,children:s.jsx(Nq,{client:d,patient:c,encounter:u,children:d.name})}),s.jsx(he,{children:d.description})]},d.id))]})}function cY(e){return e==="Patient"||e==="Encounter"}function uY(){const{resourceType:e,id:t}=ft(),n=Gt(),[r,o]=p.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:oe.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(Me,{children:s.jsx(ju,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function dY(){const e=ae(),{resourceType:t,id:n}=ft(),r=e.readHistory(t,n).read();return s.jsx(Me,{children:s.jsx(jq,{history:r})})}const fY="_hl7Input_k5xm3_1",hY={hl7Input:fY};function pY(e){return s.jsx("iframe",{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 mY(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),s.jsx("iframe",{frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Dd(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const gY=`{
|
|
572
|
+
"resourceType": "Patient",
|
|
573
|
+
"name": [
|
|
574
|
+
{
|
|
575
|
+
"given": [
|
|
576
|
+
"Alice"
|
|
577
|
+
],
|
|
578
|
+
"family": "Smith"
|
|
579
|
+
}
|
|
580
|
+
]
|
|
581
|
+
}`,vY="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 yY(){const e=ae(),{id:t}=ft(),[n,r]=p.useState(),[o,i]=p.useState(),[a,l]=p.useState(gY),[c,u]=p.useState(vY),[d,f]=p.useState(on.FHIR_JSON),h=p.useRef(null),m=p.useRef(null),[g,v]=p.useState(!1);p.useEffect(()=>{e.readResource("Bot",t).then(async j=>{r(j),i(await xY(e,j))}).catch(j=>pe({color:"red",message:Ie(j),autoClose:!1}))},[e,t]);const S=p.useCallback(()=>Dd(h.current,{command:"getValue"}),[]),x=p.useCallback(()=>Dd(h.current,{command:"getOutput"}),[]),w=p.useCallback(async()=>d===on.FHIR_JSON?JSON.parse(a):c,[d,a,c]),y=p.useCallback(async j=>{j.preventDefault(),j.stopPropagation(),v(!0);try{const T=await S(),E=await x(),R=await e.createAttachment(T,"index.ts","text/typescript"),_=await e.createAttachment(E,"index.js","text/typescript"),N=[{op:"add",path:"/sourceCode",value:R},{op:"add",path:"/executableCode",value:_}];await e.patchResource("Bot",t,N),pe({color:"green",message:"Saved"})}catch(T){pe({color:"red",message:Ie(T),autoClose:!1})}finally{v(!1)}},[e,t,S,x]),b=p.useCallback(async j=>{j.preventDefault(),j.stopPropagation(),v(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),pe({color:"green",message:"Deployed"})}catch(T){pe({color:"red",message:Ie(T),autoClose:!1})}finally{v(!1)}},[e,t]),C=p.useCallback(async j=>{j.preventDefault(),j.stopPropagation(),v(!0);try{const T=await w(),E=await e.post(e.fhirUrl("Bot",t,"$execute"),T,d);await Dd(m.current,{command:"setValue",value:E}),pe({color:"green",message:"Success"})}catch(T){pe({color:"red",message:Ie(T),autoClose:!1})}finally{v(!1)}},[e,t,w,d]);return!n||o===void 0?null:s.jsxs(lr,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(lr.Col,{span:8,children:s.jsxs(Jn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(mY,{iframeRef:h,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(te,{justify:"flex-end",gap:"xs",children:[s.jsx(ie,{type:"button",onClick:y,loading:g,leftSection:s.jsx(kz,{size:"1rem"}),children:"Save"}),s.jsx(ie,{type:"button",onClick:b,loading:g,leftSection:s.jsx(Jx,{size:"1rem"}),children:"Deploy"}),s.jsx(ie,{type:"button",onClick:C,loading:g,leftSection:s.jsx(Bz,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(lr.Col,{span:4,children:[s.jsxs(Jn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(It,{data:[{label:"FHIR",value:on.FHIR_JSON},{label:"HL7",value:on.HL7_V2}],onChange:j=>f(j.currentTarget.value)}),d===on.FHIR_JSON?s.jsx(gl,{value:a,onChange:j=>l(j),autosize:!0,minRows:15}):s.jsx("textarea",{className:hY.hl7Input,value:c,onChange:j=>u(j.currentTarget.value),rows:15})]}),s.jsx(Jn,{m:2,p:"xs",shadow:"md",children:s.jsx(pY,{iframeRef:m,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function xY(e,t){var n,r,o;if((n=t.sourceCode)!=null&&n.url){const i=(o=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:o.find(bk);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Xs(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function bY(){const e=ae(),{resourceType:t,id:n}=ft(),r={reference:t+"/"+n},o=p.useCallback(i=>{e.updateResource(Xs(i)).then(()=>{pe({color:"green",message:"Success"})}).catch(a=>{pe({color:"red",message:Ie(a),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(Me,{children:s.jsx(JH,{value:r,onSubmit:o})});case"Questionnaire":return s.jsx(Me,{children:s.jsx(MW,{questionnaire:r,onSubmit:o})});default:return null}}function wY(){const{resourceType:e,id:t}=ft(),n=St({reference:e+"/"+t}),r=Gt();return n?s.jsx(Me,{children:s.jsx(iq,{value:n,onStart:(o,i)=>r(`/forms/${ol(i)}`),onEdit:(o,i,a)=>r(`/${a.reference}}`)})}):null}function SY(){const e=ae(),{resourceType:t,id:n}=ft(),r=Gt();return s.jsxs(Me,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(ie,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(o=>pe({color:"red",message:Ie(o),autoClose:!1}))},children:"Delete"})]})}const jY="_selectProfileBtn_tbaz6_1",CY="_chevron_tbaz6_13",$S={selectProfileBtn:jY,chevron:CY};function EY(){var c,u;const{resourceType:e,id:t}=ft(),n=St({reference:e+"/"+t}),[r,o]=p.useState(),i=iu({onDropdownClose:()=>i.resetSelectedOption()}),a=p.useMemo(()=>{var d;if(Ft((d=n==null?void 0:n.meta)==null?void 0:d.profile))return[s.jsx(Oe.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>s.jsx(Oe.Option,{value:f,children:f},f))]},[(c=n==null?void 0:n.meta)==null?void 0:c.profile]);if(p.useEffect(()=>{var d,f;((f=(d=n==null?void 0:n.meta)==null?void 0:d.profile)==null?void 0:f.length)===1&&o(n.meta.profile[0])},[(u=n==null?void 0:n.meta)==null?void 0:u.profile]),!n)return null;let l;return Ft(a)&&(l=s.jsx(te,{justify:"flex-end",children:s.jsxs(Le,{align:"flex-end",gap:"xs",children:[s.jsxs(Oe,{store:i,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:d=>{o(d),i.closeDropdown()},children:[s.jsx(Oe.Target,{children:s.jsx(Sn,{onClick:()=>i.toggleDropdown(),children:s.jsxs(Qy,{fw:"bold",fs:"sm",className:$S.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(Xx,{stroke:1.5,className:$S.chevron})]})})}),s.jsx(Oe.Dropdown,{w:"max-content",children:s.jsx(Oe.Options,{children:a})})]}),s.jsx(q,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(he,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(he,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(he,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(Me,{children:s.jsxs(Le,{gap:"xl",children:[l,s.jsx(b0,{value:n,profileUrl:r})]})})}function TY(){const e=ae(),{resourceType:t,id:n}=ft(),[r,o]=p.useState(),[i,a]=p.useState(),l=Gt(),[c,u]=p.useState();p.useEffect(()=>{e.readResource(t,n).then(m=>{o(Kr(m)),a(Kr(m))}).catch(m=>{u(mt(m)),pe({color:"red",message:Ie(m),autoClose:!1})})},[e,t,n]);const d=p.useCallback(m=>{u(void 0),e.updateResource(Xs(m)).then(()=>{l(`/${t}/${n}/details`),pe({id:"succes",color:"green",message:"Success"})}).catch(g=>{u(mt(g)),pe({color:"red",message:Ie(g),autoClose:!1})})},[e,t,n,l]),f=p.useCallback(m=>{u(void 0);const g=m0.createPatch(r,m);e.patchResource(t,n,g).then(()=>{l(`/${t}/${n}/details`),pe({id:"succes",color:"green",message:"Success"})}).catch(v=>{u(mt(v)),pe({color:"red",message:Ie(v),autoClose:!1})})},[e,t,n,r,l]),h=p.useCallback(()=>l(`/${t}/${n}/delete`),[l,t,n]);return i?s.jsx(Me,{children:s.jsx(Cf,{defaultValue:i,onSubmit:d,onPatch:f,onDelete:h,outcome:c})}):null}function J2({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=ae(),[i,a]=p.useState();return p.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(l=>{a(l.filter(dB))}).catch(console.error)},[o,n,r]),s.jsx(et,{value:t==null?void 0:t.url,onChange:l=>{const c=i==null?void 0:i.find(u=>u.url===l);c&&n(c)},children:s.jsx(et.List,{children:i==null?void 0:i.map(l=>{var d,f;const c=(f=(d=e.meta)==null?void 0:d.profile)==null?void 0:f.includes(l.url),u=c?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return s.jsx(et.Tab,{value:l.url,title:u,rightSection:c&&s.jsx(_x,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(nU,{size:"90%"})}),children:l.title||l.name},l.url)})})})}function Z2(e,t){const n=ae(),r=Gt();return{defaultValue:{resourceType:e},handleSubmit:a=>{t&&t(void 0),n.createResource(a).then(l=>r("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(mt(l)),pe({color:"red",message:Ie(l),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function hm(){const{resourceType:e}=ft(),t=ri(),[n,r]=p.useState(),{defaultValue:o,handleSubmit:i}=Z2(e,r),[a,l]=p.useState(),c=t.pathname.toLowerCase().endsWith("profiles"),u=p.useCallback(d=>{const f=Xs(d);a&&jk(f,a.url),i(f)},[a,i]);return c?s.jsx(Me,{children:s.jsxs(Le,{children:[s.jsx(J2,{resource:o,currentProfile:a,onChange:l}),a?s.jsx(Cf,{defaultValue:o,onSubmit:u,outcome:n,profileUrl:a.url},a.url):s.jsx(he,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(Me,{children:s.jsx(Cf,{defaultValue:o,onSubmit:i,outcome:n})})}function PY(){const e=ae(),{resourceType:t,id:n}=ft(),r=e.readHistory(t,n).read();return s.jsx(Me,{children:s.jsx(_q,{history:r})})}function kY(){const{resourceType:e}=ft(),[t,n]=p.useState(),{defaultValue:r,handleSubmit:o}=Z2(e,n),i=p.useCallback(a=>{o(JSON.parse(a["new-resource"]))},[o]);return s.jsxs(Me,{children:[t&&s.jsx(Ir,{outcome:t}),s.jsxs(Qe,{onSubmit:i,children:[s.jsx(gl,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:fr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ie,{type:"submit",children:"OK"})})]})]})}function RY(){const e=ae(),{resourceType:t,id:n}=ft(),r=St({reference:t+"/"+n}),o=Gt(),[i,a]=p.useState(),l=p.useCallback(c=>{e.updateResource(Xs(JSON.parse(c.resource))).then(()=>{a(void 0),o(`/${t}/${n}/details`),pe({color:"green",message:"Success"})}).catch(u=>{pe({color:"red",message:Ie(u),autoClose:!1})})},[e,t,n,o]);return r?s.jsxs(Me,{children:[i&&s.jsx(Ir,{outcome:i}),s.jsxs(Qe,{onSubmit:l,children:[s.jsx(gl,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:fr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ie,{type:"submit",children:"OK"})})]})]}):null}function _Y(){const{resourceType:e,id:t}=ft();return St({reference:e+"/"+t})?s.jsxs(Me,{children:[s.jsxs(Bi,{icon:s.jsx(Cl,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Xe,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(c2,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function DY(){const e=ae(),{resourceType:t,id:n}=ft(),[r,o]=p.useState(),[i,a]=p.useState();return p.useEffect(()=>{e.readResource(t,n).then(l=>o(Kr(l))).catch(l=>{pe({color:"red",message:Ie(l)})})},[e,t,n]),r?s.jsxs(Me,{children:[s.jsxs(ye,{order:2,children:["Available ",t," profiles"]}),s.jsx(Le,{children:s.jsxs(s.Fragment,{children:[s.jsx(J2,{resource:r,currentProfile:i,onChange:a}),i?s.jsx(IY,{profile:i,resource:r,onResourceUpdated:l=>o(l)},i.url):s.jsx(he,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const IY=({profile:e,resource:t,onResourceUpdated:n})=>{const r=ae(),[o,i]=p.useState(),[a,l]=p.useState(()=>{var u,d;return(d=(u=t.meta)==null?void 0:u.profile)==null?void 0:d.includes(e.url)}),c=p.useCallback(u=>{i(void 0);const d=Xs(u);a?jk(d,e.url):O6(d,e.url),r.updateResource(d).then(f=>{n(f),pe({color:"green",message:"Success"})}).catch(f=>{i(mt(f)),pe({color:"red",message:Ie(f),autoClose:!1})})},[r,e.url,n,a]);return s.jsxs(Le,{children:[s.jsx(du,{size:"md",checked:a,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),a?s.jsx(Cf,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):s.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ie,{type:"submit",children:"OK"})})})]})};function AY(){const e=ae(),{id:t}=ft(),[n,r]=p.useState(),[o,i]=p.useState(0),a=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>NY(c,t));function l(){n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${n.name} to questionnaire responses`,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:ct(n)}}).then(()=>{r(void 0),i(Date.now()),e.invalidateSearches("Subscription"),pe({color:"green",message:"Success"})}).catch(c=>pe({color:"red",message:Ie(c),autoClose:!1}))}return s.jsxs(Me,{children:[s.jsx(ye,{children:"Bots"}),a.length===0&&s.jsx("p",{children:"No bots found."}),a.map(c=>{var u;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Tl,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),s.jsx("hr",{}),s.jsx(ye,{children:"Connect to bot"}),s.jsxs(te,{children:[s.jsx(Ys,{name:"bot",resourceType:"Bot",onChange:c=>r(c)}),s.jsx(ie,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function NY(e,t){var o;const n=e.criteria||"",r=((o=e.channel)==null?void 0:o.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&n.includes(t)&&r.startsWith("Bot/")}function MY(){const{id:e}=ft(),t=Gt(),[n,r]=p.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:oe.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(Me,{children:s.jsx(ju,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function OY(){const e=ae(),{resourceType:t,id:n}=ft(),r=St({reference:t+"/"+n}),o=p.useCallback(i=>{e.updateResource(Xs(i)).then(()=>{pe({color:"green",message:"Success"})}).catch(a=>{pe({color:"red",message:Ie(a),autoClose:!1})})},[e]);return r?s.jsx(Me,{children:s.jsx(XW,{onSubmit:o,definition:r})}):null}function LY(){const{resourceType:e,id:t}=ft(),n=St({reference:e+"/"+t});return n?s.jsx(Me,{children:e==="MeasureReport"?s.jsx(qH,{measureReport:n}):s.jsx(h0,{value:n})}):null}const $Y="_container_1ue98_1",FY="_entry_1ue98_14",zY="_active_1ue98_21",pm={container:$Y,entry:FY,active:zY};function UY(e){const t=ae(),n=St(e.value),[r,o]=p.useState();return p.useEffect(()=>{if(!n)return;const i=M0(n);if(!i)return;const a="reference"in i?i.reference:ct(i);t.search("ServiceRequest","subject="+a).then(l=>{const u=l.entry.map(d=>d.resource);FR(u),u.reverse(),o(u)}).catch(l=>pe({color:"red",message:Ie(l),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:pm.container,children:r.map(i=>{var a,l,c,u,d,f,h;return s.jsxs("div",{className:rt(pm.entry,{[pm.active]:i.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(qe,{to:i,children:BY(i)})}),((l=(a=i.category)==null?void 0:a[0])==null?void 0:l.text)&&s.jsx("p",{children:(c=i.category[0])==null?void 0:c.text}),((f=(d=(u=i.code)==null?void 0:u.coding)==null?void 0:d[0])==null?void 0:f.code)&&s.jsx("p",{children:(h=i.code.coding[0])==null?void 0:h.code}),s.jsx("p",{children:VY(i)})]},i.id)})}):null}function BY(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function VY(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const HY="_container_1l2dh_1",WY={container:HY};function qY(e){var o,i,a,l;const t=St(e.valueSet);if(!t)return null;const n=[""],r=(l=(a=(i=(o=t.compose)==null?void 0:o.include)==null?void 0:i[0])==null?void 0:a.concept)==null?void 0:l.map(c=>c.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:WY.container,children:s.jsx(It,{defaultValue:e.defaultValue,onChange:c=>e.onChange(c.currentTarget.value),data:n})})}function GY(e){var n,r;const t=St(e.specimen);return t?s.jsxs(ze,{children:[s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Type"}),s.jsx(ze.Value,{children:"Specimen"})]}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Collected"}),s.jsx(ze.Value,{children:$n((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Specimen Age"}),s.jsx(ze.Value,{children:QY(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Specimen Stability"}),s.jsx(ze.Value,{children:KY(t)})]}):s.jsx(s.Fragment,{})]}):null}function QY(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return e_(t_(n,new Date))}function KY(e){var r;if(!((r=e.collection)!=null&&r.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return e_(t_(t,n))}function e_(e){return e.toString().padStart(3,"0")+"D"}function t_(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function YY(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"),t}const XY=[];function JY(){var y,b,C,j,T,E,R;const e=ae(),{resourceType:t,id:n}=ft(),r={reference:t+"/"+n},o=Gt(),[i,a]=p.useState(),l=St(r,a),c=YY(t),[u,d]=p.useState(()=>{const _=window.location.pathname.split("/").pop();return _&&c.map(N=>N.toLowerCase()).includes(_)?_:c[0].toLowerCase()}),f=At();async function h(){var O,F;const N=(F=(O=(await e.readHistory(t,n)).entry)==null?void 0:O.find(z=>!!z.resource))==null?void 0:F.resource;N?m(N):pe({color:"red",message:"No history to restore",autoClose:!1})}function m(_){e.updateResource(Xs(_)).then(()=>{a(void 0),pe({color:"green",message:"Success"})}).catch(N=>{pe({color:"red",message:Ie(N),autoClose:!1})})}if(i)return n7(i)?s.jsxs(Me,{children:[s.jsx(ye,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(ie,{color:"red",onClick:h,children:"Restore"})]}):s.jsx(Ir,{outcome:i});function g(_){_||(_=c[0].toLowerCase()),d(_),o(`/${t}/${n}/${_}`)}function v(_){const N=l,O=N.orderDetail||[];O.length===0&&O.push({}),O[0].text!==_&&(O[0].text=_,m({...N,orderDetail:O}))}const S=l&&M0(l),x=l&&jK(l),w=(C=(b=(y=e.getUserConfiguration())==null?void 0:y.option)==null?void 0:b.find(_=>_.id==="statusValueSet"))==null?void 0:C.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&w&&s.jsx(qY,{valueSet:{reference:w},defaultValue:(T=(j=l.orderDetail)==null?void 0:j[0])==null?void 0:T.text,onChange:v},ct(l)+"-"+((R=(E=l.orderDetail)==null?void 0:E[0])==null?void 0:R.text)),l&&s.jsx(UY,{value:l}),l&&s.jsxs(Jn,{children:[S&&s.jsx(G2,{patient:S}),x&&s.jsx(GY,{specimen:x}),t!=="Patient"&&s.jsx(Q2,{resource:r}),s.jsx(Rr,{children:s.jsx(et,{value:u.toLowerCase(),onChange:g,children:s.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(_=>s.jsx(et.Tab,{value:_.toLowerCase(),children:XY.includes(_)?s.jsxs(te,{gap:"xs",wrap:"nowrap",children:[_,s.jsx(su,{color:f.primaryColor,size:"sm",children:"Beta"})]}):_},_))})})})]}),s.jsx(_0,{})]})}function FS(){var x,w,y,b;const e=Gt(),{resourceType:t,id:n,versionId:r,tab:o}=ft(),i=ae(),[a,l]=p.useState(!0),[c,u]=p.useState(),[d,f]=p.useState();if(p.useEffect(()=>{f(void 0),l(!0),i.readHistory(t,n).then(C=>u(C)).then(()=>l(!1)).catch(C=>{f(C),l(!1)})},[i,t,n]),a)return s.jsx(Pr,{});if(!c)return s.jsxs(Me,{children:[s.jsx(ye,{children:"Resource not found"}),s.jsx(qe,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(C=>{var j,T;return((T=(j=C.resource)==null?void 0:j.meta)==null?void 0:T.versionId)===r});if(m===-1)return s.jsxs(Me,{children:[s.jsx(ye,{children:"Version not found"}),s.jsx(qe,{to:`/${t}/${n}`,children:"Return to resource"})]});const g=h[m].resource,v=m<h.length-1?h[m+1].resource:void 0,S="diff";return s.jsxs(et,{value:o||S,onChange:C=>e(`/${t}/${n}/_history/${r}/${C||S}`),children:[s.jsxs(Jn,{children:[s.jsx(wu,{fluid:!0,p:"md",children:s.jsx(he,{children:`${t} ${n}`})}),s.jsxs(et.List,{children:[s.jsx(et.Tab,{value:"diff",children:"Diff"}),s.jsx(et.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(Me,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(et.Panel,{value:"diff",children:v?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(x=g.meta)==null?void 0:x.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(qe,{to:`/${t}/${n}/_history/${(w=v.meta)==null?void 0:w.versionId}`,children:(y=v.meta)==null?void 0:y.versionId})]})]}),s.jsx(Tq,{original:v,revised:g})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(b=g.meta)==null?void 0:b.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)})]})}),s.jsx(et.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})}function ZY(){const{resourceType:e,id:t}=ft(),n=Gt(),[r,o]=p.useState({resourceType:"Subscription",filters:[{code:"url",operator:oe.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(Me,{children:s.jsx(NH,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function eX(e){const t=ae(),{resource:n,opened:r,onClose:o}=e,[i,a]=p.useState(!1),[l,c]=p.useState(),[u,d]=p.useState(!1),f=p.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:i&&l?ct(l):void 0,verbose:u}),pe({color:"green",message:"Done"}),o()}catch(h){pe({color:"red",message:Ie(h),autoClose:!1})}},[t,n,o,i,l,u]);return s.jsx(mn,{opened:r,onClose:o,title:"Resend Subscriptions",children:s.jsx(Qe,{onSubmit:f,children:s.jsxs(Le,{children:[s.jsx(Rn,{label:"Choose subscription (all subscriptions by default)",onChange:h=>a(h.currentTarget.checked)}),i&&s.jsx(Ys,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:c}),s.jsx(Rn,{label:"Verbose mode",onChange:h=>d(h.currentTarget.checked)}),s.jsx(te,{justify:"flex-end",children:s.jsx(ie,{type:"submit",children:"Resend"})})]})})})}function zS(){const e=ae(),t=Vh(),{resourceType:n,id:r}=ft(),o={reference:n+"/"+r},[i,a]=p.useState(),l=$f(!1);function c(w,y){return e.updateResource({...w,priority:y})}function u(w,y){c(w,"stat").then(y).catch(console.error)}function d(w,y){c(w,"routine").then(y).catch(console.error)}function f(w){t(`/${w.resourceType}/${w.id}`)}function h(w){t(`/${w.resourceType}/${w.id}/edit`)}function m(w){t(`/${w.resourceType}/${w.id}/delete`)}function g(w){a(w),l[1].open()}function v(w){var y;t(`/${w.resourceType}/${w.id}/_history/${(y=w.meta)==null?void 0:y.versionId}`)}function S(w,y){e.post(e.fhirUrl(w.resourceType,w.id,"$aws-textract"),{}).then(y).catch(console.error)}function x(w){var D;const{primaryResource:y,currentResource:b,reloadTimeline:C}=w,j=b.resourceType===y.resourceType&&b.id===y.id,T=b.resourceType==="Communication"&&b.priority!=="stat",E=b.resourceType==="Communication"&&b.priority==="stat",R=j,_=!j,N=!j,O=!j,F=(D=e.getProjectMembership())==null?void 0:D.admin,z=F,H=OK()&&(b.resourceType==="DocumentReference"||b.resourceType==="Media");return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Label,{children:"Resource"}),T&&s.jsx(Z.Item,{leftSection:s.jsx(zz,{size:14}),onClick:()=>u(b,C),"aria-label":`Pin ${ct(b)}`,children:"Pin"}),E&&s.jsx(Z.Item,{leftSection:s.jsx(Uz,{size:14}),onClick:()=>d(b,C),"aria-label":`Unpin ${ct(b)}`,children:"Unpin"}),_&&s.jsx(Z.Item,{leftSection:s.jsx(Nw,{size:14}),onClick:()=>f(b),"aria-label":`Details ${ct(b)}`,children:"Details"}),R&&s.jsx(Z.Item,{leftSection:s.jsx(Nw,{size:14}),onClick:()=>v(b),"aria-label":`Details ${ct(b)}`,children:"Details"}),N&&s.jsx(Z.Item,{leftSection:s.jsx(Jk,{size:14}),onClick:()=>h(b),"aria-label":`Edit ${ct(b)}`,children:"Edit"}),F&&s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Label,{children:"Admin"}),z&&s.jsx(Z.Item,{leftSection:s.jsx(qz,{size:14}),onClick:()=>g(b),"aria-label":`Resend Subscriptions ${ct(b)}`,children:"Resend Subscriptions"})]}),H&&s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Label,{children:"AWS AI"}),s.jsx(Z.Item,{leftSection:s.jsx(eU,{size:14}),onClick:()=>S(b,C),"aria-label":`AWS Textract ${ct(b)}`,children:"AWS Textract"})]}),O&&s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Label,{children:"Danger zone"}),s.jsx(Z.Item,{color:"red",leftSection:s.jsx(t0,{size:14}),onClick:()=>m(b),"aria-label":`Delete ${ct(b)}`,children:"Delete"})]})]})}return s.jsxs(s.Fragment,{children:[n==="Encounter"&&s.jsx(VV,{encounter:o,getMenu:x}),n==="Patient"&&s.jsx(GH,{patient:o,getMenu:x}),n==="ServiceRequest"&&s.jsx(Aq,{serviceRequest:o,getMenu:x}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&s.jsx(BV,{resource:o,getMenu:x}),s.jsx(eX,{resource:i,opened:l[0],onClose:l[1].close},`resend-subscriptions-${i==null?void 0:i.id}`)]})}function tX(e){const{opened:t,close:n,version:r,loadingStatus:o,handleStatus:i,handleUpgrade:a}=e,[l,c]=p.useState();return p.useEffect(()=>{t&&(l||nz().then(c).catch(console.error),i())},[t,l,i]),l&&r&&!o?r==="unknown"?s.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(l)?s.jsxs("p",{children:["This agent is already on the latest version (",l,")."]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",l,"?"]}),s.jsx(ie,{onClick:()=>{a(),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"})]}):s.jsx(Pr,{})}function nX(){const e=ae(),{id:t}=ft(),n=p.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=p.useState(!1),[i,a]=p.useState(!1),[l,c]=p.useState(!1),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[v,S]=p.useState(),[x,w]=p.useState(!1),[y,b]=p.useState(!1),[C,{open:j,close:T}]=$f(!1);p.useEffect(()=>{if(r||i||l||x){b(!0);return}b(!1)},[r,i,l,x]);const E=p.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(z=>{var H,D,k,P,I,L;d((D=(H=z.parameter)==null?void 0:H.find($=>$.name==="status"))==null?void 0:D.valueCode),h((P=(k=z.parameter)==null?void 0:k.find($=>$.name==="version"))==null?void 0:P.valueString),g((L=(I=z.parameter)==null?void 0:I.find($=>$.name==="lastUpdated"))==null?void 0:L.valueInstant)}).catch(z=>F(Ie(z))).finally(()=>o(!1))},[e,t]),R=p.useCallback(z=>{const H=z.host,D=z.pingCount||1;H&&(w(!0),e.pushToAgent(n,H,`PING ${D}`,on.PING,!0).then(k=>S(k)).catch(k=>F(Ie(k))).finally(()=>w(!1)))},[e,n]),_=p.useCallback(()=>{a(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(z=>{O("Agent config reloaded successfully.")}).catch(z=>F(Ie(z))).finally(()=>a(!1))},[e,t]),N=p.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$upgrade"),{cache:"reload"}).then(z=>{O("Agent upgraded successfully.")}).catch(z=>F(Ie(z))).finally(()=>c(!1))},[e,t]);function O(z){pe({color:"green",title:"Success",icon:s.jsx(Ks,{size:"1rem"}),message:z})}function F(z){pe({color:"red",title:"Error",message:z,autoClose:!1})}return s.jsxs(Me,{children:[s.jsx(mn,{opened:C,onClose:T,title:"Upgrade Agent",centered:!0,children:s.jsx(tX,{opened:C,close:T,version:f,loadingStatus:r,handleStatus:E,handleUpgrade:N})}),s.jsx(ye,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(Tl,{value:n,link:!0})]}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Agent Status"}),s.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."}),s.jsx(ie,{onClick:E,loading:r,disabled:y&&!r,children:"Get Status"}),!r&&u&&s.jsx(fe,{children:s.jsxs(fe.Tbody,{children:[s.jsxs(fe.Tr,{children:[s.jsx(fe.Td,{children:"Status"}),s.jsx(fe.Td,{children:s.jsx(f0,{status:u})})]}),s.jsxs(fe.Tr,{children:[s.jsx(fe.Td,{children:"Version"}),s.jsx(fe.Td,{children:f})]}),s.jsxs(fe.Tr,{children:[s.jsx(fe.Td,{children:"Last Updated"}),s.jsx(fe.Td,{children:$n(m,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Reload Config"}),s.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),s.jsx(ie,{onClick:_,loading:i,disabled:y&&!i,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Upgrade Agent"}),s.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),s.jsx(ie,{onClick:j,loading:l,disabled:y&&!l,"aria-label":"Upgrade agent",children:"Upgrade"}),s.jsx(dn,{my:"lg"}),s.jsx(ye,{order:2,children:"Ping from Agent"}),s.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."}),s.jsx(Qe,{onSubmit:R,children:s.jsxs(te,{children:[s.jsx(xe,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(Zt,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:x,disabled:y&&!x,children:s.jsx(Qz,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(fx,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!x&&v&&s.jsxs(s.Fragment,{children:[s.jsx(ye,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:v})]})]})}function rX(){return s.jsx(nQ,{children:s.jsxs(Ee,{errorElement:s.jsx(vK,{}),children:[s.jsx(Ee,{path:"/signin",element:s.jsx(BK,{})}),s.jsx(Ee,{path:"/oauth",element:s.jsx(LK,{})}),s.jsx(Ee,{path:"/resetpassword",element:s.jsx(FK,{})}),s.jsx(Ee,{path:"/setpassword/:id/:secret",element:s.jsx(UK,{})}),s.jsx(Ee,{path:"/register",element:s.jsx($K,{})}),s.jsx(Ee,{path:"/changepassword",element:s.jsx(pK,{})}),s.jsx(Ee,{path:"/security",element:s.jsx(zK,{})}),s.jsx(Ee,{path:"/mfa",element:s.jsx(MK,{})}),s.jsx(Ee,{path:"/batch",element:s.jsx(fK,{})}),s.jsx(Ee,{path:"/bulk/:resourceType",element:s.jsx(hK,{})}),s.jsx(Ee,{path:"/smart",element:s.jsx(VK,{})}),s.jsx(Ee,{path:"/forms/:id",element:s.jsx(EK,{})}),s.jsx(Ee,{path:"/admin/super",element:s.jsx(nY,{})}),s.jsx(Ee,{path:"/admin/config",element:s.jsx(JK,{})}),s.jsxs(Ee,{path:"/admin",element:s.jsx(ZK,{}),children:[s.jsx(Ee,{path:"patients",element:s.jsx(XK,{})}),s.jsx(Ee,{path:"bots/new",element:s.jsx(qK,{})}),s.jsx(Ee,{path:"bots",element:s.jsx(HK,{})}),s.jsx(Ee,{path:"clients/new",element:s.jsx(GK,{})}),s.jsx(Ee,{path:"clients",element:s.jsx(WK,{})}),s.jsx(Ee,{path:"details",element:s.jsx(MS,{})}),s.jsx(Ee,{path:"invite",element:s.jsx(YK,{})}),s.jsx(Ee,{path:"users",element:s.jsx(rY,{})}),s.jsx(Ee,{path:"project",element:s.jsx(MS,{})}),s.jsx(Ee,{path:"secrets",element:s.jsx(eY,{})}),s.jsx(Ee,{path:"sites",element:s.jsx(tY,{})}),s.jsx(Ee,{path:"members/:membershipId",element:s.jsx(KK,{})})]}),s.jsx(Ee,{path:"/lab/assays",element:s.jsx(oY,{})}),s.jsx(Ee,{path:"/lab/panels",element:s.jsx(iY,{})}),s.jsx(Ee,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(FS,{})}),s.jsx(Ee,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(FS,{})}),s.jsxs(Ee,{path:"/:resourceType/new",element:s.jsx(gK,{}),children:[s.jsx(Ee,{index:!0,element:s.jsx(hm,{})}),s.jsx(Ee,{path:"form",element:s.jsx(hm,{})}),s.jsx(Ee,{path:"json",element:s.jsx(kY,{})}),s.jsx(Ee,{path:"profiles",element:s.jsx(hm,{})})]}),s.jsxs(Ee,{path:"/:resourceType/:id",element:s.jsx(JY,{}),children:[s.jsx(Ee,{index:!0,element:s.jsx(zS,{})}),s.jsx(Ee,{path:"apply",element:s.jsx(aY,{})}),s.jsx(Ee,{path:"apps",element:s.jsx(lY,{})}),s.jsx(Ee,{path:"event",element:s.jsx(uY,{})}),s.jsx(Ee,{path:"blame",element:s.jsx(dY,{})}),s.jsx(Ee,{path:"bots",element:s.jsx(AY,{})}),s.jsx(Ee,{path:"builder",element:s.jsx(bY,{})}),s.jsx(Ee,{path:"checklist",element:s.jsx(wY,{})}),s.jsx(Ee,{path:"delete",element:s.jsx(SY,{})}),s.jsx(Ee,{path:"details",element:s.jsx(EY,{})}),s.jsx(Ee,{path:"edit",element:s.jsx(TY,{})}),s.jsx(Ee,{path:"editor",element:s.jsx(yY,{})}),s.jsx(Ee,{path:"history",element:s.jsx(PY,{})}),s.jsx(Ee,{path:"json",element:s.jsx(RY,{})}),s.jsx(Ee,{path:"preview",element:s.jsx(_Y,{})}),s.jsx(Ee,{path:"responses",element:s.jsx(MY,{})}),s.jsx(Ee,{path:"report",element:s.jsx(LY,{})}),s.jsx(Ee,{path:"ranges",element:s.jsx(OY,{})}),s.jsx(Ee,{path:"subscriptions",element:s.jsx(ZY,{})}),s.jsx(Ee,{path:"timeline",element:s.jsx(zS,{})}),s.jsx(Ee,{path:"tools",element:s.jsx(nX,{})}),s.jsx(Ee,{path:"profiles",element:s.jsx(DY,{})})]}),s.jsx(Ee,{path:"/:resourceType",element:s.jsx(NS,{})}),s.jsx(Ee,{path:"/",element:s.jsx(NS,{})})]})})}function oX(){const e=ae(),t=e.getUserConfiguration(),n=ri(),[r]=D0();return e.isLoading()?s.jsx(Pr,{}):s.jsx(QU,{logo:s.jsx(eo,{size:24}),pathname:n.pathname,searchParams:r,version:I8,menus:iX(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(p.Suspense,{fallback:s.jsx(Pr,{}),children:s.jsx(rX,{})})})}function iX(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var o;return{title:r.title,links:((o=r.link)==null?void 0:o.map(i=>({label:i.name,href:i.target,icon:sX(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(Mz,{})}]}),t}const US={Patient:Xz,Practitioner:Az,Organization:Cz,ServiceRequest:Hz,DiagnosticReport:Gz,Questionnaire:Iz,admin:wz,AccessPolicy:Nz,Subscription:tU,batch:Fz,Observation:$z};function sX(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in US){const n=US[t];return s.jsx(n,{})}}catch{}return s.jsx(Mh,{w:30})}"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister()))).catch(e=>console.error("SW registration failed: ",e))});async function aX(){const e=Pu(),t=new Bk({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=sQ([{path:"*",element:s.jsx(oX,{})}]),o=a=>r.navigate(a);x2(document.getElementById("root")).render(s.jsx(p.StrictMode,{children:s.jsx(rz,{medplum:t,navigate:o,children:s.jsxs(jj,{theme:n,children:[s.jsx(ei,{position:"bottom-right"}),s.jsx(mQ,{router:r})]})})}))}aX().catch(console.error);
|
|
582
|
+
//# sourceMappingURL=index-CMlkeBKK.js.map
|