@medplum/app 3.1.5 → 3.1.6
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-CCxkjo1T.css +1 -0
- package/dist/assets/index-D9zfKRAQ.js +563 -0
- package/dist/assets/index-D9zfKRAQ.js.map +1 -0
- package/dist/index.html +3 -3
- package/package.json +16 -16
- package/dist/assets/index-B4iLXt6s.js +0 -563
- package/dist/assets/index-B4iLXt6s.js.map +0 -1
- package/dist/assets/index-D8AskT8z.css +0 -1
|
@@ -1,563 +0,0 @@
|
|
|
1
|
-
function zS(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 s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).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 H0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var VS={exports:{}},of={},BS={exports:{}},Ge={};/**
|
|
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 bc=Symbol.for("react.element"),OR=Symbol.for("react.portal"),$R=Symbol.for("react.fragment"),LR=Symbol.for("react.strict_mode"),FR=Symbol.for("react.profiler"),zR=Symbol.for("react.provider"),VR=Symbol.for("react.context"),BR=Symbol.for("react.forward_ref"),UR=Symbol.for("react.suspense"),HR=Symbol.for("react.memo"),WR=Symbol.for("react.lazy"),W0=Symbol.iterator;function qR(e){return e===null||typeof e!="object"?null:(e=W0&&e[W0]||e["@@iterator"],typeof e=="function"?e:null)}var US={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},HS=Object.assign,WS={};function Fa(e,t,n){this.props=e,this.context=t,this.refs=WS,this.updater=n||US}Fa.prototype.isReactComponent={};Fa.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")};Fa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qS(){}qS.prototype=Fa.prototype;function hg(e,t,n){this.props=e,this.context=t,this.refs=WS,this.updater=n||US}var mg=hg.prototype=new qS;mg.constructor=hg;HS(mg,Fa.prototype);mg.isPureReactComponent=!0;var q0=Array.isArray,GS=Object.prototype.hasOwnProperty,pg={current:null},QS={key:!0,ref:!0,__self:!0,__source:!0};function KS(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)GS.call(t,r)&&!QS.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:bc,type:e,key:i,ref:s,props:o,_owner:pg.current}}function GR(e,t){return{$$typeof:bc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function gg(e){return typeof e=="object"&&e!==null&&e.$$typeof===bc}function QR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var G0=/\/+/g;function Ph(e,t){return typeof e=="object"&&e!==null&&e.key!=null?QR(""+e.key):t.toString(36)}function Wu(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case bc:case OR:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Ph(s,0):r,q0(o)?(n="",e!=null&&(n=e.replace(G0,"$&/")+"/"),Wu(o,t,n,"",function(u){return u})):o!=null&&(gg(o)&&(o=GR(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(G0,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",q0(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Ph(i,l);s+=Wu(i,t,n,c,o)}else if(c=qR(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Ph(i,l++),s+=Wu(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 s}function mu(e,t,n){if(e==null)return e;var r=[],o=0;return Wu(e,r,"","",function(i){return t.call(n,i,o++)}),r}function KR(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 An={current:null},qu={transition:null},YR={ReactCurrentDispatcher:An,ReactCurrentBatchConfig:qu,ReactCurrentOwner:pg};Ge.Children={map:mu,forEach:function(e,t,n){mu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return mu(e,function(){t++}),t},toArray:function(e){return mu(e,function(t){return t})||[]},only:function(e){if(!gg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ge.Component=Fa;Ge.Fragment=$R;Ge.Profiler=FR;Ge.PureComponent=hg;Ge.StrictMode=LR;Ge.Suspense=UR;Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=YR;Ge.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=HS({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=pg.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)GS.call(t,c)&&!QS.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:bc,type:e.type,key:o,ref:i,props:r,_owner:s}};Ge.createContext=function(e){return e={$$typeof:VR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:zR,_context:e},e.Consumer=e};Ge.createElement=KS;Ge.createFactory=function(e){var t=KS.bind(null,e);return t.type=e,t};Ge.createRef=function(){return{current:null}};Ge.forwardRef=function(e){return{$$typeof:BR,render:e}};Ge.isValidElement=gg;Ge.lazy=function(e){return{$$typeof:WR,_payload:{_status:-1,_result:e},_init:KR}};Ge.memo=function(e,t){return{$$typeof:HR,type:e,compare:t===void 0?null:t}};Ge.startTransition=function(e){var t=qu.transition;qu.transition={};try{e()}finally{qu.transition=t}};Ge.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ge.useCallback=function(e,t){return An.current.useCallback(e,t)};Ge.useContext=function(e){return An.current.useContext(e)};Ge.useDebugValue=function(){};Ge.useDeferredValue=function(e){return An.current.useDeferredValue(e)};Ge.useEffect=function(e,t){return An.current.useEffect(e,t)};Ge.useId=function(){return An.current.useId()};Ge.useImperativeHandle=function(e,t,n){return An.current.useImperativeHandle(e,t,n)};Ge.useInsertionEffect=function(e,t){return An.current.useInsertionEffect(e,t)};Ge.useLayoutEffect=function(e,t){return An.current.useLayoutEffect(e,t)};Ge.useMemo=function(e,t){return An.current.useMemo(e,t)};Ge.useReducer=function(e,t,n){return An.current.useReducer(e,t,n)};Ge.useRef=function(e){return An.current.useRef(e)};Ge.useState=function(e){return An.current.useState(e)};Ge.useSyncExternalStore=function(e,t,n){return An.current.useSyncExternalStore(e,t,n)};Ge.useTransition=function(){return An.current.useTransition()};Ge.version="18.2.0";BS.exports=Ge;var m=BS.exports;const C=fg(m),YS=zS({__proto__:null,default:C},[m]);/**
|
|
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 XR=m,JR=Symbol.for("react.element"),ZR=Symbol.for("react.fragment"),e2=Object.prototype.hasOwnProperty,t2=XR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n2={key:!0,ref:!0,__self:!0,__source:!0};function XS(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)e2.call(t,r)&&!n2.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:JR,type:e,key:i,ref:s,props:o,_owner:t2.current}}of.Fragment=ZR;of.jsx=XS;of.jsxs=XS;VS.exports=of;var a=VS.exports,no=function(){return no=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},no.apply(this,arguments)};function JS(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 r2(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 Gu="right-scroll-bar-position",Qu="width-before-scroll-bar",o2="with-scroll-bars-hidden",i2="--removed-body-scroll-bar-size";function Th(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function s2(e,t){var n=m.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 a2=typeof window<"u"?m.useLayoutEffect:m.useEffect,Q0=new WeakMap;function l2(e,t){var n=s2(null,function(r){return e.forEach(function(o){return Th(o,r)})});return a2(function(){var r=Q0.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(l){i.has(l)||Th(l,null)}),i.forEach(function(l){o.has(l)||Th(l,s)})}Q0.set(n,e)},[e]),n}function c2(e){return e}function u2(e,t){t===void 0&&(t=c2);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 s=t(i,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(i),s=n}var c=function(){var d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function d2(e){e===void 0&&(e={});var t=u2(null);return t.options=no({async:!0,ssr:!1},e),t}var ZS=function(e){var t=e.sideCar,n=JS(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 m.createElement(r,no({},n))};ZS.isSideCarExport=!0;function f2(e,t){return e.useMedium(t),ZS}var eb=d2(),kh=function(){},sf=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:kh,onWheelCapture:kh,onTouchMoveCapture:kh}),o=r[0],i=r[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noIsolation,g=e.inert,v=e.allowPinchZoom,S=e.as,y=S===void 0?"div":S,x=e.gapMode,w=JS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=h,j=l2([n,t]),P=no(no({},w),o);return m.createElement(m.Fragment,null,d&&m.createElement(b,{sideCar:eb,removeScrollBar:u,shards:f,noIsolation:p,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:x}),s?m.cloneElement(m.Children.only(l),no(no({},P),{ref:j})):m.createElement(y,no({},P,{className:c,ref:j}),l))});sf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sf.classNames={fullWidth:Qu,zeroRight:Gu};var h2=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function m2(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=h2();return t&&e.setAttribute("nonce",t),e}function p2(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function g2(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var v2=function(){var e=0,t=null;return{add:function(n){e==0&&(t=m2())&&(p2(t,n),g2(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},y2=function(){var e=v2();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tb=function(){var e=y2(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},x2={left:0,top:0,right:0,gap:0},Rh=function(e){return parseInt(e||"",10)||0},w2=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[Rh(n),Rh(r),Rh(o)]},S2=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return x2;var t=w2(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])}},b2=tb(),da="data-scroll-locked",C2=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
-
.`.concat(o2,` {
|
|
19
|
-
overflow: hidden `).concat(r,`;
|
|
20
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
21
|
-
}
|
|
22
|
-
body[`).concat(da,`] {
|
|
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(s,`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(Gu,` {
|
|
36
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(Qu,` {
|
|
40
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.`).concat(Gu," .").concat(Gu,` {
|
|
44
|
-
right: 0 `).concat(r,`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.`).concat(Qu," .").concat(Qu,` {
|
|
48
|
-
margin-right: 0 `).concat(r,`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
body[`).concat(da,`] {
|
|
52
|
-
`).concat(i2,": ").concat(l,`px;
|
|
53
|
-
}
|
|
54
|
-
`)},K0=function(){var e=parseInt(document.body.getAttribute(da)||"0",10);return isFinite(e)?e:0},E2=function(){m.useEffect(function(){return document.body.setAttribute(da,(K0()+1).toString()),function(){var e=K0()-1;e<=0?document.body.removeAttribute(da):document.body.setAttribute(da,e.toString())}},[])},j2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;E2();var i=m.useMemo(function(){return S2(o)},[o]);return m.createElement(b2,{styles:C2(i,!t,o,n?"":"!important")})},Rm=!1;if(typeof window<"u")try{var pu=Object.defineProperty({},"passive",{get:function(){return Rm=!0,!0}});window.addEventListener("test",pu,pu),window.removeEventListener("test",pu,pu)}catch{Rm=!1}var Ms=Rm?{passive:!1}:!1,P2=function(e){return e.tagName==="TEXTAREA"},nb=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!P2(e)&&n[t]==="visible")},T2=function(e){return nb(e,"overflowY")},k2=function(e){return nb(e,"overflowX")},Y0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=rb(e,r);if(o){var i=ob(e,r),s=i[1],l=i[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},R2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},rb=function(e,t){return e==="v"?T2(t):k2(t)},ob=function(e,t){return e==="v"?R2(t):_2(t)},D2=function(e,t){return e==="h"&&t==="rtl"?-1:1},I2=function(e,t,n,r,o){var i=D2(e,window.getComputedStyle(t).direction),s=i*r,l=n.target,c=t.contains(l),u=!1,d=s>0,f=0,h=0;do{var p=ob(e,l),g=p[0],v=p[1],S=p[2],y=v-S-i*g;(g||y)&&rb(e,l)&&(f+=y,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},gu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},X0=function(e){return[e.deltaX,e.deltaY]},J0=function(e){return e&&"current"in e?e.current:e},A2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},N2=function(e){return`
|
|
55
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
-
`)},M2=0,Os=[];function O2(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(M2++)[0],i=m.useState(tb)[0],s=m.useRef(e);m.useEffect(function(){s.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=r2([e.lockRef.current],(e.shards||[]).map(J0),!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=m.useCallback(function(v,S){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var y=gu(v),x=n.current,w="deltaX"in v?v.deltaX:x[0]-y[0],b="deltaY"in v?v.deltaY:x[1]-y[1],j,P=v.target,E=Math.abs(w)>Math.abs(b)?"h":"v";if("touches"in v&&E==="h"&&P.type==="range")return!1;var T=Y0(E,P);if(!T)return!0;if(T?j=E:(j=E==="v"?"h":"v",T=Y0(E,P)),!T)return!1;if(!r.current&&"changedTouches"in v&&(w||b)&&(r.current=j),!j)return!0;var _=r.current||j;return I2(_,S,v,_==="h"?w:b,!0)},[]),c=m.useCallback(function(v){var S=v;if(!(!Os.length||Os[Os.length-1]!==i)){var y="deltaY"in S?X0(S):gu(S),x=t.current.filter(function(j){return j.name===S.type&&(j.target===S.target||S.target===j.shadowParent)&&A2(j.delta,y)})[0];if(x&&x.should){S.cancelable&&S.preventDefault();return}if(!x){var w=(s.current.shards||[]).map(J0).filter(Boolean).filter(function(j){return j.contains(S.target)}),b=w.length>0?l(S,w[0]):!s.current.noIsolation;b&&S.cancelable&&S.preventDefault()}}},[]),u=m.useCallback(function(v,S,y,x){var w={name:v,delta:S,target:y,should:x,shadowParent:$2(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(b){return b!==w})},1)},[]),d=m.useCallback(function(v){n.current=gu(v),r.current=void 0},[]),f=m.useCallback(function(v){u(v.type,X0(v),v.target,l(v,e.lockRef.current))},[]),h=m.useCallback(function(v){u(v.type,gu(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Os.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ms),document.addEventListener("touchmove",c,Ms),document.addEventListener("touchstart",d,Ms),function(){Os=Os.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ms),document.removeEventListener("touchmove",c,Ms),document.removeEventListener("touchstart",d,Ms)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(i,{styles:N2(o)}):null,p?m.createElement(j2,{gapMode:e.gapMode}):null)}function $2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const L2=f2(eb,O2);var af=m.forwardRef(function(e,t){return m.createElement(sf,no({},e,{ref:t,sideCar:L2}))});af.classNames=sf.classNames;function xt(e){return Object.keys(e)}function _h(e){return e&&typeof e=="object"&&!Array.isArray(e)}function vg(e,t){const n={...e},r=t;return _h(e)&&_h(t)&&Object.keys(t).forEach(o=>{_h(r[o])&&o in e?n[o]=vg(n[o],r[o]):n[o]=r[o]}),n}function F2(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function z2(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 _m(e){const t=z2(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 Dh(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function ib(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?Dh(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?Dh(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?Dh(i):i}}return r}return n}const V=ib("rem",{shouldScale:!0}),ud=ib("em");function gs(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function sb(e){return typeof e=="number"?!0:typeof e=="string"?e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!==""?!0:/[0-9]/.test(e.trim().replace("-","")[0]):!1}function Oo(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==C.Fragment:!1}function Nn(e){const t=m.createContext(null);return[({children:o,value:i})=>C.createElement(t.Provider,{value:i},o),()=>{const o=m.useContext(t);if(o===null)throw new Error(e);return o}]}function Cc(e=null){const t=m.createContext(e);return[({children:o,value:i})=>C.createElement(t.Provider,{value:i},o),()=>m.useContext(t)]}function Z0(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function dd(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function V2(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 B2(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 U2(e,t,n){return dd(e,n)===dd(t,n)}function ab({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:s}){return l=>{var g;n==null||n(l);const c=Array.from(((g=dd(l.currentTarget,e))==null?void 0:g.querySelectorAll(t))||[]).filter(v=>U2(l.currentTarget,v,e)),u=c.findIndex(v=>l.currentTarget===v),d=B2(u,c,r),f=V2(u,c,r),h=i==="rtl"?f:d,p=i==="rtl"?d:f;switch(l.key){case"ArrowRight":{s==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[h].focus(),o&&c[h].click());break}case"ArrowLeft":{s==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[p].focus(),o&&c[p].click());break}case"ArrowUp":{s==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[f].focus(),o&&c[f].click());break}case"ArrowDown":{s==="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 H2={app:100,modal:200,popover:300,overlay:400,max:9999};function Hr(e){return H2[e]}const W2=()=>{};function q2(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||W2:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function Oe(e,t="size",n=!0){if(e!==void 0)return sb(e)?n?V(e):e:`var(--${t}-${e})`}function cn(e){return Oe(e,"mantine-spacing")}function St(e){return e===void 0?"var(--mantine-radius-default)":Oe(e,"mantine-radius")}function nn(e){return Oe(e,"mantine-font-size")}function lb(e){return Oe(e,"mantine-line-height",!1)}function yg(e){if(e)return Oe(e,"mantine-shadow",!1)}function Jn(e,t){return n=>{e==null||e(n),t==null||t(n)}}function xg(e,t){return e in t.breakpoints?_m(t.breakpoints[e]):_m(e)}function Vl(e,t){const n=e.map(r=>({value:r,px:xg(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function ci(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function G2(e,t,n){var r;return n?Array.from(((r=dd(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function Q2(){const[e,t]=m.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function vu(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 wg(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function ex(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Bi(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function lf(e,t){const n=Bi(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback((...o)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...o),t)},[n,t])}const tx=["mousedown","touchstart"];function K2(e,t,n){const r=m.useRef();return m.useEffect(()=>{const o=i=>{const{target:s}=i??{};if(Array.isArray(n)){const l=(s==null?void 0:s.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(s)&&s.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else r.current&&!r.current.contains(s)&&e()};return(t||tx).forEach(i=>document.addEventListener(i,o)),()=>{(t||tx).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function cb({timeout:e=2e3}={}){const[t,n]=m.useState(null),[r,o]=m.useState(!1),[i,s]=m.useState(null),l=d=>{window.clearTimeout(i),s(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 Y2(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function X2(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function ub(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=m.useState(n?t:X2(e)),i=m.useRef();return m.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),Y2(i.current,s=>o(s.matches))},[e]),r}function J2(e,t){return ub("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const za=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Po(e,t){const n=m.useRef(!1);m.useEffect(()=>()=>{n.current=!1},[]),m.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function db({opened:e,shouldReturnFocus:t=!0}){const n=m.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Po(()=>{let o=-1;const i=s=>{s.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 Z2(e,t="body > :not(script)"){const n=wg(),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"),s=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"):!s&&!l&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:s||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 e_=/input|select|textarea|button|object/,fb="a, input, select, textarea, button, object, [tabindex]";function t_(e){return e.style.display==="none"}function n_(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(t_(n))return!1;n=n.parentNode}return!0}function hb(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Dm(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(hb(e));return(e_.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&n_(e)}function mb(e){const t=hb(e);return(Number.isNaN(t)||t>=0)&&Dm(e)}function r_(e){return Array.from(e.querySelectorAll(fb)).filter(mb)}function o_(e,t){const n=r_(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 s=o.activeElement;if(s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(i=n.filter(d=>d.getAttribute("type")==="radio"&&d.getAttribute("name")===s.getAttribute("name")).includes(r)),!i)return;t.preventDefault();const c=n[t.shiftKey?n.length-1:0];c&&c.focus()}function i_(e=!0){const t=m.useRef(),n=m.useRef(null),r=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const l=Array.from(i.querySelectorAll(fb));s=l.find(mb)||l.find(Dm)||null,!s&&Dm(i)&&(s=i)}s&&s.focus({preventScroll:!0})},o=m.useCallback(i=>{if(e){if(i===null){n.current&&(n.current(),n.current=null);return}n.current=Z2(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&r(i)}),t.current=i):t.current=null)}},[e]);return m.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const i=s=>{s.key==="Tab"&&t.current&&o_(t.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const s_=e=>(e+1)%1e6;function a_(){const[,e]=m.useReducer(s_,0);return e}const l_=C.useId||(()=>{});function c_(){const e=l_();return e?`mantine-${e.replace(/:/g,"")}`:""}function Mn(e){const t=c_(),[n,r]=m.useState(t);return za(()=>{r(wg())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function pb(e,t,n){m.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function cf(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function u_(...e){return t=>{e.forEach(n=>cf(n,t))}}function Qt(...e){return m.useCallback(u_(...e),e)}function hn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=m.useState(t!==void 0?t:n),s=(l,...c)=>{i(l),r==null||r(l,...c)};return e!==void 0?[e,r,!0]:[o,s,!1]}function Jo(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const yu="dots";function d_({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:i}){const s=Math.max(Math.trunc(e),0),[l,c]=hn({value:r,onChange:i,defaultValue:o,finalValue:o}),u=v=>{v<=0?c(1):v>s?c(s):c(v)},d=()=>u(l+1),f=()=>u(l-1),h=()=>u(1),p=()=>u(s);return{range:m.useMemo(()=>{if(t*2+3+n*2>=s)return Jo(1,s);const S=Math.max(l-t,n),y=Math.min(l+t,s-n),x=S>n+2,w=y<s-(n+1);if(!x&&w){const b=t*2+n+2;return[...Jo(1,b),yu,...Jo(s-(n-1),s)]}if(x&&!w){const b=n+1+2*t;return[...Jo(1,n),yu,...Jo(s-b,s)]}return[...Jo(1,n),yu,...Jo(S,y),yu,...Jo(s-n+1,s)]},[s,t,l]),active:l,setPage:u,next:d,previous:f,first:h,last:p}}function Sg(e,t){return ub("(prefers-reduced-motion: reduce)",e,t)}function f_(e=!1,t){const{onOpen:n,onClose:r}={},[o,i]=m.useState(e),s=m.useCallback(()=>{i(u=>u||(n==null||n(),!0))},[n]),l=m.useCallback(()=>{i(u=>u&&(r==null||r(),!1))},[r]),c=m.useCallback(()=>{o?l():s()},[l,s,o]);return[o,{open:s,close:l,toggle:c}]}function h_(e,t,n={autoInvoke:!1}){const r=m.useRef(null),o=m.useCallback((...s)=>{r.current||(r.current=window.setTimeout(()=>{e(s),r.current=null},t))},[t]),i=m.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return m.useEffect(()=>(n.autoInvoke&&o(),i),[i,o]),{start:o,clear:i}}function m_(e,t,n){const r=m.useRef(),o=m.useRef(null);return m.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 s;(s=r.current)==null||s.disconnect()}},[e,t]),o}function p_(){const[e,t]=m.useState(!1);return m.useEffect(()=>t(!0),[]),e}var g_={};function gb(){return typeof process<"u"&&g_?"production":"development"}function vb(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=vb(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=vb(e))&&(r&&(r+=" "),r+=t);return r}const v_={};function y_(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 uf({theme:e,classNames:t,props:n,stylesCtx:r}){const i=(Array.isArray(t)?t:[t]).map(s=>typeof s=="function"?s(e,n,r):s||v_);return y_(i)}function fd({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((i,s)=>typeof s=="function"?{...i,...s(e,n,r)}:{...i,...s},{})}const bg=m.createContext(null);function Va(){const e=m.useContext(bg);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function x_(){return Va().cssVariablesResolver}function w_(){return Va().classNamesPrefix}function Cg(){return Va().getStyleNonce}function S_(){return Va().withStaticClasses}function b_(){return Va().headless}function C_(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function E_(e){let t=e.replace("#","");if(t.length===3){const s=t.split("");t=[s[0],s[0],s[1],s[1],s[2],s[2]].join("")}if(t.length===8){const s=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:s}}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 j_(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 P_(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,s=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,p;return c>=0&&c<1?(f=l,h=u,p=0):c>=1&&c<2?(f=u,h=l,p=0):c>=2&&c<3?(f=0,h=l,p=u):c>=3&&c<4?(f=0,h=u,p=l):c>=4&&c<5?(f=u,h=0,p=l):(f=l,h=0,p=u),{r:Math.round((f+d)*255),g:Math.round((h+d)*255),b:Math.round((p+d)*255),a:s||1}}function Eg(e){return C_(e)?E_(e):e.startsWith("rgb")?j_(e):e.startsWith("hsl")?P_(e):{r:0,g:0,b:0,a:1}}function xu(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=Eg(e),s=1-t,l=c=>Math.round(c*s);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function Bl(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Ih(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function T_(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function k_(e){if(e.startsWith("oklch("))return(T_(e)||0)/100;const{r:t,g:n,b:r}=Eg(e),o=t/255,i=n/255,s=r/255,l=Ih(o),c=Ih(i),u=Ih(s);return .2126*l+.7152*c+.0722*u}function al(e,t=.179){return e.startsWith("var(")?!1:k_(e)>t}function uo({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:al(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:al(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:al(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),i=o?Number(o):void 0,s=r in t.colors;if(s){const l=i!==void 0?t.colors[r][i]:t.colors[r][Bl(t,n||"light")];return{color:r,value:l,shade:i,isThemeColor:s,isLight:al(l,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:s,isLight:al(e,t.luminanceThreshold),shade:i,variable:void 0}}function wt(e,t){const n=uo({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Im(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=wt(n.from,t),o=wt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function fr(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}=Eg(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const $s=fr,R_=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=uo({color:e,theme:t}),s=typeof o=="boolean"?o:t.autoContrast;if(n==="filled"){const l=s&&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:`${V(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:`${V(1)} solid transparent`}:{background:e,hover:xu(e,.1),color:l,border:`${V(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:`${V(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:fr(l,.1),hover:fr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${V(1)} solid transparent`}}return{background:fr(e,.1),hover:fr(e,.12),color:e,border:`${V(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:`${V(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:fr(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${V(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:fr(e,.05),color:e,border:`${V(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:`${V(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:"transparent",hover:fr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${V(1)} solid transparent`}}return{background:"transparent",hover:fr(e,.12),color:e,border:`${V(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${V(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${V(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${V(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:xu(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${V(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:xu(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${V(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:xu(t.white,.01),color:e,border:`${V(1)} solid transparent`}:n==="gradient"?{background:Im(r,t),hover:Im(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:`${V(1)} solid var(--mantine-color-default-border)`}:{}},__={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"]},nx="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",jg={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:__,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:R_,autoContrast:!1,luminanceThreshold:.3,fontFamily:nx,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:nx,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:V(34),lineHeight:"1.3"},h2:{fontSize:V(26),lineHeight:"1.35"},h3:{fontSize:V(22),lineHeight:"1.4"},h4:{fontSize:V(18),lineHeight:"1.45"},h5:{fontSize:V(16),lineHeight:"1.5"},h6:{fontSize:V(14),lineHeight:"1.5"}}},fontSizes:{xs:V(12),sm:V(14),md:V(16),lg:V(18),xl:V(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:V(2),sm:V(4),md:V(8),lg:V(16),xl:V(32)},spacing:{xs:V(10),sm:V(12),md:V(16),lg:V(20),xl:V(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), 0 ${V(1)} ${V(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${V(10)} ${V(15)} ${V(-5)}, rgba(0, 0, 0, 0.04) 0 ${V(7)} ${V(7)} ${V(-5)}`,md:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${V(20)} ${V(25)} ${V(-5)}, rgba(0, 0, 0, 0.04) 0 ${V(10)} ${V(10)} ${V(-5)}`,lg:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${V(28)} ${V(23)} ${V(-7)}, rgba(0, 0, 0, 0.04) 0 ${V(12)} ${V(12)} ${V(-7)}`,xl:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${V(36)} ${V(28)} ${V(-7)}, rgba(0, 0, 0, 0.04) 0 ${V(17)} ${V(17)} ${V(-7)}`},other:{},components:{}};function rx(e){return e==="auto"||e==="dark"||e==="light"}function D_({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 rx(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&&rx(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const I_="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",ox="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Ah(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function ix(e){if(!(e.primaryColor in e.colors))throw new Error(I_);if(typeof e.primaryShade=="object"&&(!Ah(e.primaryShade.dark)||!Ah(e.primaryShade.light)))throw new Error(ox);if(typeof e.primaryShade=="number"&&!Ah(e.primaryShade))throw new Error(ox)}function A_(e,t){var r;if(!t)return ix(e),e;const n=vg(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),ix(n),n}const Pg=m.createContext(null),N_=()=>m.useContext(Pg)||jg;function $t(){const e=m.useContext(Pg);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 yb({theme:e,children:t,inherit:n=!0}){const r=N_(),o=m.useMemo(()=>A_(n?r:jg,e),[e,r,n]);return C.createElement(Pg.Provider,{value:o},t)}yb.displayName="@mantine/core/MantineThemeProvider";function M_(){const e=$t(),t=Cg(),n=xt(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),s=_m(e.breakpoints[o]),l=i?`${s-.1}px`:ud(s-.1),c=i?`${s}px`:ud(s);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 C.createElement("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function Nh(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Mh(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function O_(e,t){const n=Nh(e.variables),r=n?Mh(t,n):"",o=Nh(e.dark),i=o?Mh(`${t}[data-mantine-color-scheme="dark"]`,o):"",s=Nh(e.light),l=s?Mh(`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${i}${l}`}function vs({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&uo({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function sx(e,t){return vs({color:e.colors[e.primaryColor][Bl(e,t)],theme:e,autoContrast:null})}function wu({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const l=Bl(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`]:$s(e.colors[t][l],.1),[`--mantine-color-${r}-light-hover`]:$s(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`]:$s(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=Bl(e,"dark"),s={[`--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`]:$s(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:$s(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`]:$s(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],...s}:s}function $_(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Ls(e,t,n){xt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const xb=e=>{const t=Bl(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:V(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":sx(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":sx(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)"}};Ls(r.variables,e.breakpoints,"breakpoint"),Ls(r.variables,e.spacing,"spacing"),Ls(r.variables,e.fontSizes,"font-size"),Ls(r.variables,e.lineHeights,"line-height"),Ls(r.variables,e.shadows,"shadow"),Ls(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((i,s)=>{r.variables[`--mantine-primary-color-${s}`]=`var(--mantine-color-${e.primaryColor}-${s})`}),xt(e.colors).forEach(i=>{const s=e.colors[i];if($_(s)){Object.assign(r.light,wu({theme:e,name:s.name,color:s.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,wu({theme:e,name:s.name,color:s.dark,colorScheme:"dark",withColorValues:!0}));return}s.forEach((l,c)=>{r.variables[`--mantine-color-${i}-${c}`]=l}),Object.assign(r.light,wu({theme:e,color:i,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,wu({theme:e,color:i,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return xt(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 L_({theme:e,generator:t}){const n=xb(e),r=t==null?void 0:t(e);return r?vg(n,r):n}const Oh=xb(jg);function F_(e){const t={variables:{},light:{},dark:{}};return xt(e.variables).forEach(n=>{Oh.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),xt(e.light).forEach(n=>{Oh.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),xt(e.dark).forEach(n=>{Oh.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function z_(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 wb({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=$t(),r=Cg(),o=x_(),i=L_({theme:n,generator:o}),s=e===":root"&&t,l=s?F_(i):i,c=O_(l,e);return c?C.createElement("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${c}${s?"":z_(e)}`}}):null}wb.displayName="@mantine/CssVariables";function V_(){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 Fs(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 B_({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=m.useRef(),[i,s]=m.useState(()=>e.get(t)),l=r||i,c=m.useCallback(d=>{r||(Fs(d,n),s(d),e.set(d))},[e.set,l,r]),u=m.useCallback(()=>{s(t),Fs(t,n),e.clear()},[e.clear,t]);return m.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),za(()=>{Fs(e.get(t),n)},[]),m.useEffect(()=>{var f;if(r)return Fs(r,n),()=>{};r===void 0&&Fs(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const d=h=>{i==="auto"&&Fs(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 U_({respectReducedMotion:e,getRootElement:t}){za(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}V_();function Sb({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:i=!0,withCssVariables:s=!0,cssVariablesSelector:l=":root",classNamesPrefix:c="mantine",colorSchemeManager:u=D_(),defaultColorScheme:d="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:p}){const{colorScheme:g,setColorScheme:v,clearColorScheme:S}=B_({defaultColorScheme:d,forceColorScheme:p,manager:u,getRootElement:f});return U_({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:f}),C.createElement(bg.Provider,{value:{colorScheme:g,setColorScheme:v,clearColorScheme:S,getRootElement:f,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:l,withStaticClasses:r}},C.createElement(yb,{theme:e},s&&C.createElement(wb,{cssVariablesSelector:l,deduplicateCssVariables:i}),o&&C.createElement(M_,null),t))}Sb.displayName="@mantine/core/MantineProvider";function Ec({classNames:e,styles:t,props:n,stylesCtx:r}){const o=$t();return{resolvedClassNames:uf({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:fd({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const H_={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function W_({theme:e,options:t,unstyled:n}){return rt((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||H_[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function q_({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return uf({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function G_({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return uf({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function Q_({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function K_({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function Y_({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function X_({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var s,l;return(l=uf({theme:t,classNames:(s=t.components[i])==null?void 0:s.classNames,props:r,stylesCtx:o}))==null?void 0:l[n]})}function J_({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function Z_({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:i,classes:s,unstyled:l,className:c,rootSelector:u,props:d,stylesCtx:f,withStaticClasses:h,headless:p}){return rt(W_({theme:e,options:t,unstyled:l||p}),X_({theme:e,themeName:n,selector:r,props:d,stylesCtx:f}),J_({options:t,classes:s,selector:r,unstyled:l}),G_({selector:r,stylesCtx:f,theme:e,classNames:i,props:d}),q_({selector:r,stylesCtx:f,options:t,props:d,theme:e}),Q_({rootSelector:u,selector:r,className:c}),K_({selector:r,classes:s,unstyled:l||p}),h&&!p&&Y_({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function eD({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var s;return fd({theme:e,styles:(s=e.components[i])==null?void 0:s.styles,props:n,stylesCtx:r})[o]}).reduce((i,s)=>({...i,...s}),{})}function Am({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Am({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function tD(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...gs(n[r])}}),t),{})}function nD({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:s,headless:l}){var c;return(c=tD([l?{}:t==null?void 0:t(n,r,o),...s.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 rD({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:s,styles:l,style:c,vars:u,varsResolver:d,headless:f}){return{...eD({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...fd({theme:e,styles:l,props:o,stylesCtx:i})[n],...fd({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...nD({theme:e,props:o,stylesCtx:i,vars:u,varsResolver:d,selector:n,themeName:t,headless:f}),...s===n?Am({style:c,theme:e}):null,...Am({style:r==null?void 0:r.style,theme:e})}}function me({name:e,classes:t,props:n,stylesCtx:r,className:o,style:i,rootSelector:s="root",unstyled:l,classNames:c,styles:u,vars:d,varsResolver:f}){const h=$t(),p=w_(),g=S_(),v=b_(),S=(Array.isArray(e)?e:[e]).filter(y=>y);return(y,x)=>({className:Z_({theme:h,options:x,themeName:S,selector:y,classNamesPrefix:p,classNames:c,classes:t,unstyled:l,className:o,rootSelector:s,props:n,stylesCtx:r,withStaticClasses:g,headless:v}),style:rD({theme:h,themeName:S,selector:y,options:x,props:n,stylesCtx:r,rootSelector:s,styles:u,style:i,vars:d,varsResolver:f,headless:v})})}function jc(e,t){return typeof e=="boolean"?e:t.autoContrast}function ax(){const e=document.createElement("style");return e.innerHTML="*, *::before, *::after {transition: none !important;}",e.setAttribute("data-mantine-disable-transition","true"),document.head.appendChild(e),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(n=>n.remove())}function oD({keepTransitions:e}={}){const t=m.useRef(),n=m.useRef(),r=m.useContext(bg);if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const o=u=>{r.setColorScheme(u),t.current=e?()=>{}:ax(),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var d;(d=t.current)==null||d.call(t)},10)},i=()=>{r.clearColorScheme(),t.current=e?()=>{}:ax(),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var u;(u=t.current)==null||u.call(t)},10)},s=J2("light",{getInitialValueInEffect:!1}),l=r.colorScheme==="auto"?s:r.colorScheme,c=m.useCallback(()=>o(l==="light"?"dark":"light"),[o,l]);return m.useEffect(()=>()=>{var u;(u=t.current)==null||u.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:o,clearColorScheme:i,toggleColorScheme:c}}function U(e,t,n){var s;const r=$t(),o=(s=r.components[e])==null?void 0:s.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...gs(n)}}function lx(e){return xt(e).reduce((t,n)=>e[n]!==void 0?`${t}${F2(n)}:${e[n]};`:t,"").trim()}function iD({selector:e,styles:t,media:n}){const r=t?lx(t):"",o=Array.isArray(n)?n.map(i=>`@media${i.query}{${e}{${lx(i.styles)}}}`):[];return`${r?`${e}{${r}}`:""}${o.join("")}`.trim()}function Ba({selector:e,styles:t,media:n}){const r=Cg();return C.createElement("style",{"data-mantine-styles":"inline",nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:iD({selector:e,styles:t,media:n})}})}function $o(e){const{m:t,mx:n,my:r,mt:o,mb:i,ml:s,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:p,pb:g,pl:v,pr:S,pe:y,ps:x,bg:w,c:b,opacity:j,ff:P,fz:E,fw:T,lts:_,ta:R,lh:O,fs:I,tt:M,td:F,w:N,miw:A,maw:D,h:k,mih:L,mah:B,bgsz:H,bgp:J,bgr:we,bga:ie,pos:Ce,top:_e,left:Pe,bottom:ue,right:Ue,inset:bt,display:at,flex:ve,hiddenFrom:Le,visibleFrom:Ae,lightHidden:te,darkHidden:re,...je}=e;return{styleProps:gs({m:t,mx:n,my:r,mt:o,mb:i,ml:s,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:p,pb:g,pl:v,pr:S,pe:y,ps:x,bg:w,c:b,opacity:j,ff:P,fz:E,fw:T,lts:_,ta:R,lh:O,fs:I,tt:M,td:F,w:N,miw:A,maw:D,h:k,mih:L,mah:B,bgsz:H,bgp:J,bgr:we,bga:ie,pos:Ce,top:_e,left:Pe,bottom:ue,right:Ue,inset:bt,display:at,flex:ve,hiddenFrom:Le,visibleFrom:Ae,lightHidden:te,darkHidden:re}),rest:je}}const sD={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"},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 bb(e,t){const n=uo({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 aD(e,t){const n=uo({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:bb(e,t)}const cx={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 lD(e){return typeof e=="string"&&e in cx?cx[e]:e}const cD=["h1","h2","h3","h4","h5","h6"];function uD(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&cD.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?V(e):e}function dD(e){return e}const fD=["h1","h2","h3","h4","h5","h6"];function hD(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&fD.includes(e)?`var(--mantine-${e}-line-height)`:e}function mD(e){return typeof e=="number"?V(e):e}function pD(e,t){if(typeof e=="number")return V(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return V(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const $h={color:bb,textColor:aD,fontSize:uD,spacing:pD,identity:dD,size:mD,lineHeight:hD,fontFamily:lD};function ux(e){return e.replace("(min-width: ","").replace("em)","")}function gD({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(ux(o))-Number(ux(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function vD(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function yD(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function xD(e){return typeof e=="object"&&e!==null?xt(e).filter(t=>t!=="base"):[]}function wD(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function Cb({styleProps:e,data:t,theme:n}){return gD(xt(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom")return r;const i=t[o],s=Array.isArray(i.property)?i.property:[i.property],l=yD(e[o]);if(!vD(e[o]))return s.forEach(u=>{r.inlineStyles[u]=$h[i.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=xD(e[o]);return s.forEach(u=>{l&&(r.styles[u]=$h[i.type](l,n)),c.forEach(d=>{const f=`(min-width: ${n.breakpoints[d]})`;r.media[f]={...r.media[f],[u]:$h[i.type](wD(e[o],d),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Pc(){return`__m__-${m.useId().replace(/:/g,"")}`}function Eb(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Eb(r,t)}),{}):typeof e=="function"?e(t):e??{}}function jb(e){return e.startsWith("data-")?e:`data-${e}`}function SD(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[jb(n)]=e[n]),t},{})}function Pb(e){return e?typeof e=="string"?{[jb(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...Pb(n)}),{}):SD(e):null}function Nm(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Nm(r,t)}),{}):typeof e=="function"?e(t):e??{}}function bD({theme:e,style:t,vars:n,styleProps:r}){const o=Nm(t,e),i=Nm(n,e);return{...o,...i,...r}}const Tb=m.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:i,size:s,hiddenFrom:l,visibleFrom:c,lightHidden:u,darkHidden:d,renderRoot:f,...h},p)=>{const g=$t(),v=e||"div",{styleProps:S,rest:y}=$o(h),x=Pc(),w=Cb({styleProps:S,theme:g,data:sD}),b={ref:p,style:bD({theme:g,style:t,vars:n,styleProps:w.inlineStyles}),className:rt(r,{[x]:w.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":d,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${c}`]:c}),"data-variant":o,"data-size":sb(s)?void 0:s||void 0,...Pb(i),...y};return C.createElement(C.Fragment,null,w.hasResponsiveStyles&&C.createElement(Ba,{selector:`.${x}`,styles:w.styles,media:w.media}),typeof f=="function"?f(b):C.createElement(v,{...b}))});Tb.displayName="@mantine/core/Box";const G=Tb;function kb(e){return e}function X(e){const t=m.forwardRef(e);return t.extend=kb,t}function bn(e){const t=m.forwardRef(e);return t.extend=kb,t}const CD=m.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Ua(){return m.useContext(CD)}var Rb={exports:{}},sr={},_b={exports:{}},Db={};/**
|
|
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(k,L){var B=k.length;k.push(L);e:for(;0<B;){var H=B-1>>>1,J=k[H];if(0<o(J,L))k[H]=L,k[B]=J,B=H;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var L=k[0],B=k.pop();if(B!==L){k[0]=B;e:for(var H=0,J=k.length,we=J>>>1;H<we;){var ie=2*(H+1)-1,Ce=k[ie],_e=ie+1,Pe=k[_e];if(0>o(Ce,B))_e<J&&0>o(Pe,Ce)?(k[H]=Pe,k[_e]=B,H=_e):(k[H]=Ce,k[ie]=B,H=ie);else if(_e<J&&0>o(Pe,B))k[H]=Pe,k[_e]=B,H=_e;else break e}}return L}function o(k,L){var B=k.sortIndex-L.sortIndex;return B!==0?B:k.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,g=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(k){for(var L=n(u);L!==null;){if(L.callback===null)r(u);else if(L.startTime<=k)r(u),L.sortIndex=L.expirationTime,t(c,L);else break;L=n(u)}}function b(k){if(v=!1,w(k),!g)if(n(c)!==null)g=!0,A(j);else{var L=n(u);L!==null&&D(b,L.startTime-k)}}function j(k,L){g=!1,v&&(v=!1,y(T),T=-1),p=!0;var B=h;try{for(w(L),f=n(c);f!==null&&(!(f.expirationTime>L)||k&&!O());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var J=H(f.expirationTime<=L);L=e.unstable_now(),typeof J=="function"?f.callback=J:f===n(c)&&r(c),w(L)}else r(c);f=n(c)}if(f!==null)var we=!0;else{var ie=n(u);ie!==null&&D(b,ie.startTime-L),we=!1}return we}finally{f=null,h=B,p=!1}}var P=!1,E=null,T=-1,_=5,R=-1;function O(){return!(e.unstable_now()-R<_)}function I(){if(E!==null){var k=e.unstable_now();R=k;var L=!0;try{L=E(!0,k)}finally{L?M():(P=!1,E=null)}}else P=!1}var M;if(typeof x=="function")M=function(){x(I)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,N=F.port2;F.port1.onmessage=I,M=function(){N.postMessage(null)}}else M=function(){S(I,0)};function A(k){E=k,P||(P=!0,M())}function D(k,L){T=S(function(){k(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,A(j))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(k){switch(h){case 1:case 2:case 3:var L=3;break;default:L=h}var B=h;h=L;try{return k()}finally{h=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,L){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var B=h;h=k;try{return L()}finally{h=B}},e.unstable_scheduleCallback=function(k,L,B){var H=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?H+B:H):B=H,k){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=B+J,k={id:d++,callback:L,priorityLevel:k,startTime:B,expirationTime:J,sortIndex:-1},B>H?(k.sortIndex=B,t(u,k),n(c)===null&&k===n(u)&&(v?(y(T),T=-1):v=!0,D(b,B-H))):(k.sortIndex=J,t(c,k),g||p||(g=!0,A(j))),k},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(k){var L=h;return function(){var B=h;h=L;try{return k.apply(this,arguments)}finally{h=B}}}})(Db);_b.exports=Db;var ED=_b.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 Ib=m,nr=ED;function Z(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 Ab=new Set,Ul={};function ys(e,t){Sa(e,t),Sa(e+"Capture",t)}function Sa(e,t){for(Ul[e]=t,e=0;e<t.length;e++)Ab.add(t[e])}var To=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mm=Object.prototype.hasOwnProperty,jD=/^[: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]*$/,dx={},fx={};function PD(e){return Mm.call(fx,e)?!0:Mm.call(dx,e)?!1:jD.test(e)?fx[e]=!0:(dx[e]=!0,!1)}function TD(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 kD(e,t,n,r){if(t===null||typeof t>"u"||TD(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 On(e,t,n,r,o,i,s){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=s}var mn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mn[e]=new On(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mn[t]=new On(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mn[e]=new On(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mn[e]=new On(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){mn[e]=new On(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mn[e]=new On(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mn[e]=new On(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mn[e]=new On(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mn[e]=new On(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tg=/[\-:]([a-z])/g;function kg(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(Tg,kg);mn[t]=new On(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(Tg,kg);mn[t]=new On(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(Tg,kg);mn[t]=new On(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mn[e]=new On(e,1,!1,e.toLowerCase(),null,!1,!1)});mn.xlinkHref=new On("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mn[e]=new On(e,1,!1,e.toLowerCase(),null,!0,!0)});function Rg(e,t,n,r){var o=mn.hasOwnProperty(t)?mn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(kD(t,n,o,r)&&(n=null),r||o===null?PD(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 Lo=Ib.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Su=Symbol.for("react.element"),Ks=Symbol.for("react.portal"),Ys=Symbol.for("react.fragment"),_g=Symbol.for("react.strict_mode"),Om=Symbol.for("react.profiler"),Nb=Symbol.for("react.provider"),Mb=Symbol.for("react.context"),Dg=Symbol.for("react.forward_ref"),$m=Symbol.for("react.suspense"),Lm=Symbol.for("react.suspense_list"),Ig=Symbol.for("react.memo"),ti=Symbol.for("react.lazy"),Ob=Symbol.for("react.offscreen"),hx=Symbol.iterator;function ll(e){return e===null||typeof e!="object"?null:(e=hx&&e[hx]||e["@@iterator"],typeof e=="function"?e:null)}var Ot=Object.assign,Lh;function El(e){if(Lh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Lh=t&&t[1]||""}return`
|
|
77
|
-
`+Lh+e}var Fh=!1;function zh(e,t){if(!e||Fh)return"";Fh=!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
|
-
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var c=`
|
|
80
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{Fh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?El(e):""}function RD(e){switch(e.tag){case 5:return El(e.type);case 16:return El("Lazy");case 13:return El("Suspense");case 19:return El("SuspenseList");case 0:case 2:case 15:return e=zh(e.type,!1),e;case 11:return e=zh(e.type.render,!1),e;case 1:return e=zh(e.type,!0),e;default:return""}}function Fm(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 Ys:return"Fragment";case Ks:return"Portal";case Om:return"Profiler";case _g:return"StrictMode";case $m:return"Suspense";case Lm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Mb:return(e.displayName||"Context")+".Consumer";case Nb:return(e._context.displayName||"Context")+".Provider";case Dg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ig:return t=e.displayName||null,t!==null?t:Fm(e.type)||"Memo";case ti:t=e._payload,e=e._init;try{return Fm(e(t))}catch{}}return null}function _D(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 Fm(t);case 8:return t===_g?"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 Ci(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $b(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function DD(e){var t=$b(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(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bu(e){e._valueTracker||(e._valueTracker=DD(e))}function Lb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$b(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function hd(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 zm(e,t){var n=t.checked;return Ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ci(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 Fb(e,t){t=t.checked,t!=null&&Rg(e,"checked",t,!1)}function Vm(e,t){Fb(e,t);var n=Ci(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")?Bm(e,t.type,n):t.hasOwnProperty("defaultValue")&&Bm(e,t.type,Ci(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function px(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 Bm(e,t,n){(t!=="number"||hd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var jl=Array.isArray;function fa(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=""+Ci(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 Um(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Z(91));return Ot({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function gx(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Z(92));if(jl(n)){if(1<n.length)throw Error(Z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ci(n)}}function zb(e,t){var n=Ci(t.value),r=Ci(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 vx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Vb(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 Hm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Vb(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Cu,Bb=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(Cu=Cu||document.createElement("div"),Cu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Cu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _l={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},ID=["Webkit","ms","Moz","O"];Object.keys(_l).forEach(function(e){ID.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_l[t]=_l[e]})});function Ub(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_l.hasOwnProperty(e)&&_l[e]?(""+t).trim():t+"px"}function Hb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Ub(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var AD=Ot({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 Wm(e,t){if(t){if(AD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function qm(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 Gm=null;function Ag(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qm=null,ha=null,ma=null;function yx(e){if(e=Rc(e)){if(typeof Qm!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=pf(t),Qm(e.stateNode,e.type,t))}}function Wb(e){ha?ma?ma.push(e):ma=[e]:ha=e}function qb(){if(ha){var e=ha,t=ma;if(ma=ha=null,yx(e),t)for(e=0;e<t.length;e++)yx(t[e])}}function Gb(e,t){return e(t)}function Qb(){}var Vh=!1;function Kb(e,t,n){if(Vh)return e(t,n);Vh=!0;try{return Gb(e,t,n)}finally{Vh=!1,(ha!==null||ma!==null)&&(Qb(),qb())}}function Wl(e,t){var n=e.stateNode;if(n===null)return null;var r=pf(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(Z(231,t,typeof n));return n}var Km=!1;if(To)try{var cl={};Object.defineProperty(cl,"passive",{get:function(){Km=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{Km=!1}function ND(e,t,n,r,o,i,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Dl=!1,md=null,pd=!1,Ym=null,MD={onError:function(e){Dl=!0,md=e}};function OD(e,t,n,r,o,i,s,l,c){Dl=!1,md=null,ND.apply(MD,arguments)}function $D(e,t,n,r,o,i,s,l,c){if(OD.apply(this,arguments),Dl){if(Dl){var u=md;Dl=!1,md=null}else throw Error(Z(198));pd||(pd=!0,Ym=u)}}function xs(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 Yb(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 xx(e){if(xs(e)!==e)throw Error(Z(188))}function LD(e){var t=e.alternate;if(!t){if(t=xs(e),t===null)throw Error(Z(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 xx(o),e;if(i===r)return xx(o),t;i=i.sibling}throw Error(Z(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(Z(189))}}if(n.alternate!==r)throw Error(Z(190))}if(n.tag!==3)throw Error(Z(188));return n.stateNode.current===n?e:t}function Xb(e){return e=LD(e),e!==null?Jb(e):null}function Jb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Jb(e);if(t!==null)return t;e=e.sibling}return null}var Zb=nr.unstable_scheduleCallback,wx=nr.unstable_cancelCallback,FD=nr.unstable_shouldYield,zD=nr.unstable_requestPaint,Ht=nr.unstable_now,VD=nr.unstable_getCurrentPriorityLevel,Ng=nr.unstable_ImmediatePriority,eC=nr.unstable_UserBlockingPriority,gd=nr.unstable_NormalPriority,BD=nr.unstable_LowPriority,tC=nr.unstable_IdlePriority,df=null,oo=null;function UD(e){if(oo&&typeof oo.onCommitFiberRoot=="function")try{oo.onCommitFiberRoot(df,e,void 0,(e.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:qD,HD=Math.log,WD=Math.LN2;function qD(e){return e>>>=0,e===0?32:31-(HD(e)/WD|0)|0}var Eu=64,ju=4194304;function Pl(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 vd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=Pl(l):(i&=s,i!==0&&(r=Pl(i)))}else s=n&~o,s!==0?r=Pl(s):i!==0&&(r=Pl(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-Or(t),o=1<<n,r|=e[n],t&=~o;return r}function GD(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 QD(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Or(i),l=1<<s,c=o[s];c===-1?(!(l&n)||l&r)&&(o[s]=GD(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Xm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function nC(){var e=Eu;return Eu<<=1,!(Eu&4194240)&&(Eu=64),e}function Bh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Or(t),e[t]=n}function KD(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-Or(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Mg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Or(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var st=0;function rC(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var oC,Og,iC,sC,aC,Jm=!1,Pu=[],hi=null,mi=null,pi=null,ql=new Map,Gl=new Map,si=[],YD="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 Sx(e,t){switch(e){case"focusin":case"focusout":hi=null;break;case"dragenter":case"dragleave":mi=null;break;case"mouseover":case"mouseout":pi=null;break;case"pointerover":case"pointerout":ql.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gl.delete(t.pointerId)}}function ul(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=Rc(t),t!==null&&Og(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function XD(e,t,n,r,o){switch(t){case"focusin":return hi=ul(hi,e,t,n,r,o),!0;case"dragenter":return mi=ul(mi,e,t,n,r,o),!0;case"mouseover":return pi=ul(pi,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ql.set(i,ul(ql.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Gl.set(i,ul(Gl.get(i)||null,e,t,n,r,o)),!0}return!1}function lC(e){var t=Wi(e.target);if(t!==null){var n=xs(t);if(n!==null){if(t=n.tag,t===13){if(t=Yb(n),t!==null){e.blockedOn=t,aC(e.priority,function(){iC(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 Ku(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Gm=r,n.target.dispatchEvent(r),Gm=null}else return t=Rc(n),t!==null&&Og(t),e.blockedOn=n,!1;t.shift()}return!0}function bx(e,t,n){Ku(e)&&n.delete(t)}function JD(){Jm=!1,hi!==null&&Ku(hi)&&(hi=null),mi!==null&&Ku(mi)&&(mi=null),pi!==null&&Ku(pi)&&(pi=null),ql.forEach(bx),Gl.forEach(bx)}function dl(e,t){e.blockedOn===t&&(e.blockedOn=null,Jm||(Jm=!0,nr.unstable_scheduleCallback(nr.unstable_NormalPriority,JD)))}function Ql(e){function t(o){return dl(o,e)}if(0<Pu.length){dl(Pu[0],e);for(var n=1;n<Pu.length;n++){var r=Pu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(hi!==null&&dl(hi,e),mi!==null&&dl(mi,e),pi!==null&&dl(pi,e),ql.forEach(t),Gl.forEach(t),n=0;n<si.length;n++)r=si[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<si.length&&(n=si[0],n.blockedOn===null);)lC(n),n.blockedOn===null&&si.shift()}var pa=Lo.ReactCurrentBatchConfig,yd=!0;function ZD(e,t,n,r){var o=st,i=pa.transition;pa.transition=null;try{st=1,$g(e,t,n,r)}finally{st=o,pa.transition=i}}function eI(e,t,n,r){var o=st,i=pa.transition;pa.transition=null;try{st=4,$g(e,t,n,r)}finally{st=o,pa.transition=i}}function $g(e,t,n,r){if(yd){var o=Zm(e,t,n,r);if(o===null)Jh(e,t,r,xd,n),Sx(e,r);else if(XD(o,e,t,n,r))r.stopPropagation();else if(Sx(e,r),t&4&&-1<YD.indexOf(e)){for(;o!==null;){var i=Rc(o);if(i!==null&&oC(i),i=Zm(e,t,n,r),i===null&&Jh(e,t,r,xd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Jh(e,t,r,null,n)}}var xd=null;function Zm(e,t,n,r){if(xd=null,e=Ag(r),e=Wi(e),e!==null)if(t=xs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Yb(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 xd=e,null}function cC(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(VD()){case Ng:return 1;case eC:return 4;case gd:case BD:return 16;case tC:return 536870912;default:return 16}default:return 16}}var ui=null,Lg=null,Yu=null;function uC(){if(Yu)return Yu;var e,t=Lg,n=t.length,r,o="value"in ui?ui.value:ui.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Yu=o.slice(e,1<r?1-r:void 0)}function Xu(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 Tu(){return!0}function Cx(){return!1}function ar(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,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)?Tu:Cx,this.isPropagationStopped=Cx,this}return Ot(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=Tu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Tu)},persist:function(){},isPersistent:Tu}),t}var Ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fg=ar(Ha),kc=Ot({},Ha,{view:0,detail:0}),tI=ar(kc),Uh,Hh,fl,ff=Ot({},kc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zg,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!==fl&&(fl&&e.type==="mousemove"?(Uh=e.screenX-fl.screenX,Hh=e.screenY-fl.screenY):Hh=Uh=0,fl=e),Uh)},movementY:function(e){return"movementY"in e?e.movementY:Hh}}),Ex=ar(ff),nI=Ot({},ff,{dataTransfer:0}),rI=ar(nI),oI=Ot({},kc,{relatedTarget:0}),Wh=ar(oI),iI=Ot({},Ha,{animationName:0,elapsedTime:0,pseudoElement:0}),sI=ar(iI),aI=Ot({},Ha,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lI=ar(aI),cI=Ot({},Ha,{data:0}),jx=ar(cI),uI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dI={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"},fI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fI[e])?!!t[e]:!1}function zg(){return hI}var mI=Ot({},kc,{key:function(e){if(e.key){var t=uI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zg,charCode:function(e){return e.type==="keypress"?Xu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pI=ar(mI),gI=Ot({},ff,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Px=ar(gI),vI=Ot({},kc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zg}),yI=ar(vI),xI=Ot({},Ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),wI=ar(xI),SI=Ot({},ff,{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}),bI=ar(SI),CI=[9,13,27,32],Vg=To&&"CompositionEvent"in window,Il=null;To&&"documentMode"in document&&(Il=document.documentMode);var EI=To&&"TextEvent"in window&&!Il,dC=To&&(!Vg||Il&&8<Il&&11>=Il),Tx=" ",kx=!1;function fC(e,t){switch(e){case"keyup":return CI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xs=!1;function jI(e,t){switch(e){case"compositionend":return hC(t);case"keypress":return t.which!==32?null:(kx=!0,Tx);case"textInput":return e=t.data,e===Tx&&kx?null:e;default:return null}}function PI(e,t){if(Xs)return e==="compositionend"||!Vg&&fC(e,t)?(e=uC(),Yu=Lg=ui=null,Xs=!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 dC&&t.locale!=="ko"?null:t.data;default:return null}}var TI={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 Rx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!TI[e.type]:t==="textarea"}function mC(e,t,n,r){Wb(r),t=wd(t,"onChange"),0<t.length&&(n=new Fg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Al=null,Kl=null;function kI(e){jC(e,0)}function hf(e){var t=ea(e);if(Lb(t))return e}function RI(e,t){if(e==="change")return t}var pC=!1;if(To){var qh;if(To){var Gh="oninput"in document;if(!Gh){var _x=document.createElement("div");_x.setAttribute("oninput","return;"),Gh=typeof _x.oninput=="function"}qh=Gh}else qh=!1;pC=qh&&(!document.documentMode||9<document.documentMode)}function Dx(){Al&&(Al.detachEvent("onpropertychange",gC),Kl=Al=null)}function gC(e){if(e.propertyName==="value"&&hf(Kl)){var t=[];mC(t,Kl,e,Ag(e)),Kb(kI,t)}}function _I(e,t,n){e==="focusin"?(Dx(),Al=t,Kl=n,Al.attachEvent("onpropertychange",gC)):e==="focusout"&&Dx()}function DI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hf(Kl)}function II(e,t){if(e==="click")return hf(t)}function AI(e,t){if(e==="input"||e==="change")return hf(t)}function NI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fr=typeof Object.is=="function"?Object.is:NI;function Yl(e,t){if(Fr(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(!Mm.call(t,o)||!Fr(e[o],t[o]))return!1}return!0}function Ix(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ax(e,t){var n=Ix(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=Ix(n)}}function vC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yC(){for(var e=window,t=hd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=hd(e.document)}return t}function Bg(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 MI(e){var t=yC(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&vC(n.ownerDocument.documentElement,n)){if(r!==null&&Bg(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=Ax(n,i);var s=Ax(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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 OI=To&&"documentMode"in document&&11>=document.documentMode,Js=null,ep=null,Nl=null,tp=!1;function Nx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tp||Js==null||Js!==hd(r)||(r=Js,"selectionStart"in r&&Bg(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}),Nl&&Yl(Nl,r)||(Nl=r,r=wd(ep,"onSelect"),0<r.length&&(t=new Fg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Js)))}function ku(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zs={animationend:ku("Animation","AnimationEnd"),animationiteration:ku("Animation","AnimationIteration"),animationstart:ku("Animation","AnimationStart"),transitionend:ku("Transition","TransitionEnd")},Qh={},xC={};To&&(xC=document.createElement("div").style,"AnimationEvent"in window||(delete Zs.animationend.animation,delete Zs.animationiteration.animation,delete Zs.animationstart.animation),"TransitionEvent"in window||delete Zs.transitionend.transition);function mf(e){if(Qh[e])return Qh[e];if(!Zs[e])return e;var t=Zs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in xC)return Qh[e]=t[n];return e}var wC=mf("animationend"),SC=mf("animationiteration"),bC=mf("animationstart"),CC=mf("transitionend"),EC=new Map,Mx="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 Ri(e,t){EC.set(e,t),ys(t,[e])}for(var Kh=0;Kh<Mx.length;Kh++){var Yh=Mx[Kh],$I=Yh.toLowerCase(),LI=Yh[0].toUpperCase()+Yh.slice(1);Ri($I,"on"+LI)}Ri(wC,"onAnimationEnd");Ri(SC,"onAnimationIteration");Ri(bC,"onAnimationStart");Ri("dblclick","onDoubleClick");Ri("focusin","onFocus");Ri("focusout","onBlur");Ri(CC,"onTransitionEnd");Sa("onMouseEnter",["mouseout","mouseover"]);Sa("onMouseLeave",["mouseout","mouseover"]);Sa("onPointerEnter",["pointerout","pointerover"]);Sa("onPointerLeave",["pointerout","pointerover"]);ys("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ys("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ys("onBeforeInput",["compositionend","keypress","textInput","paste"]);ys("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tl="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(" "),FI=new Set("cancel close invalid load scroll toggle".split(" ").concat(Tl));function Ox(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,$D(r,t,void 0,e),e.currentTarget=null}function jC(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 s=r.length-1;0<=s;s--){var l=r[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;Ox(o,l,u),i=c}else for(s=0;s<r.length;s++){if(l=r[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;Ox(o,l,u),i=c}}}if(pd)throw e=Ym,pd=!1,Ym=null,e}function Et(e,t){var n=t[sp];n===void 0&&(n=t[sp]=new Set);var r=e+"__bubble";n.has(r)||(PC(t,e,2,!1),n.add(r))}function Xh(e,t,n){var r=0;t&&(r|=4),PC(n,e,r,t)}var Ru="_reactListening"+Math.random().toString(36).slice(2);function Xl(e){if(!e[Ru]){e[Ru]=!0,Ab.forEach(function(n){n!=="selectionchange"&&(FI.has(n)||Xh(n,!1,e),Xh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ru]||(t[Ru]=!0,Xh("selectionchange",!1,t))}}function PC(e,t,n,r){switch(cC(t)){case 1:var o=ZD;break;case 4:o=eI;break;default:o=$g}n=o.bind(null,t,n,e),o=void 0,!Km||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 Jh(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;s=s.return}for(;l!==null;){if(s=Wi(l),s===null)return;if(c=s.tag,c===5||c===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Kb(function(){var u=i,d=Ag(n),f=[];e:{var h=EC.get(e);if(h!==void 0){var p=Fg,g=e;switch(e){case"keypress":if(Xu(n)===0)break e;case"keydown":case"keyup":p=pI;break;case"focusin":g="focus",p=Wh;break;case"focusout":g="blur",p=Wh;break;case"beforeblur":case"afterblur":p=Wh;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":p=Ex;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=rI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=yI;break;case wC:case SC:case bC:p=sI;break;case CC:p=wI;break;case"scroll":p=tI;break;case"wheel":p=bI;break;case"copy":case"cut":case"paste":p=lI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Px}var v=(t&4)!==0,S=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var x=u,w;x!==null;){w=x;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,y!==null&&(b=Wl(x,y),b!=null&&v.push(Jl(x,b,w)))),S)break;x=x.return}0<v.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Gm&&(g=n.relatedTarget||n.fromElement)&&(Wi(g)||g[ko]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?Wi(g):null,g!==null&&(S=xs(g),g!==S||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(v=Ex,b="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=Px,b="onPointerLeave",y="onPointerEnter",x="pointer"),S=p==null?h:ea(p),w=g==null?h:ea(g),h=new v(b,x+"leave",p,n,d),h.target=S,h.relatedTarget=w,b=null,Wi(d)===u&&(v=new v(y,x+"enter",g,n,d),v.target=w,v.relatedTarget=S,b=v),S=b,p&&g)t:{for(v=p,y=g,x=0,w=v;w;w=zs(w))x++;for(w=0,b=y;b;b=zs(b))w++;for(;0<x-w;)v=zs(v),x--;for(;0<w-x;)y=zs(y),w--;for(;x--;){if(v===y||y!==null&&v===y.alternate)break t;v=zs(v),y=zs(y)}v=null}else v=null;p!==null&&$x(f,h,p,v,!1),g!==null&&S!==null&&$x(f,S,g,v,!0)}}e:{if(h=u?ea(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var j=RI;else if(Rx(h))if(pC)j=AI;else{j=DI;var P=_I}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=II);if(j&&(j=j(e,u))){mC(f,j,n,d);break e}P&&P(e,h,u),e==="focusout"&&(P=h._wrapperState)&&P.controlled&&h.type==="number"&&Bm(h,"number",h.value)}switch(P=u?ea(u):window,e){case"focusin":(Rx(P)||P.contentEditable==="true")&&(Js=P,ep=u,Nl=null);break;case"focusout":Nl=ep=Js=null;break;case"mousedown":tp=!0;break;case"contextmenu":case"mouseup":case"dragend":tp=!1,Nx(f,n,d);break;case"selectionchange":if(OI)break;case"keydown":case"keyup":Nx(f,n,d)}var E;if(Vg)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Xs?fC(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(dC&&n.locale!=="ko"&&(Xs||T!=="onCompositionStart"?T==="onCompositionEnd"&&Xs&&(E=uC()):(ui=d,Lg="value"in ui?ui.value:ui.textContent,Xs=!0)),P=wd(u,T),0<P.length&&(T=new jx(T,e,null,n,d),f.push({event:T,listeners:P}),E?T.data=E:(E=hC(n),E!==null&&(T.data=E)))),(E=EI?jI(e,n):PI(e,n))&&(u=wd(u,"onBeforeInput"),0<u.length&&(d=new jx("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=E))}jC(f,t)})}function Jl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Wl(e,n),i!=null&&r.unshift(Jl(e,i,o)),i=Wl(e,t),i!=null&&r.push(Jl(e,i,o))),e=e.return}return r}function zs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $x(e,t,n,r,o){for(var i=t._reactName,s=[];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=Wl(n,i),c!=null&&s.unshift(Jl(n,c,l))):o||(c=Wl(n,i),c!=null&&s.push(Jl(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var zI=/\r\n?/g,VI=/\u0000|\uFFFD/g;function Lx(e){return(typeof e=="string"?e:""+e).replace(zI,`
|
|
81
|
-
`).replace(VI,"")}function _u(e,t,n){if(t=Lx(t),Lx(e)!==t&&n)throw Error(Z(425))}function Sd(){}var np=null,rp=null;function op(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 ip=typeof setTimeout=="function"?setTimeout:void 0,BI=typeof clearTimeout=="function"?clearTimeout:void 0,Fx=typeof Promise=="function"?Promise:void 0,UI=typeof queueMicrotask=="function"?queueMicrotask:typeof Fx<"u"?function(e){return Fx.resolve(null).then(e).catch(HI)}:ip;function HI(e){setTimeout(function(){throw e})}function Zh(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),Ql(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Ql(t)}function gi(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 zx(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 Wa=Math.random().toString(36).slice(2),ro="__reactFiber$"+Wa,Zl="__reactProps$"+Wa,ko="__reactContainer$"+Wa,sp="__reactEvents$"+Wa,WI="__reactListeners$"+Wa,qI="__reactHandles$"+Wa;function Wi(e){var t=e[ro];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ko]||n[ro]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zx(e);e!==null;){if(n=e[ro])return n;e=zx(e)}return t}e=n,n=e.parentNode}return null}function Rc(e){return e=e[ro]||e[ko],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ea(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Z(33))}function pf(e){return e[Zl]||null}var ap=[],ta=-1;function _i(e){return{current:e}}function Pt(e){0>ta||(e.current=ap[ta],ap[ta]=null,ta--)}function gt(e,t){ta++,ap[ta]=e.current,e.current=t}var Ei={},Sn=_i(Ei),Vn=_i(!1),ts=Ei;function ba(e,t){var n=e.type.contextTypes;if(!n)return Ei;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 Bn(e){return e=e.childContextTypes,e!=null}function bd(){Pt(Vn),Pt(Sn)}function Vx(e,t,n){if(Sn.current!==Ei)throw Error(Z(168));gt(Sn,t),gt(Vn,n)}function TC(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(Z(108,_D(e)||"Unknown",o));return Ot({},n,r)}function Cd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ei,ts=Sn.current,gt(Sn,e),gt(Vn,Vn.current),!0}function Bx(e,t,n){var r=e.stateNode;if(!r)throw Error(Z(169));n?(e=TC(e,t,ts),r.__reactInternalMemoizedMergedChildContext=e,Pt(Vn),Pt(Sn),gt(Sn,e)):Pt(Vn),gt(Vn,n)}var wo=null,gf=!1,em=!1;function kC(e){wo===null?wo=[e]:wo.push(e)}function GI(e){gf=!0,kC(e)}function Di(){if(!em&&wo!==null){em=!0;var e=0,t=st;try{var n=wo;for(st=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}wo=null,gf=!1}catch(o){throw wo!==null&&(wo=wo.slice(e+1)),Zb(Ng,Di),o}finally{st=t,em=!1}}return null}var na=[],ra=0,Ed=null,jd=0,mr=[],pr=0,ns=null,So=1,bo="";function Li(e,t){na[ra++]=jd,na[ra++]=Ed,Ed=e,jd=t}function RC(e,t,n){mr[pr++]=So,mr[pr++]=bo,mr[pr++]=ns,ns=e;var r=So;e=bo;var o=32-Or(r)-1;r&=~(1<<o),n+=1;var i=32-Or(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,So=1<<32-Or(t)+o|n<<o|r,bo=i+e}else So=1<<i|n<<o|r,bo=e}function Ug(e){e.return!==null&&(Li(e,1),RC(e,1,0))}function Hg(e){for(;e===Ed;)Ed=na[--ra],na[ra]=null,jd=na[--ra],na[ra]=null;for(;e===ns;)ns=mr[--pr],mr[pr]=null,bo=mr[--pr],mr[pr]=null,So=mr[--pr],mr[pr]=null}var tr=null,Zn=null,Rt=!1,Nr=null;function _C(e,t){var n=vr(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 Ux(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,tr=e,Zn=gi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,tr=e,Zn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ns!==null?{id:So,overflow:bo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=vr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,tr=e,Zn=null,!0):!1;default:return!1}}function lp(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cp(e){if(Rt){var t=Zn;if(t){var n=t;if(!Ux(e,t)){if(lp(e))throw Error(Z(418));t=gi(n.nextSibling);var r=tr;t&&Ux(e,t)?_C(r,n):(e.flags=e.flags&-4097|2,Rt=!1,tr=e)}}else{if(lp(e))throw Error(Z(418));e.flags=e.flags&-4097|2,Rt=!1,tr=e}}}function Hx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;tr=e}function Du(e){if(e!==tr)return!1;if(!Rt)return Hx(e),Rt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!op(e.type,e.memoizedProps)),t&&(t=Zn)){if(lp(e))throw DC(),Error(Z(418));for(;t;)_C(e,t),t=gi(t.nextSibling)}if(Hx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Zn=gi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Zn=null}}else Zn=tr?gi(e.stateNode.nextSibling):null;return!0}function DC(){for(var e=Zn;e;)e=gi(e.nextSibling)}function Ca(){Zn=tr=null,Rt=!1}function Wg(e){Nr===null?Nr=[e]:Nr.push(e)}var QI=Lo.ReactCurrentBatchConfig;function Dr(e,t){if(e&&e.defaultProps){t=Ot({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Pd=_i(null),Td=null,oa=null,qg=null;function Gg(){qg=oa=Td=null}function Qg(e){var t=Pd.current;Pt(Pd),e._currentValue=t}function up(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 ga(e,t){Td=e,qg=oa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(zn=!0),e.firstContext=null)}function wr(e){var t=e._currentValue;if(qg!==e)if(e={context:e,memoizedValue:t,next:null},oa===null){if(Td===null)throw Error(Z(308));oa=e,Td.dependencies={lanes:0,firstContext:e}}else oa=oa.next=e;return t}var qi=null;function Kg(e){qi===null?qi=[e]:qi.push(e)}function IC(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Kg(t)):(n.next=o.next,o.next=n),t.interleaved=n,Ro(e,r)}function Ro(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 ni=!1;function Yg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function AC(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 Co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function vi(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,Ro(e,n)}return o=r.interleaved,o===null?(t.next=t,Kg(r)):(t.next=o.next,o.next=t),r.interleaved=t,Ro(e,n)}function Ju(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,Mg(e,n)}}function Wx(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 s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,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 kd(e,t,n,r){var o=e.updateQueue;ni=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?i=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=o.baseState;s=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(h=t,p=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(p,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(p,f,h):g,h==null)break e;f=Ot({},f,h);break e;case 2:ni=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,s|=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 s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);os|=s,e.lanes=s,e.memoizedState=f}}function qx(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(Z(191,o));o.call(r)}}}var NC=new Ib.Component().refs;function dp(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ot({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vf={isMounted:function(e){return(e=e._reactInternals)?xs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_n(),o=xi(e),i=Co(r,o);i.payload=t,n!=null&&(i.callback=n),t=vi(e,i,o),t!==null&&($r(t,e,o,r),Ju(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_n(),o=xi(e),i=Co(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vi(e,i,o),t!==null&&($r(t,e,o,r),Ju(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_n(),r=xi(e),o=Co(n,r);o.tag=2,t!=null&&(o.callback=t),t=vi(e,o,r),t!==null&&($r(t,e,r,n),Ju(t,e,r))}};function Gx(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Yl(n,r)||!Yl(o,i):!0}function MC(e,t,n){var r=!1,o=Ei,i=t.contextType;return typeof i=="object"&&i!==null?i=wr(i):(o=Bn(t)?ts:Sn.current,r=t.contextTypes,i=(r=r!=null)?ba(e,o):Ei),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=vf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Qx(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&&vf.enqueueReplaceState(t,t.state,null)}function fp(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=NC,Yg(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=wr(i):(i=Bn(t)?ts:Sn.current,o.context=ba(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(dp(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&&vf.enqueueReplaceState(o,o.state,null),kd(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function hl(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(Z(309));var r=n.stateNode}if(!r)throw Error(Z(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(s){var l=o.refs;l===NC&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(Z(284));if(!n._owner)throw Error(Z(290,e))}return e}function Iu(e,t){throw e=Object.prototype.toString.call(t),Error(Z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Kx(e){var t=e._init;return t(e._payload)}function OC(e){function t(y,x){if(e){var w=y.deletions;w===null?(y.deletions=[x],y.flags|=16):w.push(x)}}function n(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function o(y,x){return y=wi(y,x),y.index=0,y.sibling=null,y}function i(y,x,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<x?(y.flags|=2,x):w):(y.flags|=2,x)):(y.flags|=1048576,x)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,x,w,b){return x===null||x.tag!==6?(x=am(w,y.mode,b),x.return=y,x):(x=o(x,w),x.return=y,x)}function c(y,x,w,b){var j=w.type;return j===Ys?d(y,x,w.props.children,b,w.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ti&&Kx(j)===x.type)?(b=o(x,w.props),b.ref=hl(y,x,w),b.return=y,b):(b=od(w.type,w.key,w.props,null,y.mode,b),b.ref=hl(y,x,w),b.return=y,b)}function u(y,x,w,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=lm(w,y.mode,b),x.return=y,x):(x=o(x,w.children||[]),x.return=y,x)}function d(y,x,w,b,j){return x===null||x.tag!==7?(x=Zi(w,y.mode,b,j),x.return=y,x):(x=o(x,w),x.return=y,x)}function f(y,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=am(""+x,y.mode,w),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Su:return w=od(x.type,x.key,x.props,null,y.mode,w),w.ref=hl(y,null,x),w.return=y,w;case Ks:return x=lm(x,y.mode,w),x.return=y,x;case ti:var b=x._init;return f(y,b(x._payload),w)}if(jl(x)||ll(x))return x=Zi(x,y.mode,w,null),x.return=y,x;Iu(y,x)}return null}function h(y,x,w,b){var j=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(y,x,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Su:return w.key===j?c(y,x,w,b):null;case Ks:return w.key===j?u(y,x,w,b):null;case ti:return j=w._init,h(y,x,j(w._payload),b)}if(jl(w)||ll(w))return j!==null?null:d(y,x,w,b,null);Iu(y,w)}return null}function p(y,x,w,b,j){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(w)||null,l(x,y,""+b,j);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Su:return y=y.get(b.key===null?w:b.key)||null,c(x,y,b,j);case Ks:return y=y.get(b.key===null?w:b.key)||null,u(x,y,b,j);case ti:var P=b._init;return p(y,x,w,P(b._payload),j)}if(jl(b)||ll(b))return y=y.get(w)||null,d(x,y,b,j,null);Iu(x,b)}return null}function g(y,x,w,b){for(var j=null,P=null,E=x,T=x=0,_=null;E!==null&&T<w.length;T++){E.index>T?(_=E,E=null):_=E.sibling;var R=h(y,E,w[T],b);if(R===null){E===null&&(E=_);break}e&&E&&R.alternate===null&&t(y,E),x=i(R,x,T),P===null?j=R:P.sibling=R,P=R,E=_}if(T===w.length)return n(y,E),Rt&&Li(y,T),j;if(E===null){for(;T<w.length;T++)E=f(y,w[T],b),E!==null&&(x=i(E,x,T),P===null?j=E:P.sibling=E,P=E);return Rt&&Li(y,T),j}for(E=r(y,E);T<w.length;T++)_=p(E,y,T,w[T],b),_!==null&&(e&&_.alternate!==null&&E.delete(_.key===null?T:_.key),x=i(_,x,T),P===null?j=_:P.sibling=_,P=_);return e&&E.forEach(function(O){return t(y,O)}),Rt&&Li(y,T),j}function v(y,x,w,b){var j=ll(w);if(typeof j!="function")throw Error(Z(150));if(w=j.call(w),w==null)throw Error(Z(151));for(var P=j=null,E=x,T=x=0,_=null,R=w.next();E!==null&&!R.done;T++,R=w.next()){E.index>T?(_=E,E=null):_=E.sibling;var O=h(y,E,R.value,b);if(O===null){E===null&&(E=_);break}e&&E&&O.alternate===null&&t(y,E),x=i(O,x,T),P===null?j=O:P.sibling=O,P=O,E=_}if(R.done)return n(y,E),Rt&&Li(y,T),j;if(E===null){for(;!R.done;T++,R=w.next())R=f(y,R.value,b),R!==null&&(x=i(R,x,T),P===null?j=R:P.sibling=R,P=R);return Rt&&Li(y,T),j}for(E=r(y,E);!R.done;T++,R=w.next())R=p(E,y,T,R.value,b),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?T:R.key),x=i(R,x,T),P===null?j=R:P.sibling=R,P=R);return e&&E.forEach(function(I){return t(y,I)}),Rt&&Li(y,T),j}function S(y,x,w,b){if(typeof w=="object"&&w!==null&&w.type===Ys&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Su:e:{for(var j=w.key,P=x;P!==null;){if(P.key===j){if(j=w.type,j===Ys){if(P.tag===7){n(y,P.sibling),x=o(P,w.props.children),x.return=y,y=x;break e}}else if(P.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ti&&Kx(j)===P.type){n(y,P.sibling),x=o(P,w.props),x.ref=hl(y,P,w),x.return=y,y=x;break e}n(y,P);break}else t(y,P);P=P.sibling}w.type===Ys?(x=Zi(w.props.children,y.mode,b,w.key),x.return=y,y=x):(b=od(w.type,w.key,w.props,null,y.mode,b),b.ref=hl(y,x,w),b.return=y,y=b)}return s(y);case Ks:e:{for(P=w.key;x!==null;){if(x.key===P)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(y,x.sibling),x=o(x,w.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=lm(w,y.mode,b),x.return=y,y=x}return s(y);case ti:return P=w._init,S(y,x,P(w._payload),b)}if(jl(w))return g(y,x,w,b);if(ll(w))return v(y,x,w,b);Iu(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(y,x.sibling),x=o(x,w),x.return=y,y=x):(n(y,x),x=am(w,y.mode,b),x.return=y,y=x),s(y)):n(y,x)}return S}var Ea=OC(!0),$C=OC(!1),_c={},io=_i(_c),ec=_i(_c),tc=_i(_c);function Gi(e){if(e===_c)throw Error(Z(174));return e}function Xg(e,t){switch(gt(tc,t),gt(ec,e),gt(io,_c),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Hm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Hm(t,e)}Pt(io),gt(io,t)}function ja(){Pt(io),Pt(ec),Pt(tc)}function LC(e){Gi(tc.current);var t=Gi(io.current),n=Hm(t,e.type);t!==n&&(gt(ec,e),gt(io,n))}function Jg(e){ec.current===e&&(Pt(io),Pt(ec))}var At=_i(0);function Rd(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 tm=[];function Zg(){for(var e=0;e<tm.length;e++)tm[e]._workInProgressVersionPrimary=null;tm.length=0}var Zu=Lo.ReactCurrentDispatcher,nm=Lo.ReactCurrentBatchConfig,rs=0,Mt=null,Xt=null,tn=null,_d=!1,Ml=!1,nc=0,KI=0;function pn(){throw Error(Z(321))}function ev(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function tv(e,t,n,r,o,i){if(rs=i,Mt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Zu.current=e===null||e.memoizedState===null?ZI:eA,e=n(r,o),Ml){i=0;do{if(Ml=!1,nc=0,25<=i)throw Error(Z(301));i+=1,tn=Xt=null,t.updateQueue=null,Zu.current=tA,e=n(r,o)}while(Ml)}if(Zu.current=Dd,t=Xt!==null&&Xt.next!==null,rs=0,tn=Xt=Mt=null,_d=!1,t)throw Error(Z(300));return e}function nv(){var e=nc!==0;return nc=0,e}function eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Mt.memoizedState=tn=e:tn=tn.next=e,tn}function Sr(){if(Xt===null){var e=Mt.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var t=tn===null?Mt.memoizedState:tn.next;if(t!==null)tn=t,Xt=e;else{if(e===null)throw Error(Z(310));Xt=e,e={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},tn===null?Mt.memoizedState=tn=e:tn=tn.next=e}return tn}function rc(e,t){return typeof t=="function"?t(e):t}function rm(e){var t=Sr(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var r=Xt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,c=null,u=i;do{var d=u.lane;if((rs&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,s=r):c=c.next=f,Mt.lanes|=d,os|=d}u=u.next}while(u!==null&&u!==i);c===null?s=r:c.next=l,Fr(r,t.memoizedState)||(zn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Mt.lanes|=i,os|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function om(e){var t=Sr(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Fr(i,t.memoizedState)||(zn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function FC(){}function zC(e,t){var n=Mt,r=Sr(),o=t(),i=!Fr(r.memoizedState,o);if(i&&(r.memoizedState=o,zn=!0),r=r.queue,rv(UC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||tn!==null&&tn.memoizedState.tag&1){if(n.flags|=2048,oc(9,BC.bind(null,n,r,o,t),void 0,null),rn===null)throw Error(Z(349));rs&30||VC(n,t,o)}return o}function VC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Mt.updateQueue,t===null?(t={lastEffect:null,stores:null},Mt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function BC(e,t,n,r){t.value=n,t.getSnapshot=r,HC(t)&&WC(e)}function UC(e,t,n){return n(function(){HC(t)&&WC(e)})}function HC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function WC(e){var t=Ro(e,1);t!==null&&$r(t,e,1,-1)}function Yx(e){var t=eo();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rc,lastRenderedState:e},t.queue=e,e=e.dispatch=JI.bind(null,Mt,e),[t.memoizedState,e]}function oc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Mt.updateQueue,t===null?(t={lastEffect:null,stores:null},Mt.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 qC(){return Sr().memoizedState}function ed(e,t,n,r){var o=eo();Mt.flags|=e,o.memoizedState=oc(1|t,n,void 0,r===void 0?null:r)}function yf(e,t,n,r){var o=Sr();r=r===void 0?null:r;var i=void 0;if(Xt!==null){var s=Xt.memoizedState;if(i=s.destroy,r!==null&&ev(r,s.deps)){o.memoizedState=oc(t,n,i,r);return}}Mt.flags|=e,o.memoizedState=oc(1|t,n,i,r)}function Xx(e,t){return ed(8390656,8,e,t)}function rv(e,t){return yf(2048,8,e,t)}function GC(e,t){return yf(4,2,e,t)}function QC(e,t){return yf(4,4,e,t)}function KC(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 YC(e,t,n){return n=n!=null?n.concat([e]):null,yf(4,4,KC.bind(null,t,e),n)}function ov(){}function XC(e,t){var n=Sr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ev(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function JC(e,t){var n=Sr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ev(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ZC(e,t,n){return rs&21?(Fr(n,t)||(n=nC(),Mt.lanes|=n,os|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,zn=!0),e.memoizedState=n)}function YI(e,t){var n=st;st=n!==0&&4>n?n:4,e(!0);var r=nm.transition;nm.transition={};try{e(!1),t()}finally{st=n,nm.transition=r}}function eE(){return Sr().memoizedState}function XI(e,t,n){var r=xi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},tE(e))nE(t,n);else if(n=IC(e,t,n,r),n!==null){var o=_n();$r(n,e,r,o),rE(n,t,r)}}function JI(e,t,n){var r=xi(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(tE(e))nE(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,Fr(l,s)){var c=t.interleaved;c===null?(o.next=o,Kg(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=IC(e,t,o,r),n!==null&&(o=_n(),$r(n,e,r,o),rE(n,t,r))}}function tE(e){var t=e.alternate;return e===Mt||t!==null&&t===Mt}function nE(e,t){Ml=_d=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function rE(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mg(e,n)}}var Dd={readContext:wr,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useInsertionEffect:pn,useLayoutEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useMutableSource:pn,useSyncExternalStore:pn,useId:pn,unstable_isNewReconciler:!1},ZI={readContext:wr,useCallback:function(e,t){return eo().memoizedState=[e,t===void 0?null:t],e},useContext:wr,useEffect:Xx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ed(4194308,4,KC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ed(4194308,4,e,t)},useInsertionEffect:function(e,t){return ed(4,2,e,t)},useMemo:function(e,t){var n=eo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=eo();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=XI.bind(null,Mt,e),[r.memoizedState,e]},useRef:function(e){var t=eo();return e={current:e},t.memoizedState=e},useState:Yx,useDebugValue:ov,useDeferredValue:function(e){return eo().memoizedState=e},useTransition:function(){var e=Yx(!1),t=e[0];return e=YI.bind(null,e[1]),eo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Mt,o=eo();if(Rt){if(n===void 0)throw Error(Z(407));n=n()}else{if(n=t(),rn===null)throw Error(Z(349));rs&30||VC(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Xx(UC.bind(null,r,i,e),[e]),r.flags|=2048,oc(9,BC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=eo(),t=rn.identifierPrefix;if(Rt){var n=bo,r=So;n=(r&~(1<<32-Or(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=nc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=KI++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},eA={readContext:wr,useCallback:XC,useContext:wr,useEffect:rv,useImperativeHandle:YC,useInsertionEffect:GC,useLayoutEffect:QC,useMemo:JC,useReducer:rm,useRef:qC,useState:function(){return rm(rc)},useDebugValue:ov,useDeferredValue:function(e){var t=Sr();return ZC(t,Xt.memoizedState,e)},useTransition:function(){var e=rm(rc)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:FC,useSyncExternalStore:zC,useId:eE,unstable_isNewReconciler:!1},tA={readContext:wr,useCallback:XC,useContext:wr,useEffect:rv,useImperativeHandle:YC,useInsertionEffect:GC,useLayoutEffect:QC,useMemo:JC,useReducer:om,useRef:qC,useState:function(){return om(rc)},useDebugValue:ov,useDeferredValue:function(e){var t=Sr();return Xt===null?t.memoizedState=e:ZC(t,Xt.memoizedState,e)},useTransition:function(){var e=om(rc)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:FC,useSyncExternalStore:zC,useId:eE,unstable_isNewReconciler:!1};function Pa(e,t){try{var n="",r=t;do n+=RD(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 im(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function hp(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var nA=typeof WeakMap=="function"?WeakMap:Map;function oE(e,t,n){n=Co(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ad||(Ad=!0,Cp=r),hp(e,t)},n}function iE(e,t,n){n=Co(-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(){hp(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){hp(e,t),typeof r!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Jx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nA;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=gA.bind(null,e,t,n),t.then(e,e))}function Zx(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 e1(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=Co(-1,1),t.tag=2,vi(n,t,1))),n.lanes|=1),e)}var rA=Lo.ReactCurrentOwner,zn=!1;function Pn(e,t,n,r){t.child=e===null?$C(t,null,n,r):Ea(t,e.child,n,r)}function t1(e,t,n,r,o){n=n.render;var i=t.ref;return ga(t,o),r=tv(e,t,n,r,i,o),n=nv(),e!==null&&!zn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,_o(e,t,o)):(Rt&&n&&Ug(t),t.flags|=1,Pn(e,t,r,o),t.child)}function n1(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!fv(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,sE(e,t,i,r,o)):(e=od(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 s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Yl,n(s,r)&&e.ref===t.ref)return _o(e,t,o)}return t.flags|=1,e=wi(i,r),e.ref=t.ref,e.return=t,t.child=e}function sE(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Yl(i,r)&&e.ref===t.ref)if(zn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(zn=!0);else return t.lanes=e.lanes,_o(e,t,o)}return mp(e,t,n,r,o)}function aE(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},gt(sa,Xn),Xn|=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,gt(sa,Xn),Xn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,gt(sa,Xn),Xn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,gt(sa,Xn),Xn|=r;return Pn(e,t,o,n),t.child}function lE(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function mp(e,t,n,r,o){var i=Bn(n)?ts:Sn.current;return i=ba(t,i),ga(t,o),n=tv(e,t,n,r,i,o),r=nv(),e!==null&&!zn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,_o(e,t,o)):(Rt&&r&&Ug(t),t.flags|=1,Pn(e,t,n,o),t.child)}function r1(e,t,n,r,o){if(Bn(n)){var i=!0;Cd(t)}else i=!1;if(ga(t,o),t.stateNode===null)td(e,t),MC(t,n,r),fp(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=wr(u):(u=Bn(n)?ts:Sn.current,u=ba(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||c!==u)&&Qx(t,s,r,u),ni=!1;var h=t.memoizedState;s.state=h,kd(t,r,s,o),c=t.memoizedState,l!==r||h!==c||Vn.current||ni?(typeof d=="function"&&(dp(t,n,d,r),c=t.memoizedState),(l=ni||Gx(t,n,l,r,h,c,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,AC(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Dr(t.type,l),s.props=u,f=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=wr(c):(c=Bn(n)?ts:Sn.current,c=ba(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||h!==c)&&Qx(t,s,r,c),ni=!1,h=t.memoizedState,s.state=h,kd(t,r,s,o);var g=t.memoizedState;l!==f||h!==g||Vn.current||ni?(typeof p=="function"&&(dp(t,n,p,r),g=t.memoizedState),(u=ni||Gx(t,n,u,r,h,g,c)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return pp(e,t,n,r,i,o)}function pp(e,t,n,r,o,i){lE(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Bx(t,n,!1),_o(e,t,i);r=t.stateNode,rA.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Ea(t,e.child,null,i),t.child=Ea(t,null,l,i)):Pn(e,t,l,i),t.memoizedState=r.state,o&&Bx(t,n,!0),t.child}function cE(e){var t=e.stateNode;t.pendingContext?Vx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Vx(e,t.context,!1),Xg(e,t.containerInfo)}function o1(e,t,n,r,o){return Ca(),Wg(o),t.flags|=256,Pn(e,t,n,r),t.child}var gp={dehydrated:null,treeContext:null,retryLane:0};function vp(e){return{baseLanes:e,cachePool:null,transitions:null}}function uE(e,t,n){var r=t.pendingProps,o=At.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),gt(At,o&1),e===null)return cp(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):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Sf(s,r,0,null),e=Zi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=vp(n),t.memoizedState=gp,e):iv(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return oA(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=wi(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=wi(l,i):(i=Zi(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?vp(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=gp,r}return i=e.child,e=i.sibling,r=wi(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 iv(e,t){return t=Sf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Au(e,t,n,r){return r!==null&&Wg(r),Ea(t,e.child,null,n),e=iv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oA(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=im(Error(Z(422))),Au(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Sf({mode:"visible",children:r.children},o,0,null),i=Zi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ea(t,e.child,null,s),t.child.memoizedState=vp(s),t.memoizedState=gp,i);if(!(t.mode&1))return Au(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(Z(419)),r=im(i,r,void 0),Au(e,t,s,r)}if(l=(s&e.childLanes)!==0,zn||l){if(r=rn,r!==null){switch(s&-s){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|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Ro(e,o),$r(r,e,o,-1))}return dv(),r=im(Error(Z(421))),Au(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=vA.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Zn=gi(o.nextSibling),tr=t,Rt=!0,Nr=null,e!==null&&(mr[pr++]=So,mr[pr++]=bo,mr[pr++]=ns,So=e.id,bo=e.overflow,ns=t),t=iv(t,r.children),t.flags|=4096,t)}function i1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),up(e.return,t,n)}function sm(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 dE(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Pn(e,t,r.children,n),r=At.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&&i1(e,n,t);else if(e.tag===19)i1(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(gt(At,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&&Rd(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),sm(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&&Rd(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}sm(t,!0,n,null,i);break;case"together":sm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function td(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function _o(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),os|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Z(153));if(t.child!==null){for(e=t.child,n=wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function iA(e,t,n){switch(t.tag){case 3:cE(t),Ca();break;case 5:LC(t);break;case 1:Bn(t.type)&&Cd(t);break;case 4:Xg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;gt(Pd,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(gt(At,At.current&1),t.flags|=128,null):n&t.child.childLanes?uE(e,t,n):(gt(At,At.current&1),e=_o(e,t,n),e!==null?e.sibling:null);gt(At,At.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return dE(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),gt(At,At.current),r)break;return null;case 22:case 23:return t.lanes=0,aE(e,t,n)}return _o(e,t,n)}var fE,yp,hE,mE;fE=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}};yp=function(){};hE=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Gi(io.current);var i=null;switch(n){case"input":o=zm(e,o),r=zm(e,r),i=[];break;case"select":o=Ot({},o,{value:void 0}),r=Ot({},r,{value:void 0}),i=[];break;case"textarea":o=Um(e,o),r=Um(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Sd)}Wm(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ul.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(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(n||(n={}),n[s]=c[s])}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"&&(Ul.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Et("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 ml(e,t){if(!Rt)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 gn(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 sA(e,t,n){var r=t.pendingProps;switch(Hg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gn(t),null;case 1:return Bn(t.type)&&bd(),gn(t),null;case 3:return r=t.stateNode,ja(),Pt(Vn),Pt(Sn),Zg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Du(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Nr!==null&&(Pp(Nr),Nr=null))),yp(e,t),gn(t),null;case 5:Jg(t);var o=Gi(tc.current);if(n=t.type,e!==null&&t.stateNode!=null)hE(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Z(166));return gn(t),null}if(e=Gi(io.current),Du(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ro]=t,r[Zl]=i,e=(t.mode&1)!==0,n){case"dialog":Et("cancel",r),Et("close",r);break;case"iframe":case"object":case"embed":Et("load",r);break;case"video":case"audio":for(o=0;o<Tl.length;o++)Et(Tl[o],r);break;case"source":Et("error",r);break;case"img":case"image":case"link":Et("error",r),Et("load",r);break;case"details":Et("toggle",r);break;case"input":mx(r,i),Et("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Et("invalid",r);break;case"textarea":gx(r,i),Et("invalid",r)}Wm(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&_u(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&_u(r.textContent,l,e),o=["children",""+l]):Ul.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&Et("scroll",r)}switch(n){case"input":bu(r),px(r,i,!0);break;case"textarea":bu(r),vx(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Sd)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Vb(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[ro]=t,e[Zl]=r,fE(e,t,!1,!1),t.stateNode=e;e:{switch(s=qm(n,r),n){case"dialog":Et("cancel",e),Et("close",e),o=r;break;case"iframe":case"object":case"embed":Et("load",e),o=r;break;case"video":case"audio":for(o=0;o<Tl.length;o++)Et(Tl[o],e);o=r;break;case"source":Et("error",e),o=r;break;case"img":case"image":case"link":Et("error",e),Et("load",e),o=r;break;case"details":Et("toggle",e),o=r;break;case"input":mx(e,r),o=zm(e,r),Et("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ot({},r,{value:void 0}),Et("invalid",e);break;case"textarea":gx(e,r),o=Um(e,r),Et("invalid",e);break;default:o=r}Wm(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Hb(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Bb(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Hl(e,c):typeof c=="number"&&Hl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ul.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Et("scroll",e):c!=null&&Rg(e,i,c,s))}switch(n){case"input":bu(e),px(e,r,!1);break;case"textarea":bu(e),vx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ci(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?fa(e,!!r.multiple,i,!1):r.defaultValue!=null&&fa(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Sd)}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 gn(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(Z(166));if(n=Gi(tc.current),Gi(io.current),Du(t)){if(r=t.stateNode,n=t.memoizedProps,r[ro]=t,(i=r.nodeValue!==n)&&(e=tr,e!==null))switch(e.tag){case 3:_u(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_u(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ro]=t,t.stateNode=r}return gn(t),null;case 13:if(Pt(At),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Rt&&Zn!==null&&t.mode&1&&!(t.flags&128))DC(),Ca(),t.flags|=98560,i=!1;else if(i=Du(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Z(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Z(317));i[ro]=t}else Ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gn(t),i=!1}else Nr!==null&&(Pp(Nr),Nr=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||At.current&1?Jt===0&&(Jt=3):dv())),t.updateQueue!==null&&(t.flags|=4),gn(t),null);case 4:return ja(),yp(e,t),e===null&&Xl(t.stateNode.containerInfo),gn(t),null;case 10:return Qg(t.type._context),gn(t),null;case 17:return Bn(t.type)&&bd(),gn(t),null;case 19:if(Pt(At),i=t.memoizedState,i===null)return gn(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ml(i,!1);else{if(Jt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Rd(e),s!==null){for(t.flags|=128,ml(i,!1),r=s.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,s=i.alternate,s===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=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return gt(At,At.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ht()>Ta&&(t.flags|=128,r=!0,ml(i,!1),t.lanes=4194304)}else{if(!r)if(e=Rd(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ml(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Rt)return gn(t),null}else 2*Ht()-i.renderingStartTime>Ta&&n!==1073741824&&(t.flags|=128,r=!0,ml(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ht(),t.sibling=null,n=At.current,gt(At,r?n&1|2:n&1),t):(gn(t),null);case 22:case 23:return uv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Xn&1073741824&&(gn(t),t.subtreeFlags&6&&(t.flags|=8192)):gn(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function aA(e,t){switch(Hg(t),t.tag){case 1:return Bn(t.type)&&bd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ja(),Pt(Vn),Pt(Sn),Zg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jg(t),null;case 13:if(Pt(At),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pt(At),null;case 4:return ja(),null;case 10:return Qg(t.type._context),null;case 22:case 23:return uv(),null;case 24:return null;default:return null}}var Nu=!1,yn=!1,lA=typeof WeakSet=="function"?WeakSet:Set,pe=null;function ia(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ft(e,t,r)}else n.current=null}function xp(e,t,n){try{n()}catch(r){Ft(e,t,r)}}var s1=!1;function cA(e,t){if(np=yd,e=yC(),Bg(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 s=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||o!==0&&f.nodeType!==3||(l=s+o),f!==i||r!==0&&f.nodeType!==3||(c=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===o&&(l=s),h===i&&++d===r&&(c=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(rp={focusedElem:e,selectionRange:n},yd=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;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,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:Dr(t.type,v),S);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Z(163))}}catch(b){Ft(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return g=s1,s1=!1,g}function Ol(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&&xp(t,n,i)}o=o.next}while(o!==r)}}function xf(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 wp(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 pE(e){var t=e.alternate;t!==null&&(e.alternate=null,pE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ro],delete t[Zl],delete t[sp],delete t[WI],delete t[qI])),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 gE(e){return e.tag===5||e.tag===3||e.tag===4}function a1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gE(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 Sp(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=Sd));else if(r!==4&&(e=e.child,e!==null))for(Sp(e,t,n),e=e.sibling;e!==null;)Sp(e,t,n),e=e.sibling}function bp(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(bp(e,t,n),e=e.sibling;e!==null;)bp(e,t,n),e=e.sibling}var ln=null,Ir=!1;function Zo(e,t,n){for(n=n.child;n!==null;)vE(e,t,n),n=n.sibling}function vE(e,t,n){if(oo&&typeof oo.onCommitFiberUnmount=="function")try{oo.onCommitFiberUnmount(df,n)}catch{}switch(n.tag){case 5:yn||ia(n,t);case 6:var r=ln,o=Ir;ln=null,Zo(e,t,n),ln=r,Ir=o,ln!==null&&(Ir?(e=ln,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ln.removeChild(n.stateNode));break;case 18:ln!==null&&(Ir?(e=ln,n=n.stateNode,e.nodeType===8?Zh(e.parentNode,n):e.nodeType===1&&Zh(e,n),Ql(e)):Zh(ln,n.stateNode));break;case 4:r=ln,o=Ir,ln=n.stateNode.containerInfo,Ir=!0,Zo(e,t,n),ln=r,Ir=o;break;case 0:case 11:case 14:case 15:if(!yn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&xp(n,t,s),o=o.next}while(o!==r)}Zo(e,t,n);break;case 1:if(!yn&&(ia(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ft(n,t,l)}Zo(e,t,n);break;case 21:Zo(e,t,n);break;case 22:n.mode&1?(yn=(r=yn)||n.memoizedState!==null,Zo(e,t,n),yn=r):Zo(e,t,n);break;default:Zo(e,t,n)}}function l1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new lA),t.forEach(function(r){var o=yA.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function kr(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,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:ln=l.stateNode,Ir=!1;break e;case 3:ln=l.stateNode.containerInfo,Ir=!0;break e;case 4:ln=l.stateNode.containerInfo,Ir=!0;break e}l=l.return}if(ln===null)throw Error(Z(160));vE(i,s,o),ln=null,Ir=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){Ft(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)yE(t,e),t=t.sibling}function yE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kr(t,e),Xr(e),r&4){try{Ol(3,e,e.return),xf(3,e)}catch(v){Ft(e,e.return,v)}try{Ol(5,e,e.return)}catch(v){Ft(e,e.return,v)}}break;case 1:kr(t,e),Xr(e),r&512&&n!==null&&ia(n,n.return);break;case 5:if(kr(t,e),Xr(e),r&512&&n!==null&&ia(n,n.return),e.flags&32){var o=e.stateNode;try{Hl(o,"")}catch(v){Ft(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=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&&Fb(o,i),qm(l,s);var u=qm(l,i);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?Hb(o,f):d==="dangerouslySetInnerHTML"?Bb(o,f):d==="children"?Hl(o,f):Rg(o,d,f,u)}switch(l){case"input":Vm(o,i);break;case"textarea":zb(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?fa(o,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?fa(o,!!i.multiple,i.defaultValue,!0):fa(o,!!i.multiple,i.multiple?[]:"",!1))}o[Zl]=i}catch(v){Ft(e,e.return,v)}}break;case 6:if(kr(t,e),Xr(e),r&4){if(e.stateNode===null)throw Error(Z(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Ft(e,e.return,v)}}break;case 3:if(kr(t,e),Xr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ql(t.containerInfo)}catch(v){Ft(e,e.return,v)}break;case 4:kr(t,e),Xr(e);break;case 13:kr(t,e),Xr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(lv=Ht())),r&4&&l1(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(yn=(u=yn)||d,kr(t,e),yn=u):kr(t,e),Xr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(pe=e,d=e.child;d!==null;){for(f=pe=d;pe!==null;){switch(h=pe,p=h.child,h.tag){case 0:case 11:case 14:case 15:Ol(4,h,h.return);break;case 1:ia(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){Ft(r,n,v)}}break;case 5:ia(h,h.return);break;case 22:if(h.memoizedState!==null){u1(f);continue}}p!==null?(p.return=h,pe=p):u1(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,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Ub("display",s))}catch(v){Ft(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){Ft(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:kr(t,e),Xr(e),r&4&&l1(e);break;case 21:break;default:kr(t,e),Xr(e)}}function Xr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(gE(n)){var r=n;break e}n=n.return}throw Error(Z(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Hl(o,""),r.flags&=-33);var i=a1(e);bp(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=a1(e);Sp(e,l,s);break;default:throw Error(Z(161))}}catch(c){Ft(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uA(e,t,n){pe=e,xE(e)}function xE(e,t,n){for(var r=(e.mode&1)!==0;pe!==null;){var o=pe,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Nu;if(!s){var l=o.alternate,c=l!==null&&l.memoizedState!==null||yn;l=Nu;var u=yn;if(Nu=s,(yn=c)&&!u)for(pe=o;pe!==null;)s=pe,c=s.child,s.tag===22&&s.memoizedState!==null?d1(o):c!==null?(c.return=s,pe=c):d1(o);for(;i!==null;)pe=i,xE(i),i=i.sibling;pe=o,Nu=l,yn=u}c1(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,pe=i):c1(e)}}function c1(e){for(;pe!==null;){var t=pe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:yn||xf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!yn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Dr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&qx(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qx(t,s,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&&Ql(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Z(163))}yn||t.flags&512&&wp(t)}catch(h){Ft(t,t.return,h)}}if(t===e){pe=null;break}if(n=t.sibling,n!==null){n.return=t.return,pe=n;break}pe=t.return}}function u1(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,pe=n;break}pe=t.return}}function d1(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{xf(4,t)}catch(c){Ft(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){Ft(t,o,c)}}var i=t.return;try{wp(t)}catch(c){Ft(t,i,c)}break;case 5:var s=t.return;try{wp(t)}catch(c){Ft(t,s,c)}}}catch(c){Ft(t,t.return,c)}if(t===e){pe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,pe=l;break}pe=t.return}}var dA=Math.ceil,Id=Lo.ReactCurrentDispatcher,sv=Lo.ReactCurrentOwner,yr=Lo.ReactCurrentBatchConfig,tt=0,rn=null,qt=null,dn=0,Xn=0,sa=_i(0),Jt=0,ic=null,os=0,wf=0,av=0,$l=null,Fn=null,lv=0,Ta=1/0,xo=null,Ad=!1,Cp=null,yi=null,Mu=!1,di=null,Nd=0,Ll=0,Ep=null,nd=-1,rd=0;function _n(){return tt&6?Ht():nd!==-1?nd:nd=Ht()}function xi(e){return e.mode&1?tt&2&&dn!==0?dn&-dn:QI.transition!==null?(rd===0&&(rd=nC()),rd):(e=st,e!==0||(e=window.event,e=e===void 0?16:cC(e.type)),e):1}function $r(e,t,n,r){if(50<Ll)throw Ll=0,Ep=null,Error(Z(185));Tc(e,n,r),(!(tt&2)||e!==rn)&&(e===rn&&(!(tt&2)&&(wf|=n),Jt===4&&ai(e,dn)),Un(e,r),n===1&&tt===0&&!(t.mode&1)&&(Ta=Ht()+500,gf&&Di()))}function Un(e,t){var n=e.callbackNode;QD(e,t);var r=vd(e,e===rn?dn:0);if(r===0)n!==null&&wx(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&wx(n),t===1)e.tag===0?GI(f1.bind(null,e)):kC(f1.bind(null,e)),UI(function(){!(tt&6)&&Di()}),n=null;else{switch(rC(r)){case 1:n=Ng;break;case 4:n=eC;break;case 16:n=gd;break;case 536870912:n=tC;break;default:n=gd}n=TE(n,wE.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function wE(e,t){if(nd=-1,rd=0,tt&6)throw Error(Z(327));var n=e.callbackNode;if(va()&&e.callbackNode!==n)return null;var r=vd(e,e===rn?dn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Md(e,r);else{t=r;var o=tt;tt|=2;var i=bE();(rn!==e||dn!==t)&&(xo=null,Ta=Ht()+500,Ji(e,t));do try{mA();break}catch(l){SE(e,l)}while(!0);Gg(),Id.current=i,tt=o,qt!==null?t=0:(rn=null,dn=0,t=Jt)}if(t!==0){if(t===2&&(o=Xm(e),o!==0&&(r=o,t=jp(e,o))),t===1)throw n=ic,Ji(e,0),ai(e,r),Un(e,Ht()),n;if(t===6)ai(e,r);else{if(o=e.current.alternate,!(r&30)&&!fA(o)&&(t=Md(e,r),t===2&&(i=Xm(e),i!==0&&(r=i,t=jp(e,i))),t===1))throw n=ic,Ji(e,0),ai(e,r),Un(e,Ht()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(Z(345));case 2:Fi(e,Fn,xo);break;case 3:if(ai(e,r),(r&130023424)===r&&(t=lv+500-Ht(),10<t)){if(vd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){_n(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ip(Fi.bind(null,e,Fn,xo),t);break}Fi(e,Fn,xo);break;case 4:if(ai(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Or(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ht()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dA(r/1960))-r,10<r){e.timeoutHandle=ip(Fi.bind(null,e,Fn,xo),r);break}Fi(e,Fn,xo);break;case 5:Fi(e,Fn,xo);break;default:throw Error(Z(329))}}}return Un(e,Ht()),e.callbackNode===n?wE.bind(null,e):null}function jp(e,t){var n=$l;return e.current.memoizedState.isDehydrated&&(Ji(e,t).flags|=256),e=Md(e,t),e!==2&&(t=Fn,Fn=n,t!==null&&Pp(t)),e}function Pp(e){Fn===null?Fn=e:Fn.push.apply(Fn,e)}function fA(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(!Fr(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 ai(e,t){for(t&=~av,t&=~wf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Or(t),r=1<<n;e[n]=-1,t&=~r}}function f1(e){if(tt&6)throw Error(Z(327));va();var t=vd(e,0);if(!(t&1))return Un(e,Ht()),null;var n=Md(e,t);if(e.tag!==0&&n===2){var r=Xm(e);r!==0&&(t=r,n=jp(e,r))}if(n===1)throw n=ic,Ji(e,0),ai(e,t),Un(e,Ht()),n;if(n===6)throw Error(Z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Fi(e,Fn,xo),Un(e,Ht()),null}function cv(e,t){var n=tt;tt|=1;try{return e(t)}finally{tt=n,tt===0&&(Ta=Ht()+500,gf&&Di())}}function is(e){di!==null&&di.tag===0&&!(tt&6)&&va();var t=tt;tt|=1;var n=yr.transition,r=st;try{if(yr.transition=null,st=1,e)return e()}finally{st=r,yr.transition=n,tt=t,!(tt&6)&&Di()}}function uv(){Xn=sa.current,Pt(sa)}function Ji(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,BI(n)),qt!==null)for(n=qt.return;n!==null;){var r=n;switch(Hg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&bd();break;case 3:ja(),Pt(Vn),Pt(Sn),Zg();break;case 5:Jg(r);break;case 4:ja();break;case 13:Pt(At);break;case 19:Pt(At);break;case 10:Qg(r.type._context);break;case 22:case 23:uv()}n=n.return}if(rn=e,qt=e=wi(e.current,null),dn=Xn=t,Jt=0,ic=null,av=wf=os=0,Fn=$l=null,qi!==null){for(t=0;t<qi.length;t++)if(n=qi[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}qi=null}return e}function SE(e,t){do{var n=qt;try{if(Gg(),Zu.current=Dd,_d){for(var r=Mt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}_d=!1}if(rs=0,tn=Xt=Mt=null,Ml=!1,nc=0,sv.current=null,n===null||n.return===null){Jt=1,ic=t,qt=null;break}e:{var i=e,s=n.return,l=n,c=t;if(t=dn,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 p=Zx(s);if(p!==null){p.flags&=-257,e1(p,s,l,i,t),p.mode&1&&Jx(i,u,t),t=p,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)){Jx(i,u,t),dv();break e}c=Error(Z(426))}}else if(Rt&&l.mode&1){var S=Zx(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),e1(S,s,l,i,t),Wg(Pa(c,l));break e}}i=c=Pa(c,l),Jt!==4&&(Jt=2),$l===null?$l=[i]:$l.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=oE(i,c,t);Wx(i,y);break e;case 1:l=c;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(yi===null||!yi.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=iE(i,l,t);Wx(i,b);break e}}i=i.return}while(i!==null)}EE(n)}catch(j){t=j,qt===n&&n!==null&&(qt=n=n.return);continue}break}while(!0)}function bE(){var e=Id.current;return Id.current=Dd,e===null?Dd:e}function dv(){(Jt===0||Jt===3||Jt===2)&&(Jt=4),rn===null||!(os&268435455)&&!(wf&268435455)||ai(rn,dn)}function Md(e,t){var n=tt;tt|=2;var r=bE();(rn!==e||dn!==t)&&(xo=null,Ji(e,t));do try{hA();break}catch(o){SE(e,o)}while(!0);if(Gg(),tt=n,Id.current=r,qt!==null)throw Error(Z(261));return rn=null,dn=0,Jt}function hA(){for(;qt!==null;)CE(qt)}function mA(){for(;qt!==null&&!FD();)CE(qt)}function CE(e){var t=PE(e.alternate,e,Xn);e.memoizedProps=e.pendingProps,t===null?EE(e):qt=t,sv.current=null}function EE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=aA(n,t),n!==null){n.flags&=32767,qt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Jt=6,qt=null;return}}else if(n=sA(n,t,Xn),n!==null){qt=n;return}if(t=t.sibling,t!==null){qt=t;return}qt=t=e}while(t!==null);Jt===0&&(Jt=5)}function Fi(e,t,n){var r=st,o=yr.transition;try{yr.transition=null,st=1,pA(e,t,n,r)}finally{yr.transition=o,st=r}return null}function pA(e,t,n,r){do va();while(di!==null);if(tt&6)throw Error(Z(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(Z(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(KD(e,i),e===rn&&(qt=rn=null,dn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Mu||(Mu=!0,TE(gd,function(){return va(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=yr.transition,yr.transition=null;var s=st;st=1;var l=tt;tt|=4,sv.current=null,cA(e,n),yE(n,e),MI(rp),yd=!!np,rp=np=null,e.current=n,uA(n),zD(),tt=l,st=s,yr.transition=i}else e.current=n;if(Mu&&(Mu=!1,di=e,Nd=o),i=e.pendingLanes,i===0&&(yi=null),UD(n.stateNode),Un(e,Ht()),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(Ad)throw Ad=!1,e=Cp,Cp=null,e;return Nd&1&&e.tag!==0&&va(),i=e.pendingLanes,i&1?e===Ep?Ll++:(Ll=0,Ep=e):Ll=0,Di(),null}function va(){if(di!==null){var e=rC(Nd),t=yr.transition,n=st;try{if(yr.transition=null,st=16>e?16:e,di===null)var r=!1;else{if(e=di,di=null,Nd=0,tt&6)throw Error(Z(331));var o=tt;for(tt|=4,pe=e.current;pe!==null;){var i=pe,s=i.child;if(pe.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(pe=u;pe!==null;){var d=pe;switch(d.tag){case 0:case 11:case 15:Ol(8,d,i)}var f=d.child;if(f!==null)f.return=d,pe=f;else for(;pe!==null;){d=pe;var h=d.sibling,p=d.return;if(pE(d),d===u){pe=null;break}if(h!==null){h.return=p,pe=h;break}pe=p}}}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)}}pe=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,pe=s;else e:for(;pe!==null;){if(i=pe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ol(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,pe=y;break e}pe=i.return}}var x=e.current;for(pe=x;pe!==null;){s=pe;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,pe=w;else e:for(s=x;pe!==null;){if(l=pe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:xf(9,l)}}catch(j){Ft(l,l.return,j)}if(l===s){pe=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,pe=b;break e}pe=l.return}}if(tt=o,Di(),oo&&typeof oo.onPostCommitFiberRoot=="function")try{oo.onPostCommitFiberRoot(df,e)}catch{}r=!0}return r}finally{st=n,yr.transition=t}}return!1}function h1(e,t,n){t=Pa(n,t),t=oE(e,t,1),e=vi(e,t,1),t=_n(),e!==null&&(Tc(e,1,t),Un(e,t))}function Ft(e,t,n){if(e.tag===3)h1(e,e,n);else for(;t!==null;){if(t.tag===3){h1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(yi===null||!yi.has(r))){e=Pa(n,e),e=iE(t,e,1),t=vi(t,e,1),e=_n(),t!==null&&(Tc(t,1,e),Un(t,e));break}}t=t.return}}function gA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_n(),e.pingedLanes|=e.suspendedLanes&n,rn===e&&(dn&n)===n&&(Jt===4||Jt===3&&(dn&130023424)===dn&&500>Ht()-lv?Ji(e,0):av|=n),Un(e,t)}function jE(e,t){t===0&&(e.mode&1?(t=ju,ju<<=1,!(ju&130023424)&&(ju=4194304)):t=1);var n=_n();e=Ro(e,t),e!==null&&(Tc(e,t,n),Un(e,n))}function vA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jE(e,n)}function yA(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(Z(314))}r!==null&&r.delete(t),jE(e,n)}var PE;PE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Vn.current)zn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return zn=!1,iA(e,t,n);zn=!!(e.flags&131072)}else zn=!1,Rt&&t.flags&1048576&&RC(t,jd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;td(e,t),e=t.pendingProps;var o=ba(t,Sn.current);ga(t,n),o=tv(null,t,r,e,o,n);var i=nv();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,Bn(r)?(i=!0,Cd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Yg(t),o.updater=vf,t.stateNode=o,o._reactInternals=t,fp(t,r,e,n),t=pp(null,t,r,!0,i,n)):(t.tag=0,Rt&&i&&Ug(t),Pn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(td(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=wA(r),e=Dr(r,e),o){case 0:t=mp(null,t,r,e,n);break e;case 1:t=r1(null,t,r,e,n);break e;case 11:t=t1(null,t,r,e,n);break e;case 14:t=n1(null,t,r,Dr(r.type,e),n);break e}throw Error(Z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Dr(r,o),mp(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Dr(r,o),r1(e,t,r,o,n);case 3:e:{if(cE(t),e===null)throw Error(Z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,AC(e,t),kd(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Pa(Error(Z(423)),t),t=o1(e,t,r,n,o);break e}else if(r!==o){o=Pa(Error(Z(424)),t),t=o1(e,t,r,n,o);break e}else for(Zn=gi(t.stateNode.containerInfo.firstChild),tr=t,Rt=!0,Nr=null,n=$C(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ca(),r===o){t=_o(e,t,n);break e}Pn(e,t,r,n)}t=t.child}return t;case 5:return LC(t),e===null&&cp(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,op(r,o)?s=null:i!==null&&op(r,i)&&(t.flags|=32),lE(e,t),Pn(e,t,s,n),t.child;case 6:return e===null&&cp(t),null;case 13:return uE(e,t,n);case 4:return Xg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ea(t,null,r,n):Pn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Dr(r,o),t1(e,t,r,o,n);case 7:return Pn(e,t,t.pendingProps,n),t.child;case 8:return Pn(e,t,t.pendingProps.children,n),t.child;case 12:return Pn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,gt(Pd,r._currentValue),r._currentValue=s,i!==null)if(Fr(i.value,s)){if(i.children===o.children&&!Vn.current){t=_o(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Co(-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),up(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Z(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),up(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Pn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ga(t,n),o=wr(o),r=r(o),t.flags|=1,Pn(e,t,r,n),t.child;case 14:return r=t.type,o=Dr(r,t.pendingProps),o=Dr(r.type,o),n1(e,t,r,o,n);case 15:return sE(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Dr(r,o),td(e,t),t.tag=1,Bn(r)?(e=!0,Cd(t)):e=!1,ga(t,n),MC(t,r,o),fp(t,r,o,n),pp(null,t,r,!0,e,n);case 19:return dE(e,t,n);case 22:return aE(e,t,n)}throw Error(Z(156,t.tag))};function TE(e,t){return Zb(e,t)}function xA(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 vr(e,t,n,r){return new xA(e,t,n,r)}function fv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wA(e){if(typeof e=="function")return fv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Dg)return 11;if(e===Ig)return 14}return 2}function wi(e,t){var n=e.alternate;return n===null?(n=vr(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 od(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")fv(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ys:return Zi(n.children,o,i,t);case _g:s=8,o|=8;break;case Om:return e=vr(12,n,t,o|2),e.elementType=Om,e.lanes=i,e;case $m:return e=vr(13,n,t,o),e.elementType=$m,e.lanes=i,e;case Lm:return e=vr(19,n,t,o),e.elementType=Lm,e.lanes=i,e;case Ob:return Sf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nb:s=10;break e;case Mb:s=9;break e;case Dg:s=11;break e;case Ig:s=14;break e;case ti:s=16,r=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=vr(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Zi(e,t,n,r){return e=vr(7,e,r,t),e.lanes=n,e}function Sf(e,t,n,r){return e=vr(22,e,r,t),e.elementType=Ob,e.lanes=n,e.stateNode={isHidden:!1},e}function am(e,t,n){return e=vr(6,e,null,t),e.lanes=n,e}function lm(e,t,n){return t=vr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function SA(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=Bh(0),this.expirationTimes=Bh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function hv(e,t,n,r,o,i,s,l,c){return e=new SA(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=vr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yg(i),e}function bA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function kE(e){if(!e)return Ei;e=e._reactInternals;e:{if(xs(e)!==e||e.tag!==1)throw Error(Z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Bn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Z(171))}if(e.tag===1){var n=e.type;if(Bn(n))return TC(e,n,t)}return t}function RE(e,t,n,r,o,i,s,l,c){return e=hv(n,r,!0,e,o,i,s,l,c),e.context=kE(null),n=e.current,r=_n(),o=xi(n),i=Co(r,o),i.callback=t??null,vi(n,i,o),e.current.lanes=o,Tc(e,o,r),Un(e,r),e}function bf(e,t,n,r){var o=t.current,i=_n(),s=xi(o);return n=kE(n),t.context===null?t.context=n:t.pendingContext=n,t=Co(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=vi(o,t,s),e!==null&&($r(e,o,s,i),Ju(e,o,s)),s}function Od(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 m1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mv(e,t){m1(e,t),(e=e.alternate)&&m1(e,t)}function CA(){return null}var _E=typeof reportError=="function"?reportError:function(e){console.error(e)};function pv(e){this._internalRoot=e}Cf.prototype.render=pv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Z(409));bf(e,t,null,null)};Cf.prototype.unmount=pv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;is(function(){bf(null,e,null,null)}),t[ko]=null}};function Cf(e){this._internalRoot=e}Cf.prototype.unstable_scheduleHydration=function(e){if(e){var t=sC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<si.length&&t!==0&&t<si[n].priority;n++);si.splice(n,0,e),n===0&&lC(e)}};function gv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ef(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function p1(){}function EA(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Od(s);i.call(u)}}var s=RE(t,r,e,0,null,!1,!1,"",p1);return e._reactRootContainer=s,e[ko]=s.current,Xl(e.nodeType===8?e.parentNode:e),is(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=Od(c);l.call(u)}}var c=hv(e,0,!1,null,null,!1,!1,"",p1);return e._reactRootContainer=c,e[ko]=c.current,Xl(e.nodeType===8?e.parentNode:e),is(function(){bf(t,c,n,r)}),c}function jf(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var c=Od(s);l.call(c)}}bf(t,s,e,o)}else s=EA(n,t,e,o,r);return Od(s)}oC=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Pl(t.pendingLanes);n!==0&&(Mg(t,n|1),Un(t,Ht()),!(tt&6)&&(Ta=Ht()+500,Di()))}break;case 13:is(function(){var r=Ro(e,1);if(r!==null){var o=_n();$r(r,e,1,o)}}),mv(e,1)}};Og=function(e){if(e.tag===13){var t=Ro(e,134217728);if(t!==null){var n=_n();$r(t,e,134217728,n)}mv(e,134217728)}};iC=function(e){if(e.tag===13){var t=xi(e),n=Ro(e,t);if(n!==null){var r=_n();$r(n,e,t,r)}mv(e,t)}};sC=function(){return st};aC=function(e,t){var n=st;try{return st=e,t()}finally{st=n}};Qm=function(e,t,n){switch(t){case"input":if(Vm(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=pf(r);if(!o)throw Error(Z(90));Lb(r),Vm(r,o)}}}break;case"textarea":zb(e,n);break;case"select":t=n.value,t!=null&&fa(e,!!n.multiple,t,!1)}};Gb=cv;Qb=is;var jA={usingClientEntryPoint:!1,Events:[Rc,ea,pf,Wb,qb,cv]},pl={findFiberByHostInstance:Wi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},PA={bundleType:pl.bundleType,version:pl.version,rendererPackageName:pl.rendererPackageName,rendererConfig:pl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Xb(e),e===null?null:e.stateNode},findFiberByHostInstance:pl.findFiberByHostInstance||CA,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 Ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ou.isDisabled&&Ou.supportsFiber)try{df=Ou.inject(PA),oo=Ou}catch{}}sr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jA;sr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gv(t))throw Error(Z(200));return bA(e,t,null,n)};sr.createRoot=function(e,t){if(!gv(e))throw Error(Z(299));var n=!1,r="",o=_E;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=hv(e,1,!1,null,null,n,!1,r,o),e[ko]=t.current,Xl(e.nodeType===8?e.parentNode:e),new pv(t)};sr.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(Z(188)):(e=Object.keys(e).join(","),Error(Z(268,e)));return e=Xb(t),e=e===null?null:e.stateNode,e};sr.flushSync=function(e){return is(e)};sr.hydrate=function(e,t,n){if(!Ef(t))throw Error(Z(200));return jf(null,e,t,!0,n)};sr.hydrateRoot=function(e,t,n){if(!gv(e))throw Error(Z(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=_E;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=RE(t,null,e,1,n??null,o,!1,i,s),e[ko]=t.current,Xl(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 Cf(t)};sr.render=function(e,t,n){if(!Ef(t))throw Error(Z(200));return jf(null,e,t,!1,n)};sr.unmountComponentAtNode=function(e){if(!Ef(e))throw Error(Z(40));return e._reactRootContainer?(is(function(){jf(null,null,e,!1,function(){e._reactRootContainer=null,e[ko]=null})}),!0):!1};sr.unstable_batchedUpdates=cv;sr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ef(n))throw Error(Z(200));if(e==null||e._reactInternals===void 0)throw Error(Z(38));return jf(e,t,n,!1,r)};sr.version="18.2.0-next-9e3b772b8-20220608";function DE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DE)}catch(e){console.error(e)}}DE(),Rb.exports=sr;var Dc=Rb.exports;const aa=fg(Dc),TA=zS({__proto__:null,default:aa},[Dc]),[kA,Cr]=Nn("ScrollArea.Root component was not found in tree");function ka(e,t){const n=Bi(t);za(()=>{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 RA=C.forwardRef((e,t)=>{const{style:n,...r}=e,o=Cr(),[i,s]=C.useState(0),[l,c]=C.useState(0),u=!!(i&&l);return ka(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),ka(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),u?C.createElement("div",{...r,ref:t,style:{...n,width:i,height:l}}):null}),_A=C.forwardRef((e,t)=>{const n=Cr(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?C.createElement(RA,{...e,ref:t}):null}),DA={scrollHideDelay:1e3,type:"hover"},IE=m.forwardRef((e,t)=>{const n=U("ScrollAreaRoot",DA,e),{type:r,scrollHideDelay:o,scrollbars:i,...s}=n,[l,c]=m.useState(null),[u,d]=m.useState(null),[f,h]=m.useState(null),[p,g]=m.useState(null),[v,S]=m.useState(null),[y,x]=m.useState(0),[w,b]=m.useState(0),[j,P]=m.useState(!1),[E,T]=m.useState(!1),_=Qt(t,R=>c(R));return C.createElement(kA,{value:{type:r,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:j,onScrollbarXEnabledChange:P,scrollbarY:v,onScrollbarYChange:S,scrollbarYEnabled:E,onScrollbarYEnabledChange:T,onCornerWidthChange:x,onCornerHeightChange:b}},C.createElement(G,{...s,ref:_,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${y}px`,"--sa-corner-height":i!=="xy"?"0px":`${w}px`}}))});IE.displayName="@mantine/core/ScrollAreaRoot";function AE(e,t){const n=e/t;return Number.isNaN(n)?0:n}function Pf(e){const t=AE(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function NE(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 IA(e,[t,n]){return Math.min(n,Math.max(t,e))}function g1(e,t,n="ltr"){const r=Pf(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,s]:[s*-1,0],u=IA(e,c);return NE([0,s],[0,l])(u)}function AA(e,t,n,r="ltr"){const o=Pf(n),i=o/2,s=t||i,l=o-s,c=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return NE([c,u],f)(e)}function ME(e,t){return e>0&&e<t}function $d(e){return e?parseInt(e,10):0}function es(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[NA,OE]=Nn("ScrollAreaScrollbar was not found in tree"),$E=m.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=Cr(),[p,g]=C.useState(null),v=Qt(t,T=>g(T)),S=C.useRef(null),y=C.useRef(""),{viewport:x}=h,w=n.content-n.viewport,b=Bi(u),j=Bi(l),P=lf(d,10),E=T=>{if(S.current){const _=T.clientX-S.current.left,R=T.clientY-S.current.top;c({x:_,y:R})}};return m.useEffect(()=>{const T=_=>{const R=_.target;(p==null?void 0:p.contains(R))&&b(_,w)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[x,p,w,b]),m.useEffect(j,[n,j]),ka(p,P),ka(h.content,P),C.createElement(NA,{value:{scrollbar:p,hasThumb:r,onThumbChange:Bi(o),onThumbPointerUp:Bi(i),onThumbPositionChange:j,onThumbPointerDown:Bi(s)}},C.createElement("div",{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:es(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),S.current=p.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",E(T))}),onPointerMove:es(e.onPointerMove,E),onPointerUp:es(e.onPointerUp,T=>{const _=T.target;_.hasPointerCapture(T.pointerId)&&_.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=y.current,S.current=null})}))}),MA=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,s=Cr(),[l,c]=m.useState(),u=m.useRef(null),d=Qt(t,u,s.onScrollbarXChange);return m.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),C.createElement($E,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{...o,"--sa-thumb-width":`${Pf(n)}px`},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),ME(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:$d(l.paddingLeft),paddingEnd:$d(l.paddingRight)}})}})}),OA=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,s=Cr(),[l,c]=C.useState(),u=m.useRef(null),d=Qt(t,u,s.onScrollbarYChange);return m.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),C.createElement($E,{...i,"data-orientation":"vertical",ref:d,sizes:n,style:{"--sa-thumb-height":`${Pf(n)}px`,...o},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),ME(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:$d(l.paddingTop),paddingEnd:$d(l.paddingBottom)}})}})}),vv=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=Ua(),i=Cr(),s=m.useRef(null),l=m.useRef(0),[c,u]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=AE(c.viewport,c.content),f={...r,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:p=>{s.current=p},onThumbPointerUp:()=>{l.current=0},onThumbPointerDown:p=>{l.current=p}},h=(p,g)=>AA(p,l.current,c,g);return n==="horizontal"?C.createElement(MA,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollLeft,g=g1(p,c,o);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=h(p,o))}}):n==="vertical"?C.createElement(OA,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollTop,g=g1(p,c);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=h(p))}}):null}),LE=m.forwardRef((e,t)=>{const n=Cr(),{forceMount:r,...o}=e,[i,s]=m.useState(!1),l=e.orientation==="horizontal",c=lf(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(l?u:d)}},10);return ka(n.viewport,c),ka(n.content,c),r||i?C.createElement(vv,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),$A=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Cr(),[i,s]=m.useState(!1);return m.useEffect(()=>{const{scrollArea:l}=o;let c=0;if(l){const u=()=>{window.clearTimeout(c),s(!0)},d=()=>{c=window.setTimeout(()=>s(!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?C.createElement(LE,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),LA=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Cr(),i=e.orientation==="horizontal",[s,l]=m.useState("hidden"),c=lf(()=>l("idle"),100);return m.useEffect(()=>{if(s==="idle"){const u=window.setTimeout(()=>l("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[s,o.scrollHideDelay]),m.useEffect(()=>{const{viewport:u}=o,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const p=u[d];f!==p&&(l("scrolling"),c()),f=p};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c]),n||s!=="hidden"?C.createElement(vv,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:es(e.onPointerEnter,()=>l("interacting")),onPointerLeave:es(e.onPointerLeave,()=>l("idle"))}):null}),v1=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Cr(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,l=e.orientation==="horizontal";return C.useEffect(()=>(l?i(!0):s(!0),()=>{l?i(!1):s(!1)}),[l,i,s]),o.type==="hover"?C.createElement($A,{...r,ref:t,forceMount:n}):o.type==="scroll"?C.createElement(LA,{...r,ref:t,forceMount:n}):o.type==="auto"?C.createElement(LE,{...r,ref:t,forceMount:n}):o.type==="always"?C.createElement(vv,{...r,ref:t}):null});function FA(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,l=n.top!==i.top;(s||l)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const zA=m.forwardRef((e,t)=>{const{style:n,...r}=e,o=Cr(),i=OE(),{onThumbPositionChange:s}=i,l=Qt(t,d=>i.onThumbChange(d)),c=m.useRef(),u=lf(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const{viewport:d}=o;if(d){const f=()=>{if(u(),!c.current){const h=FA(d,s);c.current=h,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,u,s]),C.createElement("div",{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:es(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),p=d.clientX-h.left,g=d.clientY-h.top;i.onThumbPointerDown({x:p,y:g})}),onPointerUp:es(e.onPointerUp,i.onThumbPointerUp)})}),y1=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OE();return n||o.hasThumb?C.createElement(zA,{ref:t,...r}):null}),FE=m.forwardRef(({children:e,style:t,...n},r)=>{const o=Cr(),i=Qt(r,o.onViewportChange);return C.createElement(G,{...n,ref:i,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t}},C.createElement("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange},e))});FE.displayName="@mantine/core/ScrollAreaViewport";var yv={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const zE={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},VA=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":V(t)}}),Er=X((e,t)=>{const n=U("ScrollArea",zE,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,scrollbarSize:c,vars:u,type:d,scrollHideDelay:f,viewportProps:h,viewportRef:p,onScrollPositionChange:g,children:v,offsetScrollbars:S,scrollbars:y,...x}=n,[w,b]=m.useState(!1),j=me({name:"ScrollArea",props:n,classes:yv,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:VA});return C.createElement(IE,{type:d==="never"?"always":d,scrollHideDelay:f,ref:t,scrollbars:y,...j("root"),...x},C.createElement(FE,{...h,...j("viewport",{style:h==null?void 0:h.style}),ref:p,"data-offset-scrollbars":S===!0?"xy":S||void 0,"data-scrollbars":y||void 0,onScroll:P=>{var E;(E=h==null?void 0:h.onScroll)==null||E.call(h,P),g==null||g({x:P.currentTarget.scrollLeft,y:P.currentTarget.scrollTop})}},v),(y==="xy"||y==="x")&&C.createElement(v1,{...j("scrollbar"),orientation:"horizontal","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1)},C.createElement(y1,{...j("thumb")})),(y==="xy"||y==="y")&&C.createElement(v1,{...j("scrollbar"),orientation:"vertical","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1)},C.createElement(y1,{...j("thumb")})),C.createElement(_A,{...j("corner"),"data-hovered":w||void 0,"data-hidden":d==="never"||void 0}))});Er.displayName="@mantine/core/ScrollArea";const Tf=X((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:i,scrollHideDelay:s,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:p,viewportProps:g,scrollbars:v,style:S,vars:y,...x}=U("ScrollAreaAutosize",zE,e);return C.createElement(G,{...x,ref:t,style:[{display:"flex",overflow:"auto"},S]},C.createElement(G,{style:{display:"flex",flexDirection:"column",flex:1}},C.createElement(Er,{classNames:r,styles:o,scrollHideDelay:s,scrollbarSize:i,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:p,viewportProps:g,vars:y,scrollbars:v},n)))});Er.classes=yv;Tf.displayName="@mantine/core/ScrollAreaAutosize";Tf.classes=yv;Er.Autosize=Tf;var VE={root:"m_87cf2631"};const BA={__staticSelector:"UnstyledButton"},Dn=bn((e,t)=>{const n=U("UnstyledButton",BA,e),{className:r,component:o="button",__staticSelector:i,unstyled:s,classNames:l,styles:c,style:u,...d}=n,f=me({name:i,props:n,classes:VE,className:r,style:u,classNames:l,styles:c,unstyled:s});return C.createElement(G,{...f("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...d})});Dn.classes=VE;Dn.displayName="@mantine/core/UnstyledButton";var BE={root:"m_515a97f8"};const UA={},xv=X((e,t)=>{const n=U("VisuallyHidden",UA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,...u}=n,d=me({name:"VisuallyHidden",classes:BE,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l});return C.createElement(G,{component:"span",ref:t,...d("root"),...u})});xv.classes=BE;xv.displayName="@mantine/core/VisuallyHidden";var UE={root:"m_1b7284a3"};const HA={},WA=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:St(t),"--paper-shadow":yg(n)}}),Hn=bn((e,t)=>{const n=U("Paper",HA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,withBorder:c,vars:u,radius:d,shadow:f,variant:h,mod:p,...g}=n,v=me({name:"Paper",props:n,classes:UE,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:WA});return C.createElement(G,{ref:t,mod:[{"data-with-border":c},p],...v("root"),variant:h,...g})});Hn.classes=UE;Hn.displayName="@mantine/core/Paper";function ji(e){return HE(e)?(e.nodeName||"").toLowerCase():"#document"}function Wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fo(e){var t;return(t=(HE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function HE(e){return e instanceof Node||e instanceof Wn(e).Node}function Nt(e){return e instanceof Element||e instanceof Wn(e).Element}function rr(e){return e instanceof HTMLElement||e instanceof Wn(e).HTMLElement}function Tp(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wn(e).ShadowRoot}function Ic(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=or(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function qA(e){return["table","td","th"].includes(ji(e))}function wv(e){const t=Sv(),n=or(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 GA(e){let t=ss(e);for(;rr(t)&&!Ra(t);){if(wv(t))return t;t=ss(t)}return null}function Sv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ra(e){return["html","body","#document"].includes(ji(e))}function or(e){return Wn(e).getComputedStyle(e)}function kf(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ss(e){if(ji(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tp(e)&&e.host||Fo(e);return Tp(t)?t.host:t}function WE(e){const t=ss(e);return Ra(t)?e.ownerDocument?e.ownerDocument.body:e.body:rr(t)&&Ic(t)?t:WE(t)}function Eo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=WE(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Wn(o);return i?t.concat(s,s.visualViewport||[],Ic(o)?o:[],s.frameElement&&n?Eo(s.frameElement):[]):t.concat(o,Eo(o,[],n))}function x1(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 sc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Tp(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function qE(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function GE(){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 QA(e){return XA()?!1:!w1()&&e.width===0&&e.height===0||w1()&&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 KA(){return/apple/i.test(navigator.vendor)}function w1(){const e=/android/i;return e.test(qE())||e.test(GE())}function YA(){return qE().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function XA(){return GE().includes("jsdom/")}function kp(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function JA(e){return"nativeEvent"in e}function ZA(e){return e.matches("html,body")}function Qi(e){return(e==null?void 0:e.ownerDocument)||document}function cm(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 qs(e){return"composedPath"in e?e.composedPath()[0]:e.target}const eN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function tN(e){return rr(e)&&e.matches(eN)}const zr=Math.min,xn=Math.max,Ld=Math.round,$u=Math.floor,Pi=e=>({x:e,y:e}),nN={left:"right",right:"left",bottom:"top",top:"bottom"},rN={start:"end",end:"start"};function Rp(e,t,n){return xn(e,zr(t,n))}function Do(e,t){return typeof e=="function"?e(t):e}function Vr(e){return e.split("-")[0]}function qa(e){return e.split("-")[1]}function bv(e){return e==="x"?"y":"x"}function Cv(e){return e==="y"?"height":"width"}function ws(e){return["top","bottom"].includes(Vr(e))?"y":"x"}function Ev(e){return bv(ws(e))}function oN(e,t,n){n===void 0&&(n=!1);const r=qa(e),o=Ev(e),i=Cv(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Fd(s)),[s,Fd(s)]}function iN(e){const t=Fd(e);return[_p(e),t,_p(t)]}function _p(e){return e.replace(/start|end/g,t=>rN[t])}function sN(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function aN(e,t,n,r){const o=qa(e);let i=sN(Vr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(_p)))),i}function Fd(e){return e.replace(/left|right|bottom|top/g,t=>nN[t])}function lN(e){return{top:0,right:0,bottom:0,left:0,...e}}function jv(e){return typeof e!="number"?lN(e):{top:e,right:e,bottom:e,left:e}}function _a(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 S1(e,t,n){let{reference:r,floating:o}=e;const i=ws(t),s=Ev(t),l=Cv(s),c=Vr(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 p;switch(c){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(qa(t)){case"start":p[s]-=h*(n&&u?-1:1);break;case"end":p[s]+=h*(n&&u?-1:1);break}return p}const cN=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=S1(u,r,c),h=r,p={},g=0;for(let v=0;v<l.length;v++){const{name:S,fn:y}=l[v],{x,y:w,data:b,reset:j}=await y({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:u,platform:s,elements:{reference:e,floating:t}});d=x??d,f=w??f,p={...p,[S]:{...p[S],...b}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(u=j.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:f}=S1(u,h,c)),v=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:p}};async function Pv(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Do(t,e),g=jv(p),S=l[h?f==="floating"?"reference":"floating":f],y=_a(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})),x=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),b=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},j=_a(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(y.top-j.top+g.top)/b.y,bottom:(j.bottom-y.bottom+g.bottom)/b.y,left:(y.left-j.left+g.left)/b.x,right:(j.right-y.right+g.right)/b.x}}const uN=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Do(e,t)||{};if(u==null)return{};const f=jv(d),h={x:n,y:r},p=Ev(o),g=Cv(p),v=await s.getDimensions(u),S=p==="y",y=S?"top":"left",x=S?"bottom":"right",w=S?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[p]-h[p]-i.floating[g],j=h[p]-i.reference[p],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let E=P?P[w]:0;(!E||!await(s.isElement==null?void 0:s.isElement(P)))&&(E=l.floating[w]||i.floating[g]);const T=b/2-j/2,_=E/2-v[g]/2-1,R=zr(f[y],_),O=zr(f[x],_),I=R,M=E-v[g]-O,F=E/2-v[g]/2+T,N=Rp(I,F,M),A=!c.arrow&&qa(o)!=null&&F!==N&&i.reference[g]/2-(F<I?R:O)-v[g]/2<0,D=A?F<I?F-I:F-M:0;return{[p]:h[p]+D,data:{[p]:N,centerOffset:F-N-D,...A&&{alignmentOffset:D}},reset:A}}}),dN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...S}=Do(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Vr(o),x=Vr(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=h||(x||!v?[Fd(l)]:iN(l));!h&&g!=="none"&&b.push(...aN(l,v,g,w));const j=[l,...b],P=await Pv(t,S),E=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&E.push(P[y]),f){const I=oN(o,s,w);E.push(P[I[0]],P[I[1]])}if(T=[...T,{placement:o,overflows:E}],!E.every(I=>I<=0)){var _,R;const I=(((_=i.flip)==null?void 0:_.index)||0)+1,M=j[I];if(M)return{data:{index:I,overflows:T},reset:{placement:M}};let F=(R=T.filter(N=>N.overflows[0]<=0).sort((N,A)=>N.overflows[1]-A.overflows[1])[0])==null?void 0:R.placement;if(!F)switch(p){case"bestFit":{var O;const N=(O=T.map(A=>[A.placement,A.overflows.filter(D=>D>0).reduce((D,k)=>D+k,0)]).sort((A,D)=>A[1]-D[1])[0])==null?void 0:O[0];N&&(F=N);break}case"initialPlacement":F=l;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function QE(e){const t=zr(...e.map(i=>i.left)),n=zr(...e.map(i=>i.top)),r=xn(...e.map(i=>i.right)),o=xn(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function fN(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=>_a(QE(o)))}const hN=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:s}=t,{padding:l=2,x:c,y:u}=Do(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),f=fN(d),h=_a(QE(d)),p=jv(l);function g(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&u!=null)return f.find(S=>c>S.left-p.left&&c<S.right+p.right&&u>S.top-p.top&&u<S.bottom+p.bottom)||h;if(f.length>=2){if(ws(n)==="y"){const R=f[0],O=f[f.length-1],I=Vr(n)==="top",M=R.top,F=O.bottom,N=I?R.left:O.left,A=I?R.right:O.right,D=A-N,k=F-M;return{top:M,bottom:F,left:N,right:A,width:D,height:k,x:N,y:M}}const S=Vr(n)==="left",y=xn(...f.map(R=>R.right)),x=zr(...f.map(R=>R.left)),w=f.filter(R=>S?R.left===x:R.right===y),b=w[0].top,j=w[w.length-1].bottom,P=x,E=y,T=E-P,_=j-b;return{top:b,bottom:j,left:P,right:E,width:T,height:_,x:P,y:b}}return h}const v=await i.getElementRects({reference:{getBoundingClientRect:g},floating:r.floating,strategy:s});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 mN(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Vr(n),l=qa(n),c=ws(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&c?-1:1,f=Do(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const pN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await mN(t,e);return s===((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:s}}}}},gN=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:s=!1,limiter:l={fn:S=>{let{x:y,y:x}=S;return{x:y,y:x}}},...c}=Do(e,t),u={x:n,y:r},d=await Pv(t,c),f=ws(Vr(o)),h=bv(f);let p=u[h],g=u[f];if(i){const S=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=p+d[S],w=p-d[y];p=Rp(x,p,w)}if(s){const S=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=g+d[S],w=g-d[y];g=Rp(x,g,w)}const v=l.fn({...t,[h]:p,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r}}}}},vN=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Do(e,t),d={x:n,y:r},f=ws(o),h=bv(f);let p=d[h],g=d[f];const v=Do(l,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const w=h==="y"?"height":"width",b=i.reference[h]-i.floating[w]+S.mainAxis,j=i.reference[h]+i.reference[w]-S.mainAxis;p<b?p=b:p>j&&(p=j)}if(u){var y,x;const w=h==="y"?"width":"height",b=["top","left"].includes(Vr(o)),j=i.reference[f]-i.floating[w]+(b&&((y=s.offset)==null?void 0:y[f])||0)+(b?0:S.crossAxis),P=i.reference[f]+i.reference[w]+(b?0:((x=s.offset)==null?void 0:x[f])||0)-(b?S.crossAxis:0);g<j?g=j:g>P&&(g=P)}return{[h]:p,[f]:g}}}},yN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...l}=Do(e,t),c=await Pv(t,l),u=Vr(n),d=qa(n),f=ws(n)==="y",{width:h,height:p}=r.floating;let g,v;u==="top"||u==="bottom"?(g=u,v=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(v=u,g=d==="end"?"top":"bottom");const S=p-c[g],y=h-c[v],x=!t.middlewareData.shift;let w=S,b=y;if(f){const P=h-c.left-c.right;b=d||x?zr(y,P):P}else{const P=p-c.top-c.bottom;w=d||x?zr(S,P):P}if(x&&!d){const P=xn(c.left,0),E=xn(c.right,0),T=xn(c.top,0),_=xn(c.bottom,0);f?b=h-2*(P!==0||E!==0?P+E:xn(c.left,c.right)):w=p-2*(T!==0||_!==0?T+_:xn(c.top,c.bottom))}await s({...t,availableWidth:b,availableHeight:w});const j=await o.getDimensions(i.floating);return h!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function KE(e){const t=or(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=rr(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=Ld(n)!==i||Ld(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Tv(e){return Nt(e)?e:e.contextElement}function ya(e){const t=Tv(e);if(!rr(t))return Pi(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=KE(t);let s=(i?Ld(n.width):n.width)/r,l=(i?Ld(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const xN=Pi(0);function YE(e){const t=Wn(e);return!Sv()||!t.visualViewport?xN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wn(e)?!1:t}function as(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Tv(e);let s=Pi(1);t&&(r?Nt(r)&&(s=ya(r)):s=ya(e));const l=wN(i,n,r)?YE(i):Pi(0);let c=(o.left+l.x)/s.x,u=(o.top+l.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const h=Wn(i),p=r&&Nt(r)?Wn(r):r;let g=h,v=g.frameElement;for(;v&&r&&p!==g;){const S=ya(v),y=v.getBoundingClientRect(),x=or(v),w=y.left+(v.clientLeft+parseFloat(x.paddingLeft))*S.x,b=y.top+(v.clientTop+parseFloat(x.paddingTop))*S.y;c*=S.x,u*=S.y,d*=S.x,f*=S.y,c+=w,u+=b,g=Wn(v),v=g.frameElement}}return _a({width:d,height:f,x:c,y:u})}const SN=[":popover-open",":modal"];function XE(e){return SN.some(t=>{try{return e.matches(t)}catch{return!1}})}function bN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Fo(r),l=t?XE(t.floating):!1;if(r===s||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Pi(1);const d=Pi(0),f=rr(r);if((f||!f&&!i)&&((ji(r)!=="body"||Ic(s))&&(c=kf(r)),rr(r))){const h=as(r);u=ya(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 CN(e){return Array.from(e.getClientRects())}function JE(e){return as(Fo(e)).left+kf(e).scrollLeft}function EN(e){const t=Fo(e),n=kf(e),r=e.ownerDocument.body,o=xn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+JE(e);const l=-n.scrollTop;return or(r).direction==="rtl"&&(s+=xn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function jN(e,t){const n=Wn(e),r=Fo(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=Sv();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:l,y:c}}function PN(e,t){const n=as(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=rr(e)?ya(e):Pi(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:s,height:l,x:c,y:u}}function b1(e,t,n){let r;if(t==="viewport")r=jN(e,n);else if(t==="document")r=EN(Fo(e));else if(Nt(t))r=PN(t,n);else{const o=YE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return _a(r)}function ZE(e,t){const n=ss(e);return n===t||!Nt(n)||Ra(n)?!1:or(n).position==="fixed"||ZE(n,t)}function TN(e,t){const n=t.get(e);if(n)return n;let r=Eo(e,[],!1).filter(l=>Nt(l)&&ji(l)!=="body"),o=null;const i=or(e).position==="fixed";let s=i?ss(e):e;for(;Nt(s)&&!Ra(s);){const l=or(s),c=wv(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ic(s)&&!c&&ZE(e,s))?r=r.filter(d=>d!==s):o=l,s=ss(s)}return t.set(e,r),r}function kN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?TN(t,this._c):[].concat(n),r],l=s[0],c=s.reduce((u,d)=>{const f=b1(t,d,o);return u.top=xn(f.top,u.top),u.right=zr(f.right,u.right),u.bottom=zr(f.bottom,u.bottom),u.left=xn(f.left,u.left),u},b1(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function RN(e){const{width:t,height:n}=KE(e);return{width:t,height:n}}function _N(e,t,n){const r=rr(t),o=Fo(t),i=n==="fixed",s=as(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pi(0);if(r||!r&&!i)if((ji(t)!=="body"||Ic(o))&&(l=kf(t)),r){const f=as(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=JE(o));const u=s.left+l.scrollLeft-c.x,d=s.top+l.scrollTop-c.y;return{x:u,y:d,width:s.width,height:s.height}}function C1(e,t){return!rr(e)||or(e).position==="fixed"?null:t?t(e):e.offsetParent}function ej(e,t){const n=Wn(e);if(!rr(e)||XE(e))return n;let r=C1(e,t);for(;r&&qA(r)&&or(r).position==="static";)r=C1(r,t);return r&&(ji(r)==="html"||ji(r)==="body"&&or(r).position==="static"&&!wv(r))?n:r||GA(e)||n}const DN=async function(e){const t=this.getOffsetParent||ej,n=this.getDimensions,r=await n(e.floating);return{reference:_N(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function IN(e){return or(e).direction==="rtl"}const AN={convertOffsetParentRelativeRectToViewportRelativeRect:bN,getDocumentElement:Fo,getClippingRect:kN,getOffsetParent:ej,getElementRects:DN,getClientRects:CN,getDimensions:RN,getScale:ya,isElement:Nt,isRTL:IN};function NN(e,t){let n=null,r;const o=Fo(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(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 p=$u(d),g=$u(o.clientWidth-(u+f)),v=$u(o.clientHeight-(d+h)),S=$u(u),x={rootMargin:-p+"px "+-g+"px "+-v+"px "+-S+"px",threshold:xn(0,zr(1,c))||1};let w=!0;function b(j){const P=j[0].intersectionRatio;if(P!==c){if(!w)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(b,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(e)}return s(!0),i}function MN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Tv(e),d=o||i?[...u?Eo(u):[],...Eo(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&l?NN(u,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!c&&p.observe(u),p.observe(t));let g,v=c?as(e):null;c&&S();function S(){const y=as(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&n(),v=y,g=requestAnimationFrame(S)}return n(),()=>{var y;d.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const tj=pN,kv=gN,Dp=dN,ON=yN,E1=uN,Ip=hN,j1=vN,$N=(e,t,n)=>{const r=new Map,o={platform:AN,...n},i={...o.platform,_c:r};return cN(e,t,{...o,platform:i})},nj=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?E1({element:r.current,padding:o}).fn(n):{}:r?E1({element:r,padding:o}).fn(n):{}}}};var id=typeof document<"u"?m.useLayoutEffect:m.useEffect;function zd(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(!zd(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)&&!zd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function rj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function P1(e,t){const n=rj(e);return Math.round(t*n)/n}function T1(e){const t=m.useRef(e);return id(()=>{t.current=e}),t}function LN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);zd(h,r)||p(r);const[g,v]=m.useState(null),[S,y]=m.useState(null),x=m.useCallback(D=>{D!==P.current&&(P.current=D,v(D))},[]),w=m.useCallback(D=>{D!==E.current&&(E.current=D,y(D))},[]),b=i||g,j=s||S,P=m.useRef(null),E=m.useRef(null),T=m.useRef(d),_=c!=null,R=T1(c),O=T1(o),I=m.useCallback(()=>{if(!P.current||!E.current)return;const D={placement:t,strategy:n,middleware:h};O.current&&(D.platform=O.current),$N(P.current,E.current,D).then(k=>{const L={...k,isPositioned:!0};M.current&&!zd(T.current,L)&&(T.current=L,Dc.flushSync(()=>{f(L)}))})},[h,t,n,O]);id(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(D=>({...D,isPositioned:!1})))},[u]);const M=m.useRef(!1);id(()=>(M.current=!0,()=>{M.current=!1}),[]),id(()=>{if(b&&(P.current=b),j&&(E.current=j),b&&j){if(R.current)return R.current(b,j,I);I()}},[b,j,I,R,_]);const F=m.useMemo(()=>({reference:P,floating:E,setReference:x,setFloating:w}),[x,w]),N=m.useMemo(()=>({reference:b,floating:j}),[b,j]),A=m.useMemo(()=>{const D={position:n,left:0,top:0};if(!N.floating)return D;const k=P1(N.floating,d.x),L=P1(N.floating,d.y);return l?{...D,transform:"translate("+k+"px, "+L+"px)",...rj(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:L}},[n,l,N.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:I,refs:F,elements:N,floatingStyles:A}),[d,I,F,N,A])}const oj={...YS},FN=oj.useInsertionEffect,zN=FN||(e=>e());function Gs(e){const t=m.useRef(()=>{});return zN(()=>{t.current=e}),m.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 so=typeof document<"u"?m.useLayoutEffect:m.useEffect;let k1=!1,VN=0;const R1=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+VN++;function BN(){const[e,t]=m.useState(()=>k1?R1():void 0);return so(()=>{e==null&&t(R1())},[]),m.useEffect(()=>{k1=!0},[]),e}const UN=oj.useId,ij=UN||BN;function HN(){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 WN=m.createContext(null),qN=m.createContext(null),Rv=()=>{var e;return((e=m.useContext(WN))==null?void 0:e.id)||null},_v=()=>m.useContext(qN);function Dv(e){return"data-floating-ui-"+e}function _1(e){const t=m.useRef(e);return so(()=>{t.current=e}),t}const D1=Dv("safe-polygon");function sd(e,t,n){return n&&!kp(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function GN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:s,floating:l},refs:c}=e,{enabled:u=!0,delay:d=0,handleClose:f=null,mouseOnly:h=!1,restMs:p=0,move:g=!0}=t,v=_v(),S=Rv(),y=_1(f),x=_1(d),w=m.useRef(),b=m.useRef(-1),j=m.useRef(),P=m.useRef(-1),E=m.useRef(!0),T=m.useRef(!1),_=m.useRef(()=>{}),R=m.useCallback(()=>{var F;const N=(F=o.current.openEvent)==null?void 0:F.type;return(N==null?void 0:N.includes("mouse"))&&N!=="mousedown"},[o]);m.useEffect(()=>{if(!u)return;function F(N){let{open:A}=N;A||(clearTimeout(b.current),clearTimeout(P.current),E.current=!0)}return i.on("openchange",F),()=>{i.off("openchange",F)}},[u,i]),m.useEffect(()=>{if(!u||!y.current||!n)return;function F(A){R()&&r(!1,A,"hover")}const N=Qi(l).documentElement;return N.addEventListener("mouseleave",F),()=>{N.removeEventListener("mouseleave",F)}},[l,n,r,u,y,R]);const O=m.useCallback(function(F,N,A){N===void 0&&(N=!0),A===void 0&&(A="hover");const D=sd(x.current,"close",w.current);D&&!j.current?(clearTimeout(b.current),b.current=window.setTimeout(()=>r(!1,F,A),D)):N&&(clearTimeout(b.current),r(!1,F,A))},[x,r]),I=m.useCallback(()=>{_.current(),j.current=void 0},[]),M=m.useCallback(()=>{if(T.current){const F=Qi(c.floating.current).body;F.style.pointerEvents="",F.removeAttribute(D1),T.current=!1}},[c]);return m.useEffect(()=>{if(!u)return;function F(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function N(k){if(clearTimeout(b.current),E.current=!1,h&&!kp(w.current)||p>0&&!sd(x.current,"open"))return;const L=sd(x.current,"open",w.current);L?b.current=window.setTimeout(()=>{r(!0,k,"hover")},L):r(!0,k,"hover")}function A(k){if(F())return;_.current();const L=Qi(l);if(clearTimeout(P.current),y.current){n||clearTimeout(b.current),j.current=y.current({...e,tree:v,x:k.clientX,y:k.clientY,onClose(){M(),I(),O(k,!0,"safe-polygon")}});const H=j.current;L.addEventListener("mousemove",H),_.current=()=>{L.removeEventListener("mousemove",H)};return}(w.current==="touch"?!sc(l,k.relatedTarget):!0)&&O(k)}function D(k){F()||y.current==null||y.current({...e,tree:v,x:k.clientX,y:k.clientY,onClose(){M(),I(),O(k)}})(k)}if(Nt(s)){const k=s;return n&&k.addEventListener("mouseleave",D),l==null||l.addEventListener("mouseleave",D),g&&k.addEventListener("mousemove",N,{once:!0}),k.addEventListener("mouseenter",N),k.addEventListener("mouseleave",A),()=>{n&&k.removeEventListener("mouseleave",D),l==null||l.removeEventListener("mouseleave",D),g&&k.removeEventListener("mousemove",N),k.removeEventListener("mouseenter",N),k.removeEventListener("mouseleave",A)}}},[s,l,u,e,h,p,g,O,I,M,r,n,v,x,y,o]),so(()=>{var F;if(u&&n&&(F=y.current)!=null&&F.__options.blockPointerEvents&&R()){const A=Qi(l).body;if(A.setAttribute(D1,""),A.style.pointerEvents="none",T.current=!0,Nt(s)&&l){var N;const D=s,k=v==null||(N=v.nodesRef.current.find(L=>L.id===S))==null||(N=N.context)==null?void 0:N.elements.floating;return k&&(k.style.pointerEvents=""),D.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{D.style.pointerEvents="",l.style.pointerEvents=""}}}},[u,n,S,l,s,v,y,R]),so(()=>{n||(w.current=void 0,I(),M())},[n,I,M]),m.useEffect(()=>()=>{I(),clearTimeout(b.current),clearTimeout(P.current),M()},[u,s,I,M]),m.useMemo(()=>{if(!u)return{};function F(N){w.current=N.pointerType}return{reference:{onPointerDown:F,onPointerEnter:F,onMouseMove(N){function A(){E.current||r(!0,N.nativeEvent,"hover")}h&&!kp(w.current)||n||p===0||(clearTimeout(P.current),w.current==="touch"?A():P.current=window.setTimeout(A,p))}},floating:{onMouseEnter(){clearTimeout(b.current)},onMouseLeave(N){O(N.nativeEvent,!1)}}}},[u,h,n,p,r,O])}const Ap=()=>{},sj=m.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ap,setState:Ap,isInstantPhase:!1}),aj=()=>m.useContext(sj);function QN(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=m.useReducer((c,u)=>({...c,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),s=m.useRef(null),l=m.useCallback(c=>{i({currentId:c})},[]);return so(()=>{o.currentId?s.current===null?s.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),s.current=null)},[o.currentId]),m.createElement(sj.Provider,{value:m.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,l])},t)}function KN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:i}=t,s=i??o,l=aj(),{currentId:c,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:h}=l;return so(()=>{c&&(f({delay:{open:1,close:sd(d,"close")}}),c!==s&&r(!1))},[s,r,f,c,d]),so(()=>{function p(){r(!1),f({delay:d,currentId:null})}if(c&&!n&&c===s){if(h){const g=window.setTimeout(p,h);return()=>{clearTimeout(g)}}p()}},[n,f,c,s,r,d,h]),so(()=>{u===Ap||!n||u(s)},[n,u,s]),l}function um(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(s=>{var l;return o.parentId===s.id&&((l=o.context)==null?void 0:l.open)})}),n=n.concat(r);return n}const YN={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},XN={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},I1=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 JN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:o,elements:{reference:i,domReference:s,floating:l},dataRef:c}=e,{enabled:u=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:h="pointerdown",referencePress:p=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:S,capture:y}=t,x=_v(),w=Gs(typeof f=="function"?f:()=>!1),b=typeof f=="function"?w:f,j=m.useRef(!1),P=m.useRef(!1),{escapeKey:E,outsidePress:T}=I1(S),{escapeKey:_,outsidePress:R}=I1(y),O=Gs(N=>{if(!n||!u||!d||N.key!=="Escape")return;const A=x?um(x.nodesRef.current,o):[];if(!E&&(N.stopPropagation(),A.length>0)){let D=!0;if(A.forEach(k=>{var L;if((L=k.context)!=null&&L.open&&!k.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}r(!1,JA(N)?N.nativeEvent:N,"escape-key")}),I=Gs(N=>{var A;const D=()=>{var k;O(N),(k=qs(N))==null||k.removeEventListener("keydown",D)};(A=qs(N))==null||A.addEventListener("keydown",D)}),M=Gs(N=>{const A=j.current;j.current=!1;const D=P.current;if(P.current=!1,h==="click"&&D||A||typeof b=="function"&&!b(N))return;const k=qs(N),L="["+Dv("inert")+"]",B=Qi(l).querySelectorAll(L);let H=Nt(k)?k:null;for(;H&&!Ra(H);){const ie=ss(H);if(Ra(ie)||!Nt(ie))break;H=ie}if(B.length&&Nt(k)&&!ZA(k)&&!sc(k,l)&&Array.from(B).every(ie=>!sc(H,ie)))return;if(rr(k)&&l){const ie=k.clientWidth>0&&k.scrollWidth>k.clientWidth,Ce=k.clientHeight>0&&k.scrollHeight>k.clientHeight;let _e=Ce&&N.offsetX>k.clientWidth;if(Ce&&or(k).direction==="rtl"&&(_e=N.offsetX<=k.offsetWidth-k.clientWidth),_e||ie&&N.offsetY>k.clientHeight)return}const J=x&&um(x.nodesRef.current,o).some(ie=>{var Ce;return cm(N,(Ce=ie.context)==null?void 0:Ce.elements.floating)});if(cm(N,l)||cm(N,s)||J)return;const we=x?um(x.nodesRef.current,o):[];if(we.length>0){let ie=!0;if(we.forEach(Ce=>{var _e;if((_e=Ce.context)!=null&&_e.open&&!Ce.context.dataRef.current.__outsidePressBubbles){ie=!1;return}}),!ie)return}r(!1,N,"outside-press")}),F=Gs(N=>{var A;const D=()=>{var k;M(N),(k=qs(N))==null||k.removeEventListener(h,D)};(A=qs(N))==null||A.addEventListener(h,D)});return m.useEffect(()=>{if(!n||!u)return;c.current.__escapeKeyBubbles=E,c.current.__outsidePressBubbles=T;function N(k){r(!1,k,"ancestor-scroll")}const A=Qi(l);d&&A.addEventListener("keydown",_?I:O,_),b&&A.addEventListener(h,R?F:M,R);let D=[];return v&&(Nt(s)&&(D=Eo(s)),Nt(l)&&(D=D.concat(Eo(l))),!Nt(i)&&i&&i.contextElement&&(D=D.concat(Eo(i.contextElement)))),D=D.filter(k=>{var L;return k!==((L=A.defaultView)==null?void 0:L.visualViewport)}),D.forEach(k=>{k.addEventListener("scroll",N,{passive:!0})}),()=>{d&&A.removeEventListener("keydown",_?I:O,_),b&&A.removeEventListener(h,R?F:M,R),D.forEach(k=>{k.removeEventListener("scroll",N)})}},[c,l,s,i,d,b,h,n,r,v,u,E,T,O,_,I,M,R,F]),m.useEffect(()=>{j.current=!1},[b,h]),m.useMemo(()=>u?{reference:{onKeyDown:O,[YN[g]]:N=>{p&&r(!1,N.nativeEvent,"reference-press")}},floating:{onKeyDown:O,onMouseDown(){P.current=!0},onMouseUp(){P.current=!0},[XN[h]]:()=>{j.current=!0}}}:{},[u,p,h,g,r,O])}function Iv(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:o}=e,[i,s]=m.useState(null),[l,c]=m.useState(null),d=((t=e.elements)==null?void 0:t.reference)||i;so(()=>{d&&(v.current=d)},[d]);const f=LN({...e,elements:{...e.elements,...l&&{reference:l}}}),h=_v(),p=Rv()!=null,g=Gs((T,_,R)=>{S.current.openEvent=T?_:void 0,y.emit("openchange",{open:T,event:_,reason:R,nested:p}),r==null||r(T,_,R)}),v=m.useRef(null),S=m.useRef({}),y=m.useState(()=>HN())[0],x=ij(),w=m.useCallback(T=>{const _=Nt(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;c(_),f.refs.setReference(_)},[f.refs]),b=m.useCallback(T=>{(Nt(T)||T===null)&&(v.current=T,s(T)),(Nt(f.refs.reference.current)||f.refs.reference.current===null||T!==null&&!Nt(T))&&f.refs.setReference(T)},[f.refs]),j=m.useMemo(()=>({...f.refs,setReference:b,setPositionReference:w,domReference:v}),[f.refs,b,w]),P=m.useMemo(()=>({...f.elements,domReference:d}),[f.elements,d]),E=m.useMemo(()=>({...f,refs:j,elements:P,dataRef:S,nodeId:o,floatingId:x,events:y,open:n,onOpenChange:g}),[f,o,x,y,n,g,j,P]);return so(()=>{const T=h==null?void 0:h.nodesRef.current.find(_=>_.id===o);T&&(T.context=E)}),m.useMemo(()=>({...f,context:E,refs:j,elements:P}),[f,j,P,E])}function ZN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,refs:i,elements:{domReference:s}}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=m.useRef(!1),d=m.useRef(),f=m.useRef(!0);return m.useEffect(()=>{if(!l)return;const h=Wn(s);function p(){!n&&rr(s)&&s===x1(Qi(s))&&(u.current=!0)}function g(){f.current=!0}return h.addEventListener("blur",p),h.addEventListener("keydown",g,!0),()=>{h.removeEventListener("blur",p),h.removeEventListener("keydown",g,!0)}},[s,n,l]),m.useEffect(()=>{if(!l)return;function h(p){let{reason:g}=p;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,l]),m.useEffect(()=>()=>{clearTimeout(d.current)},[]),m.useMemo(()=>l?{reference:{onPointerDown(h){QA(h.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(h){if(u.current)return;const p=qs(h.nativeEvent);if(c&&Nt(p))try{if(KA()&&YA())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!f.current&&!tN(p))return}r(!0,h.nativeEvent,"focus")},onBlur(h){u.current=!1;const p=h.relatedTarget,g=Nt(p)&&p.hasAttribute(Dv("focus-guard"))&&p.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{const v=x1(s?s.ownerDocument:document);!p&&v===s||sc(i.floating.current,v)||sc(s,v)||g||r(!1,h.nativeEvent,"focus")})}}}:{},[l,c,s,i,r])}const A1="active",N1="selected";function dm(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[A1]:s,[N1]:l,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1},...i,...t.map(s=>{const l=s?s[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(c=>{let[u,d]=c;if(!(o&&[A1,N1].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),s[u]=function(){for(var h,p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];return(h=r.get(u))==null?void 0:h.map(S=>S(...g)).find(S=>S!==void 0)}}}else s[u]=d}),s),{})}}function e4(e){e===void 0&&(e=[]);const t=e,n=m.useCallback(i=>dm(i,e,"reference"),t),r=m.useCallback(i=>dm(i,e,"floating"),t),o=m.useCallback(i=>dm(i,e,"item"),e.map(i=>i==null?void 0:i.item));return m.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])}const t4=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function n4(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:s="dialog"}=t,l=(n=t4.get(s))!=null?n:s,c=ij(),d=Rv()!=null;return m.useMemo(()=>{if(!i)return{};const f={id:o,...l&&{role:l}};return l==="tooltip"||s==="label"?{reference:{["aria-"+(s==="label"?"labelledby":"describedby")]:r?o:void 0},floating:f}:{reference:{"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"},...s==="select"&&{"aria-autocomplete":"none"},...s==="combobox"&&{"aria-autocomplete":"list"}},floating:{...f,...l==="menu"&&{"aria-labelledby":c}},item(h){let{active:p,selected:g}=h;const v={role:"option",...p&&{id:o+"-option"}};switch(s){case"select":return{...v,"aria-selected":p&&g};case"combobox":return{...v,...p&&{"aria-selected":!0}}}return{}}}},[i,s,l,r,o,c,d])}function lj(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 M1(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function O1(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 r4={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function o4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:s,dir:l}){const[c,u="center"]=e.split("-"),d={width:V(t),height:V(t),transform:"rotate(45deg)",position:"absolute",[r4[c]]:V(r)},f=V(-t/2);return c==="left"?{...d,...M1(u,s,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:c==="right"?{...d,...M1(u,s,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:c==="top"?{...d,...O1(u,i,n,o,l),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:c==="bottom"?{...d,...O1(u,i,n,o,l),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const Av=m.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:s,arrowY:l,style:c,...u},d)=>{const{dir:f}=Ua();return i?C.createElement("div",{...u,ref:d,style:{...c,...o4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:s,arrowY:l})}}):null});Av.displayName="@mantine/core/FloatingArrow";const[i4,cj]=Nn("Popover component was not found in the tree");function Rf({children:e,active:t=!0,refProp:n="ref"}){const r=i_(t),o=Qt(r,e==null?void 0:e.ref);return Oo(e)?m.cloneElement(e,{[n]:o}):e}function uj(e){return C.createElement(xv,{tabIndex:-1,"data-autofocus":!0,...e})}Rf.displayName="@mantine/core/FocusTrap";uj.displayName="@mantine/core/FocusTrapInitialFocus";Rf.InitialFocus=uj;function s4(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 a4={},dj=m.forwardRef((e,t)=>{const{children:n,target:r,...o}=U("Portal",a4,e),[i,s]=m.useState(!1),l=m.useRef(null);return za(()=>(s(!0),l.current=r?typeof r=="string"?document.querySelector(r):r:s4(o),cf(t,l.current),!r&&l.current&&document.body.appendChild(l.current),()=>{!r&&l.current&&document.body.removeChild(l.current)}),[r]),!i||!l.current?null:Dc.createPortal(C.createElement(C.Fragment,null,n),l.current)});dj.displayName="@mantine/core/Portal";function Ss({withinPortal:e=!0,children:t,...n}){return e?C.createElement(dj,{...n},t):C.createElement(C.Fragment,null,t)}Ss.displayName="@mantine/core/OptionalPortal";const gl=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${V(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),Lu={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${V(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${V(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${V(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${V(-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(${V(-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(${V(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(${V(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${V(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:{...gl("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...gl("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...gl("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...gl("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...gl("top"),common:{transformOrigin:"top right"}}},$1={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function l4({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Lu?{transitionProperty:Lu[e].transitionProperty,...o,...Lu[e].common,...Lu[e][$1[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[$1[t]]}}function c4({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:s,onExited:l}){const c=$t(),u=Sg(),d=c.respectReducedMotion?u:!1,[f,h]=m.useState(d?0:e),[p,g]=m.useState(r?"entered":"exited"),v=m.useRef(-1),S=m.useRef(-1),y=x=>{const w=x?o:i,b=x?s:l;window.clearTimeout(v.current);const j=d?0:x?e:t;h(j),j===0?(typeof w=="function"&&w(),typeof b=="function"&&b(),g(x?"entered":"exited")):S.current=requestAnimationFrame(()=>{aa.flushSync(()=>{g(x?"pre-entering":"pre-exiting")}),S.current=requestAnimationFrame(()=>{typeof w=="function"&&w(),g(x?"entering":"exiting"),v.current=window.setTimeout(()=>{typeof b=="function"&&b(),g(x?"entered":"exited")},j)})})};return Po(()=>{y(r)},[r]),m.useEffect(()=>()=>{window.clearTimeout(v.current),cancelAnimationFrame(S.current)},[]),{transitionDuration:f,transitionStatus:p,transitionTimingFunction:n||"ease"}}function zo({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:s="ease",onExit:l,onEntered:c,onEnter:u,onExited:d}){const{transitionDuration:f,transitionStatus:h,transitionTimingFunction:p}=c4({mounted:o,exitDuration:r,duration:n,timingFunction:s,onExit:l,onEntered:c,onEnter:u,onExited:d});return f===0?o?C.createElement(C.Fragment,null,i({})):e?i({display:"none"}):null:h==="exited"?e?i({display:"none"}):null:C.createElement(C.Fragment,null,i(l4({transition:t,duration:f,state:h,timingFunction:p})))}zo.displayName="@mantine/core/Transition";var fj={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const u4={},Nv=X((e,t)=>{var S,y,x,w;const n=U("PopoverDropdown",u4,e),{className:r,style:o,vars:i,children:s,onKeyDownCapture:l,variant:c,classNames:u,styles:d,...f}=n,h=cj(),p=db({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},v=Qt(t,h.floating);return h.disabled?null:C.createElement(Ss,{...h.portalProps,withinPortal:h.withinPortal},C.createElement(zo,{mounted:h.opened,...h.transitionProps,transition:((S=h.transitionProps)==null?void 0:S.transition)||"fade",duration:((y=h.transitionProps)==null?void 0:y.duration)??150,keepMounted:h.keepMounted,exitDuration:typeof((x=h.transitionProps)==null?void 0:x.exitDuration)=="number"?h.transitionProps.exitDuration:(w=h.transitionProps)==null?void 0:w.duration},b=>C.createElement(Rf,{active:h.trapFocus},C.createElement(G,{...g,...f,variant:c,ref:v,onKeyDownCapture:q2(h.onClose,{active:h.closeOnEscape,onTrigger:p,onKeyDown:l}),"data-position":h.placement,...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:V(h.width)},o]})},s,C.createElement(Av,{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})})))))});Nv.classes=fj;Nv.displayName="@mantine/core/PopoverDropdown";const d4={refProp:"ref",popupType:"dialog"},hj=X((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=U("PopoverTarget",d4,e);if(!Oo(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 s=i,l=cj(),c=Qt(l.reference,n.ref,t),u=l.withRoles?{"aria-haspopup":o,"aria-expanded":l.opened,"aria-controls":l.getDropdownId(),id:l.getTargetId()}:{};return m.cloneElement(n,{...s,...u,...l.targetProps,className:rt(l.targetProps.className,s.className,n.props.className),[r]:c,...l.controlled?null:{onClick:l.onToggle}})});hj.displayName="@mantine/core/PopoverTarget";function mj({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=m.useState(0);m.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return MN(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Po(()=>{t.update()},r),Po(()=>{i(s=>s+1)},[e])}function f4(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 h4(e,t){const n=f4(e.middlewares),r=[tj(e.offset)];return n.shift&&r.push(kv(typeof n.shift=="boolean"?{limiter:j1(),padding:5}:{limiter:j1(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Dp():Dp(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Ip():Ip(n.inline)),r.push(nj({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(ON({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,availableWidth:i,availableHeight:s}){var u;const c=((u=t().refs.floating.current)==null?void 0:u.style)??{};n.size&&Object.assign(c,{maxWidth:`${i}px`,maxHeight:`${s}px`}),e.width==="target"&&Object.assign(c,{width:`${o.reference.width}px`})}})),r}function m4(e){const[t,n]=hn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var s;t&&((s=e.onClose)==null||s.call(e),n(!1))},o=()=>{var s,l;t?((s=e.onClose)==null||s.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},i=Iv({strategy:e.strategy,placement:e.position,middleware:h4(e,()=>i)});return mj({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:i}),Po(()=>{var s;(s=e.onPositionChange)==null||s.call(e,i.placement)},[i.placement]),Po(()=>{var s,l;e.opened?(l=e.onOpen)==null||l.call(e):(s=e.onClose)==null||s.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const p4={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:Hr("popover"),__staticSelector:"Popover",width:"max-content"},g4=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:St(t),"--popover-shadow":yg(n)}});function Wr(e){var je,Ye,Xe,ze,Y,Q;const t=U("Popover",p4,e),{children:n,position:r,offset:o,onPositionChange:i,positionDependencies:s,opened:l,transitionProps:c,width:u,middlewares:d,withArrow:f,arrowSize:h,arrowOffset:p,arrowRadius:g,arrowPosition:v,unstyled:S,classNames:y,styles:x,closeOnClickOutside:w,withinPortal:b,portalProps:j,closeOnEscape:P,clickOutsideEvents:E,trapFocus:T,onClose:_,onOpen:R,onChange:O,zIndex:I,radius:M,shadow:F,id:N,defaultOpened:A,__staticSelector:D,withRoles:k,disabled:L,returnFocus:B,variant:H,keepMounted:J,vars:we,floatingStrategy:ie,...Ce}=t,_e=me({name:D,props:t,classes:fj,classNames:y,styles:x,unstyled:S,rootSelector:"dropdown",vars:we,varsResolver:g4}),Pe=m.useRef(null),[ue,Ue]=m.useState(null),[bt,at]=m.useState(null),{dir:ve}=Ua(),Le=Mn(N),Ae=m4({middlewares:d,width:u,position:lj(ve,r),offset:typeof o=="number"?o+(f?h/2:0):o,arrowRef:Pe,arrowOffset:p,onPositionChange:i,positionDependencies:s,opened:l,defaultOpened:A,onChange:O,onOpen:R,onClose:_,strategy:ie});K2(()=>w&&Ae.onClose(),E,[ue,bt]);const te=m.useCallback(ye=>{Ue(ye),Ae.floating.refs.setReference(ye)},[Ae.floating.refs.setReference]),re=m.useCallback(ye=>{at(ye),Ae.floating.refs.setFloating(ye)},[Ae.floating.refs.setFloating]);return C.createElement(i4,{value:{returnFocus:B,disabled:L,controlled:Ae.controlled,reference:te,floating:re,x:Ae.floating.x,y:Ae.floating.y,arrowX:(Xe=(Ye=(je=Ae.floating)==null?void 0:je.middlewareData)==null?void 0:Ye.arrow)==null?void 0:Xe.x,arrowY:(Q=(Y=(ze=Ae.floating)==null?void 0:ze.middlewareData)==null?void 0:Y.arrow)==null?void 0:Q.y,opened:Ae.opened,arrowRef:Pe,transitionProps:c,width:u,withArrow:f,arrowSize:h,arrowOffset:p,arrowRadius:g,arrowPosition:v,placement:Ae.floating.placement,trapFocus:T,withinPortal:b,portalProps:j,zIndex:I,radius:M,shadow:F,closeOnEscape:P,onClose:Ae.onClose,onToggle:Ae.onToggle,getTargetId:()=>`${Le}-target`,getDropdownId:()=>`${Le}-dropdown`,withRoles:k,targetProps:Ce,__staticSelector:D,classNames:y,styles:x,unstyled:S,variant:H,keepMounted:J,getStyles:_e}},n)}Wr.Target=hj;Wr.Dropdown=Nv;Wr.displayName="@mantine/core/Popover";Wr.extend=e=>e;var Mr={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 v4=m.forwardRef(({className:e,...t},n)=>C.createElement(G,{component:"span",className:rt(Mr.barsLoader,e),...t,ref:n},C.createElement("span",{className:Mr.bar}),C.createElement("span",{className:Mr.bar}),C.createElement("span",{className:Mr.bar}))),y4=m.forwardRef(({className:e,...t},n)=>C.createElement(G,{component:"span",className:rt(Mr.dotsLoader,e),...t,ref:n},C.createElement("span",{className:Mr.dot}),C.createElement("span",{className:Mr.dot}),C.createElement("span",{className:Mr.dot}))),x4=m.forwardRef(({className:e,...t},n)=>C.createElement(G,{component:"span",className:rt(Mr.ovalLoader,e),...t,ref:n})),pj={bars:v4,oval:x4,dots:y4},w4={loaders:pj,type:"oval"},S4=(e,{size:t,color:n})=>({root:{"--loader-size":Oe(t,"loader-size"),"--loader-color":n?wt(n,e):void 0}}),Gn=X((e,t)=>{const n=U("Loader",w4,e),{size:r,color:o,type:i,vars:s,className:l,style:c,classNames:u,styles:d,unstyled:f,loaders:h,variant:p,children:g,...v}=n,S=me({name:"Loader",props:n,classes:Mr,className:l,style:c,classNames:u,styles:d,unstyled:f,vars:s,varsResolver:S4});return g?C.createElement(G,{...S("root"),ref:t,...v},g):C.createElement(G,{...S("root"),ref:t,component:h[i],variant:p,size:r,...v})});Gn.defaultLoaders=pj;Gn.classes=Mr;Gn.displayName="@mantine/core/Loader";var _f={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21"};const L1={orientation:"horizontal"},b4=(e,{borderWidth:t})=>({group:{"--ai-border-width":V(t)}}),Mv=X((e,t)=>{const n=U("ActionIconGroup",L1,e),{className:r,style:o,classNames:i,styles:s,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...p}=U("ActionIconGroup",L1,e),g=me({name:"ActionIconGroup",props:n,classes:_f,className:r,style:o,classNames:i,styles:s,unstyled:l,vars:u,varsResolver:b4,rootSelector:"group"});return C.createElement(G,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...p})});Mv.classes=_f;Mv.displayName="@mantine/core/ActionIconGroup";const C4={},E4=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:s});return{root:{"--ai-size":Oe(t,"ai-size"),"--ai-radius":n===void 0?void 0:St(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=bn((e,t)=>{const n=U("ActionIcon",C4,e),{className:r,unstyled:o,variant:i,classNames:s,styles:l,style:c,loading:u,loaderProps:d,size:f,color:h,radius:p,__staticSelector:g,gradient:v,vars:S,children:y,disabled:x,"data-disabled":w,autoContrast:b,mod:j,...P}=n,E=me({name:["ActionIcon",g],props:n,className:r,style:c,classes:_f,classNames:s,styles:l,unstyled:o,vars:S,varsResolver:E4});return C.createElement(Dn,{...E("root",{active:!x&&!u&&!w}),...P,unstyled:o,variant:i,size:f,disabled:x||u,ref:t,mod:[{loading:u,disabled:x||w},j]},C.createElement(zo,{mounted:!!u,transition:"slide-down",duration:150},T=>C.createElement(G,{component:"span",...E("loader",{style:T}),"aria-hidden":!0},C.createElement(Gn,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d}))),C.createElement(G,{component:"span",mod:{loading:u},...E("icon")},y))});Zt.classes=_f;Zt.displayName="@mantine/core/ActionIcon";Zt.Group=Mv;const gj=m.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>C.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n},C.createElement("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"})));gj.displayName="@mantine/core/CloseIcon";var vj={root:"m_86a44da5","root--subtle":"m_220c80f2"};const j4={variant:"subtle"},P4=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Oe(t,"cb-size"),"--cb-radius":n===void 0?void 0:St(n),"--cb-icon-size":V(r)}}),bs=bn((e,t)=>{const n=U("CloseButton",j4,e),{iconSize:r,children:o,vars:i,radius:s,className:l,classNames:c,style:u,styles:d,unstyled:f,"data-disabled":h,disabled:p,variant:g,icon:v,mod:S,...y}=n,x=me({name:"CloseButton",props:n,className:l,style:u,classes:vj,classNames:c,styles:d,unstyled:f,vars:i,varsResolver:P4});return C.createElement(Dn,{ref:t,...y,unstyled:f,variant:g,disabled:p,mod:[{disabled:p||h},S],...x("root",{variant:g,active:!p&&!h})},v||C.createElement(gj,null),o)});bs.classes=vj;bs.displayName="@mantine/core/CloseButton";function T4(e){return m.Children.toArray(e).filter(Boolean)}var yj={root:"m_4081bf90"};const k4={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},R4=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:i,wrap:s},{childWidth:l})=>({root:{"--group-child-width":t&&n?l:void 0,"--group-gap":cn(r),"--group-align":o,"--group-justify":i,"--group-wrap":s}}),ee=X((e,t)=>{const n=U("Group",k4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,children:c,gap:u,align:d,justify:f,wrap:h,grow:p,preventGrowOverflow:g,vars:v,variant:S,__size:y,mod:x,...w}=n,b=T4(c),j=b.length,P=cn(u??"md"),T={childWidth:`calc(${100/j}% - (${P} - ${P} / ${j}))`},_=me({name:"Group",props:n,stylesCtx:T,className:o,style:i,classes:yj,classNames:r,styles:s,unstyled:l,vars:v,varsResolver:R4});return C.createElement(G,{..._("root"),ref:t,variant:S,mod:[{grow:p},x],size:y,...w},b)});ee.classes=yj;ee.displayName="@mantine/core/Group";var xj={root:"m_9814e45f"};const _4={zIndex:Hr("modal")},D4=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:s})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&fr(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${V(o)})`:void 0,"--overlay-radius":i===void 0?void 0:St(i),"--overlay-z-index":s==null?void 0:s.toString()}}),ac=bn((e,t)=>{const n=U("Overlay",_4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,fixed:u,center:d,children:f,radius:h,zIndex:p,gradient:g,blur:v,color:S,backgroundOpacity:y,mod:x,...w}=n,b=me({name:"Overlay",props:n,classes:xj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:D4});return C.createElement(G,{ref:t,...b("root"),mod:[{center:d,fixed:u},x],...w},f)});ac.classes=xj;ac.displayName="@mantine/core/Overlay";const[I4,Vo]=Nn("ModalBase component was not found in tree");function A4({opened:e,transitionDuration:t}){const[n,r]=m.useState(e),o=m.useRef(),s=Sg()?0:t;return m.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):s===0?r(!1):o.current=window.setTimeout(()=>r(!1),s),()=>window.clearTimeout(o.current)),[e,s]),n}function N4({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:s}){const l=Mn(e),[c,u]=m.useState(!1),[d,f]=m.useState(!1),h=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,p=A4({opened:n,transitionDuration:h});return pb("keydown",g=>{var v;g.key==="Escape"&&o&&((v=g.target)==null?void 0:v.getAttribute("data-mantine-stop-propagation"))!=="true"&&i()},{capture:!0}),db({opened:n,shouldReturnFocus:r&&s}),{_id:l,titleMounted:c,bodyMounted:d,shouldLockScroll:p,setTitleMounted:u,setBodyMounted:f}}const M4=m.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,trapFocus:i,closeOnEscape:s,returnFocus:l,closeOnClickOutside:c,withinPortal:u,portalProps:d,lockScroll:f,children:h,zIndex:p,shadow:g,padding:v,__vars:S,unstyled:y,removeScrollProps:x,...w},b)=>{const{_id:j,titleMounted:P,bodyMounted:E,shouldLockScroll:T,setTitleMounted:_,setBodyMounted:R}=N4({id:r,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:s,onClose:n,returnFocus:l});return C.createElement(Ss,{...d,withinPortal:u},C.createElement(I4,{value:{opened:t,onClose:n,closeOnClickOutside:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${j}-title`,getBodyId:()=>`${j}-body`,titleMounted:P,bodyMounted:E,setTitleMounted:_,setBodyMounted:R,trapFocus:i,closeOnEscape:s,zIndex:p,unstyled:y}},C.createElement(af,{enabled:T&&f,...x},C.createElement(G,{ref:b,...w,__vars:{...S,"--mb-z-index":(p||Hr("modal")).toString(),"--mb-shadow":yg(g),"--mb-padding":cn(v)}},h))))});function O4(){const e=Vo();return m.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Da={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const wj=m.forwardRef(({className:e,...t},n)=>{const r=O4(),o=Vo();return C.createElement(G,{ref:n,...t,id:r,className:rt({[Da.body]:!o.unstyled},e)})});wj.displayName="@mantine/core/ModalBaseBody";const Sj=m.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Vo();return C.createElement(bs,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:rt({[Da.close]:!o.unstyled},e),unstyled:o.unstyled})});Sj.displayName="@mantine/core/ModalBaseCloseButton";const $4=m.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},s)=>{const l=Vo();return C.createElement(zo,{mounted:l.opened,transition:"pop",...l.transitionProps,...e},c=>C.createElement("div",{...n,className:rt({[Da.inner]:!l.unstyled},n.className)},C.createElement(Rf,{active:l.opened&&l.trapFocus},C.createElement(Hn,{...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,ref:s,style:[o,c],className:rt({[Da.content]:!l.unstyled},t),unstyled:l.unstyled},i.children))))}),bj=m.forwardRef(({className:e,...t},n)=>{const r=Vo();return C.createElement(G,{component:"header",ref:n,className:rt({[Da.header]:!r.unstyled},e),...t})});bj.displayName="@mantine/core/ModalBaseHeader";const L4={duration:200,timingFunction:"ease",transition:"fade"};function F4(e){const t=Vo();return{...L4,...t.transitionProps,...e}}const Cj=m.forwardRef(({onClick:e,transitionProps:t,style:n,...r},o)=>{const i=Vo(),s=F4(t);return C.createElement(zo,{mounted:i.opened,...s,transition:"fade"},l=>C.createElement(ac,{ref:o,fixed:!0,style:[n,l],zIndex:i.zIndex,unstyled:i.unstyled,onClick:c=>{e==null||e(c),i.closeOnClickOutside&&i.onClose()},...r}))});Cj.displayName="@mantine/core/ModalBaseOverlay";function z4(){const e=Vo();return m.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const Ej=m.forwardRef(({className:e,...t},n)=>{const r=z4(),o=Vo();return C.createElement(G,{component:"h2",ref:n,className:rt({[Da.title]:!o.unstyled},e),...t,id:r})});Ej.displayName="@mantine/core/ModalBaseTitle";function V4({children:e}){return C.createElement(C.Fragment,null,e)}const[B4,Ga]=Cc({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var jr={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 F1={},U4=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${nn(t)} - ${V(2)})`}}),Df=X((e,t)=>{const n=U("InputDescription",F1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...p}=U("InputDescription",F1,n),g=Ga(),v=me({name:["InputWrapper",d],props:n,classes:jr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"description",vars:c,varsResolver:U4}),S=f&&(g==null?void 0:g.getStyles)||v;return C.createElement(G,{component:"p",ref:t,variant:h,size:u,...S("description",g!=null&&g.getStyles?{className:o,style:i}:void 0),...p})});Df.classes=jr;Df.displayName="@mantine/core/InputDescription";const H4={},W4=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${nn(t)} - ${V(2)})`}}),If=X((e,t)=>{const n=U("InputError",H4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...p}=n,g=me({name:["InputWrapper",d],props:n,classes:jr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"error",vars:c,varsResolver:W4}),v=Ga(),S=f&&(v==null?void 0:v.getStyles)||g;return C.createElement(G,{component:"p",ref:t,variant:h,size:u,...S("error",v!=null&&v.getStyles?{className:o,style:i}:void 0),...p})});If.classes=jr;If.displayName="@mantine/core/InputError";const z1={labelElement:"label"},q4=(e,{size:t})=>({label:{"--input-label-size":nn(t),"--input-asterisk-color":void 0}}),Af=X((e,t)=>{const n=U("InputLabel",z1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,labelElement:u,size:d,required:f,htmlFor:h,onMouseDown:p,children:g,__staticSelector:v,variant:S,mod:y,...x}=U("InputLabel",z1,n),w=me({name:["InputWrapper",v],props:n,classes:jr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"label",vars:c,varsResolver:q4}),b=Ga(),j=(b==null?void 0:b.getStyles)||w;return C.createElement(G,{...j("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},y],onMouseDown:P=>{p==null||p(P),!P.defaultPrevented&&P.detail>1&&P.preventDefault()},...x},g,f&&C.createElement("span",{...j("required"),"aria-hidden":!0}," *"))});Af.classes=jr;Af.displayName="@mantine/core/InputLabel";const V1={},Ov=X((e,t)=>{const n=U("InputPlaceholder",V1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,__staticSelector:u,variant:d,error:f,mod:h,...p}=U("InputPlaceholder",V1,n),g=me({name:["InputPlaceholder",u],props:n,classes:jr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"placeholder"});return C.createElement(G,{...g("placeholder"),mod:[{error:!!f},h],component:"span",variant:d,ref:t,...p})});Ov.classes=jr;Ov.displayName="@mantine/core/InputPlaceholder";function G4(e,{hasDescription:t,hasError:n}){const r=e.findIndex(c=>c==="input"),o=e[r-1],i=e[r+1];return{offsetBottom:t&&i==="description"||n&&i==="error",offsetTop:t&&o==="description"||n&&o==="error"}}const Q4={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},K4=(e,{size:t})=>({label:{"--input-label-size":nn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${nn(t)} - ${V(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${nn(t)} - ${V(2)})`}}),$v=X((e,t)=>{const n=U("InputWrapper",Q4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,variant:d,__staticSelector:f,inputContainer:h,inputWrapperOrder:p,label:g,error:v,description:S,labelProps:y,descriptionProps:x,errorProps:w,labelElement:b,children:j,withAsterisk:P,id:E,required:T,__stylesApiProps:_,mod:R,...O}=n,I=me({name:["InputWrapper",f],props:_||n,classes:jr,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:K4}),M={size:u,variant:d,__staticSelector:f},F=Mn(E),N=typeof P=="boolean"?P:T,A=(w==null?void 0:w.id)||`${F}-error`,D=(x==null?void 0:x.id)||`${F}-description`,k=F,L=!!v&&typeof v!="boolean",B=!!S,H=`${L?A:""} ${B?D:""}`,J=H.trim().length>0?H.trim():void 0,we=(y==null?void 0:y.id)||`${F}-label`,ie=g&&C.createElement(Af,{key:"label",labelElement:b,id:we,htmlFor:k,required:N,...M,...y},g),Ce=B&&C.createElement(Df,{key:"description",...x,...M,size:(x==null?void 0:x.size)||M.size,id:(x==null?void 0:x.id)||D},S),_e=C.createElement(C.Fragment,{key:"input"},h(j)),Pe=L&&C.createElement(If,{...w,...M,size:(w==null?void 0:w.size)||M.size,key:"error",id:(w==null?void 0:w.id)||A},v),ue=p.map(Ue=>{switch(Ue){case"label":return ie;case"input":return _e;case"description":return Ce;case"error":return Pe;default:return null}});return C.createElement(B4,{value:{getStyles:I,describedBy:J,inputId:k,labelId:we,...G4(p,{hasDescription:B,hasError:L})}},C.createElement(G,{ref:t,variant:d,size:u,mod:[{error:!!v},R],...I("root"),...O},ue))});$v.classes=jr;$v.displayName="@mantine/core/InputWrapper";const Y4={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},X4=(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":Oe(t.size,"input-height"),"--input-fz":nn(t.size),"--input-radius":t.radius===void 0?void 0:St(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?V(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?V(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?Oe(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),_t=bn((e,t)=>{const n=U("Input",Y4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,required:c,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:h,error:p,disabled:g,leftSection:v,leftSectionProps:S,leftSectionWidth:y,rightSection:x,rightSectionProps:w,rightSectionWidth:b,rightSectionPointerEvents:j,leftSectionPointerEvents:P,variant:E,vars:T,pointer:_,multiline:R,radius:O,id:I,withAria:M,withErrorStyles:F,mod:N,...A}=n,{styleProps:D,rest:k}=$o(A),L=Ga(),B={offsetBottom:L==null?void 0:L.offsetBottom,offsetTop:L==null?void 0:L.offsetTop},H=me({name:["Input",u],props:d||n,classes:jr,className:o,style:i,classNames:r,styles:s,unstyled:l,stylesCtx:B,rootSelector:"wrapper",vars:T,varsResolver:X4}),J=M?{required:c,disabled:g,"aria-invalid":!!p,"aria-describedby":L==null?void 0:L.describedBy,id:(L==null?void 0:L.inputId)||I}:{};return C.createElement(G,{...H("wrapper"),...D,...h,mod:[{error:!!p&&F,pointer:_,disabled:g,multiline:R,"data-with-right-section":!!x,"data-with-left-section":!!v},N],variant:E,size:f},v&&C.createElement("div",{...S,"data-position":"left",...H("section",{className:S==null?void 0:S.className,style:S==null?void 0:S.style})},v),C.createElement(G,{component:"input",...k,...J,ref:t,required:c,mod:{disabled:g,error:!!p&&F},variant:E,...H("input")}),x&&C.createElement("div",{...w,"data-position":"right",...H("section",{className:w==null?void 0:w.className,style:w==null?void 0:w.style})},x))});_t.classes=jr;_t.Wrapper=$v;_t.Label=Af;_t.Error=If;_t.Description=Df;_t.Placeholder=Ov;_t.displayName="@mantine/core/Input";function J4(e,t,n){const r=U(e,t,n),{label:o,description:i,error:s,required:l,classNames:c,styles:u,className:d,unstyled:f,__staticSelector:h,__stylesApiProps:p,errorProps:g,labelProps:v,descriptionProps:S,wrapperProps:y,id:x,size:w,style:b,inputContainer:j,inputWrapperOrder:P,withAsterisk:E,variant:T,vars:_,mod:R,...O}=r,{styleProps:I,rest:M}=$o(O),F={label:o,description:i,error:s,required:l,classNames:c,className:d,__staticSelector:h,__stylesApiProps:p||r,errorProps:g,labelProps:v,descriptionProps:S,unstyled:f,styles:u,size:w,style:b,inputContainer:j,inputWrapperOrder:P,withAsterisk:E,variant:T,id:x,mod:R,...y};return{...M,classNames:c,styles:u,unstyled:f,wrapperProps:{...F,...I},inputProps:{required:l,classNames:c,styles:u,unstyled:f,size:w,__staticSelector:h,__stylesApiProps:p||r,error:s,variant:T,id:x}}}const Z4={__staticSelector:"InputBase",withAria:!0},Kn=bn((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=J4("InputBase",Z4,e);return C.createElement(_t.Wrapper,{...r},C.createElement(_t,{...n,...o,ref:t}))});Kn.classes={..._t.classes,..._t.Wrapper.classes};Kn.displayName="@mantine/core/InputBase";const e3={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 jj={root:"m_8bffd616"};const t3={},ls=bn((e,t)=>{const n=U("Flex",t3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,gap:u,rowGap:d,columnGap:f,align:h,justify:p,wrap:g,direction:v,...S}=n,y=me({name:"Flex",classes:jj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c}),x=$t(),w=Pc(),b=Cb({styleProps:{gap:u,rowGap:d,columnGap:f,align:h,justify:p,wrap:g,direction:v},theme:x,data:e3});return C.createElement(C.Fragment,null,b.hasResponsiveStyles&&C.createElement(Ba,{selector:`.${w}`,styles:b.styles,media:b.media}),C.createElement(G,{ref:t,...y("root",{className:w,style:gs(b.inlineStyles)}),...S}))});ls.classes=jj;ls.displayName="@mantine/core/Flex";function n3(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 r3({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=m.useRef(),[i,s]=m.useState(!1),[l,c]=m.useState(typeof r=="boolean"?r:!1),u=()=>{if(!e||!t)return;const p=e.getBoundingClientRect(),g=t.getBoundingClientRect(),v={top:p.top-g.top,left:p.left-g.left,width:p.width,height:p.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=m.useRef(),h=m.useRef();return m.useEffect(()=>{if(u(),e)return f.current=new ResizeObserver(d),f.current.observe(e),h.current=new ResizeObserver(d),h.current.observe(t),()=>{var p,g;(p=f.current)==null||p.disconnect(),(g=h.current)==null||g.disconnect()}},[t,e]),m.useEffect(()=>{if(t){const p=g=>{n3(g.target,t)&&(d(),c(!1))};return document.addEventListener("transitionend",p),()=>{document.removeEventListener("transitionend",p)}}},[t]),h_(()=>{gb()!=="test"&&s(!0)},20,{autoInvoke:!0}),m_(p=>{p.forEach(g=>{g.type==="attributes"&&g.attributeName==="dir"&&d()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:i,hidden:l}}var Pj={root:"m_96b553a6"};const o3={},i3=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Lv=X((e,t)=>{const n=U("FloatingIndicator",o3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,target:u,parent:d,transitionDuration:f,mod:h,displayAfterTransitionEnd:p,...g}=n,v=me({name:"FloatingIndicator",classes:Pj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:i3}),S=m.useRef(null),{initialized:y,hidden:x}=r3({target:u,parent:d,ref:S,displayAfterTransitionEnd:p}),w=Qt(t,S);return!u||!d?null:C.createElement(G,{ref:w,mod:[{initialized:y,hidden:x},h],...v("root"),...g})});Lv.displayName="@mantine/core/FloatingIndicator";Lv.classes=Pj;var Tj={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 s3={},a3=(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:St(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},Cs=X((e,t)=>{const n=U("Alert",s3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,color:d,title:f,children:h,id:p,icon:g,withCloseButton:v,onClose:S,closeButtonLabel:y,variant:x,autoContrast:w,...b}=n,j=me({name:"Alert",classes:Tj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:a3}),P=Mn(p),E=f&&`${P}-title`||void 0,T=`${P}-body`;return C.createElement(G,{id:P,...j("root",{variant:x}),variant:x,ref:t,...b,role:"alert","aria-describedby":T,"aria-labelledby":E},C.createElement("div",{...j("wrapper")},g&&C.createElement("div",{...j("icon")},g),C.createElement("div",{...j("body")},f&&C.createElement("div",{...j("title"),"data-with-close-button":v||void 0},C.createElement("span",{id:E,...j("label")},f)),h&&C.createElement("div",{id:T,...j("message"),"data-variant":x},h)),v&&C.createElement(bs,{...j("closeButton"),onClick:S,variant:"transparent",size:16,iconSize:16,"aria-label":y,unstyled:l})))});Cs.classes=Tj;Cs.displayName="@mantine/core/Alert";var kj={root:"m_b6d8b162"};function l3(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const c3={inherit:!1},u3=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":nn(o),"--text-lh":lb(o),"--text-gradient":t==="gradient"?Im(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?wt(i,e):void 0}}),de=bn((e,t)=>{const n=U("Text",c3,e),{lineClamp:r,truncate:o,inline:i,inherit:s,gradient:l,span:c,__staticSelector:u,vars:d,className:f,style:h,classNames:p,styles:g,unstyled:v,variant:S,mod:y,size:x,...w}=n,b=me({name:["Text",u],props:n,classes:kj,className:f,style:h,classNames:p,styles:g,unstyled:v,vars:d,varsResolver:u3});return C.createElement(G,{...b("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:S,mod:[{"data-truncate":l3(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":s},y],size:x,...w})});de.classes=kj;de.displayName="@mantine/core/Text";var Rj={root:"m_849cf0da"};const d3={underline:"hover"},Ze=bn((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...s}=U("Anchor",d3,e);return C.createElement(de,{component:"a",ref:t,className:rt({[Rj.root]:!o},r),...s,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});Ze.classes=Rj;Ze.displayName="@mantine/core/Anchor";const[f3,Qa]=Nn("AppShell was not found in tree");var Ii={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const h3={},Fv=X((e,t)=>{const n=U("AppShellAside",h3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,p=Qa();return p.disabled?null:C.createElement(G,{component:"aside",ref:t,mod:[{"with-border":u??p.withBorder},f],...p.getStyles("aside",{className:o,classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-aside-z-index":`calc(${d??p.zIndex} + 1)`}})});Fv.classes=Ii;Fv.displayName="@mantine/core/AppShellAside";const m3={},zv=X((e,t)=>{var g;const n=U("AppShellFooter",m3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,p=Qa();return p.disabled?null:C.createElement(G,{component:"footer",ref:t,mod:[{"with-border":u??p.withBorder},f],...p.getStyles("footer",{className:rt({[af.classNames.zeroRight]:p.offsetScrollbars},o),classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-footer-z-index":(g=d??p.zIndex)==null?void 0:g.toString()}})});zv.classes=Ii;zv.displayName="@mantine/core/AppShellFooter";const p3={},Vv=X((e,t)=>{var g;const n=U("AppShellHeader",p3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,p=Qa();return p.disabled?null:C.createElement(G,{component:"header",ref:t,mod:[{"with-border":u??p.withBorder},f],...p.getStyles("header",{className:rt({[af.classNames.zeroRight]:p.offsetScrollbars},o),classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-header-z-index":(g=d??p.zIndex)==null?void 0:g.toString()}})});Vv.classes=Ii;Vv.displayName="@mantine/core/AppShellHeader";const g3={},Bv=X((e,t)=>{const n=U("AppShellMain",g3,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Qa();return C.createElement(G,{component:"main",ref:t,...u.getStyles("main",{className:o,style:i,classNames:r,styles:s}),...c})});Bv.classes=Ii;Bv.displayName="@mantine/core/AppShellMain";function Ac(e){return typeof e=="object"?e.base:e}function Nc(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 Mc(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function v3({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,s="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"),Nc(i)){const f=V(Ac(i));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Mc(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=V(i.base),e["--app-shell-aside-offset"]=V(i.base)),xt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=V(i[f]),t[f]["--app-shell-aside-offset"]=V(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"]=s,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=xg(r.breakpoint,o)-.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"]=s,n[f]["--app-shell-aside-transform-rtl"]=l}}function y3({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(Nc(r)){const s=V(Ac(r));e["--app-shell-footer-height"]=s,i&&(e["--app-shell-footer-offset"]=s)}Mc(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=V(r.base),i&&(e["--app-shell-footer-offset"]=V(r.base))),xt(r).forEach(s=>{s!=="base"&&(t[s]=t[s]||{},t[s]["--app-shell-footer-height"]=V(r[s]),i&&(t[s]["--app-shell-footer-offset"]=V(r[s])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function x3({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(Nc(r)){const s=V(Ac(r));e["--app-shell-header-height"]=s,i&&(e["--app-shell-header-offset"]=s)}Mc(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=V(r.base),i&&(e["--app-shell-header-offset"]=V(r.base))),xt(r).forEach(s=>{s!=="base"&&(t[s]=t[s]||{},t[s]["--app-shell-header-height"]=V(r[s]),i&&(t[s]["--app-shell-header-offset"]=V(r[s])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function w3({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,s="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"),Nc(i)){const f=V(Ac(i));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Mc(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=V(i.base),e["--app-shell-navbar-offset"]=V(i.base)),xt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=V(i[f]),t[f]["--app-shell-navbar-offset"]=V(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"]=s,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=xg(r.breakpoint,o)-.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"]=s,n[f]["--app-shell-navbar-transform-rtl"]=l}}function fm(e){return Number(e)===0?"0px":cn(e)}function S3({padding:e,baseStyles:t,minMediaStyles:n}){Nc(e)&&(t["--app-shell-padding"]=fm(Ac(e))),Mc(e)&&(e.base&&(t["--app-shell-padding"]=fm(e.base)),xt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=fm(e[r]))}))}function b3({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const s={},l={},c={};w3({baseStyles:c,minMediaStyles:s,maxMediaStyles:l,navbar:e,theme:i}),v3({baseStyles:c,minMediaStyles:s,maxMediaStyles:l,aside:r,theme:i}),x3({baseStyles:c,minMediaStyles:s,header:t}),y3({baseStyles:c,minMediaStyles:s,footer:n}),S3({baseStyles:c,minMediaStyles:s,padding:o});const u=Vl(xt(s),i).map(h=>({query:`(min-width: ${ud(h.px)})`,styles:s[h.value]})),d=Vl(xt(l),i).map(h=>({query:`(max-width: ${ud(h.px)})`,styles:l[h.value]})),f=[...u,...d];return{baseStyles:c,media:f}}function C3({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=$t(),s=Va(),{media:l,baseStyles:c}=b3({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return C.createElement(Ba,{media:l,styles:c,selector:s.cssVariablesSelector})}const E3={},Uv=X((e,t)=>{const n=U("AppShellNavbar",E3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,p=Qa();return p.disabled?null:C.createElement(G,{component:"nav",ref:t,mod:[{"with-border":u??p.withBorder},f],...p.getStyles("navbar",{className:o,classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-navbar-z-index":`calc(${d??p.zIndex} + 1)`}})});Uv.classes=Ii;Uv.displayName="@mantine/core/AppShellNavbar";const j3={},Hv=bn((e,t)=>{const n=U("AppShellSection",j3,e),{classNames:r,className:o,style:i,styles:s,vars:l,grow:c,mod:u,...d}=n,f=Qa();return C.createElement(G,{ref:t,mod:[{grow:c},u],...f.getStyles("section",{className:o,style:i,classNames:r,styles:s}),...d})});Hv.classes=Ii;Hv.displayName="@mantine/core/AppShellSection";function P3({transitionDuration:e,disabled:t}){const[n,r]=m.useState(!0),o=m.useRef(),i=m.useRef();return pb("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),200)}),za(()=>{m.startTransition(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>r(!1),e||0)})},[t,e]),n}const T3={withBorder:!0,offsetScrollbars:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Hr("app")},k3=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),qn=X((e,t)=>{const n=U("AppShell",T3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,navbar:u,withBorder:d,padding:f,transitionDuration:h,transitionTimingFunction:p,header:g,zIndex:v,layout:S,disabled:y,aside:x,footer:w,offsetScrollbars:b,mod:j,...P}=n,E=me({name:"AppShell",classes:Ii,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:k3}),T=P3({disabled:y,transitionDuration:h});return C.createElement(f3,{value:{getStyles:E,withBorder:d,zIndex:v,disabled:y,offsetScrollbars:b}},C.createElement(C3,{navbar:u,header:g,aside:x,footer:w,padding:f}),C.createElement(G,{ref:t,...E("root"),mod:[{resizing:T,layout:S,disabled:y},j],...P}))});qn.classes=Ii;qn.displayName="@mantine/core/AppShell";qn.Navbar=Uv;qn.Header=Vv;qn.Main=Bv;qn.Aside=Fv;qn.Footer=zv;qn.Section=Hv;function _j(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=>_j(t))}:e}function Dj(e){return e?e.map(t=>_j(t)):[]}function Ij(e){return e.reduce((t,n)=>"group"in n?{...t,...Ij(n.items)}:(t[n.value]=n,t),{})}var Qn={dropdown:"m_88b62a41",options:"m_b2821a6e",option:"m_92253aa5",search:"m_985517d8",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 R3={error:null},_3=(e,{size:t})=>({chevron:{"--combobox-chevron-size":Oe(t,"combobox-chevron-size")}}),Nf=X((e,t)=>{const n=U("ComboboxChevron",R3,e),{size:r,error:o,style:i,className:s,classNames:l,styles:c,unstyled:u,vars:d,mod:f,...h}=n,p=me({name:"ComboboxChevron",classes:Qn,props:n,style:i,className:s,classNames:l,styles:c,unstyled:u,vars:d,varsResolver:_3,rootSelector:"chevron"});return C.createElement(G,{component:"svg",...h,...p("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},C.createElement("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"}))});Nf.classes=Qn;Nf.displayName="@mantine/core/ComboboxChevron";const[D3,Pr]=Nn("Combobox component was not found in tree"),Aj=m.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>C.createElement(bs,{ref:i,size:e||"sm",variant:"transparent",tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:s=>{s.preventDefault(),t==null||t(s)},onClick:s=>{r(),n==null||n(s)}}));Aj.displayName="@mantine/core/ComboboxClearButton";const I3={},Wv=X((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:s,...l}=U("ComboboxDropdown",I3,e),c=Pr();return C.createElement(Wr.Dropdown,{...l,ref:t,role:"presentation","data-hidden":s||void 0,...c.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});Wv.classes=Qn;Wv.displayName="@mantine/core/ComboboxDropdown";const A3={refProp:"ref"},Nj=X((e,t)=>{const{children:n,refProp:r}=U("ComboboxDropdownTarget",A3,e);if(Pr(),!Oo(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 C.createElement(Wr.Target,{ref:t,refProp:r},n)});Nj.displayName="@mantine/core/ComboboxDropdownTarget";const N3={},qv=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("ComboboxEmpty",N3,e),c=Pr();return C.createElement(G,{ref:t,...c.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...l})});qv.classes=Qn;qv.displayName="@mantine/core/ComboboxEmpty";function Gv({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const s=Pr(),[l,c]=m.useState(null),u=f=>{if(e==null||e(f),!s.readOnly&&t){if(f.nativeEvent.isComposing)return;if(f.nativeEvent.code==="ArrowDown"&&(f.preventDefault(),s.store.dropdownOpened?c(s.store.selectNextOption()):(s.store.openDropdown("keyboard"),c(s.store.selectActiveOption()))),f.nativeEvent.code==="ArrowUp"&&(f.preventDefault(),s.store.dropdownOpened?c(s.store.selectPreviousOption()):(s.store.openDropdown("keyboard"),c(s.store.selectActiveOption()))),f.nativeEvent.code==="Enter"||f.nativeEvent.code==="NumpadEnter"){if(f.nativeEvent.keyCode===229)return;const h=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&h!==-1?(f.preventDefault(),s.store.clickSelectedOption()):o==="button"&&(f.preventDefault(),s.store.openDropdown("keyboard"))}f.nativeEvent.code==="Escape"&&s.store.closeDropdown("keyboard"),f.nativeEvent.code==="Space"&&o==="button"&&(f.preventDefault(),s.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(s.store.listId&&s.store.dropdownOpened)||void 0,"aria-controls":s.store.listId,"aria-activedescendant":s.store.dropdownOpened&&l||void 0,autoComplete:i,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},onKeyDown:u}}const M3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Mj=X((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:s,targetType:l,autoComplete:c,...u}=U("ComboboxEventsTarget",M3,e);if(!Oo(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=Pr(),f=Gv({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:c});return m.cloneElement(n,{...f,...u,[r]:Qt(t,d.store.targetRef,n==null?void 0:n.ref)})});Mj.displayName="@mantine/core/ComboboxEventsTarget";const O3={},Qv=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("ComboboxFooter",O3,e),c=Pr();return C.createElement(G,{ref:t,...c.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...l})});Qv.classes=Qn;Qv.displayName="@mantine/core/ComboboxFooter";const $3={},Kv=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,children:l,label:c,...u}=U("ComboboxGroup",$3,e),d=Pr();return C.createElement(G,{ref:t,...d.getStyles("group",{className:r,classNames:n,style:o,styles:i}),...u},c&&C.createElement("div",{...d.getStyles("groupLabel",{classNames:n,styles:i})},c),l)});Kv.classes=Qn;Kv.displayName="@mantine/core/ComboboxGroup";const L3={},Yv=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("ComboboxHeader",L3,e),c=Pr();return C.createElement(G,{ref:t,...c.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...l})});Yv.classes=Qn;Yv.displayName="@mantine/core/ComboboxHeader";function Oj({value:e,valuesDivider:t=",",...n}){return C.createElement("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}Oj.displayName="@mantine/core/ComboboxHiddenInput";const F3={},Xv=X((e,t)=>{const n=U("ComboboxOption",F3,e),{classNames:r,className:o,style:i,styles:s,vars:l,onClick:c,id:u,active:d,onMouseDown:f,onMouseOver:h,disabled:p,selected:g,mod:v,...S}=n,y=Pr(),x=m.useId(),w=u||x;return C.createElement(G,{...y.getStyles("option",{className:o,classNames:r,styles:s,style:i}),...S,ref:t,id:w,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":p,"combobox-selected":g},v],role:"option",onClick:b=>{var j;p?b.preventDefault():((j=y.onOptionSubmit)==null||j.call(y,n.value,n),c==null||c(b))},onMouseDown:b=>{b.preventDefault(),f==null||f(b)},onMouseOver:b=>{y.resetSelectionOnOptionHover&&y.store.resetSelectedOption(),h==null||h(b)}})});Xv.classes=Qn;Xv.displayName="@mantine/core/ComboboxOption";const z3={},Jv=X((e,t)=>{const n=U("ComboboxOptions",z3,e),{classNames:r,className:o,style:i,styles:s,id:l,onMouseDown:c,labelledBy:u,...d}=n,f=Pr(),h=Mn(l);return m.useEffect(()=>{f.store.setListId(h)},[h]),C.createElement(G,{ref:t,...f.getStyles("options",{className:o,style:i,classNames:r,styles:s}),...d,id:h,role:"listbox","aria-labelledby":u,onMouseDown:p=>{p.preventDefault(),c==null||c(p)}})});Jv.classes=Qn;Jv.displayName="@mantine/core/ComboboxOptions";const V3={withAriaAttributes:!0,withKeyboardNavigation:!0},Zv=X((e,t)=>{const n=U("ComboboxSearch",V3,e),{classNames:r,styles:o,unstyled:i,vars:s,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:u,size:d,...f}=n,h=Pr(),p=h.getStyles("search"),g=Gv({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return C.createElement(_t,{ref:Qt(t,h.store.searchRef),classNames:[{input:p.className},r],styles:[{input:p.style},o],size:d||h.size,...g,...f,__staticSelector:"Combobox"})});Zv.classes=Qn;Zv.displayName="@mantine/core/ComboboxSearch";const B3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},$j=X((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:s,targetType:l,autoComplete:c,...u}=U("ComboboxTarget",B3,e);if(!Oo(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=Pr(),f=Gv({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:c}),h=m.cloneElement(n,{...f,...u});return C.createElement(Wr.Target,{ref:Qt(t,d.store.targetRef)},h)});$j.displayName="@mantine/core/ComboboxTarget";function U3(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 H3(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 W3(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Oc({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:s="instant"}={}){const[l,c]=hn({value:t,defaultValue:e,finalValue:!1,onChange:n}),u=m.useRef(null),d=m.useRef(-1),f=m.useRef(null),h=m.useRef(null),p=m.useRef(-1),g=m.useRef(-1),v=m.useRef(-1),S=m.useCallback((A="unknown")=>{l||(c(!0),o==null||o(A))},[c,o,l]),y=m.useCallback((A="unknown")=>{l&&(c(!1),r==null||r(A))},[c,r,l]),x=m.useCallback((A="unknown")=>{l?y(A):S(A)},[y,S,l]),w=m.useCallback(()=>{const A=document.querySelector(`#${u.current} [data-combobox-selected]`);A==null||A.removeAttribute("data-combobox-selected"),A==null||A.removeAttribute("aria-selected")},[]),b=m.useCallback(A=>{const D=document.getElementById(u.current),k=D==null?void 0:D.querySelectorAll("[data-combobox-option]");if(!k)return null;const L=A>=k.length?0:A<0?k.length-1:A;return d.current=L,k!=null&&k[L]&&!k[L].hasAttribute("data-combobox-disabled")?(w(),k[L].setAttribute("data-combobox-selected","true"),k[L].setAttribute("aria-selected","true"),k[L].scrollIntoView({block:"nearest",behavior:s}),k[L].id):null},[s,w]),j=m.useCallback(()=>{const A=document.querySelector(`#${u.current} [data-combobox-active]`);if(A){const D=document.querySelectorAll(`#${u.current} [data-combobox-option]`),k=Array.from(D).findIndex(L=>L===A);return b(k)}return b(0)},[b]),P=m.useCallback(()=>b(H3(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),E=m.useCallback(()=>b(U3(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),T=m.useCallback(()=>b(W3(document.querySelectorAll(`#${u.current} [data-combobox-option]`))),[b]),_=m.useCallback((A="selected",D)=>{v.current=window.setTimeout(()=>{var B;const k=document.querySelectorAll(`#${u.current} [data-combobox-option]`),L=Array.from(k).findIndex(H=>H.hasAttribute(`data-combobox-${A}`));d.current=L,D!=null&&D.scrollIntoView&&((B=k[L])==null||B.scrollIntoView({block:"nearest",behavior:s}))},0)},[]),R=m.useCallback(()=>{d.current=-1,w()},[w]),O=m.useCallback(()=>{const A=document.querySelectorAll(`#${u.current} [data-combobox-option]`),D=A==null?void 0:A[d.current];D==null||D.click()},[]),I=m.useCallback(A=>{u.current=A},[]),M=m.useCallback(()=>{p.current=window.setTimeout(()=>f.current.focus(),0)},[]),F=m.useCallback(()=>{g.current=window.setTimeout(()=>h.current.focus(),0)},[]),N=m.useCallback(()=>d.current,[]);return m.useEffect(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),{dropdownOpened:l,openDropdown:S,closeDropdown:y,toggleDropdown:x,selectedOptionIndex:d.current,getSelectedOptionIndex:N,selectOption:b,selectFirstOption:T,selectActiveOption:j,selectNextOption:P,selectPreviousOption:E,resetSelectedOption:R,updateSelectedOptionIndex:_,listId:u.current,setListId:I,clickSelectedOption:O,searchRef:f,focusSearchInput:M,targetRef:h,focusTarget:F}}const q3={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},G3=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":nn(t),"--combobox-option-padding":Oe(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:V(n),"--combobox-option-fz":nn(t),"--combobox-option-padding":Oe(t,"combobox-option-padding")}});function De(e){const t=U("Combobox",q3,e),{classNames:n,styles:r,unstyled:o,children:i,store:s,vars:l,onOptionSubmit:c,onClose:u,size:d,dropdownPadding:f,resetSelectionOnOptionHover:h,__staticSelector:p,readOnly:g,...v}=t,S=Oc(),y=s||S,x=me({name:p||"Combobox",classes:Qn,props:t,classNames:n,styles:r,unstyled:o,vars:l,varsResolver:G3}),w=()=>{u==null||u(),y.closeDropdown()};return C.createElement(D3,{value:{getStyles:x,store:y,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:h,readOnly:g}},C.createElement(Wr,{opened:y.dropdownOpened,...v,onClose:w,withRoles:!1,unstyled:o},i))}const Q3=e=>e;De.extend=Q3;De.classes=Qn;De.displayName="@mantine/core/Combobox";De.Target=$j;De.Dropdown=Wv;De.Options=Jv;De.Option=Xv;De.Search=Zv;De.Empty=qv;De.Chevron=Nf;De.Footer=Qv;De.Header=Yv;De.EventsTarget=Mj;De.DropdownTarget=Nj;De.Group=Kv;De.ClearButton=Aj;De.HiddenInput=Oj;var Lj={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const Fj=Lj,Mf=m.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:i,children:s,label:l,description:c,id:u,disabled:d,error:f,size:h,labelPosition:p="left",bodyElement:g="div",labelElement:v="label",variant:S,style:y,vars:x,mod:w,...b},j)=>{const P=me({name:e,props:t,className:n,style:y,classes:Lj,classNames:r,styles:o,unstyled:i});return C.createElement(G,{...P("root"),ref:j,__vars:{"--label-fz":nn(h),"--label-lh":Oe(h,"label-lh")},mod:[{"label-position":p},w],variant:S,size:h,...b},C.createElement(G,{component:g,htmlFor:g==="label"?u:void 0,...P("body")},s,C.createElement("div",{...P("labelWrapper"),"data-disabled":d||void 0},l&&C.createElement(G,{component:v,htmlFor:v==="label"?u:void 0,...P("label"),"data-disabled":d||void 0},l),c&&C.createElement(_t.Description,{size:h,__inheritStyles:!1,...P("description")},c),f&&f!=="boolean"&&C.createElement(_t.Error,{size:h,__inheritStyles:!1,...P("error")},f))))});Mf.displayName="@mantine/core/InlineInput";const zj=m.createContext(null),K3=zj.Provider,Y3=()=>m.useContext(zj);function ey({children:e,role:t}){const n=Ga();return n?C.createElement("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy},e):C.createElement(C.Fragment,null,e)}const X3={},ty=X((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,readOnly:c,...u}=U("CheckboxGroup",X3,e),[d,f]=hn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=p=>{const g=p.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return C.createElement(K3,{value:{value:d,onChange:h,size:i}},C.createElement(_t.Wrapper,{size:i,ref:t,...s,...u,labelElement:"div",__staticSelector:"CheckboxGroup"},C.createElement(ey,{role:"group"},l)))});ty.classes=_t.Wrapper.classes;ty.displayName="@mantine/core/CheckboxGroup";function Of({size:e,style:t,...n}){const r=e!==void 0?{width:V(e),height:V(e),...t}:t;return C.createElement("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n},C.createElement("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 J3({indeterminate:e,...t}){return e?C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t},C.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):C.createElement(Of,{...t})}var Vj={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const Z3={labelPosition:"right",icon:J3},e5=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:s})=>{const l=uo({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":Oe(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:St(t),"--checkbox-color":i==="outline"?c:wt(n,e),"--checkbox-icon-color":o?wt(o,e):jc(s,e)?vs({color:n,theme:e}):void 0}}},br=X((e,t)=>{const n=U("Checkbox",Z3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,label:d,id:f,size:h,radius:p,wrapperProps:g,children:v,checked:S,labelPosition:y,description:x,error:w,disabled:b,variant:j,indeterminate:P,icon:E,rootRef:T,iconColor:_,onChange:R,autoContrast:O,mod:I,...M}=n,F=Y3(),N=h||(F==null?void 0:F.size),A=E,D=me({name:"Checkbox",props:n,classes:Vj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:e5}),{styleProps:k,rest:L}=$o(M),B=Mn(f),H=F?{checked:F.value.includes(L.value),onChange:J=>{F.onChange(J),R==null||R(J)}}:{};return C.createElement(Mf,{...D("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:B,size:N,labelPosition:y,label:d,description:x,error:w,disabled:b,classNames:r,styles:s,unstyled:l,"data-checked":H.checked||S||void 0,variant:j,ref:T,mod:I,...k,...g},C.createElement(G,{...D("inner"),mod:{"data-label-position":y}},C.createElement(G,{component:"input",id:B,ref:t,checked:S,disabled:b,mod:{error:!!w,indeterminate:P},...D("input",{focusable:!0,variant:j}),onChange:R,...L,...H,type:"checkbox"}),C.createElement(A,{indeterminate:P,...D("icon")})))});br.classes={...Vj,...Fj};br.displayName="@mantine/core/Checkbox";br.Group=ty;function Ia(e){return"group"in e}function Bj({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let i=0;i<e.length;i+=1){const s=e[i];if(o.length===n)return o;Ia(s)&&o.push({group:s.group,items:Bj({options:s.items,search:t,limit:n-o.length})}),Ia(s)||s.label.toLowerCase().includes(r)&&o.push(s)}return o}function t5(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 Uj(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Ia(n))Uj(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 n5(e,t){return Array.isArray(e)?e.includes(t):e===t}function Hj({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!Ia(e)){const l=n5(n,e.value),c=t&&l&&C.createElement(Of,{className:Qn.optionsDropdownCheckIcon}),u=C.createElement(C.Fragment,null,r==="left"&&c,C.createElement("span",null,e.label),r==="right"&&c);return C.createElement(De.Option,{value:e.value,disabled:e.disabled,className:rt({[Qn.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":l||void 0,"aria-selected":l,active:l},typeof i=="function"?i({option:e,checked:l}):u)}const s=e.items.map(l=>C.createElement(Hj,{data:l,value:n,key:l.value,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i}));return C.createElement(De.Group,{label:e.group},s)}function r5({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:i,maxDropdownHeight:s,withScrollArea:l=!0,filterOptions:c=!0,withCheckIcon:u=!1,value:d,checkIconPosition:f,nothingFoundMessage:h,unstyled:p,labelId:g,renderOption:v,scrollAreaProps:S}){Uj(e);const x=typeof o=="string"?(r||Bj)({options:e,search:c?o:"",limit:i??1/0}):e,w=t5(x),b=x.map(j=>C.createElement(Hj,{data:j,key:Ia(j)?j.group:j.value,withCheckIcon:u,value:d,checkIconPosition:f,unstyled:p,renderOption:v}));return C.createElement(De.Dropdown,{hidden:t||n&&w},C.createElement(De.Options,{labelledBy:g},l?C.createElement(Er.Autosize,{mah:s??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S},b):b,w&&h&&C.createElement(De.Empty,null,h)))}const Wj=m.createContext(null),o5=Wj.Provider;function i5(){return{withinGroup:!!m.useContext(Wj)}}var $f={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const s5={},a5=(e,{spacing:t})=>({group:{"--ag-spacing":cn(t)}}),ny=X((e,t)=>{const n=U("AvatarGroup",s5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,spacing:u,...d}=n,f=me({name:"AvatarGroup",classes:$f,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:a5,rootSelector:"group"});return C.createElement(o5,{value:!0},C.createElement(G,{ref:t,...f("group"),...d}))});ny.classes=$f;ny.displayName="@mantine/core/AvatarGroup";function l5(e){return C.createElement("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("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"}))}const c5={},u5=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:s});return{root:{"--avatar-size":Oe(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:St(n),"--avatar-bg":i||r?l.background:void 0,"--avatar-color":i||r?l.color:void 0,"--avatar-bd":i||r?l.border:void 0}}},cs=bn((e,t)=>{const n=U("Avatar",c5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,src:u,alt:d,radius:f,color:h,gradient:p,imageProps:g,children:v,autoContrast:S,mod:y,...x}=n,w=i5(),[b,j]=m.useState(!u),P=me({name:"Avatar",props:n,classes:$f,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:u5});return m.useEffect(()=>j(!u),[u]),C.createElement(G,{...P("root"),mod:[{"within-group":w.withinGroup},y],ref:t,...x},b?C.createElement("span",{...P("placeholder"),title:d},v||C.createElement(l5,null)):C.createElement("img",{...g,...P("image"),src:u,alt:d,onError:E=>{var T;j(!0),(T=g==null?void 0:g.onError)==null||T.call(g,E)}}))});cs.classes=$f;cs.displayName="@mantine/core/Avatar";cs.Group=ny;var qj={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const d5={},f5=(e,{radius:t,color:n,gradient:r,variant:o,size:i,autoContrast:s})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{root:{"--badge-height":Oe(i,"badge-height"),"--badge-padding-x":Oe(i,"badge-padding-x"),"--badge-fz":Oe(i,"badge-fz"),"--badge-radius":t===void 0?void 0:St(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"?wt(n,e):void 0}}},$c=bn((e,t)=>{const n=U("Badge",d5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,color:d,gradient:f,leftSection:h,rightSection:p,children:g,variant:v,fullWidth:S,autoContrast:y,circle:x,mod:w,...b}=n,j=me({name:"Badge",props:n,classes:qj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:f5});return C.createElement(G,{variant:v,mod:[{block:S,circle:x},w],...j("root",{variant:v}),ref:t,...b},h&&C.createElement("span",{...j("section"),"data-position":"left"},h),C.createElement("span",{...j("label")},g),p&&C.createElement("span",{...j("section"),"data-position":"right"},p))});$c.classes=qj;$c.displayName="@mantine/core/Badge";var Gj={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const h5={iconSize:48},m5=(e,{color:t,iconSize:n,radius:r})=>{const o=uo({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=uo({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":fr(i.value,.07),"--bq-bg-dark":fr(o.value,.06),"--bq-bd":wt(t,e),"--bq-icon-size":V(n),"--bq-radius":St(r)}}},ry=X((e,t)=>{const n=U("Blockquote",h5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,icon:d,iconSize:f,cite:h,...p}=n,g=me({name:"Blockquote",classes:Gj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:m5});return C.createElement(G,{component:"blockquote",ref:t,...g("root"),...p},d&&C.createElement("span",{...g("icon")},d),u,h&&C.createElement("cite",{...g("cite")},h))});ry.classes=Gj;ry.displayName="@mantine/core/Blockquote";var Lf={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844"};const B1={orientation:"horizontal"},p5=(e,{borderWidth:t})=>({group:{"--button-border-width":V(t)}}),oy=X((e,t)=>{const n=U("ButtonGroup",B1,e),{className:r,style:o,classNames:i,styles:s,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...p}=U("ButtonGroup",B1,e),g=me({name:"ButtonGroup",props:n,classes:Lf,className:r,style:o,classNames:i,styles:s,unstyled:l,vars:u,varsResolver:p5,rootSelector:"group"});return C.createElement(G,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...p})});oy.classes=Lf;oy.displayName="@mantine/core/ButtonGroup";const g5={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${V(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},v5={},y5=(e,{radius:t,color:n,gradient:r,variant:o,size:i,justify:s,autoContrast:l})=>{const c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{root:{"--button-justify":s,"--button-height":Oe(i,"button-height"),"--button-padding-x":Oe(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?nn(i.replace("compact-","")):nn(i),"--button-radius":t===void 0?void 0:St(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}}},oe=bn((e,t)=>{const n=U("Button",v5,e),{style:r,vars:o,className:i,color:s,disabled:l,children:c,leftSection:u,rightSection:d,fullWidth:f,variant:h,radius:p,loading:g,loaderProps:v,gradient:S,classNames:y,styles:x,unstyled:w,"data-disabled":b,autoContrast:j,mod:P,...E}=n,T=me({name:"Button",props:n,classes:Lf,className:i,style:r,classNames:y,styles:x,unstyled:w,vars:o,varsResolver:y5}),_=!!u,R=!!d;return C.createElement(Dn,{ref:t,...T("root",{active:!l&&!g&&!b}),unstyled:w,variant:h,disabled:l||g,mod:[{disabled:l||b,loading:g,block:f,"with-left-section":_,"with-right-section":R},P],...E},C.createElement(zo,{mounted:!!g,transition:g5,duration:150},O=>C.createElement(G,{component:"span",...T("loader",{style:O}),"aria-hidden":!0},C.createElement(Gn,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...v}))),C.createElement("span",{...T("inner")},u&&C.createElement(G,{component:"span",...T("section"),mod:{position:"left"}},u),C.createElement(G,{component:"span",mod:{loading:g},...T("label")},c),d&&C.createElement(G,{component:"span",...T("section"),mod:{position:"right"}},d)))});oe.classes=Lf;oe.displayName="@mantine/core/Button";oe.Group=oy;var Qj={root:"m_4451eb3a"};const x5={},un=bn((e,t)=>{const n=U("Center",x5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,inline:u,mod:d,...f}=n,h=me({name:"Center",props:n,classes:Qj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c});return C.createElement(G,{ref:t,mod:[{inline:u},d],...h("root"),...f})});un.classes=Qj;un.displayName="@mantine/core/Center";const[w5,S5]=Cc(),b5={};function Kj(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=U("ChipGroup",b5,e),[s,l]=hn({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),c=d=>Array.isArray(s)?s.includes(d):d===s,u=d=>{const f=d.currentTarget.value;Array.isArray(s)?l(s.includes(f)?s.filter(h=>h!==f):[...s,f]):l(f)};return C.createElement(w5,{value:{isChipSelected:c,onChange:u,multiple:o}},i)}Kj.displayName="@mantine/core/ChipGroup";var Yj={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 C5={type:"checkbox"},E5=(e,{size:t,radius:n,variant:r,color:o,autoContrast:i})=>{const s=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:i});return{root:{"--chip-fz":nn(t),"--chip-size":Oe(t,"chip-size"),"--chip-radius":n===void 0?void 0:St(n),"--chip-checked-padding":Oe(t,"chip-checked-padding"),"--chip-padding":Oe(t,"chip-padding"),"--chip-icon-size":Oe(t,"chip-icon-size"),"--chip-bg":o||r?s.background:void 0,"--chip-hover":o||r?s.hover:void 0,"--chip-color":o||r?s.color:void 0,"--chip-bd":o||r?s.border:void 0,"--chip-spacing":Oe(t,"chip-spacing")}}},lc=X((e,t)=>{const n=U("Chip",C5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,id:u,checked:d,defaultChecked:f,onChange:h,value:p,wrapperProps:g,type:v,disabled:S,children:y,size:x,variant:w,icon:b,rootRef:j,autoContrast:P,mod:E,...T}=n,_=me({name:"Chip",classes:Yj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:E5}),R=S5(),O=Mn(u),{styleProps:I,rest:M}=$o(T),[F,N]=hn({value:d,defaultValue:f,finalValue:!1,onChange:h}),A=R?{checked:R.isChipSelected(p),onChange:k=>{R.onChange(k),h==null||h(k.currentTarget.checked)},type:R.multiple?"checkbox":"radio"}:{},D=A.checked||F;return C.createElement(G,{size:x,variant:w,ref:j,mod:E,..._("root"),...I,...g},C.createElement("input",{type:v,..._("input"),checked:D,onChange:k=>N(k.currentTarget.checked),id:O,disabled:S,ref:t,value:p,...A,...M}),C.createElement("label",{htmlFor:O,"data-checked":D||void 0,"data-disabled":S||void 0,..._("label",{variant:w||"filled"})},D&&C.createElement("span",{..._("iconWrapper")},b||C.createElement(Of,{..._("checkIcon")})),C.createElement("span",null,y)))});lc.classes=Yj;lc.displayName="@mantine/core/Chip";lc.Group=Kj;var Xj={root:"m_b183c0a2"};const j5={},P5=(e,{color:t})=>({root:{"--code-bg":t?wt(t,e):void 0}}),iy=X((e,t)=>{const n=U("Code",j5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,block:d,variant:f,mod:h,...p}=n,g=me({name:"Code",props:n,classes:Xj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:P5});return C.createElement(G,{component:d?"pre":"code",variant:f,ref:t,mod:[{block:d},h],...g("root"),...p,dir:"ltr"})});iy.classes=Xj;iy.displayName="@mantine/core/Code";var Jj={root:"m_7485cace"};const T5={},k5=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:Oe(t,"container-size")}}),sy=X((e,t)=>{const n=U("Container",T5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,fluid:u,mod:d,...f}=n,h=me({name:"Container",classes:Jj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:k5});return C.createElement(G,{ref:t,mod:[{fluid:u},d],...h("root"),...f})});sy.classes=Jj;sy.displayName="@mantine/core/Container";const R5={timeout:1e3};function Zj(e){const{children:t,timeout:n,value:r,...o}=U("CopyButton",R5,e),i=cb({timeout:n}),s=()=>i.copy(r);return C.createElement(C.Fragment,null,t({copy:s,copied:i.copied,...o}))}Zj.displayName="@mantine/core/CopyButton";var eP={root:"m_3eebeb36",label:"m_9e365f20"};const _5={orientation:"horizontal"},D5=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?wt(t,e):void 0,"--divider-border-style":n,"--divider-size":Oe(r,"divider-size")}}),vn=X((e,t)=>{const n=U("Divider",_5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,orientation:d,label:f,labelPosition:h,mod:p,...g}=n,v=me({name:"Divider",classes:eP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:D5});return C.createElement(G,{ref:t,mod:[{orientation:d,"with-label":!!f},p],...v("root"),...g,role:"separator"},f&&C.createElement(G,{component:"span",mod:{position:h},...v("label")},f))});vn.classes=eP;vn.displayName="@mantine/core/Divider";function I5({open:e,close:t,openDelay:n,closeDelay:r}){const o=m.useRef(-1),i=m.useRef(-1),s=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{s(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},c=()=>{s(),r===0||r===void 0?t():i.current=window.setTimeout(t,r)};return m.useEffect(()=>s,[]),{openDropdown:l,closeDropdown:c}}const[A5,tP]=Nn("Grid component was not found in tree"),Np=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,U1=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Np(e,t),H1=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},W1=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function N5({span:e,order:t,offset:n,selector:r}){var h;const o=$t(),i=tP(),l=ci(e)===void 0?12:ci(e),c=gs({"--col-order":(h=ci(t))==null?void 0:h.toString(),"--col-flex-grow":H1(l,i.grow),"--col-flex-basis":Np(l,i.columns),"--col-width":l==="content"?"auto":void 0,"--col-max-width":U1(l,i.columns,i.grow),"--col-offset":W1(ci(n),i.columns)}),u=xt(o.breakpoints).reduce((p,g)=>{var v;return p[g]||(p[g]={}),typeof t=="object"&&t[g]!==void 0&&(p[g]["--col-order"]=(v=t[g])==null?void 0:v.toString()),typeof e=="object"&&e[g]!==void 0&&(p[g]["--col-flex-grow"]=H1(e[g],i.grow),p[g]["--col-flex-basis"]=Np(e[g],i.columns),p[g]["--col-width"]=e[g]==="content"?"auto":void 0,p[g]["--col-max-width"]=U1(e[g],i.columns,i.grow)),typeof n=="object"&&n[g]!==void 0&&(p[g]["--col-offset"]=W1(n[g],i.columns)),p},{}),f=Vl(xt(u),o).filter(p=>xt(u[p.value]).length>0).map(p=>({query:`(min-width: ${o.breakpoints[p.value]})`,styles:u[p.value]}));return C.createElement(Ba,{styles:c,media:f,selector:r})}var ay={root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const M5={span:12},ly=X((e,t)=>{const n=U("GridCol",M5,e),{classNames:r,className:o,style:i,styles:s,vars:l,span:c,order:u,offset:d,...f}=n,h=tP(),p=Pc();return C.createElement(C.Fragment,null,C.createElement(N5,{selector:`.${p}`,span:c,order:u,offset:d}),C.createElement(G,{ref:t,...h.getStyles("col",{className:rt(o,p),style:i,classNames:r,styles:s}),...f}))});ly.classes=ay;ly.displayName="@mantine/core/GridCol";function O5({gutter:e,selector:t}){const n=$t(),r=gs({"--grid-gutter":cn(ci(e))}),o=xt(n.breakpoints).reduce((l,c)=>(l[c]||(l[c]={}),typeof e=="object"&&e[c]!==void 0&&(l[c]["--grid-gutter"]=cn(e[c])),l),{}),s=Vl(xt(o),n).filter(l=>xt(o[l.value]).length>0).map(l=>({query:`(min-width: ${n.breakpoints[l.value]})`,styles:o[l.value]}));return C.createElement(Ba,{styles:r,media:s,selector:t})}const $5={gutter:"md",grow:!1,columns:12},L5=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),er=X((e,t)=>{const n=U("Grid",$5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,grow:u,gutter:d,columns:f,align:h,justify:p,children:g,...v}=n,S=me({name:"Grid",classes:ay,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:L5}),y=Pc();return C.createElement(A5,{value:{getStyles:S,grow:u,columns:f}},C.createElement(O5,{selector:`.${y}`,...n}),C.createElement(G,{ref:t,...S("root",{className:y}),...v},C.createElement("div",{...S("inner")},g)))});er.classes=ay;er.displayName="@mantine/core/Grid";er.Col=ly;function Vd(){return Vd=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},Vd.apply(this,arguments)}function cy(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var F5=m.useLayoutEffect,z5=function(t){var n=m.useRef(t);return F5(function(){n.current=t}),n},q1=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},V5=function(t,n){var r=m.useRef();return m.useCallback(function(o){t.current=o,r.current&&q1(r.current,null),r.current=n,n&&q1(n,o)},[n])},G1={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},B5=function(t){Object.keys(G1).forEach(function(n){t.style.setProperty(n,G1[n],"important")})},Q1=B5,jn=null,K1=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function U5(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),jn||(jn=document.createElement("textarea"),jn.setAttribute("tabindex","-1"),jn.setAttribute("aria-hidden","true"),Q1(jn)),jn.parentNode===null&&document.body.appendChild(jn);var o=e.paddingSize,i=e.borderSize,s=e.sizingStyle,l=s.boxSizing;Object.keys(s).forEach(function(h){var p=h;jn.style[p]=s[p]}),Q1(jn),jn.value=t;var c=K1(jn,e);jn.value=t,c=K1(jn,e),jn.value="x";var u=jn.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 Y1=function(){},H5=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},W5=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],q5=!!document.documentElement.currentStyle,G5=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=H5(W5,n),o=r.boxSizing;if(o==="")return null;q5&&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),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:s}},Q5=G5;function nP(e,t,n){var r=z5(n);m.useLayoutEffect(function(){var o=function(s){return r.current(s)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var K5=function(t){nP(window,"resize",t)},Y5=function(t){nP(document.fonts,"loadingdone",t)},X5=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],J5=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,s=t.onChange,l=s===void 0?Y1:s,c=t.onHeightChange,u=c===void 0?Y1:c,d=cy(t,X5),f=d.value!==void 0,h=m.useRef(null),p=V5(h,n),g=m.useRef(0),v=m.useRef(),S=function(){var w=h.current,b=r&&v.current?v.current:Q5(w);if(b){v.current=b;var j=U5(b,w.value||w.placeholder||"x",i,o),P=j[0],E=j[1];g.current!==P&&(g.current=P,w.style.setProperty("height",P+"px","important"),u(P,{rowHeight:E}))}},y=function(w){f||S(),l(w)};return m.useLayoutEffect(S),K5(S),Y5(S),m.createElement("textarea",Vd({},d,{onChange:y,ref:p}))},Z5=m.forwardRef(J5);const e9={},Es=X((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:s,...l}=U("Textarea",e9,e),c=n&&gb()!=="test",u=c?{maxRows:r,minRows:o}:{};return C.createElement(Kn,{component:c?Z5:"textarea",ref:t,...l,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":s},...u})});Es.classes=Kn.classes;Es.displayName="@mantine/core/Textarea";function X1(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const t9={serialize:JSON.stringify,deserialize:JSON.parse},Ka=X((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:i,validationError:s,serialize:l,deserialize:c,onFocus:u,onBlur:d,readOnly:f,error:h,...p}=U("JsonInput",t9,e),[g,v]=hn({value:n,defaultValue:r,finalValue:"",onChange:o}),[S,y]=m.useState(X1(g,c)),x=b=>{u==null||u(b),y(!0)},w=b=>{typeof d=="function"&&d(b);const j=X1(b.currentTarget.value,c);i&&!f&&j&&b.currentTarget.value.trim()!==""&&v(l(c(b.currentTarget.value),null,2)),y(j)};return C.createElement(Es,{value:g,onChange:b=>v(b.currentTarget.value),onFocus:x,onBlur:w,ref:t,readOnly:f,...p,autoComplete:"off",__staticSelector:"JsonInput",error:S?h:s||!0,"data-monospace":!0})});Ka.classes=Kn.classes;Ka.displayName="@mantine/core/JsonInput";const[n9,r9]=Nn("List component was not found in tree");var uy={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const o9={},dy=X((e,t)=>{const n=U("ListItem",o9,e),{classNames:r,className:o,style:i,styles:s,vars:l,icon:c,children:u,mod:d,...f}=n,h=r9(),p=c||h.icon,g={classNames:r,styles:s};return C.createElement(G,{...h.getStyles("item",{...g,className:o,style:i}),component:"li",mod:[{"with-icon":!!p,centered:h.center},d],ref:t,...f},C.createElement("div",{...h.getStyles("itemWrapper",g)},p&&C.createElement("span",{...h.getStyles("itemIcon",g)},p),C.createElement("span",{...h.getStyles("itemLabel",g)},u)))});dy.classes=uy;dy.displayName="@mantine/core/ListItem";const i9={type:"unordered"},s9=(e,{size:t,spacing:n})=>({root:{"--list-fz":nn(t),"--list-lh":lb(t),"--list-spacing":cn(n)}}),Rn=X((e,t)=>{const n=U("List",i9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,type:d,withPadding:f,icon:h,spacing:p,center:g,listStyleType:v,mod:S,...y}=n,x=me({name:"List",classes:uy,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:s9});return C.createElement(n9,{value:{center:g,icon:h,getStyles:x}},C.createElement(G,{...x("root",{style:{listStyleType:v}}),component:d==="unordered"?"ul":"ol",mod:[{"with-padding":f},S],ref:t,...y},u))});Rn.classes=uy;Rn.displayName="@mantine/core/List";Rn.Item=dy;var rP={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const J1={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Hr("overlay")},a9=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),fy=X((e,t)=>{const n=U("LoadingOverlay",J1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,transitionProps:u,loaderProps:d,overlayProps:f,visible:h,zIndex:p,...g}=n,v=$t(),S=me({name:"LoadingOverlay",classes:rP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:a9}),y={...J1.overlayProps,...f};return C.createElement(zo,{transition:"fade",...u,mounted:!!h},x=>C.createElement(G,{...S("root",{style:x}),ref:t,...g},C.createElement(Gn,{...S("loader"),unstyled:l,...d}),C.createElement(ac,{...y,...S("overlay"),darkHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.white}),C.createElement(ac,{...y,...S("overlay"),lightHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.colors.dark[5]})))});fy.classes=rP;fy.displayName="@mantine/core/LoadingOverlay";const[l9,Lc]=Nn("Menu component was not found in the tree");var Ya={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const c9={},hy=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("MenuDivider",c9,e),c=Lc();return C.createElement(G,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...l})});hy.classes=Ya;hy.displayName="@mantine/core/MenuDivider";const u9={},my=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,onMouseEnter:l,onMouseLeave:c,children:u,...d}=U("MenuDropdown",u9,e),f=m.useRef(null),h=Lc(),p=S=>{var y,x;(S.key==="ArrowUp"||S.key==="ArrowDown")&&(S.preventDefault(),(x=(y=f.current)==null?void 0:y.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||x.focus())},g=Jn(l,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.openDropdown()),v=Jn(c,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.closeDropdown());return C.createElement(Wr.Dropdown,{...d,onMouseEnter:g,onMouseLeave:v,role:"menu","aria-orientation":"vertical",ref:Qt(t,f),...h.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:p},C.createElement("div",{tabIndex:-1,"data-autofocus":!0,"aria-hidden":!0,style:{outline:0}}),u)});my.classes=Ya;my.displayName="@mantine/core/MenuDropdown";const d9={},py=bn((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,color:l,closeMenuOnClick:c,leftSection:u,rightSection:d,children:f,disabled:h,...p}=U("MenuItem",d9,e),g=Lc(),v=$t(),{dir:S}=Ua(),y=m.useRef(),x=g.getItemIndex(y.current),w=p,b=Jn(w.onMouseLeave,()=>g.setHovered(-1)),j=Jn(w.onMouseEnter,()=>g.setHovered(g.getItemIndex(y.current))),P=Jn(w.onClick,()=>{typeof c=="boolean"?c&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately()}),E=Jn(w.onFocus,()=>g.setHovered(g.getItemIndex(y.current))),T=l?v.variantColorResolver({color:l,theme:v,variant:"light"}):void 0,_=l?uo({color:l,theme:v}):null;return C.createElement(Dn,{...p,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,onFocus:E,...g.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:Qt(y,t),role:"menuitem",disabled:h,"data-menu-item":!0,"data-disabled":h||void 0,"data-hovered":g.hovered===x?!0:void 0,onMouseEnter:j,onMouseLeave:b,onClick:P,onKeyDown:ab({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:S,orientation:"vertical",onKeyDown:w.onKeydown}),__vars:{"--menu-item-color":_!=null&&_.isThemeColor&&(_==null?void 0:_.shade)===void 0?`var(--mantine-color-${_.color}-6)`:T==null?void 0:T.color,"--menu-item-hover":T==null?void 0:T.hover}},u&&C.createElement("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left"},u),f&&C.createElement("div",{...g.getStyles("itemLabel",{styles:i,classNames:n})},f),d&&C.createElement("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right"},d))});py.classes=Ya;py.displayName="@mantine/core/MenuItem";const f9={},gy=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("MenuLabel",f9,e),c=Lc();return C.createElement(G,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...l})});gy.classes=Ya;gy.displayName="@mantine/core/MenuLabel";const h9={refProp:"ref"},oP=m.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=U("MenuTarget",h9,e);if(!Oo(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=Lc(),s=Jn(n.props.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),l=Jn(n.props.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),c=Jn(n.props.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return C.createElement(Wr.Target,{refProp:r,popupType:"menu",ref:t,...o},m.cloneElement(n,{onClick:s,onMouseEnter:l,onMouseLeave:c,"data-expanded":i.opened?!0:void 0}))});oP.displayName="@mantine/core/MenuTarget";const m9={trapFocus:!0,closeOnItemClick:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function ne(e){const t=U("Menu",m9,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:s,trapFocus:l,onChange:c,closeOnItemClick:u,loop:d,closeOnEscape:f,trigger:h,openDelay:p,closeDelay:g,classNames:v,styles:S,unstyled:y,variant:x,vars:w,menuItemTabIndex:b,keepMounted:j,...P}=t,E=me({name:"Menu",classes:Ya,props:t,classNames:v,styles:S,unstyled:y}),[T,{setHovered:_,resetHovered:R}]=Q2(),[O,I]=hn({value:i,defaultValue:s,finalValue:!1,onChange:c}),[M,F]=m.useState(!1),N=()=>{I(!1),F(!1),O&&(o==null||o())},A=()=>{I(!0),!O&&(r==null||r())},D=()=>{O?N():A()},{openDropdown:k,closeDropdown:L}=I5({open:A,close:N,closeDelay:g,openDelay:p}),B=we=>G2("[data-menu-item]","[data-menu-dropdown]",we),{resolvedClassNames:H,resolvedStyles:J}=Ec({classNames:v,styles:S,props:t});return Po(()=>{R()},[O]),C.createElement(l9,{value:{getStyles:E,opened:O,toggleDropdown:D,getItemIndex:B,hovered:T,setHovered:_,openedViaClick:M,setOpenedViaClick:F,closeOnItemClick:u,closeDropdown:h==="click"?N:L,openDropdown:h==="click"?A:k,closeDropdownImmediately:N,loop:d,trigger:h,unstyled:y,menuItemTabIndex:b}},C.createElement(Wr,{...P,opened:O,onChange:D,defaultOpened:s,trapFocus:j?!1:l,closeOnEscape:f,__staticSelector:"Menu",classNames:H,styles:J,unstyled:y,variant:x,keepMounted:j},n))}ne.extend=e=>e;ne.classes=Ya;ne.displayName="@mantine/core/Menu";ne.Item=py;ne.Label=gy;ne.Dropdown=my;ne.Target=oP;ne.Divider=hy;const[p9,Xa]=Nn("Modal component was not found in tree");var Bo={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const g9={},Ff=X((e,t)=>{const n=U("ModalBody",g9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Xa();return C.createElement(wj,{ref:t,...u.getStyles("body",{classNames:r,style:i,styles:s,className:o}),...c})});Ff.classes=Bo;Ff.displayName="@mantine/core/ModalBody";const v9={},zf=X((e,t)=>{const n=U("ModalCloseButton",v9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Xa();return C.createElement(Sj,{ref:t,...u.getStyles("close",{classNames:r,style:i,styles:s,className:o}),...c})});zf.classes=Bo;zf.displayName="@mantine/core/ModalCloseButton";const y9={},Vf=X((e,t)=>{const n=U("ModalContent",y9,e),{classNames:r,className:o,style:i,styles:s,vars:l,children:c,...u}=n,d=Xa(),f=d.scrollAreaComponent||V4;return C.createElement($4,{...d.getStyles("content",{className:o,style:i,styles:s,classNames:r}),innerProps:d.getStyles("inner",{className:o,style:i,styles:s,classNames:r}),"data-full-screen":d.fullScreen||void 0,"data-modal-content":!0,ref:t,...u},C.createElement(f,{style:{maxHeight:d.fullScreen?"100dvh":`calc(100dvh - (${V(d.yOffset)} * 2))`}},c))});Vf.classes=Bo;Vf.displayName="@mantine/core/ModalContent";const x9={},Bf=X((e,t)=>{const n=U("ModalHeader",x9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Xa();return C.createElement(bj,{ref:t,...u.getStyles("header",{classNames:r,style:i,styles:s,className:o}),...c})});Bf.classes=Bo;Bf.displayName="@mantine/core/ModalHeader";const w9={},Uf=X((e,t)=>{const n=U("ModalOverlay",w9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Xa();return C.createElement(Cj,{ref:t,...u.getStyles("overlay",{classNames:r,style:i,styles:s,className:o}),...c})});Uf.classes=Bo;Uf.displayName="@mantine/core/ModalOverlay";const S9={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Hr("modal"),transitionProps:{duration:200,transition:"pop"},yOffset:"5dvh"},b9=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:St(t),"--modal-size":Oe(n,"modal-size"),"--modal-y-offset":V(r),"--modal-x-offset":V(o)}}),Hf=X((e,t)=>{const n=U("ModalRoot",S9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,yOffset:u,scrollAreaComponent:d,radius:f,fullScreen:h,centered:p,xOffset:g,__staticSelector:v,...S}=n,y=me({name:v,classes:Bo,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:b9});return C.createElement(p9,{value:{yOffset:u,scrollAreaComponent:d,getStyles:y,fullScreen:h}},C.createElement(M4,{ref:t,...y("root"),"data-full-screen":h||void 0,"data-centered":p||void 0,unstyled:l,...S}))});Hf.classes=Bo;Hf.displayName="@mantine/core/ModalRoot";const C9={},Wf=X((e,t)=>{const n=U("ModalTitle",C9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Xa();return C.createElement(Ej,{ref:t,...u.getStyles("title",{classNames:r,style:i,styles:s,className:o}),...c})});Wf.classes=Bo;Wf.displayName="@mantine/core/ModalTitle";const E9={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Hr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},$n=X((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:s,children:l,radius:c,...u}=U("Modal",E9,e),d=!!n||i;return C.createElement(Hf,{ref:t,radius:c,...u},r&&C.createElement(Uf,{...o}),C.createElement(Vf,{radius:c},d&&C.createElement(Bf,null,n&&C.createElement(Wf,null,n),i&&C.createElement(zf,{...s})),C.createElement(Ff,null,l)))});$n.classes=Bo;$n.displayName="@mantine/core/Modal";$n.Root=Hf;$n.Overlay=Uf;$n.Content=Vf;$n.Body=Ff;$n.Header=Bf;$n.Title=Wf;$n.CloseButton=zf;const[j9,vy]=Cc(),[P9,T9]=Cc();var qf={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const k9={},R9=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?Oe(t):Oe(n,"pg-gap")}}),yy=X((e,t)=>{const n=U("PillGroup",k9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,disabled:d,...f}=n,h=vy(),p=(h==null?void 0:h.size)||u||void 0,g=me({name:"PillGroup",classes:qf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:R9,stylesCtx:{size:p},rootSelector:"group"});return C.createElement(P9,{value:{size:p,disabled:d}},C.createElement(G,{ref:t,size:p,...g("group"),...f}))});yy.classes=qf;yy.displayName="@mantine/core/PillGroup";const _9={variant:"default"},D9=(e,{radius:t},{size:n})=>({root:{"--pill-fz":Oe(n,"pill-fz"),"--pill-height":Oe(n,"pill-height"),"--pill-radius":t===void 0?void 0:St(t)}}),us=X((e,t)=>{const n=U("Pill",_9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,variant:u,children:d,withRemoveButton:f,onRemove:h,removeButtonProps:p,radius:g,size:v,disabled:S,mod:y,...x}=n,w=T9(),b=vy(),j=v||(w==null?void 0:w.size)||void 0,P=(b==null?void 0:b.variant)==="filled"?"contrast":u||"default",E=me({name:"Pill",classes:qf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:D9,stylesCtx:{size:j}});return C.createElement(G,{component:"span",ref:t,variant:P,size:j,...E("root",{variant:P}),mod:[{"with-remove":f&&!S,disabled:S||(w==null?void 0:w.disabled)},y],...x},C.createElement("span",{...E("label")},d),f&&C.createElement(bs,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...p,...E("remove",{className:p==null?void 0:p.className,style:p==null?void 0:p.style}),onMouseDown:T=>{var _;T.preventDefault(),T.stopPropagation(),(_=p==null?void 0:p.onMouseDown)==null||_.call(p,T)},onClick:T=>{var _;T.stopPropagation(),h==null||h(),(_=p==null?void 0:p.onClick)==null||_.call(p,T)}}))});us.classes=qf;us.displayName="@mantine/core/Pill";us.Group=yy;var iP={field:"m_45c4369d"};const I9={type:"visible"},xy=X((e,t)=>{const n=U("PillsInputField",I9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,type:u,disabled:d,id:f,pointer:h,mod:p,...g}=n,v=vy(),S=Ga(),y=me({name:"PillsInputField",classes:iP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"field"}),x=d||(v==null?void 0:v.disabled);return C.createElement(G,{component:"input",ref:Qt(t,v==null?void 0:v.fieldRef),"data-type":u,disabled:x,mod:[{disabled:x,pointer:h},p],...y("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:w=>!h&&w.stopPropagation()})});xy.classes=iP;xy.displayName="@mantine/core/PillsInputField";const A9={},Aa=X((e,t)=>{const n=U("PillsInput",A9,e),{children:r,onMouseDown:o,onClick:i,size:s,disabled:l,__staticSelector:c,error:u,variant:d,...f}=n,h=m.useRef();return C.createElement(j9,{value:{fieldRef:h,size:s,disabled:l,hasError:!!u,variant:d}},C.createElement(Kn,{size:s,error:u,variant:d,component:"div",ref:t,onMouseDown:p=>{var g;p.preventDefault(),o==null||o(p),(g=h.current)==null||g.focus()},onClick:p=>{var g;p.preventDefault(),i==null||i(p),(g=h.current)==null||g.focus()},...f,multiline:!0,disabled:l,__staticSelector:c||"PillsInput",withAria:!1},r))});Aa.displayName="@mantine/core/PillsInput";Aa.Field=xy;function N9({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(Ia(i)?o.push({group:i.group,items:i.items.filter(s=>n.indexOf(s.value.toLowerCase().trim())===-1)}):n.indexOf(i.value.toLowerCase().trim())===-1&&o.push(i),o),[])}const M9={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Gf=X((e,t)=>{const n=U("MultiSelect",M9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,value:d,defaultValue:f,onChange:h,onKeyDown:p,variant:g,data:v,dropdownOpened:S,defaultDropdownOpened:y,onDropdownOpen:x,onDropdownClose:w,selectFirstOptionOnChange:b,onOptionSubmit:j,comboboxProps:P,filter:E,limit:T,withScrollArea:_,maxDropdownHeight:R,searchValue:O,defaultSearchValue:I,onSearchChange:M,readOnly:F,disabled:N,onFocus:A,onBlur:D,onPaste:k,radius:L,rightSection:B,rightSectionWidth:H,rightSectionPointerEvents:J,rightSectionProps:we,leftSection:ie,leftSectionWidth:Ce,leftSectionPointerEvents:_e,leftSectionProps:Pe,inputContainer:ue,inputWrapperOrder:Ue,withAsterisk:bt,labelProps:at,descriptionProps:ve,errorProps:Le,wrapperProps:Ae,description:te,label:re,error:je,maxValues:Ye,searchable:Xe,nothingFoundMessage:ze,withCheckIcon:Y,checkIconPosition:Q,hidePickedOptions:ye,withErrorStyles:nt,name:Ct,form:ct,id:Dt,clearable:Wt,clearButtonProps:Kr,hiddenInputProps:mo,placeholder:sn,hiddenInputValuesDivider:Qo,required:Is,mod:cu,renderOption:Eh,onRemove:lr,onClear:Ko,scrollAreaProps:uu,...ol}=n,il=Mn(Dt),As=Dj(v),Yo=Ij(As),Cn=Oc({opened:S,defaultOpened:y,onDropdownOpen:x,onDropdownClose:()=>{w==null||w(),Cn.resetSelectedOption()}}),{styleProps:jh,rest:{type:$,autoComplete:z,...q}}=$o(ol),[K,le]=hn({value:d,defaultValue:f,finalValue:[],onChange:h}),[Ne,Ee]=hn({value:O,defaultValue:I,finalValue:"",onChange:M}),he=me({name:"MultiSelect",classes:{},props:n,classNames:r,styles:s,unstyled:l}),{resolvedClassNames:Fe,resolvedStyles:Me}=Ec({props:n,styles:s,classNames:r}),Kt=Be=>{p==null||p(Be),Be.key===" "&&!Xe&&(Be.preventDefault(),Cn.toggleDropdown()),Be.key==="Backspace"&&Ne.length===0&&K.length>0&&(lr==null||lr(K[K.length-1]),le(K.slice(0,K.length-1)))},Yt=K.map((Be,po)=>{var Tr,go;return C.createElement(us,{key:`${Be}-${po}`,withRemoveButton:!F&&!((Tr=Yo[Be])!=null&&Tr.disabled),onRemove:()=>{le(K.filter(Xo=>Be!==Xo)),lr==null||lr(Be)},unstyled:l,disabled:N,...he("pill")},((go=Yo[Be])==null?void 0:go.label)||Be)});m.useEffect(()=>{b&&Cn.selectFirstOption()},[b,K]);const ke=Wt&&K.length>0&&!N&&!F&&C.createElement(De.ClearButton,{size:u,...Kr,onClear:()=>{Ko==null||Ko(),le([]),Ee("")}}),ut=N9({data:As,value:K});return C.createElement(C.Fragment,null,C.createElement(De,{store:Cn,classNames:Fe,styles:Me,unstyled:l,size:u,readOnly:F,__staticSelector:"MultiSelect",onOptionSubmit:Be=>{j==null||j(Be),Ee(""),Cn.updateSelectedOptionIndex("selected"),K.includes(Yo[Be].value)?(le(K.filter(po=>po!==Yo[Be].value)),lr==null||lr(Yo[Be].value)):K.length<Ye&&le([...K,Yo[Be].value])},...P},C.createElement(De.DropdownTarget,null,C.createElement(Aa,{...jh,__staticSelector:"MultiSelect",classNames:Fe,styles:Me,unstyled:l,size:u,className:o,style:i,variant:g,disabled:N,radius:L,rightSection:B||ke||C.createElement(De.Chevron,{size:u,error:je,unstyled:l}),rightSectionPointerEvents:J||(ke?"all":"none"),rightSectionWidth:H,rightSectionProps:we,leftSection:ie,leftSectionWidth:Ce,leftSectionPointerEvents:_e,leftSectionProps:Pe,inputContainer:ue,inputWrapperOrder:Ue,withAsterisk:bt,labelProps:at,descriptionProps:ve,errorProps:Le,wrapperProps:Ae,description:te,label:re,error:je,multiline:!0,withErrorStyles:nt,__stylesApiProps:{...n,rightSectionPointerEvents:J||(ke?"all":"none"),multiline:!0},pointer:!Xe,onClick:()=>Xe?Cn.openDropdown():Cn.toggleDropdown(),"data-expanded":Cn.dropdownOpened||void 0,id:il,required:Is,mod:cu},C.createElement(us.Group,{disabled:N,unstyled:l,...he("pillsList")},Yt,C.createElement(De.EventsTarget,{autoComplete:z},C.createElement(Aa.Field,{...q,ref:t,id:il,placeholder:sn,type:!Xe&&!sn?"hidden":"visible",...he("inputField"),unstyled:l,onFocus:Be=>{A==null||A(Be),Xe&&Cn.openDropdown()},onBlur:Be=>{D==null||D(Be),Cn.closeDropdown(),Ee("")},onKeyDown:Kt,value:Ne,onChange:Be=>{Ee(Be.currentTarget.value),Xe&&Cn.openDropdown(),b&&Cn.selectFirstOption()},disabled:N,readOnly:F||!Xe,pointer:!Xe}))))),C.createElement(r5,{data:ye?ut:As,hidden:F||N,filter:E,search:Ne,limit:T,hiddenWhenEmpty:!Xe||!ze||ye&&ut.length===0&&Ne.trim().length===0,withScrollArea:_,maxDropdownHeight:R,filterOptions:Xe,value:K,checkIconPosition:Q,withCheckIcon:Y,nothingFoundMessage:ze,unstyled:l,labelId:`${il}-label`,renderOption:Eh,scrollAreaProps:uu})),C.createElement(De.HiddenInput,{name:Ct,valuesDivider:Qo,value:K,form:ct,disabled:N,...mo}))});Gf.classes={...Kn.classes,...De.classes};Gf.displayName="@mantine/core/MultiSelect";function O9(e){return"group"in e}function wy({data:e}){if(O9(e)){const o=e.items.map(i=>C.createElement(wy,{key:i.value,data:i}));return C.createElement("optgroup",{label:e.group},o)}const{value:t,label:n,...r}=e;return C.createElement("option",{key:e.value,value:e.value,...r},e.label)}wy.displayName="@mantine/core/NativeSelectOption";const $9={rightSectionPointerEvents:"none"},Tt=X((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:s,unstyled:l,...c}=U("NativeSelect",$9,e),u=Dj(n).map((d,f)=>C.createElement(wy,{key:f,data:d}));return C.createElement(Kn,{component:"select",ref:t,...c,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:l,rightSection:s||C.createElement(Nf,{size:o,error:i,unstyled:l})},r||u)});Tt.classes=Kn.classes;Tt.displayName="@mantine/core/NativeSelect";var sP={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const L9={withCloseButton:!0},F9=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:St(t),"--notification-color":n?wt(n,e):void 0}}),Sy=X((e,t)=>{const n=U("Notification",L9,e),{className:r,color:o,radius:i,loading:s,withCloseButton:l,withBorder:c,title:u,icon:d,children:f,onClose:h,closeButtonProps:p,classNames:g,style:v,styles:S,unstyled:y,variant:x,vars:w,mod:b,...j}=n,P=me({name:"Notification",classes:sP,props:n,className:r,style:v,classNames:g,styles:S,unstyled:y,vars:w,varsResolver:F9});return C.createElement(G,{...P("root"),mod:[{"data-with-icon":!!d||s,"data-with-border":c},b],ref:t,variant:x,...j,role:"alert"},d&&!s&&C.createElement("div",{...P("icon")},d),s&&C.createElement(Gn,{size:28,color:o,...P("loader")}),C.createElement("div",{...P("body")},u&&C.createElement("div",{...P("title")},u),C.createElement(G,{...P("description"),mod:{"data-with-title":!!u}},f)),l&&C.createElement(bs,{iconSize:16,color:"gray",...p,unstyled:y,onClick:h,...P("closeButton")}))});Sy.classes=sP;Sy.displayName="@mantine/core/Notification";function aP(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 cc;(function(e){e.event="event",e.props="prop"})(cc||(cc={}));function li(){}function z9(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,s){return i===t[s]})||(t=r,n=e.apply(void 0,r)),n}}function uc(e){return!!(e||"").match(/\d/)}function xa(e){return e==null}function V9(e){return typeof e=="number"&&isNaN(e)}function lP(e){return xa(e)||V9(e)||typeof e=="number"&&!isFinite(e)}function cP(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function B9(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 U9(e,t,n){var r=B9(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 H9(e){var t=m.useRef(e);t.current=e;var n=m.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function by(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),i=o[0],s=o[1]||"";return{beforeDecimal:i,afterDecimal:s,hasNegation:n,addNegation:r}}function W9(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 uP(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function Z1(e,t){return Array(t+1).join(e)}function dP(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 s=1+i,l=o.length;return s<0?o="0."+Z1("0",Math.abs(s))+o:s>=l?o=o+Z1("0",s-l):o=(o.substring(0,s)||"0")+"."+o.substring(s),n+o}function ew(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=by(e),i=o.beforeDecimal,s=o.afterDecimal,l=o.hasNegation,c=parseFloat("0."+(s||"0")),u=s.length<=t?"0."+s:c.toFixed(t),d=u.split("."),f=i;i&&Number(d[0])&&(f=i.split("").reverse().reduce(function(v,S,y){return v.length>y?(Number(v[0])+Number(S)).toString()+v.substring(1,v.length):S+v},d[0]));var h=uP(d[1]||"",t,n),p=l?"-":"",g=r?".":"";return""+p+f+g+h}function Ui(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 fP=z9(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}}});function q9(e,t,n){return Math.min(Math.max(e,t),n)}function hm(e){return Math.max(e.selectionStart,e.selectionEnd)}function G9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Q9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function K9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function Y9(e,t,n,r,o,i,s){s===void 0&&(s=K9);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),p=0;p<u;p++){h[p]=-1;for(var g=0,v=d;g<v;g++){var S=s({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:p,formattedValueIndex:g});if(S&&f[g]!==!0){h[p]=g,f[g]=!0;break}}}for(var y=r;y<u&&(h[y]===-1||!i(n[y]));)y++;var x=y===u||h[y]===-1?d:h[y];for(y=r-1;y>0&&h[y]===-1;)y--;var w=y===-1||h[y]===-1?0:h[y]+1;return w>x?x:r-w<x-r?w:x}function tw(e,t,n,r){var o=e.length;if(t=q9(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 X9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(uc(e[n])||uc(e[n-1]));return t}function hP(e,t,n,r,o,i){i===void 0&&(i=li);var s=H9(function(g,v){var S,y;return lP(g)?(y="",S=""):typeof g=="number"||v?(y=typeof g=="number"?dP(g):g,S=r(y)):(y=o(g,void 0),S=r(y)),{formattedValue:S,numAsString:y}}),l=m.useState(function(){return s(xa(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;xa(e)&&(f=c.numAsString,h=!0);var p=s(f,h);return m.useMemo(function(){u(p)},[p.formattedValue]),[c,d]}function J9(e){return e.replace(/[^0-9]/g,"")}function Z9(e){return e}function eM(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,s=e.format;s===void 0&&(s=Z9);var l=e.removeFormatting;l===void 0&&(l=J9);var c=e.defaultValue,u=e.valueIsNumericString,d=e.onValueChange,f=e.isAllowed,h=e.onChange;h===void 0&&(h=li);var p=e.onKeyDown;p===void 0&&(p=li);var g=e.onMouseUp;g===void 0&&(g=li);var v=e.onFocus;v===void 0&&(v=li);var S=e.onBlur;S===void 0&&(S=li);var y=e.value,x=e.getCaretBoundary;x===void 0&&(x=X9);var w=e.isValidInputCharacter;w===void 0&&(w=uc);var b=e.isCharacterSame,j=aP(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),P=hP(y,c,!!u,s,l,d),E=P[0],T=E.formattedValue,_=E.numAsString,R=P[1],O=m.useRef({formattedValue:T,numAsString:_}),I=function(te,re){O.current={formattedValue:te.formattedValue,numAsString:te.value},R(te,re)},M=m.useState(!1),F=M[0],N=M[1],A=m.useRef(null),D=m.useRef({setCaretTimeout:null,focusTimeout:null});m.useEffect(function(){return N(!0),function(){clearTimeout(D.current.setCaretTimeout),clearTimeout(D.current.focusTimeout)}},[]);var k=s,L=function(te,re){var je=parseFloat(re);return{formattedValue:te,value:re,floatValue:isNaN(je)?void 0:je}},B=function(te,re,je){te.selectionStart===0&&te.selectionEnd===te.value.length||(Ui(te,re),D.current.setCaretTimeout=setTimeout(function(){te.value===je&&te.selectionStart!==re&&Ui(te,re)},0))},H=function(te,re,je){return tw(te,re,x(te),je)},J=function(te,re,je){var Ye=x(re),Xe=Y9(re,T,te,je,Ye,w,b);return Xe=tw(re,Xe,Ye),Xe},we=function(te){var re=te.formattedValue;re===void 0&&(re="");var je=te.input,Ye=te.source,Xe=te.event,ze=te.numAsString,Y;if(je){var Q=te.inputValue||je.value,ye=hm(je);je.value=re,Y=J(Q,re,ye),Y!==void 0&&B(je,Y,re)}re!==T&&I(L(re,ze),{event:Xe,source:Ye})};m.useEffect(function(){var te=O.current,re=te.formattedValue,je=te.numAsString;T!==re&&(T!==_||re!==je)&&I(L(T,_),{event:void 0,source:cc.props})},[T,_]);var ie=A.current?hm(A.current):void 0,Ce=typeof window<"u"?m.useLayoutEffect:m.useEffect;Ce(function(){var te=A.current;if(T!==O.current.formattedValue&&te){var re=J(O.current.formattedValue,T,ie);te.value=T,B(te,re,T)}},[T]);var _e=function(te,re,je){var Ye=fP(T,te),Xe=Object.assign(Object.assign({},Ye),{lastValue:T}),ze=l(te,Xe),Y=k(ze);if(ze=l(Y,void 0),f&&!f(L(Y,ze))){var Q=re.target,ye=hm(Q),nt=J(te,T,ye);return Q.value=T,B(Q,nt,T),!1}return we({formattedValue:Y,numAsString:ze,inputValue:te,event:re,source:je,input:re.target}),!0},Pe=function(te){var re=te.target,je=re.value,Ye=_e(je,te,cc.event);Ye&&h(te)},ue=function(te){var re=te.target,je=te.key,Ye=re.selectionStart,Xe=re.selectionEnd,ze=re.value;ze===void 0&&(ze="");var Y;if(je==="ArrowLeft"||je==="Backspace"?Y=Math.max(Ye-1,0):je==="ArrowRight"?Y=Math.min(Ye+1,ze.length):je==="Delete"&&(Y=Ye),Y===void 0||Ye!==Xe){p(te);return}var Q=Y;if(je==="ArrowLeft"||je==="ArrowRight"){var ye=je==="ArrowLeft"?"left":"right";Q=H(ze,Y,ye),Q!==Y&&te.preventDefault()}else je==="Delete"&&!w(ze[Y])?Q=H(ze,Y,"right"):je==="Backspace"&&!w(ze[Y])&&(Q=H(ze,Y,"left"));Q!==Y&&B(re,Q,ze),te.isUnitTestRun&&B(re,Q,ze),p(te)},Ue=function(te){var re=te.target,je=function(){var Ye=re.selectionStart,Xe=re.selectionEnd,ze=re.value;if(ze===void 0&&(ze=""),Ye===Xe){var Y=H(ze,Ye);Y!==Ye&&B(re,Y,ze)}};je(),requestAnimationFrame(function(){je()}),g(te)},bt=function(te){te.persist&&te.persist();var re=te.target,je=te.currentTarget;A.current=re,D.current.focusTimeout=setTimeout(function(){var Ye=re.selectionStart,Xe=re.selectionEnd,ze=re.value;ze===void 0&&(ze="");var Y=H(ze,Ye);Y!==Ye&&!(Ye===0&&Xe===ze.length)&&B(re,Y,ze),v(Object.assign(Object.assign({},te),{currentTarget:je}))},0)},at=function(te){A.current=null,clearTimeout(D.current.focusTimeout),clearTimeout(D.current.setCaretTimeout),S(te)},ve=F&&G9()?"numeric":void 0,Le=Object.assign({inputMode:ve},j,{type:t,value:T,onChange:Pe,onKeyDown:ue,onMouseUp:Ue,onFocus:bt,onBlur:at});if(n==="text")return o?C.createElement(C.Fragment,null,o(T,j)||null):C.createElement("span",Object.assign({},j,{ref:i}),T);if(r){var Ae=r;return C.createElement(Ae,Object.assign({},Le,{ref:i}))}return C.createElement("input",Object.assign({},Le,{ref:i}))}function nw(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 s=t.allowNegative,l=t.thousandsGroupStyle;if(l===void 0&&(l="thousand"),e===""||e==="-")return e;var c=Qf(t),u=c.thousandSeparator,d=c.decimalSeparator,f=n!==0&&e.indexOf(".")!==-1||n&&r,h=by(e,s),p=h.beforeDecimal,g=h.afterDecimal,v=h.addNegation;return n!==void 0&&(g=uP(g,n,!!r)),u&&(p=U9(p,u,l)),o&&(p=o+p),i&&(g=g+i),v&&(p="-"+p),e=p+(f&&d||"")+g,e}function Qf(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 tM(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 nM(e,t){return new RegExp("(^-)|[0-9]|"+cP(e),"g")}function rM(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function oM(e,t,n){var r;t===void 0&&(t=Q9(e));var o=n.allowNegative,i=n.prefix;i===void 0&&(i="");var s=n.suffix;s===void 0&&(s="");var l=n.decimalScale,c=t.from,u=t.to,d=u.start,f=u.end,h=Qf(n),p=h.allowedDecimalSeparators,g=h.decimalSeparator,v=e[f]===g;if(uc(e)&&(e===i||e===s)&&t.lastValue==="")return e;if(f-d===1&&p.indexOf(e[d])!==-1){var S=l===0?"":g;e=e.substring(0,d)+S+e.substring(d+1,e.length)}var y=function(D,k,L){var B=!1,H=!1;i.startsWith("-")?B=!1:D.startsWith("--")?(B=!1,H=!0):s.startsWith("-")&&D.length===s.length?B=!1:D[0]==="-"&&(B=!0);var J=B?1:0;return H&&(J=2),J&&(D=D.substring(J),k-=J,L-=J),{value:D,start:k,end:L,hasNegation:B}},x=y(e,d,f),w=x.hasNegation;r=x,e=r.value,d=r.start,f=r.end;var b=y(t.lastValue,c.start,c.end),j=b.start,P=b.end,E=b.value,T=e.substring(d,f);e.length&&E.length&&(j>E.length-s.length||P<i.length)&&!(T&&s.startsWith(T))&&(e=E);var _=0;e.startsWith(i)?_+=i.length:d<i.length&&(_=d),e=e.substring(_),f-=_;var R=e.length,O=e.length-s.length;e.endsWith(s)?R=O:(f>O||f>e.length-s.length)&&(R=f),e=e.substring(0,R),e=tM(w?"-"+e:e,o),e=(e.match(nM(g))||[]).join("");var I=e.indexOf(g);e=e.replace(new RegExp(cP(g),"g"),function(D,k){return k===I?".":""});var M=by(e,o),F=M.beforeDecimal,N=M.afterDecimal,A=M.addNegation;return u.end-u.start<c.end-c.start&&F===""&&v&&!parseFloat(N)&&(e=A?"-":""),e}function iM(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 s=e.length;return o.fill(!1,s-r.length+1,s+1),o}function sM(e){var t=Qf(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 aM(e){e=sM(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=li);var i=e.onBlur;i===void 0&&(i=li);var s=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,p=e.onValueChange,g=aP(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=Qf(e),S=v.decimalSeparator,y=v.allowedDecimalSeparators,x=function(A){return nw(A,e)},w=function(A,D){return oM(A,D,e)},b=xa(f)?d:f,j=h??rM(b,u,t);xa(f)?xa(d)||(j=j||typeof d=="number"):j=j||typeof f=="number";var P=function(A){return lP(A)?A:(typeof A=="number"&&(A=dP(A)),j&&typeof l=="number"?ew(A,l,!!c):A)},E=hP(P(f),P(d),!!j,x,w,p),T=E[0],_=T.numAsString,R=T.formattedValue,O=E[1],I=function(A){var D=A.target,k=A.key,L=D.selectionStart,B=D.selectionEnd,H=D.value;if(H===void 0&&(H=""),L!==B){o(A);return}k==="Backspace"&&H[0]==="-"&&L===u.length+1&&n&&Ui(D,1),l&&c&&(k==="Backspace"&&H[L-1]===S?(Ui(D,L-1),A.preventDefault()):k==="Delete"&&H[L]===S&&A.preventDefault()),y!=null&&y.includes(k)&&H[L]===S&&Ui(D,L+1);var J=s===!0?",":s;k==="Backspace"&&H[L-1]===J&&Ui(D,L-1),k==="Delete"&&H[L]===J&&Ui(D,L+1),o(A)},M=function(A){var D=_;if(D.match(/\d/g)||(D=""),r||(D=W9(D)),c&&l&&(D=ew(D,l,c)),D!==_){var k=nw(D,e);O({formattedValue:k,value:D,floatValue:parseFloat(D)},{event:A,source:cc.event})}i(A)},F=function(A){return A===S?!0:uc(A)},N=function(A){var D=A.currentValue,k=A.lastValue,L=A.formattedValue,B=A.currentValueIndex,H=A.formattedValueIndex,J=D[B],we=L[H],ie=fP(k,D),Ce=ie.to;return B>=Ce.start&&B<Ce.end&&y&&y.includes(J)&&we===S?!0:J===we};return Object.assign(Object.assign({},g),{value:R,valueIsNumericString:!1,isValidInputCharacter:F,isCharacterSame:N,onValueChange:O,format:x,removeFormatting:w,getCaretBoundary:function(A){return iM(A,e)},onKeyDown:I,onBlur:M})}function lM(e){var t=aM(e);return C.createElement(eM,Object.assign({},t))}function rw({direction:e,style:t,...n}){return C.createElement("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},C.createElement("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 Mp={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const cM=/^-0(\.0*)?$/,uM=/^-?0\d+$/;function dM(e){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)}function ow(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 fM={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,startValue:0},hM=(e,{size:t})=>({controls:{"--ni-chevron-size":Oe(t,"ni-chevron-size")}}),Cy=X((e,t)=>{const n=U("NumberInput",fM,e),{className:r,classNames:o,styles:i,unstyled:s,vars:l,onChange:c,onValueChange:u,value:d,defaultValue:f,max:h,min:p,step:g,hideControls:v,rightSection:S,isAllowed:y,clampBehavior:x,onBlur:w,allowDecimal:b,decimalScale:j,onKeyDown:P,onKeyDownCapture:E,handlersRef:T,startValue:_,disabled:R,rightSectionPointerEvents:O,allowNegative:I,readOnly:M,size:F,rightSectionWidth:N,stepHoldInterval:A,stepHoldDelay:D,allowLeadingZeros:k,withKeyboardEvents:L,...B}=n,H=me({name:"NumberInput",classes:Mp,props:n,classNames:o,styles:i,unstyled:s,vars:l,varsResolver:hM}),{resolvedClassNames:J,resolvedStyles:we}=Ec({classNames:o,styles:i,props:n}),[ie,Ce]=hn({value:d,defaultValue:f,onChange:c}),_e=D!==void 0&&A!==void 0,Pe=m.useRef(null),ue=m.useRef(null),Ue=m.useRef(0),bt=(Q,ye)=>{ye.source==="event"&&Ce(dM(Q.floatValue)&&!cM.test(Q.value)&&!(k&&uM.test(Q.value))?Q.floatValue:Q.value),u==null||u(Q,ye)},at=Q=>{const ye=String(Q).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return ye?Math.max(0,(ye[1]?ye[1].length:0)-(ye[2]?+ye[2]:0)):0},ve=Q=>{Pe.current&&typeof Q<"u"&&Pe.current.setSelectionRange(Q,Q)},Le=m.useRef();Le.current=()=>{let Q;const ye=at(ie),nt=at(g),Ct=Math.max(ye,nt),ct=10**Ct;if(typeof ie!="number"||Number.isNaN(ie))Q=vu(_,p,h);else if(h!==void 0){const Wt=(Math.round(ie*ct)+Math.round(g*ct))/ct;Q=Wt<=h?Wt:h}else Q=(Math.round(ie*ct)+Math.round(g*ct))/ct;const Dt=Q.toFixed(Ct);Ce(parseFloat(Dt)),u==null||u({floatValue:parseFloat(Dt),formattedValue:Dt,value:Dt},{source:"increment"}),setTimeout(()=>{var Wt;return ve((Wt=Pe.current)==null?void 0:Wt.value.length)},0)};const Ae=m.useRef();Ae.current=()=>{let Q;const ye=at(ie),nt=at(g),Ct=Math.max(ye,nt),ct=10**Ct;if(typeof ie!="number"||Number.isNaN(ie))Q=vu(_,p,h);else{const Wt=(Math.round(ie*ct)-Math.round(g*ct))/ct;Q=p!==void 0&&Wt<p?p:Wt}const Dt=Q.toFixed(Ct);Ce(parseFloat(Dt)),u==null||u({floatValue:parseFloat(Dt),formattedValue:Dt,value:Dt},{source:"decrement"}),setTimeout(()=>{var Wt;return ve((Wt=Pe.current)==null?void 0:Wt.value.length)},0)};const te=Q=>{P==null||P(Q),!(M||!L)&&(Q.key==="ArrowUp"&&(Q.preventDefault(),Le.current()),Q.key==="ArrowDown"&&(Q.preventDefault(),Ae.current()))},re=Q=>{if(E==null||E(Q),Q.key==="Backspace"){const ye=Pe.current;ye.selectionStart===0&&ye.selectionStart===ye.selectionEnd&&(Q.preventDefault(),window.setTimeout(()=>ve(0),0))}};cf(T,{increment:Le.current,decrement:Ae.current});const je=Q=>{Q?Le.current():Ae.current(),Ue.current+=1},Ye=Q=>{if(je(Q),_e){const ye=typeof A=="number"?A:A(Ue.current);ue.current=window.setTimeout(()=>Ye(Q),ye)}},Xe=(Q,ye)=>{var nt;Q.preventDefault(),(nt=Pe.current)==null||nt.focus(),je(ye),_e&&(ue.current=window.setTimeout(()=>Ye(ye),D))},ze=()=>{ue.current&&window.clearTimeout(ue.current),ue.current=null,Ue.current=0},Y=C.createElement("div",{...H("controls")},C.createElement(Dn,{...H("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof ie=="number"&&h!==void 0&&ie>=h,mod:{direction:"up"},onMouseDown:Q=>Q.preventDefault(),onPointerDown:Q=>{Xe(Q,!0)},onPointerUp:ze,onPointerLeave:ze},C.createElement(rw,{direction:"up"})),C.createElement(Dn,{...H("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof ie=="number"&&p!==void 0&&ie<=p,mod:{direction:"down"},onMouseDown:Q=>Q.preventDefault(),onPointerDown:Q=>{Xe(Q,!1)},onPointerUp:ze,onPointerLeave:ze},C.createElement(rw,{direction:"down"})));return C.createElement(Kn,{component:lM,allowNegative:I,className:rt(Mp.root,r),size:F,...B,readOnly:M,disabled:R,value:ie,getInputRef:Qt(t,Pe),onValueChange:bt,rightSection:v||M?S:S||Y,classNames:J,styles:we,unstyled:s,__staticSelector:"NumberInput",decimalScale:b?j:0,onKeyDown:te,onKeyDownCapture:re,rightSectionPointerEvents:O??(R?"none":void 0),rightSectionWidth:N??`var(--ni-right-section-width-${F||"sm"})`,allowLeadingZeros:k,onBlur:Q=>{w==null||w(Q),x==="blur"&&typeof ie=="number"&&vu(ie,p,h)!==ie&&Ce(vu(ie,p,h))},isAllowed:Q=>x==="strict"?y?y(Q)&&ow(Q.floatValue,p,h):ow(Q.floatValue,p,h):y?y(Q):!0})});Cy.classes={...Kn.classes,...Mp};Cy.displayName="@mantine/core/NumberInput";const[mM,Kf]=Nn("Pagination.Root component was not found in tree");var Fc={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const pM={withPadding:!0},zc=X((e,t)=>{const n=U("PaginationControl",pM,e),{classNames:r,className:o,style:i,styles:s,vars:l,active:c,disabled:u,withPadding:d,mod:f,...h}=n,p=Kf(),g=u||p.disabled;return C.createElement(Dn,{ref:t,disabled:g,mod:[{active:c,disabled:g,"with-padding":d},f],...p.getStyles("control",{className:o,style:i,classNames:r,styles:s,active:!g}),...h})});zc.classes=Fc;zc.displayName="@mantine/core/PaginationControl";function Vc({style:e,children:t,path:n,...r}){return C.createElement("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},C.createElement("path",{d:n,fill:"currentColor"}))}const gM=e=>C.createElement(Vc,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),vM=e=>C.createElement(Vc,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),yM=e=>C.createElement(Vc,{...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"}),xM=e=>C.createElement(Vc,{...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"}),wM=e=>C.createElement(Vc,{...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"}),SM={icon:wM},Yf=X((e,t)=>{const n=U("PaginationDots",SM,e),{classNames:r,className:o,style:i,styles:s,vars:l,icon:c,...u}=n,d=Kf(),f=c;return C.createElement(G,{ref:t,...d.getStyles("dots",{className:o,style:i,styles:s,classNames:r}),...u},C.createElement(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}}))});Yf.classes=Fc;Yf.displayName="@mantine/core/PaginationDots";function Xf({icon:e,name:t,action:n,type:r}){const o={icon:e},i=m.forwardRef((s,l)=>{const{icon:c,...u}=U(t,o,s),d=c,f=Kf(),h=r==="next"?f.active===f.total:f.active===1;return C.createElement(zc,{disabled:f.disabled||h,ref:l,onClick:f[n],withPadding:!1,...u},C.createElement(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 mP=Xf({icon:gM,name:"PaginationNext",action:"onNext",type:"next"}),pP=Xf({icon:vM,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),gP=Xf({icon:yM,name:"PaginationFirst",action:"onFirst",type:"previous"}),vP=Xf({icon:xM,name:"PaginationLast",action:"onLast",type:"next"});function Ey({dotsIcon:e}){const t=Kf(),n=t.range.map((r,o)=>{var i;return r==="dots"?C.createElement(Yf,{icon:e,key:o}):C.createElement(zc,{key:o,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)},r)});return C.createElement(C.Fragment,null,n)}Ey.displayName="@mantine/core/PaginationItems";const bM={siblings:1,boundaries:1},CM=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:St(n),"--pagination-control-size":Oe(t,"pagination-control-size"),"--pagination-control-fz":nn(t),"--pagination-active-bg":r?wt(r,e):void 0,"--pagination-active-color":jc(o,e)?vs({color:r,theme:e}):void 0}}),Jf=X((e,t)=>{const n=U("PaginationRoot",bM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,total:u,value:d,defaultValue:f,onChange:h,disabled:p,siblings:g,boundaries:v,color:S,radius:y,onNextPage:x,onPreviousPage:w,onFirstPage:b,onLastPage:j,getItemProps:P,autoContrast:E,...T}=n,_=me({name:"Pagination",classes:Fc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:CM}),{range:R,setPage:O,next:I,previous:M,active:F,first:N,last:A}=d_({page:d,initialPage:f,onChange:h,total:u,siblings:g,boundaries:v}),D=Jn(x,I),k=Jn(w,M),L=Jn(b,N),B=Jn(j,A);return C.createElement(mM,{value:{total:u,range:R,active:F,disabled:p,getItemProps:P,onChange:O,onNext:D,onPrevious:k,onFirst:L,onLast:B,getStyles:_}},C.createElement(G,{ref:t,..._("root"),...T}))});Jf.classes=Fc;Jf.displayName="@mantine/core/PaginationRoot";const EM={withControls:!0,siblings:1,boundaries:1,gap:8},qr=X((e,t)=>{const n=U("Pagination",EM,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:s,previousIcon:l,lastIcon:c,firstIcon:u,dotsIcon:d,total:f,gap:h,...p}=n;return f<=0?null:C.createElement(Jf,{ref:t,total:f,...p},C.createElement(ee,{gap:h},r&&C.createElement(gP,{icon:u,...i==null?void 0:i("first")}),o&&C.createElement(pP,{icon:l,...i==null?void 0:i("previous")}),C.createElement(Ey,{dotsIcon:d}),o&&C.createElement(mP,{icon:s,...i==null?void 0:i("next")}),r&&C.createElement(vP,{icon:c,...i==null?void 0:i("last")})))});qr.classes=Fc;qr.displayName="@mantine/core/Pagination";qr.Root=Jf;qr.Control=zc;qr.Dots=Yf;qr.First=gP;qr.Last=vP;qr.Next=mP;qr.Previous=pP;qr.Items=Ey;const jM=({reveal:e})=>C.createElement("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)"}},C.createElement("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 Op={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const PM={visibilityToggleIcon:jM},TM=(e,{size:t})=>({root:{"--psi-icon-size":Oe(t,"psi-icon-size"),"--psi-button-size":Oe(t,"psi-button-size")}}),Lr=X((e,t)=>{const n=U("PasswordInput",PM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,required:u,error:d,leftSection:f,disabled:h,id:p,variant:g,inputContainer:v,description:S,label:y,size:x,errorProps:w,descriptionProps:b,labelProps:j,withAsterisk:P,inputWrapperOrder:E,wrapperProps:T,radius:_,rightSection:R,rightSectionWidth:O,rightSectionPointerEvents:I,leftSectionWidth:M,visible:F,defaultVisible:N,onVisibilityChange:A,visibilityToggleIcon:D,visibilityToggleButtonProps:k,rightSectionProps:L,leftSectionProps:B,leftSectionPointerEvents:H,mod:J,...we}=n,ie=Mn(p),[Ce,_e]=hn({value:F,defaultValue:N,finalValue:!1,onChange:A}),Pe=()=>_e(!Ce),ue=me({name:"PasswordInput",classes:Op,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:TM}),{resolvedClassNames:Ue,resolvedStyles:bt}=Ec({classNames:r,styles:s,props:n}),{styleProps:at,rest:ve}=$o(we),Le=D,Ae=C.createElement(Zt,{...ue("visibilityToggle"),disabled:h,radius:_,"aria-hidden":!k,tabIndex:-1,...k,variant:"subtle",color:"gray",unstyled:l,onMouseDown:te=>{var re;te.preventDefault(),(re=k==null?void 0:k.onMouseDown)==null||re.call(k,te),Pe()},onKeyDown:te=>{var re;(re=k==null?void 0:k.onKeyDown)==null||re.call(k,te),te.key===" "&&(te.preventDefault(),Pe())}},C.createElement(Le,{reveal:Ce}));return C.createElement(_t.Wrapper,{required:u,id:ie,label:y,error:d,description:S,size:x,classNames:Ue,styles:bt,__staticSelector:"PasswordInput",errorProps:w,descriptionProps:b,unstyled:l,withAsterisk:P,inputWrapperOrder:E,inputContainer:v,variant:g,labelProps:{...j,htmlFor:ie},mod:J,...ue("root"),...at,...T},C.createElement(_t,{component:"div",error:d,leftSection:f,size:x,classNames:{...Ue,input:rt(Op.input,Ue.input)},styles:bt,radius:_,disabled:h,__staticSelector:"PasswordInput",rightSectionWidth:O,rightSection:R??Ae,variant:g,unstyled:l,leftSectionWidth:M,rightSectionPointerEvents:I||"all",rightSectionProps:L,leftSectionProps:B,leftSectionPointerEvents:H,withAria:!1},C.createElement("input",{required:u,"data-invalid":!!d||void 0,"data-with-left-section":!!f||void 0,...ue("innerInput"),disabled:h,id:ie,ref:t,...ve,autoComplete:ve.autoComplete||"off",type:Ce?"text":"password"})))});Lr.classes={...Kn.classes,...Op};Lr.displayName="@mantine/core/PasswordInput";const[kM,RM]=Cc(),_M={},jy=X((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,name:c,readOnly:u,...d}=U("RadioGroup",_M,e),f=Mn(c),[h,p]=hn({value:n,defaultValue:r,finalValue:"",onChange:o}),g=v=>!u&&p(v.currentTarget.value);return C.createElement(kM,{value:{value:h,onChange:g,size:i,name:f}},C.createElement(_t.Wrapper,{size:i,ref:t,...s,...d,labelElement:"div",__staticSelector:"RadioGroup"},C.createElement(ey,{role:"radiogroup"},l)))});jy.classes=_t.Wrapper.classes;jy.displayName="@mantine/core/RadioGroup";function DM({size:e,style:t,...n}){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:V(e),height:V(e),...t},"aria-hidden":!0,...n},C.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"}))}var yP={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const IM={labelPosition:"right"},AM=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:s})=>{const l=uo({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":Oe(t,"radio-size"),"--radio-radius":n===void 0?void 0:St(n),"--radio-color":i==="outline"?c:wt(r,e),"--radio-icon-color":o?wt(o,e):jc(s,e)?vs({color:r,theme:e}):void 0,"--radio-icon-size":Oe(t,"radio-icon-size")}}},dc=X((e,t)=>{const n=U("Radio",IM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,id:u,size:d,label:f,labelPosition:h,description:p,error:g,radius:v,color:S,variant:y,disabled:x,wrapperProps:w,icon:b=DM,rootRef:j,iconColor:P,onChange:E,mod:T,..._}=n,R=me({name:"Radio",classes:yP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:AM}),O=RM(),I=(O==null?void 0:O.size)??d,M=n.size?d:I,{styleProps:F,rest:N}=$o(_),A=Mn(u),D=O?{checked:O.value===N.value,name:N.name??O.name,onChange:k=>{O.onChange(k),E==null||E(k)}}:{};return C.createElement(Mf,{...R("root"),__staticSelector:"Radio",__stylesApiProps:n,id:A,size:M,labelPosition:h,label:f,description:p,error:g,disabled:x,classNames:r,styles:s,unstyled:l,"data-checked":D.checked||void 0,variant:y,ref:j,mod:T,...F,...w},C.createElement(G,{...R("inner"),mod:{"label-position":h}},C.createElement(G,{...R("radio",{focusable:!0,variant:y}),onChange:E,...N,...D,component:"input",mod:{error:!!g},ref:t,id:A,disabled:x,type:"radio"}),C.createElement(b,{...R("icon"),"aria-hidden":!0})))});dc.classes=yP;dc.displayName="@mantine/core/Radio";dc.Group=jy;const NM={duration:100,transition:"fade"};function MM(e,t){return{...NM,...t,...e}}function OM({offset:e,position:t}){const[n,r]=m.useState(!1),o=m.useRef(),{x:i,y:s,elements:l,refs:c,update:u,placement:d}=Iv({placement:t,middleware:[kv({crossAxis:!0,padding:5,rootBoundary:"document"})]}),f=d.includes("right")?e:t.includes("left")?e*-1:0,h=d.includes("bottom")?e:t.includes("top")?e*-1:0,p=m.useCallback(({clientX:g,clientY:v})=>{c.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:g,y:v,left:g+f,top:v+h,right:g,bottom:v}}})},[l.reference]);return m.useEffect(()=>{if(c.floating.current){const g=o.current;g.addEventListener("mousemove",p);const v=Eo(c.floating.current);return v.forEach(S=>{S.addEventListener("scroll",u)}),()=>{g.removeEventListener("mousemove",p),v.forEach(S=>{S.removeEventListener("scroll",u)})}}},[l.reference,c.floating.current,u,p,n]),{handleMouseMove:p,x:i,y:s,opened:n,setOpened:r,boundaryRef:o,floating:c.setFloating}}var Zf={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const $M={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Hr("popover")},LM=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:St(t),"--tooltip-bg":n?wt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Py=X((e,t)=>{const n=U("TooltipFloating",$M,e),{children:r,refProp:o,withinPortal:i,style:s,className:l,classNames:c,styles:u,unstyled:d,radius:f,color:h,label:p,offset:g,position:v,multiline:S,zIndex:y,disabled:x,variant:w,vars:b,portalProps:j,...P}=n,E=$t(),T=me({name:"TooltipFloating",props:n,classes:Zf,className:l,style:s,classNames:c,styles:u,unstyled:d,rootSelector:"tooltip",vars:b,varsResolver:LM}),{handleMouseMove:_,x:R,y:O,opened:I,boundaryRef:M,floating:F,setOpened:N}=OM({offset:g,position:v});if(!Oo(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 A=Qt(M,r.ref,t),D=L=>{var B,H;(H=(B=r.props).onMouseEnter)==null||H.call(B,L),_(L),N(!0)},k=L=>{var B,H;(H=(B=r.props).onMouseLeave)==null||H.call(B,L),N(!1)};return C.createElement(C.Fragment,null,C.createElement(Ss,{...j,withinPortal:i},C.createElement(G,{...P,...T("tooltip",{style:{...Eb(s,E),zIndex:y,display:!x&&I?"block":"none",top:(O&&Math.round(O))??"",left:(R&&Math.round(R))??""}}),variant:w,ref:F,mod:{multiline:S}},p)),m.cloneElement(r,{...r.props,[o]:A,onMouseEnter:D,onMouseLeave:k}))});Py.classes=Zf;Py.displayName="@mantine/core/TooltipFloating";const xP=m.createContext(!1),FM=xP.Provider,zM=()=>m.useContext(xP),VM={openDelay:0,closeDelay:0};function wP(e){const{openDelay:t,closeDelay:n,children:r}=U("TooltipGroup",VM,e);return C.createElement(FM,{value:!0},C.createElement(QN,{delay:{open:t,close:n}},r))}wP.displayName="@mantine/core/TooltipGroup";function BM(e){var P,E,T;const[t,n]=m.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=zM(),s=Mn(),{delay:l,currentId:c,setCurrentId:u}=aj(),d=m.useCallback(_=>{n(_),_&&u(s)},[u,s]),{x:f,y:h,context:p,refs:g,update:v,placement:S,middlewareData:{arrow:{x:y,y:x}={}}}=Iv({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:[tj(e.offset),kv({padding:8}),Dp(),nj({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[Ip()]:[]]}),{getReferenceProps:w,getFloatingProps:b}=e4([GN(p,{enabled:(P=e.events)==null?void 0:P.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((E=e.events)!=null&&E.touch)}),ZN(p,{enabled:(T=e.events)==null?void 0:T.focus,visibleOnly:!0}),n4(p,{role:"tooltip"}),JN(p,{enabled:typeof e.opened>"u"}),KN(p,{id:s})]);mj({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),Po(()=>{var _;(_=e.onPositionChange)==null||_.call(e,S)},[S]);const j=o&&c&&c!==s;return{x:f,y:h,arrowX:y,arrowY:x,reference:g.setReference,floating:g.setFloating,getFloatingProps:b,getReferenceProps:w,isGroupPhase:j,opened:o,placement:S}}const iw={position:"top",refProp:"ref",withinPortal:!0,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Hr("popover"),positionDependencies:[]},UM=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:St(t),"--tooltip-bg":n?wt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Ja=X((e,t)=>{const n=U("Tooltip",iw,e),{children:r,position:o,refProp:i,label:s,openDelay:l,closeDelay:c,onPositionChange:u,opened:d,withinPortal:f,radius:h,color:p,classNames:g,styles:v,unstyled:S,style:y,className:x,withArrow:w,arrowSize:b,arrowOffset:j,arrowRadius:P,arrowPosition:E,offset:T,transitionProps:_,multiline:R,events:O,zIndex:I,disabled:M,positionDependencies:F,onClick:N,onMouseEnter:A,onMouseLeave:D,inline:k,variant:L,keepMounted:B,vars:H,portalProps:J,mod:we,floatingStrategy:ie,...Ce}=U("Tooltip",iw,n),{dir:_e}=Ua(),Pe=m.useRef(null),ue=BM({position:lj(_e,o),closeDelay:c,openDelay:l,onPositionChange:u,opened:d,events:O,arrowRef:Pe,arrowOffset:j,offset:typeof T=="number"?T+(w?b/2:0):T,positionDependencies:[...F,r],inline:k,strategy:ie}),Ue=me({name:"Tooltip",props:n,classes:Zf,className:x,style:y,classNames:g,styles:v,unstyled:S,rootSelector:"tooltip",vars:H,varsResolver:UM});if(!Oo(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 bt=Qt(ue.reference,r.ref,t),at=MM(_,{duration:100,transition:"fade"});return C.createElement(C.Fragment,null,C.createElement(Ss,{...J,withinPortal:f},C.createElement(zo,{...at,keepMounted:B,mounted:!M&&!!ue.opened,duration:ue.isGroupPhase?10:at.duration},ve=>C.createElement(G,{...Ce,variant:L,mod:[{multiline:R},we],...ue.getFloatingProps({ref:ue.floating,className:Ue("tooltip").className,style:{...Ue("tooltip").style,...ve,zIndex:I,top:ue.y??0,left:ue.x??0}})},s,C.createElement(Av,{ref:Pe,arrowX:ue.arrowX,arrowY:ue.arrowY,visible:w,position:ue.placement,arrowSize:b,arrowOffset:j,arrowRadius:P,arrowPosition:E,...Ue("arrow")})))),m.cloneElement(r,ue.getReferenceProps({onClick:N,onMouseEnter:A,onMouseLeave:D,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[i]:bt,className:rt(x,r.props.className),...r.props})))});Ja.classes=Zf;Ja.displayName="@mantine/core/Tooltip";Ja.Floating=Py;Ja.Group=wP;function HM({size:e,thickness:t,sum:n,value:r,root:o,offset:i}){const s=(e*.9-t*2)/2,l=Math.PI*s*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:s||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:c,strokeDashoffset:o?0:i||0}}function SP({size:e,value:t,offset:n,sum:r,thickness:o,root:i,color:s,lineRoundCaps:l,tooltip:c,getStyles:u,display:d,...f}){const h=$t();return C.createElement(Ja.Floating,{disabled:!c,label:c},C.createElement(G,{component:"circle",...f,...u("curve"),__vars:{"--curve-color":s?wt(s,h):void 0},fill:"none",strokeLinecap:l?"round":"butt",...HM({sum:r,size:e,thickness:o,value:t,offset:n,root:i})}))}SP.displayName="@mantine/core/Curve";function WM({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const i=n.reduce((d,f)=>d+f.value,0),s=Math.PI*((e*.9-t*2)/2)*2;let l=s;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*s;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 bP={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function qM(e,t){return Math.min(e||12,(t||120)/4)}const GM={size:120,thickness:12},QM=(e,{size:t,thickness:n})=>({root:{"--rp-size":V(t),"--rp-label-offset":V(n*2)}}),eh=X((e,t)=>{const n=U("RingProgress",GM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,label:u,sections:d,size:f,thickness:h,roundCaps:p,rootColor:g,...v}=n,S=me({name:"RingProgress",classes:bP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:QM}),y=qM(h,f),x=WM({size:f,thickness:y,sections:d,renderRoundedLineCaps:p,rootColor:g}).map(({data:w,sum:b,root:j,lineRoundCaps:P,offset:E},T)=>C.createElement(SP,{...w,key:T,size:f,thickness:y,sum:b,offset:E,color:w==null?void 0:w.color,root:j,lineRoundCaps:P,getStyles:S}));return C.createElement(G,{...S("root"),size:f,ref:t,...v},C.createElement("svg",{...S("svg")},x),u&&C.createElement("div",{...S("label")},u))});eh.classes=bP;eh.displayName="@mantine/core/RingProgress";var CP={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const KM={withItemsBorders:!0},YM=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:St(t),"--sc-color":n?wt(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":Oe(o,"sc-padding"),"--sc-font-size":nn(o)}}),Ty=X((e,t)=>{var _e,Pe;const n=U("SegmentedControl",KM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,data:u,value:d,defaultValue:f,onChange:h,size:p,name:g,disabled:v,readOnly:S,fullWidth:y,orientation:x,radius:w,color:b,transitionDuration:j,transitionTimingFunction:P,variant:E,autoContrast:T,withItemsBorders:_,mod:R,...O}=n,I=me({name:"SegmentedControl",props:n,classes:CP,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:YM}),M=$t(),F=u.map(ue=>typeof ue=="string"?{label:ue,value:ue}:ue),N=p_(),[A,D]=m.useState(null),[k,L]=m.useState({}),B=(ue,Ue)=>{k[Ue]=ue,L(k)},[H,J]=hn({value:d,defaultValue:f,finalValue:Array.isArray(u)?((_e=F.find(ue=>!ue.disabled))==null?void 0:_e.value)??((Pe=u[0])==null?void 0:Pe.value)??null:null,onChange:h}),we=Mn(g),ie=F.map(ue=>C.createElement(G,{...I("control"),mod:{active:H===ue.value,orientation:x},key:ue.value},C.createElement("input",{...I("input"),disabled:v||ue.disabled,type:"radio",name:we,value:ue.value,id:`${we}-${ue.value}`,checked:H===ue.value,onChange:()=>!S&&J(ue.value),"data-focus-ring":M.focusRing}),C.createElement(G,{component:"label",...I("label"),mod:{active:H===ue.value&&!(v||ue.disabled),disabled:v||ue.disabled,"read-only":S},htmlFor:`${we}-${ue.value}`,ref:Ue=>B(Ue,ue.value),__vars:{"--sc-label-color":b!==void 0?vs({color:b,theme:M,autoContrast:T}):void 0}},C.createElement("span",{...I("innerLabel")},ue.label)))),Ce=Qt(t,ue=>D(ue));return u.length===0?null:C.createElement(G,{...I("root"),variant:E,size:p,ref:Ce,mod:[{"full-width":y,orientation:x,initialized:N,"with-items-borders":_},R],...O,role:"radiogroup"},typeof H=="string"&&C.createElement(Lv,{target:k[H],parent:A,component:"span",transitionDuration:"var(--sc-transition-duration)",...I("indicator")}),ie)});Ty.classes=CP;Ty.displayName="@mantine/core/SegmentedControl";function XM({spacing:e,verticalSpacing:t,cols:n,selector:r}){var d;const o=$t(),i=t===void 0?e:t,s=gs({"--sg-spacing-x":cn(ci(e)),"--sg-spacing-y":cn(ci(i)),"--sg-cols":(d=ci(n))==null?void 0:d.toString()}),l=xt(o.breakpoints).reduce((f,h)=>(f[h]||(f[h]={}),typeof e=="object"&&e[h]!==void 0&&(f[h]["--sg-spacing-x"]=cn(e[h])),typeof i=="object"&&i[h]!==void 0&&(f[h]["--sg-spacing-y"]=cn(i[h])),typeof n=="object"&&n[h]!==void 0&&(f[h]["--sg-cols"]=n[h]),f),{}),u=Vl(xt(l),o).filter(f=>xt(l[f.value]).length>0).map(f=>({query:`(min-width: ${o.breakpoints[f.value]})`,styles:l[f.value]}));return C.createElement(Ba,{styles:s,media:u,selector:r})}var EP={root:"m_2415a157"};const JM={cols:1,spacing:"md"},ky=X((e,t)=>{const n=U("SimpleGrid",JM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,cols:u,verticalSpacing:d,spacing:f,...h}=n,p=me({name:"SimpleGrid",classes:EP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c}),g=Pc();return C.createElement(C.Fragment,null,C.createElement(XM,{...n,selector:`.${g}`}),C.createElement(G,{ref:t,...p("root",{className:g}),...h}))});ky.classes=EP;ky.displayName="@mantine/core/SimpleGrid";const ZM={},th=X((e,t)=>{const{w:n,h:r,miw:o,mih:i,...s}=U("Space",ZM,e);return C.createElement(G,{ref:t,...s,w:n,miw:o??n,h:r,mih:i??r})});th.displayName="@mantine/core/Space";var jP={root:"m_6d731127"};const eO={gap:"md",align:"stretch",justify:"flex-start"},tO=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":cn(t),"--stack-align":n,"--stack-justify":r}}),Ie=X((e,t)=>{const n=U("Stack",eO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,align:u,justify:d,gap:f,variant:h,...p}=n,g=me({name:"Stack",props:n,classes:jP,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:tO});return C.createElement(G,{ref:t,...g("root"),variant:h,...p})});Ie.classes=jP;Ie.displayName="@mantine/core/Stack";const[nO,rO]=Nn("Stepper component was not found in tree"),Bd=()=>null;Bd.displayName="@mantine/core/StepperCompleted";var Ry={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 Fu=(e,t)=>typeof e=="function"?C.createElement(e,{step:t||0}):e,oO={withIcon:!0,allowStepClick:!0,iconPosition:"left"},_y=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,step:l,state:c,color:u,icon:d,completedIcon:f,progressIcon:h,label:p,description:g,withIcon:v,iconSize:S,loading:y,allowStepClick:x,allowStepSelect:w,iconPosition:b,orientation:j,mod:P,...E}=U("StepperStep",oO,e),T=rO(),_=$t(),R={classNames:n,styles:i},O=c==="stepCompleted"?null:c==="stepProgress"?h:d,I={"data-progress":c==="stepProgress"||void 0,"data-completed":c==="stepCompleted"||void 0};return C.createElement(Dn,{...T.getStyles("step",{className:r,style:o,variant:T.orientation,...R}),mod:[{"icon-position":b||T.iconPosition,"allow-click":x},P],ref:t,...I,...E,__vars:{"--step-color":u?wt(u,_):void 0},tabIndex:x?0:-1},v&&C.createElement("span",{...T.getStyles("stepWrapper",R)},C.createElement("span",{...T.getStyles("stepIcon",R),...I},C.createElement(zo,{mounted:c==="stepCompleted",transition:"pop",duration:200},M=>C.createElement("span",{...T.getStyles("stepCompletedIcon",{style:M,...R})},y?C.createElement(Gn,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...T.getStyles("stepLoader",R)}):Fu(f,l)||C.createElement(Of,{size:"60%"}))),c!=="stepCompleted"?y?C.createElement(Gn,{...T.getStyles("stepLoader",R),size:"calc(var(--stepper-icon-size) / 2)",color:u}):Fu(O||d,l):null),j==="vertical"&&C.createElement("span",{...T.getStyles("verticalSeparator",R),"data-active":c==="stepCompleted"||void 0})),(p||g)&&C.createElement("span",{...T.getStyles("stepBody",R),"data-orientation":T.orientation,"data-icon-position":b||T.iconPosition},p&&C.createElement("span",{...T.getStyles("stepLabel",R)},Fu(p,l)),g&&C.createElement("span",{...T.getStyles("stepDescription",R)},Fu(g,l))))});_y.classes=Ry;_y.displayName="@mantine/core/StepperStep";const iO={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},sO=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:s})=>({root:{"--stepper-color":t?wt(t,e):void 0,"--stepper-icon-color":jc(s,e)?vs({color:t,theme:e}):void 0,"--stepper-icon-size":n===void 0?Oe(r,"stepper-icon-size"):V(n),"--stepper-content-padding":cn(o),"--stepper-radius":i===void 0?void 0:St(i),"--stepper-fz":nn(r),"--stepper-spacing":cn(r)}}),Na=X((e,t)=>{var D,k,L;const n=U("Stepper",iO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,onStepClick:d,active:f,icon:h,completedIcon:p,progressIcon:g,color:v,iconSize:S,contentPadding:y,orientation:x,iconPosition:w,size:b,radius:j,allowNextStepsSelect:P,wrap:E,...T}=n,_=me({name:"Stepper",classes:Ry,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:sO}),R=m.Children.toArray(u),O=R.filter(B=>B.type!==Bd),I=R.find(B=>B.type===Bd),M=O.reduce((B,H,J)=>{const we=f===J?"stepProgress":f>J?"stepCompleted":"stepInactive",Ce=typeof d!="function"?!1:typeof H.props.allowStepSelect=="boolean"?H.props.allowStepSelect:we==="stepCompleted"||P;return B.push(m.cloneElement(H,{icon:H.props.icon||h||J+1,key:J,step:J,state:we,onClick:()=>Ce&&(d==null?void 0:d(J)),allowStepClick:Ce,completedIcon:H.props.completedIcon||p,progressIcon:H.props.progressIcon||g,color:H.props.color||v,iconSize:S,radius:j,iconPosition:H.props.iconPosition||w,orientation:x,unstyled:l})),x==="horizontal"&&J!==O.length-1&&B.push(C.createElement("div",{..._("separator"),"data-active":J<f||void 0,"data-orientation":x,key:`separator-${J}`})),B},[]),F=(k=(D=O[f])==null?void 0:D.props)==null?void 0:k.children,N=(L=I==null?void 0:I.props)==null?void 0:L.children,A=f>O.length-1?N:F;return C.createElement(nO,{value:{getStyles:_,orientation:x,iconPosition:w}},C.createElement(G,{..._("root"),ref:t,size:b,...T},C.createElement(G,{..._("steps"),mod:{orientation:x,"icon-position":w,wrap:E&&x!=="vertical"}},M),A&&C.createElement("div",{..._("content")},A)))});Na.classes=Ry;Na.displayName="@mantine/core/Stepper";Na.Completed=Bd;Na.Step=_y;const PP=m.createContext(null),aO=PP.Provider,lO=()=>m.useContext(PP),cO={},Dy=X((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,readOnly:c,...u}=U("SwitchGroup",cO,e),[d,f]=hn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=p=>{const g=p.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return C.createElement(aO,{value:{value:d,onChange:h,size:i}},C.createElement(_t.Wrapper,{size:i,ref:t,...s,...u,labelElement:"div",__staticSelector:"SwitchGroup"},C.createElement(ey,{role:"group"},l)))});Dy.classes=_t.Wrapper.classes;Dy.displayName="@mantine/core/SwitchGroup";var TP={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const uO={labelPosition:"right"},dO=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:St(t),"--switch-height":Oe(r,"switch-height"),"--switch-width":Oe(r,"switch-width"),"--switch-thumb-size":Oe(r,"switch-thumb-size"),"--switch-label-font-size":Oe(r,"switch-label-font-size"),"--switch-track-label-padding":Oe(r,"switch-track-label-padding"),"--switch-color":n?wt(n,e):void 0}}),Bc=X((e,t)=>{const n=U("Switch",uO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,label:d,offLabel:f,onLabel:h,id:p,size:g,radius:v,wrapperProps:S,children:y,thumbIcon:x,checked:w,defaultChecked:b,onChange:j,labelPosition:P,description:E,error:T,disabled:_,variant:R,rootRef:O,mod:I,...M}=n,F=lO(),N=g||(F==null?void 0:F.size),A=me({name:"Switch",props:n,classes:TP,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:dO}),{styleProps:D,rest:k}=$o(M),L=Mn(p),B=F?{checked:F.value.includes(k.value),onChange:F.onChange}:{},[H,J]=hn({value:B.checked??w,defaultValue:b,finalValue:!1});return C.createElement(Mf,{...A("root"),__staticSelector:"Switch",__stylesApiProps:n,id:L,size:N,labelPosition:P,label:d,description:E,error:T,disabled:_,bodyElement:"label",labelElement:"span",classNames:r,styles:s,unstyled:l,"data-checked":B.checked||void 0,variant:R,ref:O,mod:I,...D,...S},C.createElement("input",{...k,disabled:_,checked:H,onChange:we=>{var ie;F?(ie=B.onChange)==null||ie.call(B,we):j==null||j(we),J(we.currentTarget.checked)},id:L,ref:t,type:"checkbox",role:"switch",...A("input")}),C.createElement(G,{"aria-hidden":"true",mod:{error:T,"label-position":P},...A("track")},C.createElement(G,{component:"span",mod:"reduce-motion",...A("thumb")},x),C.createElement("span",{...A("trackLabel")},H?h:f)))});Bc.classes={...TP,...Fj};Bc.displayName="@mantine/core/Switch";Bc.Group=Dy;const[fO,hO]=Nn("Table component was not found in the tree");var Uc={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 mO(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 js(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=X((o,i)=>{const s=U(n,{},o),{classNames:l,className:c,style:u,styles:d,...f}=s,h=hO();return C.createElement(G,{component:e,ref:i,...mO(h,t),...h.getStyles(e,{className:c,classNames:l,style:u,styles:d,props:s}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=Uc,r}const $p=js("th",{columnBorder:!0}),kP=js("td",{columnBorder:!0}),ad=js("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),RP=js("thead",{stickyHeader:!0}),_P=js("tbody"),DP=js("tfoot"),IP=js("caption",{captionSide:!0});function Iy({data:e}){return C.createElement(C.Fragment,null,e.caption&&C.createElement(IP,null,e.caption),e.head&&C.createElement(RP,null,C.createElement(ad,null,e.head.map((t,n)=>C.createElement($p,{key:n},t)))),e.body&&C.createElement(_P,null,e.body.map((t,n)=>C.createElement(ad,{key:n},t.map((r,o)=>C.createElement(kP,{key:o},r))))),e.foot&&C.createElement(DP,null,C.createElement(ad,null,e.foot.map((t,n)=>C.createElement($p,{key:n},t)))))}Iy.displayName="@mantine/core/TableDataRenderer";const pO={type:"scrollarea"},gO=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":V(t),"--table-overflow":n==="native"?"auto":void 0}}),Ay=X((e,t)=>{const n=U("TableScrollContainer",pO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,minWidth:d,type:f,...h}=n,p=me({name:"TableScrollContainer",classes:Uc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:gO,rootSelector:"scrollContainer"});return C.createElement(G,{component:f==="scrollarea"?Er:"div",...f==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...p("scrollContainer"),...h},C.createElement("div",{...p("scrollContainerInner")},u))});Ay.classes=Uc;Ay.displayName="@mantine/core/TableScrollContainer";const vO={withRowBorders:!0,verticalSpacing:7},yO=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:i,stripedColor:s,highlightOnHoverColor:l,striped:c,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":cn(r),"--table-vertical-spacing":cn(o),"--table-border-color":i?wt(i,e):void 0,"--table-striped-color":c&&s?wt(s,e):void 0,"--table-highlight-on-hover-color":u&&l?wt(l,e):void 0,"--table-sticky-header-offset":f?V(d):void 0}}),ce=X((e,t)=>{const n=U("Table",vO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,horizontalSpacing:u,verticalSpacing:d,captionSide:f,stripedColor:h,highlightOnHoverColor:p,striped:g,highlightOnHover:v,withColumnBorders:S,withRowBorders:y,withTableBorder:x,borderColor:w,layout:b,variant:j,data:P,children:E,stickyHeader:T,stickyHeaderOffset:_,mod:R,...O}=n,I=me({name:"Table",props:n,className:o,style:i,classes:Uc,classNames:r,styles:s,unstyled:l,rootSelector:"table",vars:c,varsResolver:yO});return C.createElement(fO,{value:{getStyles:I,stickyHeader:T,striped:g===!0?"odd":g||void 0,highlightOnHover:v,withColumnBorders:S,withRowBorders:y,captionSide:f||"bottom"}},C.createElement(G,{component:"table",variant:j,ref:t,mod:[{"data-with-table-border":x},R],...I("table"),...O},E||!!P&&C.createElement(Iy,{data:P})))});ce.classes=Uc;ce.displayName="@mantine/core/Table";ce.Td=kP;ce.Th=$p;ce.Tr=ad;ce.Thead=RP;ce.Tbody=_P;ce.Tfoot=DP;ce.Caption=IP;ce.ScrollContainer=Ay;ce.DataRenderer=Iy;const[xO,Ny]=Nn("Tabs component was not found in the tree");var Hc={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 wO={},My=X((e,t)=>{const n=U("TabsList",wO,e),{children:r,className:o,grow:i,justify:s,classNames:l,styles:c,style:u,mod:d,...f}=n,h=Ny();return C.createElement(G,{...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":s}},r)});My.classes=Hc;My.displayName="@mantine/core/TabsList";const SO={},Oy=X((e,t)=>{const n=U("TabsPanel",SO,e),{children:r,className:o,value:i,classNames:s,styles:l,style:c,mod:u,...d}=n,f=Ny(),h=f.value===i,p=f.keepMounted||n.keepMounted||h?r:null;return C.createElement(G,{...d,...f.getStyles("panel",{className:o,classNames:s,styles:l,style:[c,h?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:f.orientation},u],role:"tabpanel",id:f.getPanelId(i),"aria-labelledby":f.getTabId(i)},p)});Oy.classes=Hc;Oy.displayName="@mantine/core/TabsPanel";const bO={},$y=X((e,t)=>{const n=U("TabsTab",bO,e),{className:r,children:o,rightSection:i,leftSection:s,value:l,onClick:c,onKeyDown:u,disabled:d,color:f,style:h,classNames:p,styles:g,vars:v,mod:S,...y}=n,x=$t(),{dir:w}=Ua(),b=Ny(),j=l===b.value,P=T=>{b.onChange(b.allowTabDeactivation&&l===b.value?null:l),c==null||c(T)},E={classNames:p,styles:g,props:n};return C.createElement(Dn,{...y,...b.getStyles("tab",{className:r,style:h,variant:b.variant,...E}),disabled:d,unstyled:b.unstyled,variant:b.variant,mod:[{active:j,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":j,tabIndex:j||b.value===null?0:-1,"aria-controls":b.getPanelId(l),onClick:P,__vars:{"--tabs-color":f?wt(f,x):void 0},onKeyDown:ab({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:b.activateTabWithKeyboard,loop:b.loop,orientation:b.orientation||"horizontal",dir:w,onKeyDown:u})},s&&C.createElement("span",{...b.getStyles("tabSection",E),"data-position":"left"},s),o&&C.createElement("span",{...b.getStyles("tabLabel",E)},o),i&&C.createElement("span",{...b.getStyles("tabSection",E),"data-position":"right"},i))});$y.classes=Hc;$y.displayName="@mantine/core/TabsTab";const sw="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",CO={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},EO=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":St(t),"--tabs-color":wt(n,e),"--tabs-text-color":jc(r,e)?vs({color:n,theme:e}):void 0}}),et=X((e,t)=>{const n=U("Tabs",CO,e),{defaultValue:r,value:o,onChange:i,orientation:s,children:l,loop:c,id:u,activateTabWithKeyboard:d,allowTabDeactivation:f,variant:h,color:p,radius:g,inverted:v,placement:S,keepMounted:y,classNames:x,styles:w,unstyled:b,className:j,style:P,vars:E,autoContrast:T,mod:_,...R}=n,O=Mn(u),[I,M]=hn({value:o,defaultValue:r,finalValue:null,onChange:i}),F=me({name:"Tabs",props:n,classes:Hc,className:j,style:P,classNames:x,styles:w,unstyled:b,vars:E,varsResolver:EO});return C.createElement(xO,{value:{placement:S,value:I,orientation:s,id:O,loop:c,activateTabWithKeyboard:d,getTabId:Z0(`${O}-tab`,sw),getPanelId:Z0(`${O}-panel`,sw),onChange:M,allowTabDeactivation:f,variant:h,color:p,radius:g,inverted:v,keepMounted:y,unstyled:b,getStyles:F}},C.createElement(G,{ref:t,id:O,variant:h,mod:[{orientation:s,inverted:s==="horizontal"&&v,placement:s==="vertical"&&S},_],...F("root"),...R},l))});et.classes=Hc;et.displayName="@mantine/core/Tabs";et.Tab=$y;et.Panel=Oy;et.List=My;const jO={},fe=X((e,t)=>{const n=U("TextInput",jO,e);return C.createElement(Kn,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});fe.classes=Kn.classes;fe.displayName="@mantine/core/TextInput";var AP={root:"m_7341320d"};const PO={},TO=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:s});return{root:{"--ti-size":Oe(t,"ti-size"),"--ti-radius":n===void 0?void 0:St(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}}},Ly=X((e,t)=>{const n=U("ThemeIcon",PO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,autoContrast:u,...d}=n,f=me({name:"ThemeIcon",classes:AP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:TO});return C.createElement(G,{ref:t,...f("root"),...d})});Ly.classes=AP;Ly.displayName="@mantine/core/ThemeIcon";const kO=["h1","h2","h3","h4","h5","h6"];function RO(e,t){const n=t!==void 0?t:`h${e}`;return kO.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:{fontSize:V(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var NP={root:"m_8a5d1357"};const _O={order:1},DO=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=RO(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}}},ge=X((e,t)=>{const n=U("Title",_O,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,order:c,vars:u,size:d,variant:f,lineClamp:h,textWrap:p,mod:g,...v}=n,S=me({name:"Title",props:n,classes:NP,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:DO});return[1,2,3,4,5,6].includes(c)?C.createElement(G,{...S("root"),component:`h${c}`,variant:f,ref:t,mod:[{order:c,"data-line-clamp":typeof h=="number"},g],size:d,...v}):null});ge.classes=NP;ge.displayName="@mantine/core/Title";function IO(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 AO(e){return m.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}const NO=()=>IO({notifications:[],queue:[],limit:5}),Ps=NO(),MO=(e=Ps)=>AO(e);function Za(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]);e.setState({notifications:r.slice(0,n.limit),queue:r.slice(n.limit),limit:n.limit})}function xe(e,t=Ps){const n=e.id||wg();return Za(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function MP(e,t=Ps){return Za(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function kl(e,t=Ps){return Za(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function OO(e=Ps){Za(e,()=>[])}function $O(e=Ps){Za(e,t=>t.slice(0,e.getState().limit))}const ao={show:xe,hide:MP,update:kl,clean:OO,cleanQueue:$O,updateState:Za};function Lp(e,t){return Lp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Lp(e,t)}function OP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Lp(e,t)}var $P={exports:{}},LO="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",FO=LO,zO=FO;function LP(){}function FP(){}FP.resetWarningCache=LP;var VO=function(){function e(r,o,i,s,l,c){if(c!==zO){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:FP,resetWarningCache:LP};return n.PropTypes=n,n};$P.exports=VO();var BO=$P.exports;const dt=fg(BO),aw={disabled:!1},Ud=C.createContext(null);var UO=function(t){return t.scrollTop},Rl="unmounted",zi="exited",Vi="entering",Qs="entered",Fp="exiting",Uo=function(e){OP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=o,l=s&&!s.isMounting?r.enter:r.appear,c;return i.appearStatus=null,r.in?l?(c=zi,i.appearStatus=Vi):c=Qs:r.unmountOnExit||r.mountOnEnter?c=Rl:c=zi,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===Rl?{status:zi}: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 s=this.state.status;this.props.in?s!==Vi&&s!==Qs&&(i=Vi):(s===Vi||s===Qs)&&(i=Fp)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,s,l;return i=s=l=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,l=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:l}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Vi){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:aa.findDOMNode(this);s&&UO(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===zi&&this.setState({status:Rl})},n.performEnter=function(o){var i=this,s=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[aa.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!o&&!s||aw.disabled){this.safeSetState({status:Qs},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Vi},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Qs},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),l=this.props.nodeRef?void 0:aa.findDOMNode(this);if(!i||aw.disabled){this.safeSetState({status:zi},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Fp},function(){o.props.onExiting(l),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:zi},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,s=!0;return this.nextCallback=function(l){s&&(s=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:aa.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!s||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[s,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===Rl)return null;var i=this.props,s=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=cy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return C.createElement(Ud.Provider,{value:null},typeof s=="function"?s(o,l):C.cloneElement(C.Children.only(s),l))},t}(C.Component);Uo.contextType=Ud;Uo.propTypes={};function Vs(){}Uo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vs,onEntering:Vs,onEntered:Vs,onExit:Vs,onExiting:Vs,onExited:Vs};Uo.UNMOUNTED=Rl;Uo.EXITED=zi;Uo.ENTERING=Vi;Uo.ENTERED=Qs;Uo.EXITING=Fp;function HO(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fy(e,t){var n=function(i){return t&&m.isValidElement(i)?t(i):i},r=Object.create(null);return e&&m.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function WO(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 s,l={};for(var c in t){if(r[c])for(s=0;s<r[c].length;s++){var u=r[c][s];l[r[c][s]]=n(u)}l[c]=n(c)}for(s=0;s<o.length;s++)l[o[s]]=n(o[s]);return l}function Ki(e,t,n){return n[t]!=null?n[t]:e.props[t]}function qO(e,t){return Fy(e.children,function(n){return m.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Ki(n,"appear",e),enter:Ki(n,"enter",e),exit:Ki(n,"exit",e)})})}function GO(e,t,n){var r=Fy(e.children),o=WO(t,r);return Object.keys(o).forEach(function(i){var s=o[i];if(m.isValidElement(s)){var l=i in t,c=i in r,u=t[i],d=m.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=m.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:Ki(s,"exit",e),enter:Ki(s,"enter",e)}):!c&&l&&!d?o[i]=m.cloneElement(s,{in:!1}):c&&l&&m.isValidElement(u)&&(o[i]=m.cloneElement(s,{onExited:n.bind(null,s),in:u.props.in,exit:Ki(s,"exit",e),enter:Ki(s,"enter",e)}))}}),o}var QO=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},KO={component:"div",childFactory:function(t){return t}},zy=function(e){OP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=i.handleExited.bind(HO(i));return i.state={contextValue:{isMounting:!0},handleExited:s,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 s=i.children,l=i.handleExited,c=i.firstRender;return{children:c?qO(o,l):GO(o,s,l),firstRender:!1}},n.handleExited=function(o,i){var s=Fy(this.props.children);o.key in s||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=Vd({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,i=o.component,s=o.childFactory,l=cy(o,["component","childFactory"]),c=this.state.contextValue,u=QO(this.state.children).map(s);return delete l.appear,delete l.enter,delete l.exit,i===null?C.createElement(Ud.Provider,{value:c},u):C.createElement(Ud.Provider,{value:c},C.createElement(i,l,u))},t}(C.Component);zy.propTypes={};zy.defaultProps=KO;const lw={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},YO={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function XO({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,i]=n.split("-"),s=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:lw[s],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:YO[s]},u={opacity:0,maxHeight:0,transform:lw[s]};return{...l,...{entering:c,entered:c,exiting:u,exited:u}[e]}}function JO(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const zP=m.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:s,...l}=e,c=JO(n,e.autoClose),u=m.useRef(),d=()=>window.clearTimeout(u.current),f=()=>{t(e.id),d()},h=()=>{typeof c=="number"&&(u.current=window.setTimeout(f,c))};return m.useEffect(()=>{var p;(p=e.onOpen)==null||p.call(e,e)},[]),m.useEffect(()=>(h(),d),[c]),C.createElement(Sy,{...r,...l,onClose:f,ref:o,onMouseEnter:d,onMouseLeave:h},s)});zP.displayName="@mantine/notifications/NotificationContainer";var VP={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const ZO=Uo,e$={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Hr("overlay"),store:Ps,withinPortal:!0},t$=(e,{zIndex:t,position:n,containerWidth:r})=>{const[o,i]=n.split("-");return{root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-top":o==="top"?"var(--mantine-spacing-md)":void 0,"--notifications-bottom":o==="bottom"?"var(--mantine-spacing-md)":void 0,"--notifications-left":i==="left"?"var(--mantine-spacing-md)":i==="center"?"50%":void 0,"--notifications-right":i==="right"?"var(--mantine-spacing-md)":void 0,"--notifications-transform":i==="center"?"translateX(-50%)":void 0,"--notifications-container-width":V(r)}}},Ho=X((e,t)=>{const n=U("Notifications",e$,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,position:u,autoClose:d,transitionDuration:f,containerWidth:h,notificationMaxHeight:p,limit:g,zIndex:v,store:S,portalProps:y,withinPortal:x,...w}=n,b=$t(),j=MO(S),P=a_(),E=Sg(),T=m.useRef({}),_=m.useRef(0),O=(b.respectReducedMotion?E:!1)?1:f,I=me({name:"Notifications",classes:VP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:t$});m.useEffect(()=>{S==null||S.updateState(F=>({...F,limit:g||5}))},[g]),Po(()=>{j.notifications.length>_.current&&setTimeout(()=>P(),0),_.current=j.notifications.length},[j.notifications]);const M=j.notifications.map(({style:F,...N})=>C.createElement(ZO,{key:N.id,timeout:O,onEnter:()=>T.current[N.id].offsetHeight,nodeRef:{current:T.current[N.id]}},A=>C.createElement(zP,{ref:D=>{T.current[N.id]=D},data:N,onHide:D=>MP(D,S),autoClose:d,...I("notification",{style:{...XO({state:A,position:u,transitionDuration:O,maxHeight:p}),...F}})})));return C.createElement(Ss,{withinPortal:x,...y},C.createElement(G,{...I("root"),ref:t,...w},C.createElement(zy,null,M)))});Ho.classes=VP;Ho.displayName="@mantine/notifications/Notifications";Ho.show=ao.show;Ho.hide=ao.hide;Ho.update=ao.update;Ho.clean=ao.clean;Ho.cleanQueue=ao.cleanQueue;Ho.updateState=ao.updateState;class n${constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Wc{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class r${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 s=o.consumeAndParse(n);return r(i,s)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,i,s){const l=o.consumeAndParse(n);return r(i,s,l)},precedence:n})}construct(t){return new o$(t,this.prefixParselets,this.infixParselets)}}class o${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 i$="http://hl7.org",BP="ok",s$="created",a$="gone",l$="not-modified",c$="not-found",u$="forbidden",d$="accepted",f$={resourceType:"OperationOutcome",id:BP,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},h$={resourceType:"OperationOutcome",id:c$,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},UP={resourceType:"OperationOutcome",id:u$,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Si(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},expression:t?[t]:void 0}]}}function jt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function m$(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function nh(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function HP(e){return e.id===BP||e.id===s$||e.id===l$||e.id===d$}function p$(e){return e.id===a$}class We extends Error{constructor(t,n){super(WP(t)),this.outcome=t,this.cause=n}}function ht(e){return e instanceof We?e.outcome:nh(e)?e:Si($e(e))}function $e(e){return e?typeof e=="string"?e:e instanceof Error?e.message:nh(e)?WP(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function WP(e){var n;const t=((n=e.issue)==null?void 0:n.map(qP))??[];return t.length>0?t.join("; "):"Unknown error"}function qP(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 g$(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 v$(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,i])=>[o,g$(o,i)])),constraints:[],innerTypes:[]};return t}const y$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},x$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},w$={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"}]}}},S$={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"}]}}},b$={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"}]}}},C$={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"}]}}},E$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},j$={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"}]}}},P$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},T$={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"}]}}},k$={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"}]}}},R$={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"}]}}},_$={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"}]}}},D$={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"}]}}},I$={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"]}]}}},A$={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"}]}}},N$={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"}]}}},M$={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"}]}}},O$={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"}]}}},$$={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"}]}}},L$={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"]}]}}},F$={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"}]}}},z$={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"}]},account:{type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},V$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},B$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},U$={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"]}]}}},H$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},W$={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"}]}}},q$={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"}]}}},G$={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"}]}}},Q$={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"}]}}},K$={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"]}]}}},Y$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},X$={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"}]}}},J$={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"]}]}}},Z$={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"}]}}},eL={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"}]}}},tL={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"}]}}},nL={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"}]}}},rL={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"}]}}},oL={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"]}]}}},iL={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"}]}}},sL={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"}]}}},aL={elements:{id:{type:[{code:"string"}]},meta:{type:[{code:"Meta"}]},implicitRules:{type:[{code:"uri"}]},language:{type:[{code:"code"}]},text:{type:[{code:"Narrative"}]},contained:{max:9007199254740991,type:[{code:"Resource"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},url:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},name:{type:[{code:"string"}]},title:{type:[{code:"string"}]},status:{min:1,type:[{code:"code"}]},experimental:{type:[{code:"boolean"}]},date:{type:[{code:"dateTime"}]},publisher:{type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]},description:{type:[{code:"markdown"}]},useContext:{max:9007199254740991,type:[{code:"UsageContext"}]},jurisdiction:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},lL={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"}]}}},cL={Element:y$,BackboneElement:x$,Address:w$,Age:S$,Annotation:b$,Attachment:C$,CodeableConcept:E$,Coding:j$,ContactDetail:P$,ContactPoint:T$,Contributor:k$,Count:R$,DataRequirement:_$,Distance:D$,Dosage:I$,Duration:A$,ElementDefinition:N$,Expression:M$,Extension:O$,HumanName:$$,Identifier:L$,MarketingStatus:F$,Meta:z$,Money:V$,Narrative:B$,ParameterDefinition:U$,Period:H$,Population:W$,ProdCharacteristic:q$,ProductShelfLife:G$,Quantity:Q$,Range:K$,Ratio:Y$,Reference:X$,RelatedArtifact:J$,SampledData:Z$,Signature:eL,SubstanceAmount:tL,Timing:nL,TriggerDefinition:rL,UsageContext:oL,MoneyQuantity:iL,SimpleQuantity:sL,MetadataResource:aL,IdentityProvider:lL};function uL(e){return new dL(e).parse()}const GP=v$(cL),Vy=Object.create(null),cw=Object.create(null);function zp(e){let t;return e?(t=cw[e],t||(t=cw[e]=Object.create(null))):t=GP,t}function uw(e,t){var r;const n=Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(o=>o.resource))??[];for(const o of n)QP(o,t)}function QP(e,t){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const n=uL(e),r=zp(t);r[e.name]=n,t&&e.url===t&&(Vy[t]=n);for(const o of n.innerTypes)o.parentType=n,r[o.name]=o}function KP(e){return!!GP[e]}function rh(e,t){let n=zp(t)[e];return!n&&t&&(n=zp()[e]),n}function YP(e,t){const n=rh(e,t);if(!n)throw new We(Si("Unknown data type: "+e));return n}function By(e){return!!Vy[e]}function Ts(e){return Vy[e]}class dL{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,title:t.title,type:t.type,url:t.url,kind:t.kind,description:mL(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,o,i,s;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=mm(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[mm(t,c.path)]=l;break}c=c.parent}if(!c){const u=mm(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((s=this.resourceSchema.mandatoryProperties)==null||s.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),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var n,r,o;for(;this.backboneContext&&!Bs((n=this.backboneContext)==null?void 0:n.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;this.backboneContext={type:{name:xw(t),title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:Bs((r=this.backboneContext)==null?void 0:r.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,n){var r,o,i,s;hL(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:(s=t.slicing)==null?void 0:s.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){var n;if(this.backboneContext&&!Bs(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&&!Bs(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0;this.slicingContext&&!Bs(this.slicingContext.path,t==null?void 0:t.path)&&((n=this.slicingContext)!=null&&n.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext=void 0)}next(){const t=this.peek();if(t)return this.index++,t}peek(){var n,r,o,i,s;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)??((s=c.base)==null?void 0:s.max)??c.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(Bs(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.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext.current={name:t.sliceName??"",path:t.path??"",definition:t.definition,type:this.parseElementDefinitionType(t),elements:{},min:t.min??0,max:t.max==="*"?Number.POSITIVE_INFINITY:Number.parseInt(t.max,10),binding:t.binding}}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var o;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=xw(t)),r||(r=(o=qc(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,s;const n=dw(t.max),r=(i=t.base)!=null&&i.max?dw(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((s=t.base)==null?void 0:s.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:fw(fn(o,"fixed[x]")),pattern:fw(fn(o,"pattern[x]")),binding:t.binding}}}function dw(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function mm(e,t=""){return fL(e.path,t)}function fL(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Bs(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function fw(e){return Array.isArray(e)&&e.length>0?e[0]:Vt(e)?void 0:e}function hL(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 mL(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 pL(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?gL:fn,[o,...i]=t.split(".");let s=[r(e,o,n)];for(const l of i){const c=[];for(const u of s)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));s=c}return s}function gL(e,t,n){const r=e.path;return vL(fn(e,t,n),r,t)}function vL(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 XP={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 yL(e,t){const n=Array.isArray(e)?e.map(r=>({type:r.type,value:r.value})):{type:e.type,value:e.value};return!(t.pattern&&!Hy(n,t.pattern)||t.fixed&&!Gc(n,t.fixed))}function xL(e,t,n,r){if(Array.isArray(e))return!1;const o=(r??n.elements)[t.path],i=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(yL(e,o))return!0;break;case"type":return!e||!(i!=null&&i.length)?!1:i.some(s=>s.code===e.type)}return!1}function Te(e){return[{type:W.boolean,value:e}]}function fo(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}:xr(e)?{type:W.Quantity,value:e}:Wo(e)?{type:e.resourceType,value:e}:{type:W.BackboneElement,value:e}}function fi(e){return e.length===0?!1:!!e[0].value}function Io(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 fn(e,t,n){if(!e.value)return;const r=Rs(e.type,t,n==null?void 0:n.profileUrl);return r?JP(e,t,r):wL(e,t)}function JP(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let i,s="undefined",l;if(n.path.endsWith("[x]")){const c=n.path.split(".").pop().replace("[x]","");for(const u of o){const d=c+Gt(u.code);if(i=r[d],l=r["_"+d],i!==void 0||l!==void 0){s=u.code;break}}}else console.assert(o.length===1,"Expected single type",n.path),i=r[t],s=o[0].code,l=r["_"+t];if(l)if(Array.isArray(i)){i=i.slice();for(let c=0;c<Math.max(i.length,l.length);c++)i[c]=gw(i[c],l[c])}else i=gw(i,l);if(!Vt(i))return(s==="Element"||s==="BackboneElement")&&(s=n.type[0].code),Array.isArray(i)?i.map(c=>hw(c,s)):hw(i,s)}function hw(e,t){return t==="Resource"&&Wo(e)&&(t=e.resourceType),{type:t,value:e}}function wL(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+Gt(o);if(i in n){r=n[i];break}}if(!Vt(r))return Array.isArray(r)?r.map(fo):fo(r)}function ZP(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(fi(nT(n,o))){r=!0;break}r||t.push(n)}return t}function eT(e){return Te(!fi(e))}function tT(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Te(!1):Te(e.every((n,r)=>fi(nT(n,t[r]))))}function nT(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):xr(n)&&xr(r)?Te(iT(n,r)):Te(typeof n=="object"&&typeof r=="object"?Uy(e,t):n===r)}function rT(e,t){return e.length===0&&t.length===0?Te(!0):e.length!==t.length?Te(!1):(e.sort(mw),t.sort(mw),Te(e.every((n,r)=>fi(SL(n,t[r])))))}function SL(e,t){const{type:n,value:r}=e,{type:o,value:i}=t,s=r==null?void 0:r.valueOf(),l=i==null?void 0:i.valueOf();return typeof s=="number"&&typeof l=="number"?Te(Math.abs(s-l)<.01):xr(s)&&xr(l)?Te(iT(s,l)):Te(n==="Coding"&&o==="Coding"?typeof s!="object"||typeof l!="object"?!1:s.code===l.code&&s.system===l.system:typeof s=="object"&&typeof l=="object"?Uy({...s,id:void 0},{...l,id:void 0}):typeof s=="string"&&typeof l=="string"?s.toLowerCase()===l.toLowerCase():s===l)}function mw(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 oT(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 bL(n);case"DateTime":return Vp(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return CL(n);case"Quantity":return xr(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function bL(e){return typeof e=="string"&&!!XP.date.exec(e)}function Vp(e){return typeof e=="string"&&!!XP.dateTime.exec(e)}function CL(e){return!!(e&&typeof e=="object"&&("start"in e&&Vp(e.start)||"end"in e&&Vp(e.end)))}function xr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function iT(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 Uy(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],s=t[o];if(pw(i)&&pw(s)){if(!Uy(i,s))return!1}else if(i!==s)return!1}return!0}function pw(e){return e!==null&&typeof e=="object"}function gw(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return EL(e??{},t)}return e}function EL(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function vt(e){const t=yt(e),n=Ao(e);return n===t?{reference:t}:{reference:t,display:n}}function yt(e){return _s(e)?e.reference:`${e.resourceType}/${e.id}`}function oh(e){if(e)return _s(e)?e.reference.split("/")[1]:e.id}function jL(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Ao(e){if(jL(e)){const t=PL(e);if(t)return t}if(e.resourceType==="Device"){const t=TL(e);if(t)return t}if(e.resourceType==="MedicationRequest"){const t=e.medicationCodeableConcept;if(t)return Ti(t)}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]),$L(t))return Ti(t);if(LL(t))return t.text}return yt(e)}function PL(e){const t=e.name;if(t&&t.length>0)return Qc(t[0])}function TL(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function kL(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=vw(n);if(r)return r}else return vw(t)}function vw(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function sT(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(),s=n.getUTCDate(),l=r.getUTCFullYear(),c=r.getUTCMonth(),u=r.getUTCDate();let d=l-o;(c<i||c===i&&u<s)&&d--;let f=l*12+c-(o*12+i);u<s&&f--;const h=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:d,months:f,days:h}}function RL(e,t){const{years:n,months:r,days:o}=sT(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 qc(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 ir(e,t){return JSON.stringify(e,_L,t?2:void 0)}function _L(e,t){return!DL(e)&&Vt(t)?void 0:t}function DL(e){return!!/\d+$/.exec(e)}function Vt(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!zt(e):!1}function zt(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 Gc(e,t,n){return e===t||Vt(e)&&Vt(t)?!0:Vt(e)||Vt(t)?!1:Array.isArray(e)&&Array.isArray(t)?IL(e,t):Array.isArray(e)||Array.isArray(t)?!1:wn(e)&&wn(t)?AL(e,t,n):(wn(e)||wn(t),!1)}function IL(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Gc(e[n],t[n]))return!1;return!0}function AL(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],s=t[o];if(!Gc(i,s,o))return!1}return!0}function Hy(e,t){return Vt(e)?!0:Vt(t)?!1:Array.isArray(e)&&Array.isArray(t)?NL(e,t):Array.isArray(e)||Array.isArray(t)?!1:wn(e)&&wn(t)?ML(e,t):wn(e)||wn(t)?!1:e===t}function NL(e,t){return t.every(n=>e.some(r=>Hy(r,n)))}function ML(e,t){return Object.entries(t).every(([n,r])=>n in e&&Hy(e[n],r))}function ho(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function aT(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function wn(e){return e!==null&&typeof e=="object"}function OL(e){return wn(e)&&"code"in e&&typeof e.code=="string"}function $L(e){return wn(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(OL)}function LL(e){return wn(e)&&"text"in e&&typeof e.text=="string"}const lT=[];for(let e=0;e<256;e++)lT.push(e.toString(16).padStart(2,"0"));function FL(e){const t=new Uint8Array(e),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=lT[t[r]];return n.join("")}function zL(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 Gt(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function Wy(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function fc(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function VL(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 BL(e){if(e)return Array.isArray(e)?e:[e]}const yw=e=>new Promise(t=>{setTimeout(t,e)});function UL(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 HL(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 hc(e){return e.sort((t,n)=>t.localeCompare(n))}function cT(e){return e.endsWith("/")?e:e+"/"}function WL(e){return e.startsWith("/")?e.slice(1):e}function yo(e,t){return new URL(WL(t),cT(e.toString())).toString()}function qL(e,t){return yo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function GL(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 QL(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 Qc(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=pc(e.text);if(r)return r}return n.join(" ").trim()}function ih(e){return e instanceof Date&&!isNaN(e.getTime())}function KL(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return ih(r)?r.toLocaleTimeString(t,n):""}function In(e,t,n){if(!e)return"";const r=new Date(e);return ih(r)?r.toLocaleString(t,n):""}function YL(e,t,n){return!e||!e.start&&!e.end?"":In(e.start,t,n)+" - "+In(e.end,t,n)}const XL={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},JL={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},ZL={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function uT(e){if(!e)return"";const t=[];return e7(t,e.repeat),e.event&&t.push(e.event.map(n=>In(n)).join(", ")),Gt(t.join(" ").trim())}function e7(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(XL[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+JL[o]):e.push("per "+r+" "+ZL[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Gt).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>KL(i)).join(", "))}function mc(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=r7(r.value,t),`> ${ri(r)}`):`>= ${ri(r)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=n7(o.value,t),`< ${ri(o)}`):`<= ${ri(o)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${ri(r)} - ${ri(o)}`)}function ri(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 t7(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Ti(e){if(!e)return"";const t=pc(e.text);return t||(e.coding?e.coding.map(n=>ks(n)).join(", "):"")}function ks(e){return pc(e==null?void 0:e.display)??pc(e==null?void 0:e.code)??""}function dT(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(ri(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Ti(e.valueCodeableConcept));else{const n=pc(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>dT(n)).join(" / ")),t.join(" / ").trim()}function pc(e){return typeof e=="string"?e:void 0}function n7(e,t,n=1){return(fT(e)+n)*Math.pow(10,-t)}function r7(e,t,n=1){return(fT(e)-n)*Math.pow(10,-t)}function fT(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 o7(e){for(const t of e.base??[]){let n=No.types[t];n||(n={searchParamsDetails:{}},No.types[t]=n),n.searchParams||(n.searchParams={_id:{base:[t],code:"_id",type:"token",expression:t+".id"},_lastUpdated:{base:[t],code:"_lastUpdated",type:"date",expression:t+".meta.lastUpdated"},_compartment:{base:[t],code:"_compartment",type:"reference",expression:t+".meta.compartment"},_profile:{base:[t],code:"_profile",type:"uri",expression:t+".meta.profile"},_security:{base:[t],code:"_security",type:"token",expression:t+".meta.security"},_source:{base:[t],code:"_source",type:"uri",expression:t+".meta.source"},_tag:{base:[t],code:"_tag",type:"token",expression:t+".meta.tag"}}),n.searchParams[e.code]=e}}function xw(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"?i7((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function i7(e){return e.length===1?e[0]:e.map(Gt).join("")}function qy(e){var t;return(t=No.types[e])==null?void 0:t.searchParams}function s7(e,t){var n,r;return(r=(n=No.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function ds(e){const t=e.replaceAll("[x]","").split(".").pop();return hT(t)}function hT(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(l7).join(" ").replace("_"," ").replace(/\s+/g," ")}const a7=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function l7(e){const t=e.toUpperCase();return e===t?e:a7.has(t)?t:t.charAt(0)+e.slice(1)}function Rs(e,t,n){const r=rh(e,n);if(r)return c7(r.elements,t)}function c7(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]",s=e[i];if(s)return s}}}function Wo(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function _s(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const No={types:{}};function ld(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 yl=()=>[],Ln={empty:(e,t)=>Te(t.length===0||t.every(n=>Vt(n.value))),hasValue:(e,t)=>Te(t.length!==0),exists:(e,t,n)=>Te(n?t.filter(r=>fi(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Vt(r.value))),all:(e,t,n)=>Te(t.every(r=>fi(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:yl,supersetOf:yl,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===Ln.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>fi(n.eval({parent:e,variables:{$this:r}},[r]))),select:(e,t,n)=>t.map(r=>n.eval(e,[r])).flat(),repeat:yl,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,t),o=[];for(const i of t)!o.some(s=>s.value===i.value)&&r.some(s=>s.value===i.value)&&o.push(i);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t),o=[];for(const i of t)r.some(s=>s.value===i.value)||o.push(i);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t);return ZP([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t);return[...t,...r]},htmlChecks:(e,t,n)=>[fo(!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 fi(i)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(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(Ln.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(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(Ln.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:W.date,value:ld(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Te(Ln.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:W.dateTime,value:ld(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Te(Ln.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(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(Ln.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return xr(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(Ln.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return n==null?[]:xr(n)?[{type:W.string,value:`${n.value} '${n.unit}'`}]:[{type:W.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Te(Ln.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:W.time,value:ld("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Te(Ln.toTime(e,t).length===1),indexOf:(e,t,n)=>ur((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>ur((o,i,s)=>{const l=i,c=s?l+s:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,n,r),startsWith:(e,t,n)=>ur((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>ur((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>ur((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>ur(n=>n.toUpperCase(),e,t),lower:(e,t)=>ur(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>ur((o,i,s)=>o.replaceAll(i,s),e,t,n,r),matches:(e,t,n)=>ur((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>ur((o,i,s)=>o.replaceAll(i,s),e,t,n,r),length:(e,t)=>ur(n=>n.length,e,t),toChars:(e,t)=>ur(n=>n?n.split(""):void 0,e,t),abs:(e,t)=>Jr(Math.abs,e,t),ceiling:(e,t)=>Jr(Math.ceil,e,t),exp:(e,t)=>Jr(Math.exp,e,t),floor:(e,t)=>Jr(Math.floor,e,t),ln:(e,t)=>Jr(Math.log,e,t),log:(e,t,n)=>Jr((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>Jr(Math.pow,e,t,n),round:(e,t)=>Jr(Math.round,e,t),sqrt:(e,t)=>Jr(Math.sqrt,e,t),truncate:(e,t)=>Jr(n=>n|0,e,t),children:yl,descendants:yl,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=Ln.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const s=Ln.toDateTime(e,r.eval(e,t));if(s.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=sT(i[0].value,s[0].value);return[{type:W.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,n)=>{let r="";return n instanceof Gy?r=n.name:n instanceof Ky&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:W.boolean,value:oT(o,r)})):[]},not:(e,t)=>Ln.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 fo(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,s]=o.split("/");return{type:i,value:{resourceType:i,id:s}}}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"}}:Wo(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 s;return{type:W.boolean,value:((s=i.value)==null?void 0:s.resourceType)===o}})}};function ur(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=to(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...r.map(s=>{var l;return(l=s==null?void 0:s.eval(t,n)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(fo):[fo(i)]}function Jr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=to(n,1),i=xr(o),s=i?o.value:o;if(typeof s!="number")throw new Error("Math function cannot be called with non-number");const l=e(s,...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 to(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}class u7{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}`)}}toString(){return this.child.toString()}}class Us{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Gy{constructor(t){this.name=t}eval(t,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 Wo(n)&&n.resourceType===this.name?t:fn(t,this.name)}toString(){return this.name}}class d7{eval(){return[]}toString(){return"{}"}}class f7 extends n${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 Qy extends Wc{constructor(t,n){super("as",t,n)}eval(t,n){return Ln.ofType(t,this.left.eval(t,n),this.right)}}class Yn extends Wc{}class Rr extends Yn{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,s=o[0].value,l=xr(i)?i.value:i,c=xr(s)?s.value:s,u=this.impl(l,c);return typeof u=="boolean"?Te(u):xr(i)?[{type:W.Quantity,value:{...i,value:u}}]:[fo(u)]}}class h7 extends Wc{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(s=>typeof s.value=="string")?[{type:W.string,value:i.map(s=>s.value).join("")}]:i}}class m7 extends Yn{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 p7 extends Yn{constructor(t,n){super("in",t,n)}eval(t,n){const r=Io(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Te(o.some(i=>i.value===r.value)):[]}}class Ky extends Wc{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 mT extends Wc{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return ZP([...r,...o])}}class g7 extends Yn{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return tT(r,o)}}class v7 extends Yn{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return eT(tT(r,o))}}class y7 extends Yn{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return rT(r,o)}}class x7 extends Yn{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return eT(rT(r,o))}}class Yy extends Yn{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(oT(r[0],o))}}class w7 extends Yn{constructor(t,n){super("and",t,n)}eval(t,n){const r=Io(this.left.eval(t,n),"boolean"),o=Io(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 S7 extends Yn{constructor(t,n){super("or",t,n)}eval(t,n){const r=Io(this.left.eval(t,n),"boolean"),o=Io(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 b7 extends Yn{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Io(this.left.eval(t,n),"boolean"),o=Io(this.right.eval(t,n),"boolean");return!r||!o?[]:Te(r.value!==o.value)}}class C7 extends Yn{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Io(this.left.eval(t,n),"boolean"),o=Io(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 Xy{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Ln[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 Jy{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 E7=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class j7{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;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()))));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()===" "&&P7(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 P7(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&E7.includes(e.value)))}const T7=["true","false"],k7=["!=","!~","<=",">=","{}","->"];function R7(e){return new j7(e,T7,k7).tokenize()}const it={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},_7={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}},D7={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new Jy(t,n)},precedence:it.Indexer},I7={parse(e,t){if(!(t instanceof Gy))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new Xy(t.name,n)},precedence:it.FunctionCall};function A7(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 N7(){return new r$().registerPrefix("String",{parse:(e,t)=>new Us({type:W.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Us({type:W.dateTime,value:ld(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Us({type:W.Quantity,value:A7(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Us({type:t.value.includes(".")?W.decimal:W.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Us({type:W.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Us({type:W.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Gy(t.value)}).registerPrefix("{}",{parse:()=>new d7}).registerPrefix("(",_7).registerInfix("[",D7).registerInfix("(",I7).prefix("+",it.UnaryAdd,(e,t)=>new f7("+",t,n=>n)).prefix("-",it.UnarySubtract,(e,t)=>new Rr("-",t,t,(n,r)=>-r)).infixLeft(".",it.Dot,(e,t,n)=>new Ky(e,n)).infixLeft("/",it.Divide,(e,t,n)=>new Rr("/",e,n,(r,o)=>r/o)).infixLeft("*",it.Multiply,(e,t,n)=>new Rr("*",e,n,(r,o)=>r*o)).infixLeft("+",it.Add,(e,t,n)=>new Rr("+",e,n,(r,o)=>r+o)).infixLeft("-",it.Subtract,(e,t,n)=>new Rr("-",e,n,(r,o)=>r-o)).infixLeft("|",it.Union,(e,t,n)=>new mT(e,n)).infixLeft("=",it.Equals,(e,t,n)=>new g7(e,n)).infixLeft("!=",it.NotEquals,(e,t,n)=>new v7(e,n)).infixLeft("~",it.Equivalent,(e,t,n)=>new y7(e,n)).infixLeft("!~",it.NotEquivalent,(e,t,n)=>new x7(e,n)).infixLeft("<",it.LessThan,(e,t,n)=>new Rr("<",e,n,(r,o)=>r<o)).infixLeft("<=",it.LessThanOrEquals,(e,t,n)=>new Rr("<=",e,n,(r,o)=>r<=o)).infixLeft(">",it.GreaterThan,(e,t,n)=>new Rr(">",e,n,(r,o)=>r>o)).infixLeft(">=",it.GreaterThanOrEquals,(e,t,n)=>new Rr(">=",e,n,(r,o)=>r>=o)).infixLeft("&",it.Ampersand,(e,t,n)=>new h7(e,n)).infixLeft("and",it.And,(e,t,n)=>new w7(e,n)).infixLeft("as",it.As,(e,t,n)=>new Qy(e,n)).infixLeft("contains",it.Contains,(e,t,n)=>new m7(e,n)).infixLeft("div",it.Divide,(e,t,n)=>new Rr("div",e,n,(r,o)=>r/o|0)).infixLeft("in",it.In,(e,t,n)=>new p7(e,n)).infixLeft("is",it.Is,(e,t,n)=>new Yy(e,n)).infixLeft("mod",it.Modulo,(e,t,n)=>new Rr("mod",e,n,(r,o)=>r%o)).infixLeft("or",it.Or,(e,t,n)=>new S7(e,n)).infixLeft("xor",it.Xor,(e,t,n)=>new b7(e,n)).infixLeft("implies",it.Implies,(e,t,n)=>new C7(e,n))}const M7=N7();function pT(e){return new u7(e,M7.construct(R7(e)).consumeAndParse())}function O7(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]=fo(n[r]))}return gc(e,n).map(r=>r.value)}function gc(e,t,n){const r=n??{};return pT(e).eval({variables:r},t).map(i=>{var s;return{type:i.type,value:(s=i.value)==null?void 0:s.valueOf()}})}var oi=(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))(oi||{});function sh(e,t){var r,o;let n=(o=(r=No.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=L7(e,t)),n}function $7(e,t,n){let r=No.types[e];r||(r={},No.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function L7(e,t){const n=t.code,r=V7(n),o=U7(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=Fl(l),u=HL(()=>c.join("."));c.length===1&&c[0]instanceof Yn?i.propertyTypes.add("boolean"):u().endsWith("extension.value.code")||u().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):gT(i,Fl(l),e,1),u().endsWith("extension.valueDateTime")&&(i.array=!1)}const s={columnName:r,type:B7(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return $7(e,n,s),s}function gT(e,t,n,r){const o=t[r];if(o instanceof Qy){e.propertyTypes.add(o.right.toString());return}if(o instanceof Xy){F7(e,o);return}const i=o.toString(),s=Rs(n,i);if(!s)throw new Error(`Element definition not found for ${n} ${i}`);let l=!1,c=r+1;if(c<t.length&&t[c]instanceof Jy&&(l=!0,c++),s.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(s);for(const u of s.type)e.propertyTypes.add(u.code);return}for(const u of s.type){let d=u.code;z7(d)&&(d=s.type[0].code),gT(e,t,d,c)}}function F7(e,t){if(t.name==="as"){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 Yy){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function z7(e){return e==="Element"||e==="BackboneElement"}function V7(e){return e.split("-").reduce((t,n,r)=>t+(r?Gt(n):n),"")}function B7(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 U7(e,t){const n=[],r=pT(t);return Bp(e,r.child,n),n}function Bp(e,t,n){t instanceof mT?(Bp(e,t.left,n),Bp(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function Fl(e){if(e instanceof Qy||e instanceof Jy)return[Fl(e.left),e].flat();if(e instanceof Yn)return[e];if(e instanceof Ky)return[Fl(e.left),Fl(e.right)].flat();if(e instanceof Xy){if(e.name==="where"&&!(e.args[0]instanceof Yy))return[];if(e.name==="last")return[]}return[e]}const ah=20;var ae=(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.IDENTIFIER="identifier",e.ITERATE="iterate",e))(ae||{});const vT={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"},Zy={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function H7(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[s,l]=e.split("?");n=s,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()),W7(o,i)}function W7(e,t){const n={resourceType:e};for(const[r,o]of t)q7(n,r,o);return n}function q7(e,t,n){var s,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":G7(e,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=ww(n);o==="iterate"&&(c.modifier="iterate"),e.include=vl(e.include,c);break}case"_revinclude":{const c=ww(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=(s=No.types[e.resourceType])==null?void 0:s.searchParams)==null?void 0:l[r];c?e.filters=vl(e.filters,Q7(c,o,n)):e.filters=vl(e.filters,X7(r,o,n))}}}}function G7(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 Q7(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":return K7(e,n);case"reference":case"string":case"token":case"uri":return Y7(e,t,n);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function K7(e,t){const{operator:n,value:r}=J7(t);return{code:e.code,operator:n,value:r}}function Y7(e,t,n){return{code:e.code,operator:Z7(t),value:n}}function X7(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 Zy&&(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 J7(e){const t=e.substring(0,2),n=Zy[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function Z7(e){return vT[e]??"eq"}function ww(e){const t=e.split(":");if(t.includes("*"))throw new We(Si("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new We(Si(`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 We(Si(`Invalid include value '${e}'`))}function la(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(e6(n))),e.sortRules&&e.sortRules.length>0&&t.push(t6(e.sortRules)),e.offset!==void 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(Sw("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(Sw("_revinclude",n))),t.length===0?"":(hc(t),"?"+t.join("&"))}function e6(e){const t=e.operator in vT?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in Zy?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function t6(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function Sw(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function n6(e){if(typeof window<"u")return window.atob(e);if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("binary");throw new Error("Unable to decode base64")}function r6(e){if(typeof window<"u")return window.btoa(e);if(typeof Buffer<"u")return Buffer.from(e,"binary").toString("base64");throw new Error("Unable to encode base64")}function bw(){const e=new Uint32Array(28);return crypto.getRandomValues(e),FL(e.buffer)}async function o6(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function yT(){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 xT(e){var o,i,s;const t={};e=ho(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]=yT(),l.fullUrl="urn:uuid:"+t[c],(s=l.resource)==null||delete s.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)=>i6(l,c,t),2);return s6(JSON.parse(r))}function i6(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 s6(e){const t=l6(e),{sorted:n,cycles:r}=a6(t),o={};for(const s of e.entry||[])s.fullUrl&&(o[s.fullUrl]=s);const i=n.map(s=>o[s]);for(const s of r)for(const l of s){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function a6(e){const t=[],n={},r=[];for(const i of Object.keys(e))n[i]=0;function o(i,s){if(n[i]===2)return!0;if(n[i]===1){const c=s.lastIndexOf(i);return c!==-1&&r.push(s.slice(c)),!0}n[i]=1,s.push(i);let l=!1;for(const c of e[i])o(c,s)||(l=!0);return n[i]=2,s.pop(),t.unshift(i),!l}for(const i in e)n[i]===0&&o(i,[]);return{sorted:t,cycles:r}}function wT(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(_s(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else wT(r,t)}}function l6(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&&wT(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class ST{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 en={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 bT{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 e0{constructor(){this.emitter=new bT}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 Up={"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"},c6=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],t0=["DiagnosticReport-update"];function u6(e){return t0.includes(e)}function d6(e){if(t0.includes(e))throw new We(jt(`'context.version' is required for '${e}'.`))}const f6={"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 h6(e){return c6.includes(e)}function CT(e){return!!e.endpoint}function Cw(e){if(!n0(e))throw new We(jt("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 CT(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function n0(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(!Up[i])return!1;return!(CT(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function Ew(e,t,n,r){if(typeof t!="object")throw new We(jt(`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 We(jt(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new We(jt(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!h6(t.resourceType))throw new We(jt(`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 We(jt(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function m6(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)Ew(e,t.resource,n,r);else{const{resources:i}=t;if(!i)throw new We(jt(`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 s of i)Ew(e,s,n,r)}}function p6(e,t){const n=new Map,r=f6[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new We(jt(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));m6(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new We(jt(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)||0)>1)throw new We(jt(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function jw(e,t,n,r){if(!(e&&typeof e=="string"))throw new We(jt("Must provide a topic."));if(!Up[t])throw new We(jt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Up).join(", ")}`));if(typeof n!="object")throw new We(jt("context must be a context object or array of context objects."));if(t0.includes(t)&&!r)throw new We(jt(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return p6(t,o),{timestamp:new Date().toISOString(),id:yT(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class g6 extends e0{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new We(jt("Subscription request should contain an endpoint."));if(!n0(t))throw new We(jt("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 v6(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=n6(t),r=Array.from(n).reduce((i,s)=>{const l=("00"+s.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(r);return JSON.parse(o)}function y6(e){return e.split(".").length===3}function r0(e){const[t,n,r]=e.split(".");return v6(n)}function x6(e){try{return typeof r0(e).login_id=="string"}catch{return!1}}function w6(e){try{const n=r0(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class S6{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)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var Pw;class _r{constructor(t){this[Pw]="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)}}Pw=Symbol.toStringTag;class b6{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new C6)}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?ir(n):void 0)}}class C6{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]}}class E6 extends e0{constructor(t){super(),this.bufferedAmount=-1/0,this.extensions="NOT_IMPLEMENTED",this.messageBuffer=[];const n=new WebSocket(t);n.addEventListener("open",()=>{if(this.messageBuffer.length){const r=this.messageBuffer;for(const o of r)n.send(o)}this.dispatchEvent(new Event("open"))}),n.addEventListener("error",r=>{this.dispatchEvent(r)}),n.addEventListener("message",r=>{this.dispatchEvent(r)}),n.addEventListener("close",r=>{this.dispatchEvent(r)}),this.ws=n}get readyState(){return this.ws.readyState}close(){this.ws.close()}send(t){if(this.ws.readyState!==WebSocket.OPEN){this.messageBuffer.push(t);return}try{this.ws.send(t)}catch(n){this.dispatchEvent(new ErrorEvent("error",{error:n,message:n.message})),this.messageBuffer.push(t)}}}class Hp extends e0{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 j6{constructor(t){this.criteria=t,this.emitter=new Hp(t),this.refCount=1}}class P6{constructor(t,n,r){if(!(t instanceof ET))throw new We(jt("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new We(jt("Not a valid URL"))}const i=r!=null&&r.RobustWebSocket?new r.RobustWebSocket(o):new E6(o);this.medplum=t,this.ws=i,this.masterSubEmitter=new Hp,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.setupWebSocketListeners()}setupWebSocketListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,o,i,s,l;try{const c=JSON.parse(n.data),u=(o=(r=c==null?void 0:c.entry)==null?void 0:r[0])==null?void 0:o.resource;if(u.type==="heartbeat"){(i=this.masterSubEmitter)==null||i.dispatchEvent({type:"heartbeat",payload:c});return}(s=this.masterSubEmitter)==null||s.dispatchEvent({type:"message",payload:c});const d=this.criteriaEntriesBySubscriptionId.get(oh(u.subscription));if(!d){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}d.emitter.dispatchEvent({type:"message",payload:c})}catch(c){console.error(c);const u={type:"error",payload:c};(l=this.masterSubEmitter)==null||l.dispatchEvent(u);for(const{emitter:d}of this.criteriaEntries.values())d.dispatchEvent(u)}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new We(m$(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const{emitter:o}of this.criteriaEntries.values())o.dispatchEvent(n)}),t.addEventListener("close",()=>{var r;const n={type:"close"};this.wsClosed&&((r=this.masterSubEmitter)==null||r.dispatchEvent(n));for(const{emitter:o}of this.criteriaEntries.values())o.dispatchEvent(n)})}emitConnect(t){var r;const n={type:"connect",payload:{subscriptionId:t}};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const{emitter:o}of this.criteriaEntries.values())o.dispatchEvent(n)}emitError(t,n){var o,i,s;const r={type:"error",payload:n};(o=this.masterSubEmitter)==null||o.dispatchEvent(r),(s=(i=this.criteriaEntries.get(t))==null?void 0:i.emitter)==null||s.dispatchEvent(r)}async getTokenForCriteria(t){var s,l;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${yt(this.medplum.getProfile())}`,criteria:t.criteria,channel:{type:"websocket"}})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),o=(s=r==null?void 0:r.find(c=>c.name==="token"))==null?void 0:s.valueString,i=(l=r==null?void 0:r.find(c=>c.name==="websocket-url"))==null?void 0:l.valueUrl;if(!o)throw new We(jt("Failed to get token"));if(!i)throw new We(jt("Failed to get URL from $get-ws-binding-token"));return[n,o]}addCriteria(t){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const n=this.criteriaEntries.get(t);if(n)return n.refCount+=1,n.emitter;const r=new j6(t);return this.criteriaEntries.set(t,r),this.getTokenForCriteria(r).then(([o,i])=>{r.subscriptionId=o,this.criteriaEntriesBySubscriptionId.set(o,r),this.emitConnect(o),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:i}}))}).catch(o=>{console.error(o.message),this.emitError(t,o),this.criteriaEntries.delete(t)}),r.emitter}removeCriteria(t){var i,s,l;const n=this.criteriaEntries.get(t);if(!n){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}if(n.refCount-=1,n.refCount>0)return;const r=(i=this.criteriaEntries.get(t))==null?void 0:i.subscriptionId,o={type:"disconnect",payload:{subscriptionId:r}};this.masterSubEmitter&&(this.masterSubEmitter._removeCriteria(t),this.masterSubEmitter.dispatchEvent(o)),(l=(s=this.criteriaEntries.get(t))==null?void 0:s.emitter)==null||l.dispatchEvent(o),this.criteriaEntries.delete(t),r&&this.criteriaEntriesBySubscriptionId.delete(r)}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}getCriteriaCount(){return this.criteriaEntries.size}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new Hp(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const T6="3.1.5-6e0fc2e2f",k6=en.FHIR_JSON+", */*; q=0.1",R6="https://api.medplum.com/",_6=1e3,D6=6e4,I6=0,A6="Binary/",Tw={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class ET extends bT{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)??N6(),this.storage=(t==null?void 0:t.storage)??new b6,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=cT((t==null?void 0:t.baseUrl)??R6),this.fhirBaseUrl=yo(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=yo(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=yo(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=yo(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),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.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?I6:D6),this.cacheTime>0?this.requestCache=new ST((t==null?void 0:t.resourceCacheSize)??_6):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.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0}).catch(console.error)),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}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=yo(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((s,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:s,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const i=new _r(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,en.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 s=o;i&&(s=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,s,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 s=new URL(t);if(s.searchParams.set("response_type","code"),s.searchParams.set("client_id",n),s.searchParams.set("redirect_uri",r),s.searchParams.set("scope",o.scope??"openid profile email"),s.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`.");s.searchParams.set("code_challenge_method",c),s.searchParams.set("code_challenge",l)}return s.toString()}fhirUrl(...t){return new URL(yo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=GL(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),i="search-"+o.toString(),s=this.getCacheEntry(i,r);if(s)return s.value;const l=new _r((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(),s=this.getCacheEntry(i,r);if(s)return s.value;const l=new _r(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(),s=this.getCacheEntry(i,r);if(s)return s.value;const l=new _r(this.search(t,n,r).then(pm));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,n,r){var i,s;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(!((s=c.entry)!=null&&s.length)&&!u)break;yield pm(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 Tw;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}readResource(t,n,r){return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new _r(Promise.reject(new Error("Missing reference")));if(r==="system")return new _r(Promise.resolve(Tw));const[o,i]=r.split("/");return!o||!i?new _r(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(KP(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new _r((async()=>{const i=`{
|
|
94
|
-
StructureDefinitionList(name: "${t}") {
|
|
95
|
-
resourceType,
|
|
96
|
-
name,
|
|
97
|
-
kind,
|
|
98
|
-
description,
|
|
99
|
-
type,
|
|
100
|
-
snapshot {
|
|
101
|
-
element {
|
|
102
|
-
id,
|
|
103
|
-
path,
|
|
104
|
-
definition,
|
|
105
|
-
min,
|
|
106
|
-
max,
|
|
107
|
-
base {
|
|
108
|
-
path,
|
|
109
|
-
min,
|
|
110
|
-
max
|
|
111
|
-
},
|
|
112
|
-
contentReference,
|
|
113
|
-
type {
|
|
114
|
-
code,
|
|
115
|
-
profile,
|
|
116
|
-
targetProfile
|
|
117
|
-
},
|
|
118
|
-
binding {
|
|
119
|
-
strength,
|
|
120
|
-
valueSet
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
SearchParameterList(base: "${t}", _count: 100) {
|
|
126
|
-
base,
|
|
127
|
-
code,
|
|
128
|
-
type,
|
|
129
|
-
expression,
|
|
130
|
-
target
|
|
131
|
-
}
|
|
132
|
-
}`.replace(/\s+/g," "),s=await this.graphql(i);uw(s.data.StructureDefinitionList);for(const l of s.data.SearchParameterList)o7(l)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&By(t))return Promise.resolve([t]);const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const i=new _r((async()=>{if(n!=null&&n.expandProfile){const s=this.fhirUrl("StructureDefinition","$expand-profile");s.search=new URLSearchParams({url:t}).toString();const l=await this.post(s.toString(),{});return pm(l).map(c=>(QP(c,c.url),c.url))}else{const s=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});return s?(uw([s],t),[t]):(console.warn(`No StructureDefinition found for ${t}!`),[])}})());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 s=_w(t,n,r,o),l=i??(typeof n=="object"?n:{}),c=await this.createBinary(s,l);return{contentType:s.contentType,url:c.url,title:s.filename}}createBinary(t,n,r,o,i){const s=_w(t,n,r,o),l=i??(typeof n=="object"?n:{}),{data:c,contentType:u,filename:d,securityContext:f,onProgress:h}=s,p=this.fhirUrl("Binary");return d&&p.searchParams.set("_filename",d),f!=null&&f.reference&&this.setRequestHeader(l,"X-Security-Context",f.reference),h?this.uploadwithProgress(p,c,u,h,l):this.post(p,c,u,l)}uploadwithProgress(t,n,r,o,i){return new Promise((s,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 p;(p=i==null?void 0:i.signal)==null||p.removeEventListener("abort",u),h instanceof Error?l(h):s(h)};if(c.responseType="json",c.onabort=()=>d(new Error("Request aborted")),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 We(ht(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[p,g]of Object.entries(h))c.setRequestHeader(p,g)}c.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=$6(t,n,r,o),s=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,s)}createComment(t,n,r){const o=this.getProfile();let i,s;return t.resourceType==="Encounter"&&(i=vt(t),s=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,s=t.subject),t.resourceType==="Patient"&&(s=vt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[vt(t)],encounter:i,subject:s,sender:o?vt(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}patchResource(t,n,r,o){return this.invalidateSearches(t),this.patch(this.fhirUrl(t,n),r,o)}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 s=t;i=this.fhirUrl("Bot",s,"$execute")}else{const s=t;i=this.fhirUrl("Bot","$execute"),i.searchParams.set("identifier",s.system+"|"+s.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,en.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},en.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,i,s){return this.post(this.fhirUrl("Agent",oh(t),"$push"),{destination:typeof n=="string"?n:yt(n),body:r,contentType:o,waitForResponse:i},en.FHIR_JSON,s)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||yt(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.sessionDetails=void 0,this.accessTokenExpires=w6(t),this.medplumServer=x6(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").then(r=>{var i,s;this.profilePromise=void 0;const o=((s=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:s.id)!==r.profile.id;this.sessionDetails=r,o&&this.dispatchEvent({type:"change"}),t(r.profile)}).catch(n)}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!this.isInitialized||!!this.profilePromise}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(A6)&&(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=vt(i));const s=await this.createAttachment(o,n);return this.updateResource({...i,status:"completed",content:s})}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}/`,s=this.fhirUrl(`${i}$export`);return n&&s.searchParams.set("_type",n),r&&s.searchParams.set("_since",r),this.startAsyncRequest(s.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 S6(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 _r(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 s=i.headers.get("content-type"),l=s==null?void 0:s.includes("json");if(i.status===404&&!l)throw new We(h$);const c=await this.parseBody(i,l);if(i.status===200&&r.followRedirectOnOk||i.status===201&&r.followRedirectOnCreated){const u=await Rw(i,c);if(u)return this.request("GET",u,{...r,body:void 0})}if(i.status===202&&r.pollStatusOnAccepted){const d=await Rw(i,c)??o.statusUrl;if(d)return this.pollStatus(d,r,o)}if(i.status>=400)throw new We(ht(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=yo(this.baseUrl,t));const r=3,o=200;let i;for(let s=0;s<r;s++){try{if(this.options.verbose&&this.logRequest(t,n),i=await this.fetch(t,n),this.options.verbose&&this.logResponse(i),i.status<500)return i}catch(l){this.retryCatch(s,r,l)}await yw(o)}return i}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of hc(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 yw(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 s=t[0];try{s.resolve(await this.request(s.method,yo(this.fhirBaseUrl,s.url),s.options))}catch(l){s.reject(new We(ht(l)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(s=>({request:{method:s.method,url:s.url},resource:s.options.body?JSON.parse(s.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let s=0;s<t.length;s++){const l=t[s],c=(o=r.entry)==null?void 0:o[s];(i=c==null?void 0:c.response)!=null&&i.outcome&&!HP(c.response.outcome)?l.reject(new We(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){this.setRequestHeader(t,"X-Medplum","extended"),this.setRequestHeader(t,"Accept",k6,!0),t.body&&this.setRequestHeader(t,"Content-Type",en.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.constructor.name==="Blob")||typeof File<"u"&&(n instanceof File||n.constructor.name==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||n.constructor.name==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new Error("Unauthenticated")))}async startPkce(){const t=bw();sessionStorage.setItem("pkceState",t);const n=bw();sessionStorage.setItem("codeVerifier",n);const r=await o6(n),o=zL(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??kw()),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)??kw()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&r.set("code_verifier",o)}return this.fetchTokens(r)}refreshIfExpired(){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&this.accessTokenExpires<Date.now()&&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=r6(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new We(jt("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new We(jt("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("/fhircast/STU3",Cw(r),en.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!n0(t))throw new We(jt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new We(jt("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",Cw(t),en.FORM_URL_ENCODED)}fhircastConnect(t){return new g6(t)}async fhircastPublish(t,n,r,o){return u6(n)?this.post(`/fhircast/STU3/${t}`,jw(t,n,r,o),en.JSON):(d6(n),this.post(`/fhircast/STU3/${t}`,jw(t,n,r),en.JSON))}async fhircastGetContext(t){return this.get(`/fhircast/STU3/${t}`)}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n={method:"POST",headers:{"Content-Type":en.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(s){throw this.refreshPromise=void 0,s}if(!o.ok){this.clearActiveLogin();try{const s=await o.json();throw new We(Si(s.error_description))}catch(s){throw new We(Si("Failed to fetch tokens"),s)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(y6(n)){const r=r0(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new Error("Token expired");if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}setupStorageListener(){try{window.addEventListener("storage",t=>{(t.key===null||t.key==="activeLogin")&&window.location.reload()})}catch{}}retryCatch(t,n,r){if(r.message==="Failed to fetch"&&t===1&&this.dispatchEvent({type:"offline"}),t>=n-1)throw r}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new P6(this,qL(this.baseUrl,"/ws/subscriptions-r4"))),this.subscriptionManager}subscribeToCriteria(t){return this.getSubscriptionManager().addCriteria(t)}unsubscribeFromCriteria(t){this.subscriptionManager&&(this.subscriptionManager.removeCriteria(t),this.subscriptionManager.getCriteriaCount()===0&&this.subscriptionManager.closeWebSocket())}getMasterSubscriptionEmitter(){return this.getSubscriptionManager().getMasterEmitter()}}function N6(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function kw(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function Rw(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(nh(t)&&((i=(o=t.issue)==null?void 0:o[0])!=null&&i.diagnostics))return t.issue[0].diagnostics}function pm(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function M6(e){return wn(e)&&"data"in e&&"contentType"in e}function _w(e,t,n,r){return M6(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function O6(e){return wn(e)&&"docDefinition"in e}function $6(e,t,n,r){return O6(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function Ma({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o}){if(t===(e==null?void 0:e.path))return;const i=L6(t,n,e,!!o),s=Object.create(null);for(const[l,c]of Object.entries(i))s[t+"."+l]=c;return{path:t,elements:i,elementsByPath:s,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:o??(e==null?void 0:e.debugMode)??!1}}function L6(e,t,n,r){const o=Object.create(null);if(n)for(const[s,l]of Object.entries(n.elementsByPath)){const c=fc(e,s);c!==void 0&&(o[c]=l)}let i=!1;if(t)for(const[s,l]of Object.entries(t))s in o||(o[s]=l,i=!0);return r&&console.assert(i,"Unnecessary ElementsContext; not using any newly provided elements"),o}function jT(e){return e.type!==void 0&&e.type.length>0}function F6(e,t,n,r){var i;const o=pL(e,t.path,{profileUrl:r});if(o){const s=((i=n.typeSchema)==null?void 0:i.elements)??n.elements;return o.some(l=>xL(l,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function PT(e,t,n,r){var o,i;if(e)for(const s of t){const l={value:e,type:((o=s.typeSchema)==null?void 0:o.name)??((i=s.type)==null?void 0:i[0].code)};if(n.every(c=>{var u;return F6(l,c,s,((u=s.typeSchema)==null?void 0:u.url)??r)}))return s.name}}class z6{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Ma({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(!zt(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=V6(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 s of t.children)this.crawlElementNode(s,n);zt((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,s;const r=[];for(const l of t){if(!jT(l))continue;const c=(s=(i=l.type.find(u=>zt(u.profile)))==null?void 0:i.profile)==null?void 0:s[0];if(zt(c)){const u=Ts(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 s=(o==null?void 0:o.elements)??t.elements;zt(s)&&(i=Ma({path:n,parentContext:this.elementsContext,elements:s})),i&&this.elementsContextStack.push(i),this.crawlElementsImpl(s,n),i&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function V6(e){const t=[];function n(i,s){return s.startsWith(i+".")}function r(i,s){for(const l of i.children)if(n(l.key,s.key)){r(l,s);return}i.children.push(s)}const o=Object.entries(e);o.sort((i,s)=>i[0].localeCompare(s[0]));for(const[i,s]of o){const l={key:i,element:s,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 gm="__sliceName";function B6(e,t){const n=new U6(e,e.resourceType,"resource");return new z6(t,n).crawlResource(),n.getDefaultValue()}function Dw(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Hd(e,r,o,t);continue}const i=fc(n,r);i!==void 0&&Hd(e,i,o,t)}return e}class U6{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=ho(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,s=fc(i,t);if(s===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){H6(d,s,n,r.elements),Hd(d,s,n,r.elements);const f=qp(d,s,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=fc(this.value.path,t);if(i===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);for(const s of this.value.values){const l=qp(s,i,n,r.elements);if(Array.isArray(l))for(let c=l.length-1;c>=0;c--){const u=l[c];zt(u)||l.splice(c,1)}Vt(l)&&Wp(s,void 0,i,n)}}onEnterSlice(t,n,r){const o=this.value.values,i=[];for(const s of o){if(s===void 0)continue;if(!Array.isArray(s))throw new Error("Expected array value for sliced element");const l=this.getMatchingSliceValues(s,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[gm]??PT(i,[n],r.discriminator,this.schema.url))===n.name&&o.push(i);for(let i=o.length;i<n.min;i++)if(Wy(n.type[0].code)){const s=Object.create(null);o.push(s),t.push(s)}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];gm in o&&delete o[gm]}}getDefaultValue(){return this.rootValue}}function H6(e,t,n,r){const o=qp(e,t,n,r);n.min>0&&o===void 0&&Wy(n.type[0].code)&&(n.isArray?Wp(e,[Object.create(null)],t,n):Wp(e,Object.create(null),t,n))}function Wp(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]",Gt(i))}t===void 0?delete e[o]:e[o]=t}function qp(e,t,n,r){const o=t.split(".");let i=e,s;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]",Gt(d))}if(l===o.length-1){Array.isArray(i)?s=i.map(u=>u[c]):s=i[c];continue}if(Array.isArray(i))i=i.map(u=>u[c]);else if(wn(i)){if(i[c]===void 0)return;i=i[c]}else return}return s}function Hd(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(l=>Hd(l,t,n,r));e==null&&(e=Object.create(null));const o=e,i=t.split(".");let s=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]",Gt(d))}if(l===i.length-1){const u=Array.isArray(s)?s:[s];for(const d of u)n.fixed?d[c]??(d[c]=n.fixed.value):n.pattern&&(d[c]=TT(d[c],n.pattern.value))}else{if(!(c in s)){const u=i.slice(0,l+1).join(".");s[c]=r[u].isArray?[Object.create(null)]:Object.create(null)}s=s[c]}}return o}function TT(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:ho(t);if(wn(t)&&(wn(e)&&!Array.isArray(e)||e===void 0)){const n=ho(e)??Object.create(null);for(const r of Object.keys(t))n[r]=TT(n[r],t[r]);return n}return e}var kT=m.createContext(void 0);function lh(){return m.useContext(kT)}function se(){return lh().medplum}function ch(){return lh().navigate}function uh(){return lh().profile}function W6(e){let t=e.medplum,n=e.navigate??q6,[r,o]=m.useState({profile:t.getProfile(),loading:!t.isInitialized});m.useEffect(()=>{t&&(t.isInitialized||(o(s=>({...s,loading:!0})),t.getInitPromise().then(()=>o(s=>({...s,loading:!1}))).catch(console.error)))},[t,t.isInitialized]),m.useEffect(()=>{function s(){o({...r,profile:t.getProfile()})}return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[t,r]);let i=m.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(kT.Provider,{value:i,children:e.children})}function q6(e){window.location.assign(e)}var Iw=new Map,RT=e=>m.useMemo(()=>{if(!e)return;let 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;let r=n.get("Expires");if(!r||r.length>13)return e;let o=Iw.get(t);if(o){let i=new URLSearchParams(new URL(o).search).get("Expires");if(i&&parseInt(i,10)*1e3-5e3>Date.now())return o}return Iw.set(t,e),e},[e]);function mt(e,t){let n=se(),[r,o]=m.useState(Aw(n,e)),i=m.useCallback(s=>{Gc(s,r)||o(s)},[r,o]);return m.useEffect(()=>{i(Aw(n,e))},[n,e,i]),m.useEffect(()=>{let s=!0;return _s(e)&&n.readReference(e).then(l=>{s&&i(l)}).catch(l=>{s&&(i(void 0),t&&t(ht(l)))}),()=>s=!1},[n,r,e,i,t]),r}function Aw(e,t){if(t){if(Wo(t))return t;if(_s(t))return e.getCachedReference(t)}}function G6(e,t){return _T("searchOne",e,t)}function Oa(e,t){return _T("searchResources",e,t)}function _T(e,t,n){let r=se(),[o,i]=m.useState(),[s,l]=m.useState(!1),[c,u]=m.useState(),[d,f]=m.useState();return m.useEffect(()=>{let h=r.fhirSearchUrl(t,n).toString();h!==o&&(i(h),r[e](t,n).then(p=>{l(!1),u(p),f(f$)}).catch(p=>{l(!1),u(void 0),f(ht(p))}))},[r,e,t,n,o]),[c,s,d]}function Q6(e){const t=e.value;return t?a.jsx(a.Fragment,{children:QL(t)}):null}function Nw(e,t){return e.line&&e.line.length>t?e.line[t]:""}function Mw(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function K6(e){const[t,n]=m.useState(e.defaultValue||{}),r=m.useRef();r.current=t;function o(h){n(h),e.onChange&&e.onChange(h)}function i(h){o({...r.current,use:h})}function s(h){o({...r.current,type:h})}function l(h){o(Mw(r.current||{},0,h))}function c(h){o(Mw(r.current||{},1,h))}function u(h){o({...r.current,city:h})}function d(h){o({...r.current,state:h})}function f(h){o({...r.current,postalCode:h})}return a.jsxs(ee,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(Tt,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>i(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(Tt,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>s(h.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(fe,{placeholder:"Line 1",defaultValue:Nw(t,0),onChange:h=>l(h.currentTarget.value)}),a.jsx(fe,{placeholder:"Line 2",defaultValue:Nw(t,1),onChange:h=>c(h.currentTarget.value)}),a.jsx(fe,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),a.jsx(fe,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),a.jsx(fe,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>f(h.currentTarget.value)})]})}function Y6(e){const t=uh(),[n,r]=m.useState(e.defaultValue||{});function o(i){const s=i?{text:i,authorReference:t&&vt(t),time:new Date().toISOString()}:{};r(s),e.onChange&&e.onChange(s)}return a.jsx(fe,{name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}/**
|
|
133
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the MIT license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/var X6={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"}};/**
|
|
138
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the MIT license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const be=(e,t,n,r)=>{const o=m.forwardRef(({color:i="currentColor",size:s=24,stroke:l=2,className:c,children:u,...d},f)=>m.createElement("svg",{ref:f,...X6[e],width:s,height:s,className:["tabler-icon",`tabler-icon-${t}`,c].join(" "),...e==="filled"?{fill:i}:{strokeWidth:l,stroke:i},...d},[...r.map(([h,p])=>m.createElement(h,p)),...Array.isArray(u)?u:[u]]));return o.displayName=`${n}`,o};/**
|
|
143
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the MIT license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/var J6=be("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"}]]);/**
|
|
148
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the MIT license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/var Kc=be("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"}]]);/**
|
|
153
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the MIT license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/var Z6=be("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"}]]);/**
|
|
158
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the MIT license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/var eF=be("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"}]]);/**
|
|
163
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the MIT license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/var tF=be("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"}]]);/**
|
|
168
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the MIT license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/var nF=be("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"}]]);/**
|
|
173
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the MIT license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/var rF=be("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"}]]);/**
|
|
178
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the MIT license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/var oF=be("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"}]]);/**
|
|
183
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the MIT license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/var iF=be("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"}]]);/**
|
|
188
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the MIT license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/var sF=be("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"}]]);/**
|
|
193
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the MIT license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/var aF=be("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"}]]);/**
|
|
198
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the MIT license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/var lF=be("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"}]]);/**
|
|
203
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the MIT license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/var $i=be("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"}]]);/**
|
|
208
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the MIT license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/var dh=be("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
213
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the MIT license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/var cF=be("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"}]]);/**
|
|
218
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the MIT license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/var DT=be("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
223
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the MIT license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/var Wd=be("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"}]]);/**
|
|
228
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the MIT license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/var qd=be("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"}]]);/**
|
|
233
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the MIT license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/var o0=be("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"}]]);/**
|
|
238
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the MIT license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/var uF=be("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"}]]);/**
|
|
243
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the MIT license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/var IT=be("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"}]]);/**
|
|
248
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the MIT license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/var dF=be("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"}]]);/**
|
|
253
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the MIT license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/var fF=be("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"}]]);/**
|
|
258
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the MIT license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/var hF=be("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"}]]);/**
|
|
263
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the MIT license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/var mF=be("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"}]]);/**
|
|
268
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the MIT license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/var Yc=be("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"}]]);/**
|
|
273
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the MIT license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/var Xc=be("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
278
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the MIT license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/var Ow=be("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"}]]);/**
|
|
283
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the MIT license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/var pF=be("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"}]]);/**
|
|
288
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the MIT license.
|
|
291
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/var gF=be("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"}]]);/**
|
|
293
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the MIT license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/var vF=be("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"}]]);/**
|
|
298
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the MIT license.
|
|
301
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/var yF=be("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"}]]);/**
|
|
303
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the MIT license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/var xF=be("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"}]]);/**
|
|
308
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
309
|
-
*
|
|
310
|
-
* This source code is licensed under the MIT license.
|
|
311
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/var wF=be("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"}]]);/**
|
|
313
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the MIT license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/var SF=be("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"}]]);/**
|
|
318
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
319
|
-
*
|
|
320
|
-
* This source code is licensed under the MIT license.
|
|
321
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
-
*/var bF=be("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"}]]);/**
|
|
323
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the MIT license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/var AT=be("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
328
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the MIT license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/var NT=be("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
333
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
334
|
-
*
|
|
335
|
-
* This source code is licensed under the MIT license.
|
|
336
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
-
*/var CF=be("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"}]]);/**
|
|
338
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
339
|
-
*
|
|
340
|
-
* This source code is licensed under the MIT license.
|
|
341
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
-
*/var EF=be("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"}]]);/**
|
|
343
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
344
|
-
*
|
|
345
|
-
* This source code is licensed under the MIT license.
|
|
346
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/var jF=be("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"}]]);/**
|
|
348
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
349
|
-
*
|
|
350
|
-
* This source code is licensed under the MIT license.
|
|
351
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
-
*/var PF=be("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"}]]);/**
|
|
353
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the MIT license.
|
|
356
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/var TF=be("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"}]]);/**
|
|
358
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
359
|
-
*
|
|
360
|
-
* This source code is licensed under the MIT license.
|
|
361
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
-
*/var kF=be("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
363
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
364
|
-
*
|
|
365
|
-
* This source code is licensed under the MIT license.
|
|
366
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/var RF=be("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
|
|
368
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the MIT license.
|
|
371
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/var _F=be("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"}]]);/**
|
|
373
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
374
|
-
*
|
|
375
|
-
* This source code is licensed under the MIT license.
|
|
376
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
-
*/var DF=be("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"}]]);/**
|
|
378
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
379
|
-
*
|
|
380
|
-
* This source code is licensed under the MIT license.
|
|
381
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
-
*/var IF=be("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"}]]);/**
|
|
383
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
384
|
-
*
|
|
385
|
-
* This source code is licensed under the MIT license.
|
|
386
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
-
*/var AF=be("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"}]]);/**
|
|
388
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
389
|
-
*
|
|
390
|
-
* This source code is licensed under the MIT license.
|
|
391
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
-
*/var NF=be("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"}]]);/**
|
|
393
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
394
|
-
*
|
|
395
|
-
* This source code is licensed under the MIT license.
|
|
396
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
-
*/var Gp=be("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"}]]);/**
|
|
398
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
399
|
-
*
|
|
400
|
-
* This source code is licensed under the MIT license.
|
|
401
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
-
*/var i0=be("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"}]]);/**
|
|
403
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
404
|
-
*
|
|
405
|
-
* This source code is licensed under the MIT license.
|
|
406
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
-
*/var s0=be("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"}]]);/**
|
|
408
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
409
|
-
*
|
|
410
|
-
* This source code is licensed under the MIT license.
|
|
411
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
-
*/var MF=be("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"}]]);/**
|
|
413
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
414
|
-
*
|
|
415
|
-
* This source code is licensed under the MIT license.
|
|
416
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
-
*/var OF=be("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"}]]);/**
|
|
418
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
419
|
-
*
|
|
420
|
-
* This source code is licensed under the MIT license.
|
|
421
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
-
*/var $F=be("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"}]]);/**
|
|
423
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
424
|
-
*
|
|
425
|
-
* This source code is licensed under the MIT license.
|
|
426
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
-
*/var LF=be("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"}]]);/**
|
|
428
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
429
|
-
*
|
|
430
|
-
* This source code is licensed under the MIT license.
|
|
431
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
-
*/var MT=be("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"}]]);/**
|
|
433
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
434
|
-
*
|
|
435
|
-
* This source code is licensed under the MIT license.
|
|
436
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
-
*/var $w=be("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"}]]);/**
|
|
438
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
439
|
-
*
|
|
440
|
-
* This source code is licensed under the MIT license.
|
|
441
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
-
*/var FF=be("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"}]]);/**
|
|
443
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
444
|
-
*
|
|
445
|
-
* This source code is licensed under the MIT license.
|
|
446
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
-
*/var Gd=be("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
|
|
448
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
449
|
-
*
|
|
450
|
-
* This source code is licensed under the MIT license.
|
|
451
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
-
*/var zF=be("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 OT extends m.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx(Cs,{icon:a.jsx(Kc,{size:16}),title:"Something went wrong",color:"red",children:$e(this.state.error)}):this.props.children}}function Br(){return a.jsx(un,{style:{width:"100%",height:"100vh"},children:a.jsx(Gn,{})})}const VF="_main_g2hyx_1",BF={main:VF};function lt(e){e.preventDefault(),e.stopPropagation()}function $T(e){if(Lw(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&Lw(t[0]))return!0}return!1}function Lw(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function qe(e){const t=ch(),{to:n,suffix:r,label:o,onClick:i,children:s,...l}=e;let c=UF(n);return r&&(c+="/"+r),a.jsx(Ze,{href:c,"aria-label":o,onClick:u=>{lt(u),i?i(u):n&&t(c)},...l,children:s})}function UF(e){if(e){if(typeof e=="string")return HF(e);if(Wo(e))return WF(e);if(_s(e))return qF(e)}return"#"}function HF(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function WF(e){return`/${e.resourceType}/${e.id}`}function qF(e){return`/${e.reference}`}function GF(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 Ai(e){const t=mt(e.value),n=t?Ao(t):e.alt??"",r=GF(n),o=(t&&kL(t))??e.src,i=RT(o??void 0),s=e.radius??"xl",l={...e,value:void 0,link:void 0};return e.link?a.jsx(qe,{to:t,children:a.jsx(cs,{src:i,alt:n,radius:s,...l,children:r})}):a.jsx(cs,{src:i,alt:n,radius:s,...l,children:r})}const QF="_logoButton_189g3_1",KF="_user_189g3_11",YF="_userName_189g3_21",XF="_userActive_189g3_31",zu={logoButton:QF,user:KF,userName:YF,userActive:XF};function a0(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Qc(t,e.options)}):null}function JF(e){var c,u,d;const t=lh(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),{colorScheme:s,setColorScheme:l}=oD();return a.jsxs(a.Fragment,{children:[a.jsxs(Ie,{align:"center",p:"xl",children:[a.jsx(Ai,{size:"xl",radius:100,value:t.profile}),a.jsx(a0,{value:(u=(c=t.profile)==null?void 0:c.name)==null?void 0:u[0]}),a.jsx(de,{c:"dimmed",size:"xs",children:(d=n.getActiveLogin())==null?void 0:d.project.display})]}),i.length>1&&a.jsx(ne.Divider,{}),i.map(f=>f.profile.reference!==yt(t.profile)&&a.jsx(ne.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:a.jsxs(ee,{children:[a.jsx(cs,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(de,{size:"sm",fw:500,children:f.profile.display}),a.jsx(de,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),a.jsx(ne.Divider,{}),a.jsx(ee,{justify:"center",children:a.jsx(Ty,{size:"xs",value:s,onChange:f=>l(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx($F,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),a.jsx(ne.Item,{leftSection:a.jsx(Gp,{size:14,stroke:1.5}),onClick:()=>o(`/${yt(r)}`),children:"Account settings"}),a.jsx(ne.Item,{leftSection:a.jsx(bF,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsx(de,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}function l0(e){const t=Oc({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:i,defaultValue:s,toOption:l,loadOptions:c,itemComponent:u,onChange:d,onCreate:f,creatable:h,clearable:p,required:g,placeholder:v,leftSection:S,maxValues:y,optionsDropdownMaxHeight:x=320,...w}=e,b=ZF(s),[j,P]=m.useState(""),[E,T]=m.useState(),[_,R]=m.useState(),[O,I]=m.useState(),[M,F]=m.useState(b.map(l)),[N,A]=m.useState([]),D=u??e8,k=m.useRef();k.current=j;const L=m.useRef(),B=m.useRef(),H=m.useRef();H.current=E;const J=m.useRef();J.current=_;const we=m.useRef();we.current=O;const ie=m.useRef();ie.current=N;const Ce=m.useCallback(()=>{if(T(void 0),k.current===B.current&&c===L.current)return;B.current=k.current,L.current=c;const ve=new AbortController;R(ve),c(k.current??"",ve.signal).then(Le=>{ve.signal.aborted||(A(Le.map(l)),R(void 0),we.current?(Le.length>0&&d(Le.slice(0,1)),I(!1)):Le.length>0&&t.openDropdown())}).catch(Le=>{ve.signal.aborted||Le.message.includes("aborted")||xe({color:"red",message:$e(Le)})})},[t,c,d,l]),_e=m.useCallback(ve=>{(N&&N.length>0||h)&&t.openDropdown(),t.updateSelectedOptionIndex(),P(ve.currentTarget.value),J.current&&(J.current.abort(),R(void 0)),H.current!==void 0&&window.clearTimeout(H.current);const Le=window.setTimeout(()=>Ce(),100);T(Le)},[t,N,h,Ce]),Pe=m.useCallback(ve=>{const Le=[],Ae=[...M];let te=N==null?void 0:N.find(je=>je.value===ve),re=te==null?void 0:te.resource;if(!re&&h!==!1&&f&&(re=f(ve),te=l(re)),re&&Le.push(re),te&&Ae.push(te),y!==void 0)for(;Ae.length>y;)Ae.shift();d(Le),F(Ae)},[h,N,M,y,d,f,l]),ue=ve=>{P(""),A([]),t.closeDropdown(),B.current=void 0,Pe(ve==="$create"?j:ve)},Ue=m.useCallback(ve=>{const Le=M.filter(Ae=>Ae.value!==ve.value);d(Le.map(Ae=>Ae.resource)),F(Le)},[M,d]),bt=m.useCallback(ve=>{ve.key==="Enter"?!E&&!_?(lt(ve),N&&N.length>0&&(A(N.slice(0,1)),Pe(N[0].value))):I(!0):ve.key==="Backspace"&&j.length===0&&(lt(ve),Ue(M[M.length-1]))},[j,M,N,E,_,Pe,Ue]);m.useEffect(()=>()=>{J.current&&J.current.abort()},[]);const at=p&&M.length>0&&a.jsx(De.ClearButton,{title:"Clear all",size:16,onClear:()=>{P(""),F([]),d([]),t.closeDropdown()}});return a.jsxs(De,{store:t,onOptionSubmit:ue,withinPortal:!0,shadow:"xl",...w,children:[a.jsx(De.DropdownTarget,{children:a.jsx(Aa,{label:r,description:o,error:i,className:e.className,leftSection:S,rightSection:_?a.jsx(Gn,{size:16}):at,required:g,children:a.jsxs(us.Group,{children:[M.map(ve=>a.jsx(us,{withRemoveButton:!0,onRemove:()=>Ue(ve),children:ve.label},ve.value)),(y===void 0||y===0||M.length<y)&&a.jsx(De.EventsTarget,{children:a.jsx(Aa.Field,{role:"searchbox",name:n,value:j,placeholder:v,onFocus:_e,onBlur:()=>t.closeDropdown(),onKeyDown:bt,onChange:_e})})]})})}),a.jsx(De.Dropdown,{children:a.jsx(De.Options,{children:a.jsxs(Tf,{type:"scroll",mah:x,children:[N.map(ve=>a.jsx(De.Option,{value:ve.value,active:M.includes(ve),children:a.jsx(D,{...ve})},ve.value)),h&&j.trim().length>0&&a.jsxs(De.Option,{value:"$create",children:["+ Create ",j]}),!h&&j.trim().length>0&&N.length===0&&a.jsx(De.Empty,{children:"Nothing found"})]})})})]})}function ZF(e){return e?Array.isArray(e)?e:[e]:[]}function e8(e){return a.jsx(ee,{gap:"sm",children:a.jsx("span",{children:e.label})})}const t8="_searchInput_dick8_1",n8={searchInput:t8};function r8(e){return{value:e.id,label:Ao(e),resource:e}}function o8(e){const t=ch(),n=se(),r=m.useCallback(async(i,s)=>{const l=s8(i),c={signal:s},u=await n.graphql(l,void 0,void 0,c);return a8(u,i)},[n]),o=m.useCallback(i=>{i.length>0&&t(`/${yt(i[0])}`)},[t]);return a.jsx(l0,{size:"sm",radius:"md",className:n8.searchInput,leftSection:a.jsx(NF,{size:16}),placeholder:"Search",itemComponent:i8,toOption:r8,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const i8=m.forwardRef(({resource:e,...t},n)=>{var o;let r;return e.resourceType==="Patient"?r=e.birthDate:e.resourceType==="ServiceRequest"&&(r=(o=e.subject)==null?void 0:o.display),a.jsx("div",{ref:n,...t,children:a.jsxs(ee,{wrap:"nowrap",children:[a.jsx(Ai,{value:e}),a.jsxs("div",{children:[a.jsx(de,{children:Ao(e)}),a.jsx(de,{size:"xs",c:"dimmed",children:r})]})]})})});function s8(e){const t=JSON.stringify(e);return aT(e)?`{
|
|
453
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
454
|
-
resourceType
|
|
455
|
-
id
|
|
456
|
-
identifier {
|
|
457
|
-
system
|
|
458
|
-
value
|
|
459
|
-
}
|
|
460
|
-
name {
|
|
461
|
-
given
|
|
462
|
-
family
|
|
463
|
-
}
|
|
464
|
-
birthDate
|
|
465
|
-
}
|
|
466
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
467
|
-
resourceType
|
|
468
|
-
id
|
|
469
|
-
identifier {
|
|
470
|
-
system
|
|
471
|
-
value
|
|
472
|
-
}
|
|
473
|
-
subject {
|
|
474
|
-
display
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}`.replace(/\s+/g," "):`{
|
|
478
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
479
|
-
resourceType
|
|
480
|
-
id
|
|
481
|
-
identifier {
|
|
482
|
-
system
|
|
483
|
-
value
|
|
484
|
-
}
|
|
485
|
-
name {
|
|
486
|
-
given
|
|
487
|
-
family
|
|
488
|
-
}
|
|
489
|
-
birthDate
|
|
490
|
-
}
|
|
491
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
492
|
-
resourceType
|
|
493
|
-
id
|
|
494
|
-
identifier {
|
|
495
|
-
system
|
|
496
|
-
value
|
|
497
|
-
}
|
|
498
|
-
name {
|
|
499
|
-
given
|
|
500
|
-
family
|
|
501
|
-
}
|
|
502
|
-
birthDate
|
|
503
|
-
}
|
|
504
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
505
|
-
resourceType
|
|
506
|
-
id
|
|
507
|
-
identifier {
|
|
508
|
-
system
|
|
509
|
-
value
|
|
510
|
-
}
|
|
511
|
-
subject {
|
|
512
|
-
display
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
}`.replace(/\s+/g," ")}function a8(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),c8(l8(n),t).slice(0,5)}function l8(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 c8(e,t){return e.sort((n,r)=>Fw(r,t)-Fw(n,t))}function Fw(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,zw(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,zw(Qc(r),t));return n}function zw(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function u8(e){var o;const t=uh(),[n,r]=m.useState(!1);return a.jsx(qn.Header,{p:8,style:{zIndex:101},children:a.jsxs(ee,{justify:"space-between",children:[a.jsxs(ee,{gap:"xs",children:[a.jsx(Dn,{className:zu.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&a.jsx(o8,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(ee,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(ne,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[a.jsx(ne.Target,{children:a.jsx(Dn,{className:rt(zu.user,{[zu.userActive]:n}),onClick:()=>r(i=>!i),children:a.jsxs(ee,{gap:7,children:[a.jsx(Ai,{value:t,radius:"xl",size:24}),a.jsx(de,{size:"sm",className:zu.userName,children:Qc((o=t==null?void 0:t.name)==null?void 0:o[0])}),a.jsx(DT,{size:12,stroke:1.5})]})})}),a.jsx(ne.Dropdown,{children:a.jsx(JF,{version:e.version})})]})]})]})})}function d8(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?f8(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&h8(t,n);return t}function f8(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function h8(e,t){e[t.name]=t.value}function Qe(e){return a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=d8(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function m8(e){const t=se(),n=t.getUserConfiguration();function r(o){var d,f;const{menuname:i,bookmarkname:s}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=ho(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:s,target:l}),t.updateResource(c).then(h=>{n.menu=h.menu,t.dispatchEvent({type:"change"}),xe({color:"green",message:"Success"}),e.onOk()}).catch(h=>{xe({color:"red",message:$e(h)})})}return a.jsx($n,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(Qe,{onSubmit:r,children:a.jsxs(Ie,{children:[a.jsx(p8,{config:n}),a.jsx(fe,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(ee,{justify:"flex-end",children:a.jsx(oe,{mt:"sm",type:"submit",children:"OK"})})]})})})}function p8(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 a.jsx(Tt,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function LT(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function g8(e){return typeof e.display=="string"?e.display:LT(e)}function v8(e){return{value:LT(e),label:g8(e),resource:e}}function y8(e){return{code:e,display:e}}function c0(e){const t=se(),{binding:n,creatable:r,clearable:o,expandParams:i,withHelpText:s,...l}=e,c=m.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,p=[];for(const v of h)v.code&&!p.some(S=>S.code===v.code)&&p.push(v);return p},[t,i,n]);return a.jsx(l0,{...l,creatable:r??!0,clearable:o??!0,toOption:v8,loadOptions:c,onCreate:y8,itemComponent:s?x8:void 0})}const x8=m.forwardRef(({label:e,resource:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsx(ee,{wrap:"nowrap",children:a.jsxs("div",{children:[a.jsx(de,{children:e}),a.jsx(de,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})})}));function FT(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,s]=m.useState(t);function l(c){const u=c[0],d=S8(u);s(d),n&&n(d)}return a.jsx(c0,{defaultValue:w8(i),onChange:l,withHelpText:r??!0,...o})}function w8(e){return e?{code:e}:void 0}function S8(e){return e==null?void 0:e.code}function u0(e){const[t,n]=m.useState(e.defaultValue),r=e.onChange,o=m.useCallback(i=>{n(i),r&&r(i)},[r]);return a.jsx(FT,{"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 b8="_menuTitle_9g6l5_1",C8="_link_9g6l5_9",E8="_linkActive_9g6l5_38",Qp={menuTitle:b8,link:C8,linkActive:E8};function j8(e){var l;const t=ch(),n=k8(e.pathname,e.searchParams,e.menus),[r,o]=m.useState(!1);function i(c,u){c.stopPropagation(),c.preventDefault(),t(u),window.innerWidth<768&&e.closeNavbar()}function s(c){c&&t(`/${c}`)}return a.jsxs(a.Fragment,{children:[a.jsx(qn.Navbar,{children:a.jsxs(Er,{p:"xs",children:[!e.resourceTypeSearchDisabled&&a.jsx(qn.Section,{mb:"sm",children:a.jsx(u0,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:c=>s(c)},window.location.pathname)}),a.jsxs(qn.Section,{grow:!0,children:[(l=e.menus)==null?void 0:l.map(c=>{var u;return a.jsxs(m.Fragment,{children:[a.jsx(de,{className:Qp.menuTitle,children:c.title}),(u=c.links)==null?void 0:u.map(d=>a.jsxs(P8,{to:d.href,active:d.href===(n==null?void 0:n.href),onClick:f=>i(f,d.href),children:[a.jsx(T8,{to:d.href,icon:d.icon}),a.jsx("span",{children:d.label})]},d.href))]},`menu-${c.title}`)}),e.displayAddBookmark&&a.jsx(oe,{variant:"subtle",size:"xs",mt:"xl",leftSection:a.jsx(RF,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&a.jsx(m8,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function P8(e){return a.jsx(qe,{onClick:e.onClick,to:e.to,className:rt(Qp.link,{[Qp.linkActive]:e.active}),children:e.children})}function T8(e){return e.icon?e.icon:a.jsx(th,{w:30})}function k8(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const i of n)if(i.links)for(const s of i.links){const l=R8(e,t,s.href);l>o&&(o=l,r=s)}return r}function R8(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[s,l]of r.searchParams.entries())if(!o.includes(s)&&t.get(s)!==l)return 0;let i=1;for(const[s,l]of t.entries())o.includes(s)||r.searchParams.get(s)===l&&i++;return i}function _8(e){const[t,n]=m.useState(localStorage.navbarOpen==="true"),r=se(),o=uh();m.useEffect(()=>{function c(){xe({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 s(){i(!1)}function l(){i(!t)}return r.isLoading()?a.jsx(Br,{}):a.jsxs(qn,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&a.jsx(u8,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:l,notifications:e.notifications}),o&&t?a.jsx(j8,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:s,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,a.jsx(qn.Main,{className:BF.main,children:a.jsx(OT,{children:a.jsx(m.Suspense,{fallback:a.jsx(Br,{}),children:e.children})})})]})}function Jc(e){const{contentType:t,url:n,title:r}=e.value??{},o=RT(n);return o?a.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),(t==null?void 0:t.startsWith("video/"))&&a.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:a.jsx("source",{type:t,src:o})}),t==="application/pdf"&&a.jsx("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400},children:a.jsx("iframe",{width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(Ze,{href:o,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:D8(r),children:r||"Download"})})]}):null}function D8(e){return e!=null&&e.includes(".")?e:void 0}const I8="_root_17n8t_1",A8="_compact_17n8t_25",Vw={root:I8,compact:A8};function d0(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:rt(Vw.root,{[Vw.compact]:n}),children:t})}function jo(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function N8(e){var r;const t=(r=e.values)==null?void 0:r.map((o,i)=>a.jsx("div",{children:a.jsx(Jc,{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(!zt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=a.jsx(jo,{term:ds(o),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function f0(e){const t=se(),n=m.useRef(null);function r(s){var l;lt(s),(l=n.current)==null||l.click()}function o(s){lt(s);const l=s.target.files;l&&Array.from(l).forEach(i)}function i(s){!s||!s.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:s,contentType:s.type||"application/octet-stream",filename:s.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(c=>e.onUpload(c)).catch(c=>{e.onUploadError&&e.onUploadError(ht(c))}))}return a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:s=>o(s)}),e.children({onClick:r})]})}function M8(e){const[t,n]=m.useState(e.defaultValue??[]),r=m.useRef();r.current=t;function o(i){n(i),e.onChange&&e.onChange(i)}return a.jsxs("table",{style:{width:"100%"},children:[a.jsxs("colgroup",{children:[a.jsx("col",{width:"97%"}),a.jsx("col",{width:"3%"})]}),a.jsxs("tbody",{children:[t.map((i,s)=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Jc,{value:i,maxWidth:200})}),a.jsx("td",{children:a.jsx(Zt,{title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:l=>{lt(l);const c=t.slice();c.splice(s,1),o(c)},children:a.jsx(Wd,{})})})]},`${s}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(f0,{onUpload:i=>{o([...r.current,i])},children:i=>a.jsx(Zt,{...i,title:"Add",variant:"subtle",size:"sm",color:"green",children:a.jsx(o0,{})})})})]})]})]})}function zT(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?a.jsxs(a.Fragment,{children:[a.jsx(Jc,{value:t,maxWidth:200}),a.jsx(oe,{onClick:o=>{lt(o),r(void 0)},children:"Remove"})]}):a.jsx(f0,{securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(oe,{...o,children:"Upload..."})})}const VT=["meta","implicitRules","contained","extension","modifierExtension"],BT=["language","text"];function lo(e){return a.jsx(a.Fragment,{children:Ti(e.value)})}function O8(e){return a.jsx(a.Fragment,{children:ks(e.value)})}function UT(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),a.jsx(a.Fragment,{children:n.join("").trim()})}function $8(e){var n;const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>a.jsx(UT,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function L8(e){var t,n;return a.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function F8(e){return a.jsx(a.Fragment,{children:t7(e.value)})}function vc(e){return a.jsx(a.Fragment,{children:ri(e.value)})}function h0(e){return a.jsx(a.Fragment,{children:mc(e.value)})}function z8(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(vc,{value:t.numerator})," / ",a.jsx(vc,{value:t.denominator})]}):null}function Qd(e){if(!e.value)return null;const t=e.value.display||e.value.reference||ir(e.value);return e.link!==!1&&e.value.reference?a.jsx(qe,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}const on=m.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),debugMode:!1});on.displayName="ElementsContext";const m0=["extension","modifierExtension"],V8=["id",...VT].filter(e=>!m0.includes(e));function B8(e){return Object.entries(e).filter(([n,r])=>{var o;return!zt(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||m0.includes(n)&&!zt((o=r.slicing)==null?void 0:o.slices)||V8.includes(n)?!1:!(BT.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function HT(e,t,n,r){if(!zt(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 s=PT(i,t,n.discriminator,r);let l=s?t.findIndex(c=>c.name===s):-1;l===-1&&(l=t.length),o[l].push(i)}return o}async function WT({medplum:e,property:t}){return new Promise((n,r)=>{var l,c;if(!t.slicing){n([]);return}const o=[],i=[],s=[];for(const u of t.slicing.slices){if(!jT(u)){console.debug("Unsupported slice definition",u);continue}let d;zt(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?s.push(e.requestProfileSchema(d)):s.push(Promise.resolve([]))}Promise.all(s).then(()=>{for(let u=0;u<o.length;u++){const d=o[u],f=i[u];if(f){const h=Ts(f);d.typeSchema=h}}n(o)}).catch(r)})}function fh(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function U8(e){var s,l;const{slice:t,property:n}=e,r=((s=t.typeSchema)==null?void 0:s.elements)??t.elements,o=m.useContext(on),i=m.useMemo(()=>{var c;if(zt(r))return Ma({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 fh(on.Provider,i,a.jsx(a.Fragment,{children:e.value.map((c,u)=>a.jsx("div",{children:a.jsx(Ur,{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 H8(e){var g;const{property:t,propertyType:n}=e,r=se(),o=m.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[i,s]=m.useState(!0),[l,c]=m.useState([]),[u,d]=m.useState(()=>[o]),f=m.useContext(on);if(m.useEffect(()=>{WT({medplum:r,property:t}).then(v=>{c(v);const S=HT(o,v,t.slicing,f.profileUrl);d(S),s(!1)}).catch(v=>{console.error(v),s(!1)})},[r,t,f.profileUrl,d,o]),i)return a.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((y,x)=>a.jsx("div",{children:a.jsx(Ur,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:y,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${x}-${v.length}`));if(e.includeDescriptionListEntry){if(!zt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const y=e.path.split(".").pop();h=a.jsx(jo,{term:ds(y),children:S})}else h=a.jsx(a.Fragment,{children:S})}return a.jsxs(a.Fragment,{children:[l.map((v,S)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let y=a.jsx(U8,{path:e.path,slice:v,property:t,value:u[S],ignoreMissingValues:e.ignoreMissingValues,link:e.link},v.name);return e.includeDescriptionListEntry&&(y=a.jsx(jo,{term:ds(v.name),children:y},v.name)),y}),h]})}function Zc(e,t,n){const r=fn(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 W8(e,t,n){const r=JP(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function q8(e){const{elementDefinitionType:t}=e,n=se(),r=m.useContext(on),[o,i]=m.useState(YP("Extension")),s=m.useMemo(()=>{if(zt(t==null?void 0:t.profile))return t.profile[0]},[t]),[l,c]=m.useState(s!==void 0);if(m.useEffect(()=>{s&&(c(!0),n.requestProfileSchema(s).then(()=>{const f=Ts(s);c(!1),f&&i(f)}).catch(f=>{c(!1),console.warn(f)}))},[n,s]),s&&(l||!By(s)))return a.jsx("div",{children:"Loading..."});const u=o.elements["value[x]"];if((u==null?void 0:u.max)!==0){const[f,h]=Zc({type:"Extension",value:e.value},"value[x]",s??r.profileUrl);return a.jsx(Ur,{propertyType:h,value:f})}return a.jsx(Kd,{path:e.path,value:{type:o.name,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:s})}function Ur(e){var s;const{property:t,propertyType:n,value:r}=e;if((s=t==null?void 0:t.path)==null?void 0:s.endsWith(".id"))return a.jsxs(G,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Vt(r)&&a.jsx(Zj,{value:r,timeout:2e3,children:({copied:l,copy:c})=>a.jsx(Ja,{label:l?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(Zt,{variant:"subtle",color:l?"teal":"gray",onClick:c,children:l?a.jsx(dh,{size:"1rem"}):a.jsx(IT,{size:"1rem"})})})})]});const i=!!e.arrayElement;if(t!=null&&t.max&&t.max>1&&!i)return n===W.Attachment?a.jsx(N8,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(H8,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case W.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case W.SystemString:case W.string:return a.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 a.jsx(a.Fragment,{children:r});case W.canonical:return a.jsx(Qd,{value:{reference:r},link:e.link});case W.dateTime:case W.instant:return a.jsx(a.Fragment,{children:In(r)});case W.markdown:return a.jsx("pre",{children:r});case W.Address:return a.jsx(Q6,{value:r});case W.Annotation:return a.jsx(a.Fragment,{children:r==null?void 0:r.text});case W.Attachment:return a.jsx(Jc,{value:r,maxWidth:e.maxWidth});case W.CodeableConcept:return a.jsx(lo,{value:r});case W.Coding:return a.jsx(O8,{value:r});case W.ContactDetail:return a.jsx($8,{value:r});case W.ContactPoint:return a.jsx(UT,{value:r});case W.HumanName:return a.jsx(a0,{value:r});case W.Identifier:return a.jsx(L8,{value:r});case W.Money:return a.jsx(F8,{value:r});case W.Period:return a.jsx(a.Fragment,{children:YL(r)});case W.Quantity:case W.Duration:return a.jsx(vc,{value:r});case W.Range:return a.jsx(h0,{value:r});case W.Ratio:return a.jsx(z8,{value:r});case W.Reference:return a.jsx(Qd,{value:r,link:e.link});case W.Timing:return a.jsx(a.Fragment,{children:uT(r)});case W.Dosage:case W.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Kd,{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 a.jsx(q8,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Kd,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const qT=["extension","modifierExtension"],G8=VT.filter(e=>!qT.includes(e));function Kd(e){const t=e.value,{value:n,type:r}=t,o=m.useContext(on),i=e.profileUrl??(o==null?void 0:o.profileUrl),s=m.useMemo(()=>rh(r,i),[i,r]),l=m.useMemo(()=>{if(s)return Ma({parentContext:o,elements:s.elements,path:e.path,profileUrl:s.url})},[s,e.path,o]);if(Vt(n))return null;if(!s)return a.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return a.jsx("div",{children:n.name});const c=l??o;return fh(on.Provider,l,a.jsx(d0,{compact:e.compact,children:Object.entries(c.elements).map(([u,d])=>{var v;if(qT.includes(u)&&Vt((v=d.slicing)==null?void 0:v.slices))return null;if(G8.includes(u))return null;if(BT.includes(u)&&d.path.split(".").length===2||u.includes("."))return null;const[f,h]=Zc(t,u,c.profileUrl);if((e.ignoreMissingValues||d.max===0)&&Vt(f)||e.path.endsWith(".extension")&&(u==="url"||u==="id"))return null;const p=d.max>1||d.isArray,g=a.jsx(Ur,{property:d,propertyType:h,path:e.path+"."+u,value:f,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:p,link:e.link},u);return p?g:a.jsx(jo,{term:ds(u),children:g},u)})}))}function GT(e){const{debugMode:t}=m.useContext(on);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,a.jsxs(ee,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(_t.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,children:null})})]})}function Ke(e,t){var n,r,o;return(o=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(i=>{var s;return QT((s=i.expression)==null?void 0:s[0],t)}))==null?void 0:r.map(i=>{var s;return(s=i.details)==null?void 0:s.text}))==null?void 0:o.join(`
|
|
516
|
-
`)}function eu(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return QT((o=r.expression)==null?void 0:o[0],t)})}const Vu=/\[\d+\]/;function QT(e,t){const n=typeof e=="string"&&Vu.test(e),r=typeof t=="string"&&Vu.test(t);if(n!==r&&(e=e==null?void 0:e.replace(Vu,""),t=t==null?void 0:t.replace(Vu,"")),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 ft(e){const{debugMode:t}=m.useContext(on);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,a.jsx(_t.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,error:Ke(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children})}function KT(e,t,n,r,o){const i=r.type;if(i.length>1)for(const s of i){const l=t.replace("[x]",Gt(s.code));l in e&&delete e[l]}return e[n]=o,e}function Q8(e){return!!e&&!Vt(e.url)&&!Vt(e.name)}function K8(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:i,valuePath:s,...l}=e,[c,u]=m.useState(t);function d(f){const h=X8(f);u(h),n&&n(h)}return a.jsx(c0,{defaultValue:c&&Y8(c),onChange:d,withHelpText:r??!0,...l})}function Y8(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function X8(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function YT(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,s]=m.useState(t);function l(c){const u=c[0],d=u&&Z8(u);s(d),n&&n(d)}return a.jsx(c0,{defaultValue:i&&J8(i),maxValues:1,onChange:l,withHelpText:r??!0,...o})}function J8(e){return{system:e.system,code:e.code,display:e.display}}function Z8(e){return{system:e.system,code:e.code,display:e.display}}function XT(e){const{path:t,outcome:n}=e,{elementsByPath:r}=m.useContext(on),[o,i]=m.useState(e.defaultValue),s=m.useRef();s.current=o;const[l,c,u]=m.useMemo(()=>["system","use","value"].map(v=>r[t+"."+v]),[r,t]);function d(v){v&&Object.keys(v).length===0&&(v=void 0),i(v),e.onChange&&e.onChange(v)}function f(v){const S={...s.current,system:v};v||delete S.system,d(S)}function h(v){const S={...s.current,use:v};v||delete S.use,d(S)}function p(v){const S={...s.current,value:v};v||delete S.value,d(S)}const g=e.valuePath??t;return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(Tt,{"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((l==null?void 0:l.min)??0)>0,onChange:v=>f(v.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Ke(n,g+".system")}),a.jsx(Tt,{"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((c==null?void 0:c.min)??0)>0,onChange:v=>h(v.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Ke(n,g+".use")}),a.jsx(fe,{placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((u==null?void 0:u.min)??0)>0,onChange:v=>p(v.currentTarget.value),error:Ke(n,g+".value")})]})}function ez(e){var l;const[t,n]=m.useState(e.defaultValue),r=m.useRef();r.current=t;function o(c){n(c),e.onChange&&e.onChange(c)}function i(c){const u={...r.current,name:c};c||delete u.name,o(u)}function s(c){const u={...r.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(fe,{"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:c=>i(c.currentTarget.value)}),a.jsx(XT,{name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:s,outcome:e.outcome})]})}function tz(e){if(!e)return"";const t=new Date(e);return ih(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function JT(e){if(!e)return"";const t=new Date(e);return ih(t)?t.toISOString():""}var nz={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.1.5-6e0fc2e2f",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function fs(e){return a.jsx(fe,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:rz(),defaultValue:tz(e.defaultValue),autoFocus:e.autoFocus,error:Ke(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(JT(n))}}})}function rz(){return nz.NODE_ENV==="test"?"text":"datetime-local"}function oz(e){const{propertyType:t}=e,n=se(),[r,o]=m.useState(),i=m.useMemo(()=>{if(zt(t.profile))return t.profile[0]},[t]),[s,l]=m.useState(i!==void 0);return m.useEffect(()=>{i&&(l(!0),n.requestProfileSchema(i).then(()=>{const c=Ts(i);l(!1),o(c)}).catch(c=>{l(!1),console.warn(c)}))},[n,i]),i&&(s||!By(i))?a.jsx("div",{children:"Loading..."}):a.jsx(v0,{profileUrl:i,path:e.path,typeName:(r==null?void 0:r.name)??"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function iz(e){var h,p,g;const{outcome:t,path:n}=e,[r,o]=m.useState(e.defaultValue);function i(v){o(v),e.onChange&&e.onChange(v)}function s(v){i({...r,use:v||void 0})}function l(v){i({...r,prefix:v?v.split(" "):void 0})}function c(v){i({...r,given:v?v.split(" "):void 0})}function u(v){i({...r,family:v||void 0})}function d(v){i({...r,suffix:v?v.split(" "):void 0})}const f=e.valuePath??n;return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Tt,{defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:v=>s(v.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Ke(t,f+".use")}),a.jsx(fe,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(h=r==null?void 0:r.prefix)==null?void 0:h.join(" "),onChange:v=>l(v.currentTarget.value),error:Ke(t,f+".prefix")}),a.jsx(fe,{placeholder:"Given",name:e.name+"-given",defaultValue:(p=r==null?void 0:r.given)==null?void 0:p.join(" "),onChange:v=>c(v.currentTarget.value),error:Ke(t,f+".given")}),a.jsx(fe,{name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:v=>u(v.currentTarget.value),error:Ke(t,f+".family")}),a.jsx(fe,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(g=r==null?void 0:r.suffix)==null?void 0:g.join(" "),onChange:v=>d(v.currentTarget.value),error:Ke(t,f+".suffix")})]})}function sz(e){const[t,n]=m.useState(e.defaultValue),{elementsByPath:r}=m.useContext(on),[o,i]=m.useMemo(()=>["system","value"].map(c=>r[e.path+"."+c]),[r,e.path]);function s(c){n(c),e.onChange&&e.onChange(c)}const l=e.valuePath??e.path;return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(fe,{placeholder:"System",required:((o==null?void 0:o.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:c=>s({...t,system:c.currentTarget.value}),error:Ke(e.outcome,l+".system")}),a.jsx(fe,{placeholder:"Value",required:((i==null?void 0:i.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:c=>s({...t,value:c.currentTarget.value}),error:Ke(e.outcome,l+".value")})]})}const az=["USD","EUR","CAD","GBP","AUD"];function lz(e){var c;const{onChange:t}=e,[n,r]=m.useState(e.defaultValue),o=m.useCallback(u=>{r(u),t&&t(u)},[t]),i=m.useCallback(u=>{o({...n,currency:u.currentTarget.value})},[n,o]),s=m.useCallback(u=>{o({...n,value:u.currentTarget.valueAsNumber})},[n,o]),l=a.jsx(Tt,{defaultValue:n==null?void 0:n.currency,data:az,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:i});return a.jsx(fe,{type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((c=n==null?void 0:n.value)==null?void 0:c.toString())??"USD",leftSection:a.jsx(dF,{size:14}),rightSection:l,rightSectionWidth:92,onChange:s})}function cz(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(fs,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>r({...t,start:o})}),a.jsx(fs,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>r({...t,end:o})})]})}function hs(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Tt,{style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:o=>r({...t,comparator:o.currentTarget.value})}),a.jsx(fe,{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:o=>{e.disableWheel&&o.currentTarget.blur()},onChange:o=>{r({...t,value:uz(o.currentTarget.value)})}}),a.jsx(fe,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>r({...t,unit:o.currentTarget.value})})]})}function uz(e){if(e)return parseFloat(e)}function p0(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(hs,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>r({...t,low:o})}),a.jsx(hs,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>r({...t,high:o})})]})}function dz(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(hs,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>r({...t,numerator:o})}),a.jsx(hs,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>r({...t,denominator:o})})]})}const fz={Device:"device-name",Observation:"code",User:"email:contains"},hz=["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","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function mz(e){return{value:yt(e),label:Ao(e),resource:e}}function el(e){const t=se(),{resourceType:n,searchCriteria:r}=e,[o,i]=m.useState(),s=mt(e.defaultValue,i),l=e.onChange,c=m.useCallback(async(d,f)=>{const h=gz(n),p=new URLSearchParams({[h]:d??"",_count:"10",...r});return await t.searchResources(n,p,{signal:f})},[t,n,r]),u=m.useCallback(d=>{l&&l(d[0])},[l]);return zt(e.defaultValue)&&!o&&!s?null:a.jsx(l0,{name:e.name,required:e.required,itemComponent:pz,defaultValue:s,placeholder:e.placeholder,maxValues:1,toOption:mz,loadOptions:c,onChange:u,clearable:!0})}const pz=m.forwardRef(({label:e,resource:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs(ee,{wrap:"nowrap",children:[a.jsx(Ai,{value:t}),a.jsxs("div",{children:[a.jsx(de,{children:e}),a.jsx(de,{size:"xs",c:"dimmed",children:t.birthDate})]})]})}));function gz(e){return fz[e]??(hz.includes(e)?"name":"_id")}function hh(e){const{onChange:t}=e,n=se(),[r,o]=m.useState(e.defaultValue),[i,s]=m.useState(()=>vz(e.targetTypes)),[l,c]=m.useState(()=>yz(e.defaultValue,i)),u=m.useRef(new ST),d=m.useMemo(()=>(l==null?void 0:l.type)==="profile"?{...e.searchCriteria,_profile:l.value}:e.searchCriteria,[e.searchCriteria,l]);m.useEffect(()=>{let p=!1;const g=i==null?void 0:i.map(v=>{if(!wz(v))return Promise.resolve(v);p=!0;const S=v.value,y=u.current.get(S);if(y)return y;const x=xz(n,v.value).then(b=>{const j={...v};return b?zt(b.type)?(j.resourceType=b.type,j.name=b.name,j.title=b.title):(console.error(`StructureDefinition.type missing for ${v.value}`),j.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${v.value}`),j.error="StructureDefinition not found"),j}).catch(b=>(console.error(b),{...v,error:b})),w=new _r(x);return u.current.set(S,w),w});!g||!p||Promise.all(g).then(v=>{if(s(v),!l)return;const S=v.findIndex(y=>y.value===l.value||y.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=m.useCallback(p=>{const g=p?vt(p):void 0;o(g),t&&t(g)},[t]),h=m.useMemo(()=>i?i.map(p=>({value:p.value,label:p.type==="profile"?p.title??p.name??p.resourceType??p.value:p.value})):[],[i]);return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&a.jsx(Tt,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:l==null?void 0:l.resourceType,autoFocus:e.autoFocus,onChange:p=>{const g=p.currentTarget.value,v=i.find(S=>S.value===g);c(v)},data:h}),!i&&a.jsx(u0,{autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:l==null?void 0:l.resourceType,onChange:p=>{c(p?{type:"resourceType",value:p,resourceType:p}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(el,{resourceType:l==null?void 0:l.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:d,onChange:f})]})}function vz(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 yz(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 xz(e,t){const n=Ts(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
517
|
-
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
518
|
-
type,
|
|
519
|
-
name,
|
|
520
|
-
title,
|
|
521
|
-
}
|
|
522
|
-
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function wz(e){return e.type==="profile"&&!(e!=null&&e.error)&&Vt(e.resourceType)}const Sz="_indented_ldk1d_1",ZT={indented:Sz};function ek({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(oe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(qd,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(Zt,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(qd,{size:"1.25rem"})})}function tk({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(Zt,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(Wd,{size:"1.25rem"})})}function bz(e){var h,p;const{slice:t,property:n}=e,[r,o]=m.useState(e.defaultValue),i=((h=t.typeSchema)==null?void 0:h.elements)??t.elements,s=m.useContext(on),l=m.useMemo(()=>{var g;if(zt(i))return Ma({parentContext:s,elements:i,path:e.path,profileUrl:(g=t.typeSchema)==null?void 0:g.url})},[s,e.path,(p=t.typeSchema)==null?void 0:p.url,i]);function c(g){o(g),e.onChange&&e.onChange(g)}const u=t.min>0,d=Vt(t.elements),f=hT(t.name);return fh(on.Provider,l,a.jsx(ft,{title:f,description:t.definition,withAsterisk:u,fhirPath:`${n.path}:${t.name}`,testId:e.testId,children:a.jsxs(Ie,{className:d?ZT.indented:void 0,children:[r.map((g,v)=>a.jsxs(ee,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${v}`,children:a.jsx(g0,{elementDefinitionType:t.type[0],name:t.name,defaultValue:g,onChange:S=>{const y=[...r];y[v]=S,c(y)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0})}),r.length>t.min&&a.jsx(tk,{propertyDisplayName:f,testId:e.testId&&`${e.testId}-remove-${v}`,onClick:S=>{lt(S);const y=[...r];y.splice(v,1),c(y)}})]},`${v}-${r.length}`)),r.length<t.max&&a.jsx(ee,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(ek,{propertyDisplayName:f,onClick:g=>{lt(g);const v=[...r,void 0];c(v)},testId:e.testId&&`${e.testId}-add`})})]})}))}function Cz(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function Ez(e){var y;const{property:t}=e,n=se(),[r,o]=m.useState(!0),[i,s]=m.useState([]),[l]=m.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[c,u]=m.useState(()=>[l]),d=m.useContext(on),f=(y=t.type[0])==null?void 0:y.code;m.useEffect(()=>{WT({medplum:n,property:t}).then(x=>{s(x);const w=HT(l,x,t.slicing,d.profileUrl);jz(w,x),u(w),o(!1)}).catch(x=>{console.error(x),o(!1)})},[n,t,l,d.profileUrl,u]);function h(x,w){const b=[...c];if(b[w]=x,u(b),e.onChange){const j=b.flat().filter(P=>P!==void 0);e.onChange(j)}}if(r)return a.jsx("div",{children:"Loading..."});const p=i.length,g=c[p],v=!(e.hideNonSliceValues??(f==="Extension"&&i.length>0)),S=ds(t.path);return a.jsxs(Ie,{className:e.indent?ZT.indented:void 0,children:[i.map((x,w)=>a.jsx(bz,{slice:x,path:e.path,valuePath:e.valuePath,property:t,defaultValue:c[w],onChange:b=>{h(b,w)},testId:`slice-${x.name}`},x.name)),v&&g.map((x,w)=>a.jsxs(ee,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(tl,{arrayElement:!0,property:e.property,name:e.name+"."+w,path:e.path,valuePath:Cz(e.path,e.valuePath,w),defaultValue:x,onChange:b=>{const j=[...g];j[w]=b,h(j,p)},defaultPropertyType:void 0,outcome:e.outcome})}),a.jsx(tk,{propertyDisplayName:S,testId:`nonsliced-remove-${w}`,onClick:b=>{lt(b);const j=[...g];j.splice(w,1),h(j,p)}})]},`${w}-${g.length}`)),v&&c.flat().length<t.max&&a.jsx(ee,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(ek,{propertyDisplayName:S,onClick:x=>{lt(x);const w=[...g];w.push(void 0),h(w,p)},testId:"nonsliced-add"})})]})}function jz(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 Pz(e){const[t,n]=m.useState(!1),r=cb(),o=m.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),a.jsxs(ls,{gap:"xs",children:[a.jsx(Es,{...e,styles:{...i,root:{...i.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(Zt,{title:"Copy secret",onClick:()=>{var s;r.copy((s=o.current)==null?void 0:s.value),xe({color:"green",message:"Copied"})},children:a.jsx(IT,{})})]})}const Tz=["sun","mon","tue","wed","thu","fri","sat"];function kz(e){const[t,n]=m.useState(e.defaultValue),[r,o]=m.useState(!1),i=m.useRef();return i.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:uT(i.current)||"No repeat"}),a.jsx(oe,{onClick:()=>o(!0),children:"Edit"})]}),a.jsx(Rz,{visible:r,defaultValue:i.current,onOk:s=>{e.onChange&&e.onChange(s),n(s),o(!1)},onCancel:()=>o(!1)})]})}const Bw={repeat:{period:1,periodUnit:"d"}};function Rz(e){const[t,n]=m.useState(e.defaultValue||Bw),r=m.useRef();r.current=t;function o(u){n({...r.current,event:[u]})}function i(u){n({...r.current,repeat:u})}function s(u){var d;i({...(d=r.current)==null?void 0:d.repeat,period:u})}function l(u){var d;i({...(d=r.current)==null?void 0:d.repeat,periodUnit:u})}function c(u){var d;i({...(d=r.current)==null?void 0:d.repeat,dayOfWeek:u})}return a.jsx($n,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Ie,{children:[a.jsx(ft,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(fs,{name:"timing-dialog-start",onChange:u=>o(u)})}),a.jsx(Bc,{label:"Repeat",checked:!!t.repeat,onChange:u=>i(u.currentTarget.checked?Bw.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(ft,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(fe,{type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:u=>s(parseInt(u.currentTarget.value,10)||1)}),a.jsx(Tt,{id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:u=>l(u.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&a.jsx(ft,{title:"Repeat on",children:a.jsx(lc.Group,{multiple:!0,onChange:c,children:a.jsx(ee,{justify:"space-between",mt:"md",gap:"xs",children:Tz.map(u=>a.jsx(lc,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),a.jsx(ee,{justify:"flex-end",children:a.jsx(oe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function tl(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,s=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(i===W.Attachment)return a.jsx(M8,{name:n,defaultValue:o,onChange:r});const c=((l=s[0])==null?void 0:l.code)!==W.Extension;return a.jsx(Ez,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:c,onChange:r,outcome:e.outcome})}else return s.length>1?a.jsx(_z,{elementDefinitionTypes:s,...e}):a.jsx(g0,{name:n,defaultValue:o,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",Gt(s[0].code));e.onChange(c,u)}},outcome:e.outcome,elementDefinitionType:s[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath})}function _z(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(i=>i.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=m.useState(n);return a.jsxs(ee,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(Tt,{style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:i=>{o(t.find(s=>s.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),a.jsx(g0,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",Gt(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath})]})}function g0(e){const{name:t,onChange:n,outcome:r,binding:o,path:i,valuePath:s}=e,l=e.min!==void 0&&e.min>0,c=e.elementDefinitionType.code,u=m.useContext(on),d=m.useMemo(()=>{if(!Wy(c)||!Vt(e.defaultValue))return e.defaultValue;const p=Object.create(null);if(u.path===e.path)Dw(p,u.elements);else{const g=fc(u.path,e.path);if(g===void 0)return e.defaultValue;Dw(p,u.elements,g)}return zt(p)?p:e.defaultValue},[c,u.path,u.elements,e.path,e.defaultValue]);if(!c)return a.jsx("div",{children:"Property type not specified "});function f(){return{name:t,defaultValue:d,onChange:n,outcome:r,path:i,valuePath:s}}function h(){const p=Ke(e.outcome,s??i);return{id:t,name:t,"data-testid":t,defaultValue:d,required:l,error:p}}switch(c){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]"?a.jsx(Pz,{...h(),onChange:p=>{e.onChange&&e.onChange(p.currentTarget.value)}}):a.jsx(fe,{...h(),onChange:p=>{n&&n(p.currentTarget.value)}});case W.date:return a.jsx(fe,{...h(),type:"date",onChange:p=>{n&&n(p.currentTarget.value)}});case W.dateTime:case W.instant:return a.jsx(fs,{name:t,defaultValue:d,onChange:n,outcome:r});case W.decimal:case W.integer:case W.positiveInt:case W.unsignedInt:return a.jsx(fe,{...h(),type:"number",step:c===W.decimal?"any":"1",onChange:p=>{if(n){const g=p.currentTarget.valueAsNumber;n(Number.isNaN(g)?void 0:g)}}});case W.code:return a.jsx(FT,{...h(),error:void 0,onChange:n,binding:o==null?void 0:o.valueSet});case W.boolean:return a.jsx(br,{...h(),defaultChecked:!!d,onChange:p=>{n&&n(p.currentTarget.checked)}});case W.base64Binary:case W.markdown:return a.jsx(Es,{...h(),spellCheck:c!==W.base64Binary,onChange:p=>{n&&n(p.currentTarget.value)}});case W.Address:return a.jsx(K6,{...f()});case W.Annotation:return a.jsx(Y6,{...f()});case W.Attachment:return a.jsx(zT,{...f()});case W.CodeableConcept:return a.jsx(K8,{binding:o==null?void 0:o.valueSet,...f()});case W.Coding:return a.jsx(YT,{binding:o==null?void 0:o.valueSet,...f()});case W.ContactDetail:return a.jsx(ez,{...f()});case W.ContactPoint:return a.jsx(XT,{...f()});case W.Extension:return a.jsx(oz,{...f(),propertyType:e.elementDefinitionType});case W.HumanName:return a.jsx(iz,{...f()});case W.Identifier:return a.jsx(sz,{...f()});case W.Money:return a.jsx(lz,{...f()});case W.Period:return a.jsx(cz,{...f()});case W.Duration:case W.Quantity:return a.jsx(hs,{...f()});case W.Range:return a.jsx(p0,{...f()});case W.Ratio:return a.jsx(dz,{...f()});case W.Reference:return a.jsx(hh,{...f(),targetTypes:Iz(e.elementDefinitionType)});case W.Timing:return a.jsx(kz,{...f()});case W.Dosage:case W.UsageContext:default:return a.jsx(v0,{...f(),typeName:c})}}const Dz=[`${i$}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function Iz(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=Dz.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}function Az(e){const[t,n]=m.useState(e.defaultValue??{}),r=m.useContext(on),o=m.useMemo(()=>B8(r.elements),[r.elements]);function i(l){n(l),e.onChange&&e.onChange(l)}const s={type:e.type,value:t};return a.jsx(Ie,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([l,c])=>{const[u,d]=W8(s,l,c),f=c.min!==void 0&&c.min>0,h=e.valuePath?e.valuePath+"."+l:void 0,p=a.jsx(tl,{property:c,name:l,path:e.path+"."+l,valuePath:h,defaultValue:u,defaultPropertyType:d,onChange:(g,v)=>{i(KT({...t},l,v??l,c,g))},outcome:e.outcome},l);return e.type==="Extension"||m0.includes(l)?p:c.type.length===1&&c.type[0].code==="boolean"?a.jsx(GT,{title:ds(l),description:c.description,htmlFor:l,fhirPath:c.path,withAsterisk:f,children:p},l):a.jsx(ft,{title:ds(l),description:c.description,withAsterisk:f,htmlFor:l,outcome:e.outcome,fhirPath:c.path,errorExpression:h,children:p},l)})})}function v0(e){const[t]=m.useState(()=>e.defaultValue??{}),n=m.useContext(on),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=m.useMemo(()=>rh(e.typeName,r),[e.typeName,r]),i=(o==null?void 0:o.type)??e.typeName,s=m.useMemo(()=>{if(o)return Ma({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url})},[o,e.path,n]);return o?fh(on.Provider,s,a.jsx(Az,{path:e.path,valuePath:e.valuePath,type:i,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):a.jsxs("div",{children:[i," not implemented"]})}const Nz="_root_1vii2_1",Mz={root:Nz};function tu(e){const{children:t,...n}=e;return a.jsx(sy,{className:Mz.root,...n,children:t})}const Oz="_noteBody_10swh_1",$z="_noteCite_10swh_5",Lz="_noteRoot_10swh_10",Uw={noteBody:Oz,noteCite:$z,noteRoot:Lz};function nk({value:e}){return e?a.jsx(Ie,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&a.jsx(ry,{classNames:{cite:Uw.noteCite,root:Uw.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function nl(e){const{value:t,link:n,...r}=e,[o,i]=m.useState(),s=mt(t,i);let l;if(o&&!HP(o))l=`[${$e(o)}]`;else if(s)l=Ao(s);else return null;return n?a.jsx(qe,{to:t,...r,children:l}):a.jsx(de,{component:"span",...r,children:l})}function wa(e){return a.jsxs(ee,{gap:"xs",children:[a.jsx(Ai,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(nl,{value:e.value,link:e.link})]})}const Fz={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 y0(e){return a.jsx($c,{color:Fz[e.status],children:e.status})}const zz="_table_pe9td_1",Vz="_criticalRow_pe9td_12",Bz="_noteBody_pe9td_23",Uz="_noteCite_pe9td_27",Hz="_noteRoot_pe9td_32",rk={table:zz,criticalRow:Vz,noteBody:Bz,noteCite:Uz,noteRoot:Hz};x0.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function x0(e){var s;const t=se(),n=mt(e.value),[r,o]=m.useState();if(m.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];(s=l.contentType)!=null&&s.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return a.jsxs(Ie,{children:[a.jsx(ge,{children:"Diagnostic Report"}),a.jsx(Wz,{value:n}),r&&!e.hideSpecimenInfo&&qz(r),n.result&&a.jsx(Gz,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&a.jsx(nk,{value:i})]})}function Wz({value:e}){var t,n;return a.jsxs(ee,{mt:"md",gap:30,children:[e.subject&&a.jsxs("div",{children:[a.jsx(de,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(wa,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>a.jsxs("div",{children:[a.jsx(de,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(wa,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>a.jsxs("div",{children:[a.jsx(de,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(wa,{value:r,link:!0})]},r.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(de,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(de,{children:In(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(de,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(de,{children:Gt(e.status)})]})]})}function qz(e){return a.jsxs(Ie,{gap:"xs",children:[a.jsx(ge,{order:2,size:"h6",children:"Specimens"}),a.jsx(Rn,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return a.jsx(Rn.Item,{ml:"sm",children:a.jsxs(ee,{gap:20,children:[a.jsxs(ee,{gap:5,children:[a.jsx(de,{fw:500,children:"Collected:"})," ",In((n=t.collection)==null?void 0:n.collectedDateTime)]}),a.jsxs(ee,{gap:5,children:[a.jsx(de,{fw:500,children:"Received:"})," ",In(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function Gz(e){return a.jsxs("table",{className:rk.table,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Test"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Reference Range"}),a.jsx("th",{children:"Interpretation"}),a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Performer"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:a.jsx(ok,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function ok(e){var t;return a.jsx(a.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>a.jsx(Qz,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${_s(n)?n.reference:n.id}`))})}function Qz(e){var o,i;const t=mt(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=Xz(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:rt({[rk.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(qe,{to:t,children:a.jsx(lo,{value:t.code})})}),a.jsx("td",{children:a.jsx(Kz,{value:t})}),a.jsx("td",{children:a.jsx(Yz,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(lo,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(s=>a.jsx("div",{children:a.jsx(lo,{value:s})},`category-${Ti(s)}`))})}),a.jsx("td",{children:(i=t.performer)==null?void 0:i.map(s=>a.jsx(Qd,{value:s},s.reference))}),a.jsx("td",{children:t.status&&a.jsx(y0,{status:t.status})})]}),t.hasMember&&a.jsx(ok,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,children:a.jsx(nk,{value:t.note})})})]})}function Kz(e){const t=e.value;return a.jsx(a.Fragment,{children:dT(t)})}function Yz(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?a.jsx(a.Fragment,{children:t.text}):a.jsx(h0,{value:t}):null}function Xz(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 Jz="_paper_1igaj_1",Zz="_fill_1igaj_20",Hw={paper:Jz,fill:Zz};function w0(e){const{width:t,fill:n,className:r,children:o,...i}=e,s=t?{maxWidth:t}:void 0;return a.jsx(Hn,{className:rt(Hw.paper,n&&Hw.fill,r),style:s,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}var ik={},nu={};Object.defineProperty(nu,"__esModule",{value:!0});nu.Pointer=void 0;function eV(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function tV(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var nV=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var n=t.split("/").map(eV);if(n[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(n)},e.prototype.toString=function(){return this.tokens.map(tV).join("/")},e.prototype.evaluate=function(t){for(var n=null,r="",o=t,i=1,s=this.tokens.length;i<s;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}();nu.Pointer=nV;var Lt={},S0={};(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,s=new Array(i),l=0;l<i;l++)s[l]=r(o[l]);return s}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})(S0);var kn={};Object.defineProperty(kn,"__esModule",{value:!0});kn.diffAny=kn.diffObjects=kn.diffArrays=kn.intersection=kn.subtract=kn.isDestructive=void 0;var yc=S0;function rV(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}kn.isDestructive=rV;function Kp(e,t){var n={};for(var r in e)yc.hasOwnProperty.call(e,r)&&e[r]!==void 0&&(n[r]=1);for(var o in t)yc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete n[o];return Object.keys(n)}kn.subtract=Kp;function sk(e){for(var t=e.length,n={},r=0;r<t;r++){var o=e[r];for(var i in o)yc.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)}kn.intersection=sk;function oV(e){return e.op==="add"}function iV(e){return e.op==="remove"}function vm(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function ak(e,t,n,r){r===void 0&&(r=mh);var o={"0,0":{operations:[],cost:0}};function i(d,f){var h="".concat(d,",").concat(f),p=o[h];if(p===void 0){if(d>0&&f>0&&!r(e[d-1],t[f-1],n.add(String(d-1))).length)p=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(vm(v,S))}if(f>0){var y=i(d,f-1),x={op:"add",index:d-1,value:t[f-1]};g.push(vm(y,x))}if(d>0&&f>0){var w=i(d-1,f-1),b={op:"replace",index:d-1,original:e[d-1],value:t[f-1]};g.push(vm(w,b))}var j=g.sort(function(P,E){return P.cost-E.cost})[0];p=j}o[h]=p}return p}var s=isNaN(e.length)||e.length<=0?0:e.length,l=isNaN(t.length)||t.length<=0?0:t.length,c=i(s,l).operations,u=c.reduce(function(d,f){var h=d[0],p=d[1];if(oV(f)){var g=f.index+1+p,v=g<s+p?String(g):"-",S={op:f.op,path:n.add(v).toString(),value:f.value};return[h.concat(S),p+1]}else if(iV(f)){var S={op:f.op,path:n.add(String(f.index+p)).toString()};return[h.concat(S),p-1]}else{var y=n.add(String(f.index+p)),x=r(f.original,f.value,y);return[h.concat.apply(h,x),p]}},[[],0])[0];return u}kn.diffArrays=ak;function lk(e,t,n,r){r===void 0&&(r=mh);var o=[];return Kp(e,t).forEach(function(i){o.push({op:"remove",path:n.add(i).toString()})}),Kp(t,e).forEach(function(i){o.push({op:"add",path:n.add(i).toString(),value:t[i]})}),sk([e,t]).forEach(function(i){o.push.apply(o,r(e[i],t[i],n.add(i)))}),o}kn.diffObjects=lk;function mh(e,t,n,r){if(r===void 0&&(r=mh),e===t)return[];var o=(0,yc.objectType)(e),i=(0,yc.objectType)(t);return o=="array"&&i=="array"?ak(e,t,n,r):o=="object"&&i=="object"?lk(e,t,n,r):[{op:"replace",path:n.toString(),value:t}]}kn.diffAny=mh;var b0=H0&&H0.__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(Lt,"__esModule",{value:!0});Lt.apply=Lt.InvalidOperationError=Lt.test=Lt.copy=Lt.move=Lt.replace=Lt.remove=Lt.add=Lt.TestError=Lt.MissingError=void 0;var Mo=nu,C0=S0,sV=kn,co=function(e){b0(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);Lt.MissingError=co;var ck=function(e){b0(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);Lt.TestError=ck;function E0(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 uk(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function dk(e,t){var n=Mo.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new co(t.path):(E0(n.parent,n.key,(0,C0.clone)(t.value)),null)}Lt.add=dk;function fk(e,t){var n=Mo.Pointer.fromJSON(t.path).evaluate(e);return n.value===void 0?new co(t.path):(uk(n.parent,n.key),null)}Lt.remove=fk;function hk(e,t){var n=Mo.Pointer.fromJSON(t.path).evaluate(e);if(n.parent===null)return new co(t.path);if(Array.isArray(n.parent)){if(parseInt(n.key,10)>=n.parent.length)return new co(t.path)}else if(n.value===void 0)return new co(t.path);return n.parent[n.key]=(0,C0.clone)(t.value),null}Lt.replace=hk;function mk(e,t){var n=Mo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new co(t.from);var r=Mo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new co(t.path):(uk(n.parent,n.key),E0(r.parent,r.key,n.value),null)}Lt.move=mk;function pk(e,t){var n=Mo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new co(t.from);var r=Mo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new co(t.path):(E0(r.parent,r.key,(0,C0.clone)(n.value)),null)}Lt.copy=pk;function gk(e,t){var n=Mo.Pointer.fromJSON(t.path).evaluate(e);return(0,sV.diffAny)(n.value,t.value,new Mo.Pointer).length?new ck(n.value,t.value):null}Lt.test=gk;var vk=function(e){b0(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);Lt.InvalidOperationError=vk;function aV(e,t){switch(t.op){case"add":return dk(e,t);case"remove":return fk(e,t);case"replace":return hk(e,t);case"move":return mk(e,t);case"copy":return pk(e,t);case"test":return gk(e,t)}return new vk(t)}Lt.apply=aV;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=nu;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=Lt,r=kn;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,p){var g=u(f,h,p);return Array.isArray(g)?g:(0,r.diffAny)(f,h,p,d)}return d}function s(u,d,f){var h=new t.Pointer;return(f?i(f):r.diffAny)(u,d,h)}e.createPatch=s;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 p=l(u,h.path);if(p&&f.push(p),"from"in h){var g=l(u,h.from);g&&f.push(g)}}),f}e.createTests=c})(ik);const lV="_root_w6lfx_1",cV="_removed_w6lfx_16",uV="_added_w6lfx_21",ym={root:lV,removed:cV,added:uV};function dV(e){const t=se(),{original:n,revised:r}=e,[o,i]=m.useState(!1);m.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>i(!0)).catch(console.log)},[t,e.original.resourceType]);const s=m.useMemo(()=>{if(!o)return null;const l=[fo(n)],c=[fo(r)],u=[],d=fV(ik.createPatch(n,r));for(const f of d){const h=f.path,p=hV(h),g=mV(n.resourceType,p),v=f.op==="add"?void 0:gc(p,l),S=f.op==="remove"?void 0:gc(p,c);u.push({key:`op-${f.op}-${f.path}`,name:`${Gt(f.op)} ${p}`,path:(g==null?void 0:g.path)??n.resourceType+"."+p,property:g,originalValue:Ww(g,v),revisedValue:Ww(g,S)})}return u},[o,n,r]);return s?a.jsxs(ce,{className:ym.root,children:[a.jsx(ce.Thead,{children:a.jsxs(ce.Tr,{children:[a.jsx(ce.Th,{}),a.jsx(ce.Th,{children:"Before"}),a.jsx(ce.Th,{children:"After"})]})}),a.jsx(ce.Tbody,{children:s.map(l=>a.jsxs(ce.Tr,{children:[a.jsx(ce.Td,{children:l.name}),a.jsx(ce.Td,{className:ym.removed,children:l.originalValue&&a.jsx(Ur,{path:l.path,property:l.property,propertyType:l.originalValue.type,value:l.originalValue.value,ignoreMissingValues:!0})}),a.jsx(ce.Td,{className:ym.added,children:l.revisedValue&&a.jsx(Ur,{path:l.path,property:l.property,propertyType:l.revisedValue.type,value:l.revisedValue.value,ignoreMissingValues:!0})})]},l.key))})]}):null}function fV(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,s={op:r,path:o};i>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(s.op="replace",s.path=o.replace(/\/[^/]+$/,"")),t.some(l=>l.op===s.op&&l.path===s.path)||t.push(s)}return t}function hV(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 mV(e,t){var r;const n=sh(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 Ww(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:pV(t,!!(e!=null&&e.isArray))}}function pV(e,t){const n=BL(e).flatMap(r=>r.value);return t?n:n[0]}function j0(e){const{profileUrl:t}=e,n=se(),r=mt(e.value),[o,i]=m.useState();return m.useEffect(()=>{if(r)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{const s=Ts(t);s?i(s.name):console.error(`Schema not found for ${t}`)}).catch(s=>{console.error("Error in requestProfileSchema",s)});else{const s=r.resourceType;n.requestSchema(s).then(()=>{i(s)}).catch(console.error)}},[n,t,r]),!o||!r?null:a.jsx(Kd,{path:r.resourceType,value:{type:o,value:e.forceUseInput?e.value:r},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues})}function gV(e){return a.jsx(tu,{children:e.children})}function ms(e){var c,u;const{resource:t,profile:n,padding:r,popupMenuItems:o,...i}=e,s=n??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return a.jsxs(w0,{"data-testid":"timeline-item",fill:!0,...i,children:[a.jsxs(ee,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(Ai,{value:s,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(de,{size:"sm",children:a.jsx(nl,{c:"dark",fw:500,value:s,link:!0})}),a.jsxs(de,{size:"xs",children:[a.jsx(qe,{c:"dimmed",to:e.resource,children:In(l)}),a.jsx(de,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(qe,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(ne,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(ne.Target,{children:a.jsx(Zt,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${yt(e.resource)}`,children:a.jsx(hF,{})})}),o]})]}),a.jsxs(OT,{children:[r&&a.jsx("div",{style:{padding:"0 16px 16px 16px"},children:e.children}),!r&&a.jsx(a.Fragment,{children:e.children})]})]})}function yk(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(!xk(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(!xk(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 xk(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const vV="_pinnedComment_5uxzi_2",yV={pinnedComment:vV};function ph(e){const t=se(),n=ch(),r=t.getProfile(),o=m.useRef(null),i=mt(e.value),[s,l]=m.useState(),[c,u]=m.useState([]),d=e.loadTimelineResources,f=m.useRef(c);f.current=c;const h=m.useCallback(I=>{yk(I,i),I.reverse(),u(I)},[i]),p=m.useCallback(I=>{const M=[];for(const F of I){if(F.status!=="fulfilled")continue;const N=F.value;if(N.type==="history"&&l(N),N.entry)for(const A of N.entry)M.push(A.resource)}h(M)},[h]),g=m.useCallback(I=>h([...f.current,I]),[h]),v=m.useCallback(()=>{var F;let I,M;"resourceType"in e.value?(I=e.value.resourceType,M=e.value.id):[I,M]=(F=e.value.reference)==null?void 0:F.split("/"),d(t,I,M).then(p).catch(console.error)},[t,e.value,d,p]);m.useEffect(()=>v(),[v]);function S(I){!i||!e.createCommunication||t.createResource(e.createCommunication(i,r,I)).then(M=>g(M)).catch(console.error)}function y(I){!i||!e.createMedia||t.createResource(e.createMedia(i,r,I)).then(M=>g(M)).then(()=>kl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(dh,{size:16}),autoClose:2e3})).catch(M=>kl({id:"upload-notification",color:"red",title:"Upload error",message:$e(M),icon:a.jsx(Ow,{size:16}),autoClose:2e3}))}function x(I,M){return t.updateResource({...I,priority:M})}function w(I){x(I,"stat").then(v).catch(console.error)}function b(I){x(I,"routine").then(v).catch(console.error)}function j(I){n(`/${I.resourceType}/${I.id}`)}function P(I){n(`/${I.resourceType}/${I.id}/edit`)}function E(I){n(`/${I.resourceType}/${I.id}/delete`)}function T(I){var M;n(`/${I.resourceType}/${I.id}/_history/${(M=I.meta)==null?void 0:M.versionId}`)}function _(){xe({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function R(I){kl({id:"upload-notification",loading:!0,title:"Uploading...",message:jV(I),autoClose:!1,withCloseButton:!1})}function O(I){kl({id:"upload-notification",color:"red",title:"Upload error",message:$e(I),icon:a.jsx(Ow,{size:16}),autoClose:2e3})}return i?a.jsxs(gV,{children:[e.createCommunication&&a.jsx(w0,{children:a.jsx(Qe,{testid:"timeline-form",onSubmit:I=>{S(I.text);const M=o.current;M&&(M.value="",M.focus())},children:a.jsxs(ee,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(Ai,{value:r}),a.jsx(fe,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(Zt,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(CF,{size:16})}),a.jsx(f0,{securityContext:vt(i),onUpload:y,onUploadStart:_,onUploadProgress:R,onUploadError:O,children:I=>a.jsx(Zt,{...I,radius:"xl",color:"blue",variant:"filled",children:a.jsx(o0,{size:16})})})]})})}),c.map(I=>{var F;if(!I)return null;const M=`${I.resourceType}/${I.id}/${(F=I.meta)==null?void 0:F.versionId}`;if(I.resourceType===i.resourceType&&I.id===i.id)return a.jsx(xV,{history:s,resource:I,onDetails:T},M);switch(I.resourceType){case"AuditEvent":return a.jsx(CV,{resource:I,onDetails:j},M);case"Communication":return a.jsx(SV,{resource:I,onPin:I.priority!=="stat"?w:void 0,onUnpin:I.priority==="stat"?b:void 0,onDetails:j,onEdit:P,onDelete:E},M);case"DiagnosticReport":return a.jsx(EV,{resource:I,onDetails:j,onEdit:P,onDelete:E},M);case"Media":return a.jsx(bV,{resource:I,onDetails:j,onEdit:P,onDelete:E},M);default:return a.jsx(ms,{resource:I,padding:!0,children:a.jsx(j0,{value:I,ignoreMissingValues:!0})},M)}})]}):a.jsx(un,{style:{width:"100%",height:"100%"},children:a.jsx(Gn,{})})}function $a(e){return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Label,{children:"Resource"}),e.onPin&&a.jsx(ne.Item,{leftSection:a.jsx(PF,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${yt(e.resource)}`,children:"Pin"}),e.onUnpin&&a.jsx(ne.Item,{leftSection:a.jsx(TF,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${yt(e.resource)}`,children:"Unpin"}),e.onDetails&&a.jsx(ne.Item,{leftSection:a.jsx(xF,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${yt(e.resource)}`,children:"Details"}),e.onEdit&&a.jsx(ne.Item,{leftSection:a.jsx(mF,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${yt(e.resource)}`,children:"Edit"}),e.onDelete&&a.jsxs(a.Fragment,{children:[a.jsx(ne.Divider,{}),a.jsx(ne.Label,{children:"Danger zone"}),a.jsx(ne.Item,{color:"red",leftSection:a.jsx(MT,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${yt(e.resource)}`,children:"Delete"})]})]})}function xV(e){const t=wV(e.history,e.resource);return t?a.jsx(ms,{resource:e.resource,padding:!0,popupMenuItems:a.jsx($a,{...e}),children:a.jsx(dV,{original:t,revised:e.resource})}):a.jsxs(ms,{resource:e.resource,padding:!0,popupMenuItems:a.jsx($a,{...e}),children:[a.jsx("h3",{children:"Created"}),a.jsx(j0,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function wV(e,t){const n=e.entry,r=n.findIndex(o=>{var i,s,l;return((s=(i=o.resource)==null?void 0:i.meta)==null?void 0:s.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function SV(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:yV.pinnedComment;return a.jsx(ms,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:a.jsx($a,{...e}),children:a.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function bV(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 a.jsx(ms,{resource:e.resource,padding:!!n,popupMenuItems:a.jsx($a,{...e}),children:a.jsx(Jc,{value:e.resource.content})})}function CV(e){return a.jsx(ms,{resource:e.resource,padding:!0,popupMenuItems:a.jsx($a,{...e}),children:a.jsx(Er,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function EV(e){return a.jsx(ms,{resource:e.resource,padding:!0,popupMenuItems:a.jsx($a,{...e}),children:a.jsx(x0,{value:e.resource})})}function jV(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${xm(e.loaded)} / ${xm(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${xm(e.loaded)}`}function xm(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 PV(e){return a.jsx(ph,{value:e.resource,loadTimelineResources:async(t,n,r)=>{const o=`${n}/${r}`;return Promise.allSettled([t.readHistory(n,r),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:100})])}})}function Re(e){const{children:t,...n}=e;return a.jsx(tu,{children:a.jsx(w0,{...n,children:t})})}function TV(e){return a.jsx(ph,{value:e.encounter,loadTimelineResources:async(t,n,r)=>Promise.allSettled([t.readHistory("Encounter",r),t.search("Communication","encounter=Encounter/"+r),t.search("Media","encounter=Encounter/"+r)]),createCommunication:(t,n,r)=>({resourceType:"Communication",status:"completed",encounter:vt(t),subject:t.subject,sender:vt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",encounter:vt(t),subject:t.subject,operator:vt(n),issued:new Date().toISOString(),content:r})})}function kV(e){let t;try{t=O7(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return a.jsx(Ur,{value:t[0]||"",propertyType:e.propertyType})}function RV(e){return a.jsxs($n,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(G,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(Qw,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(Qw,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(de,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function Qw(e){return a.jsx(oe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const _V={string:[ae.EQUALS,ae.NOT,ae.CONTAINS,ae.EXACT],fulltext:[ae.EQUALS,ae.NOT,ae.CONTAINS,ae.EXACT],token:[ae.EQUALS,ae.NOT],reference:[ae.EQUALS,ae.NOT],numeric:[ae.EQUALS,ae.NOT_EQUALS,ae.GREATER_THAN,ae.LESS_THAN,ae.GREATER_THAN_OR_EQUALS,ae.LESS_THAN_OR_EQUALS],quantity:[ae.EQUALS,ae.NOT_EQUALS,ae.GREATER_THAN,ae.LESS_THAN,ae.GREATER_THAN_OR_EQUALS,ae.LESS_THAN_OR_EQUALS],date:[ae.EQUALS,ae.NOT_EQUALS,ae.GREATER_THAN,ae.LESS_THAN,ae.GREATER_THAN_OR_EQUALS,ae.LESS_THAN_OR_EQUALS,ae.STARTS_AFTER,ae.ENDS_BEFORE,ae.APPROXIMATELY],datetime:[ae.EQUALS,ae.NOT_EQUALS,ae.GREATER_THAN,ae.LESS_THAN,ae.GREATER_THAN_OR_EQUALS,ae.LESS_THAN_OR_EQUALS,ae.STARTS_AFTER,ae.ENDS_BEFORE,ae.APPROXIMATELY]},DV={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",identifier:"identifier",iterate:"iterate"};function P0(e,t){return{...e,filters:t,offset:0,name:void 0}}function wk(e,t){return P0(e,(e.filters??[]).filter(n=>n.code!==t))}function gh(e,t,n,r,o){const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),P0(e,i)}function IV(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function AV(e,t){return T0(e,t,-1)}function NV(e,t){return T0(e,t,0)}function MV(e,t){return T0(e,t,1)}function T0(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),R0(e,t,r,o)}function OV(e,t){return k0(e,t,-1)}function $V(e,t){return k0(e,t,0)}function LV(e,t){return k0(e,t,1)}function k0(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),R0(e,t,r,o)}function FV(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),R0(e,t,n,new Date)}function R0(e,t,n,r){return e=wk(e,t),e=Kw(e,t,ae.GREATER_THAN_OR_EQUALS,n),e=Kw(e,t,ae.LESS_THAN_OR_EQUALS,r),e}function Kw(e,t,n,r){return gh(e,t,n,r.toISOString())}function Yw(e,t,n=!0){return gh(e,t,ae.MISSING,n.toString())}function zV(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function VV(e,t){const n=e.count??ah,r=(t-1)*n;return zV(e,r)}function BV(e,t,n){return t===UV(e)&&n!==void 0&&n===HV(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function UV(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function HV(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function WV(e){return _V[e.type]}function _0(e){return DV[e]??""}function ki(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(Gt).join(" "))}function qV(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"?In((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?GV(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?QV(e,t.searchParams[0]):null}function GV(e,t){var i,s,l;const n=((l=(s=(i=t.path)==null?void 0:i.split("."))==null?void 0:s.pop())==null?void 0:l.replaceAll("[x]",""))??"",[r,o]=Zc({type:e.resourceType,value:e},n);return r?a.jsx(Ur,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function QV(e,t){const n=gc(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(Ur,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function KV(e){const t=m.useRef(!1),[n,r]=m.useState({search:JSON.parse(ir(e.search))}),[o,i]=m.useState(!1);m.useEffect(()=>{r({search:e.search})},[e.search]);const s=m.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=YP(c),d=qy(c);return hc(YV(u,d)).map(f=>({value:f,label:ki(f)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){r({search:{...n.search,fields:c}})}return a.jsx($n,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs(Ie,{children:[a.jsx(Gf,{style:{width:550},placeholder:"Select fields to display",data:s,value:n.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),a.jsx(ee,{justify:"flex-end",children:a.jsx(oe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function YV(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(ki(i));if(t)for(const i of Object.keys(t)){const s=ki(i);!r.has(i)&&!o.has(s)&&(n.push(i),r.add(i),o.add(s))}return n}function Sk(e){var o;const{resourceType:t,filter:n}=e,r=(o=No.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===ae.EQUALS||n.operator===ae.NOT_EQUALS))return a.jsx(nl,{value:{reference:n.value}});const i=sh(t,r);if(n.code==="_lastUpdated"||i.type===oi.DATETIME)return a.jsx(a.Fragment,{children:In(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function bk(e){const t=sh(e.resourceType,e.searchParam),n="filter-value";switch(t.type){case oi.REFERENCE:return a.jsx(hh,{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 oi.BOOLEAN:return a.jsx(br,{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 oi.DATE:return a.jsx(fe,{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 oi.DATETIME:return a.jsx(fs,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case oi.NUMBER:return a.jsx(fe,{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 oi.QUANTITY:return a.jsx(hs,{name:n,defaultValue:XV(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(fe,{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 XV(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function JV(e){const[t,n]=m.useState(JSON.parse(ir(e.search))),[r,o]=m.useState(-1),i=m.useRef(t);i.current=t,m.useEffect(()=>{n(JSON.parse(ir(e.search)))},[e.search]);function s(d){n(gh(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=qy(l)??{},u=t.filters||[];return a.jsxs($n,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[a.jsx("div",{children:a.jsxs("table",{children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:380}}),a.jsx("col",{style:{width:120}})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Field"}),a.jsx("th",{children:"Operation"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Actions"})]})}),a.jsxs("tbody",{children:[u.map((d,f)=>f===r?a.jsx(Xw,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const p=[...u];p[f]=h,n(P0(i.current,p)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):a.jsx(ZV,{resourceType:l,filter:d,onEdit:()=>o(f),onDelete:()=>n(IV(i.current,f))},`filter-${d.code}-${d.operator}-${d.value}-display`)),a.jsx(Xw,{resourceType:l,searchParams:c,okText:"Add",onOk:s})]})]})}),a.jsx(ee,{justify:"flex-end",mt:"xl",children:a.jsx(oe,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function ZV(e){const{filter:t}=e;return a.jsxs("tr",{children:[a.jsx("td",{children:ki(t.code)}),a.jsx("td",{children:_0(t.operator)}),a.jsx("td",{children:a.jsx(Sk,{resourceType:e.resourceType,filter:t})}),a.jsxs("td",{children:[a.jsx(oe,{size:"compact-md",variant:"outline",onClick:e.onEdit,children:"Edit"}),a.jsx(oe,{size:"compact-md",variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function Xw(e){const[t,n]=m.useState(e.defaultValue??{}),r=m.useRef(t);r.current=t;function o(u){n({...r.current,code:u})}function i(u){n({...r.current,operator:u})}function s(u){n({...r.current,value:u})}const l=e.searchParams[t.code],c=l&&WV(l);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Tt,{"data-testid":"filter-field",defaultValue:r.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:ki(u)}))]})}),a.jsx("td",{children:c&&a.jsx(Tt,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:_0(u)}))]})}),a.jsx("td",{children:l&&t.operator&&a.jsx(bk,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:s})}),a.jsxs("td",{children:[t.code&&t.operator&&a.jsx(oe,{size:"compact-md",variant:"outline",onClick:()=>{e.onOk(r.current),n({})},children:e.okText}),e.onCancel&&a.jsx(oe,{size:"compact-md",variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function eB(e){const[t,n]=m.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return a.jsx($n,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(Qe,{onSubmit:r,children:a.jsxs(er,{children:[a.jsx(er.Col,{span:10,children:a.jsx(bk,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(er.Col,{span:2,children:a.jsx(oe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function tB(e){if(!e.searchParams)return null;function t(i,s){o(BV(e.search,i.code,s))}function n(i){o(wk(e.search,i.code))}function r(i,s){e.onPrompt(i,{code:i.code,operator:s,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?a.jsx(nB,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(ne.Dropdown,{children:e.searchParams.map(i=>a.jsx(ne.Item,{children:ki(i.code)},i.code))})}function nB(e){switch(e.searchParam.type){case"date":return a.jsx(rB,{...e});case"number":case"quantity":return a.jsx(oB,{...e});case"reference":return a.jsx(iB,{...e});case"string":return a.jsx(sB,{...e});case"token":case"uri":return a.jsx(aB,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function rB(e){const{searchParam:t}=e,n=t.code;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(i0,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(ne.Item,{leftSection:a.jsx(s0,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT_EQUALS),children:"Does not equal..."}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(NT,{size:14}),onClick:()=>e.onPrompt(t,ae.ENDS_BEFORE),children:"Before..."}),a.jsx(ne.Item,{leftSection:a.jsx(AT,{size:14}),onClick:()=>e.onPrompt(t,ae.STARTS_AFTER),children:"After..."}),a.jsx(ne.Item,{leftSection:a.jsx(oF,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Between..."}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx($i,{size:14}),onClick:()=>e.onChange(MV(e.search,n)),children:"Tomorrow"}),a.jsx(ne.Item,{leftSection:a.jsx($i,{size:14}),onClick:()=>e.onChange(NV(e.search,n)),children:"Today"}),a.jsx(ne.Item,{leftSection:a.jsx($i,{size:14}),onClick:()=>e.onChange(AV(e.search,n)),children:"Yesterday"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx($i,{size:14}),onClick:()=>e.onChange(LV(e.search,n)),children:"Next Month"}),a.jsx(ne.Item,{leftSection:a.jsx($i,{size:14}),onClick:()=>e.onChange($V(e.search,n)),children:"This Month"}),a.jsx(ne.Item,{leftSection:a.jsx($i,{size:14}),onClick:()=>e.onChange(OV(e.search,n)),children:"Last Month"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx($i,{size:14}),onClick:()=>e.onChange(FV(e.search,n)),children:"Year to date"}),a.jsx(ru,{...e})]})}function oB(e){const{searchParam:t}=e;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(i0,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(ne.Item,{leftSection:a.jsx(s0,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT_EQUALS),children:"Does not equal..."}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(AT,{size:14}),onClick:()=>e.onPrompt(t,ae.GREATER_THAN),children:"Greater than..."}),a.jsx(ne.Item,{leftSection:a.jsx(Gp,{size:14}),onClick:()=>e.onPrompt(t,ae.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(ne.Item,{leftSection:a.jsx(NT,{size:14}),onClick:()=>e.onPrompt(t,ae.LESS_THAN),children:"Less than..."}),a.jsx(ne.Item,{leftSection:a.jsx(Gp,{size:14}),onClick:()=>e.onPrompt(t,ae.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(ru,{...e})]})}function iB(e){const{searchParam:t}=e;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT),children:"Does not equal..."}),a.jsx(ru,{...e})]})}function sB(e){const{searchParam:t}=e;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(i0,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(ne.Item,{leftSection:a.jsx(s0,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT),children:"Does not equal..."}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(aF,{size:14}),onClick:()=>e.onPrompt(t,ae.CONTAINS),children:"Contains..."}),a.jsx(ne.Item,{leftSection:a.jsx(sF,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Does not contain..."}),a.jsx(ru,{...e})]})}function aB(e){const{searchParam:t}=e;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT),children:"Does not equal..."}),a.jsx(ru,{...e})]})}function ru(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(nF,{size:14}),onClick:()=>e.onChange(Yw(e.search,n)),children:"Missing"}),a.jsx(ne.Item,{leftSection:a.jsx(tF,{size:14}),onClick:()=>e.onChange(Yw(e.search,n,!1)),children:"Not missing"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Gd,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const lB="_root_vlout_1",cB="_table_vlout_8",uB="_tr_vlout_12",dB="_th_vlout_18",fB="_control_vlout_22",hB="_icon_vlout_31",xl={root:lB,table:cB,tr:uB,th:dB,control:fB,icon:hB};function mB(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(pB(t,r));return n}function pB(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=Rs(e,t),r=s7(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=qy(e);let s;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);s=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),s.length===0&&(s=void 0)}return{name:t,elementDefinition:n,searchParams:s}}if(r){const i=sh(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class gB extends Event{constructor(t){super("change"),this.definition=t}}class vB extends Event{constructor(t){super("load"),this.response=t}}class Yd extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function yB(e){var F,N,A;const t=se(),[n,r]=m.useState(),[o,i]=m.useState(),{search:s,onLoad:l}=e,[c,u]=m.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),d=m.useRef(c);d.current=c;const f=s.total??"accurate",h=m.useCallback(D=>{i(void 0),t.search(s.resourceType,la({...s,total:f,fields:void 0}),D).then(k=>{u({...d.current,searchResponse:k}),l&&l(new vB(k))}).catch(k=>{u({...d.current,searchResponse:void 0}),i(k)})},[t,s,f,l]),p=m.useCallback(()=>{u({...d.current,searchResponse:void 0}),h({cache:"reload"})},[h]);m.useEffect(()=>{h()},[h]);function g(D,k){D.stopPropagation();const B=D.target.checked,H={...d.current.selected};B?H[k]=!0:delete H[k],u({...d.current,selected:H})}function v(D){D.stopPropagation();const L=D.target.checked,B={},H=d.current.searchResponse;L&&(H!=null&&H.entry)&&H.entry.forEach(J=>{var we;(we=J.resource)!=null&&we.id&&(B[J.resource.id]=!0)}),u({...d.current,selected:B})}function S(){var k,L;const D=d.current;if(!((k=D.searchResponse)!=null&&k.entry)||D.searchResponse.entry.length===0)return!1;for(const B of D.searchResponse.entry)if((L=B.resource)!=null&&L.id&&!D.selected[B.resource.id])return!1;return!0}function y(D){e.onChange&&e.onChange(new gB(D))}function x(D,k){if($T(D.target)||D.button===2)return;lt(D);const L=D.button===1||D.ctrlKey||D.metaKey;!L&&e.onClick&&e.onClick(new Yd(k,D)),L&&e.onAuxClick&&e.onAuxClick(new Yd(k,D))}function w(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(m.useEffect(()=>{r(e.search.resourceType),t.requestSchema(e.search.resourceType).catch(console.error).finally(()=>r(void 0))},[t,e.search.resourceType]),!KP(e.search.resourceType)||n===e.search.resourceType)return a.jsx(un,{style:{width:"100%",height:"100%"},children:a.jsx(Gn,{})});const b=e.checkboxesEnabled,j=mB(s),P=s.resourceType,E=c.searchResponse,T=E==null?void 0:E.entry,_=T==null?void 0:T.map(D=>D.resource),R="subtle",O="gray",I=16,M=window.innerWidth<768;return a.jsxs("div",{className:xl.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(ee,{justify:"space-between",mb:"xl",children:[a.jsxs(ee,{gap:2,children:[a.jsx(oe,{size:"compact-md",variant:R,color:O,leftSection:a.jsx(uF,{size:I}),onClick:()=>u({...d.current,fieldEditorVisible:!0}),children:"Fields"}),a.jsx(oe,{size:"compact-md",variant:R,color:O,leftSection:a.jsx(gF,{size:I}),onClick:()=>u({...d.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&a.jsx(oe,{size:"compact-md",variant:R,color:O,leftSection:a.jsx(pF,{size:I}),onClick:e.onNew,children:"New..."}),!M&&w()&&a.jsx(oe,{size:"compact-md",variant:R,color:O,leftSection:a.jsx(LF,{size:I}),onClick:e.onExport?e.onExport:()=>u({...d.current,exportDialogVisible:!0}),children:"Export..."}),!M&&e.onDelete&&a.jsx(oe,{size:"compact-md",variant:R,color:O,leftSection:a.jsx(MT,{size:I}),onClick:()=>e.onDelete(Object.keys(c.selected)),children:"Delete..."}),!M&&e.onBulk&&a.jsx(oe,{size:"compact-md",variant:R,color:O,leftSection:a.jsx(rF,{size:I}),onClick:()=>e.onBulk(Object.keys(c.selected)),children:"Bulk..."})]}),a.jsxs(ee,{gap:2,children:[E&&a.jsxs(de,{size:"xs",c:"dimmed","data-testid":"count-display",children:[Ck(s,E).toLocaleString(),"-",bB(s,E).toLocaleString(),E.total!==void 0&&` of ${s.total==="estimate"?"~":""}${(F=E.total)==null?void 0:F.toLocaleString()}`]}),a.jsx(Zt,{variant:R,color:O,title:"Refresh",onClick:p,children:a.jsx(DF,{size:I})})]})]}),a.jsxs(ce,{className:xl.table,children:[a.jsxs(ce.Thead,{children:[a.jsxs(ce.Tr,{children:[b&&a.jsx(ce.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:D=>v(D)})}),j.map(D=>a.jsx(ce.Th,{children:a.jsxs(ne,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(ne.Target,{children:a.jsx(Dn,{className:xl.control,p:2,children:a.jsxs(ee,{justify:"space-between",wrap:"nowrap",children:[a.jsx(de,{fw:500,children:ki(D.name)}),a.jsx(un,{className:xl.icon,children:a.jsx(J6,{size:14,stroke:1.5})})]})})}),a.jsx(tB,{search:e.search,searchParams:D.searchParams,onPrompt:(k,L)=>{u({...d.current,filterDialogVisible:!0,filterDialogSearchParam:k,filterDialogFilter:L})},onChange:k=>{y(k)}})]})},D.name))]}),!e.hideFilters&&a.jsxs(ce.Tr,{children:[b&&a.jsx(ce.Th,{}),j.map(D=>a.jsx(ce.Th,{children:D.searchParams&&a.jsx(xB,{resourceType:P,searchParams:D.searchParams,filters:e.search.filters})},D.name))]})]}),a.jsx(ce.Tbody,{children:_==null?void 0:_.map(D=>D&&a.jsxs(ce.Tr,{className:xl.tr,"data-testid":"search-control-row",onClick:k=>x(k,D),onAuxClick:k=>x(k,D),children:[b&&a.jsx(ce.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${D.id}`,checked:!!c.selected[D.id],onChange:k=>g(k,D.id)})}),j.map(k=>a.jsx(ce.Td,{children:qV(D,k)},k.name))]},D.id))})]}),(_==null?void 0:_.length)===0&&a.jsx(tu,{children:a.jsx(un,{style:{height:150},children:a.jsx(de,{size:"xl",c:"dimmed",children:"No results"})})}),E&&a.jsx(un,{m:"md",p:"md",children:a.jsx(qr,{value:wB(s),total:SB(s,E),onChange:D=>y(VV(s,D)),getControlProps:D=>{switch(D){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),a.jsx(KV,{search:e.search,visible:d.current.fieldEditorVisible,onOk:D=>{y(D),u({...d.current,fieldEditorVisible:!1})},onCancel:()=>{u({...d.current,fieldEditorVisible:!1})}}),a.jsx(JV,{search:e.search,visible:d.current.filterEditorVisible,onOk:D=>{y(D),u({...d.current,filterEditorVisible:!1})},onCancel:()=>{u({...d.current,filterEditorVisible:!1})}}),a.jsx(RV,{visible:d.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{u({...d.current,exportDialogVisible:!1})}}),a.jsx(eB,{visible:d.current.filterDialogVisible,title:(N=c.filterDialogSearchParam)!=null&&N.code?ki(c.filterDialogSearchParam.code):"",resourceType:P,searchParam:c.filterDialogSearchParam,filter:c.filterDialogFilter,defaultValue:"",onOk:D=>{y(gh(e.search,D.code,D.operator,D.value)),u({...d.current,filterDialogVisible:!1})},onCancel:()=>{u({...d.current,filterDialogVisible:!1})}},(A=c.filterDialogSearchParam)==null?void 0:A.code)]})}const ou=m.memo(yB);function xB(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?a.jsx("span",{children:"no filters"}):a.jsx(a.Fragment,{children:t.map(n=>a.jsxs("div",{children:[_0(n.operator)," ",a.jsx(Sk,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function wB(e){return Math.floor((e.offset??0)/(e.count??ah))+1}function SB(e,t){const n=e.count??ah,r=Ek(e,t);return Math.ceil(r/n)}function Ck(e,t){return Math.min(Ek(e,t),(e.offset??0)+1)}function bB(e,t){var n;return Math.max(Ck(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function Ek(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 CB(e){const t=se(),[n,r]=m.useState(!1),[o,i]=m.useState(),{query:s,fields:l}=e,[c,u]=m.useState(),[d,f]=m.useState({}),h=m.useRef();h.current=c;const p=m.useRef({});p.current=d,m.useEffect(()=>{i(void 0),t.graphql(s).then(u).catch(w=>i(ht(w)))},[t,s]);function g(w,b){w.stopPropagation();const P=w.target.checked,E={...p.current};P?E[b]=!0:delete E[b],f(E)}function v(w){var T;w.stopPropagation();const j=w.target.checked,P={},E=(T=h.current)==null?void 0:T.data.ResourceList;j&&E&&E.forEach(_=>{_.id&&(P[_.id]=!0)}),f(P)}function S(){var b;const w=(b=h.current)==null?void 0:b.data.ResourceList;if(!w||w.length===0)return!1;for(const j of w)if(j.id&&!p.current[j.id])return!1;return!0}function y(w,b){$T(w.target)||(lt(w),w.button!==1&&e.onClick&&e.onClick(new Yd(b,w)),w.button===1&&e.onAuxClick&&e.onAuxClick(new Yd(b,w)))}if(m.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(Gn,{});const x=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:w=>lt(w),"data-testid":"search-control",children:[a.jsxs(ce,{children:[a.jsx(ce.Thead,{children:a.jsxs(ce.Tr,{children:[x&&a.jsx(ce.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:w=>v(w)})}),l.map(w=>a.jsx(ce.Th,{children:w.name},w.name))]})}),a.jsx(ce.Tbody,{children:c==null?void 0:c.data.ResourceList.map(w=>w&&a.jsxs(ce.Tr,{"data-testid":"search-control-row",onClick:b=>y(b,w),onAuxClick:b=>y(b,w),children:[x&&a.jsx(ce.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${w.id}`,checked:!!d[w.id],onChange:b=>g(b,w.id)})}),l.map(b=>a.jsx(ce.Td,{children:a.jsx(kV,{propertyType:b.propertyType,path:b.fhirPath,resource:w})},b.name))]},w.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&a.jsx(oe,{onClick:()=>e.onBulk(Object.keys(p.current)),children:"Bulk..."})]})}const EB=m.memo(CB);function Gr(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[a.jsx("title",{children:"Medplum Logo"}),a.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),a.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"}),a.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"}),a.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),a.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function jB(e){const{group:t}=e;return a.jsx(Hn,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(ee,{children:[t.measureScore&&a.jsx(kB,{group:t}),!t.measureScore&&a.jsx(TB,{group:t})]})})}function PB(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(de,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(de,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function TB(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(c=>Ti(c.code)==="numerator"),o=n==null?void 0:n.find(c=>Ti(c.code)==="denominator"),i=r==null?void 0:r.count,s=o==null?void 0:o.count;if(s===0)return a.jsxs(G,{children:[a.jsx(ge,{order:3,children:"Not Applicable"}),a.jsx(de,{children:`Denominator: ${s}`})]});if(i===void 0||s===void 0)return a.jsxs(G,{children:[a.jsx(ge,{order:3,children:"Insufficient Data"}),a.jsx(de,{children:`Numerator: ${i}`}),a.jsx(de,{children:`Denominator: ${s}`})]});const l=i/s*100;return a.jsx(eh,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:jk(l)}],label:a.jsx(ls,{justify:"center",children:a.jsxs(de,{fw:700,fz:18,children:[i," / ",s]})})})}function kB(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 a.jsx(a.Fragment,{children:n==="%"?a.jsx(eh,{size:120,thickness:12,roundCaps:!0,sections:[{value:RB(t),color:jk(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:a.jsx(ls,{justify:"center",children:a.jsx(de,{fw:700,fz:18,children:a.jsx(vc,{value:t.measureScore})})})}):a.jsx(ls,{h:120,align:"center",children:a.jsx(ge,{order:3,children:a.jsx(vc,{value:t.measureScore})})})})}function RB(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 jk(e){return e<=33?"red":e<=67?"yellow":"green"}function _B(e){var r;const t=mt(e.measureReport),[n]=G6("Measure",{url:t==null?void 0:t.measure});return t?a.jsxs(G,{children:[n&&a.jsx(PB,{measure:n}),a.jsx(ky,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>a.jsx(jB,{group:o},o.id??i))})]}):null}function Qr(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:a.jsx(Cs,{icon:a.jsx(Kc,{size:16}),color:"red",children:t.map(r=>{var o;return a.jsx("div",{"data-testid":"text-field-error",children:qP(r)},(o=r.details)==null?void 0:o.text)})})}function DB(e){const t=m.useCallback((n,r,o)=>{const i=`${r}/${o}`,s=100;return Promise.allSettled([n.readHistory("Patient",o),n.search("Communication",{subject:i,_count:s}),n.search("Device",{patient:i,_count:s}),n.search("DeviceRequest",{patient:i,_count:s}),n.search("DiagnosticReport",{subject:i,_count:s}),n.search("Media",{subject:i,_count:s}),n.search("ServiceRequest",{subject:i,_count:s}),n.search("Task",{subject:i,_count:s})])},[]);return a.jsx(ph,{value:e.patient,loadTimelineResources:t,createCommunication:(n,r,o)=>({resourceType:"Communication",status:"completed",subject:vt(n),sender:vt(r),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(n,r,o)=>({resourceType:"Media",status:"completed",subject:vt(n),operator:vt(r),issued:new Date().toISOString(),content:o})})}const IB="_section_14dzq_2",AB="_hovering_14dzq_11",NB="_editing_14dzq_15",MB="_bottomActions_14dzq_20",ca={section:IB,hovering:AB,editing:NB,bottomActions:MB};function OB(e){const t=se(),n=mt(e.value),[r,o]=m.useState(!1),[i,s]=m.useState(),[l,c]=m.useState(),[u,d]=m.useState();function f(){c(void 0)}function h(){s(void 0)}const p=m.useRef();if(p.current=u,m.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),m.useEffect(()=>(d(BB(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({...p.current,[v]:S})}return a.jsx("div",{children:a.jsxs(Qe,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[a.jsx(fe,{label:"Plan Title",defaultValue:u.title,onChange:v=>g("title",v.currentTarget.value)}),a.jsx(Pk,{actions:u.action||[],selectedKey:i,setSelectedKey:s,hoverKey:l,setHoverKey:c,onChange:v=>g("action",v)}),a.jsx(oe,{type:"submit",children:"Save"})]})})}function Pk(e){const t=m.useRef();t.current=e.actions;function n(i){e.onChange(t.current.map(s=>s.id===i.id?i:s))}function r(i){e.onChange([...t.current,i]),e.setSelectedKey(i.id)}function o(i){e.onChange(t.current.filter(s=>s!==i))}return a.jsxs("div",{className:ca.section,children:[e.actions.map(i=>a.jsx("div",{children:a.jsx($B,{action:i,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(i)})},i.id)),a.jsx("div",{className:ca.bottomActions,children:a.jsx(Ze,{href:"#",onClick:i=>{lt(i),r({id:kk()})},children:"Add action"})})]})}function $B(e){const{action:t}=e,n=VB(t),r=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function i(c){c.stopPropagation(),e.setSelectedKey(e.action.id)}function s(c){lt(c),e.setHoverKey(e.action.id)}const l=rt(ca.section,{[ca.editing]:r,[ca.hovering]:o&&!r});return a.jsxs("div",{"data-testid":t.id,className:l,onClick:i,onMouseOver:s,onFocus:s,children:[r?a.jsx(FB,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):a.jsx(LB,{action:t,actionType:n}),a.jsx("div",{className:ca.bottomActions,children:a.jsx(Ze,{href:"#",onClick:c=>{c.preventDefault(),e.onRemove()},children:"Remove"})})]})}const Yp={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function LB(e){const{action:t,actionType:n}=e,[r,o]=Tk(t);return a.jsxs("div",{children:[a.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&a.jsx("div",{children:a.jsx(Qd,{value:{reference:t.definitionCanonical}})}),r&&a.jsx("div",{children:a.jsx(Ur,{property:Yp,propertyType:o,value:r})})]})}function FB(e){const{action:t}=e,[n,r]=m.useState(e.actionType);function o(i,s){e.onChange({...t,[i]:s})}return a.jsxs(Ie,{gap:"xl",children:[a.jsx(fe,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),a.jsx(fe,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),a.jsx(Tt,{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&&a.jsx(Pk,{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 a.jsx(Bu,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return a.jsx(Bu,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return a.jsx(Bu,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return a.jsx(Bu,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),a.jsx(ft,{title:"Timing",description:"When the action should take place.",children:a.jsx(zB,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function Bu(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(el,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:yt(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function zB(e){const t=e.action,n="timing",[r,o]=Tk(t);return a.jsx(tl,{property:Yp,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(i,s)=>{e.onChange(KT(t,n,s??n,Yp,i))},outcome:void 0})}function VB(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 Tk(e){return Zc({type:"PlanDefinitionAction",value:e},"timing")}let wm=1;function kk(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(wm=Math.max(wm,t+1))}return e}return"id-"+wm++}function BB(e){return{...e,action:Rk(e.action)}}function Rk(e){if(e)return e.map(t=>({...t,id:kk(t.id),action:Rk(t.action)}))}var pt=(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))(pt||{});function UB(e){return e.type==="choice"||e.type==="open-choice"}function HB(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=_k(t,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(o!=null&&o.length)){if(n==="any")return!0;continue}const{anyMatch:i,allMatch:s}=GB(r,o,n);if(n==="any"&&i)return!0;if(n==="all"&&!s)return!1}return n!=="any"}function WB(e,t,n){return e.map(r=>{var s;const o=(s=n.answerOption)==null?void 0:s.find(l=>ks(l.valueCoding)===r||l[t]===r),i=fn({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function _k(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=_k(n.item,t);if(r)return r}}}function qB(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}]=gc(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function GB(e,t,n){const r=t||[],o=fn({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,s=!0;for(const l of r){const c=fn({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(qB(c,o,u)?i=!0:s=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:s}}function Dk(e){var n,r;const t=qc(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=ho(e);let r=qc(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 QB(e,t,n){const r=qc(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={},s=o.split("&");for(const l of s){const[c,u]=UL(l,"=",2);i[c]=u}return i}function KB(e){return{resourceType:"QuestionnaireResponse",questionnaire:yt(e),item:Ik(e.item),status:"in-progress"}}function Ik(e){return(e==null?void 0:e.map(Ak))??[]}function Ak(e){var t;return{id:XB(),linkId:e.linkId,text:e.text,item:Ik(e.item),answer:((t=e.initial)==null?void 0:t.map(JB))??[]}}let YB=1;function XB(){return"id-"+YB++}function JB(e){return{...e}}function ZB(e){return e.value.display||e.value.reference||ir(e.value)}function eU(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const s=qc(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(r=s==null?void 0:s.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}const Nk=m.createContext({});function Xp(e){const t=m.useContext(Nk),n=e.item,r=e.response;function o(u){var f,h,p,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=(((p=e.response)==null?void 0:p.answer)??[]).concat([u]):d=(((g=e.response)==null?void 0:g.answer)??[]).map((S,y)=>y===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 s=n.linkId;if(!s)return null;const l=n.initial&&n.initial.length>0?n.initial[0]:void 0,c=D0(r,e.index)??fn({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case pt.display:return a.jsx("p",{children:e.item.text},e.item.linkId);case pt.boolean:return a.jsx(GT,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx(br,{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 pt.decimal:return a.jsx(fe,{type:"number",step:"any",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDecimal:u.currentTarget.valueAsNumber})});case pt.integer:return a.jsx(fe,{type:"number",step:1,id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueInteger:u.currentTarget.valueAsNumber})});case pt.date:return a.jsx(fe,{type:"date",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case pt.dateTime:return a.jsx(fs,{name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case pt.time:return a.jsx(fe,{type:"time",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case pt.string:case pt.url:return a.jsx(fe,{id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case pt.text:return a.jsx(Es,{id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case pt.attachment:return a.jsx(ee,{py:4,children:a.jsx(zT,{name:s,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case pt.reference:return a.jsx(hh,{name:s,required:n.required,targetTypes:Dk(n),searchCriteria:QB(n,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case pt.quantity:return a.jsx(hs,{name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case pt.choice:case pt.openChoice:return sU(n)&&!n.answerValueSet?a.jsx(tU,{name:s,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)}):a.jsx(nU,{name:s,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)});default:return null}}function tU(e){var c;const{name:t,item:n,initial:r,response:o}=e;if(!((c=n.answerOption)!=null&&c.length))return a.jsx(Mk,{});const i=fn({type:"QuestionnaireItemInitial",value:r},"value"),s=[""];for(const u of n.answerOption){const d=fn({type:"QuestionnaireItemAnswerOption",value:u},"value");s.push(Jw(d))}const l=D0(o)??i;if(n.repeats){const{propertyName:u,data:d}=aU(e.item),f=oU(o);return a.jsx(Gf,{data:d,placeholder:"Select items",searchable:!0,defaultValue:f||[Jw(i)],onChange:h=>{const p=WB(h,u,n);e.onChangeAnswer(p)}})}return a.jsx(Tt,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const f=n.answerOption[d-1],h=fn({type:"QuestionnaireItemAnswerOption",value:f},"value"),p="value"+Gt(h.type);e.onChangeAnswer({[p]:h.value})},defaultValue:ks(l==null?void 0:l.value)||(l==null?void 0:l.value),data:s})}function nU(e){var s;const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e;return!((s=n.answerOption)!=null&&s.length)&&!n.answerValueSet?a.jsx(Mk,{}):n.answerValueSet?a.jsx(YT,{name:t,binding:n.answerValueSet,onChange:l=>o({valueCoding:l}),creatable:n.type===pt.openChoice}):a.jsx(rU,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function rU(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,s=Rs("QuestionnaireItemAnswerOption","value[x]"),l=fn({type:"QuestionnaireItemInitial",value:r},"value"),c=[];let u;if(n.answerOption)for(let h=0;h<n.answerOption.length;h++){const p=n.answerOption[h],g=`${t}-option-${h}`,v=fn({type:"QuestionnaireItemAnswerOption",value:p},"value");v!=null&&v.value&&(l&&ir(v)===ir(l)&&(u=g),c.push([g,v]))}const d=D0(i),f=iU(c,d);return a.jsx(dc.Group,{name:t,value:f??u,onChange:h=>{const p=c.find(g=>g[0]===h);if(p){const g=p[1],v="value"+Gt(g.type);o({[v]:g.value})}},children:c.map(([h,p])=>a.jsx(dc,{id:h,value:h,py:4,label:a.jsx(Ur,{property:s,propertyType:p.type,value:p.value})},h))})}function Mk(){return a.jsx(fe,{disabled:!0,placeholder:"No Answers Defined"})}function Ok(e){return fn({type:"QuestionnaireItemAnswer",value:e},"value")}function D0(e,t=0){const n=e.answer;return Ok((n==null?void 0:n[t])??{})}function oU(e){const t=e.answer;return t?t.map(r=>Ok(r)).map(r=>ks(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function iU(e,t){var n;return(n=e.find(r=>Gc(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function Jw(e){if(e)return e.type==="CodeableConcept"?Ti(e.value):e.type==="Coding"?ks(e.value):e.type==="Reference"?ZB(e):e.value.toString()}function sU(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 aU(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=fn({type:"QuestionnaireItemAnswerOption",value:t},"value"),r="value"+Gt(n.type),o=(e.answerOption??[]).map(s=>({value:Zw(s,r),label:Zw(s,r)}));return{propertyName:r,data:o}}function Zw(e,t){var n;return ks(e.valueCoding)||((n=e[t])==null?void 0:n.toString())}const lU="_section_cpwxo_1",cU="_hovering_cpwxo_10",uU="_editing_cpwxo_14",dU="_questionBody_cpwxo_19",fU="_topActions_cpwxo_23",hU="_bottomActions_cpwxo_32",mU="_movementActions_cpwxo_43",pU="_movementIcons_cpwxo_55",gU="_columnAlignment_cpwxo_59",vU="_linkIdInput_cpwxo_64",yU="_typeSelect_cpwxo_69",dr={section:lU,hovering:cU,editing:uU,questionBody:dU,topActions:fU,bottomActions:hU,movementActions:mU,movementIcons:pU,columnAlignment:gU,linkIdInput:vU,typeSelect:yU};function xU(e){const t=se(),n=mt(e.questionnaire),[r,o]=m.useState(!1),[i,s]=m.useState(),[l,c]=m.useState(),[u,d]=m.useState();function f(){d(void 0)}function h(){c(void 0)}m.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),m.useEffect(()=>(s(CU(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]);const p=(g,v)=>{s(g),e.autoSave&&!v&&e.onSubmit&&e.onSubmit(g)};return!r||!i?null:a.jsx("div",{children:a.jsxs(Qe,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[a.jsx($k,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:p}),a.jsx(oe,{type:"submit",children:"Save"})]})})}function $k(e){var w;const t=e.item,n=e.item,r=Wo(e.item),o=r||n.type===pt.group,i=n.linkId??"[untitled]",s=e.selectedKey===e.item.id,l=e.hoverKey===e.item.id,c=m.useRef();c.current=e.item;function u(b){lt(b),e.setSelectedKey(e.item.id)}function d(b){lt(b),e.setHoverKey(e.item.id)}function f(b){var P;const j=c.current;e.onChange({...j,item:(P=j.item)==null?void 0:P.map(E=>E.id===b.id?b:E)})}function h(b,j){e.onChange({...e.item,item:[...e.item.item??[],b]},j)}function p(b){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.filter(P=>P!==b)})}function g(b,j){e.onChange({...c.current,[b]:j})}function v(b){e.onChange({...e.item,...b})}function S(b){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.map(P=>P===b?{...P,repeats:!P.repeats}:P)})}function y(b,j){const P=PU(e.item.item,b,j);e.onChange({...e.item,item:P})}const x=rt(dr.section,{[dr.editing]:s,[dr.hovering]:l&&!s});return a.jsxs("div",{"data-testid":n.linkId,className:x,onClick:u,onMouseOver:d,onFocus:d,children:[a.jsx("div",{className:dr.questionBody,children:s?a.jsxs(a.Fragment,{children:[r&&a.jsx(fe,{size:"xl",defaultValue:t.title,onBlur:b=>g("title",b.currentTarget.value)}),!r&&a.jsx(Es,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:b=>g("text",b.currentTarget.value)}),n.type==="reference"&&a.jsx(bU,{item:n,onChange:v}),UB(n)&&a.jsx(wU,{item:n,onChange:b=>v(b)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(ge,{children:t.title}),n.text&&a.jsx("div",{children:n.text}),!o&&a.jsx(Xp,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(w=n.item)==null?void 0:w.map((b,j)=>a.jsx("div",{children:a.jsx($k,{item:b,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:j===0,isLast:j===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:f,onRemove:()=>p(b),onRepeatable:S,onMoveUp:()=>y(j,-1),onMoveDown:()=>y(j,1)})},b.id)),!o&&a.jsx("div",{className:dr.topActions,children:s?a.jsxs(a.Fragment,{children:[a.jsx(fe,{size:"xs",className:dr.linkIdInput,defaultValue:n.linkId,onBlur:b=>g("linkId",b.currentTarget.value)}),!o&&a.jsx(Tt,{size:"xs",className:dr.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"}]})]}):a.jsx("div",{children:i})}),!r&&a.jsx(G,{className:dr.movementActions,children:a.jsxs(G,{className:dr.columnAlignment,children:[!e.isFirst&&a.jsx(Ze,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(eF,{"data-testid":"up-button",size:15,className:dr.movementIcons})}),!e.isLast&&a.jsx(Ze,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(Z6,{"data-testid":"down-button",size:15,className:dr.movementIcons})})]})}),a.jsxs("div",{className:dr.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Ze,{href:"#",onClick:b=>{b.preventDefault(),h({id:ps(),linkId:eg("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Ze,{href:"#",onClick:b=>{b.preventDefault(),h({id:ps(),linkId:eg("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Ze,{href:"#",onClick:b=>{b.preventDefault(),h(jU(),!0)},children:"Add Page"}),s&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Ze,{href:"#",onClick:b=>{b.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Ze,{href:"#",onClick:b=>{b.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function wU(e){const t=Rs("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(fe,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(SU,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(G,{display:"flex",children:[a.jsx(Ze,{href:"#",onClick:r=>{lt(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:ps()}]})},children:"Add choice"}),a.jsx(th,{w:"lg"}),a.jsx(Ze,{href:"#",onClick:r=>{lt(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function SU(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=Zc({type:"QuestionnaireItemAnswerOption",value:t},"value");return a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[a.jsx("div",{children:a.jsx(tl,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,i)=>{const s=[...e.options],l=s.findIndex(c=>c.id===t.id);s[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:s})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(Ze,{href:"#",onClick:o=>{lt(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function bU(e){const t=Dk(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(ee,{children:[a.jsx(u0,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(Sm(e.item,t.map(i=>i===n?o:i)))}}),a.jsx(Ze,{href:"#",onClick:o=>{lt(o),e.onChange(Sm(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Ze,{href:"#",onClick:n=>{lt(n),e.onChange(Sm(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Jp=1,Zp=1;function eg(e){return e+Jp++}function ps(){return"id-"+Zp++}function CU(e){return{...e,id:e.id||ps(),item:Lk(e.item)}}function Lk(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Zp=Math.max(Zp,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Jp=Math.max(Jp,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||ps(),item:Lk(t.item),answerOption:EU(t.answerOption)}))}function EU(e){if(e)return e.map(t=>({...t,id:t.id||ps()}))}function jU(){return{id:ps(),linkId:eg("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 PU(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 Fk(e){const{item:t,response:n,onChange:r}=e,[o,i]=m.useState(TU(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===pt.display)return a.jsx("p",{children:t.text},t.linkId);const s=(t==null?void 0:t.repeats)&&t.type!==pt.choice&&t.type!==pt.openChoice;return t.type===pt.boolean?a.jsx(Xp,{item:t,response:n,onChange:l=>r([l]),index:0},t.linkId):a.jsxs(ft,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>a.jsx(Xp,{item:t,response:n,onChange:u=>r([u]),index:c},`${t.linkId}-${c}`)),s&&a.jsx(Ze,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function TU(e,t){if(e.type===pt.choice||e.type===pt.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function zk(e){const[t,n]=m.useState(e.response);if(t.length===0)return null;function r(i,s){const l=t.map((c,u)=>u===s?i[0]:c);n(l),e.onChange(l)}function o(){const i=Ak(e.item);n([...t,i])}return a.jsxs(a.Fragment,{children:[t.map((i,s)=>a.jsx(Vk,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>r(l,s)},i.id)),e.item.repeats&&a.jsx(Ze,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function Vk(e){var i;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function o(s){var d;const l=(d=t.item)==null?void 0:d.map(f=>s.find(p=>p.id===f.id)??f),c=l==null?void 0:l.concat(s.slice(1)),u={...t,item:c};r([u])}return e.checkForQuestionEnabled(e.item)?a.jsxs("div",{children:[e.item.text&&a.jsx(ge,{order:3,mb:"md",children:e.item.text}),a.jsx(Ie,{children:(i=e.item.item)==null?void 0:i.map(s=>{var l,c,u;return s.type===pt.group?s.repeats?a.jsx(zk,{item:s,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===s.linkId))??[],checkForQuestionEnabled:n,onChange:o},s.linkId):a.jsx(Vk,{item:s,checkForQuestionEnabled:n,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===s.linkId))??{linkId:s.linkId},onChange:o},s.linkId):a.jsx(Fk,{item:s,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===s.linkId),onChange:o,checkForQuestionEnabled:n},s.linkId)})})]},e.item.linkId):null}function kU(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:i,prevStep:s,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,f=t.map(h=>{var v;const p=((v=n==null?void 0:n.item)==null?void 0:v.filter(S=>S.linkId===h.linkId))??[],g=h.type===pt.group?a.jsx(zk,{item:h,response:p,onChange:o,checkForQuestionEnabled:d},h.linkId):a.jsx(Fk,{item:h,response:p==null?void 0:p[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?a.jsx(Na.Step,{label:h.text,children:g},h.linkId):g});return a.jsxs(a.Fragment,{children:[c&&a.jsx(Na,{active:r??0,allowNextStepsSelect:!1,p:6,children:f}),!c&&a.jsx(Ie,{children:f}),a.jsx(RU,{activePage:r??0,numberOfPages:l,nextStep:i,prevStep:s,submitButtonText:u})]})}function RU(e){const t=e.activePage>0,n=e.activePage<e.numberOfPages-1,r=e.activePage===e.numberOfPages-1;return a.jsxs(ee,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&a.jsx(oe,{onClick:e.prevStep,children:"Back"}),n&&a.jsx(oe,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),r&&a.jsx(oe,{type:"submit",children:e.submitButtonText??"Submit"})]})}function Bk(e){const t=se(),n=t.getProfile(),[r,o]=m.useState(!1),i=mt(e.questionnaire),[s,l]=m.useState(),[c,u]=m.useState(0);m.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),m.useEffect(()=>{l(i?KB(i):void 0)},[i]);function d(v){const S=(s==null?void 0:s.item)??[],x={resourceType:"QuestionnaireResponse",status:"in-progress",item:Uk(S,Array.isArray(v)?v:[v])};l(x)}function f(v){return HB(v,(s==null?void 0:s.item)??[])}if(!r||!i||!s)return null;const h=eU(i),p=()=>u(v=>v+1),g=()=>u(v=>v-1);return a.jsx(Nk.Provider,{value:{subject:e.subject,encounter:e.encounter},children:a.jsxs(Qe,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&s&&e.onSubmit({...s,questionnaire:yt(i),subject:e.subject,source:vt(n),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&a.jsx(ge,{children:i.title}),a.jsx(kU,{items:i.item??[],response:s,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:f,nextStep:p,prevStep:g})]})})}function _U(e,t){const n=Uk(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 Uk(e,t){const n=[],r=new Set;for(const o of e){const i=o.id,s=t.find(l=>l.id===i);s?(n.push(_U(o,s)),r.add(s.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}const DU="_section_4m5it_1",IU={section:DU},AU=["gender","age","gestationalAge","context","appliesTo","category"],NU={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function MU(e){e=Object.assign(NU,e);const t=e.definition,[n,r]=m.useState([]),[o,i]=m.useState(1),[s,l]=m.useState(1);return m.useEffect(()=>{const g=LU(t,l);r(FU(g.qualifiedInterval||[],i))},[t]),a.jsxs(Qe,{testid:"reference-range-editor",onSubmit:c,children:[a.jsx(Ie,{children:n.map(g=>{var v;return a.jsx(OU,{unit:VU((v=t.quantitativeDetails)==null?void 0:v.unit),onChange:f,onAdd:h,onRemove:p,onRemoveGroup:d,intervalGroup:g},`group-${g.id}`)})}),a.jsx(Zt,{title:"Add Group",variant:"subtle",size:"sm",onClick:g=>{lt(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(v=>v+1)},children:a.jsx(qd,{})}),a.jsx(ee,{justify:"flex-end",children:a.jsx(oe,{type:"submit",children:"Save"})})]});function c(){const g=n.flatMap(v=>v.intervals).filter(v=>!BU(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 y=S.find(w=>w.id===g),x=y==null?void 0:y.intervals.findIndex(w=>w.id===v.id);return x!==void 0&&(y!=null&&y.intervals[x])&&(y.intervals[x]=v),S})}function h(g,v){v.id===void 0&&(v.id=`id-${s}`,l(S=>S+1)),r(S=>{S=[...S];const y=S.findIndex(x=>x.id===g);if(y!==-1){const x={...S[y]};v={...v,...x.filters},x.intervals=[...x.intervals,v],S[y]=x}return S})}function p(g,v){r(S=>{S=[...S];const y=S.find(x=>x.id===g);return y&&(y.intervals=y.intervals.filter(x=>x.id!==v.id)),S})}}function OU(e){const{intervalGroup:t,unit:n}=e;return a.jsx(tu,{"data-testid":t.id,className:IU.section,children:a.jsxs(Ie,{gap:"lg",children:[a.jsx(ee,{justify:"flex-end",children:a.jsx(Zt,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{lt(r),e.onRemoveGroup(t)},children:a.jsx(Wd,{})},`remove-group-button-${t.id}`)}),a.jsx($U,{intervalGroup:t,onChange:e.onChange}),a.jsx(vn,{}),t.intervals.map(r=>a.jsxs(Ie,{gap:"xs",children:[a.jsxs(ee,{children:[a.jsx(fe,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{lt(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(Zt,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{lt(o),e.onRemove(t.id,r)},children:a.jsx(Wd,{})},`remove-interval-${r.id}`)]}),a.jsx(p0,{onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(Zt,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{lt(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(qd,{})})]})})}function $U(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 a.jsxs(Ie,{style:{maxWidth:"50%"},children:[a.jsx(ee,{children:a.jsx(Tt,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const s of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),n(t.id,{...s,gender:l})}}})}),a.jsxs(ee,{gap:"xs",children:[a.jsx(de,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(p0,{name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const s of t.intervals)n(t.id,{...s,age:i})}},`age-${t.id}`)})]}),a.jsx(Tt,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const s of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,n(t.id,{...s,context:void 0})):n(t.id,{...s,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),a.jsx(Tt,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const s of t.intervals){const l=i.currentTarget.value;l===""?n(t.id,{...s,category:void 0}):n(t.id,{...s,category:l})}}})]})}function LU(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{var s;const i=parseInt(((s=o.id)==null?void 0:s.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 FU(e,t){let n=1;const r={};for(const o of e){const i=zU(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(AU.map(s=>[s,o[s]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function zU(e){var n,r;return[`gender=${e.gender}`,`age=${mc(e.age)}`,`gestationalAge=${mc(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 VU(e){return e&&(VL(e,"http://unitsofmeasure.org")||e.text)}function BU(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 UU(e){var u;const t=se(),n=mt(e.value),[r,o]=m.useState(!1),[i,s]=m.useState();if(m.useEffect(()=>{n&&!r&&(t.executeBatch(l(n)).then(s).catch(console.log),o(!0))},[t,n,r]),!n||!i)return null;return a.jsx(er,{children:(u=n.action)==null?void 0:u.map((d,f)=>{var v,S,y,x,w,b;const h=d.resource&&c(d.resource),p=(S=(v=h==null?void 0:h.input)==null?void 0:v[0])==null?void 0:S.valueReference,g=(x=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:x.valueReference;return a.jsxs(m.Fragment,{children:[a.jsx(er.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?a.jsx(cF,{}):a.jsx(MF,{color:"gray"})}),a.jsxs(er.Col,{span:9,p:"xs",children:[a.jsx(de,{fw:500,children:d.title}),d.description&&a.jsx("div",{children:d.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(nl,{value:(w=h==null?void 0:h.meta)==null?void 0:w.author})," on ",In((b=h==null?void 0:h.meta)==null?void 0:b.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(y0,{status:(h==null?void 0:h.status)||"unknown"})]})]}),a.jsxs(er.Col,{span:2,p:"md",children:[p&&!g&&a.jsx(oe,{onClick:()=>e.onStart(h,p),children:"Start"}),p&&g&&a.jsx(oe,{onClick:()=>e.onEdit(h,p,g),children:"Edit"})]})]},`action-${f}`)})});function l(d){var h;const f=[];if(d.action)for(const p of d.action)(h=p.resource)!=null&&h.reference&&f.push({request:{method:"GET",url:p.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===yt(f.resource))return f.resource}}function Hk(e,t){const n=HU(e,t);return WU(n,e,t)}function HU(e,t){const n=e.length,r=t.length,o=n+r+1,i=1+2*o,s=i/2|0,l=new Array(i);l[s+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=s+u,f=d+1,h=d-1,p=l[f],g=l[h];let v,S=0;u===-c||u!==c&&g.i<p.i?(S=p.i,v=p):(S=g.i+1,v=g),l[h]=void 0;let y=S-u,x={i:S,j:y,prev:qU(v),snake:!1};for(;S<n&&y<r&&e[S]===t[y];)S++,y++;if(S>x.i&&(x={i:S,j:y,prev:x,snake:!0}),l[d]=x,S>=n&&y>=r)return l[d]}l[s+c-1]=void 0}}function WU(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,s=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,s)};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 qU(e){return e&&!e.snake&&e.prev?e.prev:e}function GU(e){const t=e.entry.filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:ir(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 QU(n,t),KU(n),n}function QU(e,t){for(let n=1;n<t.length;n++){const r=Hk(t[n-1].lines,t[n].lines);for(const o of r){const i=o.original.position,s=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,s.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 KU(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 YU="_container_1oj0p_1",XU="_root_1oj0p_5",JU="_startRow_1oj0p_20",ZU="_normalRow_1oj0p_24",eH="_author_1oj0p_28",tH="_dateTime_1oj0p_32",nH="_lineNumber_1oj0p_37",rH="_line_1oj0p_37",oH="_pre_1oj0p_52",vo={container:YU,root:XU,startRow:JU,normalRow:ZU,author:eH,dateTime:tH,lineNumber:nH,line:rH,pre:oH};function iH(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function sH(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Hs(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Hs(r,"month");const o=Math.floor(t/86400);if(o>0)return Hs(o,"day");const i=Math.floor(t/3600);if(i>0)return Hs(i,"hour");const s=Math.floor(t/60);return s>0?Hs(s,"minute"):Hs(t,"second")}function Hs(e,t){return`${e} ${e===1?t:t+"s"} ago`}function aH(e){var s,l;const t=se(),[n,r]=m.useState(e.history);if(m.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return a.jsx("div",{children:"Loading..."});const o=(l=(s=n.entry)==null?void 0:s[0])==null?void 0:l.resource;if(!o)return null;const i=GU(n);return a.jsx("div",{className:vo.container,children:a.jsx("table",{className:vo.root,children:a.jsx("tbody",{children:i.map((c,u)=>a.jsxs("tr",{className:c.span>0?vo.startRow:vo.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:vo.author,rowSpan:c.span,children:a.jsx(wa,{value:c.meta.author,link:!0})}),a.jsx("td",{className:vo.dateTime,rowSpan:c.span,children:a.jsx(qe,{to:iH(o,c.meta.versionId),children:sH(c.meta.lastUpdated)})})]}),a.jsx("td",{className:vo.lineNumber,children:u+1}),a.jsx("td",{className:vo.line,children:a.jsx("pre",{className:vo.pre,children:c.value})})]},"row-"+u))})})})}const lH="_removed_mgz0k_2",cH="_added_mgz0k_7",eS={removed:lH,added:cH};function uH(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=ir(t,!0).match(/[^\r\n]+/g),o=ir(n,!0).match(/[^\r\n]+/g),i=Hk(r,o);return a.jsx("pre",{style:{color:"gray"},children:i.map((s,l)=>a.jsx(dH,{delta:s},"delta"+l))})}function dH(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:eS.removed,children:e.delta.original.lines.join(`
|
|
523
|
-
`)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:eS.added,children:e.delta.revised.lines.join(`
|
|
524
|
-
`)}),"...",a.jsx("br",{})]})}function Xd(e){const{outcome:t}=e,n=se(),r=mt(e.defaultValue),[o,i]=m.useState(),[s,l]=m.useState();return m.useEffect(()=>{if(r)if(e.profileUrl){const c=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const u=Ts(c);if(u){i(u.name);const d=B6(r,u);l(d)}else console.error(`Schema not found for ${c}`)}).catch(u=>{console.error("Error in requestProfileSchema",u)})}else{const c=e.schemaName??(r==null?void 0:r.resourceType);n.requestSchema(c).then(()=>{l(r),i(c)}).catch(console.log)}},[n,r,e.schemaName,e.profileUrl]),!o||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:c=>{c.preventDefault(),e.onSubmit&&e.onSubmit(s)},children:[a.jsxs(Ie,{mb:"xl",children:[a.jsx(ft,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(fe,{name:"resourceType",defaultValue:s.resourceType,disabled:!0})}),a.jsx(ft,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(fe,{name:"id",defaultValue:s.id,disabled:!0})})]}),a.jsx(v0,{path:s.resourceType,valuePath:s.resourceType,typeName:o,defaultValue:s,outcome:t,onChange:l,profileUrl:e.profileUrl}),a.jsxs(ee,{justify:"flex-end",mt:"xl",children:[a.jsx(oe,{type:"submit",children:"OK"}),e.onDelete&&a.jsx(oe,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(s)},children:"Delete"})]})]})}function fH(e){var o;const t=se(),[n,r]=m.useState(e.history);return m.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?a.jsxs(ce,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(ce.Thead,{children:a.jsxs(ce.Tr,{children:[a.jsx(ce.Th,{children:"Author"}),a.jsx(ce.Th,{children:"Date"}),a.jsx(ce.Th,{children:"Version"})]})}),a.jsx(ce.Tbody,{children:(o=n.entry)==null?void 0:o.map((i,s)=>a.jsx(hH,{entry:i},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function hH(e){var r,o,i;const{response:t,resource:n}=e.entry;return n?a.jsxs(ce.Tr,{children:[a.jsx(ce.Td,{children:a.jsx(wa,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),a.jsx(ce.Td,{children:In((o=n.meta)==null?void 0:o.lastUpdated)}),a.jsx(ce.Td,{children:a.jsx(qe,{to:mH(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):a.jsx(ce.Tr,{children:a.jsx(ce.Td,{colSpan:3,children:$e(t==null?void 0:t.outcome)})})}function mH(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function pH(e){return a.jsx(ph,{value:e.serviceRequest,loadTimelineResources:async(t,n,r)=>{const o=`${n}/${r}`,i=100;return Promise.allSettled([t.readHistory("ServiceRequest",r),t.search("Communication",{"based-on":o,_count:i}),t.search("DiagnosticReport",{"based-on":o,_count:i}),t.search("Media",{"based-on":o,_count:i}),t.search("DocumentReference",{related:o,_count:i}),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:i})])},createCommunication:(t,n,r)=>({resourceType:"Communication",status:"completed",basedOn:[vt(t)],subject:t.subject,sender:vt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",basedOn:[vt(t)],subject:t.subject,operator:vt(n),issued:new Date().toISOString(),content:r})})}function gH(e){const t=se(),{client:n,patient:r,encounter:o,children:i,...s}=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=>xe({color:"red",message:$e(c),autoClose:!1}))}return a.jsx(Ze,{onClick:()=>l(),...s,children:i})}function Wk(e){const t=se(),[n,r]=m.useState();return a.jsxs(Qe,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){r(ht(i))}},children:[a.jsxs(un,{style:{flexDirection:"column"},children:[a.jsx(Gr,{size:32}),a.jsx(ge,{children:"Create project"})]}),a.jsxs(Ie,{gap:"xl",children:[a.jsx(fe,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Ke(n,"firstName")}),a.jsxs(de,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Ze,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Ze,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(ee,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(oe,{type:"submit",children:"Create project"})})]})}function qk(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 Gk(e){const t=se(),{googleClientId:n,handleGoogleCredential:r}=e,o=m.useRef(null),[i,s]=m.useState(typeof google<"u"),[l,c]=m.useState(!1),[u,d]=m.useState(!1);return m.useEffect(()=>{if(typeof google>"u"){qk("https://accounts.google.com/gsi/client",()=>s(!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?a.jsx("div",{ref:o}):null}var vH={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.1.5-6e0fc2e2f",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function Qk(e){var t;if(e)return e;if(typeof window<"u"){const n=window.location.protocol+"//"+window.location.host;if((((t=vH.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(n))return"__GOOGLE_CLIENT_ID__"}}function Kk(e){typeof grecaptcha>"u"&&qk("https://www.google.com/recaptcha/api.js?render="+e)}function Yk(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function yH(e){const t=Qk(e.googleClientId),n=e.recaptchaSiteKey,r=se(),[o,i]=m.useState(),s=eu(o,void 0);return m.useEffect(()=>{n&&Kk(n)},[n]),a.jsxs(Qe,{onSubmit:async l=>{try{let c="";n&&(c=await Yk(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(ht(c))}},children:[a.jsx(un,{style:{flexDirection:"column"},children:e.children}),a.jsx(Qr,{issues:s}),t&&a.jsxs(a.Fragment,{children:[a.jsx(ee,{justify:"center",p:"xl",style:{height:70},children:a.jsx(Gk,{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(ht(c))}}})}),a.jsx(vn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Ie,{gap:"xl",children:[a.jsx(fe,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Ke(o,"firstName")}),a.jsx(fe,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Ke(o,"lastName")}),a.jsx(fe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Ke(o,"email")}),a.jsx(Lr,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Ke(o,"password")}),a.jsxs(de,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Ze,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Ze,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(de,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Ze,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Ze,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(ee,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(br,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(oe,{type:"submit",children:"Create account"})]})]})}function xH(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:s}=e,l=se(),[c,u]=m.useState(),[d,f]=m.useState();m.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:n}).then(p=>l.processCode(p.code)).then(()=>s()).catch(p=>f(ht(p)))},[l,t,n,c,s]);function h(p){p.code?l.processCode(p.code).then(()=>s()).catch(console.log):p.login&&u(p.login)}return a.jsxs(Re,{width:450,children:[d&&a.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&a.jsx(yH,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&a.jsx(Wk,{login:c,handleAuthResponse:h})]})}function wH(e){const[t,n]=m.useState();return t?a.jsx(bH,{email:t,...e}):a.jsx(SH,{setEmail:n,...e})}function SH(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...s}=e,l=se(),c=!e.disableGoogleAuth&&Qk(e.googleClientId),[u,d]=m.useState(),f=eu(u,void 0),h=m.useCallback(async v=>{if(!v.authorizeUrl)return!1;const S=JSON.stringify({...await l.ensureCodeChallenge(s),domain:v.domain}),y=new URL(v.authorizeUrl);return y.searchParams.set("state",S),window.location.assign(y.toString()),!0},[l,s]),p=m.useCallback(async v=>{const S=await l.post("auth/method",{email:v.email});await h(S)||t(v.email)},[l,h,t]),g=m.useCallback(async v=>{try{const S=await l.startGoogleLogin({...s,googleCredential:v.credential});await h(S)||r(S)}catch(S){d(ht(S))}},[l,s,h,r]);return a.jsxs(Qe,{onSubmit:p,children:[a.jsx(un,{style:{flexDirection:"column"},children:o}),a.jsx(Qr,{issues:f}),c&&a.jsxs(a.Fragment,{children:[a.jsx(ee,{justify:"center",p:"xl",style:{height:70},children:a.jsx(Gk,{googleClientId:c,handleGoogleCredential:g})}),!i&&a.jsx(vn,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&a.jsx(fe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Ke(u,"email")}),a.jsxs(ee,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.jsx(Ze,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&a.jsx(oe,{type:"submit",children:"Next"})]})]})}function bH(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=se(),[s,l]=m.useState(),c=eu(s,void 0),u=m.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(n).catch(f=>l(ht(f)))},[i,o,n]);return a.jsxs(Qe,{onSubmit:u,children:[a.jsx(un,{style:{flexDirection:"column"},children:r}),a.jsx(Qr,{issues:c}),a.jsx(Ie,{gap:"xl",children:a.jsx(Lr,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Ke(s,"password")})}),a.jsxs(ee,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(Ze,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),a.jsx(br,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(oe,{type:"submit",children:"Sign in"})]})]})}function CH(e){const t=se(),n=Oc(),[r,o]=m.useState(""),[i,s]=m.useState();function l(f){var h;return!!((h=f==null?void 0:f.toLowerCase())!=null&&h.includes(r.toLowerCase()))}function c(f){var h,p;return l((h=f.profile)==null?void 0:h.display)||l((p=f.project)==null?void 0:p.display)}function u(f){t.post("auth/profile",{login:e.login,profile:f}).then(e.handleAuthResponse).catch(h=>s(ht(h)))}const d=e.memberships.filter(c).slice(0,10).map(f=>a.jsx(De.Option,{value:f.id,children:a.jsx(EH,{...f})},f.id));return a.jsxs(Ie,{children:[a.jsxs(ls,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(Gr,{size:32}),a.jsx(ge,{order:3,children:"Choose profile"})]}),a.jsx(Qr,{outcome:i}),a.jsxs(De,{store:n,onOptionSubmit:u,children:[a.jsx(De.EventsTarget,{children:a.jsx(fe,{placeholder:"Search",value:r,onChange:f=>{o(f.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(De.Options,{children:d.length>0?d:a.jsx(De.Empty,{children:"Nothing found..."})})})]})]})}function EH(e){var t,n;return a.jsxs(ee,{children:[a.jsx(cs,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(de,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),a.jsx(de,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}function jH(e){const t=se();return a.jsx(Qe,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Ie,{children:[a.jsxs(un,{style:{flexDirection:"column"},children:[a.jsx(Gr,{size:32}),a.jsx(ge,{children:"Choose scope"})]}),a.jsx(Ie,{children:(e.scope??"openid").split(" ").map(n=>a.jsx(br,{id:n,name:n,label:n,defaultChecked:!0},n))}),a.jsx(ee,{justify:"flex-end",mt:"xl",children:a.jsx(oe,{type:"submit",children:"Set scope"})})]})})}function PH(e){const t=se(),[n,r]=m.useState();return a.jsx(Qe,{onSubmit:o=>{r(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>r($e(i)))},children:a.jsxs(Ie,{children:[a.jsxs(un,{style:{flexDirection:"column"},children:[a.jsx(Gr,{size:32}),a.jsx(ge,{children:"Enter MFA code"})]}),n&&a.jsx(Cs,{icon:a.jsx(Kc,{size:16}),title:"Error",color:"red",children:n}),a.jsx(Ie,{children:a.jsx(fe,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),a.jsx(ee,{justify:"flex-end",mt:"xl",children:a.jsx(oe,{type:"submit",children:"Submit code"})})]})})}function Xk(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:s,...l}=e,c=se(),[u,d]=m.useState(),f=m.useRef(!1),[h,p]=m.useState(!1),[g,v]=m.useState(),S=m.useCallback(w=>{s?s(w):c.processCode(w).then(()=>{r&&r()}).catch(b=>xe({color:"red",message:$e(b)}))},[c,s,r]),y=m.useCallback(w=>{p(!!w.mfaRequired),w.login&&d(w.login),w.memberships&&v(w.memberships),w.code&&(n?v(void 0):S(w.code))},[n,S]),x=m.useCallback(w=>{S(w.code)},[S]);return m.useEffect(()=>{t&&!f.current&&!u&&(f.current=!0,c.get("auth/login/"+t).then(y).catch(w=>xe({color:"red",message:$e(w)})))},[c,t,f,u,y]),a.jsx(Re,{width:450,px:"sm",py:"md",children:u?h?a.jsx(PH,{login:u,handleAuthResponse:y}):g?a.jsx(CH,{login:u,memberships:g,handleAuthResponse:y}):e.projectId==="new"?a.jsx(Wk,{login:u,handleAuthResponse:y}):e.chooseScopes?a.jsx(jH,{login:u,scope:e.scope,handleAuthResponse:x}):a.jsx("div",{children:"Success"}):a.jsx(wH,{onForgotPassword:o,onRegister:i,handleAuthResponse:y,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var Jk,tS=Dc;Jk=tS.createRoot,tS.hydrateRoot;/**
|
|
525
|
-
* @remix-run/router v1.16.0
|
|
526
|
-
*
|
|
527
|
-
* Copyright (c) Remix Software Inc.
|
|
528
|
-
*
|
|
529
|
-
* This source code is licensed under the MIT license found in the
|
|
530
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
531
|
-
*
|
|
532
|
-
* @license MIT
|
|
533
|
-
*/function It(){return It=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},It.apply(this,arguments)}var Ut;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ut||(Ut={}));const nS="popstate";function TH(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:s,hash:l}=r.location;return xc("",{pathname:i,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:iu(o)}return RH(t,n,null,e)}function He(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function La(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kH(){return Math.random().toString(36).substr(2,8)}function rS(e,t){return{usr:e.state,key:e.key,idx:t}}function xc(e,t,n,r){return n===void 0&&(n=null),It({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?qo(t):t,{state:n,key:t&&t.key||r||kH()})}function iu(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 qo(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 RH(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,l=Ut.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(It({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){l=Ut.Pop;let S=d(),y=S==null?null:S-u;u=S,c&&c({action:l,location:v.location,delta:y})}function h(S,y){l=Ut.Push;let x=xc(v.location,S,y);u=d()+1;let w=rS(x,u),b=v.createHref(x);try{s.pushState(w,"",b)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;o.location.assign(b)}i&&c&&c({action:l,location:v.location,delta:1})}function p(S,y){l=Ut.Replace;let x=xc(v.location,S,y);u=d();let w=rS(x,u),b=v.createHref(x);s.replaceState(w,"",b),i&&c&&c({action:l,location:v.location,delta:0})}function g(S){let y=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof S=="string"?S:iu(S);return x=x.replace(/ $/,"%20"),He(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let v={get action(){return l},get location(){return e(o,s)},listen(S){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(nS,f),c=S,()=>{o.removeEventListener(nS,f),c=null}},createHref(S){return t(o,S)},createURL:g,encodeLocation(S){let y=g(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(S){return s.go(S)}};return v}var kt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(kt||(kt={}));const _H=new Set(["lazy","caseSensitive","path","id","index","children"]);function DH(e){return e.index===!0}function tg(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let s=[...n,i],l=typeof o.id=="string"?o.id:s.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`),DH(o)){let c=It({},o,t(o),{id:l});return r[l]=c,c}else{let c=It({},o,t(o),{id:l,children:void 0});return r[l]=c,o.children&&(c.children=tg(o.children,t,s,r)),c}})}function ua(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?qo(t):t,o=su(r.pathname||"/",n);if(o==null)return null;let i=Zk(e);AH(i);let s=null;for(let l=0;s==null&&l<i.length;++l){let c=WH(o);s=BH(i[l],c)}return s}function IH(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 Zk(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,s,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,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=bi([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+'".')),Zk(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:zH(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,s);else for(let c of eR(i.path))o(i,s,c)}),t}function eR(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 s=eR(r.join("/")),l=[];return l.push(...s.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function AH(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:VH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const NH=/^:[\w-]+$/,MH=3,OH=2,$H=1,LH=10,FH=-2,oS=e=>e==="*";function zH(e,t){let n=e.split("/"),r=n.length;return n.some(oS)&&(r+=FH),t&&(r+=OH),n.filter(o=>!oS(o)).reduce((o,i)=>o+(NH.test(i)?MH:i===""?$H:LH),r)}function VH(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 BH(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let s=0;s<n.length;++s){let l=n[s],c=s===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=UH({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u);if(!d)return null;Object.assign(r,d.params);let f=l.route;i.push({params:r,pathname:bi([o,d.pathname]),pathnameBase:QH(bi([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=bi([o,d.pathnameBase]))}return i}function UH(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=HH(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let v=l[f]||"";s=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function HH(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),La(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,(s,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 WH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return La(!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 su(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 qH(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?qo(e):e;return{pathname:n?n.startsWith("/")?n:GH(n,t):t,search:KH(r),hash:YH(o)}}function GH(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 bm(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 tR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function nR(e,t){let n=tR(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function rR(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=qo(e):(o=It({},e),He(!o.pathname||!o.pathname.includes("?"),bm("?","pathname","search",o)),He(!o.pathname||!o.pathname.includes("#"),bm("#","pathname","hash",o)),He(!o.search||!o.search.includes("#"),bm("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=qH(o,l),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const bi=e=>e.join("/").replace(/\/\/+/g,"/"),QH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),KH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,YH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class I0{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 A0(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const oR=["post","put","patch","delete"],XH=new Set(oR),JH=["get",...oR],ZH=new Set(JH),eW=new Set([301,302,303,307,308]),tW=new Set([307,308]),Cm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nW={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},N0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rW=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),iR="remix-router-transitions";function oW(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 $=e.detectErrorBoundary;o=z=>({hasErrorBoundary:$(z)})}else o=rW;let i={},s=tg(e.routes,o,void 0,i),l,c=e.basename||"/",u=e.unstable_dataStrategy||lW,d=It({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},e.future),f=null,h=new Set,p=null,g=null,v=null,S=e.hydrationData!=null,y=ua(s,e.history.location,c),x=null;if(y==null){let $=hr(404,{pathname:e.history.location.pathname}),{matches:z,route:q}=mS(s);y=z,x={[q.id]:$}}let w,b=y.some($=>$.route.lazy),j=y.some($=>$.route.loader);if(b)w=!1;else if(!j)w=!0;else if(d.v7_partialHydration){let $=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null,q=K=>K.route.loader?typeof K.route.loader=="function"&&K.route.loader.hydrate===!0?!1:$&&$[K.route.id]!==void 0||z&&z[K.route.id]!==void 0:!0;if(z){let K=y.findIndex(le=>z[le.route.id]!==void 0);w=y.slice(0,K+1).every(q)}else w=y.every(q)}else w=e.hydrationData!=null;let P,E={historyAction:e.history.action,location:e.history.location,matches:y,initialized:w,navigation:Cm,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||x,fetchers:new Map,blockers:new Map},T=Ut.Pop,_=!1,R,O=!1,I=new Map,M=null,F=!1,N=!1,A=[],D=[],k=new Map,L=0,B=-1,H=new Map,J=new Set,we=new Map,ie=new Map,Ce=new Set,_e=new Map,Pe=new Map,ue=!1;function Ue(){if(f=e.history.listen($=>{let{action:z,location:q,delta:K}=$;if(ue){ue=!1;return}La(Pe.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 le=uu({currentLocation:E.location,nextLocation:q,historyAction:z});if(le&&K!=null){ue=!0,e.history.go(K*-1),Ko(le,{state:"blocked",location:q,proceed(){Ko(le,{state:"proceeding",proceed:void 0,reset:void 0,location:q}),e.history.go(K)},reset(){let Ne=new Map(E.blockers);Ne.set(le,wl),ve({blockers:Ne})}});return}return re(z,q)}),n){wW(t,I);let $=()=>SW(t,I);t.addEventListener("pagehide",$),M=()=>t.removeEventListener("pagehide",$)}return E.initialized||re(Ut.Pop,E.location,{initialHydration:!0}),P}function bt(){f&&f(),M&&M(),h.clear(),R&&R.abort(),E.fetchers.forEach(($,z)=>Kr(z)),E.blockers.forEach(($,z)=>lr(z))}function at($){return h.add($),()=>h.delete($)}function ve($,z){z===void 0&&(z={}),E=It({},E,$);let q=[],K=[];d.v7_fetcherPersist&&E.fetchers.forEach((le,Ne)=>{le.state==="idle"&&(Ce.has(Ne)?K.push(Ne):q.push(Ne))}),[...h].forEach(le=>le(E,{deletedFetchers:K,unstable_viewTransitionOpts:z.viewTransitionOpts,unstable_flushSync:z.flushSync===!0})),d.v7_fetcherPersist&&(q.forEach(le=>E.fetchers.delete(le)),K.forEach(le=>Kr(le)))}function Le($,z,q){var K,le;let{flushSync:Ne}=q===void 0?{}:q,Ee=E.actionData!=null&&E.navigation.formMethod!=null&&Ar(E.navigation.formMethod)&&E.navigation.state==="loading"&&((K=$.state)==null?void 0:K._isRedirect)!==!0,he;z.actionData?Object.keys(z.actionData).length>0?he=z.actionData:he=null:Ee?he=E.actionData:he=null;let Fe=z.loaderData?fS(E.loaderData,z.loaderData,z.matches||[],z.errors):E.loaderData,Me=E.blockers;Me.size>0&&(Me=new Map(Me),Me.forEach((ke,ut)=>Me.set(ut,wl)));let Kt=_===!0||E.navigation.formMethod!=null&&Ar(E.navigation.formMethod)&&((le=$.state)==null?void 0:le._isRedirect)!==!0;l&&(s=l,l=void 0),F||T===Ut.Pop||(T===Ut.Push?e.history.push($,$.state):T===Ut.Replace&&e.history.replace($,$.state));let Yt;if(T===Ut.Pop){let ke=I.get(E.location.pathname);ke&&ke.has($.pathname)?Yt={currentLocation:E.location,nextLocation:$}:I.has($.pathname)&&(Yt={currentLocation:$,nextLocation:E.location})}else if(O){let ke=I.get(E.location.pathname);ke?ke.add($.pathname):(ke=new Set([$.pathname]),I.set(E.location.pathname,ke)),Yt={currentLocation:E.location,nextLocation:$}}ve(It({},z,{actionData:he,loaderData:Fe,historyAction:T,location:$,initialized:!0,navigation:Cm,revalidation:"idle",restoreScrollPosition:Cn($,z.matches||E.matches),preventScrollReset:Kt,blockers:Me}),{viewTransitionOpts:Yt,flushSync:Ne===!0}),T=Ut.Pop,_=!1,O=!1,F=!1,N=!1,A=[],D=[]}async function Ae($,z){if(typeof $=="number"){e.history.go($);return}let q=ng(E.location,E.matches,c,d.v7_prependBasename,$,d.v7_relativeSplatPath,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:K,submission:le,error:Ne}=iS(d.v7_normalizeFormMethod,!1,q,z),Ee=E.location,he=xc(E.location,K,z&&z.state);he=It({},he,e.history.encodeLocation(he));let Fe=z&&z.replace!=null?z.replace:void 0,Me=Ut.Push;Fe===!0?Me=Ut.Replace:Fe===!1||le!=null&&Ar(le.formMethod)&&le.formAction===E.location.pathname+E.location.search&&(Me=Ut.Replace);let Kt=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Yt=(z&&z.unstable_flushSync)===!0,ke=uu({currentLocation:Ee,nextLocation:he,historyAction:Me});if(ke){Ko(ke,{state:"blocked",location:he,proceed(){Ko(ke,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),Ae($,z)},reset(){let ut=new Map(E.blockers);ut.set(ke,wl),ve({blockers:ut})}});return}return await re(Me,he,{submission:le,pendingError:Ne,preventScrollReset:Kt,replace:z&&z.replace,enableViewTransition:z&&z.unstable_viewTransition,flushSync:Yt})}function te(){if(Ct(),ve({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){re(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}re(T||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function re($,z,q){R&&R.abort(),R=null,T=$,F=(q&&q.startUninterruptedRevalidation)===!0,Yo(E.location,E.matches),_=(q&&q.preventScrollReset)===!0,O=(q&&q.enableViewTransition)===!0;let K=l||s,le=q&&q.overrideNavigation,Ne=ua(K,z,c),Ee=(q&&q.flushSync)===!0;if(!Ne){let ke=hr(404,{pathname:z.pathname}),{matches:ut,route:Be}=mS(K);ol(),Le(z,{matches:ut,loaderData:{},errors:{[Be.id]:ke}},{flushSync:Ee});return}if(E.initialized&&!N&&mW(E.location,z)&&!(q&&q.submission&&Ar(q.submission.formMethod))){Le(z,{matches:Ne},{flushSync:Ee});return}R=new AbortController;let he=Ws(e.history,z,R.signal,q&&q.submission),Fe;if(q&&q.pendingError)Fe=[zl(Ne).route.id,{type:kt.error,error:q.pendingError}];else if(q&&q.submission&&Ar(q.submission.formMethod)){let ke=await je(he,z,q.submission,Ne,{replace:q.replace,flushSync:Ee});if(ke.shortCircuited)return;Fe=ke.pendingActionResult,le=Em(z,q.submission),Ee=!1,he=Ws(e.history,he.url,he.signal)}let{shortCircuited:Me,loaderData:Kt,errors:Yt}=await Ye(he,z,Ne,le,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,Ee,Fe);Me||(R=null,Le(z,It({matches:Ne},hS(Fe),{loaderData:Kt,errors:Yt})))}async function je($,z,q,K,le){le===void 0&&(le={}),Ct();let Ne=yW(z,q);ve({navigation:Ne},{flushSync:le.flushSync===!0});let Ee,he=og(K,z);if(!he.route.action&&!he.route.lazy)Ee={type:kt.error,error:hr(405,{method:$.method,pathname:z.pathname,routeId:he.route.id})};else if(Ee=(await ye("action",$,[he],K))[0],$.signal.aborted)return{shortCircuited:!0};if(Xi(Ee)){let Fe;return le&&le.replace!=null?Fe=le.replace:Fe=cS(Ee.response.headers.get("Location"),new URL($.url),c)===E.location.pathname+E.location.search,await Q($,Ee,{submission:q,replace:Fe}),{shortCircuited:!0}}if(Yi(Ee))throw hr(400,{type:"defer-action"});if(gr(Ee)){let Fe=zl(K,he.route.id);return(le&&le.replace)!==!0&&(T=Ut.Push),{pendingActionResult:[Fe.route.id,Ee]}}return{pendingActionResult:[he.route.id,Ee]}}async function Ye($,z,q,K,le,Ne,Ee,he,Fe,Me){let Kt=K||Em(z,le),Yt=le||Ne||vS(Kt),ke=l||s,[ut,Be]=sS(e.history,E,q,Yt,z,d.v7_partialHydration&&he===!0,d.unstable_skipActionErrorRevalidation,N,A,D,Ce,we,J,ke,c,Me);if(ol(Je=>!(q&&q.some(En=>En.route.id===Je))||ut&&ut.some(En=>En.route.id===Je)),B=++L,ut.length===0&&Be.length===0){let Je=Is();return Le(z,It({matches:q,loaderData:{},errors:Me&&gr(Me[1])?{[Me[0]]:Me[1].error}:null},hS(Me),Je?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Fe}),{shortCircuited:!0}}if(!F&&(!d.v7_partialHydration||!he)){Be.forEach(En=>{let cr=E.fetchers.get(En.key),an=Sl(void 0,cr?cr.data:void 0);E.fetchers.set(En.key,an)});let Je;Me&&!gr(Me[1])?Je={[Me[0]]:Me[1].data}:E.actionData&&(Object.keys(E.actionData).length===0?Je=null:Je=E.actionData),ve(It({navigation:Kt},Je!==void 0?{actionData:Je}:{},Be.length>0?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Fe})}Be.forEach(Je=>{k.has(Je.key)&&sn(Je.key),Je.controller&&k.set(Je.key,Je.controller)});let po=()=>Be.forEach(Je=>sn(Je.key));R&&R.signal.addEventListener("abort",po);let{loaderResults:Tr,fetcherResults:go}=await nt(E.matches,q,ut,Be,$);if($.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",po),Be.forEach(Je=>k.delete(Je.key));let Xo=pS([...Tr,...go]);if(Xo){if(Xo.idx>=ut.length){let Je=Be[Xo.idx-ut.length].key;J.add(Je)}return await Q($,Xo.result,{replace:Ee}),{shortCircuited:!0}}let{loaderData:Ns,errors:Yr}=dS(E,q,ut,Tr,Me,Be,go,_e);_e.forEach((Je,En)=>{Je.subscribe(cr=>{(cr||Je.done)&&_e.delete(En)})}),d.v7_partialHydration&&he&&E.errors&&Object.entries(E.errors).filter(Je=>{let[En]=Je;return!ut.some(cr=>cr.route.id===En)}).forEach(Je=>{let[En,cr]=Je;Yr=Object.assign(Yr||{},{[En]:cr})});let du=Is(),fu=cu(B),hu=du||fu||Be.length>0;return It({loaderData:Ns,errors:Yr},hu?{fetchers:new Map(E.fetchers)}:{})}function Xe($,z,q,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.");k.has($)&&sn($);let le=(K&&K.unstable_flushSync)===!0,Ne=l||s,Ee=ng(E.location,E.matches,c,d.v7_prependBasename,q,d.v7_relativeSplatPath,z,K==null?void 0:K.relative),he=ua(Ne,Ee,c);if(!he){Dt($,z,hr(404,{pathname:Ee}),{flushSync:le});return}let{path:Fe,submission:Me,error:Kt}=iS(d.v7_normalizeFormMethod,!0,Ee,K);if(Kt){Dt($,z,Kt,{flushSync:le});return}let Yt=og(he,Fe);if(_=(K&&K.preventScrollReset)===!0,Me&&Ar(Me.formMethod)){ze($,z,Fe,Yt,he,le,Me);return}we.set($,{routeId:z,path:Fe}),Y($,z,Fe,Yt,he,le,Me)}async function ze($,z,q,K,le,Ne,Ee){if(Ct(),we.delete($),!K.route.action&&!K.route.lazy){let an=hr(405,{method:Ee.formMethod,pathname:q,routeId:z});Dt($,z,an,{flushSync:Ne});return}let he=E.fetchers.get($);ct($,xW(Ee,he),{flushSync:Ne});let Fe=new AbortController,Me=Ws(e.history,q,Fe.signal,Ee);k.set($,Fe);let Kt=L,ke=(await ye("action",Me,[K],le))[0];if(Me.signal.aborted){k.get($)===Fe&&k.delete($);return}if(d.v7_fetcherPersist&&Ce.has($)){if(Xi(ke)||gr(ke)){ct($,ei(void 0));return}}else{if(Xi(ke))if(k.delete($),B>Kt){ct($,ei(void 0));return}else return J.add($),ct($,Sl(Ee)),Q(Me,ke,{fetcherSubmission:Ee});if(gr(ke)){Dt($,z,ke.error);return}}if(Yi(ke))throw hr(400,{type:"defer-action"});let ut=E.navigation.location||E.location,Be=Ws(e.history,ut,Fe.signal),po=l||s,Tr=E.navigation.state!=="idle"?ua(po,E.navigation.location,c):E.matches;He(Tr,"Didn't find any matches after fetcher action");let go=++L;H.set($,go);let Xo=Sl(Ee,ke.data);E.fetchers.set($,Xo);let[Ns,Yr]=sS(e.history,E,Tr,Ee,ut,!1,d.unstable_skipActionErrorRevalidation,N,A,D,Ce,we,J,po,c,[K.route.id,ke]);Yr.filter(an=>an.key!==$).forEach(an=>{let sl=an.key,U0=E.fetchers.get(sl),MR=Sl(void 0,U0?U0.data:void 0);E.fetchers.set(sl,MR),k.has(sl)&&sn(sl),an.controller&&k.set(sl,an.controller)}),ve({fetchers:new Map(E.fetchers)});let du=()=>Yr.forEach(an=>sn(an.key));Fe.signal.addEventListener("abort",du);let{loaderResults:fu,fetcherResults:hu}=await nt(E.matches,Tr,Ns,Yr,Be);if(Fe.signal.aborted)return;Fe.signal.removeEventListener("abort",du),H.delete($),k.delete($),Yr.forEach(an=>k.delete(an.key));let Je=pS([...fu,...hu]);if(Je){if(Je.idx>=Ns.length){let an=Yr[Je.idx-Ns.length].key;J.add(an)}return Q(Be,Je.result)}let{loaderData:En,errors:cr}=dS(E,E.matches,Ns,fu,void 0,Yr,hu,_e);if(E.fetchers.has($)){let an=ei(ke.data);E.fetchers.set($,an)}cu(go),E.navigation.state==="loading"&&go>B?(He(T,"Expected pending action"),R&&R.abort(),Le(E.navigation.location,{matches:Tr,loaderData:En,errors:cr,fetchers:new Map(E.fetchers)})):(ve({errors:cr,loaderData:fS(E.loaderData,En,Tr,cr),fetchers:new Map(E.fetchers)}),N=!1)}async function Y($,z,q,K,le,Ne,Ee){let he=E.fetchers.get($);ct($,Sl(Ee,he?he.data:void 0),{flushSync:Ne});let Fe=new AbortController,Me=Ws(e.history,q,Fe.signal);k.set($,Fe);let Kt=L,ke=(await ye("loader",Me,[K],le))[0];if(Yi(ke)&&(ke=await cR(ke,Me.signal,!0)||ke),k.get($)===Fe&&k.delete($),!Me.signal.aborted){if(Ce.has($)){ct($,ei(void 0));return}if(Xi(ke))if(B>Kt){ct($,ei(void 0));return}else{J.add($),await Q(Me,ke);return}if(gr(ke)){Dt($,z,ke.error);return}He(!Yi(ke),"Unhandled fetcher deferred data"),ct($,ei(ke.data))}}async function Q($,z,q){let{submission:K,fetcherSubmission:le,replace:Ne}=q===void 0?{}:q;z.response.headers.has("X-Remix-Revalidate")&&(N=!0);let Ee=z.response.headers.get("Location");He(Ee,"Expected a Location header on the redirect Response"),Ee=cS(Ee,new URL($.url),c);let he=xc(E.location,Ee,{_isRedirect:!0});if(n){let ut=!1;if(z.response.headers.has("X-Remix-Reload-Document"))ut=!0;else if(N0.test(Ee)){const Be=e.history.createURL(Ee);ut=Be.origin!==t.location.origin||su(Be.pathname,c)==null}if(ut){Ne?t.location.replace(Ee):t.location.assign(Ee);return}}R=null;let Fe=Ne===!0?Ut.Replace:Ut.Push,{formMethod:Me,formAction:Kt,formEncType:Yt}=E.navigation;!K&&!le&&Me&&Kt&&Yt&&(K=vS(E.navigation));let ke=K||le;if(tW.has(z.response.status)&&ke&&Ar(ke.formMethod))await re(Fe,he,{submission:It({},ke,{formAction:Ee}),preventScrollReset:_});else{let ut=Em(he,K);await re(Fe,he,{overrideNavigation:ut,fetcherSubmission:le,preventScrollReset:_})}}async function ye($,z,q,K){try{let le=await cW(u,$,z,q,K,i,o);return await Promise.all(le.map((Ne,Ee)=>{if(pW(Ne)){let he=Ne.result;return{type:kt.redirect,response:fW(he,z,q[Ee].route.id,K,c,d.v7_relativeSplatPath)}}return dW(Ne)}))}catch(le){return q.map(()=>({type:kt.error,error:le}))}}async function nt($,z,q,K,le){let[Ne,...Ee]=await Promise.all([q.length?ye("loader",le,q,z):[],...K.map(he=>{if(he.matches&&he.match&&he.controller){let Fe=Ws(e.history,he.path,he.controller.signal);return ye("loader",Fe,[he.match],he.matches).then(Me=>Me[0])}else return Promise.resolve({type:kt.error,error:hr(404,{pathname:he.path})})})]);return await Promise.all([gS($,q,Ne,Ne.map(()=>le.signal),!1,E.loaderData),gS($,K.map(he=>he.match),Ee,K.map(he=>he.controller?he.controller.signal:null),!0)]),{loaderResults:Ne,fetcherResults:Ee}}function Ct(){N=!0,A.push(...ol()),we.forEach(($,z)=>{k.has(z)&&(D.push(z),sn(z))})}function ct($,z,q){q===void 0&&(q={}),E.fetchers.set($,z),ve({fetchers:new Map(E.fetchers)},{flushSync:(q&&q.flushSync)===!0})}function Dt($,z,q,K){K===void 0&&(K={});let le=zl(E.matches,z);Kr($),ve({errors:{[le.route.id]:q},fetchers:new Map(E.fetchers)},{flushSync:(K&&K.flushSync)===!0})}function Wt($){return d.v7_fetcherPersist&&(ie.set($,(ie.get($)||0)+1),Ce.has($)&&Ce.delete($)),E.fetchers.get($)||nW}function Kr($){let z=E.fetchers.get($);k.has($)&&!(z&&z.state==="loading"&&H.has($))&&sn($),we.delete($),H.delete($),J.delete($),Ce.delete($),E.fetchers.delete($)}function mo($){if(d.v7_fetcherPersist){let z=(ie.get($)||0)-1;z<=0?(ie.delete($),Ce.add($)):ie.set($,z)}else Kr($);ve({fetchers:new Map(E.fetchers)})}function sn($){let z=k.get($);He(z,"Expected fetch controller: "+$),z.abort(),k.delete($)}function Qo($){for(let z of $){let q=Wt(z),K=ei(q.data);E.fetchers.set(z,K)}}function Is(){let $=[],z=!1;for(let q of J){let K=E.fetchers.get(q);He(K,"Expected fetcher: "+q),K.state==="loading"&&(J.delete(q),$.push(q),z=!0)}return Qo($),z}function cu($){let z=[];for(let[q,K]of H)if(K<$){let le=E.fetchers.get(q);He(le,"Expected fetcher: "+q),le.state==="loading"&&(sn(q),H.delete(q),z.push(q))}return Qo(z),z.length>0}function Eh($,z){let q=E.blockers.get($)||wl;return Pe.get($)!==z&&Pe.set($,z),q}function lr($){E.blockers.delete($),Pe.delete($)}function Ko($,z){let q=E.blockers.get($)||wl;He(q.state==="unblocked"&&z.state==="blocked"||q.state==="blocked"&&z.state==="blocked"||q.state==="blocked"&&z.state==="proceeding"||q.state==="blocked"&&z.state==="unblocked"||q.state==="proceeding"&&z.state==="unblocked","Invalid blocker state transition: "+q.state+" -> "+z.state);let K=new Map(E.blockers);K.set($,z),ve({blockers:K})}function uu($){let{currentLocation:z,nextLocation:q,historyAction:K}=$;if(Pe.size===0)return;Pe.size>1&&La(!1,"A router only supports one blocker at a time");let le=Array.from(Pe.entries()),[Ne,Ee]=le[le.length-1],he=E.blockers.get(Ne);if(!(he&&he.state==="proceeding")&&Ee({currentLocation:z,nextLocation:q,historyAction:K}))return Ne}function ol($){let z=[];return _e.forEach((q,K)=>{(!$||$(K))&&(q.cancel(),z.push(K),_e.delete(K))}),z}function il($,z,q){if(p=$,v=z,g=q||null,!S&&E.navigation===Cm){S=!0;let K=Cn(E.location,E.matches);K!=null&&ve({restoreScrollPosition:K})}return()=>{p=null,v=null,g=null}}function As($,z){return g&&g($,z.map(K=>IH(K,E.loaderData)))||$.key}function Yo($,z){if(p&&v){let q=As($,z);p[q]=v()}}function Cn($,z){if(p){let q=As($,z),K=p[q];if(typeof K=="number")return K}return null}function jh($){i={},l=tg($,o,void 0,i)}return P={get basename(){return c},get future(){return d},get state(){return E},get routes(){return s},get window(){return t},initialize:Ue,subscribe:at,enableScrollRestoration:il,navigate:Ae,fetch:Xe,revalidate:te,createHref:$=>e.history.createHref($),encodeLocation:$=>e.history.encodeLocation($),getFetcher:Wt,deleteFetcher:mo,dispose:bt,getBlocker:Eh,deleteBlocker:lr,_internalFetchControllers:k,_internalActiveDeferreds:_e,_internalSetRoutes:jh},P}function iW(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ng(e,t,n,r,o,i,s,l){let c,u;if(s){c=[];for(let f of t)if(c.push(f),f.route.id===s){u=f;break}}else c=t,u=t[t.length-1];let d=rR(o||".",nR(c,i),su(e.pathname,n)||e.pathname,l==="path");return o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!M0(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:bi([n,d.pathname])),iu(d)}function iS(e,t,n,r){if(!r||!iW(r))return{path:n};if(r.formMethod&&!vW(r.formMethod))return{path:n,error:hr(405,{method:r.formMethod})};let o=()=>({path:n,error:hr(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),l=aR(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ar(s))return o();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,g)=>{let[v,S]=g;return""+p+v+"="+S+`
|
|
534
|
-
`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Ar(s))return o();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,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=rg(r.formData),u=r.formData;else if(r.body instanceof FormData)c=rg(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=uS(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=uS(c)}catch{return o()}let d={formMethod:s,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Ar(d.formMethod))return{path:n,submission:d};let f=qo(n);return t&&f.search&&M0(f.search)&&c.append("index",""),f.search="?"+c,{path:iu(f),submission:d}}function sW(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function sS(e,t,n,r,o,i,s,l,c,u,d,f,h,p,g,v){let S=v?gr(v[1])?v[1].error:v[1].data:void 0,y=e.createURL(t.location),x=e.createURL(o),w=v&&gr(v[1])?v[0]:void 0,b=w?sW(n,w):n,j=v?v[1].statusCode:void 0,P=s&&j&&j>=400,E=b.filter((_,R)=>{let{route:O}=_;if(O.lazy)return!0;if(O.loader==null)return!1;if(i)return typeof O.loader!="function"||O.loader.hydrate?!0:t.loaderData[O.id]===void 0&&(!t.errors||t.errors[O.id]===void 0);if(aW(t.loaderData,t.matches[R],_)||c.some(F=>F===_.route.id))return!0;let I=t.matches[R],M=_;return aS(_,It({currentUrl:y,currentParams:I.params,nextUrl:x,nextParams:M.params},r,{actionResult:S,unstable_actionStatus:j,defaultShouldRevalidate:P?!1:l||y.pathname+y.search===x.pathname+x.search||y.search!==x.search||sR(I,M)}))}),T=[];return f.forEach((_,R)=>{if(i||!n.some(N=>N.route.id===_.routeId)||d.has(R))return;let O=ua(p,_.path,g);if(!O){T.push({key:R,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let I=t.fetchers.get(R),M=og(O,_.path),F=!1;h.has(R)?F=!1:u.includes(R)?F=!0:I&&I.state!=="idle"&&I.data===void 0?F=l:F=aS(M,It({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:S,unstable_actionStatus:j,defaultShouldRevalidate:P?!1:l})),F&&T.push({key:R,routeId:_.routeId,path:_.path,matches:O,match:M,controller:new AbortController})}),[E,T]}function aW(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function sR(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function aS(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function lS(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 s in r){let c=o[s]!==void 0&&s!=="hasErrorBoundary";La(!c,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!c&&!_H.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,It({},t(o),{lazy:void 0}))}function lW(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function cW(e,t,n,r,o,i,s,l){let c=r.reduce((f,h)=>f.add(h.route.id),new Set),u=new Set,d=await e({matches:o.map(f=>{let h=c.has(f.route.id);return It({},f,{shouldLoad:h,resolve:g=>(u.add(f.route.id),h?uW(t,n,f,i,s,g,l):Promise.resolve({type:kt.data,result:void 0}))})}),request:n,params:o[0].params,context:l});return o.forEach(f=>He(u.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((f,h)=>c.has(o[h].route.id))}async function uW(e,t,n,r,o,i,s){let l,c,u=d=>{let f,h=new Promise((v,S)=>f=S);c=()=>f(),t.signal.addEventListener("abort",c);let p=v=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:s},...v!==void 0?[v]:[]),g;return i?g=i(v=>p(v)):g=(async()=>{try{return{type:"data",result:await p()}}catch(v){return{type:"error",result:v}}})(),Promise.race([g,h])};try{let d=n.route[e];if(n.route.lazy)if(d){let f,[h]=await Promise.all([u(d).catch(p=>{f=p}),lS(n.route,o,r)]);if(f!==void 0)throw f;l=h}else if(await lS(n.route,o,r),d=n.route[e],d)l=await u(d);else if(e==="action"){let f=new URL(t.url),h=f.pathname+f.search;throw hr(405,{method:t.method,pathname:h,routeId:n.route.id})}else return{type:kt.data,result:void 0};else if(d)l=await u(d);else{let f=new URL(t.url),h=f.pathname+f.search;throw hr(404,{pathname:h})}He(l.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(d){return{type:kt.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return l}async function dW(e){let{result:t,type:n,status:r}=e;if(lR(t)){let s;try{let l=t.headers.get("Content-Type");l&&/\bapplication\/json\b/.test(l)?t.body==null?s=null:s=await t.json():s=await t.text()}catch(l){return{type:kt.error,error:l}}return n===kt.error?{type:kt.error,error:new I0(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:kt.data,data:s,statusCode:t.status,headers:t.headers}}if(n===kt.error)return{type:kt.error,error:t,statusCode:A0(t)?t.status:r};if(gW(t)){var o,i;return{type:kt.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((i=t.init)==null?void 0:i.headers)&&new Headers(t.init.headers)}}return{type:kt.data,data:t,statusCode:r}}function fW(e,t,n,r,o,i){let s=e.headers.get("Location");if(He(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!N0.test(s)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);s=ng(new URL(t.url),l,o,!0,s,i),e.headers.set("Location",s)}return e}function cS(e,t,n){if(N0.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=su(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function Ws(e,t,n,r){let o=e.createURL(aR(t)).toString(),i={signal:n};if(r&&Ar(r.formMethod)){let{formMethod:s,formEncType:l}=r;i.method=s.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=rg(r.formData):i.body=r.formData}return new Request(o,i)}function rg(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function uS(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function hW(e,t,n,r,o,i){let s={},l=null,c,u=!1,d={},f=r&&gr(r[1])?r[1].error:void 0;return n.forEach((h,p)=>{let g=t[p].route.id;if(He(!Xi(h),"Cannot handle redirect results in processLoaderData"),gr(h)){let v=h.error;f!==void 0&&(v=f,f=void 0),l=l||{};{let S=zl(e,g);l[S.route.id]==null&&(l[S.route.id]=v)}s[g]=void 0,u||(u=!0,c=A0(h.error)?h.error.status:500),h.headers&&(d[g]=h.headers)}else Yi(h)?(o.set(g,h.deferredData),s[g]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!u&&(c=h.statusCode),h.headers&&(d[g]=h.headers)):(s[g]=h.data,h.statusCode&&h.statusCode!==200&&!u&&(c=h.statusCode),h.headers&&(d[g]=h.headers))}),f!==void 0&&r&&(l={[r[0]]:f},s[r[0]]=void 0),{loaderData:s,errors:l,statusCode:c||200,loaderHeaders:d}}function dS(e,t,n,r,o,i,s,l){let{loaderData:c,errors:u}=hW(t,n,r,o,l);for(let d=0;d<i.length;d++){let{key:f,match:h,controller:p}=i[d];He(s!==void 0&&s[d]!==void 0,"Did not find corresponding fetcher result");let g=s[d];if(!(p&&p.signal.aborted))if(gr(g)){let v=zl(e.matches,h==null?void 0:h.route.id);u&&u[v.route.id]||(u=It({},u,{[v.route.id]:g.error})),e.fetchers.delete(f)}else if(Xi(g))He(!1,"Unhandled fetcher revalidation redirect");else if(Yi(g))He(!1,"Unhandled fetcher deferred data");else{let v=ei(g.data);e.fetchers.set(f,v)}}return{loaderData:c,errors:u}}function fS(e,t,n,r){let o=It({},t);for(let i of n){let s=i.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(o[s]=t[s]):e[s]!==void 0&&i.route.loader&&(o[s]=e[s]),r&&r.hasOwnProperty(s))break}return o}function hS(e){return e?gr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function zl(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 mS(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 hr(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",o&&n&&r?l="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"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",o&&n&&r?l="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&&(l='Invalid request method "'+o.toUpperCase()+'"')),new I0(e||500,s,new Error(l),!0)}function pS(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Xi(n))return{result:n,idx:t}}}function aR(e){let t=typeof e=="string"?qo(e):e;return iu(It({},t,{hash:""}))}function mW(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function pW(e){return lR(e.result)&&eW.has(e.result.status)}function Yi(e){return e.type===kt.deferred}function gr(e){return e.type===kt.error}function Xi(e){return(e&&e.type)===kt.redirect}function gW(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 lR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function vW(e){return ZH.has(e.toLowerCase())}function Ar(e){return XH.has(e.toLowerCase())}async function gS(e,t,n,r,o,i){for(let s=0;s<n.length;s++){let l=n[s],c=t[s];if(!c)continue;let u=e.find(f=>f.route.id===c.route.id),d=u!=null&&!sR(u,c)&&(i&&i[c.route.id])!==void 0;if(Yi(l)&&(o||d)){let f=r[s];He(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await cR(l,f,o).then(h=>{h&&(n[s]=h||n[s])})}}}async function cR(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:kt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:kt.error,error:o}}return{type:kt.data,data:e.deferredData.data}}}function M0(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function og(e,t){let n=typeof t=="string"?qo(t).search:t.search;if(e[e.length-1].route.index&&M0(n||""))return e[e.length-1];let r=tR(e);return r[r.length-1]}function vS(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:s}=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(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function Em(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 yW(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 Sl(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 xW(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 ei(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 wW(e,t){try{let n=e.sessionStorage.getItem(iR);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 SW(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(iR,JSON.stringify(n))}catch(r){La(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
535
|
-
* React Router v6.23.0
|
|
536
|
-
*
|
|
537
|
-
* Copyright (c) Remix Software Inc.
|
|
538
|
-
*
|
|
539
|
-
* This source code is licensed under the MIT license found in the
|
|
540
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
541
|
-
*
|
|
542
|
-
* @license MIT
|
|
543
|
-
*/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 vh=m.createContext(null),uR=m.createContext(null),yh=m.createContext(null),xh=m.createContext(null),Ni=m.createContext({outlet:null,matches:[],isDataRoute:!1}),dR=m.createContext(null);function wh(){return m.useContext(xh)!=null}function Go(){return wh()||He(!1),m.useContext(xh).location}function fR(e){m.useContext(yh).static||m.useLayoutEffect(e)}function Bt(){let{isDataRoute:e}=m.useContext(Ni);return e?MW():bW()}function bW(){wh()||He(!1);let e=m.useContext(vh),{basename:t,future:n,navigator:r}=m.useContext(yh),{matches:o}=m.useContext(Ni),{pathname:i}=Go(),s=JSON.stringify(nR(o,n.v7_relativeSplatPath)),l=m.useRef(!1);return fR(()=>{l.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=rR(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:bi([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,s,i,e])}const CW=m.createContext(null);function EW(e){let t=m.useContext(Ni).outlet;return t&&m.createElement(CW.Provider,{value:e},t)}function ot(){let{matches:e}=m.useContext(Ni),t=e[e.length-1];return t?t.params:{}}function jW(e,t){return hR(e,t)}function hR(e,t,n,r){wh()||He(!1);let{navigator:o}=m.useContext(yh),{matches:i}=m.useContext(Ni),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=Go(),d;if(t){var f;let S=typeof t=="string"?qo(t):t;c==="/"||(f=S.pathname)!=null&&f.startsWith(c)||He(!1),d=S}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let S=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let g=ua(e,{pathname:p}),v=_W(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:bi([c,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:bi([c,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&v?m.createElement(xh.Provider,{value:{location:wc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Ut.Pop}},v):v}function PW(){let e=NW(),t=A0(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 m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:o},n):null,null)}const TW=m.createElement(PW,null);class kW extends m.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?m.createElement(Ni.Provider,{value:this.props.routeContext},m.createElement(dR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RW(e){let{routeContext:t,match:n,children:r}=e,o=m.useContext(vh);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Ni.Provider,{value:t},r)}function _W(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((i=n)!=null&&i.errors)e=n.matches;else return null}let s=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let d=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||He(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<s.length;d++){let f=s[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let p,g=!1,v=null,S=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,v=f.route.errorElement||TW,c&&(u<0&&h===0?(OW("route-fallback"),g=!0,S=null):u===h&&(g=!0,S=f.route.hydrateFallbackElement||null)));let y=t.concat(s.slice(0,h+1)),x=()=>{let w;return p?w=v:g?w=S:f.route.Component?w=m.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,m.createElement(RW,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(kW,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var mR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(mR||{}),Jd=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}(Jd||{});function DW(e){let t=m.useContext(vh);return t||He(!1),t}function IW(e){let t=m.useContext(uR);return t||He(!1),t}function AW(e){let t=m.useContext(Ni);return t||He(!1),t}function pR(e){let t=AW(),n=t.matches[t.matches.length-1];return n.route.id||He(!1),n.route.id}function NW(){var e;let t=m.useContext(dR),n=IW(Jd.UseRouteError),r=pR(Jd.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function MW(){let{router:e}=DW(mR.UseNavigateStable),t=pR(Jd.UseNavigateStable),n=m.useRef(!1);return fR(()=>{n.current=!0}),m.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 yS={};function OW(e,t,n){yS[e]||(yS[e]=!0)}function O0(e){return EW(e.context)}function Se(e){He(!1)}function $W(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Ut.Pop,navigator:i,static:s=!1,future:l}=e;wh()&&He(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:i,static:s,future:wc({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof r=="string"&&(r=qo(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,v=m.useMemo(()=>{let S=su(d,c);return S==null?null:{location:{pathname:S,search:f,hash:h,state:p,key:g},navigationType:o}},[c,d,f,h,p,g,o]);return v==null?null:m.createElement(yh.Provider,{value:u},m.createElement(xh.Provider,{children:n,value:v}))}function LW(e){let{children:t,location:n}=e;return jW(ig(t),n)}new Promise(()=>{});function ig(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,o)=>{if(!m.isValidElement(r))return;let i=[...t,o];if(r.type===m.Fragment){n.push.apply(n,ig(r.props.children,i));return}r.type!==Se&&He(!1),!r.props.index||!r.props.children||He(!1);let s={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&&(s.children=ig(r.props.children,i)),n.push(s)}),n}function FW(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:m.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
544
|
-
* React Router DOM v6.23.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 Zd(){return Zd=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},Zd.apply(this,arguments)}function sg(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 zW(e,t){let n=sg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const VW="6";try{window.__reactRouterVersion=VW}catch{}function BW(e,t){return oW({basename:void 0,future:Zd({},void 0,{v7_prependBasename:!0}),history:TH({window:void 0}),hydrationData:UW(),routes:e,mapRouteProperties:FW,unstable_dataStrategy:void 0,window:void 0}).initialize()}function UW(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Zd({},t,{errors:HW(t.errors)})),t}function HW(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 I0(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 s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const WW=m.createContext({isTransitioning:!1}),qW=m.createContext(new Map),GW="startTransition",xS=YS[GW],QW="flushSync",wS=TA[QW];function KW(e){xS?xS(e):e()}function bl(e){wS?wS(e):e()}class YW{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 XW(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=m.useState(n.state),[s,l]=m.useState(),[c,u]=m.useState({isTransitioning:!1}),[d,f]=m.useState(),[h,p]=m.useState(),[g,v]=m.useState(),S=m.useRef(new Map),{v7_startTransition:y}=r||{},x=m.useCallback(E=>{y?KW(E):E()},[y]),w=m.useCallback((E,T)=>{let{deletedFetchers:_,unstable_flushSync:R,unstable_viewTransitionOpts:O}=T;_.forEach(M=>S.current.delete(M)),E.fetchers.forEach((M,F)=>{M.data!==void 0&&S.current.set(F,M.data)});let I=n.window==null||typeof n.window.document.startViewTransition!="function";if(!O||I){R?bl(()=>i(E)):x(()=>i(E));return}if(R){bl(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let M=n.window.document.startViewTransition(()=>{bl(()=>i(E))});M.finished.finally(()=>{bl(()=>{f(void 0),p(void 0),l(void 0),u({isTransitioning:!1})})}),bl(()=>p(M));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,x]);m.useLayoutEffect(()=>n.subscribe(w),[n,w]),m.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new YW)},[c]),m.useEffect(()=>{if(d&&s&&n.window){let E=s,T=d.promise,_=n.window.document.startViewTransition(async()=>{x(()=>i(E)),await T});_.finished.finally(()=>{f(void 0),p(void 0),l(void 0),u({isTransitioning:!1})}),p(_)}},[x,s,d,n.window]),m.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,h,o.location,s]),m.useEffect(()=>{!c.isTransitioning&&g&&(l(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[c.isTransitioning,g]),m.useEffect(()=>{},[]);let b=m.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,T,_)=>n.navigate(E,{state:T,preventScrollReset:_==null?void 0:_.preventScrollReset}),replace:(E,T,_)=>n.navigate(E,{replace:!0,state:T,preventScrollReset:_==null?void 0:_.preventScrollReset})}),[n]),j=n.basename||"/",P=m.useMemo(()=>({router:n,navigator:b,static:!1,basename:j}),[n,b,j]);return m.createElement(m.Fragment,null,m.createElement(vh.Provider,{value:P},m.createElement(uR.Provider,{value:o},m.createElement(qW.Provider,{value:S.current},m.createElement(WW.Provider,{value:c},m.createElement($W,{basename:j,location:o.location,navigationType:o.historyAction,navigator:b,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?m.createElement(JW,{routes:n.routes,future:n.future,state:o}):t))))),null)}function JW(e){let{routes:t,future:n,state:r}=e;return hR(t,void 0,r,n)}var SS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(SS||(SS={}));var bS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(bS||(bS={}));function $0(e){let t=m.useRef(sg(e)),n=m.useRef(!1),r=Go(),o=m.useMemo(()=>zW(r.search,n.current?null:t.current),[r.search]),i=Bt(),s=m.useCallback((l,c)=>{const u=sg(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,c)},[i,o]);return[o,s]}const ZW=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 au(e,t){const n=eq(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 eq(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=ZW.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var rl=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(u){o(u)}},s=c=>{try{l(n.throw(c))}catch(u){o(u)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((n=n.apply(e,t)).next())});const tq=[".DS_Store","Thumbs.db"];function nq(e){return rl(this,null,function*(){return ef(e)&&rq(e.dataTransfer)?aq(e.dataTransfer,e.type):oq(e)?iq(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?sq(e):[]})}function rq(e){return ef(e)}function oq(e){return ef(e)&&ef(e.target)}function ef(e){return typeof e=="object"&&e!==null}function iq(e){return ag(e.target.files).map(t=>au(t))}function sq(e){return rl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>au(n))})}function aq(e,t){return rl(this,null,function*(){if(e.items){const n=ag(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(lq));return CS(gR(r))}return CS(ag(e.files).map(n=>au(n)))})}function CS(e){return e.filter(t=>tq.indexOf(t.name)===-1)}function ag(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 lq(e){if(typeof e.webkitGetAsEntry!="function")return ES(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?vR(t):ES(e)}function gR(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?gR(n):[n]],[])}function ES(e){const t=e.getAsFile();if(!t)return Promise.reject(`${e} is not a File`);const n=au(t);return Promise.resolve(n)}function cq(e){return rl(this,null,function*(){return e.isDirectory?vR(e):uq(e)})}function vR(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(s=>rl(this,null,function*(){if(s.length){const l=Promise.all(s.map(cq));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),s=>{r(s)})}i()})}function uq(e){return rl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=au(r,e.fullPath);t(o)},r=>{n(r)})})})}function dq(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(s=>{const l=s.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):o===l})}return!0}var fq=Object.defineProperty,hq=Object.defineProperties,mq=Object.getOwnPropertyDescriptors,jS=Object.getOwnPropertySymbols,pq=Object.prototype.hasOwnProperty,gq=Object.prototype.propertyIsEnumerable,PS=(e,t,n)=>t in e?fq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vq=(e,t)=>{for(var n in t||(t={}))pq.call(t,n)&&PS(e,n,t[n]);if(jS)for(var n of jS(t))gq.call(t,n)&&PS(e,n,t[n]);return e},yq=(e,t)=>hq(e,mq(t));const xq="file-invalid-type",wq="file-too-large",Sq="file-too-small",bq="too-many-files",Cq=e=>{e=Array.isArray(e)&&e.length===1?e[0]:e;const t=Array.isArray(e)?`one of ${e.join(", ")}`:e;return{code:xq,message:`File type must be ${t}`}},TS=e=>({code:wq,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),kS=e=>({code:Sq,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),Eq={code:bq,message:"Too many files"};function yR(e,t){const n=e.type==="application/x-moz-file"||dq(e,t);return[n,n?null:Cq(t)]}function xR(e,t,n){if(Hi(e.size))if(Hi(t)&&Hi(n)){if(e.size>n)return[!1,TS(n)];if(e.size<t)return[!1,kS(t)]}else{if(Hi(t)&&e.size<t)return[!1,kS(t)];if(Hi(n)&&e.size>n)return[!1,TS(n)]}return[!0,null]}function Hi(e){return e!=null}function jq({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:i,validator:s}){return!o&&e.length>1||o&&i>=1&&e.length>i?!1:e.every(l=>{const[c]=yR(l,t),[u]=xR(l,n,r),d=s?s(l):null;return c&&u&&!d})}function tf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Uu(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 RS(e){e.preventDefault()}function Pq(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Tq(e){return e.indexOf("Edge/")!==-1}function kq(e=window.navigator.userAgent){return Pq(e)||Tq(e)}function Zr(...e){return(t,...n)=>e.some(r=>(!tf(t)&&r&&r(t,...n),tf(t)))}function Rq(){return"showOpenFilePicker"in window}function _q(e){return Hi(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return wR(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(SR))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>yq(vq({},n),{[r]:o}),{})}]:e}function Dq(e){if(Hi(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>wR(t)||SR(t)).join(",")}function Iq(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Aq(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function wR(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function SR(e){return/^.*\.[\w]+$/.test(e)}var Nq=Object.defineProperty,Mq=Object.defineProperties,Oq=Object.getOwnPropertyDescriptors,nf=Object.getOwnPropertySymbols,bR=Object.prototype.hasOwnProperty,CR=Object.prototype.propertyIsEnumerable,_S=(e,t,n)=>t in e?Nq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tn=(e,t)=>{for(var n in t||(t={}))bR.call(t,n)&&_S(e,n,t[n]);if(nf)for(var n of nf(t))CR.call(t,n)&&_S(e,n,t[n]);return e},ii=(e,t)=>Mq(e,Oq(t)),rf=(e,t)=>{var n={};for(var r in e)bR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nf)for(var r of nf(e))t.indexOf(r)<0&&CR.call(e,r)&&(n[r]=e[r]);return n};const L0=m.forwardRef((e,t)=>{var n=e,{children:r}=n,o=rf(n,["children"]);const i=jR(o),{open:s}=i,l=rf(i,["open"]);return m.useImperativeHandle(t,()=>({open:s}),[s]),C.createElement(m.Fragment,null,r(ii(Tn({},l),{open:s})))});L0.displayName="Dropzone";const ER={disabled:!1,getFilesFromEvent:nq,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};L0.defaultProps=ER;L0.propTypes={children:dt.func,accept:dt.objectOf(dt.arrayOf(dt.string)),multiple:dt.bool,preventDropOnDocument:dt.bool,noClick:dt.bool,noKeyboard:dt.bool,noDrag:dt.bool,noDragEventsBubbling:dt.bool,minSize:dt.number,maxSize:dt.number,maxFiles:dt.number,disabled:dt.bool,getFilesFromEvent:dt.func,onFileDialogCancel:dt.func,onFileDialogOpen:dt.func,useFsAccessApi:dt.bool,autoFocus:dt.bool,onDragEnter:dt.func,onDragLeave:dt.func,onDragOver:dt.func,onDrop:dt.func,onDropAccepted:dt.func,onDropRejected:dt.func,onError:dt.func,validator:dt.func};const lg={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function jR(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:i,multiple:s,maxFiles:l,onDragEnter:c,onDragLeave:u,onDragOver:d,onDrop:f,onDropAccepted:h,onDropRejected:p,onFileDialogCancel:g,onFileDialogOpen:v,useFsAccessApi:S,autoFocus:y,preventDropOnDocument:x,noClick:w,noKeyboard:b,noDrag:j,noDragEventsBubbling:P,onError:E,validator:T}=Tn(Tn({},ER),e),_=m.useMemo(()=>Dq(t),[t]),R=m.useMemo(()=>_q(t),[t]),O=m.useMemo(()=>typeof v=="function"?v:DS,[v]),I=m.useMemo(()=>typeof g=="function"?g:DS,[g]),M=m.useRef(null),F=m.useRef(null),[N,A]=m.useReducer($q,lg),{isFocused:D,isFileDialogActive:k}=N,L=m.useRef(typeof window<"u"&&window.isSecureContext&&S&&Rq()),B=()=>{!L.current&&k&&setTimeout(()=>{if(F.current){const{files:Y}=F.current;Y.length||(A({type:"closeDialog"}),I())}},300)};m.useEffect(()=>(window.addEventListener("focus",B,!1),()=>{window.removeEventListener("focus",B,!1)}),[F,k,I,L]);const H=m.useRef([]),J=Y=>{M.current&&M.current.contains(Y.target)||(Y.preventDefault(),H.current=[])};m.useEffect(()=>(x&&(document.addEventListener("dragover",RS,!1),document.addEventListener("drop",J,!1)),()=>{x&&(document.removeEventListener("dragover",RS),document.removeEventListener("drop",J))}),[M,x]),m.useEffect(()=>(!n&&y&&M.current&&M.current.focus(),()=>{}),[M,y,n]);const we=m.useCallback(Y=>{E?E(Y):console.error(Y)},[E]),ie=m.useCallback(Y=>{Y.preventDefault(),Y.persist(),je(Y),H.current=[...H.current,Y.target],Uu(Y)&&Promise.resolve(r(Y)).then(Q=>{if(tf(Y)&&!P)return;const ye=Q.length,nt=ye>0&&jq({files:Q,accept:_,minSize:i,maxSize:o,multiple:s,maxFiles:l,validator:T}),Ct=ye>0&&!nt;A({isDragAccept:nt,isDragReject:Ct,isDragActive:!0,type:"setDraggedFiles"}),c&&c(Y)}).catch(Q=>we(Q))},[r,c,we,P,_,i,o,s,l,T]),Ce=m.useCallback(Y=>{Y.preventDefault(),Y.persist(),je(Y);const Q=Uu(Y);if(Q&&Y.dataTransfer)try{Y.dataTransfer.dropEffect="copy"}catch{}return Q&&d&&d(Y),!1},[d,P]),_e=m.useCallback(Y=>{Y.preventDefault(),Y.persist(),je(Y);const Q=H.current.filter(nt=>M.current&&M.current.contains(nt)),ye=Q.indexOf(Y.target);ye!==-1&&Q.splice(ye,1),H.current=Q,!(Q.length>0)&&(A({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Uu(Y)&&u&&u(Y))},[M,u,P]),Pe=m.useCallback((Y,Q)=>{const ye=[],nt=[];Y.forEach(Ct=>{const[ct,Dt]=yR(Ct,_),[Wt,Kr]=xR(Ct,i,o),mo=T?T(Ct):null;if(ct&&Wt&&!mo)ye.push(Ct);else{let sn=[Dt,Kr];mo&&(sn=sn.concat(mo)),nt.push({file:Ct,errors:sn.filter(Qo=>Qo)})}}),(!s&&ye.length>1||s&&l>=1&&ye.length>l)&&(ye.forEach(Ct=>{nt.push({file:Ct,errors:[Eq]})}),ye.splice(0)),A({acceptedFiles:ye,fileRejections:nt,type:"setFiles"}),f&&f(ye,nt,Q),nt.length>0&&p&&p(nt,Q),ye.length>0&&h&&h(ye,Q)},[A,s,_,i,o,l,f,h,p,T]),ue=m.useCallback(Y=>{Y.preventDefault(),Y.persist(),je(Y),H.current=[],Uu(Y)&&Promise.resolve(r(Y)).then(Q=>{tf(Y)&&!P||Pe(Q,Y)}).catch(Q=>we(Q)),A({type:"reset"})},[r,Pe,we,P]),Ue=m.useCallback(()=>{if(L.current){A({type:"openDialog"}),O();const Y={multiple:s,types:R};window.showOpenFilePicker(Y).then(Q=>r(Q)).then(Q=>{Pe(Q,null),A({type:"closeDialog"})}).catch(Q=>{Iq(Q)?(I(Q),A({type:"closeDialog"})):Aq(Q)?(L.current=!1,F.current?(F.current.value=null,F.current.click()):we(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."))):we(Q)});return}F.current&&(A({type:"openDialog"}),O(),F.current.value=null,F.current.click())},[A,O,I,S,Pe,we,R,s]),bt=m.useCallback(Y=>{!M.current||!M.current.isEqualNode(Y.target)||(Y.key===" "||Y.key==="Enter"||Y.keyCode===32||Y.keyCode===13)&&(Y.preventDefault(),Ue())},[M,Ue]),at=m.useCallback(()=>{A({type:"focus"})},[]),ve=m.useCallback(()=>{A({type:"blur"})},[]),Le=m.useCallback(()=>{w||(kq()?setTimeout(Ue,0):Ue())},[w,Ue]),Ae=Y=>n?null:Y,te=Y=>b?null:Ae(Y),re=Y=>j?null:Ae(Y),je=Y=>{P&&Y.stopPropagation()},Ye=m.useMemo(()=>(Y={})=>{var Q=Y,{refKey:ye="ref",role:nt,onKeyDown:Ct,onFocus:ct,onBlur:Dt,onClick:Wt,onDragEnter:Kr,onDragOver:mo,onDragLeave:sn,onDrop:Qo}=Q,Is=rf(Q,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return Tn(Tn({onKeyDown:te(Zr(Ct,bt)),onFocus:te(Zr(ct,at)),onBlur:te(Zr(Dt,ve)),onClick:Ae(Zr(Wt,Le)),onDragEnter:re(Zr(Kr,ie)),onDragOver:re(Zr(mo,Ce)),onDragLeave:re(Zr(sn,_e)),onDrop:re(Zr(Qo,ue)),role:typeof nt=="string"&&nt!==""?nt:"presentation",[ye]:M},!n&&!b?{tabIndex:0}:{}),Is)},[M,bt,at,ve,Le,ie,Ce,_e,ue,b,j,n]),Xe=m.useCallback(Y=>{Y.stopPropagation()},[]),ze=m.useMemo(()=>(Y={})=>{var Q=Y,{refKey:ye="ref",onChange:nt,onClick:Ct}=Q,ct=rf(Q,["refKey","onChange","onClick"]);const Dt={accept:_,multiple:s,type:"file",style:{display:"none"},onChange:Ae(Zr(nt,ue)),onClick:Ae(Zr(Ct,Xe)),tabIndex:-1,[ye]:F};return Tn(Tn({},Dt),ct)},[F,t,s,ue,n]);return ii(Tn({},N),{isFocused:D&&!n,getRootProps:Ye,getInputProps:ze,rootRef:M,inputRef:F,open:Ae(Ue)})}function $q(e,t){switch(t.type){case"focus":return ii(Tn({},e),{isFocused:!0});case"blur":return ii(Tn({},e),{isFocused:!1});case"openDialog":return ii(Tn({},lg),{isFileDialogActive:!0});case"closeDialog":return ii(Tn({},e),{isFileDialogActive:!1});case"setDraggedFiles":return ii(Tn({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ii(Tn({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Tn({},lg);default:return e}}function DS(){}const[Lq,Fq]=Nn("Dropzone component was not found in tree");function F0(e){const t=n=>{const{children:r,...o}=U(`Dropzone${ex(e)}`,{},n),i=Fq(),s=Oo(r)?r:C.createElement("span",null,r);return i[e]?m.cloneElement(s,o):null};return t.displayName=`@mantine/dropzone/${ex(e)}`,t}const zq=F0("accept"),Vq=F0("reject"),Bq=F0("idle");var Sc={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const Uq={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},Hq=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const i=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),s=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":St(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":s.color,"--dropzone-reject-bg":s.background}}},Mi=X((e,t)=>{const n=U("Dropzone",Uq,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,disabled:d,loading:f,multiple:h,maxSize:p,accept:g,children:v,onDropAny:S,onDrop:y,onReject:x,openRef:w,name:b,maxFiles:j,autoFocus:P,activateOnClick:E,activateOnDrag:T,dragEventsBubbling:_,activateOnKeyboard:R,onDragEnter:O,onDragLeave:I,onDragOver:M,onFileDialogCancel:F,onFileDialogOpen:N,preventDropOnDocument:A,useFsAccessApi:D,getFilesFromEvent:k,validator:L,rejectColor:B,acceptColor:H,enablePointerEvents:J,loaderProps:we,inputProps:ie,mod:Ce,..._e}=n,Pe=me({name:"Dropzone",classes:Sc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:Hq}),{getRootProps:ue,getInputProps:Ue,isDragAccept:bt,isDragReject:at,open:ve}=jR({onDrop:S,onDropAccepted:y,onDropRejected:x,disabled:d||f,accept:Array.isArray(g)?g.reduce((Ae,te)=>({...Ae,[te]:[]}),{}):g,multiple:h,maxSize:p,maxFiles:j,autoFocus:P,noClick:!E,noDrag:!T,noDragEventsBubbling:!_,noKeyboard:!R,onDragEnter:O,onDragLeave:I,onDragOver:M,onFileDialogCancel:F,onFileDialogOpen:N,preventDropOnDocument:A,useFsAccessApi:D,validator:L,...k?{getFilesFromEvent:k}:null});cf(w,ve);const Le=!bt&&!at;return C.createElement(Lq,{value:{accept:bt,reject:at,idle:Le}},C.createElement(G,{...ue(),...Pe("root",{focusable:!0}),..._e,mod:[{accept:bt,reject:at,idle:Le,loading:f,"activate-on-click":E},Ce]},C.createElement(fy,{visible:f,overlayProps:{radius:u},unstyled:l,loaderProps:we}),C.createElement("input",{...Ue(ie),name:b}),C.createElement("div",{...Pe("inner"),ref:t,"data-enable-pointer-events":J||void 0},v)))});Mi.classes=Sc;Mi.displayName="@mantine/dropzone/Dropzone";Mi.Accept=zq;Mi.Idle=Bq;Mi.Reject=Vq;const Wq={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Hr("max"),withinPortal:!0},z0=X((e,t)=>{const n=U("DropzoneFullScreen",Wq,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,active:u,onDrop:d,onReject:f,zIndex:h,withinPortal:p,portalProps:g,...v}=n,S=me({name:"DropzoneFullScreen",classes:Sc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"fullScreen"}),{resolvedClassNames:y,resolvedStyles:x}=Ec({classNames:r,styles:s,props:n}),[w,b]=m.useState(0),[j,{open:P,close:E}]=f_(!1),T=R=>{var O;(O=R.dataTransfer)!=null&&O.types.includes("Files")&&(b(I=>I+1),P())},_=()=>{b(R=>R-1)};return m.useEffect(()=>{w===0&&E()},[w]),m.useEffect(()=>{if(u)return document.addEventListener("dragenter",T,!1),document.addEventListener("dragleave",_,!1),()=>{document.removeEventListener("dragenter",T,!1),document.removeEventListener("dragleave",_,!1)}},[u]),C.createElement(Ss,{...g,withinPortal:p},C.createElement(G,{...S("fullScreen",{style:{opacity:j?1:0,pointerEvents:j?"all":"none",zIndex:h}}),ref:t},C.createElement(Mi,{...v,classNames:y,styles:x,unstyled:l,className:Sc.dropzone,onDrop:R=>{d==null||d(R),E(),b(0)},onReject:R=>{f==null||f(R),E(),b(0)}})))});z0.classes=Sc;z0.displayName="@mantine/dropzone/DropzoneFullScreen";Mi.FullScreen=z0;const Hu=Mi,qq='{"resourceType": "Bundle"}';function jm({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:s="show",loading:l}){ao[s]({id:e,loading:l,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function Gq(){const e=$t(),t=se(),[n,r]=m.useState({}),o=m.useCallback(async(l,c)=>{const u="batch-upload";jm({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=xT(d));const f=await t.executeBatch(d);r(h=>({...h,[c]:f})),jm({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(dh,{size:"1rem"}),withCloseButton:!0})}catch(d){jm({id:u,title:"Batch Upload Failed",color:"red",message:$e(d),method:"update",icon:a.jsx(Gd,{size:"1rem"}),withCloseButton:!0})}},[t]),i=m.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]),s=m.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return a.jsxs(Re,{children:[a.jsx(ge,{children:"Batch Create"}),a.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",a.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Input"}),a.jsxs(et,{defaultValue:"upload",children:[a.jsxs(et.List,{children:[a.jsx(et.Tab,{value:"upload",children:"File Upload"}),a.jsx(et.Tab,{value:"json",children:"JSON"})]}),a.jsx(et.Panel,{value:"upload",pt:"xs",children:a.jsx(Hu,{onDrop:i,accept:["application/json"],children:a.jsxs(ee,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(Hu.Accept,{children:a.jsx($w,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(Hu.Reject,{children:a.jsx(Gd,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(Hu.Idle,{children:a.jsx($w,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(de,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(de,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(et.Panel,{value:"json",pt:"xs",children:a.jsxs(Qe,{onSubmit:s,children:[a.jsx(Ka,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:qq,deserialize:JSON.parse}),a.jsx(ee,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(oe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(et,{defaultValue:Object.keys(n)[0],children:[a.jsx(et.List,{children:Object.keys(n).map(l=>a.jsx(et.Tab,{value:l,children:l},l))}),Object.keys(n).map(l=>a.jsx(et.Panel,{value:l,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[l],void 0,2)})},l))]}),a.jsx(ee,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(oe,{onClick:()=>r({}),children:"Start over"})})]})]})}function Qq(){const{resourceType:e}=ot(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Oa("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(Re,{children:[a.jsxs(ge,{children:["No apps for ",e]}),a.jsx(qe,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(Re,{children:a.jsx("div",{children:r.map(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(qe,{to:`/forms/${o.id}?subject=`+n.map(i=>`${e}/${i}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(Br,{})}function Kq(){const e=se(),[t,n]=m.useState(),[r,o]=m.useState(!1);return a.jsx(Re,{width:450,children:a.jsxs(Qe,{onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(s=>n(ht(s)))},children:[a.jsxs(un,{style:{flexDirection:"column"},children:[a.jsx(Gr,{size:32}),a.jsx(ge,{children:"Change password"})]}),!r&&a.jsxs(Ie,{gap:"xl",mt:"xl",children:[a.jsx(Lr,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Ke(t,"oldPassword")}),a.jsx(Lr,{name:"newPassword",label:"New password",required:!0,error:Ke(t,"newPassword")}),a.jsx(Lr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ke(t,"confirmPassword")}),a.jsx(ee,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(oe,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const cg=["Form","JSON","Profiles"],Yq=["Profiles"],Pm=cg[0].toLowerCase();function Xq(){const e=Bt(),t=$t(),{resourceType:n}=ot(),[r,o]=m.useState(()=>{const s=window.location.pathname.split("/").pop();return s&&cg.map(l=>l.toLowerCase()).includes(s)?s:Pm});function i(s){s||(s=Pm),o(s),e(`/${n}/new/${s}`)}return a.jsxs(a.Fragment,{children:[a.jsxs(Hn,{children:[a.jsxs(de,{p:"md",fw:500,children:["New ",n]}),a.jsx(Er,{children:a.jsx(et,{defaultValue:Pm,value:r,onChange:i,children:a.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:cg.map(s=>a.jsx(et.Tab,{value:s.toLowerCase(),px:"md",children:Yq.includes(s)?a.jsxs(ee,{gap:"xs",wrap:"nowrap",children:[s,a.jsx($c,{color:t.primaryColor,size:"sm",children:"Beta"})]}):s},s))})})})]}),a.jsx(O0,{})]})}function Jq(){return a.jsx(Re,{children:a.jsxs(Ie,{children:[a.jsx(ge,{order:1,children:"Unexpected Error"}),a.jsx(de,{children:"We're sorry, something went wrong."}),a.jsxs(de,{children:["Please contact ",a.jsx(Ze,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const Zq="_root_1fbwr_1",eG="_entry_1fbwr_8",tG="_key_1fbwr_13",nG="_value_1fbwr_20",Sh={root:Zq,entry:eG,key:tG,value:nG};function Ve(e){return a.jsx(Er,{children:a.jsx("div",{className:Sh.root,children:e.children})})}Ve.Entry=function(t){return a.jsx("div",{className:Sh.entry,children:t.children})};Ve.Key=function(t){return a.jsx("div",{className:Sh.key,children:t.children})};Ve.Value=function(t){return a.jsx("div",{className:Sh.value,children:t.children})};function rG(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function PR(e){var n,r;const t=mt(e.patient);return t?a.jsxs(Ve,{children:[a.jsx(Ai,{value:t,size:"lg",color:rG(t)}),a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"Name"}),a.jsx(Ve.Value,{children:a.jsx(qe,{to:t,fw:500,children:t.name?a.jsx(a0,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"DoB"}),a.jsx(Ve.Value,{children:t.birthDate})]}),a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"Age"}),a.jsx(Ve.Value,{children:RL(t.birthDate)})]})]}),t.gender&&a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"Gender"}),a.jsx(Ve.Value,{children:t.gender})]}),t.address&&a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"State"}),a.jsx(Ve.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:o==null?void 0:o.system}),a.jsx(Ve.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function TR(e){const t=mt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(qe,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(s,l){s&&l&&n.push({key:s,value:l})}function o(s){s&&r(s.system,s.value)}function i(s,l){Array.isArray(l)?l.forEach(c=>i(s,c)):typeof l=="string"?r(s,l):l&&(Array.isArray(l.coding)?r(s,l.coding.map(c=>c.display||c.code).join(", ")):r(s,l.text))}if("name"in t){const s=Ao(t);s!==yt(t)&&r("Name",s)}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}),a.jsx(Ve,{children:n.map(s=>a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:s.key}),a.jsx(Ve.Value,{children:s.value})]},`${s.key}-${s.value}`))})}function V0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function oG(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 cd(e,t){return new Promise((n,r)=>{var i;const o=new MessageChannel;o.port1.onmessage=({data:s})=>{o.port1.close(),s.error?r(s.error):n(s.result)},(i=e.contentWindow)==null||i.postMessage(t,"https://codeeditor.medplum.com",[o.port2])})}function Oi(e){var t;return oh((t=e.getActiveLogin())==null?void 0:t.project)}function iG(e,t){const n=new Blob([e],{type:en.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 sG(){const{id:e}=ot(),t=Go(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=se(),[i,s]=m.useState(!0),[l,c]=m.useState(),[u,d]=m.useState(),[f,h]=m.useState(),[p,g]=m.useState(),[v,S]=m.useState();if(m.useEffect(()=>{const w={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const b=r.split(",").filter(j=>!!j);b.length===1&&w.entry.push({request:{method:"GET",url:b[0]}}),d(b)}o.executeBatch(w).then(b=>{var j,P,E,T,_,R,O,I;((E=(P=(j=b.entry)==null?void 0:j[0])==null?void 0:P.response)==null?void 0:E.status)!=="200"?g((R=(_=(T=b.entry)==null?void 0:T[0])==null?void 0:_.response)==null?void 0:R.outcome):(c((O=b.entry[0])==null?void 0:O.resource),h((I=b.entry[1])==null?void 0:I.resource)),s(!1)}).catch(b=>{g(b),s(!1)})},[o,e,r]),p)return a.jsx(Re,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(p,void 0,2)})});if(v)return a.jsxs(Re,{children:[a.jsx(ge,{children:l==null?void 0:l.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[v.length===1&&a.jsx("li",{children:a.jsx(qe,{to:v[0],children:"Review your answers"})}),v.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:v.map(w=>a.jsx("li",{children:a.jsx(qe,{to:w,children:yt(w)})},w.id))})]}),f&&a.jsx("li",{children:a.jsxs(qe,{to:f,children:["Back to ",Ao(f)]})}),a.jsx("li",{children:a.jsx(qe,{to:"/",children:"Go back home"})})]})]});if(i||!l)return a.jsx(Br,{});const y=f&&V0(f);return a.jsxs(a.Fragment,{children:[a.jsxs(Hn,{shadow:"xs",radius:0,children:[y&&a.jsx(PR,{patient:y}),f&&f.resourceType!=="Patient"&&a.jsx(TR,{resource:f}),a.jsx(G,{px:"xl",py:"md",children:a.jsxs(de,{children:[Ao(l),u&&u.length>1&&a.jsxs(a.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),a.jsx(Re,{children:a.jsx(Bk,{questionnaire:l,subject:f&&vt(f),onSubmit:x})})]});async function x(w){const b=[];if(!u||u.length===0)b.push(await o.createResource(w));else for(const j of u)b.push(await o.createResource({...w,subject:{reference:j}}));S(b)}}const aG="_paper_unw9o_1",lG={paper:aG},cG={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function kR(e,t){const n=e.resourceType||uG(t),r=e.fields??dG(n),o=e.filters??(e.resourceType?void 0:fG(n)),i=e.sortRules??hG(n),s=e.offset??0,l=e.count??ah;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:s,count:l}}function uG(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 dG(e){const t=B0(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 fG(e){var t;return(t=B0(e))==null?void 0:t.filters}function hG(e){const t=B0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function B0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function mG(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function pG(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=kR(n,t.getUserConfiguration()),o=await t.search(r.resourceType,la({...r,total:"accurate",fields:void 0}));return xT(o)}function IS(){const e=se(),t=Bt(),n=Go(),[r,o]=m.useState();return m.useEffect(()=>{const i=H7(n.pathname+n.search),s=kR(i,e.getUserConfiguration());n.pathname===`/${s.resourceType}`&&n.search===la(s)?(mG(s),o(s)):t(`/${s.resourceType}${la(s)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?a.jsx(Br,{}):a.jsx(Hn,{shadow:"xs",m:"md",p:"xs",className:lG.paper,children:a.jsx(ou,{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}${la(i.definition)}`)},onNew:()=>{t(cG[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+la(r);e.download(i).then(s=>{window.open(window.URL.createObjectURL(s),"_blank")}).catch(s=>xe({color:"red",message:$e(s),autoClose:!1}))},onExportTransactionBundle:async()=>{pG(r,e).then(i=>iG(JSON.stringify(i,void 0,2))).catch(i=>xe({color:"red",message:$e(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(s=>({request:{method:"DELETE",url:`${r.resourceType}/${s}`}}))}).then(()=>o({...r})).catch(s=>xe({color:"red",message:$e(s),autoClose:!1})))},onBulk:i=>{t(`/bulk/${r.resourceType}?ids=${i.join(",")}`)}})})}function gG(){const e=se(),[t,n]=m.useState(),[r,o]=m.useState(void 0);m.useEffect(()=>{e.get("auth/mfa/status").then(l=>{const c=new URL("https://chart.googleapis.com/chart");c.searchParams.set("chs","300x300"),c.searchParams.set("cht","qr"),c.searchParams.set("chl",l.enrollUri),c.searchParams.set("choe","UTF-8"),n(c.toString()),o(l.enrolled)}).catch(l=>xe({color:"red",message:$e(l),autoClose:!1}))},[e]);const i=m.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),xe({color:"green",message:"Success"})}).catch(c=>xe({color:"red",message:$e(c),autoClose:!1}))},[e]),s=m.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return r===void 0?null:r?a.jsx(Re,{children:a.jsxs(ee,{children:[a.jsx(ge,{children:"MFA is enabled"}),a.jsx(oe,{onClick:s,children:"Disable MFA"})]})}):a.jsx(Re,{width:400,children:a.jsxs(Qe,{onSubmit:i,children:[a.jsx(ge,{children:"Multi Factor Auth Setup"}),a.jsx(un,{children:a.jsx("img",{src:t})}),a.jsx(fe,{name:"token",label:"Code"}),a.jsx(ee,{justify:"flex-end",mt:"xl",children:a.jsx(oe,{type:"submit",children:"Enroll"})})]})})}const ug={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function lu(){return ug}function RR(){try{return ug.registerEnabled!==!1&&ug.registerEnabled!=="false"}catch{return!0}}function vG(){const e=Bt(),[t]=$0(),n=t.get("client_id");if(!n)return null;const r=t.get("scope")||"openid";function o(i){const s=new URL(t.get("redirect_uri"));for(const l of["scope","state","nonce"])t.has(l)&&s.searchParams.set(l,t.get(l));s.searchParams.set("code",i),window.location.assign(s.toString())}return a.jsxs(Xk,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:lu().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:[a.jsx(Gr,{size:32}),a.jsx(ge,{children:"Sign in to Medplum"})]})}function yG(){const e=se(),t=Bt(),n=lu();return m.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),RR()?a.jsxs(xH,{type:"project",projectId:"new",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Gr,{size:32}),a.jsx(ge,{children:"Create a new account"})]}):a.jsx(Re,{width:450,children:a.jsx(Cs,{icon:a.jsx(Kc,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function xG(){const e=Bt(),t=se(),[n,r]=m.useState(),[o,i]=m.useState(!1),s=lu().recaptchaSiteKey;return m.useEffect(()=>{Kk(s)},[s]),a.jsx(Re,{width:450,children:a.jsxs(Qe,{onSubmit:async l=>{let c="";c=await Yk(s),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>r(ht(u)))},children:[a.jsxs(Ie,{gap:"lg",mb:"xl",align:"center",children:[a.jsx(Gr,{size:32}),a.jsx(ge,{children:"Medplum Password Reset"})]}),a.jsxs(Ie,{gap:"xl",children:[a.jsx(Qr,{issues:eu(n,void 0)}),!o&&a.jsxs(a.Fragment,{children:[a.jsx(fe,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Ke(n,"email")}),a.jsxs(ee,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Ze,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),a.jsx(oe,{type:"submit",children:"Reset password"})]})]}),o&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function wG(){var i;const e=Bt(),t=se(),[n,r]=m.useState();m.useEffect(()=>{t.get("auth/me").then(r).catch(s=>xe({color:"red",message:$e(s),autoClose:!1}))},[t]);function o(s){t.post("auth/revoke",{loginId:s}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>xe({color:"green",message:"Login revoked"})).catch(l=>xe({color:"red",message:$e(l),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(Re,{children:[a.jsx(ge,{children:"Security"}),a.jsxs(d0,{children:[a.jsx(jo,{term:"ID",children:a.jsx(Ze,{href:`/${yt(n.profile)}`,children:n.profile.id})}),a.jsx(jo,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(jo,{term:"Name",children:Qc((i=n.profile.name)==null?void 0:i[0])})]})]}),a.jsxs(Re,{children:[a.jsx(ge,{children:"Sessions"}),a.jsxs(ce,{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"OS"}),a.jsx("th",{children:"Browser"}),a.jsx("th",{children:"IP Address"}),a.jsx("th",{children:"Auth Method"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.security.sessions.map(s=>a.jsxs("tr",{children:[a.jsx("td",{children:s.os}),a.jsx("td",{children:s.browser}),a.jsx("td",{children:s.remoteAddress}),a.jsx("td",{children:s.authMethod}),a.jsx("td",{children:In(s.lastUpdated)}),a.jsx("td",{children:a.jsx(Ze,{href:"#",onClick:()=>o(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(Re,{children:[a.jsx(ge,{children:"Password"}),a.jsx(oe,{onClick:()=>e("/changepassword"),children:"Change password"})]}),a.jsxs(Re,{children:[a.jsx(ge,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(oe,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function SG(){const{id:e,secret:t}=ot(),n=se(),[r,o]=m.useState(),[i,s]=m.useState(!1),l=eu(r,void 0);return a.jsxs(Re,{width:450,children:[a.jsx(Qr,{issues:l}),a.jsxs(Qe,{onSubmit:c=>{if(c.password!==c.confirmPassword){o(Si("Passwords do not match","confirmPassword"));return}o(void 0);const u={id:e,secret:t,password:c.password};n.post("auth/setpassword",u).then(()=>s(!0)).catch(d=>o(ht(d)))},children:[a.jsxs(un,{style:{flexDirection:"column"},children:[a.jsx(Gr,{size:32}),a.jsx(ge,{children:"Set password"})]}),!i&&a.jsxs(Ie,{children:[a.jsx(Lr,{name:"password",label:"New password",required:!0,error:Ke(r,"password")}),a.jsx(Lr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ke(r,"confirmPassword")}),a.jsx(ee,{justify:"flex-end",mt:"xl",children:a.jsx(oe,{type:"submit",children:"Set password"})})]}),i&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(qe,{to:"/signin",children:"sign in"}),"."]})]})]})}function bG(){const e=uh(),t=Bt(),[n]=$0(),r=lu(),o=m.useCallback(()=>{const i=n.get("next");t(i!=null&&i.startsWith("/")?i:"/")},[n,t]);return m.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),a.jsxs(Xk,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:RR()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[a.jsx(Gr,{size:32}),a.jsx(ge,{children:"Sign in to Medplum"}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function CG(){const e=Bt(),t=Go(),[n,r]=m.useState(),[o,i]=m.useState(),[s,l]=m.useState();return m.useEffect(()=>{const c=Object.fromEntries(new URLSearchParams(t.search).entries());r(c.resourceType),i(c.query),l(JSON.parse(c.fields))},[t]),!n||!o||!s?null:a.jsx(EB,{resourceType:n,checkboxesEnabled:!0,query:o,fields:s,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 bh(e){const t=se(),n=Oi(t),r=Bt(),[o,i]=m.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ae.EQUALS,value:"Project/"+n},{code:"profile-type",operator:ae.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(ou,{search:o,onClick:s=>r(`/admin/members/${s.resource.id}`),onChange:s=>i(s.definition),hideFilters:!0,hideToolbar:!0})}function EG(){return a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:"Bots"}),a.jsx(bh,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ee,{justify:"flex-end",children:a.jsx(qe,{to:"/admin/bots/new",children:"Create new bot"})})]})}function jG(){return a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:"Clients"}),a.jsx(bh,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ee,{justify:"flex-end",children:a.jsx(qe,{to:"/admin/clients/new",children:"Create new client"})})]})}function Ch(e){return a.jsx(el,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Wo(t)?e.onChange(vt(t)):e.onChange(void 0)}})}function PG(){const e=se(),t=Oi(e),[n,r]=m.useState(""),[o,i]=m.useState(""),[s,l]=m.useState(),[c,u]=m.useState(),[d,f]=m.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:"Create new Bot"}),a.jsxs(Qe,{onSubmit:()=>{const h={name:n,description:o,accessPolicy:s};e.post("admin/projects/"+t+"/bot",h).then(p=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),f(p),xe({color:"green",message:"Bot created"})}).catch(p=>{xe({color:"red",message:$e(p),autoClose:!1}),u(ht(p))})},children:[!d&&a.jsxs(Ie,{children:[a.jsx(ft,{title:"Name",htmlFor:"name",outcome:c,children:a.jsx(fe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>r(h.currentTarget.value),error:Ke(c,"name")})}),a.jsx(ft,{title:"Description",htmlFor:"description",outcome:c,children:a.jsx(fe,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:Ke(c,"description")})}),a.jsx(ft,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:a.jsx(Ch,{name:"accessPolicy",onChange:l})}),a.jsx(ee,{justify:"flex-end",children:a.jsx(oe,{type:"submit",children:"Create Bot"})})]}),d&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(de,{children:"Bot created"}),a.jsxs(Rn,{children:[a.jsx(Rn.Item,{children:a.jsx(qe,{to:d,children:"Go to new bot"})}),a.jsx(Rn.Item,{children:a.jsx(qe,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function TG(){const e=se(),t=Oi(e),[n,r]=m.useState(""),[o,i]=m.useState(""),[s,l]=m.useState(""),[c,u]=m.useState(),[d,f]=m.useState(),[h,p]=m.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:"Create new Client"}),a.jsxs(Qe,{onSubmit:()=>{const g={name:n,description:o,redirectUri:s,accessPolicy:c};e.post("admin/projects/"+t+"/client",g).then(v=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),p(v),xe({color:"green",message:"Client created"})}).catch(v=>{xe({color:"red",message:$e(v),autoClose:!1}),f(ht(v))})},children:[!h&&a.jsxs(Ie,{children:[a.jsx(ft,{title:"Name",htmlFor:"name",outcome:d,children:a.jsx(fe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>r(g.currentTarget.value),error:Ke(d,"name")})}),a.jsx(ft,{title:"Description",htmlFor:"description",outcome:d,children:a.jsx(fe,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:Ke(d,"description")})}),a.jsx(ft,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:a.jsx(fe,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:Ke(d,"redirectUri")})}),a.jsx(ft,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:a.jsx(Ch,{name:"accessPolicy",onChange:u})}),a.jsx(ee,{justify:"flex-end",children:a.jsx(oe,{type:"submit",children:"Create Client"})})]}),h&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(de,{children:"Client created"}),a.jsxs(Rn,{children:[a.jsx(Rn.Item,{children:a.jsx(qe,{to:h,children:"Go to new client"})}),a.jsx(Rn.Item,{children:a.jsx(qe,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function kG(e){return a.jsx(el,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Wo(t)?e.onChange(vt(t)):e.onChange(void 0)}})}function RG(){const{membershipId:e}=ot(),t=se(),n=Oi(t),r=Bt(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[i,s]=m.useState(o.accessPolicy),[l,c]=m.useState(o.userConfiguration),[u,d]=m.useState(o.admin),[f,h]=m.useState(),[p,g]=m.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(ht(S)))}return a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(wa,{value:o.profile,link:!0})}),a.jsxs(Qe,{onSubmit:()=>{const S={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${n}/members/${e}`,S).then(()=>g(!0)).catch(y=>h(ht(y)))},children:[!p&&a.jsxs(Ie,{children:[a.jsx(ft,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(Ch,{name:"accessPolicy",defaultValue:i,onChange:s})}),a.jsx(ft,{title:"User Configuration",htmlFor:"userConfiguration",outcome:f,children:a.jsx(kG,{name:"userConfiguration",defaultValue:l,onChange:c})}),a.jsx(ft,{title:"Admin",htmlFor:"admin",outcome:f,children:a.jsx(br,{id:"admin",name:"admin",defaultChecked:u,onChange:S=>d(S.currentTarget.checked)})}),a.jsxs(ee,{justify:"flex-end",mt:"xl",children:[a.jsx(oe,{type:"submit",children:"Save"}),a.jsx(oe,{type:"button",color:"red",variant:"outline",onClick:v,children:"Remove user"})]})]}),p&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User updated"}),a.jsx("pre",{children:JSON.stringify(f,void 0,2)}),a.jsxs("p",{children:["Click ",a.jsx(qe,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function _G(){const e=se(),[t,n]=m.useState(e.getProject()),[r,o]=m.useState(),[i,s]=m.useState(),[l,c]=m.useState(!1),[u,d]=m.useState(void 0),f=m.useCallback(h=>{const p={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,p).then(g=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),nh(g)?s(g):d(g),c(p.sendEmail??!1),xe({color:"green",message:"Invite success"})}).catch(g=>{xe({color:"red",message:$e(g),autoClose:!1}),s(ht(g))})},[e,t,r]);return a.jsxs(Qe,{onSubmit:f,children:[!u&&!i&&a.jsxs(Ie,{children:[a.jsx(ge,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(ft,{title:"Project",htmlFor:"project",outcome:i,children:a.jsx(el,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(Tt,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Ke(i,"resourceType")}),a.jsx(fe,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Ke(i,"firstName")}),a.jsx(fe,{name:"lastName",label:"Last Name",required:!0,error:Ke(i,"lastName")}),a.jsx(fe,{name:"email",type:"email",label:"Email",required:!0,error:Ke(i,"email")}),a.jsx(ft,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:a.jsx(Ch,{name:"accessPolicy",onChange:o})}),a.jsx(br,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(br,{name:"isAdmin",label:"Admin"}),a.jsx(ee,{justify:"flex-end",children:a.jsx(oe,{type:"submit",children:"Invite"})})]}),i&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User created, email couldn't be sent"}),a.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),a.jsxs("p",{children:["Click ",a.jsx(qe,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(de,{children:"User created"}),l&&a.jsx(de,{children:"Email sent"}),a.jsxs(Rn,{children:[a.jsx(Rn.Item,{children:a.jsx(qe,{to:u,children:"Go to new membership"})}),a.jsx(Rn.Item,{children:a.jsx(qe,{to:u.profile,children:"Go to new profile"})}),a.jsx(Rn.Item,{children:a.jsx(qe,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function DG(){return a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:"Patients"}),a.jsx(bh,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(ee,{justify:"flex-end",children:a.jsx(qe,{to:"/admin/invite",children:"Invite new patient"})})]})}function IG(){const e=se();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(Qr,{outcome:UP});function t(n){e.post("admin/projects/setpassword",n).then(()=>xe({color:"green",message:"Done"})).catch(r=>xe({color:"red",message:$e(r),autoClose:!1}))}return a.jsxs(Re,{width:600,children:[a.jsx(ge,{order:1,children:"Project Admin"}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Force Set Password"}),a.jsx(de,{children:"Sets the password for the specified user in this project."}),a.jsx(de,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(Qe,{onSubmit:t,children:a.jsxs(Ie,{children:[a.jsx(fe,{name:"email",label:"Email",required:!0}),a.jsx(Lr,{name:"password",label:"Password",required:!0}),a.jsx(oe,{type:"submit",children:"Force Set Password"})]})})]})}function AS(){const e=se(),t=Oi(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:"Details"}),a.jsxs(d0,{children:[a.jsx(jo,{term:"ID",children:n.project.id}),a.jsx(jo,{term:"Name",children:n.project.name})]})]})}const NS=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function AG(){const e=Bt(),n=Go().pathname.replace("/admin/","")||NS[0],r=se(),o=Oi(r),i=m.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function s(l){e(`/admin/${l}`)}return a.jsxs(a.Fragment,{children:[a.jsxs(Hn,{children:[a.jsx(Ve,{children:a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"Project"}),a.jsx(Ve.Value,{children:i.project.name})]})}),a.jsx(Er,{children:a.jsx(et,{value:n.toLowerCase(),onChange:s,children:a.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:NS.map(l=>a.jsx(et.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),a.jsx(Re,{children:a.jsx(O0,{})})]})}function NG(){const e=se(),t=Oi(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=m.useState(!1),[i,s]=m.useState();return m.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),m.useEffect(()=>{n&&s(ho(n.project.secret||[]))},[e,n]),!r||!i?a.jsx("div",{children:"Loading..."}):a.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(()=>xe({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(ge,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(tl,{property:Rs("Project","secret"),name:"secret",path:"Project.secret",defaultValue:i,onChange:s,outcome:void 0}),a.jsx(oe,{type:"submit",children:"Save"})]})}function MG(){const e=se(),t=Oi(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=m.useState(!1),[i,s]=m.useState();return m.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),m.useEffect(()=>{n&&s(ho(n.project.site||[]))},[e,n]),!r||!i?a.jsx("div",{children:"Loading..."}):a.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(()=>xe({color:"green",message:"Saved"})).catch(c=>{var d,f,h,p;const u=ht(c);xe({color:"red",message:`Error ${(f=(d=u.issue)==null?void 0:d[0].details)==null?void 0:f.text} ${(p=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:p[0]}`,autoClose:!1})})},children:[a.jsx(ge,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(tl,{property:Rs("Project","site"),name:"site",path:"Project.site",defaultValue:i,onChange:s,outcome:void 0}),a.jsx(oe,{type:"submit",children:"Save"})]})}function OG(){const e=se();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(Qr,{outcome:UP});function t(){Cl(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function n(){Cl(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function r(){Cl(e,"Rebuilding Value Sets","admin/super/valuesets")}function o(u){Cl(e,"Reindexing Resources","admin/super/reindex",u)}function i(u){Cl(e,"Rebuilding Compartments","admin/super/compartments",u)}function s(u){e.post("admin/super/removebotidjobsfromqueue",u).then(()=>xe({color:"green",message:"Done"})).catch(d=>xe({color:"red",message:$e(d),autoClose:!1}))}function l(u){e.post("admin/super/purge",{...u,before:JT(u.before)}).then(()=>xe({color:"green",message:"Done"})).catch(d=>xe({color:"red",message:$e(d),autoClose:!1}))}function c(u){e.post("admin/super/setpassword",u).then(()=>xe({color:"green",message:"Done"})).catch(d=>xe({color:"red",message:$e(d),autoClose:!1}))}return a.jsxs(Re,{width:600,children:[a.jsx(ge,{order:1,children:"Super Admin"}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Structure Definitions"}),a.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),a.jsx(Qe,{children:a.jsx(oe,{onClick:t,children:"Rebuild StructureDefinitions"})}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Search Parameters"}),a.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),a.jsx(Qe,{children:a.jsx(oe,{onClick:n,children:"Rebuild SearchParameters"})}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Value Sets"}),a.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),a.jsx(Qe,{children:a.jsx(oe,{onClick:r,children:"Rebuild ValueSets"})}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Reindex Resources"}),a.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),a.jsx(Qe,{onSubmit:o,children:a.jsxs(Ie,{children:[a.jsx(ft,{title:"Resource Type",children:a.jsx(fe,{name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(oe,{type:"submit",children:"Reindex"})]})}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Rebuild Compartments"}),a.jsx("p",{children:"When Medplum changes how resource compartments are derived, the system may require a rebuild for old resources to take effect."}),a.jsx(Qe,{onSubmit:i,children:a.jsxs(Ie,{children:[a.jsx(ft,{title:"Resource Type",children:a.jsx(fe,{name:"resourceType",placeholder:"Compartments Resource Type"})}),a.jsx(oe,{type:"submit",children:"Rebuild Compartments"})]})}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Purge Resources"}),a.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),a.jsx(Qe,{onSubmit:l,children:a.jsxs(Ie,{children:[a.jsx(ft,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(Tt,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(ft,{title:"Purge Before",htmlFor:"before",children:a.jsx(fs,{name:"before",placeholder:"Before Date"})}),a.jsx(oe,{type:"submit",children:"Purge"})]})}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(Qe,{onSubmit:s,children:a.jsxs(Ie,{children:[a.jsx(ft,{title:"Bot ID",children:a.jsx(fe,{name:"botId",placeholder:"Bot Id"})}),a.jsx(oe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Force Set Password"}),a.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),a.jsx(Qe,{onSubmit:c,children:a.jsxs(Ie,{children:[a.jsx(fe,{name:"email",label:"Email",required:!0}),a.jsx(Lr,{name:"password",label:"Password",required:!0}),a.jsx(fe,{name:"projectId",label:"Project ID"}),a.jsx(oe,{type:"submit",children:"Force Set Password"})]})})]})}function Cl(e,t,n,r){ao.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(()=>{ao.update({id:n,color:"green",title:t,message:"Done",icon:a.jsx(dh,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(i=>{ao.update({id:n,color:"red",title:t,message:$e(i),icon:a.jsx(Gd,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function $G(){return a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:"Users"}),a.jsx(bh,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ee,{justify:"flex-end",children:a.jsx(qe,{to:"/admin/invite",children:"Invite new user"})})]})}function LG(){const[e]=Oa("ObservationDefinition","_count=100");return e?a.jsxs(ce,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Method"}),a.jsx("th",{children:"Unit"}),a.jsx("th",{children:"Precision"}),a.jsx("th",{children:"Ranges"})]})}),a.jsx("tbody",{children:e.map(t=>{var n,r,o,i;return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(lo,{value:(n=t.category)==null?void 0:n[0]})}),a.jsx("td",{children:a.jsx(lo,{value:t.code})}),a.jsx("td",{children:a.jsx(lo,{value:t.method})}),a.jsx("td",{children:(o=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:o.text}),a.jsx("td",{children:(i=t.quantitativeDetails)==null?void 0:i.decimalPrecision}),a.jsx("td",{children:a.jsx(dg,{ranges:t.qualifiedInterval})})]},t.id)})})]}):a.jsx(Br,{})}function dg(e){const{ranges:t}=e;if(!t)return null;const n=MS(t.map(o=>o.gender));if(n.length>1)return hc(n),a.jsx(a.Fragment,{children:n.map(o=>{var i;return a.jsxs(m.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Gt(o)})}),a.jsx(dg,{ranges:(i=e.ranges)==null?void 0:i.filter(s=>s.gender===o)})]},o)})});const r=MS(t.map(o=>o.age&&mc(o.age)));return r.length>1?(hc(r),a.jsx(a.Fragment,{children:r.map(o=>{var i;return a.jsxs(m.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Gt(o)})}),a.jsx(dg,{ranges:(i=e.ranges)==null?void 0:i.filter(s=>mc(s.age)===o)})]},o)})})):a.jsx(a.Fragment,{children:t.map(o=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:o.condition}),a.jsx("td",{children:a.jsx(h0,{value:o.range})})]})})},`range-${o.condition}`))})}function MS(e){return[...new Set(e.filter(t=>!!t))]}function FG(){const[e]=Oa("ActivityDefinition","_count=100"),[t]=Oa("ObservationDefinition","_count=100");return!e||!t?a.jsx(Br,{}):a.jsxs(ce,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Assay"}),e.map(n=>a.jsx("th",{children:n.name},n.id))]})}),a.jsx("tbody",{children:t.map(n=>{var r;return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(lo,{value:(r=n.category)==null?void 0:r[0]})}),a.jsx("td",{children:a.jsx(lo,{value:n.code})}),e.map(o=>{var i;return a.jsx("td",{children:(i=o.observationResultRequirement)!=null&&i.find(s=>{var l;return(l=s.reference)==null?void 0:l.includes(n.id)})?"✅":""},o.id)})]},n.id)})})]})}function zG(e){var s;const t=se(),[n,r]=m.useState(),[o,i]=m.useState();return o?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"Request group created successfully."}),a.jsxs("ul",{children:[a.jsxs("li",{children:["Go to the"," ",a.jsx(qe,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(qe,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(Qe,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueReference:n}]}).then(i).catch(console.log)},children:a.jsxs(Ie,{children:[a.jsxs(ge,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(de,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(de,{children:"The following tasks will be created:"}),a.jsx("ul",{children:(s=e.planDefinition.action)==null?void 0:s.map((l,c)=>{var u;return a.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&a.jsx(a.Fragment,{children:l.title}),l.code&&a.jsx(lo,{value:l.code[0]})]},`action-${c}`)})}),a.jsx(ft,{title:"Subject",children:a.jsx(hh,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(ee,{justify:"flex-end",mt:"xl",children:a.jsx(oe,{type:"submit",children:"Go"})})]})})}function VG(){const{resourceType:e,id:t}=ot(),n=mt({reference:e+"/"+t});return n?a.jsx(Re,{children:a.jsx(zG,{planDefinition:n})}):null}function BG(){const{resourceType:e,id:t}=ot(),n=mt({reference:e+"/"+t}),[r,o]=Oa("Questionnaire","subject-type="+e),[i,s]=Oa("ClientApplication",{_count:1e3});if(!n||o||s)return a.jsx(Br,{});const l=i==null?void 0:i.filter(d=>UG(e)&&!!d.launchUri);if((!r||r.length===0)&&(!l||l.length===0))return a.jsxs(Re,{children:[a.jsx(ge,{children:"Apps"}),a.jsxs("p",{children:["No apps found. Contact your administrator or ",a.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let c,u;return n.resourceType==="Patient"?c=vt(n):n.resourceType==="Encounter"&&(c=n.subject,u=vt(n)),a.jsxs(Re,{children:[r==null?void 0:r.map(d=>a.jsxs("div",{children:[a.jsx(ge,{order:3,children:a.jsx(qe,{to:`/forms/${d.id}?subject=${yt(n)}`,children:d.title||d.name})}),a.jsx(de,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>a.jsxs("div",{children:[a.jsx(ge,{order:3,children:a.jsx(gH,{client:d,patient:c,encounter:u,children:d.name})}),a.jsx(de,{children:d.description})]},d.id))]})}function UG(e){return e==="Patient"||e==="Encounter"}function HG(){const{resourceType:e,id:t}=ot(),n=Bt(),[r,o]=m.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ae.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(Re,{children:a.jsx(ou,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function WG(){const e=se(),{resourceType:t,id:n}=ot(),r=e.readHistory(t,n).read();return a.jsx(Re,{children:a.jsx(aH,{history:r})})}const qG="_hl7Input_k5xm3_1",GG={hl7Input:qG};function QG(e){return a.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 KG(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),a.jsx("iframe",{frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{cd(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const YG=`{
|
|
553
|
-
"resourceType": "Patient",
|
|
554
|
-
"name": [
|
|
555
|
-
{
|
|
556
|
-
"given": [
|
|
557
|
-
"Alice"
|
|
558
|
-
],
|
|
559
|
-
"family": "Smith"
|
|
560
|
-
}
|
|
561
|
-
]
|
|
562
|
-
}`,XG="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 JG(){const e=se(),{id:t}=ot(),[n,r]=m.useState(),[o,i]=m.useState(),[s,l]=m.useState(YG),[c,u]=m.useState(XG),[d,f]=m.useState(en.FHIR_JSON),h=m.useRef(null),p=m.useRef(null),[g,v]=m.useState(!1);m.useEffect(()=>{e.readResource("Bot",t).then(async P=>{r(P),i(await ZG(e,P))}).catch(P=>xe({color:"red",message:$e(P),autoClose:!1}))},[e,t]);const S=m.useCallback(()=>cd(h.current,{command:"getValue"}),[]),y=m.useCallback(()=>cd(h.current,{command:"getOutput"}),[]),x=m.useCallback(async()=>d===en.FHIR_JSON?JSON.parse(s):c,[d,s,c]),w=m.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),v(!0);try{const E=await S(),T=await e.createAttachment(E,"index.ts","text/typescript"),_=[];n!=null&&n.sourceCode?_.push({op:"replace",path:"/sourceCode",value:T}):_.push({op:"add",path:"/sourceCode",value:T}),await e.patchResource("Bot",t,_),xe({color:"green",message:"Saved"})}catch(E){xe({color:"red",message:$e(E),autoClose:!1})}finally{v(!1)}},[e,t,n,S]),b=m.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),v(!0);try{const E=await y();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:E}),xe({color:"green",message:"Deployed"})}catch(E){xe({color:"red",message:$e(E),autoClose:!1})}finally{v(!1)}},[e,t,y]),j=m.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),v(!0);try{const E=await x(),T=await e.post(e.fhirUrl("Bot",t,"$execute"),E,d);await cd(p.current,{command:"setValue",value:T}),xe({color:"green",message:"Success"})}catch(E){xe({color:"red",message:$e(E),autoClose:!1})}finally{v(!1)}},[e,t,x,d]);return!n||o===void 0?null:a.jsxs(er,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(er.Col,{span:8,children:a.jsxs(Hn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(KG,{iframeRef:h,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),a.jsxs(ee,{justify:"flex-end",gap:"xs",children:[a.jsx(oe,{type:"button",onClick:w,loading:g,leftSection:a.jsx(fF,{size:"1rem"}),children:"Save"}),a.jsx(oe,{type:"button",onClick:b,loading:g,leftSection:a.jsx(o0,{size:"1rem"}),children:"Deploy"}),a.jsx(oe,{type:"button",onClick:j,loading:g,leftSection:a.jsx(kF,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(er.Col,{span:4,children:[a.jsxs(Hn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(Tt,{data:[{label:"FHIR",value:en.FHIR_JSON},{label:"HL7",value:en.HL7_V2}],onChange:P=>f(P.currentTarget.value)}),d===en.FHIR_JSON?a.jsx(Ka,{value:s,onChange:P=>l(P),autosize:!0,minRows:15}):a.jsx("textarea",{className:GG.hl7Input,value:c,onChange:P=>u(P.currentTarget.value),rows:15})]}),a.jsx(Hn,{m:2,p:"xs",shadow:"md",children:a.jsx(QG,{iframeRef:p,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function ZG(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(aT);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Ds(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function _R(e,t){var n,r;(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))}function eQ(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)}}function tQ(){const e=se(),{resourceType:t,id:n}=ot(),r={reference:t+"/"+n},o=m.useCallback(i=>{e.updateResource(Ds(i)).then(()=>{xe({color:"green",message:"Success"})}).catch(s=>{xe({color:"red",message:$e(s),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(Re,{children:a.jsx(OB,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(Re,{children:a.jsx(xU,{questionnaire:r,onSubmit:o})});default:return null}}function nQ(){const{resourceType:e,id:t}=ot(),n=mt({reference:e+"/"+t}),r=Bt();return n?a.jsx(Re,{children:a.jsx(UU,{value:n,onStart:(o,i)=>r(`/forms/${oh(i)}`),onEdit:(o,i,s)=>r(`/${s.reference}}`)})}):null}function rQ(){const e=se(),{resourceType:t,id:n}=ot(),r=Bt();return a.jsxs(Re,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(oe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(o=>xe({color:"red",message:$e(o),autoClose:!1}))},children:"Delete"})]})}const oQ="_selectProfileBtn_tbaz6_1",iQ="_chevron_tbaz6_13",OS={selectProfileBtn:oQ,chevron:iQ};function sQ(){var c,u;const{resourceType:e,id:t}=ot(),n=mt({reference:e+"/"+t}),[r,o]=m.useState(),i=Oc({onDropdownClose:()=>i.resetSelectedOption()}),s=m.useMemo(()=>{var d;if(zt((d=n==null?void 0:n.meta)==null?void 0:d.profile))return[a.jsx(De.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(De.Option,{value:f,children:f},f))]},[(c=n==null?void 0:n.meta)==null?void 0:c.profile]);if(m.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 zt(s)&&(l=a.jsx(ee,{justify:"flex-end",children:a.jsxs(Ie,{align:"flex-end",gap:"xs",children:[a.jsxs(De,{store:i,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:d=>{o(d),i.closeDropdown()},children:[a.jsx(De.Target,{children:a.jsx(Dn,{onClick:()=>i.toggleDropdown(),children:a.jsxs(iy,{fw:"bold",fs:"sm",className:OS.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(DT,{stroke:1.5,className:OS.chevron})]})})}),a.jsx(De.Dropdown,{w:"max-content",children:a.jsx(De.Options,{children:s})})]}),a.jsx(G,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(de,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(de,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(de,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(Re,{children:a.jsxs(Ie,{gap:"xl",children:[l,a.jsx(j0,{value:n,profileUrl:r})]})})}function aQ(){const e=se(),{resourceType:t,id:n}=ot(),[r,o]=m.useState(),i=Bt(),[s,l]=m.useState();m.useEffect(()=>{e.readResource(t,n).then(d=>o(ho(d))).catch(d=>{l(ht(d)),xe({color:"red",message:$e(d),autoClose:!1})})},[e,t,n]);const c=m.useCallback(d=>{l(void 0),e.updateResource(Ds(d)).then(()=>{i(`/${t}/${n}/details`),xe({color:"green",message:"Success"})}).catch(f=>{l(ht(f)),xe({color:"red",message:$e(f),autoClose:!1})})},[e,t,n,i]),u=m.useCallback(()=>i(`/${t}/${n}/delete`),[i,t,n]);return r?a.jsx(Re,{children:a.jsx(Xd,{defaultValue:r,onSubmit:c,onDelete:u,outcome:s})}):null}function DR(e,t){const n=se(),r=Bt();return{defaultValue:{resourceType:e},handleSubmit:s=>{t&&t(void 0),n.createResource(s).then(l=>r("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(ht(l)),xe({color:"red",message:$e(l),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function IR({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=se(),[i,s]=m.useState();return m.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(l=>{s(l.filter(Q8))}).catch(console.error)},[o,n,r]),a.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:a.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 a.jsx(et.Tab,{value:l.url,title:u,rightSection:c&&a.jsx(Ly,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(zF,{size:"90%"})}),children:l.title||l.name},l.url)})})})}function Tm(){const{resourceType:e}=ot(),t=Go(),[n,r]=m.useState(),{defaultValue:o,handleSubmit:i}=DR(e,r),[s,l]=m.useState(),c=t.pathname.toLowerCase().endsWith("profiles"),u=m.useCallback(d=>{const f=Ds(d);s&&_R(f,s.url),i(f)},[s,i]);return c?a.jsx(Re,{children:a.jsxs(Ie,{children:[a.jsx(IR,{resource:o,currentProfile:s,onChange:l}),s?a.jsx(Xd,{defaultValue:o,onSubmit:u,outcome:n,profileUrl:s.url},s.url):a.jsx(de,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(Re,{children:a.jsx(Xd,{defaultValue:o,onSubmit:i,outcome:n})})}function lQ(){const e=se(),{resourceType:t,id:n}=ot(),r=e.readHistory(t,n).read();return a.jsx(Re,{children:a.jsx(fH,{history:r})})}function cQ(){const{resourceType:e}=ot(),[t,n]=m.useState(),{defaultValue:r,handleSubmit:o}=DR(e,n),i=m.useCallback(s=>{o(JSON.parse(s["new-resource"]))},[o]);return a.jsxs(Re,{children:[t&&a.jsx(Qr,{outcome:t}),a.jsxs(Qe,{onSubmit:i,children:[a.jsx(Ka,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:ir(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ee,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(oe,{type:"submit",children:"OK"})})]})]})}function uQ(){const e=se(),{resourceType:t,id:n}=ot(),r=mt({reference:t+"/"+n}),o=Bt(),[i,s]=m.useState(),l=m.useCallback(c=>{e.updateResource(Ds(JSON.parse(c.resource))).then(()=>{s(void 0),o(`/${t}/${n}/details`),xe({color:"green",message:"Success"})}).catch(u=>{xe({color:"red",message:$e(u),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(Re,{children:[i&&a.jsx(Qr,{outcome:i}),a.jsxs(Qe,{onSubmit:l,children:[a.jsx(Ka,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:ir(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ee,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(oe,{type:"submit",children:"OK"})})]})]}):null}function dQ(){const{resourceType:e,id:t}=ot();return mt({reference:e+"/"+t})?a.jsxs(Re,{children:[a.jsxs(Cs,{icon:a.jsx(Kc,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Ze,{href:`/forms/${t}`,children:`/forms/${t}`})]}),a.jsx(Bk,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function fQ(){const e=se(),{resourceType:t,id:n}=ot(),[r,o]=m.useState(),[i,s]=m.useState();return m.useEffect(()=>{e.readResource(t,n).then(l=>o(ho(l))).catch(l=>{xe({color:"red",message:$e(l)})})},[e,t,n]),r?a.jsxs(Re,{children:[a.jsxs(ge,{order:2,children:["Available ",t," profiles"]}),a.jsx(Ie,{children:a.jsxs(a.Fragment,{children:[a.jsx(IR,{resource:r,currentProfile:i,onChange:s}),i?a.jsx(hQ,{profile:i,resource:r,onResourceUpdated:l=>o(l)},i.url):a.jsx(de,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const hQ=({profile:e,resource:t,onResourceUpdated:n})=>{const r=se(),[o,i]=m.useState(),[s,l]=m.useState(()=>{var u,d;return(d=(u=t.meta)==null?void 0:u.profile)==null?void 0:d.includes(e.url)}),c=m.useCallback(u=>{i(void 0);const d=Ds(u);s?_R(d,e.url):eQ(d,e.url),r.updateResource(d).then(f=>{n(f),xe({color:"green",message:"Success"})}).catch(f=>{i(ht(f)),xe({color:"red",message:$e(f),autoClose:!1})})},[r,e.url,n,s]);return a.jsxs(Ie,{children:[a.jsx(Bc,{size:"md",checked:s,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),s?a.jsx(Xd,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:a.jsx(ee,{justify:"flex-end",mt:"xl",children:a.jsx(oe,{type:"submit",children:"OK"})})})]})};function mQ(){const e=se(),{id:t}=ot(),[n,r]=m.useState(),[o,i]=m.useState(0),s=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>pQ(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:yt(n)}}).then(()=>{r(void 0),i(Date.now()),e.invalidateSearches("Subscription"),xe({color:"green",message:"Success"})}).catch(c=>xe({color:"red",message:$e(c),autoClose:!1}))}return a.jsxs(Re,{children:[a.jsx(ge,{children:"Bots"}),s.length===0&&a.jsx("p",{children:"No bots found."}),s.map(c=>{var u;return a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(nl,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),a.jsx("hr",{}),a.jsx(ge,{children:"Connect to bot"}),a.jsxs(ee,{children:[a.jsx(el,{name:"bot",resourceType:"Bot",onChange:c=>r(c)}),a.jsx(oe,{onClick:l,children:"Connect"})]}),a.jsx("div",{style:{display:"none"},children:o})]})}function pQ(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 gQ(){const{id:e}=ot(),t=Bt(),[n,r]=m.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ae.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return a.jsx(Re,{children:a.jsx(ou,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function vQ(){const e=se(),{resourceType:t,id:n}=ot(),r=mt({reference:t+"/"+n}),o=m.useCallback(i=>{e.updateResource(Ds(i)).then(()=>{xe({color:"green",message:"Success"})}).catch(s=>{xe({color:"red",message:$e(s),autoClose:!1})})},[e]);return r?a.jsx(Re,{children:a.jsx(MU,{onSubmit:o,definition:r})}):null}function yQ(){const{resourceType:e,id:t}=ot(),n=mt({reference:e+"/"+t});return n?a.jsx(Re,{children:e==="MeasureReport"?a.jsx(_B,{measureReport:n}):a.jsx(x0,{value:n})}):null}const xQ="_container_1ue98_1",wQ="_entry_1ue98_14",SQ="_active_1ue98_21",km={container:xQ,entry:wQ,active:SQ};function bQ(e){const t=se(),n=mt(e.value),[r,o]=m.useState();return m.useEffect(()=>{if(!n)return;const i=V0(n);if(!i)return;const s="reference"in i?i.reference:yt(i);t.search("ServiceRequest","subject="+s).then(l=>{const u=l.entry.map(d=>d.resource);yk(u),u.reverse(),o(u)}).catch(l=>xe({color:"red",message:$e(l),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:km.container,children:r.map(i=>{var s,l,c,u,d,f,h;return a.jsxs("div",{className:rt(km.entry,{[km.active]:i.id===(n==null?void 0:n.id)}),children:[a.jsx("p",{children:a.jsx(qe,{to:i,children:CQ(i)})}),((l=(s=i.category)==null?void 0:s[0])==null?void 0:l.text)&&a.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)&&a.jsx("p",{children:(h=i.code.coding[0])==null?void 0:h.code}),a.jsx("p",{children:EQ(i)})]},i.id)})}):null}function CQ(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function EQ(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const jQ="_container_1l2dh_1",PQ={container:jQ};function TQ(e){var o,i,s,l;const t=mt(e.valueSet);if(!t)return null;const n=[""],r=(l=(s=(i=(o=t.compose)==null?void 0:o.include)==null?void 0:i[0])==null?void 0:s.concept)==null?void 0:l.map(c=>c.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:PQ.container,children:a.jsx(Tt,{defaultValue:e.defaultValue,onChange:c=>e.onChange(c.currentTarget.value),data:n})})}function kQ(e){var n,r;const t=mt(e.specimen);return t?a.jsxs(Ve,{children:[a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"Type"}),a.jsx(Ve.Value,{children:"Specimen"})]}),a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"Collected"}),a.jsx(Ve.Value,{children:In((n=t.collection)==null?void 0:n.collectedDateTime)})]}),a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"Specimen Age"}),a.jsx(Ve.Value,{children:RQ(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?a.jsxs(Ve.Entry,{children:[a.jsx(Ve.Key,{children:"Specimen Stability"}),a.jsx(Ve.Value,{children:_Q(t)})]}):a.jsx(a.Fragment,{})]}):null}function RQ(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return AR(NR(n,new Date))}function _Q(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 AR(NR(t,n))}function AR(e){return e.toString().padStart(3,"0")+"D"}function NR(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function DQ(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 IQ=["Profiles"];function AQ(){var w,b,j,P,E,T,_;const e=se(),{resourceType:t,id:n}=ot(),r={reference:t+"/"+n},o=Bt(),[i,s]=m.useState(),l=mt(r,s),c=DQ(t),[u,d]=m.useState(()=>{const R=window.location.pathname.split("/").pop();return R&&c.map(O=>O.toLowerCase()).includes(R)?R:c[0].toLowerCase()}),f=$t();async function h(){var I,M;const O=(M=(I=(await e.readHistory(t,n)).entry)==null?void 0:I.find(F=>!!F.resource))==null?void 0:M.resource;O?p(O):xe({color:"red",message:"No history to restore",autoClose:!1})}function p(R){e.updateResource(Ds(R)).then(()=>{s(void 0),xe({color:"green",message:"Success"})}).catch(O=>{xe({color:"red",message:$e(O),autoClose:!1})})}if(i)return p$(i)?a.jsxs(Re,{children:[a.jsx(ge,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(oe,{color:"red",onClick:h,children:"Restore"})]}):a.jsx(Qr,{outcome:i});function g(R){R||(R=c[0].toLowerCase()),d(R),o(`/${t}/${n}/${R}`)}function v(R){const O=l,I=O.orderDetail||[];I.length===0&&I.push({}),I[0].text!==R&&(I[0].text=R,p({...O,orderDetail:I}))}const S=l&&V0(l),y=l&&oG(l),x=(j=(b=(w=e.getUserConfiguration())==null?void 0:w.option)==null?void 0:b.find(R=>R.id==="statusValueSet"))==null?void 0:j.valueString;return a.jsxs(a.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&x&&a.jsx(TQ,{valueSet:{reference:x},defaultValue:(E=(P=l.orderDetail)==null?void 0:P[0])==null?void 0:E.text,onChange:v},yt(l)+"-"+((_=(T=l.orderDetail)==null?void 0:T[0])==null?void 0:_.text)),l&&a.jsx(bQ,{value:l}),l&&a.jsxs(Hn,{children:[S&&a.jsx(PR,{patient:S}),y&&a.jsx(kQ,{specimen:y}),t!=="Patient"&&a.jsx(TR,{resource:r}),a.jsx(Er,{children:a.jsx(et,{value:u.toLowerCase(),onChange:g,children:a.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(R=>a.jsx(et.Tab,{value:R.toLowerCase(),children:IQ.includes(R)?a.jsxs(ee,{gap:"xs",wrap:"nowrap",children:[R,a.jsx($c,{color:f.primaryColor,size:"sm",children:"Beta"})]}):R},R))})})})]}),a.jsx(O0,{})]})}function $S(){var y,x,w,b;const e=Bt(),{resourceType:t,id:n,versionId:r,tab:o}=ot(),i=se(),[s,l]=m.useState(!0),[c,u]=m.useState(),[d,f]=m.useState();if(m.useEffect(()=>{f(void 0),l(!0),i.readHistory(t,n).then(j=>u(j)).then(()=>l(!1)).catch(j=>{f(j),l(!1)})},[i,t,n]),s)return a.jsx(Br,{});if(!c)return a.jsxs(Re,{children:[a.jsx(ge,{children:"Resource not found"}),a.jsx(qe,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,p=h.findIndex(j=>{var P,E;return((E=(P=j.resource)==null?void 0:P.meta)==null?void 0:E.versionId)===r});if(p===-1)return a.jsxs(Re,{children:[a.jsx(ge,{children:"Version not found"}),a.jsx(qe,{to:`/${t}/${n}`,children:"Return to resource"})]});const g=h[p].resource,v=p<h.length-1?h[p+1].resource:void 0,S="diff";return a.jsxs(et,{value:o||S,onChange:j=>e(`/${t}/${n}/_history/${r}/${j||S}`),children:[a.jsxs(Hn,{children:[a.jsx(tu,{fluid:!0,p:"md",children:a.jsx(de,{children:`${t} ${n}`})}),a.jsxs(et.List,{children:[a.jsx(et.Tab,{value:"diff",children:"Diff"}),a.jsx(et.Tab,{value:"raw",children:"Raw"})]})]}),a.jsxs(Re,{children:[d&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),a.jsx(et.Panel,{value:"diff",children:v?a.jsxs(a.Fragment,{children:[a.jsxs("ul",{children:[a.jsxs("li",{children:["Current: ",(y=g.meta)==null?void 0:y.versionId]}),a.jsxs("li",{children:["Previous:"," ",a.jsx(qe,{to:`/${t}/${n}/_history/${(x=v.meta)==null?void 0:x.versionId}`,children:(w=v.meta)==null?void 0:w.versionId})]})]}),a.jsx(uH,{original:v,revised:g})]}):a.jsxs(a.Fragment,{children:[a.jsxs("ul",{children:[a.jsxs("li",{children:["Current: ",(b=g.meta)==null?void 0:b.versionId]}),a.jsx("li",{children:"Previous: (none)"})]}),a.jsx("pre",{children:JSON.stringify(g,void 0,2)})]})}),a.jsx(et.Panel,{value:"raw",children:a.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})}function NQ(){const{resourceType:e,id:t}=ot(),n=Bt(),[r,o]=m.useState({resourceType:"Subscription",filters:[{code:"url",operator:ae.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(Re,{children:a.jsx(ou,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function LS(){const{resourceType:e,id:t}=ot(),n={reference:e+"/"+t};switch(e){case"Encounter":return a.jsx(TV,{encounter:n});case"Patient":return a.jsx(DB,{patient:n});case"ServiceRequest":return a.jsx(pH,{serviceRequest:n});default:return a.jsx(PV,{resource:n})}}function MQ(){const e=se(),{id:t}=ot(),n=m.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=m.useState(!1),[i,s]=m.useState(),[l,c]=m.useState(),[u,d]=m.useState(),[f,h]=m.useState(),[p,g]=m.useState(!1),v=m.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(x=>{var w,b,j,P,E,T;s((b=(w=x.parameter)==null?void 0:w.find(_=>_.name==="status"))==null?void 0:b.valueCode),c((P=(j=x.parameter)==null?void 0:j.find(_=>_.name==="version"))==null?void 0:P.valueString),d((T=(E=x.parameter)==null?void 0:E.find(_=>_.name==="lastUpdated"))==null?void 0:T.valueInstant)}).catch(x=>y($e(x))).finally(()=>o(!1))},[e,t]),S=m.useCallback(x=>{const w=x.host,b=x.pingCount||1;w&&(g(!0),e.pushToAgent(n,w,`PING ${b}`,en.PING,!0).then(j=>h(j)).catch(j=>y($e(j))).finally(()=>g(!1)))},[e,n]);function y(x){xe({color:"red",title:"Error",message:x,autoClose:!1})}return a.jsxs(Re,{children:[a.jsx(ge,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(nl,{value:n,link:!0})]}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Agent Status"}),a.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),a.jsx(oe,{onClick:v,loading:r,children:"Get Status"}),!r&&i&&a.jsx(ce,{children:a.jsxs(ce.Tbody,{children:[a.jsxs(ce.Tr,{children:[a.jsx(ce.Td,{children:"Status"}),a.jsx(ce.Td,{children:a.jsx(y0,{status:i})})]}),a.jsxs(ce.Tr,{children:[a.jsx(ce.Td,{children:"Version"}),a.jsx(ce.Td,{children:l})]}),a.jsxs(ce.Tr,{children:[a.jsx(ce.Td,{children:"Last Updated"}),a.jsx(ce.Td,{children:In(u)})]})]})}),a.jsx(vn,{my:"lg"}),a.jsx(ge,{order:2,children:"Ping from Agent"}),a.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),a.jsx(Qe,{onSubmit:S,children:a.jsxs(ee,{children:[a.jsx(fe,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(Zt,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:p,children:a.jsx(AF,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(Cy,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!p&&f&&a.jsxs(a.Fragment,{children:[a.jsx(ge,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:f})]})]})}function OQ(){return a.jsx(LW,{children:a.jsxs(Se,{errorElement:a.jsx(Jq,{}),children:[a.jsx(Se,{path:"/signin",element:a.jsx(bG,{})}),a.jsx(Se,{path:"/oauth",element:a.jsx(vG,{})}),a.jsx(Se,{path:"/resetpassword",element:a.jsx(xG,{})}),a.jsx(Se,{path:"/setpassword/:id/:secret",element:a.jsx(SG,{})}),a.jsx(Se,{path:"/register",element:a.jsx(yG,{})}),a.jsx(Se,{path:"/changepassword",element:a.jsx(Kq,{})}),a.jsx(Se,{path:"/security",element:a.jsx(wG,{})}),a.jsx(Se,{path:"/mfa",element:a.jsx(gG,{})}),a.jsx(Se,{path:"/batch",element:a.jsx(Gq,{})}),a.jsx(Se,{path:"/bulk/:resourceType",element:a.jsx(Qq,{})}),a.jsx(Se,{path:"/smart",element:a.jsx(CG,{})}),a.jsx(Se,{path:"/forms/:id",element:a.jsx(sG,{})}),a.jsx(Se,{path:"/admin/super",element:a.jsx(OG,{})}),a.jsx(Se,{path:"/admin/config",element:a.jsx(IG,{})}),a.jsxs(Se,{path:"/admin",element:a.jsx(AG,{}),children:[a.jsx(Se,{path:"patients",element:a.jsx(DG,{})}),a.jsx(Se,{path:"bots/new",element:a.jsx(PG,{})}),a.jsx(Se,{path:"bots",element:a.jsx(EG,{})}),a.jsx(Se,{path:"clients/new",element:a.jsx(TG,{})}),a.jsx(Se,{path:"clients",element:a.jsx(jG,{})}),a.jsx(Se,{path:"details",element:a.jsx(AS,{})}),a.jsx(Se,{path:"invite",element:a.jsx(_G,{})}),a.jsx(Se,{path:"users",element:a.jsx($G,{})}),a.jsx(Se,{path:"project",element:a.jsx(AS,{})}),a.jsx(Se,{path:"secrets",element:a.jsx(NG,{})}),a.jsx(Se,{path:"sites",element:a.jsx(MG,{})}),a.jsx(Se,{path:"members/:membershipId",element:a.jsx(RG,{})})]}),a.jsx(Se,{path:"/lab/assays",element:a.jsx(LG,{})}),a.jsx(Se,{path:"/lab/panels",element:a.jsx(FG,{})}),a.jsx(Se,{path:"/:resourceType/:id/_history/:versionId/:tab",element:a.jsx($S,{})}),a.jsx(Se,{path:"/:resourceType/:id/_history/:versionId",element:a.jsx($S,{})}),a.jsxs(Se,{path:"/:resourceType/new",element:a.jsx(Xq,{}),children:[a.jsx(Se,{index:!0,element:a.jsx(Tm,{})}),a.jsx(Se,{path:"form",element:a.jsx(Tm,{})}),a.jsx(Se,{path:"json",element:a.jsx(cQ,{})}),a.jsx(Se,{path:"profiles",element:a.jsx(Tm,{})})]}),a.jsxs(Se,{path:"/:resourceType/:id",element:a.jsx(AQ,{}),children:[a.jsx(Se,{index:!0,element:a.jsx(LS,{})}),a.jsx(Se,{path:"apply",element:a.jsx(VG,{})}),a.jsx(Se,{path:"apps",element:a.jsx(BG,{})}),a.jsx(Se,{path:"event",element:a.jsx(HG,{})}),a.jsx(Se,{path:"blame",element:a.jsx(WG,{})}),a.jsx(Se,{path:"bots",element:a.jsx(mQ,{})}),a.jsx(Se,{path:"builder",element:a.jsx(tQ,{})}),a.jsx(Se,{path:"checklist",element:a.jsx(nQ,{})}),a.jsx(Se,{path:"delete",element:a.jsx(rQ,{})}),a.jsx(Se,{path:"details",element:a.jsx(sQ,{})}),a.jsx(Se,{path:"edit",element:a.jsx(aQ,{})}),a.jsx(Se,{path:"editor",element:a.jsx(JG,{})}),a.jsx(Se,{path:"history",element:a.jsx(lQ,{})}),a.jsx(Se,{path:"json",element:a.jsx(uQ,{})}),a.jsx(Se,{path:"preview",element:a.jsx(dQ,{})}),a.jsx(Se,{path:"responses",element:a.jsx(gQ,{})}),a.jsx(Se,{path:"report",element:a.jsx(yQ,{})}),a.jsx(Se,{path:"ranges",element:a.jsx(vQ,{})}),a.jsx(Se,{path:"subscriptions",element:a.jsx(NQ,{})}),a.jsx(Se,{path:"timeline",element:a.jsx(LS,{})}),a.jsx(Se,{path:"tools",element:a.jsx(MQ,{})}),a.jsx(Se,{path:"profiles",element:a.jsx(fQ,{})})]}),a.jsx(Se,{path:"/:resourceType",element:a.jsx(IS,{})}),a.jsx(Se,{path:"/",element:a.jsx(IS,{})})]})})}function $Q(){const e=se(),t=e.getUserConfiguration(),n=Go(),[r]=$0();return e.isLoading()?a.jsx(Br,{}):a.jsx(_8,{logo:a.jsx(Gr,{size:24}),pathname:n.pathname,searchParams:r,version:T6,menus:LQ(t),displayAddBookmark:!!(t!=null&&t.id),children:a.jsx(m.Suspense,{fallback:a.jsx(Br,{}),children:a.jsx(OQ,{})})})}function LQ(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:FQ(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(SF,{})}]}),t}const FS={Patient:OF,Practitioner:yF,Organization:lF,ServiceRequest:_F,DiagnosticReport:IF,Questionnaire:vF,admin:iF,AccessPolicy:wF,Subscription:FF,batch:jF,Observation:EF};function FQ(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in FS){const n=FS[t];return a.jsx(n,{})}}catch{}return a.jsx(th,{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 zQ(){const e=lu(),t=new ET({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=BW([{path:"*",element:a.jsx($Q,{})}]),o=s=>r.navigate(s);Jk(document.getElementById("root")).render(a.jsx(m.StrictMode,{children:a.jsx(W6,{medplum:t,navigate:o,children:a.jsxs(Sb,{theme:n,children:[a.jsx(Ho,{position:"bottom-right"}),a.jsx(XW,{router:r})]})})}))}zQ().catch(console.error);
|
|
563
|
-
//# sourceMappingURL=index-B4iLXt6s.js.map
|