@medplum/app 2.1.20 → 2.1.22
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-7LBk_ZHE.js +235 -0
- package/dist/assets/index-7LBk_ZHE.js.map +1 -0
- package/dist/index.html +4 -5
- package/package.json +8 -8
- package/dist/assets/index-c8a43a1c.js +0 -235
- package/dist/assets/index-c8a43a1c.js.map +0 -1
- /package/dist/assets/{favicon-40a461ba.ico → favicon-D3fOOtTL.ico} +0 -0
- /package/dist/assets/{index-9b7f1ec0.css → index-LlMQNUXm.css} +0 -0
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
function cA(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(n,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>n[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"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(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 n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var m1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var XC={exports:{}},bh={},JC={exports:{}},Re={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var gc=Symbol.for("react.element"),uA=Symbol.for("react.portal"),dA=Symbol.for("react.fragment"),fA=Symbol.for("react.strict_mode"),pA=Symbol.for("react.profiler"),hA=Symbol.for("react.provider"),mA=Symbol.for("react.context"),gA=Symbol.for("react.forward_ref"),vA=Symbol.for("react.suspense"),yA=Symbol.for("react.memo"),xA=Symbol.for("react.lazy"),g1=Symbol.iterator;function wA(e){return e===null||typeof e!="object"?null:(e=g1&&e[g1]||e["@@iterator"],typeof e=="function"?e:null)}var ZC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},eE=Object.assign,tE={};function Cs(e,t,r){this.props=e,this.context=t,this.refs=tE,this.updater=r||ZC}Cs.prototype.isReactComponent={};Cs.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")};Cs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function rE(){}rE.prototype=Cs.prototype;function Ny(e,t,r){this.props=e,this.context=t,this.refs=tE,this.updater=r||ZC}var Ay=Ny.prototype=new rE;Ay.constructor=Ny;eE(Ay,Cs.prototype);Ay.isPureReactComponent=!0;var v1=Array.isArray,nE=Object.prototype.hasOwnProperty,My={current:null},oE={key:!0,ref:!0,__self:!0,__source:!0};function iE(e,t,r){var n,o={},i=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)nE.call(t,n)&&!oE.hasOwnProperty(n)&&(o[n]=t[n]);var l=arguments.length-2;if(l===1)o.children=r;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(n in l=e.defaultProps,l)o[n]===void 0&&(o[n]=l[n]);return{$$typeof:gc,type:e,key:i,ref:a,props:o,_owner:My.current}}function _A(e,t){return{$$typeof:gc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ly(e){return typeof e=="object"&&e!==null&&e.$$typeof===gc}function bA(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var y1=/\/+/g;function Nm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?bA(""+e.key):t.toString(36)}function Xu(e,t,r,n,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case gc:case uA:a=!0}}if(a)return a=e,o=o(a),e=n===""?"."+Nm(a,0):n,v1(o)?(r="",e!=null&&(r=e.replace(y1,"$&/")+"/"),Xu(o,t,r,"",function(u){return u})):o!=null&&(Ly(o)&&(o=_A(o,r+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(y1,"$&/")+"/")+e)),t.push(o)),1;if(a=0,n=n===""?".":n+":",v1(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+Nm(i,l);a+=Xu(i,t,r,c,o)}else if(c=wA(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+Nm(i,l++),a+=Xu(i,t,r,c,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Zc(e,t,r){if(e==null)return e;var n=[],o=0;return Xu(e,n,"","",function(i){return t.call(r,i,o++)}),n}function SA(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var gr={current:null},Ju={transition:null},PA={ReactCurrentDispatcher:gr,ReactCurrentBatchConfig:Ju,ReactCurrentOwner:My};Re.Children={map:Zc,forEach:function(e,t,r){Zc(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Zc(e,function(){t++}),t},toArray:function(e){return Zc(e,function(t){return t})||[]},only:function(e){if(!Ly(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Re.Component=Cs;Re.Fragment=dA;Re.Profiler=pA;Re.PureComponent=Ny;Re.StrictMode=fA;Re.Suspense=vA;Re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PA;Re.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=eE({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=My.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)nE.call(t,c)&&!oE.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:gc,type:e.type,key:o,ref:i,props:n,_owner:a}};Re.createContext=function(e){return e={$$typeof:mA,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:hA,_context:e},e.Consumer=e};Re.createElement=iE;Re.createFactory=function(e){var t=iE.bind(null,e);return t.type=e,t};Re.createRef=function(){return{current:null}};Re.forwardRef=function(e){return{$$typeof:gA,render:e}};Re.isValidElement=Ly;Re.lazy=function(e){return{$$typeof:xA,_payload:{_status:-1,_result:e},_init:SA}};Re.memo=function(e,t){return{$$typeof:yA,type:e,compare:t===void 0?null:t}};Re.startTransition=function(e){var t=Ju.transition;Ju.transition={};try{e()}finally{Ju.transition=t}};Re.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Re.useCallback=function(e,t){return gr.current.useCallback(e,t)};Re.useContext=function(e){return gr.current.useContext(e)};Re.useDebugValue=function(){};Re.useDeferredValue=function(e){return gr.current.useDeferredValue(e)};Re.useEffect=function(e,t){return gr.current.useEffect(e,t)};Re.useId=function(){return gr.current.useId()};Re.useImperativeHandle=function(e,t,r){return gr.current.useImperativeHandle(e,t,r)};Re.useInsertionEffect=function(e,t){return gr.current.useInsertionEffect(e,t)};Re.useLayoutEffect=function(e,t){return gr.current.useLayoutEffect(e,t)};Re.useMemo=function(e,t){return gr.current.useMemo(e,t)};Re.useReducer=function(e,t,r){return gr.current.useReducer(e,t,r)};Re.useRef=function(e){return gr.current.useRef(e)};Re.useState=function(e){return gr.current.useState(e)};Re.useSyncExternalStore=function(e,t,r){return gr.current.useSyncExternalStore(e,t,r)};Re.useTransition=function(){return gr.current.useTransition()};Re.version="18.2.0";JC.exports=Re;var f=JC.exports;const S=Dy(f),Fl=cA({__proto__:null,default:S},[f]);/**
|
|
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 OA=f,jA=Symbol.for("react.element"),CA=Symbol.for("react.fragment"),EA=Object.prototype.hasOwnProperty,$A=OA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,kA={key:!0,ref:!0,__self:!0,__source:!0};function aE(e,t,r){var n,o={},i=null,a=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)EA.call(t,n)&&!kA.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:jA,type:e,key:i,ref:a,props:o,_owner:$A.current}}bh.Fragment=CA;bh.jsx=aE;bh.jsxs=aE;XC.exports=bh;var s=XC.exports,qn=function(){return qn=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},qn.apply(this,arguments)};function sE(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Es(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(d){try{u(n.next(d))}catch(p){a(p)}}function c(d){try{u(n.throw(d))}catch(p){a(p)}}function u(d){d.done?i(d.value):o(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}function $s(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function x1(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function Yg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var Zu="right-scroll-bar-position",ed="width-before-scroll-bar",RA="with-scroll-bars-hidden",TA="--removed-body-scroll-bar-size";function IA(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function DA(e,t){var r=f.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}function NA(e,t){return DA(t||null,function(r){return e.forEach(function(n){return IA(n,r)})})}function AA(e){return e}function MA(e,t){t===void 0&&(t=AA);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var a=t(i,n);return r.push(a),function(){r=r.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(n=!0;r.length;){var a=r;r=[],a.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var a=[];if(r.length){var l=r;r=[],l.forEach(i),a=r}var c=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),r}}}};return o}function LA(e){e===void 0&&(e={});var t=MA(null);return t.options=qn({async:!0,ssr:!1},e),t}var lE=function(e){var t=e.sideCar,r=sE(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return f.createElement(n,qn({},r))};lE.isSideCarExport=!0;function zA(e,t){return e.useMedium(t),lE}var cE=LA(),Am=function(){},Sh=f.forwardRef(function(e,t){var r=f.useRef(null),n=f.useState({onScrollCapture:Am,onWheelCapture:Am,onTouchMoveCapture:Am}),o=n[0],i=n[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,m=e.noIsolation,v=e.inert,g=e.allowPinchZoom,b=e.as,y=b===void 0?"div":b,x=e.gapMode,_=sE(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,j=NA([r,t]),C=qn(qn({},_),o);return f.createElement(f.Fragment,null,d&&f.createElement(w,{sideCar:cE,removeScrollBar:u,shards:p,noIsolation:m,inert:v,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:x}),a?f.cloneElement(f.Children.only(l),qn(qn({},C),{ref:j})):f.createElement(y,qn({},C,{className:c,ref:j}),l))});Sh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Sh.classNames={fullWidth:ed,zeroRight:Zu};var w1,FA=function(){if(w1)return w1;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=FA();return t&&e.setAttribute("nonce",t),e}function BA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function UA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WA=function(){var e=0,t=null;return{add:function(r){e==0&&(t=VA())&&(BA(t,r),UA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},HA=function(){var e=WA();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},uE=function(){var e=HA(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},GA={left:0,top:0,right:0,gap:0},Mm=function(e){return parseInt(e||"",10)||0},qA=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Mm(r),Mm(n),Mm(o)]},QA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GA;var t=qA(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},KA=uE(),YA=function(e,t,r,n){var o=e.left,i=e.top,a=e.right,l=e.gap;return r===void 0&&(r="margin"),`
|
|
18
|
-
.`.concat(RA,` {
|
|
19
|
-
overflow: hidden `).concat(n,`;
|
|
20
|
-
padding-right: `).concat(l,"px ").concat(n,`;
|
|
21
|
-
}
|
|
22
|
-
body {
|
|
23
|
-
overflow: hidden `).concat(n,`;
|
|
24
|
-
overscroll-behavior: contain;
|
|
25
|
-
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
26
|
-
padding-left: `.concat(o,`px;
|
|
27
|
-
padding-top: `).concat(i,`px;
|
|
28
|
-
padding-right: `).concat(a,`px;
|
|
29
|
-
margin-left:0;
|
|
30
|
-
margin-top:0;
|
|
31
|
-
margin-right: `).concat(l,"px ").concat(n,`;
|
|
32
|
-
`),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(Zu,` {
|
|
36
|
-
right: `).concat(l,"px ").concat(n,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(ed,` {
|
|
40
|
-
margin-right: `).concat(l,"px ").concat(n,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.`).concat(Zu," .").concat(Zu,` {
|
|
44
|
-
right: 0 `).concat(n,`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.`).concat(ed," .").concat(ed,` {
|
|
48
|
-
margin-right: 0 `).concat(n,`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
body {
|
|
52
|
-
`).concat(TA,": ").concat(l,`px;
|
|
53
|
-
}
|
|
54
|
-
`)},XA=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,i=f.useMemo(function(){return QA(o)},[o]);return f.createElement(KA,{styles:YA(i,!t,o,r?"":"!important")})},Xg=!1;if(typeof window<"u")try{var eu=Object.defineProperty({},"passive",{get:function(){return Xg=!0,!0}});window.addEventListener("test",eu,eu),window.removeEventListener("test",eu,eu)}catch{Xg=!1}var Ca=Xg?{passive:!1}:!1,JA=function(e){return e.tagName==="TEXTAREA"},dE=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!JA(e)&&r[t]==="visible")},ZA=function(e){return dE(e,"overflowY")},eM=function(e){return dE(e,"overflowX")},_1=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=fE(e,n);if(o){var i=pE(e,n),a=i[1],l=i[2];if(a>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},tM=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},rM=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},fE=function(e,t){return e==="v"?ZA(t):eM(t)},pE=function(e,t){return e==="v"?tM(t):rM(t)},nM=function(e,t){return e==="h"&&t==="rtl"?-1:1},oM=function(e,t,r,n,o){var i=nM(e,window.getComputedStyle(t).direction),a=i*n,l=r.target,c=t.contains(l),u=!1,d=a>0,p=0,h=0;do{var m=pE(e,l),v=m[0],g=m[1],b=m[2],y=g-b-i*v;(v||y)&&fE(e,l)&&(p+=y,h+=v),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(o&&Math.abs(p)<1||!o&&a>p)||!d&&(o&&Math.abs(h)<1||!o&&-a>h))&&(u=!0),u},tu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},b1=function(e){return[e.deltaX,e.deltaY]},S1=function(e){return e&&"current"in e?e.current:e},iM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aM=function(e){return`
|
|
55
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
-
`)},sM=0,Ea=[];function lM(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(sM++)[0],i=f.useState(uE)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=Yg([e.lockRef.current],(e.shards||[]).map(S1),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(g,b){if("touches"in g&&g.touches.length===2)return!a.current.allowPinchZoom;var y=tu(g),x=r.current,_="deltaX"in g?g.deltaX:x[0]-y[0],w="deltaY"in g?g.deltaY:x[1]-y[1],j,C=g.target,P=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in g&&P==="h"&&C.type==="range")return!1;var E=_1(P,C);if(!E)return!0;if(E?j=P:(j=P==="v"?"h":"v",E=_1(P,C)),!E)return!1;if(!n.current&&"changedTouches"in g&&(_||w)&&(n.current=j),!j)return!0;var k=n.current||j;return oM(k,b,g,k==="h"?_:w,!0)},[]),c=f.useCallback(function(g){var b=g;if(!(!Ea.length||Ea[Ea.length-1]!==i)){var y="deltaY"in b?b1(b):tu(b),x=t.current.filter(function(j){return j.name===b.type&&(j.target===b.target||b.target===j.shadowParent)&&iM(j.delta,y)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var _=(a.current.shards||[]).map(S1).filter(Boolean).filter(function(j){return j.contains(b.target)}),w=_.length>0?l(b,_[0]):!a.current.noIsolation;w&&b.cancelable&&b.preventDefault()}}},[]),u=f.useCallback(function(g,b,y,x){var _={name:g,delta:b,target:y,should:x,shadowParent:cM(y)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),d=f.useCallback(function(g){r.current=tu(g),n.current=void 0},[]),p=f.useCallback(function(g){u(g.type,b1(g),g.target,l(g,e.lockRef.current))},[]),h=f.useCallback(function(g){u(g.type,tu(g),g.target,l(g,e.lockRef.current))},[]);f.useEffect(function(){return Ea.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ca),document.addEventListener("touchmove",c,Ca),document.addEventListener("touchstart",d,Ca),function(){Ea=Ea.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,Ca),document.removeEventListener("touchmove",c,Ca),document.removeEventListener("touchstart",d,Ca)}},[]);var m=e.removeScrollBar,v=e.inert;return f.createElement(f.Fragment,null,v?f.createElement(i,{styles:aM(o)}):null,m?f.createElement(XA,{gapMode:e.gapMode}):null)}function cM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const uM=zA(cE,lM);var hE=f.forwardRef(function(e,t){return f.createElement(Sh,qn({},e,{ref:t,sideCar:uM}))});hE.classNames=Sh.classNames;const dM=hE;function _d(e,t){let r=e;for(;(r=r.parentElement)&&!r.matches(t););return r}function fM(e,t,r){for(let n=e-1;n>=0;n-=1)if(!t[n].disabled)return n;if(r){for(let n=t.length-1;n>-1;n-=1)if(!t[n].disabled)return n}return e}function pM(e,t,r){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(r){for(let n=0;n<t.length;n+=1)if(!t[n].disabled)return n}return e}function hM(e,t,r){return _d(e,r)===_d(t,r)}function mE({parentSelector:e,siblingSelector:t,onKeyDown:r,loop:n=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:a}){return l=>{var c;r==null||r(l);const u=Array.from(((c=_d(l.currentTarget,e))==null?void 0:c.querySelectorAll(t))||[]).filter(g=>hM(l.currentTarget,g,e)),d=u.findIndex(g=>l.currentTarget===g),p=pM(d,u,n),h=fM(d,u,n),m=i==="rtl"?h:p,v=i==="rtl"?p:h;switch(l.key){case"ArrowRight":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[m].focus(),o&&u[m].click());break}case"ArrowLeft":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[v].focus(),o&&u[v].click());break}case"ArrowUp":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[h].focus(),o&&u[h].click());break}case"ArrowDown":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[p].focus(),o&&u[p].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!u[0].disabled&&u[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const g=u.length-1;!u[g].disabled&&u[g].focus();break}}}}function mM(e,t,r){var n;return r?Array.from(((n=_d(r,t))==null?void 0:n.querySelectorAll(e))||[]).findIndex(o=>o===r):null}function Do(e){const t=f.createContext(null);return[({children:o,value:i})=>S.createElement(t.Provider,{value:i},o),()=>{const o=f.useContext(t);if(o===null)throw new Error(e);return o}]}function vc(e){return Array.isArray(e)?e:[e]}function P1(e,t){return r=>{if(typeof r!="string"||r.trim().length===0)throw new Error(t);return`${e}-${r}`}}const gM=()=>{};function vM(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||gM:r=>{var n;r.key==="Escape"&&(e(r),(n=t.onTrigger)==null||n.call(t))}}function zr(e,t){return r=>{e==null||e(r),t==null||t(r)}}function yM(){const[e,t]=f.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function xM({data:e}){const t=[],r=[],n=e.reduce((o,i,a)=>(i.group?o[i.group]?o[i.group].push(a):o[i.group]=[a]:r.push(a),o),{});return Object.keys(n).forEach(o=>{t.push(...n[o].map(i=>e[i]))}),t.push(...r.map(o=>e[o])),t}function wM(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const _M=typeof window<"u"?f.useLayoutEffect:f.useEffect;function bM(e){function t(n){const o=Object.keys(n).reduce((i,a)=>(i[`${e}:${a}`]=l=>n[a](l.detail),i),{});_M(()=>(Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i]),window.addEventListener(i,o[i])}),()=>Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i])})),[o])}function r(n){return(...o)=>wM(`${e}:${String(n)}`,o[0])}return[t,r]}function ks(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==S.Fragment:!1}function gE(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=gE(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function vE(){for(var e=0,t,r,n="";e<arguments.length;)(t=arguments[e++])&&(r=gE(t))&&(n&&(n+=" "),n+=r);return n}const SM={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],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"]};function PM(e){return()=>({fontFamily:e.fontFamily||"sans-serif"})}var OM=Object.defineProperty,O1=Object.getOwnPropertySymbols,jM=Object.prototype.hasOwnProperty,CM=Object.prototype.propertyIsEnumerable,j1=(e,t,r)=>t in e?OM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,C1=(e,t)=>{for(var r in t||(t={}))jM.call(t,r)&&j1(e,r,t[r]);if(O1)for(var r of O1(t))CM.call(t,r)&&j1(e,r,t[r]);return e};function EM(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:C1({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:C1({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function yc(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function zy(e){const t=yc(e);return(r,n,o=!0,i=!0)=>{if(typeof r=="string"&&r.includes(".")){const[l,c]=r.split("."),u=parseInt(c,10);if(l in e.colors&&u>=0&&u<10)return e.colors[l][typeof n=="number"&&!i?n:u]}const a=typeof n=="number"?n:t();return r in e.colors?e.colors[r][a]:o?e.colors[e.primaryColor][a]:r}}function yE(e){let t="";for(let r=1;r<e.length-1;r+=1)t+=`${e[r]} ${r/(e.length-1)*100}%, `;return`${e[0]} 0%, ${t}${e[e.length-1]} 100%`}function $M(e,...t){return`linear-gradient(${e}deg, ${yE(t)})`}function kM(...e){return`radial-gradient(circle, ${yE(e)})`}function xE(e){const t=zy(e),r=yc(e);return n=>{const o={from:(n==null?void 0:n.from)||e.defaultGradient.from,to:(n==null?void 0:n.to)||e.defaultGradient.to,deg:(n==null?void 0:n.deg)||e.defaultGradient.deg};return`linear-gradient(${o.deg}deg, ${t(o.from,r(),!1)} 0%, ${t(o.to,r(),!1)} 100%)`}}function wE(e){return t=>{if(typeof t=="number")return`${t/16}${e}`;if(typeof t=="string"){const r=t.replace("px","");if(!Number.isNaN(Number(r)))return`${Number(r)/16}${e}`}return t}}const O=wE("rem"),ar=wE("em");function A({size:e,sizes:t,units:r}){return e in t?t[e]:typeof e=="number"?r==="em"?ar(e):O(e):e||t.md}function mr(e){return typeof e=="number"?e:typeof e=="string"&&e.includes("rem")?Number(e.replace("rem",""))*16:typeof e=="string"&&e.includes("em")?Number(e.replace("em",""))*16:Number(e)}function RM(e){return t=>`@media (min-width: ${ar(mr(A({size:t,sizes:e.breakpoints})))})`}function TM(e){return t=>`@media (max-width: ${ar(mr(A({size:t,sizes:e.breakpoints}))-1)})`}function IM(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function DM(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}const r=parseInt(t,16),n=r>>16&255,o=r>>8&255,i=r&255;return{r:n,g:o,b:i,a:1}}function NM(e){const[t,r,n,o]=e.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:t,g:r,b:n,a:o||1}}function Fy(e){return IM(e)?DM(e):e.startsWith("rgb")?NM(e):{r:0,g:0,b:0,a:1}}function La(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(--"))return e;const{r,g:n,b:o}=Fy(e);return`rgba(${r}, ${n}, ${o}, ${t})`}function AM(e=0){return{position:"absolute",top:O(e),right:O(e),left:O(e),bottom:O(e)}}function MM(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a:i}=Fy(e),a=1-t,l=c=>Math.round(c*a);return`rgba(${l(r)}, ${l(n)}, ${l(o)}, ${i})`}function LM(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a:i}=Fy(e),a=l=>Math.round(l+(255-l)*t);return`rgba(${a(r)}, ${a(n)}, ${a(o)}, ${i})`}function zM(e){return t=>{if(typeof t=="number")return O(t);const r=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||r}}function FM(e,t){if(typeof e=="string"&&e.includes(".")){const[r,n]=e.split("."),o=parseInt(n,10);if(r in t.colors&&o>=0&&o<10)return{isSplittedColor:!0,key:r,shade:o}}return{isSplittedColor:!1}}function VM(e){const t=zy(e),r=yc(e),n=xE(e);return({variant:o,color:i,gradient:a,primaryFallback:l})=>{const c=FM(i,e);switch(o){case"light":return{border:"transparent",background:La(t(i,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1),color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),hover:La(t(i,e.colorScheme==="dark"?7:1,l,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),hover:La(t(i,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(i,e.colorScheme==="dark"?5:r("light")),background:"transparent",color:t(i,e.colorScheme==="dark"?5:r("light")),hover:e.colorScheme==="dark"?La(t(i,5,l,!1),.05):La(t(i,0,l,!1),.35)};case"default":return{border:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4],background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,color:e.colorScheme==="dark"?e.white:e.black,hover:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(i,r()),hover:null};case"transparent":return{border:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),background:"transparent",hover:null};case"gradient":return{background:n(a),color:e.white,border:"transparent",hover:null};default:{const u=r(),d=c.isSplittedColor?c.shade:u,p=c.isSplittedColor?c.key:i;return{border:"transparent",background:t(p,d,l),color:e.white,hover:t(p,d===9?8:d+1)}}}}}function BM(e){return t=>{const r=yc(e)(t);return e.colors[e.primaryColor][r]}}function UM(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function WM(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}function HM(e){return()=>e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}const Mt={fontStyles:PM,themeColor:zy,focusStyles:EM,linearGradient:$M,radialGradient:kM,smallerThan:TM,largerThan:RM,rgba:La,cover:AM,darken:MM,lighten:LM,radius:zM,variant:VM,primaryShade:yc,hover:UM,gradient:xE,primaryColor:BM,placeholderStyles:WM,dimmed:HM};var GM=Object.defineProperty,qM=Object.defineProperties,QM=Object.getOwnPropertyDescriptors,E1=Object.getOwnPropertySymbols,KM=Object.prototype.hasOwnProperty,YM=Object.prototype.propertyIsEnumerable,$1=(e,t,r)=>t in e?GM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,XM=(e,t)=>{for(var r in t||(t={}))KM.call(t,r)&&$1(e,r,t[r]);if(E1)for(var r of E1(t))YM.call(t,r)&&$1(e,r,t[r]);return e},JM=(e,t)=>qM(e,QM(t));function _E(e){return JM(XM({},e),{fn:{fontStyles:Mt.fontStyles(e),themeColor:Mt.themeColor(e),focusStyles:Mt.focusStyles(e),largerThan:Mt.largerThan(e),smallerThan:Mt.smallerThan(e),radialGradient:Mt.radialGradient,linearGradient:Mt.linearGradient,gradient:Mt.gradient(e),rgba:Mt.rgba,cover:Mt.cover,lighten:Mt.lighten,darken:Mt.darken,primaryShade:Mt.primaryShade(e),radius:Mt.radius(e),variant:Mt.variant(e),hover:Mt.hover,primaryColor:Mt.primaryColor(e),placeholderStyles:Mt.placeholderStyles(e),dimmed:Mt.dimmed(e)}})}const bE=["xs","sm","md","lg","xl"],ZM={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:SM,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)",sm:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem",md:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem",lg:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem",xl:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"},fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},radius:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"2rem"},spacing:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:"2.125rem",lineHeight:1.3,fontWeight:void 0},h2:{fontSize:"1.625rem",lineHeight:1.35,fontWeight:void 0},h3:{fontSize:"1.375rem",lineHeight:1.4,fontWeight:void 0},h4:{fontSize:"1.125rem",lineHeight:1.45,fontWeight:void 0},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:void 0},h6:{fontSize:"0.875rem",lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(0.0625rem)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:e=>({outlineOffset:"0.125rem",outline:`0.125rem solid ${e.colors[e.primaryColor][e.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:e=>({outline:"none",borderColor:e.colors[e.primaryColor][typeof e.primaryShade=="object"?e.primaryShade[e.colorScheme]:e.primaryShade]})}},Vy=_E(ZM);function e9(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function t9(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var r9=function(){function e(r){var n=this;this._insertTag=function(o){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,i),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(t9(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=e9(o);try{i.insertRule(n,i.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e}(),rr="-ms-",bd="-moz-",Fe="-webkit-",SE="comm",By="rule",Uy="decl",n9="@import",PE="@keyframes",o9="@layer",i9=Math.abs,Ph=String.fromCharCode,a9=Object.assign;function s9(e,t){return Yt(e,0)^45?(((t<<2^Yt(e,0))<<2^Yt(e,1))<<2^Yt(e,2))<<2^Yt(e,3):0}function OE(e){return e.trim()}function l9(e,t){return(e=t.exec(e))?e[0]:e}function Ve(e,t,r){return e.replace(t,r)}function Jg(e,t){return e.indexOf(t)}function Yt(e,t){return e.charCodeAt(t)|0}function Vl(e,t,r){return e.slice(t,r)}function Hn(e){return e.length}function Wy(e){return e.length}function ru(e,t){return t.push(e),e}function c9(e,t){return e.map(t).join("")}var Oh=1,fs=1,jE=0,$r=0,It=0,Rs="";function jh(e,t,r,n,o,i,a){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:Oh,column:fs,length:a,return:""}}function Ws(e,t){return a9(jh("",null,null,"",null,null,0),e,{length:-e.length},t)}function u9(){return It}function d9(){return It=$r>0?Yt(Rs,--$r):0,fs--,It===10&&(fs=1,Oh--),It}function Vr(){return It=$r<jE?Yt(Rs,$r++):0,fs++,It===10&&(fs=1,Oh++),It}function Yn(){return Yt(Rs,$r)}function td(){return $r}function xc(e,t){return Vl(Rs,e,t)}function Bl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function CE(e){return Oh=fs=1,jE=Hn(Rs=e),$r=0,[]}function EE(e){return Rs="",e}function rd(e){return OE(xc($r-1,Zg(e===91?e+2:e===40?e+1:e)))}function f9(e){for(;(It=Yn())&&It<33;)Vr();return Bl(e)>2||Bl(It)>3?"":" "}function p9(e,t){for(;--t&&Vr()&&!(It<48||It>102||It>57&&It<65||It>70&&It<97););return xc(e,td()+(t<6&&Yn()==32&&Vr()==32))}function Zg(e){for(;Vr();)switch(It){case e:return $r;case 34:case 39:e!==34&&e!==39&&Zg(It);break;case 40:e===41&&Zg(e);break;case 92:Vr();break}return $r}function h9(e,t){for(;Vr()&&e+It!==47+10;)if(e+It===42+42&&Yn()===47)break;return"/*"+xc(t,$r-1)+"*"+Ph(e===47?e:Vr())}function m9(e){for(;!Bl(Yn());)Vr();return xc(e,$r)}function g9(e){return EE(nd("",null,null,null,[""],e=CE(e),0,[0],e))}function nd(e,t,r,n,o,i,a,l,c){for(var u=0,d=0,p=a,h=0,m=0,v=0,g=1,b=1,y=1,x=0,_="",w=o,j=i,C=n,P=_;b;)switch(v=x,x=Vr()){case 40:if(v!=108&&Yt(P,p-1)==58){Jg(P+=Ve(rd(x),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:P+=rd(x);break;case 9:case 10:case 13:case 32:P+=f9(v);break;case 92:P+=p9(td()-1,7);continue;case 47:switch(Yn()){case 42:case 47:ru(v9(h9(Vr(),td()),t,r),c);break;default:P+="/"}break;case 123*g:l[u++]=Hn(P)*y;case 125*g:case 59:case 0:switch(x){case 0:case 125:b=0;case 59+d:y==-1&&(P=Ve(P,/\f/g,"")),m>0&&Hn(P)-p&&ru(m>32?R1(P+";",n,r,p-1):R1(Ve(P," ","")+";",n,r,p-2),c);break;case 59:P+=";";default:if(ru(C=k1(P,t,r,u,d,o,l,_,w=[],j=[],p),i),x===123)if(d===0)nd(P,t,C,C,w,i,p,l,j);else switch(h===99&&Yt(P,3)===110?100:h){case 100:case 108:case 109:case 115:nd(e,C,C,n&&ru(k1(e,C,C,0,0,o,l,_,o,w=[],p),j),o,j,p,l,n?w:j);break;default:nd(P,C,C,C,[""],j,0,l,j)}}u=d=m=0,g=y=1,_=P="",p=a;break;case 58:p=1+Hn(P),m=v;default:if(g<1){if(x==123)--g;else if(x==125&&g++==0&&d9()==125)continue}switch(P+=Ph(x),x*g){case 38:y=d>0?1:(P+="\f",-1);break;case 44:l[u++]=(Hn(P)-1)*y,y=1;break;case 64:Yn()===45&&(P+=rd(Vr())),h=Yn(),d=p=Hn(_=P+=m9(td())),x++;break;case 45:v===45&&Hn(P)==2&&(g=0)}}return i}function k1(e,t,r,n,o,i,a,l,c,u,d){for(var p=o-1,h=o===0?i:[""],m=Wy(h),v=0,g=0,b=0;v<n;++v)for(var y=0,x=Vl(e,p+1,p=i9(g=a[v])),_=e;y<m;++y)(_=OE(g>0?h[y]+" "+x:Ve(x,/&\f/g,h[y])))&&(c[b++]=_);return jh(e,t,r,o===0?By:l,c,u,d)}function v9(e,t,r){return jh(e,t,r,SE,Ph(u9()),Vl(e,2,-2),0)}function R1(e,t,r,n){return jh(e,t,r,Uy,Vl(e,0,n),Vl(e,n+1,-1),n)}function ts(e,t){for(var r="",n=Wy(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function y9(e,t,r,n){switch(e.type){case o9:if(e.children.length)break;case n9:case Uy:return e.return=e.return||e.value;case SE:return"";case PE:return e.return=e.value+"{"+ts(e.children,n)+"}";case By:e.value=e.props.join(",")}return Hn(r=ts(e.children,n))?e.return=e.value+"{"+r+"}":""}function x9(e){var t=Wy(e);return function(r,n,o,i){for(var a="",l=0;l<t;l++)a+=e[l](r,n,o,i)||"";return a}}function w9(e){return function(t){t.root||(t=t.return)&&e(t)}}var T1=function(t){var r=new WeakMap;return function(n){if(r.has(n))return r.get(n);var o=t(n);return r.set(n,o),o}};function _9(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var b9=function(t,r,n){for(var o=0,i=0;o=i,i=Yn(),o===38&&i===12&&(r[n]=1),!Bl(i);)Vr();return xc(t,$r)},S9=function(t,r){var n=-1,o=44;do switch(Bl(o)){case 0:o===38&&Yn()===12&&(r[n]=1),t[n]+=b9($r-1,r,n);break;case 2:t[n]+=rd(o);break;case 4:if(o===44){t[++n]=Yn()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=Ph(o)}while(o=Vr());return t},P9=function(t,r){return EE(S9(CE(t),r))},I1=new WeakMap,O9=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,o=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!I1.get(n))&&!o){I1.set(t,!0);for(var i=[],a=P9(r,i),l=n.props,c=0,u=0;c<a.length;c++)for(var d=0;d<l.length;d++,u++)t.props[u]=i[c]?a[c].replace(/&\f/g,l[d]):l[d]+" "+a[c]}}},j9=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function $E(e,t){switch(s9(e,t)){case 5103:return Fe+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Fe+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Fe+e+bd+e+rr+e+e;case 6828:case 4268:return Fe+e+rr+e+e;case 6165:return Fe+e+rr+"flex-"+e+e;case 5187:return Fe+e+Ve(e,/(\w+).+(:[^]+)/,Fe+"box-$1$2"+rr+"flex-$1$2")+e;case 5443:return Fe+e+rr+"flex-item-"+Ve(e,/flex-|-self/,"")+e;case 4675:return Fe+e+rr+"flex-line-pack"+Ve(e,/align-content|flex-|-self/,"")+e;case 5548:return Fe+e+rr+Ve(e,"shrink","negative")+e;case 5292:return Fe+e+rr+Ve(e,"basis","preferred-size")+e;case 6060:return Fe+"box-"+Ve(e,"-grow","")+Fe+e+rr+Ve(e,"grow","positive")+e;case 4554:return Fe+Ve(e,/([^-])(transform)/g,"$1"+Fe+"$2")+e;case 6187:return Ve(Ve(Ve(e,/(zoom-|grab)/,Fe+"$1"),/(image-set)/,Fe+"$1"),e,"")+e;case 5495:case 3959:return Ve(e,/(image-set\([^]*)/,Fe+"$1$`$1");case 4968:return Ve(Ve(e,/(.+:)(flex-)?(.*)/,Fe+"box-pack:$3"+rr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Fe+e+e;case 4095:case 3583:case 4068:case 2532:return Ve(e,/(.+)-inline(.+)/,Fe+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Hn(e)-1-t>6)switch(Yt(e,t+1)){case 109:if(Yt(e,t+4)!==45)break;case 102:return Ve(e,/(.+:)(.+)-([^]+)/,"$1"+Fe+"$2-$3$1"+bd+(Yt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Jg(e,"stretch")?$E(Ve(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Yt(e,t+1)!==115)break;case 6444:switch(Yt(e,Hn(e)-3-(~Jg(e,"!important")&&10))){case 107:return Ve(e,":",":"+Fe)+e;case 101:return Ve(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Fe+(Yt(e,14)===45?"inline-":"")+"box$3$1"+Fe+"$2$3$1"+rr+"$2box$3")+e}break;case 5936:switch(Yt(e,t+11)){case 114:return Fe+e+rr+Ve(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Fe+e+rr+Ve(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Fe+e+rr+Ve(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Fe+e+rr+e+e}return e}var C9=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case Uy:t.return=$E(t.value,t.length);break;case PE:return ts([Ws(t,{value:Ve(t.value,"@","@"+Fe)})],o);case By:if(t.length)return c9(t.props,function(i){switch(l9(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ts([Ws(t,{props:[Ve(i,/:(read-\w+)/,":"+bd+"$1")]})],o);case"::placeholder":return ts([Ws(t,{props:[Ve(i,/:(plac\w+)/,":"+Fe+"input-$1")]}),Ws(t,{props:[Ve(i,/:(plac\w+)/,":"+bd+"$1")]}),Ws(t,{props:[Ve(i,/:(plac\w+)/,rr+"input-$1")]})],o)}return""})}},E9=[C9],kE=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(g){var b=g.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var o=t.stylisPlugins||E9,i={},a,l=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(g){for(var b=g.getAttribute("data-emotion").split(" "),y=1;y<b.length;y++)i[b[y]]=!0;l.push(g)});var c,u=[O9,j9];{var d,p=[y9,w9(function(g){d.insert(g)})],h=x9(u.concat(o,p)),m=function(b){return ts(g9(b),h)};c=function(b,y,x,_){d=x,m(b?b+"{"+y.styles+"}":y.styles),_&&(v.inserted[y.name]=!0)}}var v={key:r,sheet:new r9({key:r,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return v.sheet.hydrate(l),v};function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rt.apply(this,arguments)}var RE={exports:{}},qe={};/** @license React v16.13.1
|
|
58
|
-
* react-is.production.min.js
|
|
59
|
-
*
|
|
60
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the MIT license found in the
|
|
63
|
-
* LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/var Ht=typeof Symbol=="function"&&Symbol.for,Hy=Ht?Symbol.for("react.element"):60103,Gy=Ht?Symbol.for("react.portal"):60106,Ch=Ht?Symbol.for("react.fragment"):60107,Eh=Ht?Symbol.for("react.strict_mode"):60108,$h=Ht?Symbol.for("react.profiler"):60114,kh=Ht?Symbol.for("react.provider"):60109,Rh=Ht?Symbol.for("react.context"):60110,qy=Ht?Symbol.for("react.async_mode"):60111,Th=Ht?Symbol.for("react.concurrent_mode"):60111,Ih=Ht?Symbol.for("react.forward_ref"):60112,Dh=Ht?Symbol.for("react.suspense"):60113,$9=Ht?Symbol.for("react.suspense_list"):60120,Nh=Ht?Symbol.for("react.memo"):60115,Ah=Ht?Symbol.for("react.lazy"):60116,k9=Ht?Symbol.for("react.block"):60121,R9=Ht?Symbol.for("react.fundamental"):60117,T9=Ht?Symbol.for("react.responder"):60118,I9=Ht?Symbol.for("react.scope"):60119;function Hr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Hy:switch(e=e.type,e){case qy:case Th:case Ch:case $h:case Eh:case Dh:return e;default:switch(e=e&&e.$$typeof,e){case Rh:case Ih:case Ah:case Nh:case kh:return e;default:return t}}case Gy:return t}}}function TE(e){return Hr(e)===Th}qe.AsyncMode=qy;qe.ConcurrentMode=Th;qe.ContextConsumer=Rh;qe.ContextProvider=kh;qe.Element=Hy;qe.ForwardRef=Ih;qe.Fragment=Ch;qe.Lazy=Ah;qe.Memo=Nh;qe.Portal=Gy;qe.Profiler=$h;qe.StrictMode=Eh;qe.Suspense=Dh;qe.isAsyncMode=function(e){return TE(e)||Hr(e)===qy};qe.isConcurrentMode=TE;qe.isContextConsumer=function(e){return Hr(e)===Rh};qe.isContextProvider=function(e){return Hr(e)===kh};qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Hy};qe.isForwardRef=function(e){return Hr(e)===Ih};qe.isFragment=function(e){return Hr(e)===Ch};qe.isLazy=function(e){return Hr(e)===Ah};qe.isMemo=function(e){return Hr(e)===Nh};qe.isPortal=function(e){return Hr(e)===Gy};qe.isProfiler=function(e){return Hr(e)===$h};qe.isStrictMode=function(e){return Hr(e)===Eh};qe.isSuspense=function(e){return Hr(e)===Dh};qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ch||e===Th||e===$h||e===Eh||e===Dh||e===$9||typeof e=="object"&&e!==null&&(e.$$typeof===Ah||e.$$typeof===Nh||e.$$typeof===kh||e.$$typeof===Rh||e.$$typeof===Ih||e.$$typeof===R9||e.$$typeof===T9||e.$$typeof===I9||e.$$typeof===k9)};qe.typeOf=Hr;RE.exports=qe;var D9=RE.exports,IE=D9,N9={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},A9={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},DE={};DE[IE.ForwardRef]=N9;DE[IE.Memo]=A9;var M9=!0;function L9(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):n+=o+" "}),n}var z9=function(t,r,n){var o=t.key+"-"+r.name;(n===!1||M9===!1)&&t.registered[o]===void 0&&(t.registered[o]=r.styles)},NE=function(t,r,n){z9(t,r,n);var o=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+o:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function F9(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var V9={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},B9=/[A-Z]|^ms/g,U9=/_EMO_([^_]+?)_([^]*?)_EMO_/g,AE=function(t){return t.charCodeAt(1)===45},D1=function(t){return t!=null&&typeof t!="boolean"},Lm=_9(function(e){return AE(e)?e:e.replace(B9,"-$&").toLowerCase()}),N1=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(U9,function(n,o,i){return Gn={name:o,styles:i,next:Gn},o})}return V9[t]!==1&&!AE(t)&&typeof r=="number"&&r!==0?r+"px":r};function Ul(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return Gn={name:r.name,styles:r.styles,next:Gn},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)Gn={name:n.name,styles:n.styles,next:Gn},n=n.next;var o=r.styles+";";return o}return W9(e,t,r)}case"function":{if(e!==void 0){var i=Gn,a=r(e);return Gn=i,Ul(e,t,a)}break}}if(t==null)return r;var l=t[r];return l!==void 0?l:r}function W9(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Ul(e,t,r[o])+";";else for(var i in r){var a=r[i];if(typeof a!="object")t!=null&&t[a]!==void 0?n+=i+"{"+t[a]+"}":D1(a)&&(n+=Lm(i)+":"+N1(i,a)+";");else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)D1(a[l])&&(n+=Lm(i)+":"+N1(i,a[l])+";");else{var c=Ul(e,t,a);switch(i){case"animation":case"animationName":{n+=Lm(i)+":"+c+";";break}default:n+=i+"{"+c+"}"}}}return n}var A1=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Gn,Qy=function(t,r,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var o=!0,i="";Gn=void 0;var a=t[0];a==null||a.raw===void 0?(o=!1,i+=Ul(n,r,a)):i+=a[0];for(var l=1;l<t.length;l++)i+=Ul(n,r,t[l]),o&&(i+=a[l]);A1.lastIndex=0;for(var c="",u;(u=A1.exec(i))!==null;)c+="-"+u[1];var d=F9(i)+c;return{name:d,styles:i,next:Gn}},H9=Fl["useInsertionEffect"]?Fl["useInsertionEffect"]:!1,M1=H9||f.useLayoutEffect,ME=f.createContext(typeof HTMLElement<"u"?kE({key:"css"}):null);ME.Provider;var G9=function(t){return f.forwardRef(function(r,n){var o=f.useContext(ME);return t(r,o,n)})},ev=f.createContext({}),q9=function(t,r){if(typeof r=="function"){var n=r(t);return n}return rt({},t,r)},Q9=T1(function(e){return T1(function(t){return q9(e,t)})}),K9=function(t){var r=f.useContext(ev);return t.theme!==r&&(r=Q9(r)(t.theme)),f.createElement(ev.Provider,{value:r},t.children)},wc=G9(function(e,t){var r=e.styles,n=Qy([r],void 0,f.useContext(ev)),o=f.useRef();return M1(function(){var i=t.key+"-global",a=new t.sheet.constructor({key:i,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),l=!1,c=document.querySelector('style[data-emotion="'+i+" "+n.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),c!==null&&(l=!0,c.setAttribute("data-emotion",i),a.hydrate([c])),o.current=[a,l],function(){a.flush()}},[t]),M1(function(){var i=o.current,a=i[0],l=i[1];if(l){i[1]=!1;return}if(n.next!==void 0&&NE(t,n.next,!0),a.tags.length){var c=a.tags[a.tags.length-1].nextElementSibling;a.before=c,a.flush()}t.insert("",n,a,!1)},[t,n.name]),null});function Y9(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Qy(t)}var X9=Object.defineProperty,J9=Object.defineProperties,Z9=Object.getOwnPropertyDescriptors,L1=Object.getOwnPropertySymbols,eL=Object.prototype.hasOwnProperty,tL=Object.prototype.propertyIsEnumerable,z1=(e,t,r)=>t in e?X9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rL=(e,t)=>{for(var r in t||(t={}))eL.call(t,r)&&z1(e,r,t[r]);if(L1)for(var r of L1(t))tL.call(t,r)&&z1(e,r,t[r]);return e},nL=(e,t)=>J9(e,Z9(t));function oL({theme:e}){return S.createElement(wc,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:nL(rL({},e.fn.fontStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function Hs(e,t,r,n=O){Object.keys(t).forEach(o=>{e[`--mantine-${r}-${o}`]=n(t[o])})}function iL({theme:e}){const t={"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-transition-timing-function":e.transitionTimingFunction,"--mantine-line-height":`${e.lineHeight}`,"--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}`};Hs(t,e.shadows,"shadow"),Hs(t,e.fontSizes,"font-size"),Hs(t,e.radius,"radius"),Hs(t,e.spacing,"spacing"),Hs(t,e.breakpoints,"breakpoints",ar),Object.keys(e.colors).forEach(n=>{e.colors[n].forEach((o,i)=>{t[`--mantine-color-${n}-${i}`]=o})});const r=e.headings.sizes;return Object.keys(r).forEach(n=>{t[`--mantine-${n}-font-size`]=r[n].fontSize,t[`--mantine-${n}-line-height`]=`${r[n].lineHeight}`}),S.createElement(wc,{styles:{":root":t}})}var aL=Object.defineProperty,sL=Object.defineProperties,lL=Object.getOwnPropertyDescriptors,F1=Object.getOwnPropertySymbols,cL=Object.prototype.hasOwnProperty,uL=Object.prototype.propertyIsEnumerable,V1=(e,t,r)=>t in e?aL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zn=(e,t)=>{for(var r in t||(t={}))cL.call(t,r)&&V1(e,r,t[r]);if(F1)for(var r of F1(t))uL.call(t,r)&&V1(e,r,t[r]);return e},zm=(e,t)=>sL(e,lL(t));function dL(e,t){var r;if(!t)return e;const n=Object.keys(e).reduce((o,i)=>{if(i==="headings"&&t.headings){const a=t.headings.sizes?Object.keys(e.headings.sizes).reduce((l,c)=>(l[c]=zn(zn({},e.headings.sizes[c]),t.headings.sizes[c]),l),{}):e.headings.sizes;return zm(zn({},o),{headings:zm(zn(zn({},e.headings),t.headings),{sizes:a})})}if(i==="breakpoints"&&t.breakpoints){const a=zn(zn({},e.breakpoints),t.breakpoints);return zm(zn({},o),{breakpoints:Object.fromEntries(Object.entries(a).sort((l,c)=>mr(l[1])-mr(c[1])))})}return o[i]=typeof t[i]=="object"?zn(zn({},e[i]),t[i]):typeof t[i]=="number"||typeof t[i]=="boolean"||typeof t[i]=="function"?t[i]:t[i]||e[i],o},{});if(t!=null&&t.fontFamily&&!((r=t==null?void 0:t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),!(n.primaryColor in n.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return n}function fL(e,t){return _E(dL(e,t))}function LE(e){return Object.keys(e).reduce((t,r)=>(e[r]!==void 0&&(t[r]=e[r]),t),{})}const pL={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:`${O(1)} dotted ButtonText`},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"}};function hL(){return S.createElement(wc,{styles:pL})}var mL=Object.defineProperty,B1=Object.getOwnPropertySymbols,gL=Object.prototype.hasOwnProperty,vL=Object.prototype.propertyIsEnumerable,U1=(e,t,r)=>t in e?mL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ol=(e,t)=>{for(var r in t||(t={}))gL.call(t,r)&&U1(e,r,t[r]);if(B1)for(var r of B1(t))vL.call(t,r)&&U1(e,r,t[r]);return e};const Sd=f.createContext({theme:Vy});function Zt(){var e;return((e=f.useContext(Sd))==null?void 0:e.theme)||Vy}function yL(e){const t=Zt(),r=n=>{var o,i,a,l;return{styles:((o=t.components[n])==null?void 0:o.styles)||{},classNames:((i=t.components[n])==null?void 0:i.classNames)||{},variants:(a=t.components[n])==null?void 0:a.variants,sizes:(l=t.components[n])==null?void 0:l.sizes}};return Array.isArray(e)?e.map(r):[r(e)]}function zE(){var e;return(e=f.useContext(Sd))==null?void 0:e.emotionCache}function H(e,t,r){var n;const o=Zt(),i=(n=o.components[e])==null?void 0:n.defaultProps,a=typeof i=="function"?i(o):i;return Ol(Ol(Ol({},t),a),LE(r))}function FE({theme:e,emotionCache:t,withNormalizeCSS:r=!1,withGlobalStyles:n=!1,withCSSVariables:o=!1,inherit:i=!1,children:a}){const l=f.useContext(Sd),c=fL(Vy,i?Ol(Ol({},l.theme),e):e);return S.createElement(K9,{theme:c},S.createElement(Sd.Provider,{value:{theme:c,emotionCache:t}},r&&S.createElement(hL,null),n&&S.createElement(oL,{theme:c}),o&&S.createElement(iL,{theme:c}),typeof c.globalStyles=="function"&&S.createElement(wc,{styles:c.globalStyles(c)}),a))}FE.displayName="@mantine/core/MantineProvider";const xL={app:100,modal:200,popover:300,overlay:400,max:9999};function $n(e){return xL[e]}function wL(e,t){const r=f.useRef();return(!r.current||t.length!==r.current.prevDeps.length||r.current.prevDeps.map((n,o)=>n===t[o]).indexOf(!1)>=0)&&(r.current={v:e(),prevDeps:[...t]}),r.current.v}const _L=kE({key:"mantine",prepend:!0});function bL(){return zE()||_L}var SL=Object.defineProperty,W1=Object.getOwnPropertySymbols,PL=Object.prototype.hasOwnProperty,OL=Object.prototype.propertyIsEnumerable,H1=(e,t,r)=>t in e?SL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jL=(e,t)=>{for(var r in t||(t={}))PL.call(t,r)&&H1(e,r,t[r]);if(W1)for(var r of W1(t))OL.call(t,r)&&H1(e,r,t[r]);return e};const Fm="ref";function CL(e){let t;if(e.length!==1)return{args:e,ref:t};const[r]=e;if(!(r instanceof Object))return{args:e,ref:t};if(!(Fm in r))return{args:e,ref:t};t=r[Fm];const n=jL({},r);return delete n[Fm],{args:[n],ref:t}}const{cssFactory:EL}=(()=>{function e(r,n,o){const i=[],a=L9(r,i,o);return i.length<2?o:a+n(i)}function t(r){const{cache:n}=r,o=(...a)=>{const{ref:l,args:c}=CL(a),u=Qy(c,n.registered);return NE(n,u,!1),`${n.key}-${u.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...a)=>e(n.registered,o,vE(a))}}return{cssFactory:t}})();function VE(){const e=bL();return wL(()=>EL({cache:e}),[e])}function $L({cx:e,classes:t,context:r,classNames:n,name:o,cache:i}){const a=r.reduce((l,c)=>(Object.keys(c.classNames).forEach(u=>{typeof l[u]!="string"?l[u]=`${c.classNames[u]}`:l[u]=`${l[u]} ${c.classNames[u]}`}),l),{});return Object.keys(t).reduce((l,c)=>(l[c]=e(t[c],a[c],n!=null&&n[c],Array.isArray(o)?o.filter(Boolean).map(u=>`${(i==null?void 0:i.key)||"mantine"}-${u}-${c}`).join(" "):o?`${(i==null?void 0:i.key)||"mantine"}-${o}-${c}`:null),l),{})}var kL=Object.defineProperty,G1=Object.getOwnPropertySymbols,RL=Object.prototype.hasOwnProperty,TL=Object.prototype.propertyIsEnumerable,q1=(e,t,r)=>t in e?kL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vm=(e,t)=>{for(var r in t||(t={}))RL.call(t,r)&&q1(e,r,t[r]);if(G1)for(var r of G1(t))TL.call(t,r)&&q1(e,r,t[r]);return e};function tv(e,t){return t&&Object.keys(t).forEach(r=>{e[r]?e[r]=Vm(Vm({},e[r]),t[r]):e[r]=Vm({},t[r])}),e}function Q1(e,t,r,n){const o=i=>typeof i=="function"?i(t,r||{},n):i||{};return Array.isArray(e)?e.map(i=>o(i.styles)).reduce((i,a)=>tv(i,a),{}):o(e)}function IL({ctx:e,theme:t,params:r,variant:n,size:o}){return e.reduce((i,a)=>(a.variants&&n in a.variants&&tv(i,a.variants[n](t,r,{variant:n,size:o})),a.sizes&&o in a.sizes&&tv(i,a.sizes[o](t,r,{variant:n,size:o})),i),{})}function W(e){const t=typeof e=="function"?e:()=>e;function r(n,o){const i=Zt(),a=yL(o==null?void 0:o.name),l=zE(),c={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:u,cx:d}=VE(),p=t(i,n,c),h=Q1(o==null?void 0:o.styles,i,n,c),m=Q1(a,i,n,c),v=IL({ctx:a,theme:i,params:n,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),g=Object.fromEntries(Object.keys(p).map(b=>{const y=d({[u(p[b])]:!(o!=null&&o.unstyled)},u(v[b]),u(m[b]),u(h[b]));return[b,y]}));return{classes:$L({cx:d,classes:g,context:a,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:d,theme:i}}return r}function Bt(e){return`___ref-${e||""}`}function BE({styles:e}){const t=Zt();return S.createElement(wc,{styles:Y9(typeof e=="function"?e(t):e)})}var DL=Object.defineProperty,NL=Object.defineProperties,AL=Object.getOwnPropertyDescriptors,K1=Object.getOwnPropertySymbols,ML=Object.prototype.hasOwnProperty,LL=Object.prototype.propertyIsEnumerable,Y1=(e,t,r)=>t in e?DL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gs=(e,t)=>{for(var r in t||(t={}))ML.call(t,r)&&Y1(e,r,t[r]);if(K1)for(var r of K1(t))LL.call(t,r)&&Y1(e,r,t[r]);return e},qs=(e,t)=>NL(e,AL(t));const Qs={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${O(10)})`},transitionProperty:"transform, opacity"},nu={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},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(-${O(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(${O(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(${O(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${O(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:qs(Gs({},Qs),{common:{transformOrigin:"center center"}}),"pop-bottom-left":qs(Gs({},Qs),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":qs(Gs({},Qs),{common:{transformOrigin:"bottom right"}}),"pop-top-left":qs(Gs({},Qs),{common:{transformOrigin:"top left"}}),"pop-top-right":qs(Gs({},Qs),{common:{transformOrigin:"top right"}})},X1=["mousedown","touchstart"];function zL(e,t,r){const n=f.useRef();return f.useEffect(()=>{const o=i=>{const{target:a}=i??{};if(Array.isArray(r)){const l=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";r.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else n.current&&!n.current.contains(a)&&e()};return(t||X1).forEach(i=>document.addEventListener(i,o)),()=>{(t||X1).forEach(i=>document.removeEventListener(i,o))}},[n,e,r]),n}function FL({timeout:e=2e3}={}){const[t,r]=f.useState(null),[n,o]=f.useState(!1),[i,a]=f.useState(null),l=d=>{clearTimeout(i),a(setTimeout(()=>o(!1),e)),o(d)};return{copy:d=>{"clipboard"in navigator?navigator.clipboard.writeText(d).then(()=>l(!0)).catch(p=>r(p)):r(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),r(null),clearTimeout(i)},error:t,copied:n}}function VL(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function BL(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function UL(e,t,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){const[n,o]=f.useState(r?t:BL(e,t)),i=f.useRef();return f.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),VL(i.current,a=>o(a.matches))},[e]),n}const UE=typeof document<"u"?f.useLayoutEffect:f.useEffect;function on(e,t){const r=f.useRef(!1);f.useEffect(()=>()=>{r.current=!1},[]),f.useEffect(()=>{if(r.current)return e();r.current=!0},t)}function WE({opened:e,shouldReturnFocus:t=!0}){const r=f.useRef(),n=()=>{var o;r.current&&"focus"in r.current&&typeof r.current.focus=="function"&&((o=r.current)==null||o.focus({preventScroll:!0}))};return on(()=>{let o=-1;const i=a=>{a.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?r.current=document.activeElement:t&&(o=window.setTimeout(n,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),n}const WL=/input|select|textarea|button|object/,HE="a, input, select, textarea, button, object, [tabindex]";function HL(e){return e.style.display==="none"}function GL(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(HL(r))return!1;r=r.parentNode}return!0}function GE(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function rv(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(GE(e));return(WL.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&GL(e)}function qE(e){const t=GE(e);return(Number.isNaN(t)||t>=0)&&rv(e)}function qL(e){return Array.from(e.querySelectorAll(HE)).filter(qE)}function QL(e,t){const r=qL(e);if(!r.length){t.preventDefault();return}const n=r[t.shiftKey?0:r.length-1],o=e.getRootNode();if(!(n===o.activeElement||e===o.activeElement))return;t.preventDefault();const a=r[t.shiftKey?r.length-1:0];a&&a.focus()}function Mh(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function KL(e,t="body > :not(script)"){const r=Mh(),n=Array.from(document.querySelectorAll(t)).map(o=>{var i;if((i=o==null?void 0:o.shadowRoot)!=null&&i.contains(e)||o.contains(e))return;const a=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),c=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",r),a===null||a==="false"?o.setAttribute("aria-hidden","true"):!l&&!c&&o.setAttribute("data-hidden",a),{node:o,ariaHidden:l||null}});return()=>{n.forEach(o=>{!o||r!==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"))})}}function YL(e=!0){const t=f.useRef(),r=f.useRef(null),n=i=>{let a=i.querySelector("[data-autofocus]");if(!a){const l=Array.from(i.querySelectorAll(HE));a=l.find(qE)||l.find(rv)||null,!a&&rv(i)&&(a=i)}a&&a.focus({preventScroll:!0})},o=f.useCallback(i=>{if(e){if(i===null){r.current&&(r.current(),r.current=null);return}r.current=KL(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),t.current=i):t.current=null)}},[e]);return f.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const i=a=>{a.key==="Tab"&&t.current&&QL(t.current,a)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),r.current&&r.current()}},[e]),o}const XL=e=>(e+1)%1e6;function JL(){const[,e]=f.useReducer(XL,0);return e}const ZL=S["useId".toString()]||(()=>{});function e6(){const e=ZL();return e?`mantine-${e.replace(/:/g,"")}`:""}function Ir(e){const t=e6(),[r,n]=f.useState(t);return UE(()=>{n(Mh())},[]),typeof e=="string"?e:typeof window>"u"?t:r}function nv(e,t,r){f.useEffect(()=>(window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)),[e,t])}function QE(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function t6(...e){return t=>{e.forEach(r=>QE(r,t))}}function Ts(...e){return f.useCallback(t6(...e),e)}function kr({value:e,defaultValue:t,finalValue:r,onChange:n=()=>{}}){const[o,i]=f.useState(t!==void 0?t:r),a=l=>{i(l),n==null||n(l)};return e!==void 0?[e,n,!0]:[o,a,!1]}function Go(e,t){const r=t-e+1;return Array.from({length:r},(n,o)=>o+e)}const ou="dots";function r6({total:e,siblings:t=1,boundaries:r=1,page:n,initialPage:o=1,onChange:i}){const a=Math.max(Math.trunc(e),0),[l,c]=kr({value:n,onChange:i,defaultValue:o,finalValue:o}),u=g=>{g<=0?c(1):g>a?c(a):c(g)},d=()=>u(l+1),p=()=>u(l-1),h=()=>u(1),m=()=>u(a);return{range:f.useMemo(()=>{if(t*2+3+r*2>=a)return Go(1,a);const b=Math.max(l-t,r),y=Math.min(l+t,a-r),x=b>r+2,_=y<a-(r+1);if(!x&&_){const w=t*2+r+2;return[...Go(1,w),ou,...Go(a-(r-1),a)]}if(x&&!_){const w=r+1+2*t;return[...Go(1,r),ou,...Go(a-w,a)]}return[...Go(1,r),ou,...Go(b,y),ou,...Go(a-r+1,a)]},[a,t,l]),active:l,setPage:u,next:d,previous:p,first:h,last:m}}function n6({initialValues:e=[],limit:t}){const[{state:r,queue:n},o]=f.useState({state:e.slice(0,t),queue:e.slice(t)});return{state:r,queue:n,add:(...c)=>o(u=>{const d=[...u.state,...u.queue,...c];return{state:d.slice(0,t),queue:d.slice(t)}}),update:c=>o(u=>{const d=c([...u.state,...u.queue]);return{state:d.slice(0,t),queue:d.slice(t)}}),cleanQueue:()=>o(c=>({state:c.state,queue:[]}))}}function Lh(e,t){return UL("(prefers-reduced-motion: reduce)",e,t)}const o6=e=>e<.5?2*e*e:-1+(4-2*e)*e,i6=({axis:e,target:t,parent:r,alignment:n,offset:o,isList:i})=>{if(!t||!r&&typeof document>"u")return 0;const a=!!r,c=(r||document.body).getBoundingClientRect(),u=t.getBoundingClientRect(),d=p=>u[p]-c[p];if(e==="y"){const p=d("top");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.height*(i?0:1)||!i?m:0}const h=a?c.height:window.innerHeight;if(n==="end"){const m=p+o-h+u.height;return m>=-u.height*(i?0:1)||!i?m:0}return n==="center"?p-h/2+u.height/2:0}if(e==="x"){const p=d("left");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.width||!i?m:0}const h=a?c.width:window.innerWidth;if(n==="end"){const m=p+o-h+u.width;return m>=-u.width||!i?m:0}return n==="center"?p-h/2+u.width/2:0}return 0},a6=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const r=e==="y"?"scrollTop":"scrollLeft";if(t)return t[r];const{body:n,documentElement:o}=document;return n[r]+o[r]},s6=({axis:e,parent:t,distance:r})=>{if(!t&&typeof document>"u")return;const n=e==="y"?"scrollTop":"scrollLeft";if(t)t[n]=r;else{const{body:o,documentElement:i}=document;o[n]=r,i[n]=r}};function l6({duration:e=1250,axis:t="y",onScrollFinish:r,easing:n=o6,offset:o=0,cancelable:i=!0,isList:a=!1}={}){const l=f.useRef(0),c=f.useRef(0),u=f.useRef(!1),d=f.useRef(null),p=f.useRef(null),h=Lh(),m=()=>{l.current&&cancelAnimationFrame(l.current)},v=f.useCallback(({alignment:b="start"}={})=>{var y;u.current=!1,l.current&&m();const x=(y=a6({parent:d.current,axis:t}))!=null?y:0,_=i6({parent:d.current,target:p.current,axis:t,alignment:b,offset:o,isList:a})-(d.current?0:x);function w(){c.current===0&&(c.current=performance.now());const C=performance.now()-c.current,P=h||e===0?1:C/e,E=x+_*n(P);s6({parent:d.current,axis:t,distance:E}),!u.current&&P<1?l.current=requestAnimationFrame(w):(typeof r=="function"&&r(),c.current=0,l.current=0,m())}w()},[t,e,n,a,o,r,h]),g=()=>{i&&(u.current=!0)};return nv("wheel",g,{passive:!0}),nv("touchmove",g,{passive:!0}),f.useEffect(()=>m,[]),{scrollableRef:d,targetRef:p,scrollIntoView:v,cancel:m}}function c6(e=!1,t){const{onOpen:r,onClose:n}=t||{},[o,i]=f.useState(e),a=f.useCallback(()=>{i(u=>u||(r==null||r(),!0))},[r]),l=f.useCallback(()=>{i(u=>u&&(n==null||n(),!1))},[n]),c=f.useCallback(()=>{o?l():a()},[l,a,o]);return[o,{open:a,close:l,toggle:c}]}function J1(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var Z1=Object.getOwnPropertySymbols,u6=Object.prototype.hasOwnProperty,d6=Object.prototype.propertyIsEnumerable,f6=(e,t)=>{var r={};for(var n in e)u6.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Z1)for(var n of Z1(e))t.indexOf(n)<0&&d6.call(e,n)&&(r[n]=e[n]);return r};function no(e){const t=e,{m:r,mx:n,my:o,mt:i,mb:a,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:v,pr:g,bg:b,c:y,opacity:x,ff:_,fz:w,fw:j,lts:C,ta:P,lh:E,fs:k,tt:$,td:I,w:T,miw:z,maw:M,h:L,mih:q,mah:Y,bgsz:R,bgp:N,bgr:V,bga:Q,pos:ee,top:_e,left:we,bottom:Ue,right:Ae,inset:pt,display:Nt}=t,Pe=f6(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:LE({m:r,mx:n,my:o,mt:i,mb:a,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:v,pr:g,bg:b,c:y,opacity:x,ff:_,fz:w,fw:j,lts:C,ta:P,lh:E,fs:k,tt:$,td:I,w:T,miw:z,maw:M,h:L,mih:q,mah:Y,bgsz:R,bgp:N,bgr:V,bga:Q,pos:ee,top:_e,left:we,bottom:Ue,right:Ae,inset:pt,display:Nt}),rest:Pe}}function p6(e,t){const r=Object.keys(e).filter(n=>n!=="base").sort((n,o)=>mr(A({size:n,sizes:t.breakpoints}))-mr(A({size:o,sizes:t.breakpoints})));return"base"in e?["base",...r]:r}function h6({value:e,theme:t,getValue:r,property:n}){if(e==null)return;if(typeof e=="object")return p6(e,t).reduce((a,l)=>{if(l==="base"&&e.base!==void 0){const u=r(e.base,t);return Array.isArray(n)?(n.forEach(d=>{a[d]=u}),a):(a[n]=u,a)}const c=r(e[l],t);return Array.isArray(n)?(a[t.fn.largerThan(l)]={},n.forEach(u=>{a[t.fn.largerThan(l)][u]=c}),a):(a[t.fn.largerThan(l)]={[n]:c},a)},{});const o=r(e,t);return Array.isArray(n)?n.reduce((i,a)=>(i[a]=o,i),{}):{[n]:o}}function m6(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function g6(e){return O(e)}function v6(e){return e}function y6(e,t){return A({size:e,sizes:t.fontSizes})}const x6=["-xs","-sm","-md","-lg","-xl"];function w6(e,t){return x6.includes(e)?`calc(${A({size:e.replace("-",""),sizes:t.spacing})} * -1)`:A({size:e,sizes:t.spacing})}const _6={identity:v6,color:m6,size:g6,fontSize:y6,spacing:w6},b6={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"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},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"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",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"}};var S6=Object.defineProperty,ew=Object.getOwnPropertySymbols,P6=Object.prototype.hasOwnProperty,O6=Object.prototype.propertyIsEnumerable,tw=(e,t,r)=>t in e?S6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rw=(e,t)=>{for(var r in t||(t={}))P6.call(t,r)&&tw(e,r,t[r]);if(ew)for(var r of ew(t))O6.call(t,r)&&tw(e,r,t[r]);return e};function ov(e,t,r=b6){return Object.keys(r).reduce((o,i)=>(i in e&&e[i]!==void 0&&o.push(h6({value:e[i],getValue:_6[r[i].type],property:r[i].property,theme:t})),o),[]).reduce((o,i)=>(Object.keys(i).forEach(a=>{typeof i[a]=="object"&&i[a]!==null&&a in o?o[a]=rw(rw({},o[a]),i[a]):o[a]=i[a]}),o),{})}function nw(e,t){return typeof e=="function"?e(t):e}function j6(e,t,r){const n=Zt(),{css:o,cx:i}=VE();return Array.isArray(e)?i(r,o(ov(t,n)),e.map(a=>o(nw(a,n)))):i(r,o(nw(e,n)),o(ov(t,n)))}var C6=Object.defineProperty,Pd=Object.getOwnPropertySymbols,KE=Object.prototype.hasOwnProperty,YE=Object.prototype.propertyIsEnumerable,ow=(e,t,r)=>t in e?C6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E6=(e,t)=>{for(var r in t||(t={}))KE.call(t,r)&&ow(e,r,t[r]);if(Pd)for(var r of Pd(t))YE.call(t,r)&&ow(e,r,t[r]);return e},$6=(e,t)=>{var r={};for(var n in e)KE.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pd)for(var n of Pd(e))t.indexOf(n)<0&&YE.call(e,n)&&(r[n]=e[n]);return r};const XE=f.forwardRef((e,t)=>{var r=e,{className:n,component:o,style:i,sx:a}=r,l=$6(r,["className","component","style","sx"]);const{systemStyles:c,rest:u}=no(l),d=o||"div";return S.createElement(d,E6({ref:t,className:j6(a,c,n),style:i},u))});XE.displayName="@mantine/core/Box";const oe=XE;var k6=Object.defineProperty,R6=Object.defineProperties,T6=Object.getOwnPropertyDescriptors,iw=Object.getOwnPropertySymbols,I6=Object.prototype.hasOwnProperty,D6=Object.prototype.propertyIsEnumerable,aw=(e,t,r)=>t in e?k6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sw=(e,t)=>{for(var r in t||(t={}))I6.call(t,r)&&aw(e,r,t[r]);if(iw)for(var r of iw(t))D6.call(t,r)&&aw(e,r,t[r]);return e},N6=(e,t)=>R6(e,T6(t)),A6=W(e=>({root:N6(sw(sw({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const M6=A6;var L6=Object.defineProperty,Od=Object.getOwnPropertySymbols,JE=Object.prototype.hasOwnProperty,ZE=Object.prototype.propertyIsEnumerable,lw=(e,t,r)=>t in e?L6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z6=(e,t)=>{for(var r in t||(t={}))JE.call(t,r)&&lw(e,r,t[r]);if(Od)for(var r of Od(t))ZE.call(t,r)&&lw(e,r,t[r]);return e},F6=(e,t)=>{var r={};for(var n in e)JE.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Od)for(var n of Od(e))t.indexOf(n)<0&&ZE.call(e,n)&&(r[n]=e[n]);return r};const e$=f.forwardRef((e,t)=>{const r=H("UnstyledButton",{},e),{className:n,component:o="button",unstyled:i,variant:a}=r,l=F6(r,["className","component","unstyled","variant"]),{classes:c,cx:u}=M6(null,{name:"UnstyledButton",unstyled:i,variant:a});return S.createElement(oe,z6({component:o,ref:t,className:u(c.root,n),type:o==="button"?"button":void 0},l))});e$.displayName="@mantine/core/UnstyledButton";const So=e$;var t$={exports:{}},Gr={},r$={exports:{}},n$={};/**
|
|
65
|
-
* @license React
|
|
66
|
-
* scheduler.production.min.js
|
|
67
|
-
*
|
|
68
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the MIT license found in the
|
|
71
|
-
* LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/(function(e){function t(R,N){var V=R.length;R.push(N);e:for(;0<V;){var Q=V-1>>>1,ee=R[Q];if(0<o(ee,N))R[Q]=N,R[V]=ee,V=Q;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var N=R[0],V=R.pop();if(V!==N){R[0]=V;e:for(var Q=0,ee=R.length,_e=ee>>>1;Q<_e;){var we=2*(Q+1)-1,Ue=R[we],Ae=we+1,pt=R[Ae];if(0>o(Ue,V))Ae<ee&&0>o(pt,Ue)?(R[Q]=pt,R[Ae]=V,Q=Ae):(R[Q]=Ue,R[we]=V,Q=we);else if(Ae<ee&&0>o(pt,V))R[Q]=pt,R[Ae]=V,Q=Ae;else break e}}return N}function o(R,N){var V=R.sortIndex-N.sortIndex;return V!==0?V:R.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,p=null,h=3,m=!1,v=!1,g=!1,b=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 _(R){for(var N=r(u);N!==null;){if(N.callback===null)n(u);else if(N.startTime<=R)n(u),N.sortIndex=N.expirationTime,t(c,N);else break;N=r(u)}}function w(R){if(g=!1,_(R),!v)if(r(c)!==null)v=!0,q(j);else{var N=r(u);N!==null&&Y(w,N.startTime-R)}}function j(R,N){v=!1,g&&(g=!1,y(E),E=-1),m=!0;var V=h;try{for(_(N),p=r(c);p!==null&&(!(p.expirationTime>N)||R&&!I());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,h=p.priorityLevel;var ee=Q(p.expirationTime<=N);N=e.unstable_now(),typeof ee=="function"?p.callback=ee:p===r(c)&&n(c),_(N)}else n(c);p=r(c)}if(p!==null)var _e=!0;else{var we=r(u);we!==null&&Y(w,we.startTime-N),_e=!1}return _e}finally{p=null,h=V,m=!1}}var C=!1,P=null,E=-1,k=5,$=-1;function I(){return!(e.unstable_now()-$<k)}function T(){if(P!==null){var R=e.unstable_now();$=R;var N=!0;try{N=P(!0,R)}finally{N?z():(C=!1,P=null)}}else C=!1}var z;if(typeof x=="function")z=function(){x(T)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,L=M.port2;M.port1.onmessage=T,z=function(){L.postMessage(null)}}else z=function(){b(T,0)};function q(R){P=R,C||(C=!0,z())}function Y(R,N){E=b(function(){R(e.unstable_now())},N)}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(R){R.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,q(j))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var N=3;break;default:N=h}var V=h;h=N;try{return R()}finally{h=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,N){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var V=h;h=R;try{return N()}finally{h=V}},e.unstable_scheduleCallback=function(R,N,V){var Q=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Q+V:Q):V=Q,R){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=V+ee,R={id:d++,callback:N,priorityLevel:R,startTime:V,expirationTime:ee,sortIndex:-1},V>Q?(R.sortIndex=V,t(u,R),r(c)===null&&R===r(u)&&(g?(y(E),E=-1):g=!0,Y(w,V-Q))):(R.sortIndex=ee,t(c,R),v||m||(v=!0,q(j))),R},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(R){var N=h;return function(){var V=h;h=N;try{return R.apply(this,arguments)}finally{h=V}}}})(n$);r$.exports=n$;var V6=r$.exports;/**
|
|
73
|
-
* @license React
|
|
74
|
-
* react-dom.production.min.js
|
|
75
|
-
*
|
|
76
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the MIT license found in the
|
|
79
|
-
* LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/var o$=f,Wr=V6;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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 i$=new Set,Wl={};function fa(e,t){ps(e,t),ps(e+"Capture",t)}function ps(e,t){for(Wl[e]=t,e=0;e<t.length;e++)i$.add(t[e])}var Po=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),iv=Object.prototype.hasOwnProperty,B6=/^[: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]*$/,cw={},uw={};function U6(e){return iv.call(uw,e)?!0:iv.call(cw,e)?!1:B6.test(e)?uw[e]=!0:(cw[e]=!0,!1)}function W6(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function H6(e,t,r,n){if(t===null||typeof t>"u"||W6(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 vr(e,t,r,n,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Jt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Jt[e]=new vr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Jt[t]=new vr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Jt[e]=new vr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Jt[e]=new vr(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){Jt[e]=new vr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Jt[e]=new vr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Jt[e]=new vr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Jt[e]=new vr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Jt[e]=new vr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ky=/[\-:]([a-z])/g;function Yy(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(Ky,Yy);Jt[t]=new vr(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(Ky,Yy);Jt[t]=new vr(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(Ky,Yy);Jt[t]=new vr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Jt[e]=new vr(e,1,!1,e.toLowerCase(),null,!1,!1)});Jt.xlinkHref=new vr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Jt[e]=new vr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xy(e,t,r,n){var o=Jt.hasOwnProperty(t)?Jt[t]:null;(o!==null?o.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(H6(t,r,o,n)&&(r=null),n||o===null?U6(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=r===null?o.type===3?!1:"":r:(t=o.attributeName,n=o.attributeNamespace,r===null?e.removeAttribute(t):(o=o.type,r=o===3||o===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var No=o$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,iu=Symbol.for("react.element"),Fa=Symbol.for("react.portal"),Va=Symbol.for("react.fragment"),Jy=Symbol.for("react.strict_mode"),av=Symbol.for("react.profiler"),a$=Symbol.for("react.provider"),s$=Symbol.for("react.context"),Zy=Symbol.for("react.forward_ref"),sv=Symbol.for("react.suspense"),lv=Symbol.for("react.suspense_list"),e0=Symbol.for("react.memo"),Xo=Symbol.for("react.lazy"),l$=Symbol.for("react.offscreen"),dw=Symbol.iterator;function Ks(e){return e===null||typeof e!="object"?null:(e=dw&&e[dw]||e["@@iterator"],typeof e=="function"?e:null)}var wt=Object.assign,Bm;function yl(e){if(Bm===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Bm=t&&t[1]||""}return`
|
|
81
|
-
`+Bm+e}var Um=!1;function Wm(e,t){if(!e||Um)return"";Um=!0;var r=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 n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
82
|
-
`),i=n.stack.split(`
|
|
83
|
-
`),a=o.length-1,l=i.length-1;1<=a&&0<=l&&o[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(o[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||o[a]!==i[l]){var c=`
|
|
84
|
-
`+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Um=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?yl(e):""}function G6(e){switch(e.tag){case 5:return yl(e.type);case 16:return yl("Lazy");case 13:return yl("Suspense");case 19:return yl("SuspenseList");case 0:case 2:case 15:return e=Wm(e.type,!1),e;case 11:return e=Wm(e.type.render,!1),e;case 1:return e=Wm(e.type,!0),e;default:return""}}function cv(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 Va:return"Fragment";case Fa:return"Portal";case av:return"Profiler";case Jy:return"StrictMode";case sv:return"Suspense";case lv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case s$:return(e.displayName||"Context")+".Consumer";case a$:return(e._context.displayName||"Context")+".Provider";case Zy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case e0:return t=e.displayName||null,t!==null?t:cv(e.type)||"Memo";case Xo:t=e._payload,e=e._init;try{return cv(e(t))}catch{}}return null}function q6(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 cv(t);case 8:return t===Jy?"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 gi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function c$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Q6(e){var t=c$(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function au(e){e._valueTracker||(e._valueTracker=Q6(e))}function u$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=c$(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function jd(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 uv(e,t){var r=t.checked;return wt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function fw(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=gi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function d$(e,t){t=t.checked,t!=null&&Xy(e,"checked",t,!1)}function dv(e,t){d$(e,t);var r=gi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?fv(e,t.type,r):t.hasOwnProperty("defaultValue")&&fv(e,t.type,gi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function fv(e,t,r){(t!=="number"||jd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var xl=Array.isArray;function rs(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&n&&(e[r].defaultSelected=!0)}else{for(r=""+gi(r),t=null,o=0;o<e.length;o++){if(e[o].value===r){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function pv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return wt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function hw(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(G(92));if(xl(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:gi(r)}}function f$(e,t){var r=gi(t.value),n=gi(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function mw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function p$(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 hv(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?p$(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var su,h$=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,o){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(su=su||document.createElement("div"),su.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=su.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var jl={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},K6=["Webkit","ms","Moz","O"];Object.keys(jl).forEach(function(e){K6.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jl[t]=jl[e]})});function m$(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||jl.hasOwnProperty(e)&&jl[e]?(""+t).trim():t+"px"}function g$(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=m$(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var Y6=wt({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 mv(e,t){if(t){if(Y6[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function gv(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 vv=null;function t0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yv=null,ns=null,os=null;function gw(e){if(e=Sc(e)){if(typeof yv!="function")throw Error(G(280));var t=e.stateNode;t&&(t=Uh(t),yv(e.stateNode,e.type,t))}}function v$(e){ns?os?os.push(e):os=[e]:ns=e}function y$(){if(ns){var e=ns,t=os;if(os=ns=null,gw(e),t)for(e=0;e<t.length;e++)gw(t[e])}}function x$(e,t){return e(t)}function w$(){}var Hm=!1;function _$(e,t,r){if(Hm)return e(t,r);Hm=!0;try{return x$(e,t,r)}finally{Hm=!1,(ns!==null||os!==null)&&(w$(),y$())}}function Gl(e,t){var r=e.stateNode;if(r===null)return null;var n=Uh(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(G(231,t,typeof r));return r}var xv=!1;if(Po)try{var Ys={};Object.defineProperty(Ys,"passive",{get:function(){xv=!0}}),window.addEventListener("test",Ys,Ys),window.removeEventListener("test",Ys,Ys)}catch{xv=!1}function X6(e,t,r,n,o,i,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Cl=!1,Cd=null,Ed=!1,wv=null,J6={onError:function(e){Cl=!0,Cd=e}};function Z6(e,t,r,n,o,i,a,l,c){Cl=!1,Cd=null,X6.apply(J6,arguments)}function ez(e,t,r,n,o,i,a,l,c){if(Z6.apply(this,arguments),Cl){if(Cl){var u=Cd;Cl=!1,Cd=null}else throw Error(G(198));Ed||(Ed=!0,wv=u)}}function pa(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function b$(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 vw(e){if(pa(e)!==e)throw Error(G(188))}function tz(e){var t=e.alternate;if(!t){if(t=pa(e),t===null)throw Error(G(188));return t!==e?null:e}for(var r=e,n=t;;){var o=r.return;if(o===null)break;var i=o.alternate;if(i===null){if(n=o.return,n!==null){r=n;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===r)return vw(o),e;if(i===n)return vw(o),t;i=i.sibling}throw Error(G(188))}if(r.return!==n.return)r=o,n=i;else{for(var a=!1,l=o.child;l;){if(l===r){a=!0,r=o,n=i;break}if(l===n){a=!0,n=o,r=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===r){a=!0,r=i,n=o;break}if(l===n){a=!0,n=i,r=o;break}l=l.sibling}if(!a)throw Error(G(189))}}if(r.alternate!==n)throw Error(G(190))}if(r.tag!==3)throw Error(G(188));return r.stateNode.current===r?e:t}function S$(e){return e=tz(e),e!==null?P$(e):null}function P$(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=P$(e);if(t!==null)return t;e=e.sibling}return null}var O$=Wr.unstable_scheduleCallback,yw=Wr.unstable_cancelCallback,rz=Wr.unstable_shouldYield,nz=Wr.unstable_requestPaint,kt=Wr.unstable_now,oz=Wr.unstable_getCurrentPriorityLevel,r0=Wr.unstable_ImmediatePriority,j$=Wr.unstable_UserBlockingPriority,$d=Wr.unstable_NormalPriority,iz=Wr.unstable_LowPriority,C$=Wr.unstable_IdlePriority,zh=null,Xn=null;function az(e){if(Xn&&typeof Xn.onCommitFiberRoot=="function")try{Xn.onCommitFiberRoot(zh,e,void 0,(e.current.flags&128)===128)}catch{}}var bn=Math.clz32?Math.clz32:cz,sz=Math.log,lz=Math.LN2;function cz(e){return e>>>=0,e===0?32:31-(sz(e)/lz|0)|0}var lu=64,cu=4194304;function wl(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 kd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,a=r&268435455;if(a!==0){var l=a&~o;l!==0?n=wl(l):(i&=a,i!==0&&(n=wl(i)))}else a=r&~o,a!==0?n=wl(a):i!==0&&(n=wl(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-bn(t),o=1<<r,n|=e[r],t&=~o;return n}function uz(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 dz(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-bn(i),l=1<<a,c=o[a];c===-1?(!(l&r)||l&n)&&(o[a]=uz(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function _v(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function E$(){var e=lu;return lu<<=1,!(lu&4194240)&&(lu=64),e}function Gm(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function _c(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bn(t),e[t]=r}function fz(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0<r;){var o=31-bn(r),i=1<<o;t[o]=0,n[o]=-1,e[o]=-1,r&=~i}}function n0(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-bn(r),o=1<<n;o&t|e[n]&t&&(e[n]|=t),r&=~o}}var Ge=0;function $$(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var k$,o0,R$,T$,I$,bv=!1,uu=[],si=null,li=null,ci=null,ql=new Map,Ql=new Map,ti=[],pz="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 xw(e,t){switch(e){case"focusin":case"focusout":si=null;break;case"dragenter":case"dragleave":li=null;break;case"mouseover":case"mouseout":ci=null;break;case"pointerover":case"pointerout":ql.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ql.delete(t.pointerId)}}function Xs(e,t,r,n,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Sc(t),t!==null&&o0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function hz(e,t,r,n,o){switch(t){case"focusin":return si=Xs(si,e,t,r,n,o),!0;case"dragenter":return li=Xs(li,e,t,r,n,o),!0;case"mouseover":return ci=Xs(ci,e,t,r,n,o),!0;case"pointerover":var i=o.pointerId;return ql.set(i,Xs(ql.get(i)||null,e,t,r,n,o)),!0;case"gotpointercapture":return i=o.pointerId,Ql.set(i,Xs(Ql.get(i)||null,e,t,r,n,o)),!0}return!1}function D$(e){var t=Ui(e.target);if(t!==null){var r=pa(t);if(r!==null){if(t=r.tag,t===13){if(t=b$(r),t!==null){e.blockedOn=t,I$(e.priority,function(){R$(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function od(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Sv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);vv=n,r.target.dispatchEvent(n),vv=null}else return t=Sc(r),t!==null&&o0(t),e.blockedOn=r,!1;t.shift()}return!0}function ww(e,t,r){od(e)&&r.delete(t)}function mz(){bv=!1,si!==null&&od(si)&&(si=null),li!==null&&od(li)&&(li=null),ci!==null&&od(ci)&&(ci=null),ql.forEach(ww),Ql.forEach(ww)}function Js(e,t){e.blockedOn===t&&(e.blockedOn=null,bv||(bv=!0,Wr.unstable_scheduleCallback(Wr.unstable_NormalPriority,mz)))}function Kl(e){function t(o){return Js(o,e)}if(0<uu.length){Js(uu[0],e);for(var r=1;r<uu.length;r++){var n=uu[r];n.blockedOn===e&&(n.blockedOn=null)}}for(si!==null&&Js(si,e),li!==null&&Js(li,e),ci!==null&&Js(ci,e),ql.forEach(t),Ql.forEach(t),r=0;r<ti.length;r++)n=ti[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ti.length&&(r=ti[0],r.blockedOn===null);)D$(r),r.blockedOn===null&&ti.shift()}var is=No.ReactCurrentBatchConfig,Rd=!0;function gz(e,t,r,n){var o=Ge,i=is.transition;is.transition=null;try{Ge=1,i0(e,t,r,n)}finally{Ge=o,is.transition=i}}function vz(e,t,r,n){var o=Ge,i=is.transition;is.transition=null;try{Ge=4,i0(e,t,r,n)}finally{Ge=o,is.transition=i}}function i0(e,t,r,n){if(Rd){var o=Sv(e,t,r,n);if(o===null)rg(e,t,n,Td,r),xw(e,n);else if(hz(o,e,t,r,n))n.stopPropagation();else if(xw(e,n),t&4&&-1<pz.indexOf(e)){for(;o!==null;){var i=Sc(o);if(i!==null&&k$(i),i=Sv(e,t,r,n),i===null&&rg(e,t,n,Td,r),i===o)break;o=i}o!==null&&n.stopPropagation()}else rg(e,t,n,null,r)}}var Td=null;function Sv(e,t,r,n){if(Td=null,e=t0(n),e=Ui(e),e!==null)if(t=pa(e),t===null)e=null;else if(r=t.tag,r===13){if(e=b$(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Td=e,null}function N$(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(oz()){case r0:return 1;case j$:return 4;case $d:case iz:return 16;case C$:return 536870912;default:return 16}default:return 16}}var ni=null,a0=null,id=null;function A$(){if(id)return id;var e,t=a0,r=t.length,n,o="value"in ni?ni.value:ni.textContent,i=o.length;for(e=0;e<r&&t[e]===o[e];e++);var a=r-e;for(n=1;n<=a&&t[r-n]===o[i-n];n++);return id=o.slice(e,1<n?1-n:void 0)}function ad(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 du(){return!0}function _w(){return!1}function qr(e){function t(r,n,o,i,a){this._reactName=r,this._targetInst=o,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?du:_w,this.isPropagationStopped=_w,this}return wt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=du)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=du)},persist:function(){},isPersistent:du}),t}var Is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},s0=qr(Is),bc=wt({},Is,{view:0,detail:0}),yz=qr(bc),qm,Qm,Zs,Fh=wt({},bc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:l0,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!==Zs&&(Zs&&e.type==="mousemove"?(qm=e.screenX-Zs.screenX,Qm=e.screenY-Zs.screenY):Qm=qm=0,Zs=e),qm)},movementY:function(e){return"movementY"in e?e.movementY:Qm}}),bw=qr(Fh),xz=wt({},Fh,{dataTransfer:0}),wz=qr(xz),_z=wt({},bc,{relatedTarget:0}),Km=qr(_z),bz=wt({},Is,{animationName:0,elapsedTime:0,pseudoElement:0}),Sz=qr(bz),Pz=wt({},Is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Oz=qr(Pz),jz=wt({},Is,{data:0}),Sw=qr(jz),Cz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ez={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"},$z={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kz(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$z[e])?!!t[e]:!1}function l0(){return kz}var Rz=wt({},bc,{key:function(e){if(e.key){var t=Cz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ad(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ez[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:l0,charCode:function(e){return e.type==="keypress"?ad(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ad(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Tz=qr(Rz),Iz=wt({},Fh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pw=qr(Iz),Dz=wt({},bc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:l0}),Nz=qr(Dz),Az=wt({},Is,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mz=qr(Az),Lz=wt({},Fh,{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}),zz=qr(Lz),Fz=[9,13,27,32],c0=Po&&"CompositionEvent"in window,El=null;Po&&"documentMode"in document&&(El=document.documentMode);var Vz=Po&&"TextEvent"in window&&!El,M$=Po&&(!c0||El&&8<El&&11>=El),Ow=String.fromCharCode(32),jw=!1;function L$(e,t){switch(e){case"keyup":return Fz.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function z$(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ba=!1;function Bz(e,t){switch(e){case"compositionend":return z$(t);case"keypress":return t.which!==32?null:(jw=!0,Ow);case"textInput":return e=t.data,e===Ow&&jw?null:e;default:return null}}function Uz(e,t){if(Ba)return e==="compositionend"||!c0&&L$(e,t)?(e=A$(),id=a0=ni=null,Ba=!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 M$&&t.locale!=="ko"?null:t.data;default:return null}}var Wz={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 Cw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wz[e.type]:t==="textarea"}function F$(e,t,r,n){v$(n),t=Id(t,"onChange"),0<t.length&&(r=new s0("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var $l=null,Yl=null;function Hz(e){X$(e,0)}function Vh(e){var t=Ha(e);if(u$(t))return e}function Gz(e,t){if(e==="change")return t}var V$=!1;if(Po){var Ym;if(Po){var Xm="oninput"in document;if(!Xm){var Ew=document.createElement("div");Ew.setAttribute("oninput","return;"),Xm=typeof Ew.oninput=="function"}Ym=Xm}else Ym=!1;V$=Ym&&(!document.documentMode||9<document.documentMode)}function $w(){$l&&($l.detachEvent("onpropertychange",B$),Yl=$l=null)}function B$(e){if(e.propertyName==="value"&&Vh(Yl)){var t=[];F$(t,Yl,e,t0(e)),_$(Hz,t)}}function qz(e,t,r){e==="focusin"?($w(),$l=t,Yl=r,$l.attachEvent("onpropertychange",B$)):e==="focusout"&&$w()}function Qz(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vh(Yl)}function Kz(e,t){if(e==="click")return Vh(t)}function Yz(e,t){if(e==="input"||e==="change")return Vh(t)}function Xz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pn=typeof Object.is=="function"?Object.is:Xz;function Xl(e,t){if(Pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var o=r[n];if(!iv.call(t,o)||!Pn(e[o],t[o]))return!1}return!0}function kw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rw(e,t){var r=kw(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=kw(r)}}function U$(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?U$(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function W$(){for(var e=window,t=jd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=jd(e.document)}return t}function u0(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 Jz(e){var t=W$(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&U$(r.ownerDocument.documentElement,r)){if(n!==null&&u0(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=Rw(r,i);var a=Rw(r,n);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Zz=Po&&"documentMode"in document&&11>=document.documentMode,Ua=null,Pv=null,kl=null,Ov=!1;function Tw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ov||Ua==null||Ua!==jd(n)||(n=Ua,"selectionStart"in n&&u0(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),kl&&Xl(kl,n)||(kl=n,n=Id(Pv,"onSelect"),0<n.length&&(t=new s0("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ua)))}function fu(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Wa={animationend:fu("Animation","AnimationEnd"),animationiteration:fu("Animation","AnimationIteration"),animationstart:fu("Animation","AnimationStart"),transitionend:fu("Transition","TransitionEnd")},Jm={},H$={};Po&&(H$=document.createElement("div").style,"AnimationEvent"in window||(delete Wa.animationend.animation,delete Wa.animationiteration.animation,delete Wa.animationstart.animation),"TransitionEvent"in window||delete Wa.transitionend.transition);function Bh(e){if(Jm[e])return Jm[e];if(!Wa[e])return e;var t=Wa[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in H$)return Jm[e]=t[r];return e}var G$=Bh("animationend"),q$=Bh("animationiteration"),Q$=Bh("animationstart"),K$=Bh("transitionend"),Y$=new Map,Iw="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 Si(e,t){Y$.set(e,t),fa(t,[e])}for(var Zm=0;Zm<Iw.length;Zm++){var eg=Iw[Zm],e7=eg.toLowerCase(),t7=eg[0].toUpperCase()+eg.slice(1);Si(e7,"on"+t7)}Si(G$,"onAnimationEnd");Si(q$,"onAnimationIteration");Si(Q$,"onAnimationStart");Si("dblclick","onDoubleClick");Si("focusin","onFocus");Si("focusout","onBlur");Si(K$,"onTransitionEnd");ps("onMouseEnter",["mouseout","mouseover"]);ps("onMouseLeave",["mouseout","mouseover"]);ps("onPointerEnter",["pointerout","pointerover"]);ps("onPointerLeave",["pointerout","pointerover"]);fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _l="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(" "),r7=new Set("cancel close invalid load scroll toggle".split(" ").concat(_l));function Dw(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,ez(n,t,void 0,e),e.currentTarget=null}function X$(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],o=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var a=n.length-1;0<=a;a--){var l=n[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;Dw(o,l,u),i=c}else for(a=0;a<n.length;a++){if(l=n[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;Dw(o,l,u),i=c}}}if(Ed)throw e=wv,Ed=!1,wv=null,e}function ot(e,t){var r=t[kv];r===void 0&&(r=t[kv]=new Set);var n=e+"__bubble";r.has(n)||(J$(t,e,2,!1),r.add(n))}function tg(e,t,r){var n=0;t&&(n|=4),J$(r,e,n,t)}var pu="_reactListening"+Math.random().toString(36).slice(2);function Jl(e){if(!e[pu]){e[pu]=!0,i$.forEach(function(r){r!=="selectionchange"&&(r7.has(r)||tg(r,!1,e),tg(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pu]||(t[pu]=!0,tg("selectionchange",!1,t))}}function J$(e,t,r,n){switch(N$(t)){case 1:var o=gz;break;case 4:o=vz;break;default:o=i0}r=o.bind(null,t,r,e),o=void 0,!xv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(t,r,{capture:!0,passive:o}):e.addEventListener(t,r,!0):o!==void 0?e.addEventListener(t,r,{passive:o}):e.addEventListener(t,r,!1)}function rg(e,t,r,n,o){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var l=n.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(a===4)for(a=n.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;l!==null;){if(a=Ui(l),a===null)return;if(c=a.tag,c===5||c===6){n=i=a;continue e}l=l.parentNode}}n=n.return}_$(function(){var u=i,d=t0(r),p=[];e:{var h=Y$.get(e);if(h!==void 0){var m=s0,v=e;switch(e){case"keypress":if(ad(r)===0)break e;case"keydown":case"keyup":m=Tz;break;case"focusin":v="focus",m=Km;break;case"focusout":v="blur",m=Km;break;case"beforeblur":case"afterblur":m=Km;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=bw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=wz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Nz;break;case G$:case q$:case Q$:m=Sz;break;case K$:m=Mz;break;case"scroll":m=yz;break;case"wheel":m=zz;break;case"copy":case"cut":case"paste":m=Oz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Pw}var g=(t&4)!==0,b=!g&&e==="scroll",y=g?h!==null?h+"Capture":null:h;g=[];for(var x=u,_;x!==null;){_=x;var w=_.stateNode;if(_.tag===5&&w!==null&&(_=w,y!==null&&(w=Gl(x,y),w!=null&&g.push(Zl(x,w,_)))),b)break;x=x.return}0<g.length&&(h=new m(h,v,null,r,d),p.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&r!==vv&&(v=r.relatedTarget||r.fromElement)&&(Ui(v)||v[Oo]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(v=r.relatedTarget||r.toElement,m=u,v=v?Ui(v):null,v!==null&&(b=pa(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(g=bw,w="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=Pw,w="onPointerLeave",y="onPointerEnter",x="pointer"),b=m==null?h:Ha(m),_=v==null?h:Ha(v),h=new g(w,x+"leave",m,r,d),h.target=b,h.relatedTarget=_,w=null,Ui(d)===u&&(g=new g(y,x+"enter",v,r,d),g.target=_,g.relatedTarget=b,w=g),b=w,m&&v)t:{for(g=m,y=v,x=0,_=g;_;_=$a(_))x++;for(_=0,w=y;w;w=$a(w))_++;for(;0<x-_;)g=$a(g),x--;for(;0<_-x;)y=$a(y),_--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=$a(g),y=$a(y)}g=null}else g=null;m!==null&&Nw(p,h,m,g,!1),v!==null&&b!==null&&Nw(p,b,v,g,!0)}}e:{if(h=u?Ha(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var j=Gz;else if(Cw(h))if(V$)j=Yz;else{j=Qz;var C=qz}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=Kz);if(j&&(j=j(e,u))){F$(p,j,r,d);break e}C&&C(e,h,u),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&fv(h,"number",h.value)}switch(C=u?Ha(u):window,e){case"focusin":(Cw(C)||C.contentEditable==="true")&&(Ua=C,Pv=u,kl=null);break;case"focusout":kl=Pv=Ua=null;break;case"mousedown":Ov=!0;break;case"contextmenu":case"mouseup":case"dragend":Ov=!1,Tw(p,r,d);break;case"selectionchange":if(Zz)break;case"keydown":case"keyup":Tw(p,r,d)}var P;if(c0)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Ba?L$(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(M$&&r.locale!=="ko"&&(Ba||E!=="onCompositionStart"?E==="onCompositionEnd"&&Ba&&(P=A$()):(ni=d,a0="value"in ni?ni.value:ni.textContent,Ba=!0)),C=Id(u,E),0<C.length&&(E=new Sw(E,e,null,r,d),p.push({event:E,listeners:C}),P?E.data=P:(P=z$(r),P!==null&&(E.data=P)))),(P=Vz?Bz(e,r):Uz(e,r))&&(u=Id(u,"onBeforeInput"),0<u.length&&(d=new Sw("onBeforeInput","beforeinput",null,r,d),p.push({event:d,listeners:u}),d.data=P))}X$(p,t)})}function Zl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Id(e,t){for(var r=t+"Capture",n=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Gl(e,r),i!=null&&n.unshift(Zl(e,i,o)),i=Gl(e,t),i!=null&&n.push(Zl(e,i,o))),e=e.return}return n}function $a(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Nw(e,t,r,n,o){for(var i=t._reactName,a=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,o?(c=Gl(r,i),c!=null&&a.unshift(Zl(r,c,l))):o||(c=Gl(r,i),c!=null&&a.push(Zl(r,c,l)))),r=r.return}a.length!==0&&e.push({event:t,listeners:a})}var n7=/\r\n?/g,o7=/\u0000|\uFFFD/g;function Aw(e){return(typeof e=="string"?e:""+e).replace(n7,`
|
|
85
|
-
`).replace(o7,"")}function hu(e,t,r){if(t=Aw(t),Aw(e)!==t&&r)throw Error(G(425))}function Dd(){}var jv=null,Cv=null;function Ev(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 $v=typeof setTimeout=="function"?setTimeout:void 0,i7=typeof clearTimeout=="function"?clearTimeout:void 0,Mw=typeof Promise=="function"?Promise:void 0,a7=typeof queueMicrotask=="function"?queueMicrotask:typeof Mw<"u"?function(e){return Mw.resolve(null).then(e).catch(s7)}:$v;function s7(e){setTimeout(function(){throw e})}function ng(e,t){var r=t,n=0;do{var o=r.nextSibling;if(e.removeChild(r),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(n===0){e.removeChild(o),Kl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=o}while(r);Kl(t)}function ui(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 Lw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Ds=Math.random().toString(36).slice(2),Qn="__reactFiber$"+Ds,ec="__reactProps$"+Ds,Oo="__reactContainer$"+Ds,kv="__reactEvents$"+Ds,l7="__reactListeners$"+Ds,c7="__reactHandles$"+Ds;function Ui(e){var t=e[Qn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Oo]||r[Qn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Lw(e);e!==null;){if(r=e[Qn])return r;e=Lw(e)}return t}e=r,r=e.parentNode}return null}function Sc(e){return e=e[Qn]||e[Oo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ha(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function Uh(e){return e[ec]||null}var Rv=[],Ga=-1;function Pi(e){return{current:e}}function at(e){0>Ga||(e.current=Rv[Ga],Rv[Ga]=null,Ga--)}function Ze(e,t){Ga++,Rv[Ga]=e.current,e.current=t}var vi={},sr=Pi(vi),jr=Pi(!1),Zi=vi;function hs(e,t){var r=e.type.contextTypes;if(!r)return vi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Cr(e){return e=e.childContextTypes,e!=null}function Nd(){at(jr),at(sr)}function zw(e,t,r){if(sr.current!==vi)throw Error(G(168));Ze(sr,t),Ze(jr,r)}function Z$(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(G(108,q6(e)||"Unknown",o));return wt({},r,n)}function Ad(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vi,Zi=sr.current,Ze(sr,e),Ze(jr,jr.current),!0}function Fw(e,t,r){var n=e.stateNode;if(!n)throw Error(G(169));r?(e=Z$(e,t,Zi),n.__reactInternalMemoizedMergedChildContext=e,at(jr),at(sr),Ze(sr,e)):at(jr),Ze(jr,r)}var ho=null,Wh=!1,og=!1;function e2(e){ho===null?ho=[e]:ho.push(e)}function u7(e){Wh=!0,e2(e)}function Oi(){if(!og&&ho!==null){og=!0;var e=0,t=Ge;try{var r=ho;for(Ge=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ho=null,Wh=!1}catch(o){throw ho!==null&&(ho=ho.slice(e+1)),O$(r0,Oi),o}finally{Ge=t,og=!1}}return null}var qa=[],Qa=0,Md=null,Ld=0,en=[],tn=0,ea=null,go=1,vo="";function Mi(e,t){qa[Qa++]=Ld,qa[Qa++]=Md,Md=e,Ld=t}function t2(e,t,r){en[tn++]=go,en[tn++]=vo,en[tn++]=ea,ea=e;var n=go;e=vo;var o=32-bn(n)-1;n&=~(1<<o),r+=1;var i=32-bn(t)+o;if(30<i){var a=o-o%5;i=(n&(1<<a)-1).toString(32),n>>=a,o-=a,go=1<<32-bn(t)+o|r<<o|n,vo=i+e}else go=1<<i|r<<o|n,vo=e}function d0(e){e.return!==null&&(Mi(e,1),t2(e,1,0))}function f0(e){for(;e===Md;)Md=qa[--Qa],qa[Qa]=null,Ld=qa[--Qa],qa[Qa]=null;for(;e===ea;)ea=en[--tn],en[tn]=null,vo=en[--tn],en[tn]=null,go=en[--tn],en[tn]=null}var Br=null,Fr=null,ut=!1,wn=null;function r2(e,t){var r=rn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Vw(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Br=e,Fr=ui(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Br=e,Fr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ea!==null?{id:go,overflow:vo}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=rn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Br=e,Fr=null,!0):!1;default:return!1}}function Tv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Iv(e){if(ut){var t=Fr;if(t){var r=t;if(!Vw(e,t)){if(Tv(e))throw Error(G(418));t=ui(r.nextSibling);var n=Br;t&&Vw(e,t)?r2(n,r):(e.flags=e.flags&-4097|2,ut=!1,Br=e)}}else{if(Tv(e))throw Error(G(418));e.flags=e.flags&-4097|2,ut=!1,Br=e}}}function Bw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Br=e}function mu(e){if(e!==Br)return!1;if(!ut)return Bw(e),ut=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ev(e.type,e.memoizedProps)),t&&(t=Fr)){if(Tv(e))throw n2(),Error(G(418));for(;t;)r2(e,t),t=ui(t.nextSibling)}if(Bw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Fr=ui(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Fr=null}}else Fr=Br?ui(e.stateNode.nextSibling):null;return!0}function n2(){for(var e=Fr;e;)e=ui(e.nextSibling)}function ms(){Fr=Br=null,ut=!1}function p0(e){wn===null?wn=[e]:wn.push(e)}var d7=No.ReactCurrentBatchConfig;function vn(e,t){if(e&&e.defaultProps){t=wt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var zd=Pi(null),Fd=null,Ka=null,h0=null;function m0(){h0=Ka=Fd=null}function g0(e){var t=zd.current;at(zd),e._currentValue=t}function Dv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function as(e,t){Fd=e,h0=Ka=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pr=!0),e.firstContext=null)}function cn(e){var t=e._currentValue;if(h0!==e)if(e={context:e,memoizedValue:t,next:null},Ka===null){if(Fd===null)throw Error(G(308));Ka=e,Fd.dependencies={lanes:0,firstContext:e}}else Ka=Ka.next=e;return t}var Wi=null;function v0(e){Wi===null?Wi=[e]:Wi.push(e)}function o2(e,t,r,n){var o=t.interleaved;return o===null?(r.next=r,v0(t)):(r.next=o.next,o.next=r),t.interleaved=r,jo(e,n)}function jo(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Jo=!1;function y0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function i2(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 xo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function di(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ne&2){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,jo(e,r)}return o=n.interleaved,o===null?(t.next=t,v0(n)):(t.next=o.next,o.next=t),n.interleaved=t,jo(e,r)}function sd(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,n0(e,r)}}function Uw(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var o=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?o=i=a:i=i.next=a,r=r.next}while(r!==null);i===null?o=i=t:i=i.next=t}else o=i=t;r={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Vd(e,t,r,n){var o=e.updateQueue;Jo=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var p=o.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,g=l;switch(h=t,m=r,g.tag){case 1:if(v=g.payload,typeof v=="function"){p=v.call(m,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,h=typeof v=="function"?v.call(m,p,h):v,h==null)break e;p=wt({},p,h);break e;case 2:Jo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=p):d=d.next=m,a|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(1);if(d===null&&(c=p),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);ra|=a,e.lanes=a,e.memoizedState=p}}function Ww(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],o=n.callback;if(o!==null){if(n.callback=null,n=r,typeof o!="function")throw Error(G(191,o));o.call(n)}}}var a2=new o$.Component().refs;function Nv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:wt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Hh={isMounted:function(e){return(e=e._reactInternals)?pa(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=fr(),o=pi(e),i=xo(n,o);i.payload=t,r!=null&&(i.callback=r),t=di(e,i,o),t!==null&&(Sn(t,e,o,n),sd(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=fr(),o=pi(e),i=xo(n,o);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=di(e,i,o),t!==null&&(Sn(t,e,o,n),sd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=fr(),n=pi(e),o=xo(r,n);o.tag=2,t!=null&&(o.callback=t),t=di(e,o,n),t!==null&&(Sn(t,e,n,r),sd(t,e,n))}};function Hw(e,t,r,n,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,a):t.prototype&&t.prototype.isPureReactComponent?!Xl(r,n)||!Xl(o,i):!0}function s2(e,t,r){var n=!1,o=vi,i=t.contextType;return typeof i=="object"&&i!==null?i=cn(i):(o=Cr(t)?Zi:sr.current,n=t.contextTypes,i=(n=n!=null)?hs(e,o):vi),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Hh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Gw(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Hh.enqueueReplaceState(t,t.state,null)}function Av(e,t,r,n){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs=a2,y0(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=cn(i):(i=Cr(t)?Zi:sr.current,o.context=hs(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Nv(e,t,i,r),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&&Hh.enqueueReplaceState(o,o.state,null),Vd(e,r,o,n),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function el(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(G(309));var n=r.stateNode}if(!n)throw Error(G(147,e));var o=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=o.refs;l===a2&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function gu(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function qw(e){var t=e._init;return t(e._payload)}function l2(e){function t(y,x){if(e){var _=y.deletions;_===null?(y.deletions=[x],y.flags|=16):_.push(x)}}function r(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function n(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=hi(y,x),y.index=0,y.sibling=null,y}function i(y,x,_){return y.index=_,e?(_=y.alternate,_!==null?(_=_.index,_<x?(y.flags|=2,x):_):(y.flags|=2,x)):(y.flags|=1048576,x)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,x,_,w){return x===null||x.tag!==6?(x=dg(_,y.mode,w),x.return=y,x):(x=o(x,_),x.return=y,x)}function c(y,x,_,w){var j=_.type;return j===Va?d(y,x,_.props.children,w,_.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Xo&&qw(j)===x.type)?(w=o(x,_.props),w.ref=el(y,x,_),w.return=y,w):(w=pd(_.type,_.key,_.props,null,y.mode,w),w.ref=el(y,x,_),w.return=y,w)}function u(y,x,_,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==_.containerInfo||x.stateNode.implementation!==_.implementation?(x=fg(_,y.mode,w),x.return=y,x):(x=o(x,_.children||[]),x.return=y,x)}function d(y,x,_,w,j){return x===null||x.tag!==7?(x=Ki(_,y.mode,w,j),x.return=y,x):(x=o(x,_),x.return=y,x)}function p(y,x,_){if(typeof x=="string"&&x!==""||typeof x=="number")return x=dg(""+x,y.mode,_),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case iu:return _=pd(x.type,x.key,x.props,null,y.mode,_),_.ref=el(y,null,x),_.return=y,_;case Fa:return x=fg(x,y.mode,_),x.return=y,x;case Xo:var w=x._init;return p(y,w(x._payload),_)}if(xl(x)||Ks(x))return x=Ki(x,y.mode,_,null),x.return=y,x;gu(y,x)}return null}function h(y,x,_,w){var j=x!==null?x.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return j!==null?null:l(y,x,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case iu:return _.key===j?c(y,x,_,w):null;case Fa:return _.key===j?u(y,x,_,w):null;case Xo:return j=_._init,h(y,x,j(_._payload),w)}if(xl(_)||Ks(_))return j!==null?null:d(y,x,_,w,null);gu(y,_)}return null}function m(y,x,_,w,j){if(typeof w=="string"&&w!==""||typeof w=="number")return y=y.get(_)||null,l(x,y,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case iu:return y=y.get(w.key===null?_:w.key)||null,c(x,y,w,j);case Fa:return y=y.get(w.key===null?_:w.key)||null,u(x,y,w,j);case Xo:var C=w._init;return m(y,x,_,C(w._payload),j)}if(xl(w)||Ks(w))return y=y.get(_)||null,d(x,y,w,j,null);gu(x,w)}return null}function v(y,x,_,w){for(var j=null,C=null,P=x,E=x=0,k=null;P!==null&&E<_.length;E++){P.index>E?(k=P,P=null):k=P.sibling;var $=h(y,P,_[E],w);if($===null){P===null&&(P=k);break}e&&P&&$.alternate===null&&t(y,P),x=i($,x,E),C===null?j=$:C.sibling=$,C=$,P=k}if(E===_.length)return r(y,P),ut&&Mi(y,E),j;if(P===null){for(;E<_.length;E++)P=p(y,_[E],w),P!==null&&(x=i(P,x,E),C===null?j=P:C.sibling=P,C=P);return ut&&Mi(y,E),j}for(P=n(y,P);E<_.length;E++)k=m(P,y,E,_[E],w),k!==null&&(e&&k.alternate!==null&&P.delete(k.key===null?E:k.key),x=i(k,x,E),C===null?j=k:C.sibling=k,C=k);return e&&P.forEach(function(I){return t(y,I)}),ut&&Mi(y,E),j}function g(y,x,_,w){var j=Ks(_);if(typeof j!="function")throw Error(G(150));if(_=j.call(_),_==null)throw Error(G(151));for(var C=j=null,P=x,E=x=0,k=null,$=_.next();P!==null&&!$.done;E++,$=_.next()){P.index>E?(k=P,P=null):k=P.sibling;var I=h(y,P,$.value,w);if(I===null){P===null&&(P=k);break}e&&P&&I.alternate===null&&t(y,P),x=i(I,x,E),C===null?j=I:C.sibling=I,C=I,P=k}if($.done)return r(y,P),ut&&Mi(y,E),j;if(P===null){for(;!$.done;E++,$=_.next())$=p(y,$.value,w),$!==null&&(x=i($,x,E),C===null?j=$:C.sibling=$,C=$);return ut&&Mi(y,E),j}for(P=n(y,P);!$.done;E++,$=_.next())$=m(P,y,E,$.value,w),$!==null&&(e&&$.alternate!==null&&P.delete($.key===null?E:$.key),x=i($,x,E),C===null?j=$:C.sibling=$,C=$);return e&&P.forEach(function(T){return t(y,T)}),ut&&Mi(y,E),j}function b(y,x,_,w){if(typeof _=="object"&&_!==null&&_.type===Va&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case iu:e:{for(var j=_.key,C=x;C!==null;){if(C.key===j){if(j=_.type,j===Va){if(C.tag===7){r(y,C.sibling),x=o(C,_.props.children),x.return=y,y=x;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Xo&&qw(j)===C.type){r(y,C.sibling),x=o(C,_.props),x.ref=el(y,C,_),x.return=y,y=x;break e}r(y,C);break}else t(y,C);C=C.sibling}_.type===Va?(x=Ki(_.props.children,y.mode,w,_.key),x.return=y,y=x):(w=pd(_.type,_.key,_.props,null,y.mode,w),w.ref=el(y,x,_),w.return=y,y=w)}return a(y);case Fa:e:{for(C=_.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===_.containerInfo&&x.stateNode.implementation===_.implementation){r(y,x.sibling),x=o(x,_.children||[]),x.return=y,y=x;break e}else{r(y,x);break}else t(y,x);x=x.sibling}x=fg(_,y.mode,w),x.return=y,y=x}return a(y);case Xo:return C=_._init,b(y,x,C(_._payload),w)}if(xl(_))return v(y,x,_,w);if(Ks(_))return g(y,x,_,w);gu(y,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,x!==null&&x.tag===6?(r(y,x.sibling),x=o(x,_),x.return=y,y=x):(r(y,x),x=dg(_,y.mode,w),x.return=y,y=x),a(y)):r(y,x)}return b}var gs=l2(!0),c2=l2(!1),Pc={},Jn=Pi(Pc),tc=Pi(Pc),rc=Pi(Pc);function Hi(e){if(e===Pc)throw Error(G(174));return e}function x0(e,t){switch(Ze(rc,t),Ze(tc,e),Ze(Jn,Pc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:hv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=hv(t,e)}at(Jn),Ze(Jn,t)}function vs(){at(Jn),at(tc),at(rc)}function u2(e){Hi(rc.current);var t=Hi(Jn.current),r=hv(t,e.type);t!==r&&(Ze(tc,e),Ze(Jn,r))}function w0(e){tc.current===e&&(at(Jn),at(tc))}var yt=Pi(0);function Bd(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.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 ig=[];function _0(){for(var e=0;e<ig.length;e++)ig[e]._workInProgressVersionPrimary=null;ig.length=0}var ld=No.ReactCurrentDispatcher,ag=No.ReactCurrentBatchConfig,ta=0,xt=null,Lt=null,Vt=null,Ud=!1,Rl=!1,nc=0,f7=0;function er(){throw Error(G(321))}function b0(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Pn(e[r],t[r]))return!1;return!0}function S0(e,t,r,n,o,i){if(ta=i,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ld.current=e===null||e.memoizedState===null?g7:v7,e=r(n,o),Rl){i=0;do{if(Rl=!1,nc=0,25<=i)throw Error(G(301));i+=1,Vt=Lt=null,t.updateQueue=null,ld.current=y7,e=r(n,o)}while(Rl)}if(ld.current=Wd,t=Lt!==null&&Lt.next!==null,ta=0,Vt=Lt=xt=null,Ud=!1,t)throw Error(G(300));return e}function P0(){var e=nc!==0;return nc=0,e}function Un(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?xt.memoizedState=Vt=e:Vt=Vt.next=e,Vt}function un(){if(Lt===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Lt.next;var t=Vt===null?xt.memoizedState:Vt.next;if(t!==null)Vt=t,Lt=e;else{if(e===null)throw Error(G(310));Lt=e,e={memoizedState:Lt.memoizedState,baseState:Lt.baseState,baseQueue:Lt.baseQueue,queue:Lt.queue,next:null},Vt===null?xt.memoizedState=Vt=e:Vt=Vt.next=e}return Vt}function oc(e,t){return typeof t=="function"?t(e):t}function sg(e){var t=un(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=Lt,o=n.baseQueue,i=r.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}n.baseQueue=o=i,r.pending=null}if(o!==null){i=o.next,n=n.baseState;var l=a=null,c=null,u=i;do{var d=u.lane;if((ta&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var p={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=p,a=n):c=c.next=p,xt.lanes|=d,ra|=d}u=u.next}while(u!==null&&u!==i);c===null?a=n:c.next=l,Pn(n,t.memoizedState)||(Pr=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){o=e;do i=o.lane,xt.lanes|=i,ra|=i,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function lg(e){var t=un(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=r.dispatch,o=r.pending,i=t.memoizedState;if(o!==null){r.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);Pn(i,t.memoizedState)||(Pr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function d2(){}function f2(e,t){var r=xt,n=un(),o=t(),i=!Pn(n.memoizedState,o);if(i&&(n.memoizedState=o,Pr=!0),n=n.queue,O0(m2.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Vt!==null&&Vt.memoizedState.tag&1){if(r.flags|=2048,ic(9,h2.bind(null,r,n,o,t),void 0,null),Ut===null)throw Error(G(349));ta&30||p2(r,t,o)}return o}function p2(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function h2(e,t,r,n){t.value=r,t.getSnapshot=n,g2(t)&&v2(e)}function m2(e,t,r){return r(function(){g2(t)&&v2(e)})}function g2(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Pn(e,r)}catch{return!0}}function v2(e){var t=jo(e,1);t!==null&&Sn(t,e,1,-1)}function Qw(e){var t=Un();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:oc,lastRenderedState:e},t.queue=e,e=e.dispatch=m7.bind(null,xt,e),[t.memoizedState,e]}function ic(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function y2(){return un().memoizedState}function cd(e,t,r,n){var o=Un();xt.flags|=e,o.memoizedState=ic(1|t,r,void 0,n===void 0?null:n)}function Gh(e,t,r,n){var o=un();n=n===void 0?null:n;var i=void 0;if(Lt!==null){var a=Lt.memoizedState;if(i=a.destroy,n!==null&&b0(n,a.deps)){o.memoizedState=ic(t,r,i,n);return}}xt.flags|=e,o.memoizedState=ic(1|t,r,i,n)}function Kw(e,t){return cd(8390656,8,e,t)}function O0(e,t){return Gh(2048,8,e,t)}function x2(e,t){return Gh(4,2,e,t)}function w2(e,t){return Gh(4,4,e,t)}function _2(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 b2(e,t,r){return r=r!=null?r.concat([e]):null,Gh(4,4,_2.bind(null,t,e),r)}function j0(){}function S2(e,t){var r=un();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&b0(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function P2(e,t){var r=un();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&b0(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function O2(e,t,r){return ta&21?(Pn(r,t)||(r=E$(),xt.lanes|=r,ra|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Pr=!0),e.memoizedState=r)}function p7(e,t){var r=Ge;Ge=r!==0&&4>r?r:4,e(!0);var n=ag.transition;ag.transition={};try{e(!1),t()}finally{Ge=r,ag.transition=n}}function j2(){return un().memoizedState}function h7(e,t,r){var n=pi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},C2(e))E2(t,r);else if(r=o2(e,t,r,n),r!==null){var o=fr();Sn(r,e,n,o),$2(r,t,n)}}function m7(e,t,r){var n=pi(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(C2(e))E2(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,r);if(o.hasEagerState=!0,o.eagerState=l,Pn(l,a)){var c=t.interleaved;c===null?(o.next=o,v0(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}r=o2(e,t,o,n),r!==null&&(o=fr(),Sn(r,e,n,o),$2(r,t,n))}}function C2(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function E2(e,t){Rl=Ud=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function $2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,n0(e,r)}}var Wd={readContext:cn,useCallback:er,useContext:er,useEffect:er,useImperativeHandle:er,useInsertionEffect:er,useLayoutEffect:er,useMemo:er,useReducer:er,useRef:er,useState:er,useDebugValue:er,useDeferredValue:er,useTransition:er,useMutableSource:er,useSyncExternalStore:er,useId:er,unstable_isNewReconciler:!1},g7={readContext:cn,useCallback:function(e,t){return Un().memoizedState=[e,t===void 0?null:t],e},useContext:cn,useEffect:Kw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,cd(4194308,4,_2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return cd(4194308,4,e,t)},useInsertionEffect:function(e,t){return cd(4,2,e,t)},useMemo:function(e,t){var r=Un();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Un();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=h7.bind(null,xt,e),[n.memoizedState,e]},useRef:function(e){var t=Un();return e={current:e},t.memoizedState=e},useState:Qw,useDebugValue:j0,useDeferredValue:function(e){return Un().memoizedState=e},useTransition:function(){var e=Qw(!1),t=e[0];return e=p7.bind(null,e[1]),Un().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=xt,o=Un();if(ut){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),Ut===null)throw Error(G(349));ta&30||p2(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,Kw(m2.bind(null,n,i,e),[e]),n.flags|=2048,ic(9,h2.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Un(),t=Ut.identifierPrefix;if(ut){var r=vo,n=go;r=(n&~(1<<32-bn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=f7++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},v7={readContext:cn,useCallback:S2,useContext:cn,useEffect:O0,useImperativeHandle:b2,useInsertionEffect:x2,useLayoutEffect:w2,useMemo:P2,useReducer:sg,useRef:y2,useState:function(){return sg(oc)},useDebugValue:j0,useDeferredValue:function(e){var t=un();return O2(t,Lt.memoizedState,e)},useTransition:function(){var e=sg(oc)[0],t=un().memoizedState;return[e,t]},useMutableSource:d2,useSyncExternalStore:f2,useId:j2,unstable_isNewReconciler:!1},y7={readContext:cn,useCallback:S2,useContext:cn,useEffect:O0,useImperativeHandle:b2,useInsertionEffect:x2,useLayoutEffect:w2,useMemo:P2,useReducer:lg,useRef:y2,useState:function(){return lg(oc)},useDebugValue:j0,useDeferredValue:function(e){var t=un();return Lt===null?t.memoizedState=e:O2(t,Lt.memoizedState,e)},useTransition:function(){var e=lg(oc)[0],t=un().memoizedState;return[e,t]},useMutableSource:d2,useSyncExternalStore:f2,useId:j2,unstable_isNewReconciler:!1};function ys(e,t){try{var r="",n=t;do r+=G6(n),n=n.return;while(n);var o=r}catch(i){o=`
|
|
86
|
-
Error generating stack: `+i.message+`
|
|
87
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function cg(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Mv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var x7=typeof WeakMap=="function"?WeakMap:Map;function k2(e,t,r){r=xo(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Gd||(Gd=!0,qv=n),Mv(e,t)},r}function R2(e,t,r){r=xo(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var o=t.value;r.payload=function(){return n(o)},r.callback=function(){Mv(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Mv(e,t),typeof n!="function"&&(fi===null?fi=new Set([this]):fi.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),r}function Yw(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new x7;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(r)||(o.add(r),e=I7.bind(null,e,t,r),t.then(e,e))}function Xw(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 Jw(e,t,r,n,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=xo(-1,1),t.tag=2,di(r,t,1))),r.lanes|=1),e)}var w7=No.ReactCurrentOwner,Pr=!1;function ur(e,t,r,n){t.child=e===null?c2(t,null,r,n):gs(t,e.child,r,n)}function Zw(e,t,r,n,o){r=r.render;var i=t.ref;return as(t,o),n=S0(e,t,r,n,i,o),r=P0(),e!==null&&!Pr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Co(e,t,o)):(ut&&r&&d0(t),t.flags|=1,ur(e,t,n,o),t.child)}function e_(e,t,r,n,o){if(e===null){var i=r.type;return typeof i=="function"&&!D0(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,T2(e,t,i,n,o)):(e=pd(r.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(r=r.compare,r=r!==null?r:Xl,r(a,n)&&e.ref===t.ref)return Co(e,t,o)}return t.flags|=1,e=hi(i,n),e.ref=t.ref,e.return=t,t.child=e}function T2(e,t,r,n,o){if(e!==null){var i=e.memoizedProps;if(Xl(i,n)&&e.ref===t.ref)if(Pr=!1,t.pendingProps=n=i,(e.lanes&o)!==0)e.flags&131072&&(Pr=!0);else return t.lanes=e.lanes,Co(e,t,o)}return Lv(e,t,r,n,o)}function I2(e,t,r){var n=t.pendingProps,o=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(Xa,Lr),Lr|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ze(Xa,Lr),Lr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Ze(Xa,Lr),Lr|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,Ze(Xa,Lr),Lr|=n;return ur(e,t,o,r),t.child}function D2(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Lv(e,t,r,n,o){var i=Cr(r)?Zi:sr.current;return i=hs(t,i),as(t,o),r=S0(e,t,r,n,i,o),n=P0(),e!==null&&!Pr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Co(e,t,o)):(ut&&n&&d0(t),t.flags|=1,ur(e,t,r,o),t.child)}function t_(e,t,r,n,o){if(Cr(r)){var i=!0;Ad(t)}else i=!1;if(as(t,o),t.stateNode===null)ud(e,t),s2(t,r,n),Av(t,r,n,o),n=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=r.contextType;typeof u=="object"&&u!==null?u=cn(u):(u=Cr(r)?Zi:sr.current,u=hs(t,u));var d=r.getDerivedStateFromProps,p=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";p||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==n||c!==u)&&Gw(t,a,n,u),Jo=!1;var h=t.memoizedState;a.state=h,Vd(t,n,a,o),c=t.memoizedState,l!==n||h!==c||jr.current||Jo?(typeof d=="function"&&(Nv(t,r,d,n),c=t.memoizedState),(l=Jo||Hw(t,r,l,n,h,c,u))?(p||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),a.props=n,a.state=c,a.context=u,n=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,i2(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:vn(t.type,l),a.props=u,p=t.pendingProps,h=a.context,c=r.contextType,typeof c=="object"&&c!==null?c=cn(c):(c=Cr(r)?Zi:sr.current,c=hs(t,c));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==p||h!==c)&&Gw(t,a,n,c),Jo=!1,h=t.memoizedState,a.state=h,Vd(t,n,a,o);var v=t.memoizedState;l!==p||h!==v||jr.current||Jo?(typeof m=="function"&&(Nv(t,r,m,n),v=t.memoizedState),(u=Jo||Hw(t,r,u,n,h,v,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,v,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,v,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),a.props=n,a.state=v,a.context=c,n=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return zv(e,t,r,n,i,o)}function zv(e,t,r,n,o,i){D2(e,t);var a=(t.flags&128)!==0;if(!n&&!a)return o&&Fw(t,r,!1),Co(e,t,i);n=t.stateNode,w7.current=t;var l=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&a?(t.child=gs(t,e.child,null,i),t.child=gs(t,null,l,i)):ur(e,t,l,i),t.memoizedState=n.state,o&&Fw(t,r,!0),t.child}function N2(e){var t=e.stateNode;t.pendingContext?zw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zw(e,t.context,!1),x0(e,t.containerInfo)}function r_(e,t,r,n,o){return ms(),p0(o),t.flags|=256,ur(e,t,r,n),t.child}var Fv={dehydrated:null,treeContext:null,retryLane:0};function Vv(e){return{baseLanes:e,cachePool:null,transitions:null}}function A2(e,t,r){var n=t.pendingProps,o=yt.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ze(yt,o&1),e===null)return Iv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=n.children,e=n.fallback,i?(n=t.mode,i=t.child,a={mode:"hidden",children:a},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Kh(a,n,0,null),e=Ki(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Vv(r),t.memoizedState=Fv,e):C0(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return _7(e,t,a,n,l,o,r);if(i){i=n.fallback,a=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:n.children};return!(a&1)&&t.child!==o?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=hi(o,c),n.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=hi(l,i):(i=Ki(i,a,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,a=e.child.memoizedState,a=a===null?Vv(r):{baseLanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~r,t.memoizedState=Fv,n}return i=e.child,e=i.sibling,n=hi(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function C0(e,t){return t=Kh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vu(e,t,r,n){return n!==null&&p0(n),gs(t,e.child,null,r),e=C0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _7(e,t,r,n,o,i,a){if(r)return t.flags&256?(t.flags&=-257,n=cg(Error(G(422))),vu(e,t,a,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,o=t.mode,n=Kh({mode:"visible",children:n.children},o,0,null),i=Ki(i,o,a,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&gs(t,e.child,null,a),t.child.memoizedState=Vv(a),t.memoizedState=Fv,i);if(!(t.mode&1))return vu(e,t,a,null);if(o.data==="$!"){if(n=o.nextSibling&&o.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(G(419)),n=cg(i,n,void 0),vu(e,t,a,n)}if(l=(a&e.childLanes)!==0,Pr||l){if(n=Ut,n!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(n.suspendedLanes|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,jo(e,o),Sn(n,e,o,-1))}return I0(),n=cg(Error(G(421))),vu(e,t,a,n)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=D7.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Fr=ui(o.nextSibling),Br=t,ut=!0,wn=null,e!==null&&(en[tn++]=go,en[tn++]=vo,en[tn++]=ea,go=e.id,vo=e.overflow,ea=t),t=C0(t,n.children),t.flags|=4096,t)}function n_(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Dv(e.return,t,r)}function ug(e,t,r,n,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=o)}function M2(e,t,r){var n=t.pendingProps,o=n.revealOrder,i=n.tail;if(ur(e,t,n.children,r),n=yt.current,n&2)n=n&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&&n_(e,r,t);else if(e.tag===19)n_(e,r,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}n&=1}if(Ze(yt,n),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(r=t.child,o=null;r!==null;)e=r.alternate,e!==null&&Bd(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),ug(t,!1,o,r,i);break;case"backwards":for(r=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Bd(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}ug(t,!0,r,null,i);break;case"together":ug(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ud(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Co(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ra|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,r=hi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=hi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function b7(e,t,r){switch(t.tag){case 3:N2(t),ms();break;case 5:u2(t);break;case 1:Cr(t.type)&&Ad(t);break;case 4:x0(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,o=t.memoizedProps.value;Ze(zd,n._currentValue),n._currentValue=o;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ze(yt,yt.current&1),t.flags|=128,null):r&t.child.childLanes?A2(e,t,r):(Ze(yt,yt.current&1),e=Co(e,t,r),e!==null?e.sibling:null);Ze(yt,yt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return M2(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ze(yt,yt.current),n)break;return null;case 22:case 23:return t.lanes=0,I2(e,t,r)}return Co(e,t,r)}var L2,Bv,z2,F2;L2=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Bv=function(){};z2=function(e,t,r,n){var o=e.memoizedProps;if(o!==n){e=t.stateNode,Hi(Jn.current);var i=null;switch(r){case"input":o=uv(e,o),n=uv(e,n),i=[];break;case"select":o=wt({},o,{value:void 0}),n=wt({},n,{value:void 0}),i=[];break;case"textarea":o=pv(e,o),n=pv(e,n),i=[];break;default:typeof o.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Dd)}mv(r,n);var a;r=null;for(u in o)if(!n.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Wl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=o!=null?o[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(i||(i=[]),i.push(u,r)),r=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"&&(Wl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ot("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};F2=function(e,t,r,n){r!==n&&(t.flags|=4)};function tl(e,t){if(!ut)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function tr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var o=e.child;o!==null;)r|=o.lanes|o.childLanes,n|=o.subtreeFlags&14680064,n|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)r|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function S7(e,t,r){var n=t.pendingProps;switch(f0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tr(t),null;case 1:return Cr(t.type)&&Nd(),tr(t),null;case 3:return n=t.stateNode,vs(),at(jr),at(sr),_0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(mu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wn!==null&&(Yv(wn),wn=null))),Bv(e,t),tr(t),null;case 5:w0(t);var o=Hi(rc.current);if(r=t.type,e!==null&&t.stateNode!=null)z2(e,t,r,n,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(G(166));return tr(t),null}if(e=Hi(Jn.current),mu(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Qn]=t,n[ec]=i,e=(t.mode&1)!==0,r){case"dialog":ot("cancel",n),ot("close",n);break;case"iframe":case"object":case"embed":ot("load",n);break;case"video":case"audio":for(o=0;o<_l.length;o++)ot(_l[o],n);break;case"source":ot("error",n);break;case"img":case"image":case"link":ot("error",n),ot("load",n);break;case"details":ot("toggle",n);break;case"input":fw(n,i),ot("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},ot("invalid",n);break;case"textarea":hw(n,i),ot("invalid",n)}mv(r,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&hu(n.textContent,l,e),o=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&hu(n.textContent,l,e),o=["children",""+l]):Wl.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&ot("scroll",n)}switch(r){case"input":au(n),pw(n,i,!0);break;case"textarea":au(n),mw(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Dd)}n=o,t.updateQueue=n,n!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=p$(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[Qn]=t,e[ec]=n,L2(e,t,!1,!1),t.stateNode=e;e:{switch(a=gv(r,n),r){case"dialog":ot("cancel",e),ot("close",e),o=n;break;case"iframe":case"object":case"embed":ot("load",e),o=n;break;case"video":case"audio":for(o=0;o<_l.length;o++)ot(_l[o],e);o=n;break;case"source":ot("error",e),o=n;break;case"img":case"image":case"link":ot("error",e),ot("load",e),o=n;break;case"details":ot("toggle",e),o=n;break;case"input":fw(e,n),o=uv(e,n),ot("invalid",e);break;case"option":o=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},o=wt({},n,{value:void 0}),ot("invalid",e);break;case"textarea":hw(e,n),o=pv(e,n),ot("invalid",e);break;default:o=n}mv(r,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?g$(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&h$(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Hl(e,c):typeof c=="number"&&Hl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Wl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&ot("scroll",e):c!=null&&Xy(e,i,c,a))}switch(r){case"input":au(e),pw(e,n,!1);break;case"textarea":au(e),mw(e);break;case"option":n.value!=null&&e.setAttribute("value",""+gi(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?rs(e,!!n.multiple,i,!1):n.defaultValue!=null&&rs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Dd)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tr(t),null;case 6:if(e&&t.stateNode!=null)F2(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(G(166));if(r=Hi(rc.current),Hi(Jn.current),mu(t)){if(n=t.stateNode,r=t.memoizedProps,n[Qn]=t,(i=n.nodeValue!==r)&&(e=Br,e!==null))switch(e.tag){case 3:hu(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hu(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Qn]=t,t.stateNode=n}return tr(t),null;case 13:if(at(yt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ut&&Fr!==null&&t.mode&1&&!(t.flags&128))n2(),ms(),t.flags|=98560,i=!1;else if(i=mu(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(G(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(G(317));i[Qn]=t}else ms(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tr(t),i=!1}else wn!==null&&(Yv(wn),wn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||yt.current&1?zt===0&&(zt=3):I0())),t.updateQueue!==null&&(t.flags|=4),tr(t),null);case 4:return vs(),Bv(e,t),e===null&&Jl(t.stateNode.containerInfo),tr(t),null;case 10:return g0(t.type._context),tr(t),null;case 17:return Cr(t.type)&&Nd(),tr(t),null;case 19:if(at(yt),i=t.memoizedState,i===null)return tr(t),null;if(n=(t.flags&128)!==0,a=i.rendering,a===null)if(n)tl(i,!1);else{if(zt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Bd(e),a!==null){for(t.flags|=128,tl(i,!1),n=a.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ze(yt,yt.current&1|2),t.child}e=e.sibling}i.tail!==null&&kt()>xs&&(t.flags|=128,n=!0,tl(i,!1),t.lanes=4194304)}else{if(!n)if(e=Bd(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),tl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ut)return tr(t),null}else 2*kt()-i.renderingStartTime>xs&&r!==1073741824&&(t.flags|=128,n=!0,tl(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(r=i.last,r!==null?r.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=kt(),t.sibling=null,r=yt.current,Ze(yt,n?r&1|2:r&1),t):(tr(t),null);case 22:case 23:return T0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Lr&1073741824&&(tr(t),t.subtreeFlags&6&&(t.flags|=8192)):tr(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function P7(e,t){switch(f0(t),t.tag){case 1:return Cr(t.type)&&Nd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vs(),at(jr),at(sr),_0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return w0(t),null;case 13:if(at(yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return at(yt),null;case 4:return vs(),null;case 10:return g0(t.type._context),null;case 22:case 23:return T0(),null;case 24:return null;default:return null}}var yu=!1,nr=!1,O7=typeof WeakSet=="function"?WeakSet:Set,ie=null;function Ya(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){St(e,t,n)}else r.current=null}function Uv(e,t,r){try{r()}catch(n){St(e,t,n)}}var o_=!1;function j7(e,t){if(jv=Rd,e=W$(),u0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var a=0,l=-1,c=-1,u=0,d=0,p=e,h=null;t:for(;;){for(var m;p!==r||o!==0&&p.nodeType!==3||(l=a+o),p!==i||n!==0&&p.nodeType!==3||(c=a+n),p.nodeType===3&&(a+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===r&&++u===o&&(l=a),h===i&&++d===n&&(c=a),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Cv={focusedElem:e,selectionRange:r},Rd=!1,ie=t;ie!==null;)if(t=ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ie=e;else for(;ie!==null;){t=ie;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,b=v.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:vn(t.type,g),b);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(w){St(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ie=e;break}ie=t.return}return v=o_,o_=!1,v}function Tl(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Uv(t,r,i)}o=o.next}while(o!==n)}}function qh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Wv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function V2(e){var t=e.alternate;t!==null&&(e.alternate=null,V2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Qn],delete t[ec],delete t[kv],delete t[l7],delete t[c7])),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 B2(e){return e.tag===5||e.tag===3||e.tag===4}function i_(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||B2(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 Hv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Dd));else if(n!==4&&(e=e.child,e!==null))for(Hv(e,t,r),e=e.sibling;e!==null;)Hv(e,t,r),e=e.sibling}function Gv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Gv(e,t,r),e=e.sibling;e!==null;)Gv(e,t,r),e=e.sibling}var Qt=null,yn=!1;function qo(e,t,r){for(r=r.child;r!==null;)U2(e,t,r),r=r.sibling}function U2(e,t,r){if(Xn&&typeof Xn.onCommitFiberUnmount=="function")try{Xn.onCommitFiberUnmount(zh,r)}catch{}switch(r.tag){case 5:nr||Ya(r,t);case 6:var n=Qt,o=yn;Qt=null,qo(e,t,r),Qt=n,yn=o,Qt!==null&&(yn?(e=Qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Qt.removeChild(r.stateNode));break;case 18:Qt!==null&&(yn?(e=Qt,r=r.stateNode,e.nodeType===8?ng(e.parentNode,r):e.nodeType===1&&ng(e,r),Kl(e)):ng(Qt,r.stateNode));break;case 4:n=Qt,o=yn,Qt=r.stateNode.containerInfo,yn=!0,qo(e,t,r),Qt=n,yn=o;break;case 0:case 11:case 14:case 15:if(!nr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Uv(r,t,a),o=o.next}while(o!==n)}qo(e,t,r);break;case 1:if(!nr&&(Ya(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){St(r,t,l)}qo(e,t,r);break;case 21:qo(e,t,r);break;case 22:r.mode&1?(nr=(n=nr)||r.memoizedState!==null,qo(e,t,r),nr=n):qo(e,t,r);break;default:qo(e,t,r)}}function a_(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new O7),t.forEach(function(n){var o=N7.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function mn(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var o=r[n];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:Qt=l.stateNode,yn=!1;break e;case 3:Qt=l.stateNode.containerInfo,yn=!0;break e;case 4:Qt=l.stateNode.containerInfo,yn=!0;break e}l=l.return}if(Qt===null)throw Error(G(160));U2(i,a,o),Qt=null,yn=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){St(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)W2(t,e),t=t.sibling}function W2(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mn(t,e),Fn(e),n&4){try{Tl(3,e,e.return),qh(3,e)}catch(g){St(e,e.return,g)}try{Tl(5,e,e.return)}catch(g){St(e,e.return,g)}}break;case 1:mn(t,e),Fn(e),n&512&&r!==null&&Ya(r,r.return);break;case 5:if(mn(t,e),Fn(e),n&512&&r!==null&&Ya(r,r.return),e.flags&32){var o=e.stateNode;try{Hl(o,"")}catch(g){St(e,e.return,g)}}if(n&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&d$(o,i),gv(l,a);var u=gv(l,i);for(a=0;a<c.length;a+=2){var d=c[a],p=c[a+1];d==="style"?g$(o,p):d==="dangerouslySetInnerHTML"?h$(o,p):d==="children"?Hl(o,p):Xy(o,d,p,u)}switch(l){case"input":dv(o,i);break;case"textarea":f$(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?rs(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?rs(o,!!i.multiple,i.defaultValue,!0):rs(o,!!i.multiple,i.multiple?[]:"",!1))}o[ec]=i}catch(g){St(e,e.return,g)}}break;case 6:if(mn(t,e),Fn(e),n&4){if(e.stateNode===null)throw Error(G(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){St(e,e.return,g)}}break;case 3:if(mn(t,e),Fn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Kl(t.containerInfo)}catch(g){St(e,e.return,g)}break;case 4:mn(t,e),Fn(e);break;case 13:mn(t,e),Fn(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(k0=kt())),n&4&&a_(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(nr=(u=nr)||d,mn(t,e),nr=u):mn(t,e),Fn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ie=e,d=e.child;d!==null;){for(p=ie=d;ie!==null;){switch(h=ie,m=h.child,h.tag){case 0:case 11:case 14:case 15:Tl(4,h,h.return);break;case 1:Ya(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){St(n,r,g)}}break;case 5:Ya(h,h.return);break;case 22:if(h.memoizedState!==null){l_(p);continue}}m!==null?(m.return=h,ie=m):l_(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{o=p.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=p.stateNode,c=p.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=m$("display",a))}catch(g){St(e,e.return,g)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(g){St(e,e.return,g)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:mn(t,e),Fn(e),n&4&&a_(e);break;case 21:break;default:mn(t,e),Fn(e)}}function Fn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(B2(r)){var n=r;break e}r=r.return}throw Error(G(160))}switch(n.tag){case 5:var o=n.stateNode;n.flags&32&&(Hl(o,""),n.flags&=-33);var i=i_(e);Gv(e,i,o);break;case 3:case 4:var a=n.stateNode.containerInfo,l=i_(e);Hv(e,l,a);break;default:throw Error(G(161))}}catch(c){St(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function C7(e,t,r){ie=e,H2(e)}function H2(e,t,r){for(var n=(e.mode&1)!==0;ie!==null;){var o=ie,i=o.child;if(o.tag===22&&n){var a=o.memoizedState!==null||yu;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||nr;l=yu;var u=nr;if(yu=a,(nr=c)&&!u)for(ie=o;ie!==null;)a=ie,c=a.child,a.tag===22&&a.memoizedState!==null?c_(o):c!==null?(c.return=a,ie=c):c_(o);for(;i!==null;)ie=i,H2(i),i=i.sibling;ie=o,yu=l,nr=u}s_(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ie=i):s_(e)}}function s_(e){for(;ie!==null;){var t=ie;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:nr||qh(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!nr)if(r===null)n.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:vn(t.type,r.memoizedProps);n.componentDidUpdate(o,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ww(t,i,n);break;case 3:var a=t.updateQueue;if(a!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ww(t,a,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.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 p=d.dehydrated;p!==null&&Kl(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}nr||t.flags&512&&Wv(t)}catch(h){St(t,t.return,h)}}if(t===e){ie=null;break}if(r=t.sibling,r!==null){r.return=t.return,ie=r;break}ie=t.return}}function l_(e){for(;ie!==null;){var t=ie;if(t===e){ie=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ie=r;break}ie=t.return}}function c_(e){for(;ie!==null;){var t=ie;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{qh(4,t)}catch(c){St(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var o=t.return;try{n.componentDidMount()}catch(c){St(t,o,c)}}var i=t.return;try{Wv(t)}catch(c){St(t,i,c)}break;case 5:var a=t.return;try{Wv(t)}catch(c){St(t,a,c)}}}catch(c){St(t,t.return,c)}if(t===e){ie=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ie=l;break}ie=t.return}}var E7=Math.ceil,Hd=No.ReactCurrentDispatcher,E0=No.ReactCurrentOwner,an=No.ReactCurrentBatchConfig,Ne=0,Ut=null,Dt=null,Xt=0,Lr=0,Xa=Pi(0),zt=0,ac=null,ra=0,Qh=0,$0=0,Il=null,Sr=null,k0=0,xs=1/0,po=null,Gd=!1,qv=null,fi=null,xu=!1,oi=null,qd=0,Dl=0,Qv=null,dd=-1,fd=0;function fr(){return Ne&6?kt():dd!==-1?dd:dd=kt()}function pi(e){return e.mode&1?Ne&2&&Xt!==0?Xt&-Xt:d7.transition!==null?(fd===0&&(fd=E$()),fd):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:N$(e.type)),e):1}function Sn(e,t,r,n){if(50<Dl)throw Dl=0,Qv=null,Error(G(185));_c(e,r,n),(!(Ne&2)||e!==Ut)&&(e===Ut&&(!(Ne&2)&&(Qh|=r),zt===4&&ri(e,Xt)),Er(e,n),r===1&&Ne===0&&!(t.mode&1)&&(xs=kt()+500,Wh&&Oi()))}function Er(e,t){var r=e.callbackNode;dz(e,t);var n=kd(e,e===Ut?Xt:0);if(n===0)r!==null&&yw(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&yw(r),t===1)e.tag===0?u7(u_.bind(null,e)):e2(u_.bind(null,e)),a7(function(){!(Ne&6)&&Oi()}),r=null;else{switch($$(n)){case 1:r=r0;break;case 4:r=j$;break;case 16:r=$d;break;case 536870912:r=C$;break;default:r=$d}r=Z2(r,G2.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function G2(e,t){if(dd=-1,fd=0,Ne&6)throw Error(G(327));var r=e.callbackNode;if(ss()&&e.callbackNode!==r)return null;var n=kd(e,e===Ut?Xt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Qd(e,n);else{t=n;var o=Ne;Ne|=2;var i=Q2();(Ut!==e||Xt!==t)&&(po=null,xs=kt()+500,Qi(e,t));do try{R7();break}catch(l){q2(e,l)}while(1);m0(),Hd.current=i,Ne=o,Dt!==null?t=0:(Ut=null,Xt=0,t=zt)}if(t!==0){if(t===2&&(o=_v(e),o!==0&&(n=o,t=Kv(e,o))),t===1)throw r=ac,Qi(e,0),ri(e,n),Er(e,kt()),r;if(t===6)ri(e,n);else{if(o=e.current.alternate,!(n&30)&&!$7(o)&&(t=Qd(e,n),t===2&&(i=_v(e),i!==0&&(n=i,t=Kv(e,i))),t===1))throw r=ac,Qi(e,0),ri(e,n),Er(e,kt()),r;switch(e.finishedWork=o,e.finishedLanes=n,t){case 0:case 1:throw Error(G(345));case 2:Li(e,Sr,po);break;case 3:if(ri(e,n),(n&130023424)===n&&(t=k0+500-kt(),10<t)){if(kd(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){fr(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=$v(Li.bind(null,e,Sr,po),t);break}Li(e,Sr,po);break;case 4:if(ri(e,n),(n&4194240)===n)break;for(t=e.eventTimes,o=-1;0<n;){var a=31-bn(n);i=1<<a,a=t[a],a>o&&(o=a),n&=~i}if(n=o,n=kt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*E7(n/1960))-n,10<n){e.timeoutHandle=$v(Li.bind(null,e,Sr,po),n);break}Li(e,Sr,po);break;case 5:Li(e,Sr,po);break;default:throw Error(G(329))}}}return Er(e,kt()),e.callbackNode===r?G2.bind(null,e):null}function Kv(e,t){var r=Il;return e.current.memoizedState.isDehydrated&&(Qi(e,t).flags|=256),e=Qd(e,t),e!==2&&(t=Sr,Sr=r,t!==null&&Yv(t)),e}function Yv(e){Sr===null?Sr=e:Sr.push.apply(Sr,e)}function $7(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var o=r[n],i=o.getSnapshot;o=o.value;try{if(!Pn(i(),o))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 ri(e,t){for(t&=~$0,t&=~Qh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-bn(t),n=1<<r;e[r]=-1,t&=~n}}function u_(e){if(Ne&6)throw Error(G(327));ss();var t=kd(e,0);if(!(t&1))return Er(e,kt()),null;var r=Qd(e,t);if(e.tag!==0&&r===2){var n=_v(e);n!==0&&(t=n,r=Kv(e,n))}if(r===1)throw r=ac,Qi(e,0),ri(e,t),Er(e,kt()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Li(e,Sr,po),Er(e,kt()),null}function R0(e,t){var r=Ne;Ne|=1;try{return e(t)}finally{Ne=r,Ne===0&&(xs=kt()+500,Wh&&Oi())}}function na(e){oi!==null&&oi.tag===0&&!(Ne&6)&&ss();var t=Ne;Ne|=1;var r=an.transition,n=Ge;try{if(an.transition=null,Ge=1,e)return e()}finally{Ge=n,an.transition=r,Ne=t,!(Ne&6)&&Oi()}}function T0(){Lr=Xa.current,at(Xa)}function Qi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,i7(r)),Dt!==null)for(r=Dt.return;r!==null;){var n=r;switch(f0(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Nd();break;case 3:vs(),at(jr),at(sr),_0();break;case 5:w0(n);break;case 4:vs();break;case 13:at(yt);break;case 19:at(yt);break;case 10:g0(n.type._context);break;case 22:case 23:T0()}r=r.return}if(Ut=e,Dt=e=hi(e.current,null),Xt=Lr=t,zt=0,ac=null,$0=Qh=ra=0,Sr=Il=null,Wi!==null){for(t=0;t<Wi.length;t++)if(r=Wi[t],n=r.interleaved,n!==null){r.interleaved=null;var o=n.next,i=r.pending;if(i!==null){var a=i.next;i.next=o,n.next=a}r.pending=n}Wi=null}return e}function q2(e,t){do{var r=Dt;try{if(m0(),ld.current=Wd,Ud){for(var n=xt.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}Ud=!1}if(ta=0,Vt=Lt=xt=null,Rl=!1,nc=0,E0.current=null,r===null||r.return===null){zt=1,ac=t,Dt=null;break}e:{var i=e,a=r.return,l=r,c=t;if(t=Xt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Xw(a);if(m!==null){m.flags&=-257,Jw(m,a,l,i,t),m.mode&1&&Yw(i,u,t),t=m,c=u;var v=t.updateQueue;if(v===null){var g=new Set;g.add(c),t.updateQueue=g}else v.add(c);break e}else{if(!(t&1)){Yw(i,u,t),I0();break e}c=Error(G(426))}}else if(ut&&l.mode&1){var b=Xw(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Jw(b,a,l,i,t),p0(ys(c,l));break e}}i=c=ys(c,l),zt!==4&&(zt=2),Il===null?Il=[i]:Il.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=k2(i,c,t);Uw(i,y);break e;case 1:l=c;var x=i.type,_=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(fi===null||!fi.has(_)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=R2(i,l,t);Uw(i,w);break e}}i=i.return}while(i!==null)}Y2(r)}catch(j){t=j,Dt===r&&r!==null&&(Dt=r=r.return);continue}break}while(1)}function Q2(){var e=Hd.current;return Hd.current=Wd,e===null?Wd:e}function I0(){(zt===0||zt===3||zt===2)&&(zt=4),Ut===null||!(ra&268435455)&&!(Qh&268435455)||ri(Ut,Xt)}function Qd(e,t){var r=Ne;Ne|=2;var n=Q2();(Ut!==e||Xt!==t)&&(po=null,Qi(e,t));do try{k7();break}catch(o){q2(e,o)}while(1);if(m0(),Ne=r,Hd.current=n,Dt!==null)throw Error(G(261));return Ut=null,Xt=0,zt}function k7(){for(;Dt!==null;)K2(Dt)}function R7(){for(;Dt!==null&&!rz();)K2(Dt)}function K2(e){var t=J2(e.alternate,e,Lr);e.memoizedProps=e.pendingProps,t===null?Y2(e):Dt=t,E0.current=null}function Y2(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=P7(r,t),r!==null){r.flags&=32767,Dt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{zt=6,Dt=null;return}}else if(r=S7(r,t,Lr),r!==null){Dt=r;return}if(t=t.sibling,t!==null){Dt=t;return}Dt=t=e}while(t!==null);zt===0&&(zt=5)}function Li(e,t,r){var n=Ge,o=an.transition;try{an.transition=null,Ge=1,T7(e,t,r,n)}finally{an.transition=o,Ge=n}return null}function T7(e,t,r,n){do ss();while(oi!==null);if(Ne&6)throw Error(G(327));r=e.finishedWork;var o=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(fz(e,i),e===Ut&&(Dt=Ut=null,Xt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||xu||(xu=!0,Z2($d,function(){return ss(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=an.transition,an.transition=null;var a=Ge;Ge=1;var l=Ne;Ne|=4,E0.current=null,j7(e,r),W2(r,e),Jz(Cv),Rd=!!jv,Cv=jv=null,e.current=r,C7(r),nz(),Ne=l,Ge=a,an.transition=i}else e.current=r;if(xu&&(xu=!1,oi=e,qd=o),i=e.pendingLanes,i===0&&(fi=null),az(r.stateNode),Er(e,kt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],n(o.value,{componentStack:o.stack,digest:o.digest});if(Gd)throw Gd=!1,e=qv,qv=null,e;return qd&1&&e.tag!==0&&ss(),i=e.pendingLanes,i&1?e===Qv?Dl++:(Dl=0,Qv=e):Dl=0,Oi(),null}function ss(){if(oi!==null){var e=$$(qd),t=an.transition,r=Ge;try{if(an.transition=null,Ge=16>e?16:e,oi===null)var n=!1;else{if(e=oi,oi=null,qd=0,Ne&6)throw Error(G(331));var o=Ne;for(Ne|=4,ie=e.current;ie!==null;){var i=ie,a=i.child;if(ie.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ie=u;ie!==null;){var d=ie;switch(d.tag){case 0:case 11:case 15:Tl(8,d,i)}var p=d.child;if(p!==null)p.return=d,ie=p;else for(;ie!==null;){d=ie;var h=d.sibling,m=d.return;if(V2(d),d===u){ie=null;break}if(h!==null){h.return=m,ie=h;break}ie=m}}}var v=i.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}ie=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,ie=a;else e:for(;ie!==null;){if(i=ie,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Tl(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ie=y;break e}ie=i.return}}var x=e.current;for(ie=x;ie!==null;){a=ie;var _=a.child;if(a.subtreeFlags&2064&&_!==null)_.return=a,ie=_;else e:for(a=x;ie!==null;){if(l=ie,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:qh(9,l)}}catch(j){St(l,l.return,j)}if(l===a){ie=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ie=w;break e}ie=l.return}}if(Ne=o,Oi(),Xn&&typeof Xn.onPostCommitFiberRoot=="function")try{Xn.onPostCommitFiberRoot(zh,e)}catch{}n=!0}return n}finally{Ge=r,an.transition=t}}return!1}function d_(e,t,r){t=ys(r,t),t=k2(e,t,1),e=di(e,t,1),t=fr(),e!==null&&(_c(e,1,t),Er(e,t))}function St(e,t,r){if(e.tag===3)d_(e,e,r);else for(;t!==null;){if(t.tag===3){d_(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(fi===null||!fi.has(n))){e=ys(r,e),e=R2(t,e,1),t=di(t,e,1),e=fr(),t!==null&&(_c(t,1,e),Er(t,e));break}}t=t.return}}function I7(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=fr(),e.pingedLanes|=e.suspendedLanes&r,Ut===e&&(Xt&r)===r&&(zt===4||zt===3&&(Xt&130023424)===Xt&&500>kt()-k0?Qi(e,0):$0|=r),Er(e,t)}function X2(e,t){t===0&&(e.mode&1?(t=cu,cu<<=1,!(cu&130023424)&&(cu=4194304)):t=1);var r=fr();e=jo(e,t),e!==null&&(_c(e,t,r),Er(e,r))}function D7(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),X2(e,r)}function N7(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(G(314))}n!==null&&n.delete(t),X2(e,r)}var J2;J2=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||jr.current)Pr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Pr=!1,b7(e,t,r);Pr=!!(e.flags&131072)}else Pr=!1,ut&&t.flags&1048576&&t2(t,Ld,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;ud(e,t),e=t.pendingProps;var o=hs(t,sr.current);as(t,r),o=S0(null,t,n,e,o,r);var i=P0();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,Cr(n)?(i=!0,Ad(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,y0(t),o.updater=Hh,t.stateNode=o,o._reactInternals=t,Av(t,n,e,r),t=zv(null,t,n,!0,i,r)):(t.tag=0,ut&&i&&d0(t),ur(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(ud(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=M7(n),e=vn(n,e),o){case 0:t=Lv(null,t,n,e,r);break e;case 1:t=t_(null,t,n,e,r);break e;case 11:t=Zw(null,t,n,e,r);break e;case 14:t=e_(null,t,n,vn(n.type,e),r);break e}throw Error(G(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:vn(n,o),Lv(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:vn(n,o),t_(e,t,n,o,r);case 3:e:{if(N2(t),e===null)throw Error(G(387));n=t.pendingProps,i=t.memoizedState,o=i.element,i2(e,t),Vd(t,n,null,r);var a=t.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ys(Error(G(423)),t),t=r_(e,t,n,r,o);break e}else if(n!==o){o=ys(Error(G(424)),t),t=r_(e,t,n,r,o);break e}else for(Fr=ui(t.stateNode.containerInfo.firstChild),Br=t,ut=!0,wn=null,r=c2(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ms(),n===o){t=Co(e,t,r);break e}ur(e,t,n,r)}t=t.child}return t;case 5:return u2(t),e===null&&Iv(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Ev(n,o)?a=null:i!==null&&Ev(n,i)&&(t.flags|=32),D2(e,t),ur(e,t,a,r),t.child;case 6:return e===null&&Iv(t),null;case 13:return A2(e,t,r);case 4:return x0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=gs(t,null,n,r):ur(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:vn(n,o),Zw(e,t,n,o,r);case 7:return ur(e,t,t.pendingProps,r),t.child;case 8:return ur(e,t,t.pendingProps.children,r),t.child;case 12:return ur(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Ze(zd,n._currentValue),n._currentValue=a,i!==null)if(Pn(i.value,a)){if(i.children===o.children&&!jr.current){t=Co(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=xo(-1,r&-r),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|=r,c=i.alternate,c!==null&&(c.lanes|=r),Dv(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(G(341));a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Dv(a,r,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}ur(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,as(t,r),o=cn(o),n=n(o),t.flags|=1,ur(e,t,n,r),t.child;case 14:return n=t.type,o=vn(n,t.pendingProps),o=vn(n.type,o),e_(e,t,n,o,r);case 15:return T2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:vn(n,o),ud(e,t),t.tag=1,Cr(n)?(e=!0,Ad(t)):e=!1,as(t,r),s2(t,n,o),Av(t,n,o,r),zv(null,t,n,!0,e,r);case 19:return M2(e,t,r);case 22:return I2(e,t,r)}throw Error(G(156,t.tag))};function Z2(e,t){return O$(e,t)}function A7(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(e,t,r,n){return new A7(e,t,r,n)}function D0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function M7(e){if(typeof e=="function")return D0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zy)return 11;if(e===e0)return 14}return 2}function hi(e,t){var r=e.alternate;return r===null?(r=rn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function pd(e,t,r,n,o,i){var a=2;if(n=e,typeof e=="function")D0(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Va:return Ki(r.children,o,i,t);case Jy:a=8,o|=8;break;case av:return e=rn(12,r,t,o|2),e.elementType=av,e.lanes=i,e;case sv:return e=rn(13,r,t,o),e.elementType=sv,e.lanes=i,e;case lv:return e=rn(19,r,t,o),e.elementType=lv,e.lanes=i,e;case l$:return Kh(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case a$:a=10;break e;case s$:a=9;break e;case Zy:a=11;break e;case e0:a=14;break e;case Xo:a=16,n=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=rn(a,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function Ki(e,t,r,n){return e=rn(7,e,n,t),e.lanes=r,e}function Kh(e,t,r,n){return e=rn(22,e,n,t),e.elementType=l$,e.lanes=r,e.stateNode={isHidden:!1},e}function dg(e,t,r){return e=rn(6,e,null,t),e.lanes=r,e}function fg(e,t,r){return t=rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function L7(e,t,r,n,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=Gm(0),this.expirationTimes=Gm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gm(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function N0(e,t,r,n,o,i,a,l,c){return e=new L7(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=rn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},y0(i),e}function z7(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Fa,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function ek(e){if(!e)return vi;e=e._reactInternals;e:{if(pa(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Cr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var r=e.type;if(Cr(r))return Z$(e,r,t)}return t}function tk(e,t,r,n,o,i,a,l,c){return e=N0(r,n,!0,e,o,i,a,l,c),e.context=ek(null),r=e.current,n=fr(),o=pi(r),i=xo(n,o),i.callback=t??null,di(r,i,o),e.current.lanes=o,_c(e,o,n),Er(e,n),e}function Yh(e,t,r,n){var o=t.current,i=fr(),a=pi(o);return r=ek(r),t.context===null?t.context=r:t.pendingContext=r,t=xo(i,a),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=di(o,t,a),e!==null&&(Sn(e,o,a,i),sd(e,o,a)),a}function Kd(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 f_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function A0(e,t){f_(e,t),(e=e.alternate)&&f_(e,t)}function F7(){return null}var rk=typeof reportError=="function"?reportError:function(e){console.error(e)};function M0(e){this._internalRoot=e}Xh.prototype.render=M0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Yh(e,t,null,null)};Xh.prototype.unmount=M0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;na(function(){Yh(null,e,null,null)}),t[Oo]=null}};function Xh(e){this._internalRoot=e}Xh.prototype.unstable_scheduleHydration=function(e){if(e){var t=T$();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ti.length&&t!==0&&t<ti[r].priority;r++);ti.splice(r,0,e),r===0&&D$(e)}};function L0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Jh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function p_(){}function V7(e,t,r,n,o){if(o){if(typeof n=="function"){var i=n;n=function(){var u=Kd(a);i.call(u)}}var a=tk(t,n,e,0,null,!1,!1,"",p_);return e._reactRootContainer=a,e[Oo]=a.current,Jl(e.nodeType===8?e.parentNode:e),na(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof n=="function"){var l=n;n=function(){var u=Kd(c);l.call(u)}}var c=N0(e,0,!1,null,null,!1,!1,"",p_);return e._reactRootContainer=c,e[Oo]=c.current,Jl(e.nodeType===8?e.parentNode:e),na(function(){Yh(t,c,r,n)}),c}function Zh(e,t,r,n,o){var i=r._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var l=o;o=function(){var c=Kd(a);l.call(c)}}Yh(t,a,e,o)}else a=V7(r,t,e,o,n);return Kd(a)}k$=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=wl(t.pendingLanes);r!==0&&(n0(t,r|1),Er(t,kt()),!(Ne&6)&&(xs=kt()+500,Oi()))}break;case 13:na(function(){var n=jo(e,1);if(n!==null){var o=fr();Sn(n,e,1,o)}}),A0(e,1)}};o0=function(e){if(e.tag===13){var t=jo(e,134217728);if(t!==null){var r=fr();Sn(t,e,134217728,r)}A0(e,134217728)}};R$=function(e){if(e.tag===13){var t=pi(e),r=jo(e,t);if(r!==null){var n=fr();Sn(r,e,t,n)}A0(e,t)}};T$=function(){return Ge};I$=function(e,t){var r=Ge;try{return Ge=e,t()}finally{Ge=r}};yv=function(e,t,r){switch(t){case"input":if(dv(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var o=Uh(n);if(!o)throw Error(G(90));u$(n),dv(n,o)}}}break;case"textarea":f$(e,r);break;case"select":t=r.value,t!=null&&rs(e,!!r.multiple,t,!1)}};x$=R0;w$=na;var B7={usingClientEntryPoint:!1,Events:[Sc,Ha,Uh,v$,y$,R0]},rl={findFiberByHostInstance:Ui,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},U7={bundleType:rl.bundleType,version:rl.version,rendererPackageName:rl.rendererPackageName,rendererConfig:rl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:No.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=S$(e),e===null?null:e.stateNode},findFiberByHostInstance:rl.findFiberByHostInstance||F7,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 wu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wu.isDisabled&&wu.supportsFiber)try{zh=wu.inject(U7),Xn=wu}catch{}}Gr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B7;Gr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!L0(t))throw Error(G(200));return z7(e,t,null,r)};Gr.createRoot=function(e,t){if(!L0(e))throw Error(G(299));var r=!1,n="",o=rk;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=N0(e,1,!1,null,null,r,!1,n,o),e[Oo]=t.current,Jl(e.nodeType===8?e.parentNode:e),new M0(t)};Gr.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(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=S$(t),e=e===null?null:e.stateNode,e};Gr.flushSync=function(e){return na(e)};Gr.hydrate=function(e,t,r){if(!Jh(t))throw Error(G(200));return Zh(null,e,t,!0,r)};Gr.hydrateRoot=function(e,t,r){if(!L0(e))throw Error(G(405));var n=r!=null&&r.hydratedSources||null,o=!1,i="",a=rk;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(a=r.onRecoverableError)),t=tk(t,null,e,1,r??null,o,!1,i,a),e[Oo]=t.current,Jl(e),n)for(e=0;e<n.length;e++)r=n[e],o=r._getVersion,o=o(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new Xh(t)};Gr.render=function(e,t,r){if(!Jh(t))throw Error(G(200));return Zh(null,e,t,!1,r)};Gr.unmountComponentAtNode=function(e){if(!Jh(e))throw Error(G(40));return e._reactRootContainer?(na(function(){Zh(null,null,e,!1,function(){e._reactRootContainer=null,e[Oo]=null})}),!0):!1};Gr.unstable_batchedUpdates=R0;Gr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Jh(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Zh(e,t,r,!1,n)};Gr.version="18.2.0-next-9e3b772b8-20220608";function nk(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nk)}catch(e){console.error(e)}}nk(),t$.exports=Gr;var Oc=t$.exports;const pg=Dy(Oc);var W7=Object.defineProperty,H7=Object.defineProperties,G7=Object.getOwnPropertyDescriptors,h_=Object.getOwnPropertySymbols,q7=Object.prototype.hasOwnProperty,Q7=Object.prototype.propertyIsEnumerable,m_=(e,t,r)=>t in e?W7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xv=(e,t)=>{for(var r in t||(t={}))q7.call(t,r)&&m_(e,r,t[r]);if(h_)for(var r of h_(t))Q7.call(t,r)&&m_(e,r,t[r]);return e},g_=(e,t)=>H7(e,G7(t));const K7=["subtle","filled","outline","light","default","transparent","gradient"],_u={xs:O(18),sm:O(22),md:O(28),lg:O(34),xl:O(44)};function Y7({variant:e,theme:t,color:r,gradient:n}){const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:K7.includes(e)?Xv({border:`${O(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var X7=W((e,{radius:t,color:r,gradient:n},{variant:o,size:i})=>({root:g_(Xv({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:A({size:i,sizes:_u}),minHeight:A({size:i,sizes:_u}),width:A({size:i,sizes:_u}),minWidth:A({size:i,sizes:_u})},Y7({variant:o,theme:e,color:r,gradient:n})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":g_(Xv({content:'""'},e.fn.cover(O(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const J7=X7;var Z7=Object.defineProperty,Yd=Object.getOwnPropertySymbols,ok=Object.prototype.hasOwnProperty,ik=Object.prototype.propertyIsEnumerable,v_=(e,t,r)=>t in e?Z7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y_=(e,t)=>{for(var r in t||(t={}))ok.call(t,r)&&v_(e,r,t[r]);if(Yd)for(var r of Yd(t))ik.call(t,r)&&v_(e,r,t[r]);return e},x_=(e,t)=>{var r={};for(var n in e)ok.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yd)for(var n of Yd(e))t.indexOf(n)<0&&ik.call(e,n)&&(r[n]=e[n]);return r};function e8(e){var t=e,{size:r,color:n}=t,o=x_(t,["size","color"]);const i=o,{style:a}=i,l=x_(i,["style"]);return S.createElement("svg",y_({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:n,style:y_({width:r},a)},l),S.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var t8=Object.defineProperty,Xd=Object.getOwnPropertySymbols,ak=Object.prototype.hasOwnProperty,sk=Object.prototype.propertyIsEnumerable,w_=(e,t,r)=>t in e?t8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__=(e,t)=>{for(var r in t||(t={}))ak.call(t,r)&&w_(e,r,t[r]);if(Xd)for(var r of Xd(t))sk.call(t,r)&&w_(e,r,t[r]);return e},b_=(e,t)=>{var r={};for(var n in e)ak.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xd)for(var n of Xd(e))t.indexOf(n)<0&&sk.call(e,n)&&(r[n]=e[n]);return r};function r8(e){var t=e,{size:r,color:n}=t,o=b_(t,["size","color"]);const i=o,{style:a}=i,l=b_(i,["style"]);return S.createElement("svg",__({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:n,style:__({width:r,height:r},a)},l),S.createElement("g",{fill:"none",fillRule:"evenodd"},S.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},S.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),S.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},S.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var n8=Object.defineProperty,Jd=Object.getOwnPropertySymbols,lk=Object.prototype.hasOwnProperty,ck=Object.prototype.propertyIsEnumerable,S_=(e,t,r)=>t in e?n8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P_=(e,t)=>{for(var r in t||(t={}))lk.call(t,r)&&S_(e,r,t[r]);if(Jd)for(var r of Jd(t))ck.call(t,r)&&S_(e,r,t[r]);return e},O_=(e,t)=>{var r={};for(var n in e)lk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Jd)for(var n of Jd(e))t.indexOf(n)<0&&ck.call(e,n)&&(r[n]=e[n]);return r};function o8(e){var t=e,{size:r,color:n}=t,o=O_(t,["size","color"]);const i=o,{style:a}=i,l=O_(i,["style"]);return S.createElement("svg",P_({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:n,style:P_({width:r},a)},l),S.createElement("circle",{cx:"15",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},S.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"105",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var i8=Object.defineProperty,Zd=Object.getOwnPropertySymbols,uk=Object.prototype.hasOwnProperty,dk=Object.prototype.propertyIsEnumerable,j_=(e,t,r)=>t in e?i8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a8=(e,t)=>{for(var r in t||(t={}))uk.call(t,r)&&j_(e,r,t[r]);if(Zd)for(var r of Zd(t))dk.call(t,r)&&j_(e,r,t[r]);return e},s8=(e,t)=>{var r={};for(var n in e)uk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zd)for(var n of Zd(e))t.indexOf(n)<0&&dk.call(e,n)&&(r[n]=e[n]);return r};const hg={bars:e8,oval:r8,dots:o8},l8={xs:O(18),sm:O(22),md:O(36),lg:O(44),xl:O(58)},c8={size:"md"};function dn(e){const t=H("Loader",c8,e),{size:r,color:n,variant:o}=t,i=s8(t,["size","color","variant"]),a=Zt(),l=o in hg?o:a.loader;return S.createElement(oe,a8({role:"presentation",component:hg[l]||hg.bars,size:A({size:r,sizes:l8}),color:a.fn.variant({variant:"filled",primaryFallback:!1,color:n||a.primaryColor}).background},i))}dn.displayName="@mantine/core/Loader";var u8=Object.defineProperty,ef=Object.getOwnPropertySymbols,fk=Object.prototype.hasOwnProperty,pk=Object.prototype.propertyIsEnumerable,C_=(e,t,r)=>t in e?u8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E_=(e,t)=>{for(var r in t||(t={}))fk.call(t,r)&&C_(e,r,t[r]);if(ef)for(var r of ef(t))pk.call(t,r)&&C_(e,r,t[r]);return e},d8=(e,t)=>{var r={};for(var n in e)fk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ef)for(var n of ef(e))t.indexOf(n)<0&&pk.call(e,n)&&(r[n]=e[n]);return r};const f8={color:"gray",size:"md",variant:"subtle"},hk=f.forwardRef((e,t)=>{const r=H("ActionIcon",f8,e),{className:n,color:o,children:i,radius:a,size:l,variant:c,gradient:u,disabled:d,loaderProps:p,loading:h,unstyled:m,__staticSelector:v}=r,g=d8(r,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:b,cx:y,theme:x}=J7({radius:a,color:o,gradient:u},{name:["ActionIcon",v],unstyled:m,size:l,variant:c}),_=S.createElement(dn,E_({color:x.fn.variant({color:o,variant:c}).color,size:"100%","data-action-icon-loader":!0},p));return S.createElement(So,E_({className:y(b.root,n),ref:t,disabled:d,"data-disabled":d||void 0,"data-loading":h||void 0,unstyled:m},g),h?_:i)});hk.displayName="@mantine/core/ActionIcon";const pr=hk;var p8=Object.defineProperty,h8=Object.defineProperties,m8=Object.getOwnPropertyDescriptors,tf=Object.getOwnPropertySymbols,mk=Object.prototype.hasOwnProperty,gk=Object.prototype.propertyIsEnumerable,$_=(e,t,r)=>t in e?p8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,g8=(e,t)=>{for(var r in t||(t={}))mk.call(t,r)&&$_(e,r,t[r]);if(tf)for(var r of tf(t))gk.call(t,r)&&$_(e,r,t[r]);return e},v8=(e,t)=>h8(e,m8(t)),y8=(e,t)=>{var r={};for(var n in e)mk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tf)for(var n of tf(e))t.indexOf(n)<0&&gk.call(e,n)&&(r[n]=e[n]);return r};function z0(e){const t=H("Portal",{},e),{children:r,target:n,className:o,innerRef:i}=t,a=y8(t,["children","target","className","innerRef"]),l=Zt(),[c,u]=f.useState(!1),d=f.useRef();return UE(()=>(u(!0),d.current=n?typeof n=="string"?document.querySelector(n):n:document.createElement("div"),n||document.body.appendChild(d.current),()=>{!n&&document.body.removeChild(d.current)}),[n]),c?Oc.createPortal(S.createElement("div",v8(g8({className:o,dir:l.dir},a),{ref:i}),r),d.current):null}z0.displayName="@mantine/core/Portal";var x8=Object.defineProperty,rf=Object.getOwnPropertySymbols,vk=Object.prototype.hasOwnProperty,yk=Object.prototype.propertyIsEnumerable,k_=(e,t,r)=>t in e?x8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w8=(e,t)=>{for(var r in t||(t={}))vk.call(t,r)&&k_(e,r,t[r]);if(rf)for(var r of rf(t))yk.call(t,r)&&k_(e,r,t[r]);return e},_8=(e,t)=>{var r={};for(var n in e)vk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rf)for(var n of rf(e))t.indexOf(n)<0&&yk.call(e,n)&&(r[n]=e[n]);return r};function Ns(e){var t=e,{withinPortal:r=!0,children:n}=t,o=_8(t,["withinPortal","children"]);return r?S.createElement(z0,w8({},o),n):S.createElement(S.Fragment,null,n)}Ns.displayName="@mantine/core/OptionalPortal";var b8=Object.defineProperty,S8=Object.defineProperties,P8=Object.getOwnPropertyDescriptors,R_=Object.getOwnPropertySymbols,O8=Object.prototype.hasOwnProperty,j8=Object.prototype.propertyIsEnumerable,T_=(e,t,r)=>t in e?b8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mg=(e,t)=>{for(var r in t||(t={}))O8.call(t,r)&&T_(e,r,t[r]);if(R_)for(var r of R_(t))j8.call(t,r)&&T_(e,r,t[r]);return e},I_=(e,t)=>S8(e,P8(t));function C8({variant:e,color:t,theme:r}){if(e==="filled")return{backgroundColor:r.fn.variant({variant:"filled",color:t}).background,color:r.white};if(e==="outline"){const n=r.fn.variant({variant:"outline",color:t});return{color:n.color,borderColor:n.border,backgroundColor:r.colorScheme==="dark"?r.colors.dark[6]:r.white}}if(e==="light"){const n=r.fn.variant({variant:"light",color:t});return{backgroundColor:n.background,color:n.color}}return null}var E8=W((e,{radius:t,color:r},{variant:n})=>({root:mg(I_(mg({},e.fn.fontStyles()),{position:"relative",overflow:"hidden",paddingTop:e.spacing.sm,paddingBottom:e.spacing.sm,paddingLeft:e.spacing.md,paddingRight:e.spacing.sm,borderRadius:e.fn.radius(t),border:`${O(1)} solid transparent`}),C8({variant:n,color:r,theme:e})),wrapper:{display:"flex"},body:{flex:1},title:{boxSizing:"border-box",margin:0,marginBottom:e.spacing.xs,display:"flex",alignItems:"center",justifyContent:"space-between",lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,fontWeight:700,"&[data-with-close-button]":{paddingRight:e.spacing.md}},label:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},icon:{lineHeight:1,width:O(20),height:O(20),display:"flex",alignItems:"center",justifyContent:"flex-start",marginRight:e.spacing.md,marginTop:1},message:I_(mg({},e.fn.fontStyles()),{lineHeight:e.lineHeight,textOverflow:"ellipsis",overflow:"hidden",fontSize:e.fontSizes.sm,color:n==="filled"?e.white:e.colorScheme==="dark"?n==="light"?e.white:e.colors.dark[0]:e.black}),closeButton:{width:O(10),height:O(10),color:n==="filled"?e.white:e.colorScheme==="dark"?n==="light"?e.white:e.colors.dark[0]:e.black}}));const $8=E8;var k8=Object.defineProperty,nf=Object.getOwnPropertySymbols,xk=Object.prototype.hasOwnProperty,wk=Object.prototype.propertyIsEnumerable,D_=(e,t,r)=>t in e?k8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,N_=(e,t)=>{for(var r in t||(t={}))xk.call(t,r)&&D_(e,r,t[r]);if(nf)for(var r of nf(t))wk.call(t,r)&&D_(e,r,t[r]);return e},R8=(e,t)=>{var r={};for(var n in e)xk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nf)for(var n of nf(e))t.indexOf(n)<0&&wk.call(e,n)&&(r[n]=e[n]);return r};function _k(e){const t=e,{width:r,height:n,style:o}=t,i=R8(t,["width","height","style"]);return S.createElement("svg",N_({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:N_({width:r,height:n},o)},i),S.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"}))}_k.displayName="@mantine/core/CloseIcon";var T8=Object.defineProperty,of=Object.getOwnPropertySymbols,bk=Object.prototype.hasOwnProperty,Sk=Object.prototype.propertyIsEnumerable,A_=(e,t,r)=>t in e?T8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,I8=(e,t)=>{for(var r in t||(t={}))bk.call(t,r)&&A_(e,r,t[r]);if(of)for(var r of of(t))Sk.call(t,r)&&A_(e,r,t[r]);return e},D8=(e,t)=>{var r={};for(var n in e)bk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&of)for(var n of of(e))t.indexOf(n)<0&&Sk.call(e,n)&&(r[n]=e[n]);return r};const N8={xs:O(12),sm:O(16),md:O(20),lg:O(28),xl:O(34)},A8={size:"sm"},Pk=f.forwardRef((e,t)=>{const r=H("CloseButton",A8,e),{iconSize:n,size:o,children:i}=r,a=D8(r,["iconSize","size","children"]),l=O(n||N8[o]);return S.createElement(pr,I8({ref:t,__staticSelector:"CloseButton",size:o},a),i||S.createElement(_k,{width:l,height:l}))});Pk.displayName="@mantine/core/CloseButton";const jc=Pk;var M8=Object.defineProperty,af=Object.getOwnPropertySymbols,Ok=Object.prototype.hasOwnProperty,jk=Object.prototype.propertyIsEnumerable,M_=(e,t,r)=>t in e?M8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L8=(e,t)=>{for(var r in t||(t={}))Ok.call(t,r)&&M_(e,r,t[r]);if(af)for(var r of af(t))jk.call(t,r)&&M_(e,r,t[r]);return e},z8=(e,t)=>{var r={};for(var n in e)Ok.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&af)for(var n of af(e))t.indexOf(n)<0&&jk.call(e,n)&&(r[n]=e[n]);return r};const F8={variant:"light"},Cc=f.forwardRef((e,t)=>{const r=H("Alert",F8,e),{id:n,className:o,title:i,variant:a,children:l,color:c,classNames:u,icon:d,styles:p,onClose:h,radius:m,withCloseButton:v,closeButtonLabel:g,unstyled:b}=r,y=z8(r,["id","className","title","variant","children","color","classNames","icon","styles","onClose","radius","withCloseButton","closeButtonLabel","unstyled"]),{classes:x,cx:_}=$8({color:c,radius:m},{classNames:u,styles:p,unstyled:b,variant:a,name:"Alert"}),w=Ir(n),j=i&&`${w}-title`,C=`${w}-body`;return S.createElement(oe,L8({id:w,role:"alert","aria-labelledby":j,"aria-describedby":C,className:_(x.root,x[a],o),ref:t},y),S.createElement("div",{className:x.wrapper},d&&S.createElement("div",{className:x.icon},d),S.createElement("div",{className:x.body},i&&S.createElement("div",{className:x.title,"data-with-close-button":v||void 0},S.createElement("span",{id:j,className:x.label},i)),S.createElement("div",{id:C,className:x.message},l)),v&&S.createElement(jc,{className:x.closeButton,onClick:h,variant:"transparent",size:16,iconSize:16,"aria-label":g})))});Cc.displayName="@mantine/core/Alert";var V8=Object.defineProperty,B8=Object.defineProperties,U8=Object.getOwnPropertyDescriptors,L_=Object.getOwnPropertySymbols,W8=Object.prototype.hasOwnProperty,H8=Object.prototype.propertyIsEnumerable,z_=(e,t,r)=>t in e?V8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bu=(e,t)=>{for(var r in t||(t={}))W8.call(t,r)&&z_(e,r,t[r]);if(L_)for(var r of L_(t))H8.call(t,r)&&z_(e,r,t[r]);return e},G8=(e,t)=>B8(e,U8(t));function q8({underline:e,strikethrough:t}){const r=[];return e&&r.push("underline"),t&&r.push("line-through"),r.length>0?r.join(" "):"none"}function Q8({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function K8(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function Y8({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var X8=W((e,{color:t,lineClamp:r,truncate:n,inline:o,inherit:i,underline:a,gradient:l,weight:c,transform:u,align:d,strikethrough:p,italic:h},{size:m})=>{const v=e.fn.variant({variant:"gradient",gradient:l});return{root:G8(bu(bu(bu(bu({},e.fn.fontStyles()),e.fn.focusStyles()),K8(r)),Y8({theme:e,truncate:n})),{color:Q8({color:t,theme:e}),fontFamily:i?"inherit":e.fontFamily,fontSize:i||m===void 0?"inherit":A({size:m,sizes:e.fontSizes}),lineHeight:i?"inherit":o?1:e.lineHeight,textDecoration:q8({underline:a,strikethrough:p}),WebkitTapHighlightColor:"transparent",fontWeight:i?"inherit":c,textTransform:u,textAlign:d,fontStyle:h?"italic":void 0}),gradient:{backgroundImage:v.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const J8=X8;var Z8=Object.defineProperty,sf=Object.getOwnPropertySymbols,Ck=Object.prototype.hasOwnProperty,Ek=Object.prototype.propertyIsEnumerable,F_=(e,t,r)=>t in e?Z8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eF=(e,t)=>{for(var r in t||(t={}))Ck.call(t,r)&&F_(e,r,t[r]);if(sf)for(var r of sf(t))Ek.call(t,r)&&F_(e,r,t[r]);return e},tF=(e,t)=>{var r={};for(var n in e)Ck.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sf)for(var n of sf(e))t.indexOf(n)<0&&Ek.call(e,n)&&(r[n]=e[n]);return r};const rF={variant:"text"},$k=f.forwardRef((e,t)=>{const r=H("Text",rF,e),{className:n,size:o,weight:i,transform:a,color:l,align:c,variant:u,lineClamp:d,truncate:p,gradient:h,inline:m,inherit:v,underline:g,strikethrough:b,italic:y,classNames:x,styles:_,unstyled:w,span:j,__staticSelector:C}=r,P=tF(r,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:E,cx:k}=J8({color:l,lineClamp:d,truncate:p,inline:m,inherit:v,underline:g,strikethrough:b,italic:y,weight:i,transform:a,align:c,gradient:h},{unstyled:w,name:C||"Text",variant:u,size:o});return S.createElement(oe,eF({ref:t,className:k(E.root,{[E.gradient]:u==="gradient"},n),component:j?"span":"div"},P))});$k.displayName="@mantine/core/Text";const re=$k;var nF=Object.defineProperty,V_=Object.getOwnPropertySymbols,oF=Object.prototype.hasOwnProperty,iF=Object.prototype.propertyIsEnumerable,B_=(e,t,r)=>t in e?nF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aF=(e,t)=>{for(var r in t||(t={}))oF.call(t,r)&&B_(e,r,t[r]);if(V_)for(var r of V_(t))iF.call(t,r)&&B_(e,r,t[r]);return e};function sF({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():e.fn.themeColor(t||e.primaryColor,e.colorScheme==="dark"?4:7,!1,!0)}var lF=W((e,{color:t,underline:r})=>({root:aF({backgroundColor:"transparent",cursor:"pointer",padding:0,border:0,color:sF({theme:e,color:t})},e.fn.hover({textDecoration:r?"underline":"none"}))}));const cF=lF;var uF=Object.defineProperty,lf=Object.getOwnPropertySymbols,kk=Object.prototype.hasOwnProperty,Rk=Object.prototype.propertyIsEnumerable,U_=(e,t,r)=>t in e?uF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W_=(e,t)=>{for(var r in t||(t={}))kk.call(t,r)&&U_(e,r,t[r]);if(lf)for(var r of lf(t))Rk.call(t,r)&&U_(e,r,t[r]);return e},dF=(e,t)=>{var r={};for(var n in e)kk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&lf)for(var n of lf(e))t.indexOf(n)<0&&Rk.call(e,n)&&(r[n]=e[n]);return r};const fF={underline:!0},Tk=f.forwardRef((e,t)=>{const r=H("Anchor",fF,e),{component:n,className:o,unstyled:i,variant:a,size:l,color:c,underline:u}=r,d=dF(r,["component","className","unstyled","variant","size","color","underline"]),{classes:p,cx:h}=cF({color:c,underline:u},{name:"Anchor",unstyled:i,variant:a,size:l}),m=n==="button"?{type:"button"}:null;return S.createElement(re,W_(W_({component:n||"a",ref:t,className:h(p.root,o),size:l},m),d))});Tk.displayName="@mantine/core/Anchor";const Le=Tk,Ik=f.createContext({zIndex:1e3,fixed:!1,layout:"default"}),pF=Ik.Provider;function Dk(){return f.useContext(Ik)}function em(e,t){if(!e)return[];const r=Object.keys(e).filter(n=>n!=="base").map(n=>[A({size:n,sizes:t.breakpoints,units:"em"}),e[n]]);return r.sort((n,o)=>mr(n[0])-mr(o[0])),r}var hF=Object.defineProperty,mF=Object.defineProperties,gF=Object.getOwnPropertyDescriptors,H_=Object.getOwnPropertySymbols,vF=Object.prototype.hasOwnProperty,yF=Object.prototype.propertyIsEnumerable,G_=(e,t,r)=>t in e?hF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Su=(e,t)=>{for(var r in t||(t={}))vF.call(t,r)&&G_(e,r,t[r]);if(H_)for(var r of H_(t))yF.call(t,r)&&G_(e,r,t[r]);return e},q_=(e,t)=>mF(e,gF(t)),xF=W((e,{height:t,width:r,fixed:n,position:o,hiddenBreakpoint:i,zIndex:a,section:l,withBorder:c,layout:u})=>{const d=typeof r=="object"&&r!==null?em(r,e).reduce((h,[m,v])=>(h[`@media (min-width: ${ar(m)})`]={width:O(v),minWidth:O(v)},h),{}):null,p=c?{[l==="navbar"?"borderRight":"borderLeft"]:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`}:{};return{root:q_(Su(Su(q_(Su(Su({},e.fn.fontStyles()),o),{top:u==="alt"?0:(o==null?void 0:o.top)||"var(--mantine-header-height)",bottom:0,zIndex:a,height:t?O(t):u==="alt"?"auto":"calc(100vh - var(--mantine-header-height, 0rem) - var(--mantine-footer-height, 0rem))",width:r!=null&&r.base?O(r==null?void 0:r.base):"100%",position:n?"fixed":"static",boxSizing:"border-box",display:"flex",flexDirection:"column",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),p),d),{"&[data-hidden]":{[`@media (max-width: ${ar(mr(A({size:i,sizes:e.breakpoints}))-1)})`]:{display:"none"}}})}});const wF=xF;var _F=Object.defineProperty,cf=Object.getOwnPropertySymbols,Nk=Object.prototype.hasOwnProperty,Ak=Object.prototype.propertyIsEnumerable,Q_=(e,t,r)=>t in e?_F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K_=(e,t)=>{for(var r in t||(t={}))Nk.call(t,r)&&Q_(e,r,t[r]);if(cf)for(var r of cf(t))Ak.call(t,r)&&Q_(e,r,t[r]);return e},bF=(e,t)=>{var r={};for(var n in e)Nk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&cf)for(var n of cf(e))t.indexOf(n)<0&&Ak.call(e,n)&&(r[n]=e[n]);return r};const Mk=f.forwardRef((e,t)=>{var r=e,{width:n,height:o,fixed:i=!1,position:a,zIndex:l,hiddenBreakpoint:c="md",hidden:u=!1,withBorder:d=!0,className:p,classNames:h,styles:m,children:v,section:g,__staticSelector:b,unstyled:y,variant:x}=r,_=bF(r,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled","variant"]);const w=Dk(),{classes:j,cx:C,theme:P}=wF({width:n,height:o,fixed:w.fixed||i,position:a,hiddenBreakpoint:c,zIndex:l||w.zIndex||$n("app"),section:g,withBorder:d,layout:w.layout},{classNames:h,styles:m,name:b,unstyled:y,variant:x}),E=em(n,P).reduce((k,[$,I])=>(k[`@media (min-width: ${ar($)})`]={[`--mantine-${g}-width`]:O(I)},k),{});return S.createElement(oe,K_({component:g==="navbar"?"nav":"aside",ref:t,"data-hidden":u||void 0,className:C(j.root,p)},_),v,S.createElement(BE,{styles:()=>({":root":K_({[`--mantine-${g}-width`]:n!=null&&n.base?O(n.base):"0rem"},E)})}))});Mk.displayName="@mantine/core/HorizontalSection";var SF=Object.defineProperty,uf=Object.getOwnPropertySymbols,Lk=Object.prototype.hasOwnProperty,zk=Object.prototype.propertyIsEnumerable,Y_=(e,t,r)=>t in e?SF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PF=(e,t)=>{for(var r in t||(t={}))Lk.call(t,r)&&Y_(e,r,t[r]);if(uf)for(var r of uf(t))zk.call(t,r)&&Y_(e,r,t[r]);return e},OF=(e,t)=>{var r={};for(var n in e)Lk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&uf)for(var n of uf(e))t.indexOf(n)<0&&zk.call(e,n)&&(r[n]=e[n]);return r};const Fk=f.forwardRef((e,t)=>{var r=e,{children:n,grow:o=!1,sx:i}=r,a=OF(r,["children","grow","sx"]);return S.createElement(oe,PF({ref:t,sx:[{flex:o?1:0,boxSizing:"border-box"},...vc(i)]},a),n)});Fk.displayName="@mantine/core/Section";const jF=Fk;var CF=Object.defineProperty,X_=Object.getOwnPropertySymbols,EF=Object.prototype.hasOwnProperty,$F=Object.prototype.propertyIsEnumerable,J_=(e,t,r)=>t in e?CF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kF=(e,t)=>{for(var r in t||(t={}))EF.call(t,r)&&J_(e,r,t[r]);if(X_)for(var r of X_(t))$F.call(t,r)&&J_(e,r,t[r]);return e};const RF={fixed:!1,position:{top:0,left:0},hiddenBreakpoint:"md",hidden:!1},Nl=f.forwardRef((e,t)=>{const r=H("Navbar",RF,e);return S.createElement(Mk,kF({section:"navbar",__staticSelector:"Navbar",ref:t},r))});Nl.Section=jF;Nl.displayName="@mantine/core/Navbar";var TF=Object.defineProperty,IF=Object.defineProperties,DF=Object.getOwnPropertyDescriptors,Z_=Object.getOwnPropertySymbols,NF=Object.prototype.hasOwnProperty,AF=Object.prototype.propertyIsEnumerable,eb=(e,t,r)=>t in e?TF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gg=(e,t)=>{for(var r in t||(t={}))NF.call(t,r)&&eb(e,r,t[r]);if(Z_)for(var r of Z_(t))AF.call(t,r)&&eb(e,r,t[r]);return e},tb=(e,t)=>IF(e,DF(t)),MF=W((e,{height:t,fixed:r,position:n,zIndex:o,borderPosition:i,layout:a})=>{const l=typeof t=="object"&&t!==null?em(t,e).reduce((c,[u,d])=>(c[`@media (min-width: ${ar(u)})`]={height:O(d),minHeight:O(d)},c),{}):null;return{root:tb(gg(tb(gg(gg({},e.fn.fontStyles()),n),{zIndex:o,left:a==="alt"?"var(--mantine-navbar-width, 0)":0,right:a==="alt"?"var(--mantine-aside-width, 0)":0,height:typeof t=="object"?O(t==null?void 0:t.base)||"100%":O(t),maxHeight:typeof t=="object"?O(t==null?void 0:t.base)||"100%":O(t),position:r?"fixed":"static",boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),l),{borderBottom:i==="bottom"?`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0,borderTop:i==="top"?`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0})}});const LF=MF;var zF=Object.defineProperty,df=Object.getOwnPropertySymbols,Vk=Object.prototype.hasOwnProperty,Bk=Object.prototype.propertyIsEnumerable,rb=(e,t,r)=>t in e?zF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nb=(e,t)=>{for(var r in t||(t={}))Vk.call(t,r)&&rb(e,r,t[r]);if(df)for(var r of df(t))Bk.call(t,r)&&rb(e,r,t[r]);return e},FF=(e,t)=>{var r={};for(var n in e)Vk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&df)for(var n of df(e))t.indexOf(n)<0&&Bk.call(e,n)&&(r[n]=e[n]);return r};const Uk=f.forwardRef((e,t)=>{var r=e,{children:n,className:o,classNames:i,styles:a,height:l,fixed:c=!1,withBorder:u=!0,position:d,zIndex:p,section:h,unstyled:m,__staticSelector:v,variant:g}=r,b=FF(r,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector","variant"]);const y=Dk(),x=p||y.zIndex||$n("app"),{classes:_,cx:w,theme:j}=LF({height:l,fixed:y.fixed||c,position:d,zIndex:typeof x=="number"&&y.layout==="default"?x+1:x,layout:y.layout,borderPosition:u?h==="header"?"bottom":"top":"none"},{name:v,classNames:i,styles:a,unstyled:m,variant:g}),C=typeof l=="object"&&l!==null?em(l,j).reduce((P,[E,k])=>(P[`@media (min-width: ${ar(E)})`]={[`--mantine-${h}-height`]:O(k)},P),{}):null;return S.createElement(oe,nb({component:h==="header"?"header":"footer",className:w(_.root,o),ref:t},b),n,S.createElement(BE,{styles:()=>({":root":nb({[`--mantine-${h}-height`]:typeof l=="object"?O(l==null?void 0:l.base)||"100%":O(l)},C)})}))});Uk.displayName="@mantine/core/VerticalSection";var VF=Object.defineProperty,BF=Object.defineProperties,UF=Object.getOwnPropertyDescriptors,ob=Object.getOwnPropertySymbols,WF=Object.prototype.hasOwnProperty,HF=Object.prototype.propertyIsEnumerable,ib=(e,t,r)=>t in e?VF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GF=(e,t)=>{for(var r in t||(t={}))WF.call(t,r)&&ib(e,r,t[r]);if(ob)for(var r of ob(t))HF.call(t,r)&&ib(e,r,t[r]);return e},qF=(e,t)=>BF(e,UF(t));const QF={fixed:!1,position:{top:0,left:0,right:0}},Wk=f.forwardRef((e,t)=>{const r=H("Header",QF,e);return S.createElement(Uk,qF(GF({section:"header",__staticSelector:"Header"},r),{ref:t}))});Wk.displayName="@mantine/core/Header";var KF=Object.defineProperty,ab=Object.getOwnPropertySymbols,YF=Object.prototype.hasOwnProperty,XF=Object.prototype.propertyIsEnumerable,sb=(e,t,r)=>t in e?KF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hk=(e,t)=>{for(var r in t||(t={}))YF.call(t,r)&&sb(e,r,t[r]);if(ab)for(var r of ab(t))XF.call(t,r)&&sb(e,r,t[r]);return e};function JF(e,t){const r=A({size:e.padding,sizes:t.spacing}),n=e.navbarOffsetBreakpoint?A({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,o=e.asideOffsetBreakpoint?A({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;if(!e.fixed)return{padding:r};const i=mr(n),a=mr(o);return Hk({minHeight:"100vh",paddingTop:`calc(var(--mantine-header-height, 0px) + ${r})`,paddingBottom:`calc(var(--mantine-footer-height, 0px) + ${r})`,paddingLeft:`calc(var(--mantine-navbar-width, 0px) + ${r})`,paddingRight:`calc(var(--mantine-aside-width, 0px) + ${r})`},i===a?{[`@media (max-width: ${ar(i-1)})`]:{paddingLeft:r,paddingRight:r}}:{[`@media (max-width: ${ar(i-1)})`]:{paddingLeft:r},[`@media (max-width: ${ar(a-1)})`]:{paddingRight:r}})}var ZF=W((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:Hk({flex:1,width:"100vw",boxSizing:"border-box"},JF(t,e))}));const eV=ZF;var tV=Object.defineProperty,ff=Object.getOwnPropertySymbols,Gk=Object.prototype.hasOwnProperty,qk=Object.prototype.propertyIsEnumerable,lb=(e,t,r)=>t in e?tV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rV=(e,t)=>{for(var r in t||(t={}))Gk.call(t,r)&&lb(e,r,t[r]);if(ff)for(var r of ff(t))qk.call(t,r)&&lb(e,r,t[r]);return e},nV=(e,t)=>{var r={};for(var n in e)Gk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ff)for(var n of ff(e))t.indexOf(n)<0&&qk.call(e,n)&&(r[n]=e[n]);return r};const oV={fixed:!0,padding:"md"},Qk=f.forwardRef((e,t)=>{const r=H("AppShell",oV,e),{children:n,navbar:o,header:i,footer:a,aside:l,fixed:c,zIndex:u,padding:d,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h,className:m,styles:v,classNames:g,unstyled:b,hidden:y,layout:x,variant:_}=r,w=nV(r,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden","layout","variant"]),{classes:j,cx:C}=eV({padding:d,fixed:c,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h},{styles:v,classNames:g,unstyled:b,name:"AppShell",variant:_});return y?S.createElement(S.Fragment,null,n):S.createElement(pF,{value:{fixed:c,zIndex:u,layout:x}},S.createElement(oe,rV({className:C(j.root,m),ref:t},w),i,S.createElement("div",{className:j.body},o,S.createElement("main",{className:j.main},n),l),a))});Qk.displayName="@mantine/core/AppShell";const Pu={xs:O(1),sm:O(2),md:O(3),lg:O(4),xl:O(5)};function Ou(e,t){const r=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?r:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var iV=W((e,{color:t},{size:r,variant:n})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:O(1),borderTop:`${A({size:r,sizes:Pu})} ${n} ${Ou(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${A({size:r,sizes:Pu})} ${n} ${Ou(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:O(A({size:r,sizes:Pu})),borderTopColor:Ou(e,t),borderTopStyle:n,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:O(A({size:r,sizes:Pu})),borderLeftColor:Ou(e,t),borderLeftStyle:n}}));const aV=iV;var sV=Object.defineProperty,lV=Object.defineProperties,cV=Object.getOwnPropertyDescriptors,pf=Object.getOwnPropertySymbols,Kk=Object.prototype.hasOwnProperty,Yk=Object.prototype.propertyIsEnumerable,cb=(e,t,r)=>t in e?sV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ub=(e,t)=>{for(var r in t||(t={}))Kk.call(t,r)&&cb(e,r,t[r]);if(pf)for(var r of pf(t))Yk.call(t,r)&&cb(e,r,t[r]);return e},uV=(e,t)=>lV(e,cV(t)),dV=(e,t)=>{var r={};for(var n in e)Kk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pf)for(var n of pf(e))t.indexOf(n)<0&&Yk.call(e,n)&&(r[n]=e[n]);return r};const fV={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},br=f.forwardRef((e,t)=>{const r=H("Divider",fV,e),{className:n,color:o,orientation:i,size:a,label:l,labelPosition:c,labelProps:u,variant:d,styles:p,classNames:h,unstyled:m}=r,v=dV(r,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:g,cx:b}=aV({color:o},{classNames:h,styles:p,unstyled:m,name:"Divider",variant:d,size:a}),y=i==="vertical",x=i==="horizontal",_=!!l&&x,w=!(u!=null&&u.color);return S.createElement(oe,ub({ref:t,className:b(g.root,{[g.vertical]:y,[g.horizontal]:x,[g.withLabel]:_},n),role:"separator"},v),_&&S.createElement(re,uV(ub({},u),{size:(u==null?void 0:u.size)||"xs",mt:O(2),className:b(g.label,g[c],{[g.labelDefaultStyles]:w})}),l))});br.displayName="@mantine/core/Divider";var pV=Object.defineProperty,hV=Object.defineProperties,mV=Object.getOwnPropertyDescriptors,db=Object.getOwnPropertySymbols,gV=Object.prototype.hasOwnProperty,vV=Object.prototype.propertyIsEnumerable,fb=(e,t,r)=>t in e?pV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pb=(e,t)=>{for(var r in t||(t={}))gV.call(t,r)&&fb(e,r,t[r]);if(db)for(var r of db(t))vV.call(t,r)&&fb(e,r,t[r]);return e},yV=(e,t)=>hV(e,mV(t)),xV=W((e,t,{size:r})=>({item:yV(pb({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`,cursor:"pointer",fontSize:A({size:r,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":pb({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${A({size:r,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${A({size:r,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const wV=xV;var _V=Object.defineProperty,hb=Object.getOwnPropertySymbols,bV=Object.prototype.hasOwnProperty,SV=Object.prototype.propertyIsEnumerable,mb=(e,t,r)=>t in e?_V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PV=(e,t)=>{for(var r in t||(t={}))bV.call(t,r)&&mb(e,r,t[r]);if(hb)for(var r of hb(t))SV.call(t,r)&&mb(e,r,t[r]);return e};function Xk({data:e,hovered:t,classNames:r,styles:n,isItemSelected:o,uuid:i,__staticSelector:a,onItemHover:l,onItemSelect:c,itemsRefs:u,itemComponent:d,size:p,nothingFound:h,creatable:m,createLabel:v,unstyled:g,variant:b}){const{classes:y}=wV(null,{classNames:r,styles:n,unstyled:g,name:a,variant:b,size:p}),x=[],_=[];let w=null;const j=(P,E)=>{const k=typeof o=="function"?o(P.value):!1;return S.createElement(d,PV({key:P.value,className:y.item,"data-disabled":P.disabled||void 0,"data-hovered":!P.disabled&&t===E||void 0,"data-selected":!P.disabled&&k||void 0,selected:k,onMouseEnter:()=>l(E),id:`${i}-${E}`,role:"option",tabIndex:-1,"aria-selected":t===E,ref:$=>{u&&u.current&&(u.current[P.value]=$)},onMouseDown:P.disabled?null:$=>{$.preventDefault(),c(P)},disabled:P.disabled,variant:b},P))};let C=null;if(e.forEach((P,E)=>{P.creatable?w=E:P.group?(C!==P.group&&(C=P.group,_.push(S.createElement("div",{className:y.separator,key:`__mantine-divider-${E}`},S.createElement(br,{classNames:{label:y.separatorLabel},label:P.group})))),_.push(j(P,E))):x.push(j(P,E))}),m){const P=e[w];x.push(S.createElement("div",{key:Mh(),className:y.item,"data-hovered":t===w||void 0,onMouseEnter:()=>l(w),onMouseDown:E=>{E.preventDefault(),c(P)},tabIndex:-1,ref:E=>{u&&u.current&&(u.current[P.value]=E)}},v))}return _.length>0&&x.length>0&&x.unshift(S.createElement("div",{className:y.separator,key:"empty-group-separator"},S.createElement(br,null))),_.length>0||x.length>0?S.createElement(S.Fragment,null,_,x):S.createElement(re,{size:p,unstyled:g,className:y.nothingFound},h)}Xk.displayName="@mantine/core/SelectItems";var OV=Object.defineProperty,hf=Object.getOwnPropertySymbols,Jk=Object.prototype.hasOwnProperty,Zk=Object.prototype.propertyIsEnumerable,gb=(e,t,r)=>t in e?OV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jV=(e,t)=>{for(var r in t||(t={}))Jk.call(t,r)&&gb(e,r,t[r]);if(hf)for(var r of hf(t))Zk.call(t,r)&&gb(e,r,t[r]);return e},CV=(e,t)=>{var r={};for(var n in e)Jk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&hf)for(var n of hf(e))t.indexOf(n)<0&&Zk.call(e,n)&&(r[n]=e[n]);return r};const eR=f.forwardRef((e,t)=>{var r=e,{label:n,value:o}=r,i=CV(r,["label","value"]);return S.createElement("div",jV({ref:t},i),n||o)});eR.displayName="@mantine/core/DefaultItem";function EV(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tR(...e){return t=>e.forEach(r=>EV(r,t))}function ha(...e){return f.useCallback(tR(...e),e)}const rR=f.forwardRef((e,t)=>{const{children:r,...n}=e,o=f.Children.toArray(r),i=o.find(kV);if(i){const a=i.props.children,l=o.map(c=>c===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:c);return f.createElement(Jv,rt({},n,{ref:t}),f.isValidElement(a)?f.cloneElement(a,void 0,l):null)}return f.createElement(Jv,rt({},n,{ref:t}),r)});rR.displayName="Slot";const Jv=f.forwardRef((e,t)=>{const{children:r,...n}=e;return f.isValidElement(r)?f.cloneElement(r,{...RV(n,r.props),ref:tR(t,r.ref)}):f.Children.count(r)>1?f.Children.only(null):null});Jv.displayName="SlotClone";const $V=({children:e})=>f.createElement(f.Fragment,null,e);function kV(e){return f.isValidElement(e)&&e.type===$V}function RV(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{i(...l),o(...l)}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}const TV=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Ec=TV.reduce((e,t)=>{const r=f.forwardRef((n,o)=>{const{asChild:i,...a}=n,l=i?rR:t;return f.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),f.createElement(l,rt({},a,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Zv=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function IV(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const $c=e=>{const{present:t,children:r}=e,n=DV(t),o=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),i=ha(n.ref,o.ref);return typeof r=="function"||n.isPresent?f.cloneElement(o,{ref:i}):null};$c.displayName="Presence";function DV(e){const[t,r]=f.useState(),n=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),a=e?"mounted":"unmounted",[l,c]=IV(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=ju(n.current);i.current=l==="mounted"?u:"none"},[l]),Zv(()=>{const u=n.current,d=o.current;if(d!==e){const h=i.current,m=ju(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Zv(()=>{if(t){const u=p=>{const m=ju(n.current).includes(p.animationName);p.target===t&&m&&Oc.flushSync(()=>c("ANIMATION_END"))},d=p=>{p.target===t&&(i.current=ju(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function ju(e){return(e==null?void 0:e.animationName)||"none"}function NV(e,t=[]){let r=[];function n(i,a){const l=f.createContext(a),c=r.length;r=[...r,a];function u(p){const{scope:h,children:m,...v}=p,g=(h==null?void 0:h[e][c])||l,b=f.useMemo(()=>v,Object.values(v));return f.createElement(g.Provider,{value:b},m)}function d(p,h){const m=(h==null?void 0:h[e][c])||l,v=f.useContext(m);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=r.map(a=>f.createContext(a));return function(l){const c=(l==null?void 0:l[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,AV(o,...t)]}function AV(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=n.reduce((l,{useScope:c,scopeName:u})=>{const p=c(i)[`__scope${u}`];return{...l,...p}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Vi(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}const MV=f.createContext(void 0);function LV(e){const t=f.useContext(MV);return e||t||"ltr"}function zV(e,[t,r]){return Math.min(r,Math.max(t,e))}function Yi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function FV(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const nR="ScrollArea",[oR,yye]=NV(nR),[VV,pn]=oR(nR),BV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...a}=e,[l,c]=f.useState(null),[u,d]=f.useState(null),[p,h]=f.useState(null),[m,v]=f.useState(null),[g,b]=f.useState(null),[y,x]=f.useState(0),[_,w]=f.useState(0),[j,C]=f.useState(!1),[P,E]=f.useState(!1),k=ha(t,I=>c(I)),$=LV(o);return f.createElement(VV,{scope:r,type:n,dir:$,scrollHideDelay:i,scrollArea:l,viewport:u,onViewportChange:d,content:p,onContentChange:h,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:j,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:P,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeightChange:w},f.createElement(Ec.div,rt({dir:$},a,{ref:k,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})))}),UV="ScrollAreaViewport",WV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,...o}=e,i=pn(UV,r),a=f.useRef(null),l=ha(t,a,i.onViewportChange);return f.createElement(f.Fragment,null,f.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),f.createElement(Ec.div,rt({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),f.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},n)))}),Ao="ScrollAreaScrollbar",HV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pn(Ao,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,l=e.orientation==="horizontal";return f.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),o.type==="hover"?f.createElement(GV,rt({},n,{ref:t,forceMount:r})):o.type==="scroll"?f.createElement(qV,rt({},n,{ref:t,forceMount:r})):o.type==="auto"?f.createElement(iR,rt({},n,{ref:t,forceMount:r})):o.type==="always"?f.createElement(F0,rt({},n,{ref:t})):null}),GV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pn(Ao,e.__scopeScrollArea),[i,a]=f.useState(!1);return f.useEffect(()=>{const l=o.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),f.createElement($c,{present:r||i},f.createElement(iR,rt({"data-state":i?"visible":"hidden"},n,{ref:t})))}),qV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pn(Ao,e.__scopeScrollArea),i=e.orientation==="horizontal",a=rm(()=>c("SCROLL_END"),100),[l,c]=FV("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return f.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,o.scrollHideDelay,c]),f.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let p=u[d];const h=()=>{const m=u[d];p!==m&&(c("SCROLL"),a()),p=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c,a]),f.createElement($c,{present:r||l!=="hidden"},f.createElement(F0,rt({"data-state":l==="hidden"?"hidden":"visible"},n,{ref:t,onPointerEnter:Yi(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Yi(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),iR=f.forwardRef((e,t)=>{const r=pn(Ao,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,a]=f.useState(!1),l=e.orientation==="horizontal",c=rm(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;a(l?u:d)}},10);return ws(r.viewport,c),ws(r.content,c),f.createElement($c,{present:n||i},f.createElement(F0,rt({"data-state":i?"visible":"hidden"},o,{ref:t})))}),F0=f.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=pn(Ao,e.__scopeScrollArea),i=f.useRef(null),a=f.useRef(0),[l,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=cR(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function p(h,m){return tB(h,a.current,l,m)}return r==="horizontal"?f.createElement(QV,rt({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,m=vb(h,l,o.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=p(h,o.dir))}})):r==="vertical"?f.createElement(KV,rt({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,m=vb(h,l);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=p(h))}})):null}),QV=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=pn(Ao,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ha(t,c,i.onScrollbarXChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(sR,rt({"data-orientation":"horizontal"},o,{ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":tm(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),dR(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:mf(a.paddingLeft),paddingEnd:mf(a.paddingRight)}})}}))}),KV=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=pn(Ao,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ha(t,c,i.onScrollbarYChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(sR,rt({"data-orientation":"vertical"},o,{ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":tm(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),dR(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:mf(a.paddingTop),paddingEnd:mf(a.paddingBottom)}})}}))}),[YV,aR]=oR(Ao),sR=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:p,...h}=e,m=pn(Ao,r),[v,g]=f.useState(null),b=ha(t,k=>g(k)),y=f.useRef(null),x=f.useRef(""),_=m.viewport,w=n.content-n.viewport,j=Vi(d),C=Vi(c),P=rm(p,10);function E(k){if(y.current){const $=k.clientX-y.current.left,I=k.clientY-y.current.top;u({x:$,y:I})}}return f.useEffect(()=>{const k=$=>{const I=$.target;(v==null?void 0:v.contains(I))&&j($,w)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[_,v,w,j]),f.useEffect(C,[n,C]),ws(v,P),ws(m.content,P),f.createElement(YV,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Vi(i),onThumbPointerUp:Vi(a),onThumbPositionChange:C,onThumbPointerDown:Vi(l)},f.createElement(Ec.div,rt({},h,{ref:b,style:{position:"absolute",...h.style},onPointerDown:Yi(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),y.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",E(k))}),onPointerMove:Yi(e.onPointerMove,E),onPointerUp:Yi(e.onPointerUp,k=>{const $=k.target;$.hasPointerCapture(k.pointerId)&&$.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=x.current,y.current=null})})))}),ey="ScrollAreaThumb",XV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=aR(ey,e.__scopeScrollArea);return f.createElement($c,{present:r||o.hasThumb},f.createElement(JV,rt({ref:t},n)))}),JV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=pn(ey,r),a=aR(ey,r),{onThumbPositionChange:l}=a,c=ha(t,p=>a.onThumbChange(p)),u=f.useRef(),d=rm(()=>{u.current&&(u.current(),u.current=void 0)},100);return f.useEffect(()=>{const p=i.viewport;if(p){const h=()=>{if(d(),!u.current){const m=rB(p,l);u.current=m,l()}};return l(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[i.viewport,d,l]),f.createElement(Ec.div,rt({"data-state":a.hasThumb?"visible":"hidden"},o,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Yi(e.onPointerDownCapture,p=>{const m=p.target.getBoundingClientRect(),v=p.clientX-m.left,g=p.clientY-m.top;a.onThumbPointerDown({x:v,y:g})}),onPointerUp:Yi(e.onPointerUp,a.onThumbPointerUp)}))}),lR="ScrollAreaCorner",ZV=f.forwardRef((e,t)=>{const r=pn(lR,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?f.createElement(eB,rt({},e,{ref:t})):null}),eB=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=pn(lR,r),[i,a]=f.useState(0),[l,c]=f.useState(0),u=!!(i&&l);return ws(o.scrollbarX,()=>{var d;const p=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(p),c(p)}),ws(o.scrollbarY,()=>{var d;const p=((d=o.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;o.onCornerWidthChange(p),a(p)}),u?f.createElement(Ec.div,rt({},n,{ref:t,style:{width:i,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function mf(e){return e?parseInt(e,10):0}function cR(e,t){const r=e/t;return isNaN(r)?0:r}function tm(e){const t=cR(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function tB(e,t,r,n="ltr"){const o=tm(r),i=o/2,a=t||i,l=o-a,c=r.scrollbar.paddingStart+a,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,p=n==="ltr"?[0,d]:[d*-1,0];return uR([c,u],p)(e)}function vb(e,t,r="ltr"){const n=tm(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,l=i-n,c=r==="ltr"?[0,a]:[a*-1,0],u=zV(e,c);return uR([0,a],[0,l])(u)}function uR(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function dR(e,t){return e>0&&e<t}const rB=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=r.left!==i.left,l=r.top!==i.top;(a||l)&&t(),r=i,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function rm(e,t){const r=Vi(e),n=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),f.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ws(e,t){const r=Vi(t);Zv(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}const nB=BV,oB=WV,yb=HV,xb=XV,iB=ZV;var aB=W((e,{scrollbarSize:t,offsetScrollbars:r,scrollbarHovered:n,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:r?O(t):void 0,paddingBottom:r?O(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${O(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${Bt("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:O(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:O(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:Bt("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:O(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:O(44),minHeight:O(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:n?1:0,display:o?"none":void 0}}));const sB=aB;var lB=Object.defineProperty,cB=Object.defineProperties,uB=Object.getOwnPropertyDescriptors,gf=Object.getOwnPropertySymbols,fR=Object.prototype.hasOwnProperty,pR=Object.prototype.propertyIsEnumerable,wb=(e,t,r)=>t in e?lB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ty=(e,t)=>{for(var r in t||(t={}))fR.call(t,r)&&wb(e,r,t[r]);if(gf)for(var r of gf(t))pR.call(t,r)&&wb(e,r,t[r]);return e},hR=(e,t)=>cB(e,uB(t)),mR=(e,t)=>{var r={};for(var n in e)fR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&gf)for(var n of gf(e))t.indexOf(n)<0&&pR.call(e,n)&&(r[n]=e[n]);return r};const gR={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},nm=f.forwardRef((e,t)=>{const r=H("ScrollArea",gR,e),{children:n,className:o,classNames:i,styles:a,scrollbarSize:l,scrollHideDelay:c,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:g,viewportProps:b}=r,y=mR(r,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[x,_]=f.useState(!1),w=Zt(),{classes:j,cx:C}=sB({scrollbarSize:l,offsetScrollbars:p,scrollbarHovered:x,hidden:u==="never"},{name:"ScrollArea",classNames:i,styles:a,unstyled:v,variant:g});return S.createElement(nB,{type:u==="never"?"always":u,scrollHideDelay:c,dir:d||w.dir,ref:t,asChild:!0},S.createElement(oe,ty({className:C(j.root,o)},y),S.createElement(oB,hR(ty({},b),{className:j.viewport,ref:h,onScroll:typeof m=="function"?({currentTarget:P})=>m({x:P.scrollLeft,y:P.scrollTop}):void 0}),n),S.createElement(yb,{orientation:"horizontal",className:j.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},S.createElement(xb,{className:j.thumb})),S.createElement(yb,{orientation:"vertical",className:j.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},S.createElement(xb,{className:j.thumb})),S.createElement(iB,{className:j.corner})))}),vR=f.forwardRef((e,t)=>{const r=H("ScrollAreaAutosize",gR,e),{children:n,classNames:o,styles:i,scrollbarSize:a,scrollHideDelay:l,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,sx:v,variant:g,viewportProps:b}=r,y=mR(r,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return S.createElement(oe,hR(ty({},y),{ref:t,sx:[{display:"flex"},...vc(v)]}),S.createElement(oe,{sx:{display:"flex",flexDirection:"column",flex:1}},S.createElement(nm,{classNames:o,styles:i,scrollHideDelay:l,scrollbarSize:a,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,variant:g,viewportProps:b},n)))});vR.displayName="@mantine/core/ScrollAreaAutosize";nm.displayName="@mantine/core/ScrollArea";nm.Autosize=vR;const ma=nm;var dB=Object.defineProperty,fB=Object.defineProperties,pB=Object.getOwnPropertyDescriptors,vf=Object.getOwnPropertySymbols,yR=Object.prototype.hasOwnProperty,xR=Object.prototype.propertyIsEnumerable,_b=(e,t,r)=>t in e?dB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bb=(e,t)=>{for(var r in t||(t={}))yR.call(t,r)&&_b(e,r,t[r]);if(vf)for(var r of vf(t))xR.call(t,r)&&_b(e,r,t[r]);return e},hB=(e,t)=>fB(e,pB(t)),mB=(e,t)=>{var r={};for(var n in e)yR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&vf)for(var n of vf(e))t.indexOf(n)<0&&xR.call(e,n)&&(r[n]=e[n]);return r};const V0=f.forwardRef((e,t)=>{var r=e,{style:n}=r,o=mB(r,["style"]);return S.createElement(ma,hB(bb({},o),{style:bb({width:"100%"},n),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});V0.displayName="@mantine/core/SelectScrollArea";var gB=W(()=>({dropdown:{},itemsWrapper:{padding:O(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const vB=gB,On=Math.min,or=Math.max,yf=Math.round,Cu=Math.floor,yi=e=>({x:e,y:e}),yB={left:"right",right:"left",bottom:"top",top:"bottom"},xB={start:"end",end:"start"};function ry(e,t,r){return or(e,On(t,r))}function Eo(e,t){return typeof e=="function"?e(t):e}function jn(e){return e.split("-")[0]}function As(e){return e.split("-")[1]}function B0(e){return e==="x"?"y":"x"}function U0(e){return e==="y"?"height":"width"}function ga(e){return["top","bottom"].includes(jn(e))?"y":"x"}function W0(e){return B0(ga(e))}function wB(e,t,r){r===void 0&&(r=!1);const n=As(e),o=W0(e),i=U0(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=xf(a)),[a,xf(a)]}function _B(e){const t=xf(e);return[ny(e),t,ny(t)]}function ny(e){return e.replace(/start|end/g,t=>xB[t])}function bB(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:a;default:return[]}}function SB(e,t,r,n){const o=As(e);let i=bB(jn(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(ny)))),i}function xf(e){return e.replace(/left|right|bottom|top/g,t=>yB[t])}function PB(e){return{top:0,right:0,bottom:0,left:0,...e}}function H0(e){return typeof e!="number"?PB(e):{top:e,right:e,bottom:e,left:e}}function _s(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Sb(e,t,r){let{reference:n,floating:o}=e;const i=ga(t),a=W0(t),l=U0(a),c=jn(t),u=i==="y",d=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,h=n[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:n.y-o.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-o.width,y:p};break;default:m={x:n.x,y:n.y}}switch(As(t)){case"start":m[a]-=h*(r&&u?-1:1);break;case"end":m[a]+=h*(r&&u?-1:1);break}return m}const OB=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=Sb(u,n,c),h=n,m={},v=0;for(let g=0;g<l.length;g++){const{name:b,fn:y}=l[g],{x,y:_,data:w,reset:j}=await y({x:d,y:p,initialPlacement:n,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});if(d=x??d,p=_??p,m={...m,[b]:{...m[b],...w}},j&&v<=50){v++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(u=j.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:p}=Sb(u,h,c)),g=-1;continue}}return{x:d,y:p,placement:h,strategy:o,middlewareData:m}};async function G0(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=Eo(t,e),v=H0(m),b=l[h?p==="floating"?"reference":"floating":p],y=_s(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=p==="floating"?{...a.floating,x:n,y:o}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},j=_s(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:c}):x);return{top:(y.top-j.top+v.top)/w.y,bottom:(j.bottom-y.bottom+v.bottom)/w.y,left:(y.left-j.left+v.left)/w.x,right:(j.right-y.right+v.right)/w.x}}const Pb=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Eo(e,t)||{};if(u==null)return{};const p=H0(d),h={x:r,y:n},m=W0(o),v=U0(m),g=await a.getDimensions(u),b=m==="y",y=b?"top":"left",x=b?"bottom":"right",_=b?"clientHeight":"clientWidth",w=i.reference[v]+i.reference[m]-h[m]-i.floating[v],j=h[m]-i.reference[m],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let P=C?C[_]:0;(!P||!await(a.isElement==null?void 0:a.isElement(C)))&&(P=l.floating[_]||i.floating[v]);const E=w/2-j/2,k=P/2-g[v]/2-1,$=On(p[y],k),I=On(p[x],k),T=$,z=P-g[v]-I,M=P/2-g[v]/2+E,L=ry(T,M,z),q=!c.arrow&&As(o)!=null&&M!=L&&i.reference[v]/2-(M<T?$:I)-g[v]/2<0,Y=q?M<T?M-T:M-z:0;return{[m]:h[m]+Y,data:{[m]:L,centerOffset:M-L-Y,...q&&{alignmentOffset:Y}},reset:q}}}),wR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...b}=Eo(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=jn(o),x=jn(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=h||(x||!g?[xf(l)]:_B(l));!h&&v!=="none"&&w.push(...SB(l,g,v,_));const j=[l,...w],C=await G0(t,b),P=[];let E=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&P.push(C[y]),p){const T=wB(o,a,_);P.push(C[T[0]],C[T[1]])}if(E=[...E,{placement:o,overflows:P}],!P.every(T=>T<=0)){var k,$;const T=(((k=i.flip)==null?void 0:k.index)||0)+1,z=j[T];if(z)return{data:{index:T,overflows:E},reset:{placement:z}};let M=($=E.filter(L=>L.overflows[0]<=0).sort((L,q)=>L.overflows[1]-q.overflows[1])[0])==null?void 0:$.placement;if(!M)switch(m){case"bestFit":{var I;const L=(I=E.map(q=>[q.placement,q.overflows.filter(Y=>Y>0).reduce((Y,R)=>Y+R,0)]).sort((q,Y)=>q[1]-Y[1])[0])==null?void 0:I[0];L&&(M=L);break}case"initialPlacement":M=l;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function _R(e){const t=On(...e.map(i=>i.left)),r=On(...e.map(i=>i.top)),n=or(...e.map(i=>i.right)),o=or(...e.map(i=>i.bottom));return{x:t,y:r,width:n-t,height:o-r}}function jB(e){const t=e.slice().sort((o,i)=>o.y-i.y),r=[];let n=null;for(let o=0;o<t.length;o++){const i=t[o];!n||i.y-n.y>n.height/2?r.push([i]):r[r.length-1].push(i),n=i}return r.map(o=>_s(_R(o)))}const bR=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:n,rects:o,platform:i,strategy:a}=t,{padding:l=2,x:c,y:u}=Eo(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(n.reference))||[]),p=jB(d),h=_s(_R(d)),m=H0(l);function v(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&u!=null)return p.find(b=>c>b.left-m.left&&c<b.right+m.right&&u>b.top-m.top&&u<b.bottom+m.bottom)||h;if(p.length>=2){if(ga(r)==="y"){const $=p[0],I=p[p.length-1],T=jn(r)==="top",z=$.top,M=I.bottom,L=T?$.left:I.left,q=T?$.right:I.right,Y=q-L,R=M-z;return{top:z,bottom:M,left:L,right:q,width:Y,height:R,x:L,y:z}}const b=jn(r)==="left",y=or(...p.map($=>$.right)),x=On(...p.map($=>$.left)),_=p.filter($=>b?$.left===x:$.right===y),w=_[0].top,j=_[_.length-1].bottom,C=x,P=y,E=P-C,k=j-w;return{top:w,bottom:j,left:C,right:P,width:E,height:k,x:C,y:w}}return h}const g=await i.getElementRects({reference:{getBoundingClientRect:v},floating:n.floating,strategy:a});return o.reference.x!==g.reference.x||o.reference.y!==g.reference.y||o.reference.width!==g.reference.width||o.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}};async function CB(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=jn(r),l=As(r),c=ga(r)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,p=Eo(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return l&&typeof v=="number"&&(m=l==="end"?v*-1:v),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const SR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,o=await CB(t,e);return{x:r+o.x,y:n+o.y,data:o}}}},q0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:y,y:x}=b;return{x:y,y:x}}},...c}=Eo(e,t),u={x:r,y:n},d=await G0(t,c),p=ga(jn(o)),h=B0(p);let m=u[h],v=u[p];if(i){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=m+d[b],_=m-d[y];m=ry(x,m,_)}if(a){const b=p==="y"?"top":"left",y=p==="y"?"bottom":"right",x=v+d[b],_=v-d[y];v=ry(x,v,_)}const g=l.fn({...t,[h]:m,[p]:v});return{...g,data:{x:g.x-r,y:g.y-n}}}}},EB=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Eo(e,t),d={x:r,y:n},p=ga(o),h=B0(p);let m=d[h],v=d[p];const g=Eo(l,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const _=h==="y"?"height":"width",w=i.reference[h]-i.floating[_]+b.mainAxis,j=i.reference[h]+i.reference[_]-b.mainAxis;m<w?m=w:m>j&&(m=j)}if(u){var y,x;const _=h==="y"?"width":"height",w=["top","left"].includes(jn(o)),j=i.reference[p]-i.floating[_]+(w&&((y=a.offset)==null?void 0:y[p])||0)+(w?0:b.crossAxis),C=i.reference[p]+i.reference[_]+(w?0:((x=a.offset)==null?void 0:x[p])||0)-(w?b.crossAxis:0);v<j?v=j:v>C&&(v=C)}return{[h]:m,[p]:v}}}},$B=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:o,elements:i}=t,{apply:a=()=>{},...l}=Eo(e,t),c=await G0(t,l),u=jn(r),d=As(r),p=ga(r)==="y",{width:h,height:m}=n.floating;let v,g;u==="top"||u==="bottom"?(v=u,g=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=u,v=d==="end"?"top":"bottom");const b=m-c[v],y=h-c[g],x=!t.middlewareData.shift;let _=b,w=y;if(p){const C=h-c.left-c.right;w=d||x?On(y,C):C}else{const C=m-c.top-c.bottom;_=d||x?On(b,C):C}if(x&&!d){const C=or(c.left,0),P=or(c.right,0),E=or(c.top,0),k=or(c.bottom,0);p?w=h-2*(C!==0||P!==0?C+P:or(c.left,c.right)):_=m-2*(E!==0||k!==0?E+k:or(c.top,c.bottom))}await a({...t,availableWidth:w,availableHeight:_});const j=await o.getDimensions(i.floating);return h!==j.width||m!==j.height?{reset:{rects:!0}}:{}}}};function xi(e){return PR(e)?(e.nodeName||"").toLowerCase():"#document"}function Ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mo(e){var t;return(t=(PR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function PR(e){return e instanceof Node||e instanceof Ur(e).Node}function $o(e){return e instanceof Element||e instanceof Ur(e).Element}function to(e){return e instanceof HTMLElement||e instanceof Ur(e).HTMLElement}function Ob(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ur(e).ShadowRoot}function kc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=fn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function kB(e){return["table","td","th"].includes(xi(e))}function Q0(e){const t=K0(),r=fn(e);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function RB(e){let t=bs(e);for(;to(t)&&!om(t);){if(Q0(t))return t;t=bs(t)}return null}function K0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function om(e){return["html","body","#document"].includes(xi(e))}function fn(e){return Ur(e).getComputedStyle(e)}function im(e){return $o(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function bs(e){if(xi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ob(e)&&e.host||Mo(e);return Ob(t)?t.host:t}function OR(e){const t=bs(e);return om(t)?e.ownerDocument?e.ownerDocument.body:e.body:to(t)&&kc(t)?t:OR(t)}function wo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=OR(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=Ur(o);return i?t.concat(a,a.visualViewport||[],kc(o)?o:[],a.frameElement&&r?wo(a.frameElement):[]):t.concat(o,wo(o,[],r))}function jR(e){const t=fn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=to(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,l=yf(r)!==i||yf(n)!==a;return l&&(r=i,n=a),{width:r,height:n,$:l}}function Y0(e){return $o(e)?e:e.contextElement}function ls(e){const t=Y0(e);if(!to(t))return yi(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=jR(t);let a=(i?yf(r.width):r.width)/n,l=(i?yf(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const TB=yi(0);function CR(e){const t=Ur(e);return!K0()||!t.visualViewport?TB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function IB(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ur(e)?!1:t}function oa(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Y0(e);let a=yi(1);t&&(n?$o(n)&&(a=ls(n)):a=ls(e));const l=IB(i,r,n)?CR(i):yi(0);let c=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,d=o.width/a.x,p=o.height/a.y;if(i){const h=Ur(i),m=n&&$o(n)?Ur(n):n;let v=h.frameElement;for(;v&&n&&m!==h;){const g=ls(v),b=v.getBoundingClientRect(),y=fn(v),x=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*g.x,_=b.top+(v.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,p*=g.y,c+=x,u+=_,v=Ur(v).frameElement}}return _s({width:d,height:p,x:c,y:u})}function DB(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=to(r),i=Mo(r);if(r===i)return t;let a={scrollLeft:0,scrollTop:0},l=yi(1);const c=yi(0);if((o||!o&&n!=="fixed")&&((xi(r)!=="body"||kc(i))&&(a=im(r)),to(r))){const u=oa(r);l=ls(r),c.x=u.x+r.clientLeft,c.y=u.y+r.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+c.x,y:t.y*l.y-a.scrollTop*l.y+c.y}}function NB(e){return Array.from(e.getClientRects())}function ER(e){return oa(Mo(e)).left+im(e).scrollLeft}function AB(e){const t=Mo(e),r=im(e),n=e.ownerDocument.body,o=or(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=or(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+ER(e);const l=-r.scrollTop;return fn(n).direction==="rtl"&&(a+=or(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:l}}function MB(e,t){const r=Ur(e),n=Mo(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const u=K0();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function LB(e,t){const r=oa(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=to(e)?ls(e):yi(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=n*i.y;return{width:a,height:l,x:c,y:u}}function jb(e,t,r){let n;if(t==="viewport")n=MB(e,r);else if(t==="document")n=AB(Mo(e));else if($o(t))n=LB(t,r);else{const o=CR(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return _s(n)}function $R(e,t){const r=bs(e);return r===t||!$o(r)||om(r)?!1:fn(r).position==="fixed"||$R(r,t)}function zB(e,t){const r=t.get(e);if(r)return r;let n=wo(e,[],!1).filter(l=>$o(l)&&xi(l)!=="body"),o=null;const i=fn(e).position==="fixed";let a=i?bs(e):e;for(;$o(a)&&!om(a);){const l=fn(a),c=Q0(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||kc(a)&&!c&&$R(e,a))?n=n.filter(d=>d!==a):o=l,a=bs(a)}return t.set(e,n),n}function FB(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?zB(t,this._c):[].concat(r),n],l=a[0],c=a.reduce((u,d)=>{const p=jb(t,d,o);return u.top=or(p.top,u.top),u.right=On(p.right,u.right),u.bottom=On(p.bottom,u.bottom),u.left=or(p.left,u.left),u},jb(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function VB(e){return jR(e)}function BB(e,t,r){const n=to(t),o=Mo(t),i=r==="fixed",a=oa(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=yi(0);if(n||!n&&!i)if((xi(t)!=="body"||kc(o))&&(l=im(t)),n){const u=oa(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else o&&(c.x=ER(o));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function Cb(e,t){return!to(e)||fn(e).position==="fixed"?null:t?t(e):e.offsetParent}function kR(e,t){const r=Ur(e);if(!to(e))return r;let n=Cb(e,t);for(;n&&kB(n)&&fn(n).position==="static";)n=Cb(n,t);return n&&(xi(n)==="html"||xi(n)==="body"&&fn(n).position==="static"&&!Q0(n))?r:n||RB(e)||r}const UB=async function(e){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||kR,i=this.getDimensions;return{reference:BB(t,await o(r),n),floating:{x:0,y:0,...await i(r)}}};function WB(e){return fn(e).direction==="rtl"}const HB={convertOffsetParentRelativeRectToViewportRelativeRect:DB,getDocumentElement:Mo,getClippingRect:FB,getOffsetParent:kR,getElementRects:UB,getClientRects:NB,getDimensions:VB,getScale:ls,isElement:$o,isRTL:WB};function GB(e,t){let r=null,n;const o=Mo(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:p,height:h}=e.getBoundingClientRect();if(l||t(),!p||!h)return;const m=Cu(d),v=Cu(o.clientWidth-(u+p)),g=Cu(o.clientHeight-(d+h)),b=Cu(u),x={rootMargin:-m+"px "+-v+"px "+-g+"px "+-b+"px",threshold:or(0,On(1,c))||1};let _=!0;function w(j){const C=j[0].intersectionRatio;if(C!==c){if(!_)return a();C?a(!1,C):n=setTimeout(()=>{a(!1,1e-7)},100)}_=!1}try{r=new IntersectionObserver(w,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(w,x)}r.observe(e)}return a(!0),i}function qB(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Y0(e),d=o||i?[...u?wo(u):[],...wo(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const p=u&&l?GB(u,r):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let v,g=c?oa(e):null;c&&b();function b(){const y=oa(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&r(),g=y,v=requestAnimationFrame(b)}return r(),()=>{d.forEach(y=>{o&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),p&&p(),m&&m.disconnect(),m=null,c&&cancelAnimationFrame(v)}}const QB=(e,t,r)=>{const n=new Map,o={platform:HB,...r},i={...o.platform,_c:n};return OB(e,t,{...o,platform:i})},RR=e=>{const{element:t,padding:r}=e;function n(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return n(t)?t.current!=null?Pb({element:t.current,padding:r}).fn(o):{}:t?Pb({element:t,padding:r}).fn(o):{}}}};var hd=typeof document<"u"?f.useLayoutEffect:f.useEffect;function wf(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!wf(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!wf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Eb(e){const t=f.useRef(e);return hd(()=>{t.current=e}),t}function KB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,whileElementsMounted:i,open:a}=e,[l,c]=f.useState({x:null,y:null,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[u,d]=f.useState(n);wf(u,n)||d(n);const p=f.useRef(null),h=f.useRef(null),m=f.useRef(l),v=Eb(i),g=Eb(o),[b,y]=f.useState(null),[x,_]=f.useState(null),w=f.useCallback($=>{p.current!==$&&(p.current=$,y($))},[]),j=f.useCallback($=>{h.current!==$&&(h.current=$,_($))},[]),C=f.useCallback(()=>{if(!p.current||!h.current)return;const $={placement:t,strategy:r,middleware:u};g.current&&($.platform=g.current),QB(p.current,h.current,$).then(I=>{const T={...I,isPositioned:!0};P.current&&!wf(m.current,T)&&(m.current=T,Oc.flushSync(()=>{c(T)}))})},[u,t,r,g]);hd(()=>{a===!1&&m.current.isPositioned&&(m.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[a]);const P=f.useRef(!1);hd(()=>(P.current=!0,()=>{P.current=!1}),[]),hd(()=>{if(b&&x){if(v.current)return v.current(b,x,C);C()}},[b,x,C,v]);const E=f.useMemo(()=>({reference:p,floating:h,setReference:w,setFloating:j}),[w,j]),k=f.useMemo(()=>({reference:b,floating:x}),[b,x]);return f.useMemo(()=>({...l,update:C,refs:E,elements:k,reference:w,floating:j}),[l,C,E,k,w,j])}var Ss=typeof document<"u"?f.useLayoutEffect:f.useEffect;let vg=!1,YB=0;const $b=()=>"floating-ui-"+YB++;function XB(){const[e,t]=f.useState(()=>vg?$b():void 0);return Ss(()=>{e==null&&t($b())},[]),f.useEffect(()=>{vg||(vg=!0)},[]),e}const JB=Fl["useId".toString()],kb=JB||XB;function ZB(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){e.set(t,(e.get(t)||[]).filter(n=>n!==r))}}}const eU=f.createContext(null),tU=f.createContext(null),TR=()=>{var e;return((e=f.useContext(eU))==null?void 0:e.id)||null},X0=()=>f.useContext(tU);function ii(e){return(e==null?void 0:e.ownerDocument)||document}function rU(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function nU(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}function J0(e){return ii(e).defaultView||window}function Kn(e){return e?e instanceof J0(e).Element:!1}function IR(e){return e?e instanceof J0(e).HTMLElement:!1}function oU(e){if(typeof ShadowRoot>"u")return!1;const t=J0(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function iU(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(rU())||t.test(nU()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function aU(e){return e.width===0&&e.height===0||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}function DR(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function Rb(e){const t=f.useRef(e);return Ss(()=>{t.current=e}),t}const Tb="data-floating-ui-safe-polygon";function md(e,t,r){return r&&!DR(r)?0:typeof e=="number"?e:e==null?void 0:e[t]}const sU=function(e,t){let{enabled:r=!0,delay:n=0,handleClose:o=null,mouseOnly:i=!1,restMs:a=0,move:l=!0}=t===void 0?{}:t;const{open:c,onOpenChange:u,dataRef:d,events:p,elements:{domReference:h,floating:m},refs:v}=e,g=X0(),b=TR(),y=Rb(o),x=Rb(n),_=f.useRef(),w=f.useRef(),j=f.useRef(),C=f.useRef(),P=f.useRef(!0),E=f.useRef(!1),k=f.useRef(()=>{}),$=f.useCallback(()=>{var M;const L=(M=d.current.openEvent)==null?void 0:M.type;return(L==null?void 0:L.includes("mouse"))&&L!=="mousedown"},[d]);f.useEffect(()=>{if(!r)return;function M(){clearTimeout(w.current),clearTimeout(C.current),P.current=!0}return p.on("dismiss",M),()=>{p.off("dismiss",M)}},[r,p]),f.useEffect(()=>{if(!r||!y.current||!c)return;function M(){$()&&u(!1)}const L=ii(m).documentElement;return L.addEventListener("mouseleave",M),()=>{L.removeEventListener("mouseleave",M)}},[m,c,u,r,y,d,$]);const I=f.useCallback(function(M){M===void 0&&(M=!0);const L=md(x.current,"close",_.current);L&&!j.current?(clearTimeout(w.current),w.current=setTimeout(()=>u(!1),L)):M&&(clearTimeout(w.current),u(!1))},[x,u]),T=f.useCallback(()=>{k.current(),j.current=void 0},[]),z=f.useCallback(()=>{if(E.current){const M=ii(v.floating.current).body;M.style.pointerEvents="",M.removeAttribute(Tb),E.current=!1}},[v]);return f.useEffect(()=>{if(!r)return;function M(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function L(R){if(clearTimeout(w.current),P.current=!1,i&&!DR(_.current)||a>0&&md(x.current,"open")===0)return;d.current.openEvent=R;const N=md(x.current,"open",_.current);N?w.current=setTimeout(()=>{u(!0)},N):u(!0)}function q(R){if(M())return;k.current();const N=ii(m);if(clearTimeout(C.current),y.current){c||clearTimeout(w.current),j.current=y.current({...e,tree:g,x:R.clientX,y:R.clientY,onClose(){z(),T(),I()}});const V=j.current;N.addEventListener("mousemove",V),k.current=()=>{N.removeEventListener("mousemove",V)};return}I()}function Y(R){M()||y.current==null||y.current({...e,tree:g,x:R.clientX,y:R.clientY,onClose(){z(),T(),I()}})(R)}if(Kn(h)){const R=h;return c&&R.addEventListener("mouseleave",Y),m==null||m.addEventListener("mouseleave",Y),l&&R.addEventListener("mousemove",L,{once:!0}),R.addEventListener("mouseenter",L),R.addEventListener("mouseleave",q),()=>{c&&R.removeEventListener("mouseleave",Y),m==null||m.removeEventListener("mouseleave",Y),l&&R.removeEventListener("mousemove",L),R.removeEventListener("mouseenter",L),R.removeEventListener("mouseleave",q)}}},[h,m,r,e,i,a,l,I,T,z,u,c,g,x,y,d]),Ss(()=>{var M;if(r&&c&&(M=y.current)!=null&&M.__options.blockPointerEvents&&$()){const Y=ii(m).body;if(Y.setAttribute(Tb,""),Y.style.pointerEvents="none",E.current=!0,Kn(h)&&m){var L,q;const R=h,N=g==null||(L=g.nodesRef.current.find(V=>V.id===b))==null||(q=L.context)==null?void 0:q.elements.floating;return N&&(N.style.pointerEvents=""),R.style.pointerEvents="auto",m.style.pointerEvents="auto",()=>{R.style.pointerEvents="",m.style.pointerEvents=""}}}},[r,c,b,m,h,g,y,d,$]),Ss(()=>{c||(_.current=void 0,T(),z())},[c,T,z]),f.useEffect(()=>()=>{T(),clearTimeout(w.current),clearTimeout(C.current),z()},[r,T,z]),f.useMemo(()=>{if(!r)return{};function M(L){_.current=L.pointerType}return{reference:{onPointerDown:M,onPointerEnter:M,onMouseMove(){c||a===0||(clearTimeout(C.current),C.current=setTimeout(()=>{P.current||u(!0)},a))}},floating:{onMouseEnter(){clearTimeout(w.current)},onMouseLeave(){p.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),I(!1)}}}},[p,r,a,c,u,I])},NR=f.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),AR=()=>f.useContext(NR),lU=e=>{let{children:t,delay:r,timeoutMs:n=0}=e;const[o,i]=f.useReducer((c,u)=>({...c,...u}),{delay:r,timeoutMs:n,initialDelay:r,currentId:null,isInstantPhase:!1}),a=f.useRef(null),l=f.useCallback(c=>{i({currentId:c})},[]);return Ss(()=>{o.currentId?a.current===null?a.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),a.current=null)},[o.currentId]),f.createElement(NR.Provider,{value:f.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,i,l])},t)},cU=(e,t)=>{let{open:r,onOpenChange:n}=e,{id:o}=t;const{currentId:i,setCurrentId:a,initialDelay:l,setState:c,timeoutMs:u}=AR();f.useEffect(()=>{i&&(c({delay:{open:1,close:md(l,"close")}}),i!==o&&n(!1))},[o,n,c,i,l]),f.useEffect(()=>{function d(){n(!1),c({delay:l,currentId:null})}if(!r&&i===o)if(u){const p=window.setTimeout(d,u);return()=>{clearTimeout(p)}}else d()},[r,c,i,o,n,l,u]),f.useEffect(()=>{r&&a(o)},[r,a,o])};function uU(e){let t=e.activeElement;for(;((r=t)==null||(n=r.shadowRoot)==null?void 0:n.activeElement)!=null;){var r,n;t=t.shadowRoot.activeElement}return t}function Ib(e,t){if(!e||!t)return!1;const r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&oU(r)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function yg(e,t){let r=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],n=r;for(;n.length;)n=e.filter(o=>{var i;return(i=n)==null?void 0:i.some(a=>{var l;return o.parentId===a.id&&((l=o.context)==null?void 0:l.open)})})||[],r=r.concat(n);return r}function dU(e){return"composedPath"in e?e.composedPath()[0]:e.target}const fU=Fl["useInsertionEffect".toString()],pU=fU||(e=>e());function MR(e){const t=f.useRef(()=>{});return pU(()=>{t.current=e}),f.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function gd(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}const hU={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},mU={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},gU=function(e){var t,r;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(r=e.outsidePress)!=null?r:!0}},vU=function(e,t){let{open:r,onOpenChange:n,events:o,nodeId:i,elements:{reference:a,domReference:l,floating:c},dataRef:u}=e,{enabled:d=!0,escapeKey:p=!0,outsidePress:h=!0,outsidePressEvent:m="pointerdown",referencePress:v=!1,referencePressEvent:g="pointerdown",ancestorScroll:b=!1,bubbles:y=!0}=t===void 0?{}:t;const x=X0(),_=TR()!=null,w=MR(typeof h=="function"?h:()=>!1),j=typeof h=="function"?w:h,C=f.useRef(!1),{escapeKeyBubbles:P,outsidePressBubbles:E}=gU(y);return f.useEffect(()=>{if(!r||!d)return;u.current.__escapeKeyBubbles=P,u.current.__outsidePressBubbles=E;function k(M){if(M.key==="Escape"){const L=x?yg(x.nodesRef.current,i):[];if(L.length>0){let q=!0;if(L.forEach(Y=>{var R;if((R=Y.context)!=null&&R.open&&!Y.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),n(!1)}}function $(M){const L=C.current;if(C.current=!1,L||typeof j=="function"&&!j(M))return;const q=dU(M);if(IR(q)&&c){const N=c.ownerDocument.defaultView||window,V=q.scrollWidth>q.clientWidth,Q=q.scrollHeight>q.clientHeight;let ee=Q&&M.offsetX>q.clientWidth;if(Q&&N.getComputedStyle(q).direction==="rtl"&&(ee=M.offsetX<=q.offsetWidth-q.clientWidth),ee||V&&M.offsetY>q.clientHeight)return}const Y=x&&yg(x.nodesRef.current,i).some(N=>{var V;return gd(M,(V=N.context)==null?void 0:V.elements.floating)});if(gd(M,c)||gd(M,l)||Y)return;const R=x?yg(x.nodesRef.current,i):[];if(R.length>0){let N=!0;if(R.forEach(V=>{var Q;if((Q=V.context)!=null&&Q.open&&!V.context.dataRef.current.__outsidePressBubbles){N=!1;return}}),!N)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:_?{preventScroll:!0}:iU(M)||aU(M)}}),n(!1)}function I(){n(!1)}const T=ii(c);p&&T.addEventListener("keydown",k),j&&T.addEventListener(m,$);let z=[];return b&&(Kn(l)&&(z=wo(l)),Kn(c)&&(z=z.concat(wo(c))),!Kn(a)&&a&&a.contextElement&&(z=z.concat(wo(a.contextElement)))),z=z.filter(M=>{var L;return M!==((L=T.defaultView)==null?void 0:L.visualViewport)}),z.forEach(M=>{M.addEventListener("scroll",I,{passive:!0})}),()=>{p&&T.removeEventListener("keydown",k),j&&T.removeEventListener(m,$),z.forEach(M=>{M.removeEventListener("scroll",I)})}},[u,c,l,a,p,j,m,o,x,i,r,n,b,d,P,E,_]),f.useEffect(()=>{C.current=!1},[j,m]),f.useMemo(()=>d?{reference:{[hU[g]]:()=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),n(!1))}},floating:{[mU[m]]:()=>{C.current=!0}}}:{},[d,o,v,m,g,n])},yU=function(e,t){let{open:r,onOpenChange:n,dataRef:o,events:i,refs:a,elements:{floating:l,domReference:c}}=e,{enabled:u=!0,keyboardOnly:d=!0}=t===void 0?{}:t;const p=f.useRef(""),h=f.useRef(!1),m=f.useRef();return f.useEffect(()=>{if(!u)return;const g=ii(l).defaultView||window;function b(){!r&&IR(c)&&c===uU(ii(c))&&(h.current=!0)}return g.addEventListener("blur",b),()=>{g.removeEventListener("blur",b)}},[l,c,r,u]),f.useEffect(()=>{if(!u)return;function v(g){(g.type==="referencePress"||g.type==="escapeKey")&&(h.current=!0)}return i.on("dismiss",v),()=>{i.off("dismiss",v)}},[i,u]),f.useEffect(()=>()=>{clearTimeout(m.current)},[]),f.useMemo(()=>u?{reference:{onPointerDown(v){let{pointerType:g}=v;p.current=g,h.current=!!(g&&d)},onMouseLeave(){h.current=!1},onFocus(v){var g;h.current||v.type==="focus"&&((g=o.current.openEvent)==null?void 0:g.type)==="mousedown"&&o.current.openEvent&&gd(o.current.openEvent,c)||(o.current.openEvent=v.nativeEvent,n(!0))},onBlur(v){h.current=!1;const g=v.relatedTarget,b=Kn(g)&&g.hasAttribute("data-floating-ui-focus-guard")&&g.getAttribute("data-type")==="outside";m.current=setTimeout(()=>{Ib(a.floating.current,g)||Ib(c,g)||b||n(!1)})}}}:{},[u,d,c,a,o,n])},xU=function(e,t){let{open:r}=e,{enabled:n=!0,role:o="dialog"}=t===void 0?{}:t;const i=kb(),a=kb();return f.useMemo(()=>{const l={id:i,role:o};return n?o==="tooltip"?{reference:{"aria-describedby":r?i:void 0},floating:l}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":r?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:a}},floating:{...l,...o==="menu"&&{"aria-labelledby":a}}}:{}},[n,o,r,i,a])};function Z0(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:r,nodeId:n}=e,o=KB(e),i=X0(),a=f.useRef(null),l=f.useRef({}),c=f.useState(()=>ZB())[0],[u,d]=f.useState(null),p=f.useCallback(y=>{const x=Kn(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;o.refs.setReference(x)},[o.refs]),h=f.useCallback(y=>{(Kn(y)||y===null)&&(a.current=y,d(y)),(Kn(o.refs.reference.current)||o.refs.reference.current===null||y!==null&&!Kn(y))&&o.refs.setReference(y)},[o.refs]),m=f.useMemo(()=>({...o.refs,setReference:h,setPositionReference:p,domReference:a}),[o.refs,h,p]),v=f.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),g=MR(r),b=f.useMemo(()=>({...o,refs:m,elements:v,dataRef:l,nodeId:n,events:c,open:t,onOpenChange:g}),[o,n,c,t,g,m,v]);return Ss(()=>{const y=i==null?void 0:i.nodesRef.current.find(x=>x.id===n);y&&(y.context=b)}),f.useMemo(()=>({...o,context:b,refs:m,reference:h,positionReference:p}),[o,m,b,h,p])}function xg(e,t,r){const n=new Map;return{...r==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[r]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(a=>{let[l,c]=a;if(l.indexOf("on")===0){if(n.has(l)||n.set(l,[]),typeof c=="function"){var u;(u=n.get(l))==null||u.push(c),o[l]=function(){for(var d,p=arguments.length,h=new Array(p),m=0;m<p;m++)h[m]=arguments[m];(d=n.get(l))==null||d.forEach(v=>v(...h))}}}else o[l]=c}),o),{})}}const wU=function(e){e===void 0&&(e=[]);const t=e,r=f.useCallback(i=>xg(i,e,"reference"),t),n=f.useCallback(i=>xg(i,e,"floating"),t),o=f.useCallback(i=>xg(i,e,"item"),e.map(i=>i==null?void 0:i.item));return f.useMemo(()=>({getReferenceProps:r,getFloatingProps:n,getItemProps:o}),[r,n,o])};function LR({opened:e,floating:t,position:r,positionDependencies:n}){const[o,i]=f.useState(0);f.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return qB(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,r]),on(()=>{t.update()},n),on(()=>{i(a=>a+1)},[e])}function _U(e){const t=[SR(e.offset)];return e.middlewares.shift&&t.push(q0({limiter:EB()})),e.middlewares.flip&&t.push(wR()),e.middlewares.inline&&t.push(bR()),t.push(RR({element:e.arrowRef,padding:e.arrowOffset})),t}function bU(e){const[t,r]=kr({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),n=()=>{var a;(a=e.onClose)==null||a.call(e),r(!1)},o=()=>{var a,l;t?((a=e.onClose)==null||a.call(e),r(!1)):((l=e.onOpen)==null||l.call(e),r(!0))},i=Z0({placement:e.position,middleware:[..._U(e),...e.width==="target"?[$B({apply({rects:a}){var l,c;Object.assign((c=(l=i.refs.floating.current)==null?void 0:l.style)!=null?c:{},{width:`${a.reference.width}px`})}})]:[]]});return LR({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:i}),on(()=>{var a;(a=e.onPositionChange)==null||a.call(e,i.placement)},[i.placement]),on(()=>{var a,l;e.opened?(l=e.onOpen)==null||l.call(e):(a=e.onClose)==null||a.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:n,onToggle:o}}const zR={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[SU,FR]=Do(zR.context);var PU=Object.defineProperty,OU=Object.defineProperties,jU=Object.getOwnPropertyDescriptors,_f=Object.getOwnPropertySymbols,VR=Object.prototype.hasOwnProperty,BR=Object.prototype.propertyIsEnumerable,Db=(e,t,r)=>t in e?PU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Eu=(e,t)=>{for(var r in t||(t={}))VR.call(t,r)&&Db(e,r,t[r]);if(_f)for(var r of _f(t))BR.call(t,r)&&Db(e,r,t[r]);return e},CU=(e,t)=>OU(e,jU(t)),EU=(e,t)=>{var r={};for(var n in e)VR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&_f)for(var n of _f(e))t.indexOf(n)<0&&BR.call(e,n)&&(r[n]=e[n]);return r};const $U={refProp:"ref",popupType:"dialog",shouldOverrideDefaultTargetId:!0},UR=f.forwardRef((e,t)=>{const r=H("PopoverTarget",$U,e),{children:n,refProp:o,popupType:i,shouldOverrideDefaultTargetId:a}=r,l=EU(r,["children","refProp","popupType","shouldOverrideDefaultTargetId"]);if(!ks(n))throw new Error(zR.children);const c=l,u=FR(),d=Ts(u.reference,n.ref,t),p=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:a?u.getTargetId():n.props.id}:{};return f.cloneElement(n,Eu(CU(Eu(Eu(Eu({},c),p),u.targetProps),{className:vE(u.targetProps.className,c.className,n.props.className),[o]:d}),u.controlled?null:{onClick:u.onToggle}))});UR.displayName="@mantine/core/PopoverTarget";var kU=W((e,{radius:t,shadow:r})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[r]||r||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const RU=kU;var TU=Object.defineProperty,Nb=Object.getOwnPropertySymbols,IU=Object.prototype.hasOwnProperty,DU=Object.prototype.propertyIsEnumerable,Ab=(e,t,r)=>t in e?TU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ka=(e,t)=>{for(var r in t||(t={}))IU.call(t,r)&&Ab(e,r,t[r]);if(Nb)for(var r of Nb(t))DU.call(t,r)&&Ab(e,r,t[r]);return e};const Mb={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function NU({transition:e,state:t,duration:r,timingFunction:n}){const o={transitionDuration:`${r}ms`,transitionTimingFunction:n};return typeof e=="string"?e in nu?ka(ka(ka({transitionProperty:nu[e].transitionProperty},o),nu[e].common),nu[e][Mb[t]]):null:ka(ka(ka({transitionProperty:e.transitionProperty},o),e.common),e[Mb[t]])}function AU({duration:e,exitDuration:t,timingFunction:r,mounted:n,onEnter:o,onExit:i,onEntered:a,onExited:l}){const c=Zt(),u=Lh(),d=c.respectReducedMotion?u:!1,[p,h]=f.useState(d?0:e),[m,v]=f.useState(n?"entered":"exited"),g=f.useRef(-1),b=y=>{const x=y?o:i,_=y?a:l;v(y?"pre-entering":"pre-exiting"),window.clearTimeout(g.current);const w=d?0:y?e:t;if(h(w),w===0)typeof x=="function"&&x(),typeof _=="function"&&_(),v(y?"entered":"exited");else{const j=window.setTimeout(()=>{typeof x=="function"&&x(),v(y?"entering":"exiting")},10);g.current=window.setTimeout(()=>{window.clearTimeout(j),typeof _=="function"&&_(),v(y?"entered":"exited")},w)}};return on(()=>{b(n)},[n]),f.useEffect(()=>()=>window.clearTimeout(g.current),[]),{transitionDuration:p,transitionStatus:m,transitionTimingFunction:r||c.transitionTimingFunction}}function va({keepMounted:e,transition:t,duration:r=250,exitDuration:n=r,mounted:o,children:i,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d}){const{transitionDuration:p,transitionStatus:h,transitionTimingFunction:m}=AU({mounted:o,exitDuration:n,duration:r,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d});return p===0?o?S.createElement(S.Fragment,null,i({})):e?i({display:"none"}):null:h==="exited"?e?i({display:"none"}):null:S.createElement(S.Fragment,null,i(NU({transition:t,duration:p,state:h,timingFunction:m})))}va.displayName="@mantine/core/Transition";function ex({children:e,active:t=!0,refProp:r="ref"}){const n=YL(t),o=Ts(n,e==null?void 0:e.ref);return ks(e)?f.cloneElement(e,{[r]:o}):e}ex.displayName="@mantine/core/FocusTrap";var MU=Object.defineProperty,LU=Object.defineProperties,zU=Object.getOwnPropertyDescriptors,Lb=Object.getOwnPropertySymbols,FU=Object.prototype.hasOwnProperty,VU=Object.prototype.propertyIsEnumerable,zb=(e,t,r)=>t in e?MU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qo=(e,t)=>{for(var r in t||(t={}))FU.call(t,r)&&zb(e,r,t[r]);if(Lb)for(var r of Lb(t))VU.call(t,r)&&zb(e,r,t[r]);return e},$u=(e,t)=>LU(e,zU(t));function Fb(e,t,r,n){return e==="center"||n==="center"?{top:t}:e==="end"?{bottom:r}:e==="start"?{top:r}:{}}function Vb(e,t,r,n,o){return e==="center"||n==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:r}:e==="start"?{[o==="ltr"?"left":"right"]:r}:{}}const BU={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function UU({position:e,arrowSize:t,arrowOffset:r,arrowRadius:n,arrowPosition:o,arrowX:i,arrowY:a,dir:l}){const[c,u="center"]=e.split("-"),d={width:O(t),height:O(t),transform:"rotate(45deg)",position:"absolute",[BU[c]]:O(n)},p=O(-t/2);return c==="left"?$u(Qo(Qo({},d),Fb(u,a,r,o)),{right:p,borderLeftColor:"transparent",borderBottomColor:"transparent"}):c==="right"?$u(Qo(Qo({},d),Fb(u,a,r,o)),{left:p,borderRightColor:"transparent",borderTopColor:"transparent"}):c==="top"?$u(Qo(Qo({},d),Vb(u,i,r,o,l)),{bottom:p,borderTopColor:"transparent",borderLeftColor:"transparent"}):c==="bottom"?$u(Qo(Qo({},d),Vb(u,i,r,o,l)),{top:p,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var WU=Object.defineProperty,HU=Object.defineProperties,GU=Object.getOwnPropertyDescriptors,bf=Object.getOwnPropertySymbols,WR=Object.prototype.hasOwnProperty,HR=Object.prototype.propertyIsEnumerable,Bb=(e,t,r)=>t in e?WU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qU=(e,t)=>{for(var r in t||(t={}))WR.call(t,r)&&Bb(e,r,t[r]);if(bf)for(var r of bf(t))HR.call(t,r)&&Bb(e,r,t[r]);return e},QU=(e,t)=>HU(e,GU(t)),KU=(e,t)=>{var r={};for(var n in e)WR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&bf)for(var n of bf(e))t.indexOf(n)<0&&HR.call(e,n)&&(r[n]=e[n]);return r};const tx=f.forwardRef((e,t)=>{var r=e,{position:n,arrowSize:o,arrowOffset:i,arrowRadius:a,arrowPosition:l,visible:c,arrowX:u,arrowY:d}=r,p=KU(r,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const h=Zt();return c?S.createElement("div",QU(qU({},p),{ref:t,style:UU({position:n,arrowSize:o,arrowOffset:i,arrowRadius:a,arrowPosition:l,dir:h.dir,arrowX:u,arrowY:d})})):null});tx.displayName="@mantine/core/FloatingArrow";var YU=Object.defineProperty,XU=Object.defineProperties,JU=Object.getOwnPropertyDescriptors,Sf=Object.getOwnPropertySymbols,GR=Object.prototype.hasOwnProperty,qR=Object.prototype.propertyIsEnumerable,Ub=(e,t,r)=>t in e?YU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ra=(e,t)=>{for(var r in t||(t={}))GR.call(t,r)&&Ub(e,r,t[r]);if(Sf)for(var r of Sf(t))qR.call(t,r)&&Ub(e,r,t[r]);return e},ku=(e,t)=>XU(e,JU(t)),ZU=(e,t)=>{var r={};for(var n in e)GR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Sf)for(var n of Sf(e))t.indexOf(n)<0&&qR.call(e,n)&&(r[n]=e[n]);return r};const eW={};function QR(e){var t;const r=H("PopoverDropdown",eW,e),{style:n,className:o,children:i,onKeyDownCapture:a}=r,l=ZU(r,["style","className","children","onKeyDownCapture"]),c=FR(),{classes:u,cx:d}=RU({radius:c.radius,shadow:c.shadow},{name:c.__staticSelector,classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant}),p=WE({opened:c.opened,shouldReturnFocus:c.returnFocus}),h=c.withRoles?{"aria-labelledby":c.getTargetId(),id:c.getDropdownId(),role:"dialog"}:{};return c.disabled?null:S.createElement(Ns,ku(Ra({},c.portalProps),{withinPortal:c.withinPortal}),S.createElement(va,ku(Ra({mounted:c.opened},c.transitionProps),{transition:c.transitionProps.transition||"fade",duration:(t=c.transitionProps.duration)!=null?t:150,keepMounted:c.keepMounted,exitDuration:typeof c.transitionProps.exitDuration=="number"?c.transitionProps.exitDuration:c.transitionProps.duration}),m=>{var v,g;return S.createElement(ex,{active:c.trapFocus},S.createElement(oe,Ra(ku(Ra({},h),{tabIndex:-1,ref:c.floating,style:ku(Ra(Ra({},n),m),{zIndex:c.zIndex,top:(v=c.y)!=null?v:0,left:(g=c.x)!=null?g:0,width:c.width==="target"?void 0:O(c.width)}),className:d(u.dropdown,o),onKeyDownCapture:vM(c.onClose,{active:c.closeOnEscape,onTrigger:p,onKeyDown:a}),"data-position":c.placement}),l),i,S.createElement(tx,{ref:c.arrowRef,arrowX:c.arrowX,arrowY:c.arrowY,visible:c.withArrow,position:c.placement,arrowSize:c.arrowSize,arrowRadius:c.arrowRadius,arrowOffset:c.arrowOffset,arrowPosition:c.arrowPosition,className:u.arrow})))}))}QR.displayName="@mantine/core/PopoverDropdown";function KR(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[r,n]=t.split("-"),o=r==="right"?"left":"right";return n===void 0?o:`${o}-${n}`}return t}var Wb=Object.getOwnPropertySymbols,tW=Object.prototype.hasOwnProperty,rW=Object.prototype.propertyIsEnumerable,nW=(e,t)=>{var r={};for(var n in e)tW.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wb)for(var n of Wb(e))t.indexOf(n)<0&&rW.call(e,n)&&(r[n]=e[n]);return r};const oW={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:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:$n("popover"),__staticSelector:"Popover",width:"max-content"};function Lo(e){var t,r,n,o,i,a;const l=f.useRef(null),c=H("Popover",oW,e),{children:u,position:d,offset:p,onPositionChange:h,positionDependencies:m,opened:v,transitionProps:g,width:b,middlewares:y,withArrow:x,arrowSize:_,arrowOffset:w,arrowRadius:j,arrowPosition:C,unstyled:P,classNames:E,styles:k,closeOnClickOutside:$,withinPortal:I,portalProps:T,closeOnEscape:z,clickOutsideEvents:M,trapFocus:L,onClose:q,onOpen:Y,onChange:R,zIndex:N,radius:V,shadow:Q,id:ee,defaultOpened:_e,__staticSelector:we,withRoles:Ue,disabled:Ae,returnFocus:pt,variant:Nt,keepMounted:Pe}=c,Gt=nW(c,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[Ar,cr]=f.useState(null),[qt,At]=f.useState(null),io=Ir(ee),ao=Zt(),Ye=bU({middlewares:y,width:b,position:KR(ao.dir,d),offset:typeof p=="number"?p+(x?_/2:0):p,arrowRef:l,arrowOffset:w,onPositionChange:h,positionDependencies:m,opened:v,defaultOpened:_e,onChange:R,onOpen:Y,onClose:q});zL(()=>Ye.opened&&$&&Ye.onClose(),M,[Ar,qt]);const so=f.useCallback(Ft=>{cr(Ft),Ye.floating.reference(Ft)},[Ye.floating.reference]),Rn=f.useCallback(Ft=>{At(Ft),Ye.floating.floating(Ft)},[Ye.floating.floating]);return S.createElement(SU,{value:{returnFocus:pt,disabled:Ae,controlled:Ye.controlled,reference:so,floating:Rn,x:Ye.floating.x,y:Ye.floating.y,arrowX:(n=(r=(t=Ye.floating)==null?void 0:t.middlewareData)==null?void 0:r.arrow)==null?void 0:n.x,arrowY:(a=(i=(o=Ye.floating)==null?void 0:o.middlewareData)==null?void 0:i.arrow)==null?void 0:a.y,opened:Ye.opened,arrowRef:l,transitionProps:g,width:b,withArrow:x,arrowSize:_,arrowOffset:w,arrowRadius:j,arrowPosition:C,placement:Ye.floating.placement,trapFocus:L,withinPortal:I,portalProps:T,zIndex:N,radius:V,shadow:Q,closeOnEscape:z,onClose:Ye.onClose,onToggle:Ye.onToggle,getTargetId:()=>`${io}-target`,getDropdownId:()=>`${io}-dropdown`,withRoles:Ue,targetProps:Gt,__staticSelector:we,classNames:E,styles:k,unstyled:P,variant:Nt,keepMounted:Pe}},u)}Lo.Target=UR;Lo.Dropdown=QR;Lo.displayName="@mantine/core/Popover";var iW=Object.defineProperty,Pf=Object.getOwnPropertySymbols,YR=Object.prototype.hasOwnProperty,XR=Object.prototype.propertyIsEnumerable,Hb=(e,t,r)=>t in e?iW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aW=(e,t)=>{for(var r in t||(t={}))YR.call(t,r)&&Hb(e,r,t[r]);if(Pf)for(var r of Pf(t))XR.call(t,r)&&Hb(e,r,t[r]);return e},sW=(e,t)=>{var r={};for(var n in e)YR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pf)for(var n of Pf(e))t.indexOf(n)<0&&XR.call(e,n)&&(r[n]=e[n]);return r};function lW(e){var t=e,{children:r,component:n="div",maxHeight:o=220,direction:i="column",id:a,innerRef:l,__staticSelector:c,styles:u,classNames:d,unstyled:p}=t,h=sW(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:m}=vB(null,{name:c,styles:u,classNames:d,unstyled:p});return S.createElement(Lo.Dropdown,aW({p:0,onMouseDown:v=>v.preventDefault()},h),S.createElement("div",{style:{maxHeight:O(o),display:"flex"}},S.createElement(oe,{component:n||"div",id:`${a}-items`,"aria-labelledby":`${a}-label`,role:"listbox",onMouseDown:v=>v.preventDefault(),style:{flex:1,overflowY:n!==V0?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},S.createElement("div",{className:m.itemsWrapper,style:{flexDirection:i}},r))))}function Al({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:r,withinPortal:n,portalProps:o,children:i,__staticSelector:a,onDirectionChange:l,switchDirectionOnFlip:c,zIndex:u,dropdownPosition:d,positionDependencies:p=[],classNames:h,styles:m,unstyled:v,readOnly:g,variant:b}){return S.createElement(Lo,{unstyled:v,classNames:h,styles:m,width:"target",withRoles:!1,opened:e,middlewares:{flip:d==="flip",shift:!1},position:d==="flip"?"bottom":d,positionDependencies:p,zIndex:u,__staticSelector:a,withinPortal:n,portalProps:o,transitionProps:t,shadow:r,disabled:g,onPositionChange:y=>c&&(l==null?void 0:l(y==="top"?"column-reverse":"column")),variant:b},i)}Al.Target=Lo.Target;Al.Dropdown=lW;var cW=Object.defineProperty,uW=Object.defineProperties,dW=Object.getOwnPropertyDescriptors,Of=Object.getOwnPropertySymbols,JR=Object.prototype.hasOwnProperty,ZR=Object.prototype.propertyIsEnumerable,Gb=(e,t,r)=>t in e?cW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ru=(e,t)=>{for(var r in t||(t={}))JR.call(t,r)&&Gb(e,r,t[r]);if(Of)for(var r of Of(t))ZR.call(t,r)&&Gb(e,r,t[r]);return e},fW=(e,t)=>uW(e,dW(t)),pW=(e,t)=>{var r={};for(var n in e)JR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Of)for(var n of Of(e))t.indexOf(n)<0&&ZR.call(e,n)&&(r[n]=e[n]);return r};function eT(e,t,r){const n=H(e,t,r),{label:o,description:i,error:a,required:l,classNames:c,styles:u,className:d,unstyled:p,__staticSelector:h,sx:m,errorProps:v,labelProps:g,descriptionProps:b,wrapperProps:y,id:x,size:_,style:w,inputContainer:j,inputWrapperOrder:C,withAsterisk:P,variant:E}=n,k=pW(n,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),$=Ir(x),{systemStyles:I,rest:T}=no(k),z=Ru({label:o,description:i,error:a,required:l,classNames:c,className:d,__staticSelector:h,sx:m,errorProps:v,labelProps:g,descriptionProps:b,unstyled:p,styles:u,id:$,size:_,style:w,inputContainer:j,inputWrapperOrder:C,withAsterisk:P,variant:E},y);return fW(Ru({},T),{classNames:c,styles:u,unstyled:p,wrapperProps:Ru(Ru({},z),I),inputProps:{required:l,classNames:c,styles:u,unstyled:p,id:$,size:_,__staticSelector:h,error:a,variant:E}})}var hW=W((e,t,{size:r})=>({label:{display:"inline-block",fontSize:A({size:r,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const mW=hW;var gW=Object.defineProperty,jf=Object.getOwnPropertySymbols,tT=Object.prototype.hasOwnProperty,rT=Object.prototype.propertyIsEnumerable,qb=(e,t,r)=>t in e?gW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vW=(e,t)=>{for(var r in t||(t={}))tT.call(t,r)&&qb(e,r,t[r]);if(jf)for(var r of jf(t))rT.call(t,r)&&qb(e,r,t[r]);return e},yW=(e,t)=>{var r={};for(var n in e)tT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&jf)for(var n of jf(e))t.indexOf(n)<0&&rT.call(e,n)&&(r[n]=e[n]);return r};const xW={labelElement:"label",size:"sm"},rx=f.forwardRef((e,t)=>{const r=H("InputLabel",xW,e),{labelElement:n,children:o,required:i,size:a,classNames:l,styles:c,unstyled:u,className:d,htmlFor:p,__staticSelector:h,variant:m,onMouseDown:v}=r,g=yW(r,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:b,cx:y}=mW(null,{name:["InputWrapper",h],classNames:l,styles:c,unstyled:u,variant:m,size:a});return S.createElement(oe,vW({component:n,ref:t,className:y(b.label,d),htmlFor:n==="label"?p:void 0,onMouseDown:x=>{v==null||v(x),!x.defaultPrevented&&x.detail>1&&x.preventDefault()}},g),o,i&&S.createElement("span",{className:b.required,"aria-hidden":!0}," *"))});rx.displayName="@mantine/core/InputLabel";var wW=W((e,t,{size:r})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${O(2)})`,lineHeight:1.2,display:"block"}}));const _W=wW;var bW=Object.defineProperty,Cf=Object.getOwnPropertySymbols,nT=Object.prototype.hasOwnProperty,oT=Object.prototype.propertyIsEnumerable,Qb=(e,t,r)=>t in e?bW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SW=(e,t)=>{for(var r in t||(t={}))nT.call(t,r)&&Qb(e,r,t[r]);if(Cf)for(var r of Cf(t))oT.call(t,r)&&Qb(e,r,t[r]);return e},PW=(e,t)=>{var r={};for(var n in e)nT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cf)for(var n of Cf(e))t.indexOf(n)<0&&oT.call(e,n)&&(r[n]=e[n]);return r};const OW={size:"sm"},nx=f.forwardRef((e,t)=>{const r=H("InputError",OW,e),{children:n,className:o,classNames:i,styles:a,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=PW(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=_W(null,{name:["InputWrapper",u],classNames:i,styles:a,unstyled:l,variant:d,size:c});return S.createElement(re,SW({className:m(h.error,o),ref:t},p),n)});nx.displayName="@mantine/core/InputError";var jW=W((e,t,{size:r})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${O(2)})`,lineHeight:1.2,display:"block"}}));const CW=jW;var EW=Object.defineProperty,Ef=Object.getOwnPropertySymbols,iT=Object.prototype.hasOwnProperty,aT=Object.prototype.propertyIsEnumerable,Kb=(e,t,r)=>t in e?EW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$W=(e,t)=>{for(var r in t||(t={}))iT.call(t,r)&&Kb(e,r,t[r]);if(Ef)for(var r of Ef(t))aT.call(t,r)&&Kb(e,r,t[r]);return e},kW=(e,t)=>{var r={};for(var n in e)iT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ef)for(var n of Ef(e))t.indexOf(n)<0&&aT.call(e,n)&&(r[n]=e[n]);return r};const RW={size:"sm"},ox=f.forwardRef((e,t)=>{const r=H("InputDescription",RW,e),{children:n,className:o,classNames:i,styles:a,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=kW(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=CW(null,{name:["InputWrapper",u],classNames:i,styles:a,unstyled:l,variant:d,size:c});return S.createElement(re,$W({color:"dimmed",className:m(h.description,o),ref:t,unstyled:l},p),n)});ox.displayName="@mantine/core/InputDescription";const sT=f.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),TW=sT.Provider,IW=()=>f.useContext(sT);function DW(e,{hasDescription:t,hasError:r}){const n=e.findIndex(c=>c==="input"),o=e[n-1],i=e[n+1];return{offsetBottom:t&&i==="description"||r&&i==="error",offsetTop:t&&o==="description"||r&&o==="error"}}var NW=Object.defineProperty,AW=Object.defineProperties,MW=Object.getOwnPropertyDescriptors,Yb=Object.getOwnPropertySymbols,LW=Object.prototype.hasOwnProperty,zW=Object.prototype.propertyIsEnumerable,Xb=(e,t,r)=>t in e?NW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,FW=(e,t)=>{for(var r in t||(t={}))LW.call(t,r)&&Xb(e,r,t[r]);if(Yb)for(var r of Yb(t))zW.call(t,r)&&Xb(e,r,t[r]);return e},VW=(e,t)=>AW(e,MW(t)),BW=W(e=>({root:VW(FW({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const UW=BW;var WW=Object.defineProperty,HW=Object.defineProperties,GW=Object.getOwnPropertyDescriptors,$f=Object.getOwnPropertySymbols,lT=Object.prototype.hasOwnProperty,cT=Object.prototype.propertyIsEnumerable,Jb=(e,t,r)=>t in e?WW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ko=(e,t)=>{for(var r in t||(t={}))lT.call(t,r)&&Jb(e,r,t[r]);if($f)for(var r of $f(t))cT.call(t,r)&&Jb(e,r,t[r]);return e},Zb=(e,t)=>HW(e,GW(t)),qW=(e,t)=>{var r={};for(var n in e)lT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$f)for(var n of $f(e))t.indexOf(n)<0&&cT.call(e,n)&&(r[n]=e[n]);return r};const QW={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},uT=f.forwardRef((e,t)=>{const r=H("InputWrapper",QW,e),{className:n,label:o,children:i,required:a,id:l,error:c,description:u,labelElement:d,labelProps:p,descriptionProps:h,errorProps:m,classNames:v,styles:g,size:b,inputContainer:y,__staticSelector:x,unstyled:_,inputWrapperOrder:w,withAsterisk:j,variant:C}=r,P=qW(r,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:E,cx:k}=UW(null,{classNames:v,styles:g,name:["InputWrapper",x],unstyled:_,variant:C,size:b}),$={classNames:v,styles:g,unstyled:_,size:b,variant:C,__staticSelector:x},I=typeof j=="boolean"?j:a,T=l?`${l}-error`:m==null?void 0:m.id,z=l?`${l}-description`:h==null?void 0:h.id,L=`${!!c&&typeof c!="boolean"?T:""} ${u?z:""}`,q=L.trim().length>0?L.trim():void 0,Y=o&&S.createElement(rx,Ko(Ko({key:"label",labelElement:d,id:l?`${l}-label`:void 0,htmlFor:l,required:I},$),p),o),R=u&&S.createElement(ox,Zb(Ko(Ko({key:"description"},h),$),{size:(h==null?void 0:h.size)||$.size,id:(h==null?void 0:h.id)||z}),u),N=S.createElement(f.Fragment,{key:"input"},y(i)),V=typeof c!="boolean"&&c&&S.createElement(nx,Zb(Ko(Ko({},m),$),{size:(m==null?void 0:m.size)||$.size,key:"error",id:(m==null?void 0:m.id)||T}),c),Q=w.map(ee=>{switch(ee){case"label":return Y;case"input":return N;case"description":return R;case"error":return V;default:return null}});return S.createElement(TW,{value:Ko({describedBy:q},DW(w,{hasDescription:!!R,hasError:!!V}))},S.createElement(oe,Ko({className:k(E.root,n),ref:t},P),Q))});uT.displayName="@mantine/core/InputWrapper";var KW=Object.defineProperty,kf=Object.getOwnPropertySymbols,dT=Object.prototype.hasOwnProperty,fT=Object.prototype.propertyIsEnumerable,eS=(e,t,r)=>t in e?KW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YW=(e,t)=>{for(var r in t||(t={}))dT.call(t,r)&&eS(e,r,t[r]);if(kf)for(var r of kf(t))fT.call(t,r)&&eS(e,r,t[r]);return e},XW=(e,t)=>{var r={};for(var n in e)dT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kf)for(var n of kf(e))t.indexOf(n)<0&&fT.call(e,n)&&(r[n]=e[n]);return r};const JW={},pT=f.forwardRef((e,t)=>{const r=H("InputPlaceholder",JW,e),{sx:n}=r,o=XW(r,["sx"]);return S.createElement(oe,YW({component:"span",sx:[i=>i.fn.placeholderStyles(),...vc(n)],ref:t},o))});pT.displayName="@mantine/core/InputPlaceholder";var ZW=Object.defineProperty,eH=Object.defineProperties,tH=Object.getOwnPropertyDescriptors,tS=Object.getOwnPropertySymbols,rH=Object.prototype.hasOwnProperty,nH=Object.prototype.propertyIsEnumerable,rS=(e,t,r)=>t in e?ZW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tu=(e,t)=>{for(var r in t||(t={}))rH.call(t,r)&&rS(e,r,t[r]);if(tS)for(var r of tS(t))nH.call(t,r)&&rS(e,r,t[r]);return e},wg=(e,t)=>eH(e,tH(t));const $t={xs:O(30),sm:O(36),md:O(42),lg:O(50),xl:O(60)},oH=["default","filled","unstyled"];function iH({theme:e,variant:t}){return oH.includes(t)?t==="default"?{border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${O(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:O(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var aH=W((e,{multiline:t,radius:r,invalid:n,rightSectionWidth:o,withRightSection:i,iconWidth:a,offsetBottom:l,offsetTop:c,pointer:u},{variant:d,size:p})=>{const h=e.fn.variant({variant:"filled",color:"red"}).background,m=d==="default"||d==="filled"?{minHeight:A({size:p,sizes:$t}),paddingLeft:`calc(${A({size:p,sizes:$t})} / 3)`,paddingRight:i?o||A({size:p,sizes:$t}):`calc(${A({size:p,sizes:$t})} / 3)`,borderRadius:e.fn.radius(r)}:d==="unstyled"&&i?{paddingRight:o||A({size:p,sizes:$t})}:null;return{wrapper:{position:"relative",marginTop:c?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:wg(Tu(Tu(wg(Tu({},e.fn.fontStyles()),{height:t?d==="unstyled"?void 0:"auto":A({size:p,sizes:$t}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${A({size:p,sizes:$t})} - ${O(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:A({size:p,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:u?"pointer":void 0}),iH({theme:e,variant:d})),m),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:h,borderColor:h,"&::placeholder":{opacity:1,color:h}},"&[data-with-icon]":{paddingLeft:typeof a=="number"?O(a):A({size:p,sizes:$t})},"&::placeholder":wg(Tu({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:a?O(a):A({size:p,sizes:$t}),color:n?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||A({size:p,sizes:$t})}}});const sH=aH;var lH=Object.defineProperty,cH=Object.defineProperties,uH=Object.getOwnPropertyDescriptors,Rf=Object.getOwnPropertySymbols,hT=Object.prototype.hasOwnProperty,mT=Object.prototype.propertyIsEnumerable,nS=(e,t,r)=>t in e?lH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Iu=(e,t)=>{for(var r in t||(t={}))hT.call(t,r)&&nS(e,r,t[r]);if(Rf)for(var r of Rf(t))mT.call(t,r)&&nS(e,r,t[r]);return e},oS=(e,t)=>cH(e,uH(t)),dH=(e,t)=>{var r={};for(var n in e)hT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Rf)for(var n of Rf(e))t.indexOf(n)<0&&mT.call(e,n)&&(r[n]=e[n]);return r};const fH={size:"sm",variant:"default"},ya=f.forwardRef((e,t)=>{const r=H("Input",fH,e),{className:n,error:o,required:i,disabled:a,variant:l,icon:c,style:u,rightSectionWidth:d,iconWidth:p,rightSection:h,rightSectionProps:m,radius:v,size:g,wrapperProps:b,classNames:y,styles:x,__staticSelector:_,multiline:w,sx:j,unstyled:C,pointer:P}=r,E=dH(r,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:k,offsetTop:$,describedBy:I}=IW(),{classes:T,cx:z}=sH({radius:v,multiline:w,invalid:!!o,rightSectionWidth:d?O(d):void 0,iconWidth:p,withRightSection:!!h,offsetBottom:k,offsetTop:$,pointer:P},{classNames:y,styles:x,name:["Input",_],unstyled:C,variant:l,size:g}),{systemStyles:M,rest:L}=no(E);return S.createElement(oe,Iu(Iu({className:z(T.wrapper,n),sx:j,style:u},M),b),c&&S.createElement("div",{className:T.icon},c),S.createElement(oe,oS(Iu({component:"input"},L),{ref:t,required:i,"aria-invalid":!!o,"aria-describedby":I,disabled:a,"data-disabled":a||void 0,"data-with-icon":!!c||void 0,"data-invalid":!!o||void 0,className:T.input})),h&&S.createElement("div",oS(Iu({},m),{className:T.rightSection}),h))});ya.displayName="@mantine/core/Input";ya.Wrapper=uT;ya.Label=rx;ya.Description=ox;ya.Error=nx;ya.Placeholder=pT;const Wt=ya;var pH=Object.defineProperty,Tf=Object.getOwnPropertySymbols,gT=Object.prototype.hasOwnProperty,vT=Object.prototype.propertyIsEnumerable,iS=(e,t,r)=>t in e?pH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hH=(e,t)=>{for(var r in t||(t={}))gT.call(t,r)&&iS(e,r,t[r]);if(Tf)for(var r of Tf(t))vT.call(t,r)&&iS(e,r,t[r]);return e},mH=(e,t)=>{var r={};for(var n in e)gT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Tf)for(var n of Tf(e))t.indexOf(n)<0&&vT.call(e,n)&&(r[n]=e[n]);return r};function gH(e){const t=e,{style:r}=t,n=mH(t,["style"]);return S.createElement("svg",hH({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r},n),S.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"}))}var vH=Object.defineProperty,yH=Object.defineProperties,xH=Object.getOwnPropertyDescriptors,aS=Object.getOwnPropertySymbols,wH=Object.prototype.hasOwnProperty,_H=Object.prototype.propertyIsEnumerable,sS=(e,t,r)=>t in e?vH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bH=(e,t)=>{for(var r in t||(t={}))wH.call(t,r)&&sS(e,r,t[r]);if(aS)for(var r of aS(t))_H.call(t,r)&&sS(e,r,t[r]);return e},SH=(e,t)=>yH(e,xH(t));const yT=f.createContext(null);function PH({spacing:e,children:t}){return S.createElement(yT.Provider,{value:{spacing:e}},t)}function OH(){const e=f.useContext(yT);return e?SH(bH({},e),{withinGroup:!0}):{spacing:null,withinGroup:!1}}var jH=W((e,{spacing:t})=>({root:{display:"flex",paddingLeft:A({size:t,sizes:e.spacing})}}));const CH=jH;var EH=Object.defineProperty,If=Object.getOwnPropertySymbols,xT=Object.prototype.hasOwnProperty,wT=Object.prototype.propertyIsEnumerable,lS=(e,t,r)=>t in e?EH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$H=(e,t)=>{for(var r in t||(t={}))xT.call(t,r)&&lS(e,r,t[r]);if(If)for(var r of If(t))wT.call(t,r)&&lS(e,r,t[r]);return e},kH=(e,t)=>{var r={};for(var n in e)xT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&If)for(var n of If(e))t.indexOf(n)<0&&wT.call(e,n)&&(r[n]=e[n]);return r};const RH={},_T=f.forwardRef((e,t)=>{const r=H("AvatarGroup",RH,e),{children:n,spacing:o="sm",unstyled:i,className:a,variant:l}=r,c=kH(r,["children","spacing","unstyled","className","variant"]),{classes:u,cx:d}=CH({spacing:o},{name:"AvatarGroup",unstyled:i,variant:l});return S.createElement(PH,{spacing:o},S.createElement(oe,$H({ref:t,className:d(u.root,a)},c),n))});_T.displayName="@mantine/core/AvatarGroup";var TH=Object.defineProperty,IH=Object.defineProperties,DH=Object.getOwnPropertyDescriptors,cS=Object.getOwnPropertySymbols,NH=Object.prototype.hasOwnProperty,AH=Object.prototype.propertyIsEnumerable,uS=(e,t,r)=>t in e?TH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nl=(e,t)=>{for(var r in t||(t={}))NH.call(t,r)&&uS(e,r,t[r]);if(cS)for(var r of cS(t))AH.call(t,r)&&uS(e,r,t[r]);return e},dS=(e,t)=>IH(e,DH(t));const MH=["filled","light","gradient","outline"],Du={xs:O(16),sm:O(26),md:O(38),lg:O(56),xl:O(84)};function LH({withinGroup:e,spacing:t,theme:r}){return e?{marginLeft:`calc(${A({size:t,sizes:r.spacing})} * -1)`,backgroundColor:`${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`,border:`${O(2)} solid ${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`}:null}function zH({theme:e,variant:t,color:r,gradient:n}){const o=e.fn.variant({variant:t,color:r,gradient:n});return MH.includes(t)?{placeholder:{color:o.color,backgroundColor:o.background,backgroundImage:t==="gradient"?o.background:void 0,border:`${O(t==="gradient"?0:1)} solid ${o.border}`},placeholderIcon:{color:o.color}}:{}}var FH=W((e,{radius:t,withinGroup:r,spacing:n,color:o,gradient:i},{variant:a,size:l})=>{const c=zH({theme:e,color:o,gradient:i,variant:a});return{root:nl(dS(nl({},e.fn.focusStyles()),{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",display:"block",userSelect:"none",overflow:"hidden",borderRadius:e.fn.radius(t),textDecoration:"none",border:0,backgroundColor:"transparent",padding:0,width:A({size:l,sizes:Du}),minWidth:A({size:l,sizes:Du}),height:A({size:l,sizes:Du})}),LH({withinGroup:r,spacing:n,theme:e})),image:{objectFit:"cover",width:"100%",height:"100%",display:"block"},placeholder:nl(dS(nl({},e.fn.fontStyles()),{fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",userSelect:"none",borderRadius:e.fn.radius(t),fontSize:`calc(${A({size:l,sizes:Du})} / 2.5)`}),c.placeholder),placeholderIcon:nl({width:"70%",height:"70%"},c.placeholderIcon)}});const VH=FH;var BH=Object.defineProperty,UH=Object.defineProperties,WH=Object.getOwnPropertyDescriptors,Df=Object.getOwnPropertySymbols,bT=Object.prototype.hasOwnProperty,ST=Object.prototype.propertyIsEnumerable,fS=(e,t,r)=>t in e?BH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pS=(e,t)=>{for(var r in t||(t={}))bT.call(t,r)&&fS(e,r,t[r]);if(Df)for(var r of Df(t))ST.call(t,r)&&fS(e,r,t[r]);return e},HH=(e,t)=>UH(e,WH(t)),GH=(e,t)=>{var r={};for(var n in e)bT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Df)for(var n of Df(e))t.indexOf(n)<0&&ST.call(e,n)&&(r[n]=e[n]);return r};const qH={size:"md",color:"gray",variant:"light"},ix=f.forwardRef((e,t)=>{const r=H("Avatar",qH,e),{className:n,size:o,src:i,alt:a,radius:l,children:c,color:u,variant:d,gradient:p,classNames:h,styles:m,imageProps:v,unstyled:g}=r,b=GH(r,["className","size","src","alt","radius","children","color","variant","gradient","classNames","styles","imageProps","unstyled"]),y=OH(),[x,_]=f.useState(!i),{classes:w,cx:j}=VH({color:u,radius:l,withinGroup:y.withinGroup,spacing:y.spacing,gradient:p},{classNames:h,styles:m,unstyled:g,name:"Avatar",variant:d,size:o});return f.useEffect(()=>{_(!i)},[i]),S.createElement(oe,pS({component:"div",className:j(w.root,n),ref:t},b),x?S.createElement("div",{className:w.placeholder,title:a},c||S.createElement(gH,{className:w.placeholderIcon})):S.createElement("img",HH(pS({},v),{className:w.image,src:i,alt:a,onError:()=>_(!0)})))});ix.displayName="@mantine/core/Avatar";ix.Group=_T;const Nf=ix;var QH=Object.defineProperty,KH=Object.defineProperties,YH=Object.getOwnPropertyDescriptors,hS=Object.getOwnPropertySymbols,XH=Object.prototype.hasOwnProperty,JH=Object.prototype.propertyIsEnumerable,mS=(e,t,r)=>t in e?QH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_g=(e,t)=>{for(var r in t||(t={}))XH.call(t,r)&&mS(e,r,t[r]);if(hS)for(var r of hS(t))JH.call(t,r)&&mS(e,r,t[r]);return e},ZH=(e,t)=>KH(e,YH(t));const eG=["light","filled","outline","dot","gradient"],bg={xs:{fontSize:O(9),height:O(16)},sm:{fontSize:O(10),height:O(18)},md:{fontSize:O(11),height:O(20)},lg:{fontSize:O(13),height:O(26)},xl:{fontSize:O(16),height:O(32)}},tG={xs:O(4),sm:O(4),md:O(6),lg:O(8),xl:O(10)};function rG({theme:e,variant:t,color:r,size:n,gradient:o}){if(!eG.includes(t))return null;if(t==="dot"){const a=A({size:n,sizes:tG});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${A({size:n,sizes:e.spacing})} / 1.5 - ${a} / 2)`,"&::before":{content:'""',display:"block",width:a,height:a,borderRadius:a,backgroundColor:e.fn.themeColor(r,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:a}}}const i=e.fn.variant({color:r,variant:t,gradient:o});return{background:i.background,color:i.color,border:`${O(t==="gradient"?0:1)} solid ${i.border}`}}var nG=W((e,{color:t,radius:r,gradient:n,fullWidth:o},{variant:i,size:a})=>{const{fontSize:l,height:c}=a in bg?bg[a]:bg.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:_g(ZH(_g(_g({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:l,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${O(2)})`,textDecoration:"none",padding:`0 calc(${A({size:a,sizes:e.spacing})} / 1.5)`,boxSizing:"border-box",display:o?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:o?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(r),fontWeight:700,letterSpacing:O(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),rG({theme:e,variant:i,color:t,size:a,gradient:n}))}});const oG=nG;var iG=Object.defineProperty,Af=Object.getOwnPropertySymbols,PT=Object.prototype.hasOwnProperty,OT=Object.prototype.propertyIsEnumerable,gS=(e,t,r)=>t in e?iG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aG=(e,t)=>{for(var r in t||(t={}))PT.call(t,r)&&gS(e,r,t[r]);if(Af)for(var r of Af(t))OT.call(t,r)&&gS(e,r,t[r]);return e},sG=(e,t)=>{var r={};for(var n in e)PT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Af)for(var n of Af(e))t.indexOf(n)<0&&OT.call(e,n)&&(r[n]=e[n]);return r};const lG={variant:"light",size:"md",radius:"xl"},jT=f.forwardRef((e,t)=>{const r=H("Badge",lG,e),{className:n,color:o,variant:i,fullWidth:a,children:l,size:c,leftSection:u,rightSection:d,radius:p,gradient:h,classNames:m,styles:v,unstyled:g}=r,b=sG(r,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:y,cx:x}=oG({fullWidth:a,color:o,radius:p,gradient:h},{classNames:m,styles:v,name:"Badge",unstyled:g,variant:i,size:c});return S.createElement(oe,aG({className:x(y.root,n),ref:t},b),u&&S.createElement("span",{className:y.leftSection},u),S.createElement("span",{className:y.inner},l),d&&S.createElement("span",{className:y.rightSection},d))});jT.displayName="@mantine/core/Badge";const cG=jT;var uG=Object.defineProperty,Mf=Object.getOwnPropertySymbols,CT=Object.prototype.hasOwnProperty,ET=Object.prototype.propertyIsEnumerable,vS=(e,t,r)=>t in e?uG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yS=(e,t)=>{for(var r in t||(t={}))CT.call(t,r)&&vS(e,r,t[r]);if(Mf)for(var r of Mf(t))ET.call(t,r)&&vS(e,r,t[r]);return e},dG=(e,t)=>{var r={};for(var n in e)CT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Mf)for(var n of Mf(e))t.indexOf(n)<0&&ET.call(e,n)&&(r[n]=e[n]);return r};function fG(e){const t=e,{style:r}=t,n=dG(t,["style"]);return S.createElement("svg",yS({viewBox:"0 0 409.294 409.294",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:yS({width:O(20),height:O(20)},r)},n),S.createElement("path",{d:"M0 204.647v175.412h175.412V204.647H58.471c0-64.48 52.461-116.941 116.941-116.941V29.235C78.684 29.235 0 107.919 0 204.647zM409.294 87.706V29.235c-96.728 0-175.412 78.684-175.412 175.412v175.412h175.412V204.647H292.353c0-64.48 52.461-116.941 116.941-116.941z"}))}var pG=Object.defineProperty,hG=Object.defineProperties,mG=Object.getOwnPropertyDescriptors,xS=Object.getOwnPropertySymbols,gG=Object.prototype.hasOwnProperty,vG=Object.prototype.propertyIsEnumerable,wS=(e,t,r)=>t in e?pG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yG=(e,t)=>{for(var r in t||(t={}))gG.call(t,r)&&wS(e,r,t[r]);if(xS)for(var r of xS(t))vG.call(t,r)&&wS(e,r,t[r]);return e},xG=(e,t)=>hG(e,mG(t)),wG=W((e,{color:t})=>({root:xG(yG({},e.fn.fontStyles()),{fontSize:e.fontSizes.lg,lineHeight:e.lineHeight,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,margin:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm,padding:`${e.spacing.md} ${e.spacing.lg}`}),inner:{display:"flex"},body:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},icon:{color:e.fn.variant({variant:"filled",color:t}).background,marginRight:e.spacing.lg,marginTop:O(2),width:O(22)},cite:{display:"block",fontSize:e.fontSizes.sm,marginTop:e.spacing.xs,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],overflow:"hidden",textOverflow:"ellipsis"}}));const _G=wG;var bG=Object.defineProperty,Lf=Object.getOwnPropertySymbols,$T=Object.prototype.hasOwnProperty,kT=Object.prototype.propertyIsEnumerable,_S=(e,t,r)=>t in e?bG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SG=(e,t)=>{for(var r in t||(t={}))$T.call(t,r)&&_S(e,r,t[r]);if(Lf)for(var r of Lf(t))kT.call(t,r)&&_S(e,r,t[r]);return e},PG=(e,t)=>{var r={};for(var n in e)$T.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Lf)for(var n of Lf(e))t.indexOf(n)<0&&kT.call(e,n)&&(r[n]=e[n]);return r};const OG={color:"gray",icon:S.createElement(fG,null)},RT=f.forwardRef((e,t)=>{const r=H("Blockquote",OG,e),{className:n,color:o,icon:i,cite:a,children:l,classNames:c,styles:u,unstyled:d,variant:p}=r,h=PG(r,["className","color","icon","cite","children","classNames","styles","unstyled","variant"]),{classes:m,cx:v}=_G({color:o},{classNames:c,styles:u,unstyled:d,name:"Blockquote",variant:p});return S.createElement(oe,SG({component:"blockquote",className:v(m.root,n),ref:t},h),S.createElement("div",{className:m.inner},i&&S.createElement("div",{className:m.icon},i),S.createElement("div",{className:m.body},l,a&&S.createElement("cite",{className:m.cite},a))))});RT.displayName="@mantine/core/Blockquote";var jG=W((e,{orientation:t,buttonBorderWidth:r})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type:not(:last-of-type)":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${O(r)} / 2)`},"&:last-of-type:not(:first-of-type)":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${O(r)} / 2)`},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${O(r)} / 2)`,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${O(r)} / 2)`},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:`calc(${r} * -1)`,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const CG=jG;var EG=Object.defineProperty,zf=Object.getOwnPropertySymbols,TT=Object.prototype.hasOwnProperty,IT=Object.prototype.propertyIsEnumerable,bS=(e,t,r)=>t in e?EG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$G=(e,t)=>{for(var r in t||(t={}))TT.call(t,r)&&bS(e,r,t[r]);if(zf)for(var r of zf(t))IT.call(t,r)&&bS(e,r,t[r]);return e},kG=(e,t)=>{var r={};for(var n in e)TT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zf)for(var n of zf(e))t.indexOf(n)<0&&IT.call(e,n)&&(r[n]=e[n]);return r};const RG={orientation:"horizontal",buttonBorderWidth:1},DT=f.forwardRef((e,t)=>{const r=H("ButtonGroup",RG,e),{className:n,orientation:o,buttonBorderWidth:i,unstyled:a}=r,l=kG(r,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:u}=CG({orientation:o,buttonBorderWidth:i},{name:"ButtonGroup",unstyled:a});return S.createElement(oe,$G({className:u(c.root,n),ref:t},l))});DT.displayName="@mantine/core/ButtonGroup";var TG=Object.defineProperty,IG=Object.defineProperties,DG=Object.getOwnPropertyDescriptors,SS=Object.getOwnPropertySymbols,NG=Object.prototype.hasOwnProperty,AG=Object.prototype.propertyIsEnumerable,PS=(e,t,r)=>t in e?TG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mo=(e,t)=>{for(var r in t||(t={}))NG.call(t,r)&&PS(e,r,t[r]);if(SS)for(var r of SS(t))AG.call(t,r)&&PS(e,r,t[r]);return e},vd=(e,t)=>IG(e,DG(t));const MG=["filled","outline","light","white","default","subtle","gradient"],oy={xs:{height:$t.xs,paddingLeft:O(14),paddingRight:O(14)},sm:{height:$t.sm,paddingLeft:O(18),paddingRight:O(18)},md:{height:$t.md,paddingLeft:O(22),paddingRight:O(22)},lg:{height:$t.lg,paddingLeft:O(26),paddingRight:O(26)},xl:{height:$t.xl,paddingLeft:O(32),paddingRight:O(32)},"compact-xs":{height:O(22),paddingLeft:O(7),paddingRight:O(7)},"compact-sm":{height:O(26),paddingLeft:O(8),paddingRight:O(8)},"compact-md":{height:O(30),paddingLeft:O(10),paddingRight:O(10)},"compact-lg":{height:O(34),paddingLeft:O(12),paddingRight:O(12)},"compact-xl":{height:O(40),paddingLeft:O(14),paddingRight:O(14)}};function LG({compact:e,size:t,withLeftIcon:r,withRightIcon:n}){if(e)return oy[`compact-${t}`];const o=oy[t];return o?vd(mo({},o),{paddingLeft:r?`calc(${o.paddingLeft} / 1.5)`:o.paddingLeft,paddingRight:n?`calc(${o.paddingRight} / 1.5)`:o.paddingRight}):{}}const zG=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function FG({variant:e,theme:t,color:r,gradient:n}){if(!MG.includes(e))return null;const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?mo({border:0,backgroundImage:o.background,color:o.color},t.fn.hover({backgroundSize:"200%"})):mo({border:`${O(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var VG=W((e,{radius:t,fullWidth:r,compact:n,withLeftIcon:o,withRightIcon:i,color:a,gradient:l},{variant:c,size:u})=>({root:vd(mo(vd(mo(mo(mo(mo({},LG({compact:n,size:u,withLeftIcon:o,withRightIcon:i})),e.fn.fontStyles()),e.fn.focusStyles()),zG(r)),{borderRadius:e.fn.radius(t),fontWeight:600,position:"relative",lineHeight:1,fontSize:A({size:u,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),FG({variant:c,theme:e,color:a,gradient:l})),{"&:active":e.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":vd(mo({content:'""'},e.fn.cover(O(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:e.spacing.xs},rightIcon:{marginLeft:e.spacing.xs},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}}));const BG=VG;var UG=Object.defineProperty,Ff=Object.getOwnPropertySymbols,NT=Object.prototype.hasOwnProperty,AT=Object.prototype.propertyIsEnumerable,OS=(e,t,r)=>t in e?UG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jS=(e,t)=>{for(var r in t||(t={}))NT.call(t,r)&&OS(e,r,t[r]);if(Ff)for(var r of Ff(t))AT.call(t,r)&&OS(e,r,t[r]);return e},WG=(e,t)=>{var r={};for(var n in e)NT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ff)for(var n of Ff(e))t.indexOf(n)<0&&AT.call(e,n)&&(r[n]=e[n]);return r};const HG={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},ax=f.forwardRef((e,t)=>{const r=H("Button",HG,e),{className:n,size:o,color:i,type:a,disabled:l,children:c,leftIcon:u,rightIcon:d,fullWidth:p,variant:h,radius:m,uppercase:v,compact:g,loading:b,loaderPosition:y,loaderProps:x,gradient:_,classNames:w,styles:j,unstyled:C}=r,P=WG(r,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:E,cx:k,theme:$}=BG({radius:m,color:i,fullWidth:p,compact:g,gradient:_,withLeftIcon:!!u,withRightIcon:!!d},{name:"Button",unstyled:C,classNames:w,styles:j,variant:h,size:o}),I=$.fn.variant({color:i,variant:h}),T=S.createElement(dn,jS({color:I.color,size:`calc(${A({size:o,sizes:oy}).height} / 2)`},x));return S.createElement(So,jS({className:k(E.root,n),type:a,disabled:l,"data-button":!0,"data-disabled":l||void 0,"data-loading":b||void 0,ref:t,unstyled:C},P),S.createElement("div",{className:E.inner},(u||b&&y==="left")&&S.createElement("span",{className:k(E.icon,E.leftIcon)},b&&y==="left"?T:u),b&&y==="center"&&S.createElement("span",{className:E.centerLoader},T),S.createElement("span",{className:E.label,style:{textTransform:v?"uppercase":void 0}},c),(d||b&&y==="right")&&S.createElement("span",{className:k(E.icon,E.rightIcon)},b&&y==="right"?T:d)))});ax.displayName="@mantine/core/Button";ax.Group=DT;const ne=ax;var GG=W((e,{radius:t,shadow:r})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,boxSizing:"border-box",borderRadius:e.fn.radius(t),boxShadow:e.shadows[r]||r||"none","&[data-with-border]":{border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}}}));const qG=GG;var QG=Object.defineProperty,Vf=Object.getOwnPropertySymbols,MT=Object.prototype.hasOwnProperty,LT=Object.prototype.propertyIsEnumerable,CS=(e,t,r)=>t in e?QG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,KG=(e,t)=>{for(var r in t||(t={}))MT.call(t,r)&&CS(e,r,t[r]);if(Vf)for(var r of Vf(t))LT.call(t,r)&&CS(e,r,t[r]);return e},YG=(e,t)=>{var r={};for(var n in e)MT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Vf)for(var n of Vf(e))t.indexOf(n)<0&<.call(e,n)&&(r[n]=e[n]);return r};const XG={},zT=f.forwardRef((e,t)=>{const r=H("Paper",XG,e),{className:n,children:o,radius:i,withBorder:a,shadow:l,unstyled:c,variant:u}=r,d=YG(r,["className","children","radius","withBorder","shadow","unstyled","variant"]),{classes:p,cx:h}=qG({radius:i,shadow:l},{name:"Paper",unstyled:c,variant:u});return S.createElement(oe,KG({className:h(p.root,n),"data-with-border":a||void 0,ref:t},d),o)});zT.displayName="@mantine/core/Paper";const sn=zT;var JG=W((e,{inline:t})=>({root:{display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}}));const ZG=JG;var eq=Object.defineProperty,Bf=Object.getOwnPropertySymbols,FT=Object.prototype.hasOwnProperty,VT=Object.prototype.propertyIsEnumerable,ES=(e,t,r)=>t in e?eq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tq=(e,t)=>{for(var r in t||(t={}))FT.call(t,r)&&ES(e,r,t[r]);if(Bf)for(var r of Bf(t))VT.call(t,r)&&ES(e,r,t[r]);return e},rq=(e,t)=>{var r={};for(var n in e)FT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bf)for(var n of Bf(e))t.indexOf(n)<0&&VT.call(e,n)&&(r[n]=e[n]);return r};const BT=f.forwardRef((e,t)=>{const r=H("Center",{},e),{inline:n,className:o,unstyled:i,variant:a}=r,l=rq(r,["inline","className","unstyled","variant"]),{classes:c,cx:u}=ZG({inline:n},{name:"Center",unstyled:i,variant:a});return S.createElement(oe,tq({ref:t,className:u(c.root,o)},l))});BT.displayName="@mantine/core/Center";const ir=BT,UT=f.createContext(null),nq=UT.Provider,oq=()=>f.useContext(UT);var iq=Object.defineProperty,Uf=Object.getOwnPropertySymbols,WT=Object.prototype.hasOwnProperty,HT=Object.prototype.propertyIsEnumerable,$S=(e,t,r)=>t in e?iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kS=(e,t)=>{for(var r in t||(t={}))WT.call(t,r)&&$S(e,r,t[r]);if(Uf)for(var r of Uf(t))HT.call(t,r)&&$S(e,r,t[r]);return e},aq=(e,t)=>{var r={};for(var n in e)WT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Uf)for(var n of Uf(e))t.indexOf(n)<0&&HT.call(e,n)&&(r[n]=e[n]);return r};const sq={size:"sm"},GT=f.forwardRef((e,t)=>{const r=H("CheckboxGroup",sq,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c}=r,u=aq(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=kr({value:o,defaultValue:i,finalValue:[],onChange:a}),h=m=>{const v=m.currentTarget.value;p(d.includes(v)?d.filter(g=>g!==v):[...d,v])};return S.createElement(nq,{value:{value:d,onChange:h,size:l}},S.createElement(Wt.Wrapper,kS(kS({labelElement:"div",size:l,__staticSelector:"CheckboxGroup",ref:t},c),u),n))});GT.displayName="@mantine/core/CheckboxGroup";var lq=Object.defineProperty,Wf=Object.getOwnPropertySymbols,qT=Object.prototype.hasOwnProperty,QT=Object.prototype.propertyIsEnumerable,RS=(e,t,r)=>t in e?lq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hf=(e,t)=>{for(var r in t||(t={}))qT.call(t,r)&&RS(e,r,t[r]);if(Wf)for(var r of Wf(t))QT.call(t,r)&&RS(e,r,t[r]);return e},KT=(e,t)=>{var r={};for(var n in e)qT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wf)for(var n of Wf(e))t.indexOf(n)<0&&QT.call(e,n)&&(r[n]=e[n]);return r};function YT(e){const t=e,{width:r,height:n,style:o}=t,i=KT(t,["width","height","style"]);return S.createElement("svg",Hf({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Hf({width:r,height:n},o)},i),S.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 XT(e){var t=e,{indeterminate:r}=t,n=KT(t,["indeterminate"]);return r?S.createElement("svg",Hf({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6"},n),S.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):S.createElement(YT,Hf({},n))}var cq=Object.defineProperty,uq=Object.defineProperties,dq=Object.getOwnPropertyDescriptors,TS=Object.getOwnPropertySymbols,fq=Object.prototype.hasOwnProperty,pq=Object.prototype.propertyIsEnumerable,IS=(e,t,r)=>t in e?cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,DS=(e,t)=>{for(var r in t||(t={}))fq.call(t,r)&&IS(e,r,t[r]);if(TS)for(var r of TS(t))pq.call(t,r)&&IS(e,r,t[r]);return e},NS=(e,t)=>uq(e,dq(t));const hq={xs:O(16),sm:O(20),md:O(24),lg:O(30),xl:O(36)};var mq=W((e,{radius:t,color:r,transitionDuration:n,labelPosition:o,error:i,indeterminate:a},{size:l})=>{const c=A({size:l,sizes:hq}),u=e.fn.variant({variant:"filled",color:r});return{icon:NS(DS({},e.fn.cover()),{ref:Bt("icon"),color:a?"inherit":e.white,transform:a?"none":`translateY(${O(5)}) scale(0.5)`,opacity:a?1:0,transitionProperty:"opacity, transform",transitionTimingFunction:"ease",transitionDuration:`${n}ms`,pointerEvents:"none",width:"60%",position:"absolute",zIndex:1,margin:"auto","@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}}),inner:{position:"relative",width:c,height:c,order:o==="left"?2:1},input:NS(DS({},e.fn.focusStyles()),{appearance:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${O(1)} solid ${i?e.fn.variant({variant:"filled",color:"red"}).background:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,width:c,height:c,borderRadius:e.fn.radius(t),padding:0,display:"block",margin:0,transition:`border-color ${n}ms ease, background-color ${n}ms ease`,cursor:e.cursorType,"&:checked":{backgroundColor:u.background,borderColor:u.background,[`& + .${Bt("icon")}`]:{opacity:1,color:e.white,transform:"translateY(0) scale(1)"}},"&:disabled":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[3],cursor:"not-allowed",pointerEvents:"none",[`& + .${Bt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5]}}})}});const gq=mq;var vq=Object.defineProperty,yq=Object.defineProperties,xq=Object.getOwnPropertyDescriptors,AS=Object.getOwnPropertySymbols,wq=Object.prototype.hasOwnProperty,_q=Object.prototype.propertyIsEnumerable,MS=(e,t,r)=>t in e?vq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bq=(e,t)=>{for(var r in t||(t={}))wq.call(t,r)&&MS(e,r,t[r]);if(AS)for(var r of AS(t))_q.call(t,r)&&MS(e,r,t[r]);return e},Sq=(e,t)=>yq(e,xq(t));const Sg={xs:O(16),sm:O(20),md:O(24),lg:O(30),xl:O(36)};var Pq=W((e,{labelPosition:t},{size:r})=>({root:{},body:{display:"flex","&:has(input:disabled) label":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}},labelWrapper:Sq(bq({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:r in Sg?A({size:r,sizes:e.fontSizes}):void 0,lineHeight:r in Sg?A({size:r,sizes:Sg}):void 0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,cursor:e.cursorType,order:t==="left"?1:2}),description:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},error:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},label:{cursor:e.cursorType,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm,"&:disabled, &[data-disabled]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}));const Oq=Pq;var jq=Object.defineProperty,Gf=Object.getOwnPropertySymbols,JT=Object.prototype.hasOwnProperty,ZT=Object.prototype.propertyIsEnumerable,LS=(e,t,r)=>t in e?jq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cq=(e,t)=>{for(var r in t||(t={}))JT.call(t,r)&&LS(e,r,t[r]);if(Gf)for(var r of Gf(t))ZT.call(t,r)&&LS(e,r,t[r]);return e},Eq=(e,t)=>{var r={};for(var n in e)JT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gf)for(var n of Gf(e))t.indexOf(n)<0&&ZT.call(e,n)&&(r[n]=e[n]);return r};const am=f.forwardRef((e,t)=>{var r=e,{__staticSelector:n,className:o,classNames:i,styles:a,unstyled:l,children:c,label:u,description:d,id:p,disabled:h,error:m,size:v,labelPosition:g,variant:b}=r,y=Eq(r,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","variant"]);const{classes:x,cx:_}=Oq({labelPosition:g},{name:n,styles:a,classNames:i,unstyled:l,variant:b,size:v});return S.createElement(oe,Cq({className:_(x.root,o),ref:t},y),S.createElement("div",{className:_(x.body)},c,S.createElement("div",{className:x.labelWrapper},u!=null&&S.createElement("label",{className:x.label,"data-disabled":h||void 0,htmlFor:p},u),d&&S.createElement(Wt.Description,{className:x.description},d),m&&m!=="boolean"&&S.createElement(Wt.Error,{className:x.error},m))))});am.displayName="@mantine/core/InlineInput";var $q=Object.defineProperty,qf=Object.getOwnPropertySymbols,eI=Object.prototype.hasOwnProperty,tI=Object.prototype.propertyIsEnumerable,zS=(e,t,r)=>t in e?$q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nu=(e,t)=>{for(var r in t||(t={}))eI.call(t,r)&&zS(e,r,t[r]);if(qf)for(var r of qf(t))tI.call(t,r)&&zS(e,r,t[r]);return e},kq=(e,t)=>{var r={};for(var n in e)eI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&qf)for(var n of qf(e))t.indexOf(n)<0&&tI.call(e,n)&&(r[n]=e[n]);return r};const Rq={size:"sm",transitionDuration:100,icon:XT,labelPosition:"right"},Cn=f.forwardRef((e,t)=>{const r=H("Checkbox",Rq,e),{className:n,style:o,sx:i,checked:a,disabled:l,color:c,label:u,indeterminate:d,id:p,size:h,radius:m,wrapperProps:v,children:g,classNames:b,styles:y,transitionDuration:x,icon:_,unstyled:w,labelPosition:j,description:C,error:P,variant:E}=r,k=kq(r,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),$=oq(),I=Ir(p),{systemStyles:T,rest:z}=no(k),{classes:M}=gq({radius:m,color:c,transitionDuration:x,labelPosition:j,error:!!P,indeterminate:d},{name:"Checkbox",classNames:b,styles:y,unstyled:w,variant:E,size:($==null?void 0:$.size)||h}),L=$?{checked:$.value.includes(z.value),onChange:$.onChange}:{};return S.createElement(am,Nu(Nu({className:n,sx:i,style:o,id:I,size:($==null?void 0:$.size)||h,labelPosition:j,label:u,description:C,error:P,disabled:l,__staticSelector:"Checkbox",classNames:b,styles:y,unstyled:w,"data-checked":L.checked||void 0,variant:E},T),v),S.createElement("div",{className:M.inner},S.createElement("input",Nu(Nu({id:I,ref:t,type:"checkbox",className:M.input,checked:a,disabled:l},z),L)),S.createElement(_,{indeterminate:d,className:M.icon})))});Cn.displayName="@mantine/core/Checkbox";Cn.Group=GT;const rI=f.createContext(null),Tq=rI.Provider,Iq=()=>f.useContext(rI),Dq={};function nI(e){const{value:t,defaultValue:r,onChange:n,multiple:o,children:i}=H("ChipGroup",Dq,e),[a,l]=kr({value:t,defaultValue:r,finalValue:o?[]:null,onChange:n}),c=d=>Array.isArray(a)?a.includes(d):d===a,u=d=>{const p=d.currentTarget.value;Array.isArray(a)?l(a.includes(p)?a.filter(h=>h!==p):[...a,p]):l(p)};return S.createElement(Tq,{value:{isChipSelected:c,onChange:u,multiple:o}},i)}nI.displayName="@mantine/core/ChipGroup";var Nq=Object.defineProperty,Aq=Object.defineProperties,Mq=Object.getOwnPropertyDescriptors,FS=Object.getOwnPropertySymbols,Lq=Object.prototype.hasOwnProperty,zq=Object.prototype.propertyIsEnumerable,VS=(e,t,r)=>t in e?Nq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_n=(e,t)=>{for(var r in t||(t={}))Lq.call(t,r)&&VS(e,r,t[r]);if(FS)for(var r of FS(t))zq.call(t,r)&&VS(e,r,t[r]);return e},bl=(e,t)=>Aq(e,Mq(t));const BS={xs:O(24),sm:O(28),md:O(32),lg:O(36),xl:O(40)},ol={xs:O(10),sm:O(12),md:O(14),lg:O(16),xl:O(18)},US={xs:O(16),sm:O(20),md:O(24),lg:O(28),xl:O(32)},Au={xs:O(7.5),sm:O(10),md:O(11.5),lg:O(13),xl:O(15)};function Fq(e,{color:t},r){const n=e.fn.variant({variant:"filled",color:t}),o=e.fn.variant({variant:"light",color:t});return r==="light"?{label:_n({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1]},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),checked:bl(_n({color:o.color,backgroundColor:o.background},e.fn.hover({backgroundColor:o.hover})),{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:t}).background}})}:r==="filled"?{label:_n({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1]},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),checked:_n({color:n.color,backgroundColor:n.background},e.fn.hover({backgroundColor:n.hover}))}:r==="outline"?{label:_n({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),checked:{border:`${O(1)} solid ${n.background}`}}:{label:null,checked:null}}var Vq=W((e,{radius:t,color:r},{size:n,variant:o})=>{const i=Fq(e,{color:r},o);return{root:{},label:bl(_n(bl(_n({ref:Bt("label")},e.fn.fontStyles()),{boxSizing:"border-box",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"inline-flex",alignItems:"center",userSelect:"none",border:`${O(1)} solid transparent`,borderRadius:e.fn.radius(t),height:A({size:n,sizes:BS}),fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:`calc(${A({size:n,sizes:BS})} - ${O(2)})`,paddingLeft:A({size:n,sizes:US}),paddingRight:A({size:n,sizes:US}),cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 100ms ease",WebkitTapHighlightColor:"transparent"}),i.label),{"&[data-disabled]":bl(_n({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed",pointerEvents:"none"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})),{[`& .${Bt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}),"&[data-checked]":{paddingLeft:A({size:n,sizes:Au}),paddingRight:A({size:n,sizes:Au}),"&:not([data-disabled])":i.checked}}),iconWrapper:{ref:Bt("iconWrapper"),color:o==="filled"?e.white:e.fn.variant({variant:"filled",color:r}).background,width:`calc(${A({size:n,sizes:ol})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,maxWidth:`calc(${A({size:n,sizes:ol})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,height:A({size:n,sizes:ol}),display:"inline-block",verticalAlign:"middle",overflow:"hidden"},checkIcon:{width:A({size:n,sizes:ol}),height:`calc(${A({size:n,sizes:ol})} / 1.1)`,display:"block"},input:{width:0,height:0,padding:0,opacity:0,margin:0,"&:disabled + label":bl(_n({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed",pointerEvents:"none"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})),{[`& .${Bt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&[data-checked]":{paddingLeft:A({size:n,sizes:Au}),paddingRight:A({size:n,sizes:Au}),"&:not([data-disabled])":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}),"&:focus":{outline:"none",[`& + .${Bt("label")}`]:_n({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),"&:focus:not(:focus-visible)":{[`& + .${Bt("label")}`]:_n({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)}}}}});const Bq=Vq;var Uq=Object.defineProperty,Qf=Object.getOwnPropertySymbols,oI=Object.prototype.hasOwnProperty,iI=Object.prototype.propertyIsEnumerable,WS=(e,t,r)=>t in e?Uq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mu=(e,t)=>{for(var r in t||(t={}))oI.call(t,r)&&WS(e,r,t[r]);if(Qf)for(var r of Qf(t))iI.call(t,r)&&WS(e,r,t[r]);return e},Wq=(e,t)=>{var r={};for(var n in e)oI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qf)for(var n of Qf(e))t.indexOf(n)<0&&iI.call(e,n)&&(r[n]=e[n]);return r};const Hq={type:"checkbox",size:"sm",radius:"xl",variant:"outline"},Kf=f.forwardRef((e,t)=>{const r=H("Chip",Hq,e),{radius:n,type:o,size:i,variant:a,disabled:l,id:c,color:u,children:d,className:p,classNames:h,style:m,styles:v,checked:g,defaultChecked:b,onChange:y,sx:x,wrapperProps:_,value:w,unstyled:j}=r,C=Wq(r,["radius","type","size","variant","disabled","id","color","children","className","classNames","style","styles","checked","defaultChecked","onChange","sx","wrapperProps","value","unstyled"]),P=Iq(),E=Ir(c),{systemStyles:k,rest:$}=no(C),{classes:I,cx:T}=Bq({radius:n,color:u},{classNames:h,styles:v,unstyled:j,name:"Chip",variant:a,size:i}),[z,M]=kr({value:g,defaultValue:b,finalValue:!1,onChange:y}),L=P?{checked:P.isChipSelected(w),onChange:P.onChange,type:P.multiple?"checkbox":"radio"}:{},q=L.checked||z;return S.createElement(oe,Mu(Mu({className:T(I.root,p),style:m,sx:x},k),_),S.createElement("input",Mu(Mu({type:o,className:I.input,checked:q,onChange:Y=>M(Y.currentTarget.checked),id:E,disabled:l,ref:t,value:w},L),$)),S.createElement("label",{htmlFor:E,"data-checked":q||void 0,"data-disabled":l||void 0,className:I.label},q&&S.createElement("span",{className:I.iconWrapper},S.createElement(YT,{className:I.checkIcon})),d))});Kf.displayName="@mantine/core/Chip";Kf.Group=nI;var Gq=W((e,{fluid:t,sizes:r},{size:n})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":A({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const qq=Gq;var Qq=Object.defineProperty,Yf=Object.getOwnPropertySymbols,aI=Object.prototype.hasOwnProperty,sI=Object.prototype.propertyIsEnumerable,HS=(e,t,r)=>t in e?Qq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Kq=(e,t)=>{for(var r in t||(t={}))aI.call(t,r)&&HS(e,r,t[r]);if(Yf)for(var r of Yf(t))sI.call(t,r)&&HS(e,r,t[r]);return e},Yq=(e,t)=>{var r={};for(var n in e)aI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yf)for(var n of Yf(e))t.indexOf(n)<0&&sI.call(e,n)&&(r[n]=e[n]);return r};const Xq={sizes:{xs:O(540),sm:O(720),md:O(960),lg:O(1140),xl:O(1320)}},lI=f.forwardRef((e,t)=>{const r=H("Container",Xq,e),{className:n,fluid:o,size:i,unstyled:a,sizes:l,variant:c}=r,u=Yq(r,["className","fluid","size","unstyled","sizes","variant"]),{classes:d,cx:p}=qq({fluid:o,sizes:l},{unstyled:a,name:"Container",variant:c,size:i});return S.createElement(oe,Kq({className:p(d.root,n),ref:t},u))});lI.displayName="@mantine/core/Container";var Jq=Object.defineProperty,Xf=Object.getOwnPropertySymbols,cI=Object.prototype.hasOwnProperty,uI=Object.prototype.propertyIsEnumerable,GS=(e,t,r)=>t in e?Jq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zq=(e,t)=>{for(var r in t||(t={}))cI.call(t,r)&&GS(e,r,t[r]);if(Xf)for(var r of Xf(t))uI.call(t,r)&&GS(e,r,t[r]);return e},eQ=(e,t)=>{var r={};for(var n in e)cI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xf)for(var n of Xf(e))t.indexOf(n)<0&&uI.call(e,n)&&(r[n]=e[n]);return r};const tQ={timeout:1e3};function dI(e){const t=H("CopyButton",tQ,e),{children:r,timeout:n,value:o}=t,i=eQ(t,["children","timeout","value"]),a=FL({timeout:n}),l=()=>a.copy(o);return S.createElement(S.Fragment,null,r(Zq({copy:l,copied:a.copied},i)))}dI.displayName="@mantine/core/CopyButton";const[rQ,Ms]=Do("ModalBase component was not found in tree");var nQ=W(()=>({close:{marginLeft:"auto",marginRight:0}}));const oQ=nQ;var iQ=Object.defineProperty,Jf=Object.getOwnPropertySymbols,fI=Object.prototype.hasOwnProperty,pI=Object.prototype.propertyIsEnumerable,qS=(e,t,r)=>t in e?iQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aQ=(e,t)=>{for(var r in t||(t={}))fI.call(t,r)&&qS(e,r,t[r]);if(Jf)for(var r of Jf(t))pI.call(t,r)&&qS(e,r,t[r]);return e},sQ=(e,t)=>{var r={};for(var n in e)fI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Jf)for(var n of Jf(e))t.indexOf(n)<0&&pI.call(e,n)&&(r[n]=e[n]);return r};const lQ={size:"sm"},cQ=f.forwardRef((e,t)=>{const r=Ms(),n=H(`${r.__staticSelector}CloseButton`,lQ,e),{className:o}=n,i=sQ(n,["className"]),{classes:a,cx:l}=oQ(null,r.stylesApi);return S.createElement(jc,aQ({className:l(a.close,o),ref:t,onClick:r.onClose},i))});var uQ=W(()=>({overlay:{}}));const dQ=uQ;var fQ=Object.defineProperty,pQ=Object.defineProperties,hQ=Object.getOwnPropertyDescriptors,QS=Object.getOwnPropertySymbols,mQ=Object.prototype.hasOwnProperty,gQ=Object.prototype.propertyIsEnumerable,KS=(e,t,r)=>t in e?fQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vQ=(e,t)=>{for(var r in t||(t={}))mQ.call(t,r)&&KS(e,r,t[r]);if(QS)for(var r of QS(t))gQ.call(t,r)&&KS(e,r,t[r]);return e},yQ=(e,t)=>pQ(e,hQ(t)),xQ=W((e,{color:t,opacity:r,blur:n,radius:o,gradient:i,fixed:a,zIndex:l})=>({root:yQ(vQ({},e.fn.cover(0)),{position:a?"fixed":"absolute",backgroundColor:i?void 0:e.fn.rgba(t,r),backgroundImage:i,backdropFilter:n?`blur(${O(n)})`:void 0,borderRadius:e.fn.radius(o),zIndex:l,"&[data-center]":{display:"flex",alignItems:"center",justifyContent:"center"}})}));const wQ=xQ;var _Q=Object.defineProperty,Zf=Object.getOwnPropertySymbols,hI=Object.prototype.hasOwnProperty,mI=Object.prototype.propertyIsEnumerable,YS=(e,t,r)=>t in e?_Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bQ=(e,t)=>{for(var r in t||(t={}))hI.call(t,r)&&YS(e,r,t[r]);if(Zf)for(var r of Zf(t))mI.call(t,r)&&YS(e,r,t[r]);return e},SQ=(e,t)=>{var r={};for(var n in e)hI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zf)for(var n of Zf(e))t.indexOf(n)<0&&mI.call(e,n)&&(r[n]=e[n]);return r};const PQ={opacity:.6,color:"#000",zIndex:$n("modal"),radius:0},gI=f.forwardRef((e,t)=>{const r=H("Overlay",PQ,e),{variant:n,opacity:o,color:i,blur:a,gradient:l,zIndex:c,radius:u,children:d,className:p,classNames:h,styles:m,unstyled:v,center:g,fixed:b}=r,y=SQ(r,["variant","opacity","color","blur","gradient","zIndex","radius","children","className","classNames","styles","unstyled","center","fixed"]),{classes:x,cx:_}=wQ({color:i,opacity:o,blur:a,radius:u,gradient:l,fixed:b,zIndex:c},{name:"Overlay",classNames:h,styles:m,unstyled:v,variant:n});return S.createElement(oe,bQ({ref:t,className:_(x.root,p),"data-center":g||void 0},y),d)});gI.displayName="@mantine/core/Overlay";const vI=gI;var OQ=Object.defineProperty,jQ=Object.defineProperties,CQ=Object.getOwnPropertyDescriptors,ep=Object.getOwnPropertySymbols,yI=Object.prototype.hasOwnProperty,xI=Object.prototype.propertyIsEnumerable,XS=(e,t,r)=>t in e?OQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,il=(e,t)=>{for(var r in t||(t={}))yI.call(t,r)&&XS(e,r,t[r]);if(ep)for(var r of ep(t))xI.call(t,r)&&XS(e,r,t[r]);return e},EQ=(e,t)=>jQ(e,CQ(t)),$Q=(e,t)=>{var r={};for(var n in e)yI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ep)for(var n of ep(e))t.indexOf(n)<0&&xI.call(e,n)&&(r[n]=e[n]);return r};const kQ={},RQ=f.forwardRef((e,t)=>{const r=Ms(),n=H(`${r.__staticSelector}Overlay`,kQ,e),{onClick:o,transitionProps:i,style:a,className:l}=n,c=$Q(n,["onClick","transitionProps","style","className"]),{classes:u,cx:d}=dQ(null,r.stylesApi),p=h=>{o==null||o(h),r.closeOnClickOutside&&r.onClose()};return S.createElement(va,EQ(il(il({mounted:r.opened},r.transitionProps),i),{transition:"fade"}),h=>S.createElement(vI,il({ref:t,onClick:p,fixed:!0,style:il(il({},a),h),className:d(u.overlay,l),zIndex:r.zIndex},c)))});var TQ=W((e,{zIndex:t})=>({inner:{position:"fixed",width:"100%",top:0,bottom:0,maxHeight:"100%",zIndex:t,pointerEvents:"none"},content:{pointerEvents:"all"}}));const IQ=TQ;var DQ=Object.defineProperty,tp=Object.getOwnPropertySymbols,wI=Object.prototype.hasOwnProperty,_I=Object.prototype.propertyIsEnumerable,JS=(e,t,r)=>t in e?DQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,al=(e,t)=>{for(var r in t||(t={}))wI.call(t,r)&&JS(e,r,t[r]);if(tp)for(var r of tp(t))_I.call(t,r)&&JS(e,r,t[r]);return e},NQ=(e,t)=>{var r={};for(var n in e)wI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tp)for(var n of tp(e))t.indexOf(n)<0&&_I.call(e,n)&&(r[n]=e[n]);return r};const AQ={},MQ=f.forwardRef((e,t)=>{const r=Ms(),n=H(`${r.__staticSelector}Content`,AQ,e),{className:o,transitionProps:i,style:a,onKeyDown:l}=n,c=NQ(n,["className","transitionProps","style","onKeyDown"]),{classes:u,cx:d}=IQ({zIndex:r.zIndex},r.stylesApi),p=h=>{var m;((m=h.target)==null?void 0:m.getAttribute("data-mantine-stop-propagation"))!=="true"&&h.key==="Escape"&&r.closeOnEscape&&r.onClose(),l==null||l(h)};return S.createElement(va,al(al({mounted:r.opened,transition:"pop"},r.transitionProps),i),h=>S.createElement("div",{className:d(u.inner)},S.createElement(ex,{active:r.opened&&r.trapFocus},S.createElement(sn,al({component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":r.bodyMounted?r.getBodyId():void 0,"aria-labelledby":r.titleMounted?r.getTitleId():void 0,onKeyDown:p,ref:t,className:d(u.content,o),style:al(al({},a),h),shadow:r.shadow},c),c.children))))});var LQ=W((e,{padding:t})=>{const r=A({size:t,sizes:e.spacing});return{header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:r,paddingRight:`calc(${r} - ${O(5)})`,position:"sticky",top:0,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,zIndex:1e3}}});const zQ=LQ;var FQ=Object.defineProperty,rp=Object.getOwnPropertySymbols,bI=Object.prototype.hasOwnProperty,SI=Object.prototype.propertyIsEnumerable,ZS=(e,t,r)=>t in e?FQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VQ=(e,t)=>{for(var r in t||(t={}))bI.call(t,r)&&ZS(e,r,t[r]);if(rp)for(var r of rp(t))SI.call(t,r)&&ZS(e,r,t[r]);return e},BQ=(e,t)=>{var r={};for(var n in e)bI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rp)for(var n of rp(e))t.indexOf(n)<0&&SI.call(e,n)&&(r[n]=e[n]);return r};const UQ={},WQ=f.forwardRef((e,t)=>{const r=Ms(),n=H(`${r.__staticSelector}Header`,UQ,e),{className:o}=n,i=BQ(n,["className"]),{classes:a,cx:l}=zQ({padding:r.padding},r.stylesApi);return S.createElement(oe,VQ({ref:t,className:l(a.header,o)},i))});var HQ=W(e=>({title:{lineHeight:1,padding:0,margin:0,fontWeight:400,fontSize:e.fontSizes.md}}));const GQ=HQ;var qQ=Object.defineProperty,np=Object.getOwnPropertySymbols,PI=Object.prototype.hasOwnProperty,OI=Object.prototype.propertyIsEnumerable,eP=(e,t,r)=>t in e?qQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QQ=(e,t)=>{for(var r in t||(t={}))PI.call(t,r)&&eP(e,r,t[r]);if(np)for(var r of np(t))OI.call(t,r)&&eP(e,r,t[r]);return e},KQ=(e,t)=>{var r={};for(var n in e)PI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&np)for(var n of np(e))t.indexOf(n)<0&&OI.call(e,n)&&(r[n]=e[n]);return r};const YQ={},XQ=f.forwardRef((e,t)=>{const r=Ms(),n=H(`${r.__staticSelector}Title`,YQ,e),{className:o}=n,i=KQ(n,["className"]),{classes:a,cx:l}=GQ(null,r.stylesApi);return f.useEffect(()=>(r.setTitleMounted(!0),()=>r.setTitleMounted(!1)),[]),S.createElement(oe,QQ({component:"h2",id:r.getTitleId(),className:l(a.title,o),ref:t},i))});var JQ=W((e,{padding:t})=>({body:{padding:A({size:t,sizes:e.spacing}),"&:not(:only-child)":{paddingTop:0}}}));const ZQ=JQ;var eK=Object.defineProperty,op=Object.getOwnPropertySymbols,jI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,tP=(e,t,r)=>t in e?eK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tK=(e,t)=>{for(var r in t||(t={}))jI.call(t,r)&&tP(e,r,t[r]);if(op)for(var r of op(t))CI.call(t,r)&&tP(e,r,t[r]);return e},rK=(e,t)=>{var r={};for(var n in e)jI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&op)for(var n of op(e))t.indexOf(n)<0&&CI.call(e,n)&&(r[n]=e[n]);return r};const nK={},oK=f.forwardRef((e,t)=>{const r=Ms(),n=H(`${r.__staticSelector}Body`,nK,e),{className:o}=n,i=rK(n,["className"]),{classes:a,cx:l}=ZQ({padding:r.padding},r.stylesApi);return f.useEffect(()=>(r.setBodyMounted(!0),()=>r.setBodyMounted(!1)),[]),S.createElement(oe,tK({id:r.getBodyId(),className:l(a.body,o),ref:t},i))});function iK({children:e}){return S.createElement(S.Fragment,null,e)}function aK({opened:e,transitionDuration:t}){const[r,n]=f.useState(e),o=f.useRef(),a=Lh()?0:t;return f.useEffect(()=>(e?(n(!0),window.clearTimeout(o.current)):a===0?n(!1):o.current=window.setTimeout(()=>n(!1),a),()=>window.clearTimeout(o.current)),[e,a]),r}var sK=W(()=>({root:{}}));const lK=sK;var cK=Object.defineProperty,uK=Object.defineProperties,dK=Object.getOwnPropertyDescriptors,ip=Object.getOwnPropertySymbols,EI=Object.prototype.hasOwnProperty,$I=Object.prototype.propertyIsEnumerable,rP=(e,t,r)=>t in e?cK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pg=(e,t)=>{for(var r in t||(t={}))EI.call(t,r)&&rP(e,r,t[r]);if(ip)for(var r of ip(t))$I.call(t,r)&&rP(e,r,t[r]);return e},nP=(e,t)=>uK(e,dK(t)),fK=(e,t)=>{var r={};for(var n in e)EI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ip)for(var n of ip(e))t.indexOf(n)<0&&$I.call(e,n)&&(r[n]=e[n]);return r};const sx={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:$n("modal"),padding:"md",size:"md",shadow:"xl"};function Rt(e){const t=H("ModalBase",sx,e),{opened:r,onClose:n,children:o,closeOnClickOutside:i,__staticSelector:a,transitionProps:l,withinPortal:c,portalProps:u,keepMounted:d,target:p,zIndex:h,lockScroll:m,trapFocus:v,closeOnEscape:g,returnFocus:b,padding:y,shadow:x,id:_,size:w,variant:j,classNames:C,unstyled:P,styles:E,className:k}=t,$=fK(t,["opened","onClose","children","closeOnClickOutside","__staticSelector","transitionProps","withinPortal","portalProps","keepMounted","target","zIndex","lockScroll","trapFocus","closeOnEscape","returnFocus","padding","shadow","id","size","variant","classNames","unstyled","styles","className"]),{classes:I,cx:T}=lK(null,{name:a,classNames:C,styles:E,unstyled:P,variant:j,size:w}),z=Ir(_),[M,L]=f.useState(!1),[q,Y]=f.useState(!1),R=typeof(l==null?void 0:l.duration)=="number"?l==null?void 0:l.duration:200,N=aK({opened:r,transitionDuration:R});return nv("keydown",V=>{!v&&V.key==="Escape"&&g&&n()}),WE({opened:r,shouldReturnFocus:v&&b}),S.createElement(Ns,nP(Pg({},u),{withinPortal:c,target:p}),S.createElement(rQ,{value:{__staticSelector:a,opened:r,onClose:n,closeOnClickOutside:i,transitionProps:nP(Pg({},l),{duration:R,keepMounted:d}),zIndex:h,padding:y,id:z,getTitleId:()=>`${z}-title`,getBodyId:()=>`${z}-body`,titleMounted:M,bodyMounted:q,setTitleMounted:L,setBodyMounted:Y,trapFocus:v,closeOnEscape:g,shadow:x,stylesApi:{name:a,size:w,variant:j,classNames:C,styles:E,unstyled:P}}},S.createElement(dM,{enabled:N&&m},S.createElement(oe,Pg({className:T(I.root,k)},$),o))))}Rt.CloseButton=cQ;Rt.Overlay=RQ;Rt.Content=MQ;Rt.Header=WQ;Rt.Title=XQ;Rt.Body=oK;Rt.NativeScrollArea=iK;const pK={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 hK=Object.defineProperty,mK=Object.defineProperties,gK=Object.getOwnPropertyDescriptors,ap=Object.getOwnPropertySymbols,kI=Object.prototype.hasOwnProperty,RI=Object.prototype.propertyIsEnumerable,oP=(e,t,r)=>t in e?hK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vK=(e,t)=>{for(var r in t||(t={}))kI.call(t,r)&&oP(e,r,t[r]);if(ap)for(var r of ap(t))RI.call(t,r)&&oP(e,r,t[r]);return e},yK=(e,t)=>mK(e,gK(t)),xK=(e,t)=>{var r={};for(var n in e)kI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ap)for(var n of ap(e))t.indexOf(n)<0&&RI.call(e,n)&&(r[n]=e[n]);return r};const wK={},sp=f.forwardRef((e,t)=>{const r=H("Flex",wK,e),{gap:n,rowGap:o,columnGap:i,align:a,justify:l,wrap:c,direction:u,sx:d}=r,p=xK(r,["gap","rowGap","columnGap","align","justify","wrap","direction","sx"]);return S.createElement(oe,yK(vK({},p),{sx:[{display:"flex"},h=>ov({gap:n,rowGap:o,columnGap:i,align:a,justify:l,wrap:c,direction:u},h,pK),...vc(d)],ref:t}))});sp.displayName="@mantine/core/Flex";const[_K,bK]=Do("Grid component was not found in tree");var SK=Object.defineProperty,iP=Object.getOwnPropertySymbols,PK=Object.prototype.hasOwnProperty,OK=Object.prototype.propertyIsEnumerable,aP=(e,t,r)=>t in e?SK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jK=(e,t)=>{for(var r in t||(t={}))PK.call(t,r)&&aP(e,r,t[r]);if(iP)for(var r of iP(t))OK.call(t,r)&&aP(e,r,t[r]);return e};const lx=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,TI=(e,t,r)=>r||e==="auto"||e==="content"?"unset":lx(e,t),II=(e,t)=>{if(e)return e==="auto"||t?1:0},DI=(e,t)=>e===0?0:e?`${100/(t/e)}%`:void 0,NI=(e,t)=>typeof e<"u"?`calc(${A({size:e,sizes:t.spacing})} / 2)`:void 0;function CK({sizes:e,offsets:t,orders:r,theme:n,columns:o,gutters:i,grow:a}){return bE.reduce((l,c)=>(l[`@media (min-width: ${ar(n.breakpoints[c])})`]={order:r[c],flexBasis:lx(e[c],o),padding:NI(i[c],n),flexShrink:0,width:e[c]==="content"?"auto":void 0,maxWidth:TI(e[c],o,a),marginLeft:DI(t[c],o),flexGrow:II(e[c],a)},l),{})}var EK=W((e,{gutter:t,gutterXs:r,gutterSm:n,gutterMd:o,gutterLg:i,gutterXl:a,grow:l,offset:c,offsetXs:u,offsetSm:d,offsetMd:p,offsetLg:h,offsetXl:m,columns:v,span:g,xs:b,sm:y,md:x,lg:_,xl:w,order:j,orderXs:C,orderSm:P,orderMd:E,orderLg:k,orderXl:$})=>({col:jK({boxSizing:"border-box",flexGrow:II(g,l),order:j,padding:NI(t,e),marginLeft:DI(c,v),flexBasis:lx(g,v),flexShrink:0,width:g==="content"?"auto":void 0,maxWidth:TI(g,v,l)},CK({sizes:{xs:b,sm:y,md:x,lg:_,xl:w},offsets:{xs:u,sm:d,md:p,lg:h,xl:m},orders:{xs:C,sm:P,md:E,lg:k,xl:$},gutters:{xs:r,sm:n,md:o,lg:i,xl:a},theme:e,columns:v,grow:l}))}));const $K=EK;var kK=Object.defineProperty,lp=Object.getOwnPropertySymbols,AI=Object.prototype.hasOwnProperty,MI=Object.prototype.propertyIsEnumerable,sP=(e,t,r)=>t in e?kK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,RK=(e,t)=>{for(var r in t||(t={}))AI.call(t,r)&&sP(e,r,t[r]);if(lp)for(var r of lp(t))MI.call(t,r)&&sP(e,r,t[r]);return e},TK=(e,t)=>{var r={};for(var n in e)AI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&lp)for(var n of lp(e))t.indexOf(n)<0&&MI.call(e,n)&&(r[n]=e[n]);return r};const IK={};function DK(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const LI=f.forwardRef((e,t)=>{const r=H("GridCol",IK,e),{children:n,span:o,offset:i,offsetXs:a,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:v,xl:g,order:b,orderXs:y,orderSm:x,orderMd:_,orderLg:w,orderXl:j,className:C,unstyled:P,variant:E}=r,k=TK(r,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","unstyled","variant"]),$=bK(),I=o||$.columns,{classes:T,cx:z}=$K({gutter:$.gutter,gutterXs:$.gutterXs,gutterSm:$.gutterSm,gutterMd:$.gutterMd,gutterLg:$.gutterLg,gutterXl:$.gutterXl,offset:i,offsetXs:a,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:v,xl:g,order:b,orderXs:y,orderSm:x,orderMd:_,orderLg:w,orderXl:j,grow:$.grow,columns:$.columns,span:I},{unstyled:P,name:"Grid",variant:E});return!DK(I)||I>$.columns?null:S.createElement(oe,RK({className:z(T.col,C),ref:t},k),n)});LI.displayName="@mantine/core/Col";var NK=Object.defineProperty,lP=Object.getOwnPropertySymbols,AK=Object.prototype.hasOwnProperty,MK=Object.prototype.propertyIsEnumerable,cP=(e,t,r)=>t in e?NK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LK=(e,t)=>{for(var r in t||(t={}))AK.call(t,r)&&cP(e,r,t[r]);if(lP)for(var r of lP(t))MK.call(t,r)&&cP(e,r,t[r]);return e};function zK(e,t){return bE.reduce((r,n)=>(typeof e[n]<"u"&&(r[`@media (min-width: ${t.breakpoints[n]})`]={margin:`calc(-${A({size:e[n],sizes:t.spacing})} / 2)`}),r),{})}var FK=W((e,{justify:t,align:r,gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c})=>({root:LK({margin:`calc(-${A({size:n,sizes:e.spacing})} / 2)`,display:"flex",flexWrap:"wrap",justifyContent:t,alignItems:r},zK({xs:o,sm:i,md:a,lg:l,xl:c},e))}));const VK=FK;var BK=Object.defineProperty,cp=Object.getOwnPropertySymbols,zI=Object.prototype.hasOwnProperty,FI=Object.prototype.propertyIsEnumerable,uP=(e,t,r)=>t in e?BK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,UK=(e,t)=>{for(var r in t||(t={}))zI.call(t,r)&&uP(e,r,t[r]);if(cp)for(var r of cp(t))FI.call(t,r)&&uP(e,r,t[r]);return e},WK=(e,t)=>{var r={};for(var n in e)zI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&cp)for(var n of cp(e))t.indexOf(n)<0&&FI.call(e,n)&&(r[n]=e[n]);return r};const HK={gutter:"md",justify:"flex-start",align:"stretch",columns:12},nn=f.forwardRef((e,t)=>{const r=H("Grid",HK,e),{gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c,children:u,grow:d,justify:p,align:h,columns:m,className:v,unstyled:g,variant:b}=r,y=WK(r,["gutter","gutterXs","gutterSm","gutterMd","gutterLg","gutterXl","children","grow","justify","align","columns","className","unstyled","variant"]),{classes:x,cx:_}=VK({gutter:n,justify:p,align:h,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c},{unstyled:g,name:"Grid",variant:b});return S.createElement(_K,{value:{gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c,grow:d,columns:m}},S.createElement(oe,UK({className:_(x.root,v),ref:t},y),u))});nn.Col=LI;nn.displayName="@mantine/core/Grid";function GK(e){return f.Children.toArray(e).filter(Boolean)}const VI={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var qK=W((e,{spacing:t,position:r,noWrap:n,grow:o,align:i,count:a})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:i||"center",flexWrap:n?"nowrap":"wrap",justifyContent:VI[r],gap:A({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/a}% - (${O(A({size:t,sizes:e.spacing}))} - ${A({size:t,sizes:e.spacing})} / ${a}))`:void 0,flexGrow:o?1:0}}}));const QK=qK;var KK=Object.defineProperty,up=Object.getOwnPropertySymbols,BI=Object.prototype.hasOwnProperty,UI=Object.prototype.propertyIsEnumerable,dP=(e,t,r)=>t in e?KK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YK=(e,t)=>{for(var r in t||(t={}))BI.call(t,r)&&dP(e,r,t[r]);if(up)for(var r of up(t))UI.call(t,r)&&dP(e,r,t[r]);return e},XK=(e,t)=>{var r={};for(var n in e)BI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&up)for(var n of up(e))t.indexOf(n)<0&&UI.call(e,n)&&(r[n]=e[n]);return r};const JK={position:"left",spacing:"md"},K=f.forwardRef((e,t)=>{const r=H("Group",JK,e),{className:n,position:o,align:i,children:a,noWrap:l,grow:c,spacing:u,unstyled:d,variant:p}=r,h=XK(r,["className","position","align","children","noWrap","grow","spacing","unstyled","variant"]),m=GK(a),{classes:v,cx:g}=QK({align:i,grow:c,noWrap:l,spacing:u,position:o,count:m.length},{unstyled:d,name:"Group",variant:p});return S.createElement(oe,YK({className:g(v.root,n),ref:t},h),m)});K.displayName="@mantine/core/Group";function ZK({open:e,close:t,openDelay:r,closeDelay:n}){const o=f.useRef(-1),i=f.useRef(-1),a=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{a(),r===0?e():o.current=window.setTimeout(e,r)},c=()=>{a(),n===0?t():i.current=window.setTimeout(t,n)};return f.useEffect(()=>a,[]),{openDropdown:l,closeDropdown:c}}function fP(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var eY=W((e,t,{size:r})=>({input:{fontFamily:e.fontFamilyMonospace,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${O(2)})`}}));const tY=eY;function cx(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var rY=f.useLayoutEffect,nY=function(t){var r=f.useRef(t);return rY(function(){r.current=t}),r},pP=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},oY=function(t,r){var n=f.useRef();return f.useCallback(function(o){t.current=o,n.current&&pP(n.current,null),n.current=r,r&&pP(r,o)},[r])},hP={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},mP=function(t){Object.keys(hP).forEach(function(r){t.style.setProperty(r,hP[r],"important")})},Mr=null,iY=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function aY(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),Mr||(Mr=document.createElement("textarea"),Mr.setAttribute("tabindex","-1"),Mr.setAttribute("aria-hidden","true"),mP(Mr)),Mr.parentNode===null&&document.body.appendChild(Mr);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,l=a.boxSizing;Object.keys(a).forEach(function(h){var m=h;Mr.style[m]=a[m]}),mP(Mr),Mr.value=t;var c=iY(Mr,e);Mr.value="x";var u=Mr.scrollHeight-o,d=u*r;l==="border-box"&&(d=d+o+i),c=Math.max(d,c);var p=u*n;return l==="border-box"&&(p=p+o+i),c=Math.min(p,c),[c,u]}var gP=function(){},sY=function(t,r){return t.reduce(function(n,o){return n[o]=r[o],n},{})},lY=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],cY=!!document.documentElement.currentStyle,uY=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=sY(lY,r),o=n.boxSizing;if(o==="")return null;cY&&o==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var i=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:i,borderSize:a}},dY=function(t){var r=nY(t);f.useLayoutEffect(function(){var n=function(i){r.current(i)};return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}},[])},fY=function(t,r){var n=t.cacheMeasurements,o=t.maxRows,i=t.minRows,a=t.onChange,l=a===void 0?gP:a,c=t.onHeightChange,u=c===void 0?gP:c,d=cx(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),p=d.value!==void 0,h=f.useRef(null),m=oY(h,r),v=f.useRef(0),g=f.useRef(),b=function(){var _=h.current,w=n&&g.current?g.current:uY(_);if(w){g.current=w;var j=aY(w,_.value||_.placeholder||"x",i,o),C=j[0],P=j[1];v.current!==C&&(v.current=C,_.style.setProperty("height",C+"px","important"),u(C,{rowHeight:P}))}},y=function(_){p||b(),l(_)};return f.useLayoutEffect(b),dY(b),f.createElement("textarea",rt({},d,{onChange:y,ref:m}))},pY=f.forwardRef(fY);const hY=pY;var mY=W(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const gY=mY;var vY=Object.defineProperty,yY=Object.defineProperties,xY=Object.getOwnPropertyDescriptors,dp=Object.getOwnPropertySymbols,WI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,vP=(e,t,r)=>t in e?vY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ta=(e,t)=>{for(var r in t||(t={}))WI.call(t,r)&&vP(e,r,t[r]);if(dp)for(var r of dp(t))HI.call(t,r)&&vP(e,r,t[r]);return e},Og=(e,t)=>yY(e,xY(t)),wY=(e,t)=>{var r={};for(var n in e)WI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&dp)for(var n of dp(e))t.indexOf(n)<0&&HI.call(e,n)&&(r[n]=e[n]);return r};const _Y={autosize:!1,size:"sm",__staticSelector:"Textarea"},Rc=f.forwardRef((e,t)=>{const r=H("Textarea",_Y,e),{autosize:n,maxRows:o,minRows:i,label:a,error:l,description:c,id:u,className:d,required:p,style:h,wrapperProps:m,classNames:v,styles:g,size:b,__staticSelector:y,sx:x,errorProps:_,descriptionProps:w,labelProps:j,inputWrapperOrder:C,inputContainer:P,unstyled:E,withAsterisk:k,variant:$}=r,I=wY(r,["autosize","maxRows","minRows","label","error","description","id","className","required","style","wrapperProps","classNames","styles","size","__staticSelector","sx","errorProps","descriptionProps","labelProps","inputWrapperOrder","inputContainer","unstyled","withAsterisk","variant"]),T=Ir(u),{classes:z,cx:M}=gY(),{systemStyles:L,rest:q}=no(I),Y=Ta({required:p,ref:t,error:l,id:T,classNames:Og(Ta({},v),{input:M(z.input,v==null?void 0:v.input)}),styles:g,__staticSelector:y,size:b,multiline:!0,unstyled:E,variant:$},q);return S.createElement(Wt.Wrapper,Ta(Ta({label:a,error:l,id:T,description:c,required:p,style:h,className:d,classNames:v,styles:g,size:b,__staticSelector:y,sx:x,errorProps:_,labelProps:j,descriptionProps:w,inputContainer:P,inputWrapperOrder:C,unstyled:E,withAsterisk:k,variant:$},L),m),n?S.createElement(Wt,Og(Ta({},Y),{component:hY,maxRows:o,minRows:i})):S.createElement(Wt,Og(Ta({},Y),{component:"textarea",rows:i})))});Rc.displayName="@mantine/core/Textarea";var bY=Object.defineProperty,SY=Object.defineProperties,PY=Object.getOwnPropertyDescriptors,fp=Object.getOwnPropertySymbols,GI=Object.prototype.hasOwnProperty,qI=Object.prototype.propertyIsEnumerable,yP=(e,t,r)=>t in e?bY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xP=(e,t)=>{for(var r in t||(t={}))GI.call(t,r)&&yP(e,r,t[r]);if(fp)for(var r of fp(t))qI.call(t,r)&&yP(e,r,t[r]);return e},OY=(e,t)=>SY(e,PY(t)),jY=(e,t)=>{var r={};for(var n in e)GI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&fp)for(var n of fp(e))t.indexOf(n)<0&&qI.call(e,n)&&(r[n]=e[n]);return r};const CY={formatOnBlur:!1,size:"sm",serialize:JSON.stringify,deserialize:JSON.parse},Ls=f.forwardRef((e,t)=>{const r=H("JsonInput",CY,e),{value:n,defaultValue:o,onChange:i,onFocus:a,onBlur:l,error:c,formatOnBlur:u,size:d,validationError:p,classNames:h,unstyled:m,readOnly:v,variant:g,serialize:b,deserialize:y}=r,x=jY(r,["value","defaultValue","onChange","onFocus","onBlur","error","formatOnBlur","size","validationError","classNames","unstyled","readOnly","variant","serialize","deserialize"]),{classes:_,cx:w}=tY(null,{name:"JsonInput",unstyled:m,size:d,variant:g}),[j,C]=kr({value:n,defaultValue:o,finalValue:"",onChange:i}),[P,E]=f.useState(fP(j,y)),k=I=>{typeof a=="function"&&a(I),E(!0)},$=I=>{typeof l=="function"&&l(I);const T=fP(I.currentTarget.value,y);u&&!v&&T&&I.currentTarget.value.trim()!==""&&C(b(y(I.currentTarget.value),null,2)),E(T)};return S.createElement(Rc,xP({value:j,onChange:I=>C(I.currentTarget.value),onFocus:k,onBlur:$,error:P?c:p||!0,__staticSelector:"JsonInput",classNames:OY(xP({},h),{input:w(_.input,h==null?void 0:h.input)}),autoComplete:"off",ref:t,unstyled:m,readOnly:v,size:d,variant:g},x))});Ls.displayName="@mantine/core/JsonInput";const[EY,$Y]=Do("List component was not found in tree");var kY=W((e,{spacing:t,center:r})=>({itemWrapper:{ref:Bt("itemWrapper"),display:"inline-flex",flexDirection:"column",whiteSpace:"normal"},item:{whiteSpace:"nowrap",lineHeight:r?1:e.lineHeight,"&:not(:first-of-type)":{marginTop:A({size:t,sizes:e.spacing})},"&[data-with-icon]":{listStyle:"none",[`& .${Bt("itemWrapper")}`]:{display:"inline-flex",alignItems:r?"center":"flex-start",flexDirection:"row"}}},itemIcon:{display:"inline-block",verticalAlign:"middle",marginRight:e.spacing.sm}}));const RY=kY;var TY=Object.defineProperty,pp=Object.getOwnPropertySymbols,QI=Object.prototype.hasOwnProperty,KI=Object.prototype.propertyIsEnumerable,wP=(e,t,r)=>t in e?TY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,IY=(e,t)=>{for(var r in t||(t={}))QI.call(t,r)&&wP(e,r,t[r]);if(pp)for(var r of pp(t))KI.call(t,r)&&wP(e,r,t[r]);return e},DY=(e,t)=>{var r={};for(var n in e)QI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pp)for(var n of pp(e))t.indexOf(n)<0&&KI.call(e,n)&&(r[n]=e[n]);return r};const NY={},YI=f.forwardRef((e,t)=>{const r=H("ListItem",NY,e),{className:n,children:o,icon:i}=r,a=DY(r,["className","children","icon"]),{icon:l,spacing:c,center:u,listStyleType:d,size:p,withPadding:h,classNames:m,styles:v,unstyled:g,variant:b}=$Y(),y=i||l,{classes:x,cx:_}=RY({withPadding:h,listStyleType:d,center:u,spacing:c},{classNames:m,styles:v,unstyled:g,name:"List",variant:b,size:p});return S.createElement(oe,IY({component:"li",className:_(x.item,n),"data-with-icon":!!y||void 0,ref:t},a),S.createElement("div",{className:x.itemWrapper},y&&S.createElement("span",{className:x.itemIcon},y),S.createElement("span",null,o)))});YI.displayName="@mantine/core/ListItem";var AY=Object.defineProperty,MY=Object.defineProperties,LY=Object.getOwnPropertyDescriptors,_P=Object.getOwnPropertySymbols,zY=Object.prototype.hasOwnProperty,FY=Object.prototype.propertyIsEnumerable,bP=(e,t,r)=>t in e?AY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VY=(e,t)=>{for(var r in t||(t={}))zY.call(t,r)&&bP(e,r,t[r]);if(_P)for(var r of _P(t))FY.call(t,r)&&bP(e,r,t[r]);return e},BY=(e,t)=>MY(e,LY(t)),UY=W((e,{withPadding:t,listStyleType:r},{size:n})=>({root:BY(VY({},e.fn.fontStyles()),{listStyleType:r,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:t?e.spacing.xl:0,listStylePosition:"inside"})}));const WY=UY;var HY=Object.defineProperty,hp=Object.getOwnPropertySymbols,XI=Object.prototype.hasOwnProperty,JI=Object.prototype.propertyIsEnumerable,SP=(e,t,r)=>t in e?HY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GY=(e,t)=>{for(var r in t||(t={}))XI.call(t,r)&&SP(e,r,t[r]);if(hp)for(var r of hp(t))JI.call(t,r)&&SP(e,r,t[r]);return e},qY=(e,t)=>{var r={};for(var n in e)XI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&hp)for(var n of hp(e))t.indexOf(n)<0&&JI.call(e,n)&&(r[n]=e[n]);return r};const QY={type:"unordered",size:"md",spacing:0},Or=f.forwardRef((e,t)=>{const r=H("List",QY,e),{children:n,type:o,size:i,listStyleType:a,withPadding:l,center:c,spacing:u,icon:d,className:p,styles:h,classNames:m,unstyled:v,variant:g}=r,b=qY(r,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled","variant"]),{classes:y,cx:x}=WY({withPadding:l,listStyleType:a,center:c,spacing:u},{classNames:m,styles:h,name:"List",unstyled:v,size:i,variant:g});return S.createElement(EY,{value:{spacing:u,center:c,icon:d,listStyleType:a,size:i,withPadding:l,classNames:m,styles:h,unstyled:v,variant:g}},S.createElement(oe,GY({component:o==="unordered"?"ul":"ol",className:x(y.root,p),ref:t},b),n))});Or.Item=YI;Or.displayName="@mantine/core/List";var KY=Object.defineProperty,YY=Object.defineProperties,XY=Object.getOwnPropertyDescriptors,PP=Object.getOwnPropertySymbols,JY=Object.prototype.hasOwnProperty,ZY=Object.prototype.propertyIsEnumerable,OP=(e,t,r)=>t in e?KY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eX=(e,t)=>{for(var r in t||(t={}))JY.call(t,r)&&OP(e,r,t[r]);if(PP)for(var r of PP(t))ZY.call(t,r)&&OP(e,r,t[r]);return e},tX=(e,t)=>YY(e,XY(t)),rX=W(e=>({root:tX(eX({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})}));const nX=rX;var oX=Object.defineProperty,iX=Object.defineProperties,aX=Object.getOwnPropertyDescriptors,mp=Object.getOwnPropertySymbols,ZI=Object.prototype.hasOwnProperty,eD=Object.prototype.propertyIsEnumerable,jP=(e,t,r)=>t in e?oX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lu=(e,t)=>{for(var r in t||(t={}))ZI.call(t,r)&&jP(e,r,t[r]);if(mp)for(var r of mp(t))eD.call(t,r)&&jP(e,r,t[r]);return e},sX=(e,t)=>iX(e,aX(t)),lX=(e,t)=>{var r={};for(var n in e)ZI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&mp)for(var n of mp(e))t.indexOf(n)<0&&eD.call(e,n)&&(r[n]=e[n]);return r};const cX={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:$n("overlay")},tD=f.forwardRef((e,t)=>{const r=H("LoadingOverlay",cX,e),{className:n,visible:o,loaderProps:i,overlayOpacity:a,overlayColor:l,transitionDuration:c,exitTransitionDuration:u,zIndex:d,style:p,loader:h,radius:m,overlayBlur:v,unstyled:g,variant:b,keepMounted:y}=r,x=lX(r,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:_,cx:w,theme:j}=nX(null,{name:"LoadingOverlay",unstyled:g,variant:b}),C=`calc(${d} + 1)`;return S.createElement(va,{keepMounted:y,duration:c,exitDuration:u,mounted:o,transition:"fade"},P=>S.createElement(oe,Lu({className:w(_.root,n),style:sX(Lu(Lu({},P),p),{zIndex:d}),ref:t},x),h?S.createElement("div",{style:{zIndex:C}},h):S.createElement(dn,Lu({style:{zIndex:C}},i)),S.createElement(vI,{opacity:a,zIndex:d,radius:m,blur:v,unstyled:g,color:l||(j.colorScheme==="dark"?j.colors.dark[5]:j.white)})))});tD.displayName="@mantine/core/LoadingOverlay";const rD={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[uX,Tc]=Do(rD.context);var dX=W(e=>({divider:{marginTop:O(4),marginBottom:O(4),borderTop:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const fX=dX;var pX=Object.defineProperty,gp=Object.getOwnPropertySymbols,nD=Object.prototype.hasOwnProperty,oD=Object.prototype.propertyIsEnumerable,CP=(e,t,r)=>t in e?pX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hX=(e,t)=>{for(var r in t||(t={}))nD.call(t,r)&&CP(e,r,t[r]);if(gp)for(var r of gp(t))oD.call(t,r)&&CP(e,r,t[r]);return e},mX=(e,t)=>{var r={};for(var n in e)nD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&gp)for(var n of gp(e))t.indexOf(n)<0&&oD.call(e,n)&&(r[n]=e[n]);return r};const gX={},iD=f.forwardRef((e,t)=>{const r=H("MenuDivider",gX,e),{children:n,className:o}=r,i=mX(r,["children","className"]),{classNames:a,styles:l,unstyled:c,variant:u}=Tc(),{classes:d,cx:p}=fX(null,{name:"Menu",classNames:a,styles:l,unstyled:c,variant:u});return S.createElement(oe,hX({className:p(d.divider,o),ref:t},i))});iD.displayName="@mantine/core/MenuDivider";var vX=Object.defineProperty,vp=Object.getOwnPropertySymbols,aD=Object.prototype.hasOwnProperty,sD=Object.prototype.propertyIsEnumerable,EP=(e,t,r)=>t in e?vX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yX=(e,t)=>{for(var r in t||(t={}))aD.call(t,r)&&EP(e,r,t[r]);if(vp)for(var r of vp(t))sD.call(t,r)&&EP(e,r,t[r]);return e},xX=(e,t)=>{var r={};for(var n in e)aD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&vp)for(var n of vp(e))t.indexOf(n)<0&&sD.call(e,n)&&(r[n]=e[n]);return r};const wX={};function lD(e){const t=H("MenuDropdown",wX,e),{children:r,onMouseEnter:n,onMouseLeave:o}=t,i=xX(t,["children","onMouseEnter","onMouseLeave"]),a=f.useRef(),l=Tc(),c=p=>{var h;(p.key==="ArrowUp"||p.key==="ArrowDown")&&(p.preventDefault(),(h=a.current.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||h.focus())},u=zr(n,()=>l.trigger==="hover"&&l.openDropdown()),d=zr(o,()=>l.trigger==="hover"&&l.closeDropdown());return S.createElement(Lo.Dropdown,yX({onMouseEnter:u,onMouseLeave:d,role:"menu","aria-orientation":"vertical"},i),S.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:c,ref:a,style:{outline:0}},r))}lD.displayName="@mantine/core/MenuDropdown";var _X=Object.defineProperty,bX=Object.defineProperties,SX=Object.getOwnPropertyDescriptors,$P=Object.getOwnPropertySymbols,PX=Object.prototype.hasOwnProperty,OX=Object.prototype.propertyIsEnumerable,kP=(e,t,r)=>t in e?_X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jX=(e,t)=>{for(var r in t||(t={}))PX.call(t,r)&&kP(e,r,t[r]);if($P)for(var r of $P(t))OX.call(t,r)&&kP(e,r,t[r]);return e},CX=(e,t)=>bX(e,SX(t)),EX=W((e,{color:t,radius:r})=>({item:CX(jX({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs} ${e.spacing.sm}`,cursor:"pointer",borderRadius:e.fn.radius(r),color:t?e.fn.variant({variant:"filled",primaryFallback:!1,color:t}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:t?e.fn.variant({variant:"light",color:t}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[1]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}}));const $X=EX;var kX=Object.defineProperty,RX=Object.defineProperties,TX=Object.getOwnPropertyDescriptors,yp=Object.getOwnPropertySymbols,cD=Object.prototype.hasOwnProperty,uD=Object.prototype.propertyIsEnumerable,RP=(e,t,r)=>t in e?kX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,IX=(e,t)=>{for(var r in t||(t={}))cD.call(t,r)&&RP(e,r,t[r]);if(yp)for(var r of yp(t))uD.call(t,r)&&RP(e,r,t[r]);return e},DX=(e,t)=>RX(e,TX(t)),NX=(e,t)=>{var r={};for(var n in e)cD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&yp)for(var n of yp(e))t.indexOf(n)<0&&uD.call(e,n)&&(r[n]=e[n]);return r};const AX={},dD=f.forwardRef((e,t)=>{const r=H("MenuItem",AX,e),{children:n,className:o,color:i,closeMenuOnClick:a,icon:l,rightSection:c}=r,u=NX(r,["children","className","color","closeMenuOnClick","icon","rightSection"]),d=Tc(),{classes:p,cx:h,theme:m}=$X({radius:d.radius,color:i},{name:"Menu",classNames:d.classNames,styles:d.styles,unstyled:d.unstyled,variant:d.variant}),v=f.useRef(),g=d.getItemIndex(v.current),b=u,y=zr(b.onMouseLeave,()=>d.setHovered(-1)),x=zr(b.onMouseEnter,()=>d.setHovered(d.getItemIndex(v.current))),_=zr(b.onClick,()=>{typeof a=="boolean"?a&&d.closeDropdownImmediately():d.closeOnItemClick&&d.closeDropdownImmediately()}),w=zr(b.onFocus,()=>d.setHovered(d.getItemIndex(v.current)));return S.createElement(oe,DX(IX({component:"button",type:"button"},u),{tabIndex:-1,onFocus:w,className:h(p.item,o),ref:Ts(v,t),role:"menuitem","data-menu-item":!0,"data-hovered":d.hovered===g?!0:void 0,onMouseEnter:x,onMouseLeave:y,onClick:_,onKeyDown:mE({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:d.loop,dir:m.dir,orientation:"vertical",onKeyDown:b.onKeydown})}),l&&S.createElement("div",{className:p.itemIcon},l),n&&S.createElement("div",{className:p.itemLabel},n),c&&S.createElement("div",{className:p.itemRightSection},c))});dD.displayName="@mantine/core/MenuItem";const MX=dD;var LX=W(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs} / 2) ${e.spacing.sm}`,cursor:"default"}}));const zX=LX;var FX=Object.defineProperty,xp=Object.getOwnPropertySymbols,fD=Object.prototype.hasOwnProperty,pD=Object.prototype.propertyIsEnumerable,TP=(e,t,r)=>t in e?FX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VX=(e,t)=>{for(var r in t||(t={}))fD.call(t,r)&&TP(e,r,t[r]);if(xp)for(var r of xp(t))pD.call(t,r)&&TP(e,r,t[r]);return e},BX=(e,t)=>{var r={};for(var n in e)fD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&xp)for(var n of xp(e))t.indexOf(n)<0&&pD.call(e,n)&&(r[n]=e[n]);return r};const UX={},hD=f.forwardRef((e,t)=>{const r=H("MenuLabel",UX,e),{children:n,className:o}=r,i=BX(r,["children","className"]),{classNames:a,styles:l,unstyled:c,variant:u}=Tc(),{classes:d,cx:p}=zX(null,{name:"Menu",classNames:a,styles:l,unstyled:c,variant:u});return S.createElement(re,VX({className:p(d.label,o),ref:t},i),n)});hD.displayName="@mantine/core/MenuLabel";var WX=Object.defineProperty,wp=Object.getOwnPropertySymbols,mD=Object.prototype.hasOwnProperty,gD=Object.prototype.propertyIsEnumerable,IP=(e,t,r)=>t in e?WX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,HX=(e,t)=>{for(var r in t||(t={}))mD.call(t,r)&&IP(e,r,t[r]);if(wp)for(var r of wp(t))gD.call(t,r)&&IP(e,r,t[r]);return e},GX=(e,t)=>{var r={};for(var n in e)mD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&wp)for(var n of wp(e))t.indexOf(n)<0&&gD.call(e,n)&&(r[n]=e[n]);return r};const qX={refProp:"ref"},vD=f.forwardRef((e,t)=>{const r=H("MenuTarget",qX,e),{children:n,refProp:o}=r,i=GX(r,["children","refProp"]);if(!ks(n))throw new Error(rD.children);const a=Tc(),l=zr(n.props.onClick,()=>a.trigger==="click"&&a.toggleDropdown()),c=zr(n.props.onMouseEnter,()=>a.trigger==="hover"&&a.openDropdown()),u=zr(n.props.onMouseLeave,()=>a.trigger==="hover"&&a.closeDropdown());return S.createElement(Lo.Target,HX({refProp:o,popupType:"menu",ref:t},i),f.cloneElement(n,{onClick:l,onMouseEnter:c,onMouseLeave:u,"data-expanded":a.opened?!0:void 0}))});vD.displayName="@mantine/core/MenuTarget";var QX=W({dropdown:{padding:O(4)}});const KX=QX;var YX=Object.defineProperty,XX=Object.defineProperties,JX=Object.getOwnPropertyDescriptors,_p=Object.getOwnPropertySymbols,yD=Object.prototype.hasOwnProperty,xD=Object.prototype.propertyIsEnumerable,DP=(e,t,r)=>t in e?YX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,NP=(e,t)=>{for(var r in t||(t={}))yD.call(t,r)&&DP(e,r,t[r]);if(_p)for(var r of _p(t))xD.call(t,r)&&DP(e,r,t[r]);return e},AP=(e,t)=>XX(e,JX(t)),ZX=(e,t)=>{var r={};for(var n in e)yD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&_p)for(var n of _p(e))t.indexOf(n)<0&&xD.call(e,n)&&(r[n]=e[n]);return r};const eJ={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function X(e){const t=H("Menu",eJ,e),{children:r,onOpen:n,onClose:o,opened:i,defaultOpened:a,onChange:l,closeOnItemClick:c,loop:u,closeOnEscape:d,trigger:p,openDelay:h,closeDelay:m,classNames:v,styles:g,unstyled:b,radius:y,variant:x}=t,_=ZX(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:w,cx:j}=KX(),[C,{setHovered:P,resetHovered:E}]=yM(),[k,$]=kr({value:i,defaultValue:a,finalValue:!1,onChange:l}),I=()=>{$(!1),k&&(o==null||o())},T=()=>{$(!0),!k&&(n==null||n())},z=()=>k?I():T(),{openDropdown:M,closeDropdown:L}=ZK({open:T,close:I,closeDelay:m,openDelay:h}),q=Y=>mM("[data-menu-item]","[data-menu-dropdown]",Y);return on(()=>{E()},[k]),S.createElement(uX,{value:{opened:k,toggleDropdown:z,getItemIndex:q,hovered:C,setHovered:P,closeOnItemClick:c,closeDropdown:p==="click"?I:L,openDropdown:p==="click"?T:M,closeDropdownImmediately:I,loop:u,trigger:p,radius:y,classNames:v,styles:g,unstyled:b,variant:x}},S.createElement(Lo,AP(NP({},_),{radius:y,opened:k,onChange:z,defaultOpened:a,trapFocus:p==="click",closeOnEscape:d&&p==="click",__staticSelector:"Menu",classNames:AP(NP({},v),{dropdown:j(w.dropdown,v==null?void 0:v.dropdown)}),styles:g,unstyled:b,variant:x}),r))}X.displayName="@mantine/core/Menu";X.Item=MX;X.Label=hD;X.Dropdown=lD;X.Target=vD;X.Divider=iD;const[tJ,rJ]=Do("Modal component was not found in tree"),nJ={xs:O(320),sm:O(380),md:O(440),lg:O(620),xl:O(780)};var oJ=W((e,{yOffset:t,xOffset:r,centered:n,fullScreen:o},{size:i})=>({content:{flex:o?"0 0 100%":`0 0 ${A({size:i,sizes:nJ})}`,maxWidth:"100%",maxHeight:o?void 0:`calc(100dvh - (${O(t)} * 2))`,height:o?"100vh":void 0,borderRadius:o?0:void 0,overflowY:"auto"},inner:{paddingTop:o?0:t,paddingBottom:o?0:t,paddingLeft:o?0:r,paddingRight:o?0:r,display:"flex",justifyContent:"center",alignItems:n?"center":"flex-start"}}));const iJ=oJ;var aJ=Object.defineProperty,sJ=Object.defineProperties,lJ=Object.getOwnPropertyDescriptors,bp=Object.getOwnPropertySymbols,wD=Object.prototype.hasOwnProperty,_D=Object.prototype.propertyIsEnumerable,MP=(e,t,r)=>t in e?aJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iy=(e,t)=>{for(var r in t||(t={}))wD.call(t,r)&&MP(e,r,t[r]);if(bp)for(var r of bp(t))_D.call(t,r)&&MP(e,r,t[r]);return e},bD=(e,t)=>sJ(e,lJ(t)),cJ=(e,t)=>{var r={};for(var n in e)wD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&bp)for(var n of bp(e))t.indexOf(n)<0&&_D.call(e,n)&&(r[n]=e[n]);return r};const uJ=bD(iy({},sx),{yOffset:"5dvh",xOffset:"5vw"});function SD(e){const t=H("ModalRoot",uJ,e),{classNames:r,variant:n,size:o,yOffset:i,xOffset:a,scrollAreaComponent:l,radius:c,centered:u,fullScreen:d}=t,p=cJ(t,["classNames","variant","size","yOffset","xOffset","scrollAreaComponent","radius","centered","fullScreen"]),{classes:h,cx:m}=iJ({yOffset:i,xOffset:a,centered:u,fullScreen:d},{name:"Modal",variant:n,size:o});return S.createElement(tJ,{value:{yOffset:i,scrollAreaComponent:l,radius:c}},S.createElement(Rt,iy({__staticSelector:"Modal",size:o,variant:n,classNames:bD(iy({},r),{content:m(h.content,r==null?void 0:r.content),inner:m(h.inner,r==null?void 0:r.inner)})},p)))}var dJ=Object.defineProperty,Sp=Object.getOwnPropertySymbols,PD=Object.prototype.hasOwnProperty,OD=Object.prototype.propertyIsEnumerable,LP=(e,t,r)=>t in e?dJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fJ=(e,t)=>{for(var r in t||(t={}))PD.call(t,r)&&LP(e,r,t[r]);if(Sp)for(var r of Sp(t))OD.call(t,r)&&LP(e,r,t[r]);return e},pJ=(e,t)=>{var r={};for(var n in e)PD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Sp)for(var n of Sp(e))t.indexOf(n)<0&&OD.call(e,n)&&(r[n]=e[n]);return r};const hJ={shadow:"xl"},jD=f.forwardRef((e,t)=>{const r=H("ModalContent",hJ,e),{children:n,scrollAreaComponent:o}=r,i=pJ(r,["children","scrollAreaComponent"]),a=rJ(),l=o||a.scrollAreaComponent||Rt.NativeScrollArea;return S.createElement(Rt.Content,fJ({ref:t,radius:a.radius},i),S.createElement(l,{style:{maxHeight:`calc(100dvh - (${O(a.yOffset)} * 2))`}},n))});var mJ=Object.defineProperty,gJ=Object.defineProperties,vJ=Object.getOwnPropertyDescriptors,Pp=Object.getOwnPropertySymbols,CD=Object.prototype.hasOwnProperty,ED=Object.prototype.propertyIsEnumerable,zP=(e,t,r)=>t in e?mJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yd=(e,t)=>{for(var r in t||(t={}))CD.call(t,r)&&zP(e,r,t[r]);if(Pp)for(var r of Pp(t))ED.call(t,r)&&zP(e,r,t[r]);return e},yJ=(e,t)=>gJ(e,vJ(t)),xJ=(e,t)=>{var r={};for(var n in e)CD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pp)for(var n of Pp(e))t.indexOf(n)<0&&ED.call(e,n)&&(r[n]=e[n]);return r};const wJ=yJ(yd({},sx),{transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0});function Dr(e){const t=H("Modal",wJ,e),{title:r,withOverlay:n,overlayProps:o,withCloseButton:i,closeButtonProps:a,children:l}=t,c=xJ(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!r||i;return S.createElement(SD,yd({},c),n&&S.createElement(Rt.Overlay,yd({},o)),S.createElement(jD,null,u&&S.createElement(Rt.Header,null,r&&S.createElement(Rt.Title,null,r),i&&S.createElement(Rt.CloseButton,yd({},a))),S.createElement(Rt.Body,null,l)))}Dr.Root=SD;Dr.CloseButton=Rt.CloseButton;Dr.Overlay=Rt.Overlay;Dr.Content=jD;Dr.Header=Rt.Header;Dr.Title=Rt.Title;Dr.Body=Rt.Body;Dr.NativeScrollArea=Rt.NativeScrollArea;const $D={xs:O(16),sm:O(22),md:O(26),lg:O(30),xl:O(36)},_J={xs:O(10),sm:O(12),md:O(14),lg:O(16),xl:O(18)};var bJ=W((e,{disabled:t,radius:r,readOnly:n},{size:o,variant:i})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:i==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:A({size:o,sizes:$D}),paddingLeft:`calc(${A({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||n?A({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:A({size:o,sizes:_J}),borderRadius:A({size:r,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${O(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${A({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}})),SJ=Object.defineProperty,Op=Object.getOwnPropertySymbols,kD=Object.prototype.hasOwnProperty,RD=Object.prototype.propertyIsEnumerable,FP=(e,t,r)=>t in e?SJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PJ=(e,t)=>{for(var r in t||(t={}))kD.call(t,r)&&FP(e,r,t[r]);if(Op)for(var r of Op(t))RD.call(t,r)&&FP(e,r,t[r]);return e},OJ=(e,t)=>{var r={};for(var n in e)kD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Op)for(var n of Op(e))t.indexOf(n)<0&&RD.call(e,n)&&(r[n]=e[n]);return r};const jJ={xs:16,sm:22,md:24,lg:26,xl:30};function TD(e){var t=e,{label:r,classNames:n,styles:o,className:i,onRemove:a,disabled:l,readOnly:c,size:u,radius:d="sm",variant:p,unstyled:h}=t,m=OJ(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:v,cx:g}=bJ({disabled:l,readOnly:c,radius:d},{name:"MultiSelect",classNames:n,styles:o,unstyled:h,size:u,variant:p});return S.createElement("div",PJ({className:g(v.defaultValue,i)},m),S.createElement("span",{className:v.defaultValueLabel},r),!l&&!c&&S.createElement(jc,{"aria-hidden":!0,onMouseDown:a,size:jJ[u],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:v.defaultValueRemove,tabIndex:-1,unstyled:h}))}TD.displayName="@mantine/core/MultiSelect/DefaultValue";function CJ({data:e,searchable:t,limit:r,searchValue:n,filter:o,value:i,disableSelectedItemFiltering:a}){if(!t&&i.length===0)return e;if(!t){const c=[];for(let u=0;u<e.length;u+=1)(a||!i.some(d=>d===e[u].value&&!e[u].disabled))&&c.push(e[u]);return c}const l=[];for(let c=0;c<e.length&&(o(n,!a&&i.some(u=>u===e[c].value&&!e[c].disabled),e[c])&&l.push(e[c]),!(l.length>=r));c+=1);return l}var EJ=Object.defineProperty,jp=Object.getOwnPropertySymbols,ID=Object.prototype.hasOwnProperty,DD=Object.prototype.propertyIsEnumerable,VP=(e,t,r)=>t in e?EJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,BP=(e,t)=>{for(var r in t||(t={}))ID.call(t,r)&&VP(e,r,t[r]);if(jp)for(var r of jp(t))DD.call(t,r)&&VP(e,r,t[r]);return e},$J=(e,t)=>{var r={};for(var n in e)ID.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&jp)for(var n of jp(e))t.indexOf(n)<0&&DD.call(e,n)&&(r[n]=e[n]);return r};const kJ={xs:O(14),sm:O(18),md:O(20),lg:O(24),xl:O(28)};function RJ(e){var t=e,{size:r,error:n,style:o}=t,i=$J(t,["size","error","style"]);const a=Zt(),l=A({size:r,sizes:kJ});return S.createElement("svg",BP({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:BP({color:n?a.colors.red[6]:a.colors.gray[6],width:l,height:l},o),"data-chevron":!0},i),S.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"}))}var TJ=Object.defineProperty,IJ=Object.defineProperties,DJ=Object.getOwnPropertyDescriptors,UP=Object.getOwnPropertySymbols,NJ=Object.prototype.hasOwnProperty,AJ=Object.prototype.propertyIsEnumerable,WP=(e,t,r)=>t in e?TJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,MJ=(e,t)=>{for(var r in t||(t={}))NJ.call(t,r)&&WP(e,r,t[r]);if(UP)for(var r of UP(t))AJ.call(t,r)&&WP(e,r,t[r]);return e},LJ=(e,t)=>IJ(e,DJ(t));function ND({shouldClear:e,clearButtonProps:t,onClear:r,size:n,error:o}){return e?S.createElement(jc,LJ(MJ({},t),{variant:"transparent",onClick:r,size:n,onMouseDown:i=>i.preventDefault()})):S.createElement(RJ,{error:o,size:n})}ND.displayName="@mantine/core/SelectRightSection";var zJ=Object.defineProperty,FJ=Object.defineProperties,VJ=Object.getOwnPropertyDescriptors,Cp=Object.getOwnPropertySymbols,AD=Object.prototype.hasOwnProperty,MD=Object.prototype.propertyIsEnumerable,HP=(e,t,r)=>t in e?zJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jg=(e,t)=>{for(var r in t||(t={}))AD.call(t,r)&&HP(e,r,t[r]);if(Cp)for(var r of Cp(t))MD.call(t,r)&&HP(e,r,t[r]);return e},GP=(e,t)=>FJ(e,VJ(t)),BJ=(e,t)=>{var r={};for(var n in e)AD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cp)for(var n of Cp(e))t.indexOf(n)<0&&MD.call(e,n)&&(r[n]=e[n]);return r};function LD(e){var t=e,{styles:r,rightSection:n,rightSectionWidth:o,theme:i}=t,a=BJ(t,["styles","rightSection","rightSectionWidth","theme"]);if(n)return{rightSection:n,rightSectionWidth:o,styles:r};const l=typeof r=="function"?r(i):r;return{rightSection:!a.readOnly&&!(a.disabled&&a.shouldClear)&&S.createElement(ND,jg({},a)),styles:GP(jg({},l),{rightSection:GP(jg({},l==null?void 0:l.rightSection),{pointerEvents:a.shouldClear?void 0:"none"})})}}var UJ=Object.defineProperty,WJ=Object.defineProperties,HJ=Object.getOwnPropertyDescriptors,qP=Object.getOwnPropertySymbols,GJ=Object.prototype.hasOwnProperty,qJ=Object.prototype.propertyIsEnumerable,QP=(e,t,r)=>t in e?UJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QJ=(e,t)=>{for(var r in t||(t={}))GJ.call(t,r)&&QP(e,r,t[r]);if(qP)for(var r of qP(t))qJ.call(t,r)&&QP(e,r,t[r]);return e},KJ=(e,t)=>WJ(e,HJ(t)),YJ=W((e,{invalid:t},{size:r})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${A({size:r,sizes:$t})} - ${O(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:A({size:r,sizes:$t})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${O(2)}) calc(${e.spacing.xs} / 2)`},searchInput:KJ(QJ({},e.fn.fontStyles()),{flex:1,minWidth:O(60),backgroundColor:"transparent",border:0,outline:0,fontSize:A({size:r,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:A({size:r,sizes:$D}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const XJ=YJ;var JJ=Object.defineProperty,ZJ=Object.defineProperties,eZ=Object.getOwnPropertyDescriptors,Ep=Object.getOwnPropertySymbols,zD=Object.prototype.hasOwnProperty,FD=Object.prototype.propertyIsEnumerable,KP=(e,t,r)=>t in e?JJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ia=(e,t)=>{for(var r in t||(t={}))zD.call(t,r)&&KP(e,r,t[r]);if(Ep)for(var r of Ep(t))FD.call(t,r)&&KP(e,r,t[r]);return e},YP=(e,t)=>ZJ(e,eZ(t)),tZ=(e,t)=>{var r={};for(var n in e)zD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ep)for(var n of Ep(e))t.indexOf(n)<0&&FD.call(e,n)&&(r[n]=e[n]);return r};function rZ(e,t,r){return t?!1:r.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function nZ(e,t){return!!e&&!t.some(r=>r.value.toLowerCase()===e.toLowerCase())}function XP(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const r=t.map(n=>typeof n=="object"?n.value:n);return e.filter(n=>r.includes(n))}const oZ={size:"sm",valueComponent:TD,itemComponent:eR,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:rZ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:nZ,switchDirectionOnFlip:!1,zIndex:$n("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},sm=f.forwardRef((e,t)=>{const r=H("MultiSelect",oZ,e),{className:n,style:o,required:i,label:a,description:l,size:c,error:u,classNames:d,styles:p,wrapperProps:h,value:m,defaultValue:v,data:g,onChange:b,valueComponent:y,itemComponent:x,id:_,transitionProps:w,maxDropdownHeight:j,shadow:C,nothingFound:P,onFocus:E,onBlur:k,searchable:$,placeholder:I,filter:T,limit:z,clearSearchOnChange:M,clearable:L,clearSearchOnBlur:q,variant:Y,onSearchChange:R,searchValue:N,disabled:V,initiallyOpened:Q,radius:ee,icon:_e,rightSection:we,rightSectionWidth:Ue,creatable:Ae,getCreateLabel:pt,shouldCreate:Nt,onCreate:Pe,sx:Gt,dropdownComponent:Ar,onDropdownClose:cr,onDropdownOpen:qt,maxSelectedValues:At,withinPortal:io,portalProps:ao,switchDirectionOnFlip:Ye,zIndex:so,selectOnBlur:Rn,name:Ft,dropdownPosition:Oa,errorProps:ki,labelProps:lo,descriptionProps:J,form:ge,positionDependencies:ze,onKeyDown:ht,unstyled:_t,inputContainer:Tn,inputWrapperOrder:In,readOnly:yr,withAsterisk:Dn,clearButtonProps:Bo,hoverOnSearchChange:hn,disableSelectedItemFiltering:Ri}=r,Uo=tZ(r,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:xr,cx:co,theme:Vs}=XJ({invalid:!!u},{name:"MultiSelect",classNames:d,styles:p,unstyled:_t,size:c,variant:Y}),{systemStyles:D,rest:F}=no(Uo),U=f.useRef(),Z=f.useRef({}),de=Ir(_),[se,fe]=f.useState(Q),[ye,ce]=f.useState(-1),[Be,nt]=f.useState("column"),[be,Me]=kr({value:N,defaultValue:"",finalValue:void 0,onChange:R}),[jt,Nn]=f.useState(!1),{scrollIntoView:Qr,targetRef:Wo,scrollableRef:Bs}=l6({duration:0,offset:5,cancelable:!1,isList:!0}),Kr=Ae&&typeof pt=="function";let Yr=null;const ja=g.map(xe=>typeof xe=="string"?{label:xe,value:xe}:xe),Ti=xM({data:ja}),[Xe,An]=kr({value:XP(m,g),defaultValue:XP(v,g),finalValue:[],onChange:b}),Ce=f.useRef(!!At&&At<Xe.length),wr=xe=>{if(!yr){const Je=Xe.filter(Xr=>Xr!==xe);An(Je),At&&Je.length<At&&(Ce.current=!1)}},Mn=xe=>{Me(xe.currentTarget.value),!V&&!Ce.current&&$&&fe(!0)},mt=xe=>{typeof E=="function"&&E(xe),!V&&!Ce.current&&$&&fe(!0)},gt=CJ({data:Ti,searchable:$,searchValue:be,limit:z,filter:T,value:Xe,disableSelectedItemFiltering:Ri});Kr&&Nt(be,Ti)&&(Yr=pt(be),gt.push({label:be,value:be,creatable:!0}));const Ln=Math.min(ye,gt.length-1),Yc=(xe,Je,Xr)=>{let Ho=xe;for(;Xr(Ho);)if(Ho=Je(Ho),!gt[Ho].disabled)return Ho;return xe};on(()=>{ce(hn&&be?0:-1)},[be,hn]),on(()=>{!V&&Xe.length>g.length&&fe(!1),At&&Xe.length<At&&(Ce.current=!1),At&&Xe.length>=At&&(Ce.current=!0,fe(!1))},[Xe]);const Xc=xe=>{if(!yr)if(M&&Me(""),Xe.includes(xe.value))wr(xe.value);else{if(xe.creatable&&typeof Pe=="function"){const Je=Pe(xe.value);typeof Je<"u"&&Je!==null&&An(typeof Je=="string"?[...Xe,Je]:[...Xe,Je.value])}else An([...Xe,xe.value]);Xe.length===At-1&&(Ce.current=!0,fe(!1)),gt.length===1&&fe(!1)}},oA=xe=>{typeof k=="function"&&k(xe),Rn&>[Ln]&&se&&Xc(gt[Ln]),q&&Me(""),fe(!1)},iA=xe=>{if(jt||(ht==null||ht(xe),yr)||xe.key!=="Backspace"&&At&&Ce.current)return;const Je=Be==="column",Xr=()=>{ce(Ii=>{var uo;const Us=Yc(Ii,Di=>Di+1,Di=>Di<gt.length-1);return se&&(Wo.current=Z.current[(uo=gt[Us])==null?void 0:uo.value],Qr({alignment:Je?"end":"start"})),Us})},Ho=()=>{ce(Ii=>{var uo;const Us=Yc(Ii,Di=>Di-1,Di=>Di>0);return se&&(Wo.current=Z.current[(uo=gt[Us])==null?void 0:uo.value],Qr({alignment:Je?"start":"end"})),Us})};switch(xe.key){case"ArrowUp":{xe.preventDefault(),fe(!0),Je?Ho():Xr();break}case"ArrowDown":{xe.preventDefault(),fe(!0),Je?Xr():Ho();break}case"Enter":{xe.preventDefault(),gt[Ln]&&se?Xc(gt[Ln]):fe(!0);break}case" ":{$||(xe.preventDefault(),gt[Ln]&&se?Xc(gt[Ln]):fe(!0));break}case"Backspace":{Xe.length>0&&be.length===0&&(An(Xe.slice(0,-1)),fe(!0),At&&(Ce.current=!1));break}case"Home":{if(!$){xe.preventDefault(),se||fe(!0);const Ii=gt.findIndex(uo=>!uo.disabled);ce(Ii),Qr({alignment:Je?"end":"start"})}break}case"End":{if(!$){xe.preventDefault(),se||fe(!0);const Ii=gt.map(uo=>!!uo.disabled).lastIndexOf(!1);ce(Ii),Qr({alignment:Je?"end":"start"})}break}case"Escape":fe(!1)}},aA=Xe.map(xe=>{let Je=Ti.find(Xr=>Xr.value===xe&&!Xr.disabled);return!Je&&Kr&&(Je={value:xe,label:xe}),Je}).filter(xe=>!!xe).map((xe,Je)=>S.createElement(y,YP(Ia({},xe),{variant:Y,disabled:V,className:xr.value,readOnly:yr,onRemove:Xr=>{Xr.preventDefault(),Xr.stopPropagation(),wr(xe.value)},key:xe.value,size:c,styles:p,classNames:d,radius:ee,index:Je}))),sA=xe=>Xe.includes(xe),lA=()=>{var xe;Me(""),An([]),(xe=U.current)==null||xe.focus(),At&&(Ce.current=!1)},Jc=!yr&&(gt.length>0?se:se&&!!P);return on(()=>{const xe=Jc?qt:cr;typeof xe=="function"&&xe()},[Jc]),S.createElement(Wt.Wrapper,Ia(Ia({required:i,id:de,label:a,error:u,description:l,size:c,className:n,style:o,classNames:d,styles:p,__staticSelector:"MultiSelect",sx:Gt,errorProps:ki,descriptionProps:J,labelProps:lo,inputContainer:Tn,inputWrapperOrder:In,unstyled:_t,withAsterisk:Dn,variant:Y},D),h),S.createElement(Al,{opened:Jc,transitionProps:w,shadow:"sm",withinPortal:io,portalProps:ao,__staticSelector:"MultiSelect",onDirectionChange:nt,switchDirectionOnFlip:Ye,zIndex:so,dropdownPosition:Oa,positionDependencies:[...ze,be],classNames:d,styles:p,unstyled:_t,variant:Y},S.createElement(Al.Target,null,S.createElement("div",{className:xr.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":se&&Jc?`${de}-items`:null,"aria-controls":de,"aria-expanded":se,onMouseLeave:()=>ce(-1),tabIndex:-1},S.createElement("input",{type:"hidden",name:Ft,value:Xe.join(","),form:ge,disabled:V}),S.createElement(Wt,Ia({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:c,variant:Y,disabled:V,error:u,required:i,radius:ee,icon:_e,unstyled:_t,onMouseDown:xe=>{var Je;xe.preventDefault(),!V&&!Ce.current&&fe(!se),(Je=U.current)==null||Je.focus()},classNames:YP(Ia({},d),{input:co({[xr.input]:!$},d==null?void 0:d.input)})},LD({theme:Vs,rightSection:we,rightSectionWidth:Ue,styles:p,size:c,shouldClear:L&&Xe.length>0,onClear:lA,error:u,disabled:V,clearButtonProps:Bo,readOnly:yr})),S.createElement("div",{className:xr.values,"data-clearable":L||void 0},aA,S.createElement("input",Ia({ref:Ts(t,U),type:"search",id:de,className:co(xr.searchInput,{[xr.searchInputPointer]:!$,[xr.searchInputInputHidden]:!se&&Xe.length>0||!$&&Xe.length>0,[xr.searchInputEmpty]:Xe.length===0}),onKeyDown:iA,value:be,onChange:Mn,onFocus:mt,onBlur:oA,readOnly:!$||Ce.current||yr,placeholder:Xe.length===0?I:void 0,disabled:V,"data-mantine-stop-propagation":se,autoComplete:"off",onCompositionStart:()=>Nn(!0),onCompositionEnd:()=>Nn(!1)},F)))))),S.createElement(Al.Dropdown,{component:Ar||V0,maxHeight:j,direction:Be,id:de,innerRef:Bs,__staticSelector:"MultiSelect",classNames:d,styles:p},S.createElement(Xk,{data:gt,hovered:Ln,classNames:d,styles:p,uuid:de,__staticSelector:"MultiSelect",onItemHover:ce,onItemSelect:Xc,itemsRefs:Z,itemComponent:x,size:c,nothingFound:P,isItemSelected:sA,creatable:Ae&&!!Yr,createLabel:Yr,unstyled:_t,variant:Y}))))});sm.displayName="@mantine/core/MultiSelect";var iZ=Object.defineProperty,aZ=Object.defineProperties,sZ=Object.getOwnPropertyDescriptors,$p=Object.getOwnPropertySymbols,VD=Object.prototype.hasOwnProperty,BD=Object.prototype.propertyIsEnumerable,JP=(e,t,r)=>t in e?iZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zu=(e,t)=>{for(var r in t||(t={}))VD.call(t,r)&&JP(e,r,t[r]);if($p)for(var r of $p(t))BD.call(t,r)&&JP(e,r,t[r]);return e},ZP=(e,t)=>aZ(e,sZ(t)),lZ=(e,t)=>{var r={};for(var n in e)VD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$p)for(var n of $p(e))t.indexOf(n)<0&&BD.call(e,n)&&(r[n]=e[n]);return r};const cZ={size:"sm"},ft=f.forwardRef((e,t)=>{const r=eT("NativeSelect",cZ,e),{inputProps:n,wrapperProps:o,data:i,onChange:a,value:l,classNames:c,styles:u,rightSection:d,rightSectionWidth:p}=r,h=lZ(r,["inputProps","wrapperProps","data","onChange","value","classNames","styles","rightSection","rightSectionWidth"]),m=Zt(),g=i.map(b=>typeof b=="string"?{label:b,value:b}:b).map(b=>S.createElement("option",{key:b.value,value:b.value,disabled:b.disabled},b.label));return S.createElement(Wt.Wrapper,ZP(zu({},o),{__staticSelector:"NativeSelect"}),S.createElement(Wt,zu(ZP(zu(zu({},n),h),{onChange:a,component:"select",ref:t,value:l===null?"":l,__staticSelector:"NativeSelect",pointer:m.cursorType==="pointer"}),LD({theme:m,rightSection:d,rightSectionWidth:p,styles:u,shouldClear:!1,size:n.size,error:o.error,readOnly:!1})),g))});ft.displayName="@mantine/core/NativeSelect";var uZ=W((e,{color:t,radius:r,withTitle:n})=>{const o=e.fn.radius(r),i=e.fn.variant({variant:"filled",color:t});return{closeButton:e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0]}),icon:{boxSizing:"border-box",marginRight:e.spacing.md,width:O(28),height:O(28),borderRadius:O(28),display:"flex",flex:"none",alignItems:"center",justifyContent:"center",backgroundColor:i.background,color:e.white},root:{overflow:"hidden",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",paddingLeft:O(22),paddingRight:e.spacing.xs,paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs,borderRadius:o,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,boxShadow:e.shadows.lg,"&::before":{content:'""',display:"block",position:"absolute",width:O(6),top:o,bottom:o,left:O(4),borderRadius:o,backgroundColor:i.background},"&[data-with-icon]":{paddingLeft:e.spacing.xs,"&::before":{display:"none"}},"&[data-with-border]":{border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}},body:{flex:1,overflow:"hidden",marginRight:e.spacing.xs},loader:{marginRight:e.spacing.md},title:{lineHeight:1.4,marginBottom:O(2),overflow:"hidden",textOverflow:"ellipsis",color:e.colorScheme==="dark"?e.white:e.colors.gray[9]},description:{color:n?e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis"}}});const dZ=uZ;var fZ=Object.defineProperty,pZ=Object.defineProperties,hZ=Object.getOwnPropertyDescriptors,kp=Object.getOwnPropertySymbols,UD=Object.prototype.hasOwnProperty,WD=Object.prototype.propertyIsEnumerable,eO=(e,t,r)=>t in e?fZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tO=(e,t)=>{for(var r in t||(t={}))UD.call(t,r)&&eO(e,r,t[r]);if(kp)for(var r of kp(t))WD.call(t,r)&&eO(e,r,t[r]);return e},mZ=(e,t)=>pZ(e,hZ(t)),gZ=(e,t)=>{var r={};for(var n in e)UD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kp)for(var n of kp(e))t.indexOf(n)<0&&WD.call(e,n)&&(r[n]=e[n]);return r};const vZ={withCloseButton:!0},HD=f.forwardRef((e,t)=>{const r=H("Notification",vZ,e),{className:n,color:o,radius:i,loading:a,withCloseButton:l,withBorder:c,title:u,icon:d,children:p,onClose:h,closeButtonProps:m,classNames:v,styles:g,unstyled:b,variant:y}=r,x=gZ(r,["className","color","radius","loading","withCloseButton","withBorder","title","icon","children","onClose","closeButtonProps","classNames","styles","unstyled","variant"]),{classes:_,cx:w}=dZ({color:o,radius:i,withTitle:!!u},{name:"Notification",classNames:v,styles:g,unstyled:b,variant:y});return S.createElement(oe,tO({className:w(_.root,n),"data-with-icon":!!d||a||void 0,"data-with-border":c||void 0,role:"alert",ref:t},x),d&&!a&&S.createElement("div",{className:_.icon},d),a&&S.createElement(dn,{size:28,color:o,className:_.loader}),S.createElement("div",{className:_.body},u&&S.createElement(re,{className:_.title,size:"sm",weight:500},u),S.createElement(re,{color:"dimmed",className:_.description,size:"sm"},p)),l&&S.createElement(jc,mZ(tO({iconSize:16,color:"gray"},m),{onClick:h,className:_.closeButton})))});HD.displayName="@mantine/core/Notification";var yZ=Object.defineProperty,xZ=Object.defineProperties,wZ=Object.getOwnPropertyDescriptors,Rp=Object.getOwnPropertySymbols,GD=Object.prototype.hasOwnProperty,qD=Object.prototype.propertyIsEnumerable,rO=(e,t,r)=>t in e?yZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cg=(e,t)=>{for(var r in t||(t={}))GD.call(t,r)&&rO(e,r,t[r]);if(Rp)for(var r of Rp(t))qD.call(t,r)&&rO(e,r,t[r]);return e},_Z=(e,t)=>xZ(e,wZ(t)),bZ=(e,t)=>{var r={};for(var n in e)GD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Rp)for(var n of Rp(e))t.indexOf(n)<0&&qD.call(e,n)&&(r[n]=e[n]);return r};const SZ={type:"text",size:"sm",__staticSelector:"TextInput"},le=f.forwardRef((e,t)=>{const r=eT("TextInput",SZ,e),{inputProps:n,wrapperProps:o}=r,i=bZ(r,["inputProps","wrapperProps"]);return S.createElement(Wt.Wrapper,Cg({},o),S.createElement(Wt,_Z(Cg(Cg({},n),i),{ref:t})))});le.displayName="@mantine/core/TextInput";const[PZ,lm]=Do("Pagination.Root component was not found in tree"),OZ={siblings:1,boundaries:1};function QD(e){const{total:t,value:r,defaultValue:n,onChange:o,disabled:i,children:a,siblings:l,boundaries:c,color:u,radius:d,onNextPage:p,onPreviousPage:h,onFirstPage:m,onLastPage:v,getItemProps:g,classNames:b,styles:y,unstyled:x,variant:_,size:w}=H("PaginationRoot",OZ,e),{range:j,setPage:C,next:P,previous:E,active:k,first:$,last:I}=r6({page:r,initialPage:n,onChange:o,total:t,siblings:l,boundaries:c}),T=zr(p,P),z=zr(h,E),M=zr(m,$),L=zr(v,I);return S.createElement(PZ,{value:{total:t,range:j,active:k,disabled:i,color:u,radius:d,getItemProps:g,onChange:C,onNext:T,onPrevious:z,onFirst:M,onLast:L,stylesApi:{name:"Pagination",classNames:b,styles:y,unstyled:x,variant:_,size:w}}},a)}const sc={xs:O(22),sm:O(26),md:O(32),lg:O(38),xl:O(44)};var jZ=W((e,{color:t,radius:r,withPadding:n},{size:o})=>{const i=e.fn.variant({color:t,variant:"filled"});return{control:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center",border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,height:A({size:o,sizes:sc}),minWidth:A({size:o,sizes:sc}),padding:n?`0 calc(${A({size:o,sizes:e.spacing})} / 2)`:void 0,fontSize:A({size:o,sizes:e.fontSizes}),borderRadius:e.fn.radius(r),lineHeight:1,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,"&:not([data-disabled])":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]}),"&:active:not([data-disabled])":e.activeStyles,"&[data-disabled]":{opacity:.4,cursor:"not-allowed",pointerEvents:"none"},"&[data-active]":{borderColor:"transparent",color:i.color,backgroundColor:i.background,"&:not([data-disabled])":e.fn.hover({backgroundColor:i.hover})}}}});const CZ=jZ;var EZ=Object.defineProperty,$Z=Object.defineProperties,kZ=Object.getOwnPropertyDescriptors,Tp=Object.getOwnPropertySymbols,KD=Object.prototype.hasOwnProperty,YD=Object.prototype.propertyIsEnumerable,nO=(e,t,r)=>t in e?EZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,RZ=(e,t)=>{for(var r in t||(t={}))KD.call(t,r)&&nO(e,r,t[r]);if(Tp)for(var r of Tp(t))YD.call(t,r)&&nO(e,r,t[r]);return e},TZ=(e,t)=>$Z(e,kZ(t)),IZ=(e,t)=>{var r={};for(var n in e)KD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Tp)for(var n of Tp(e))t.indexOf(n)<0&&YD.call(e,n)&&(r[n]=e[n]);return r};const DZ={withPadding:!0},cm=f.forwardRef((e,t)=>{const r=H("PaginationControl",DZ,e),{active:n,className:o,disabled:i,withPadding:a}=r,l=IZ(r,["active","className","disabled","withPadding"]),c=lm(),{classes:u,cx:d}=CZ({color:c.color,radius:c.radius,withPadding:a},c.stylesApi);return S.createElement(So,TZ(RZ({},l),{disabled:i,"data-active":n||void 0,"data-disabled":i||void 0,ref:t,className:d(u.control,o)}))});cm.displayName="@mantine/core/PaginationControl";var NZ=Object.defineProperty,AZ=Object.defineProperties,MZ=Object.getOwnPropertyDescriptors,Ip=Object.getOwnPropertySymbols,XD=Object.prototype.hasOwnProperty,JD=Object.prototype.propertyIsEnumerable,oO=(e,t,r)=>t in e?NZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ia=(e,t)=>{for(var r in t||(t={}))XD.call(t,r)&&oO(e,r,t[r]);if(Ip)for(var r of Ip(t))JD.call(t,r)&&oO(e,r,t[r]);return e},Ic=(e,t)=>AZ(e,MZ(t)),LZ=(e,t)=>{var r={};for(var n in e)XD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ip)for(var n of Ip(e))t.indexOf(n)<0&&JD.call(e,n)&&(r[n]=e[n]);return r};function ZD(e){return`calc(${A({size:e,sizes:sc})} / 2)`}function Dc(e){var t=e,{size:r,style:n,children:o,path:i}=t,a=LZ(t,["size","style","children","path"]);return S.createElement("svg",ia({viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:ia({width:r,height:r},n)},a),S.createElement("path",{d:i,fill:"currentColor"}))}const zZ=e=>S.createElement(Dc,Ic(ia({},e),{path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"})),FZ=e=>S.createElement(Dc,Ic(ia({},e),{path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"})),VZ=e=>S.createElement(Dc,Ic(ia({},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"})),BZ=e=>S.createElement(Dc,Ic(ia({},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"})),UZ=e=>S.createElement(Dc,Ic(ia({},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"}));var WZ=W((e,t,{size:r})=>({dots:{height:A({size:r,sizes:sc}),minWidth:A({size:r,sizes:sc}),display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"}}));const HZ=WZ;var GZ=Object.defineProperty,Dp=Object.getOwnPropertySymbols,eN=Object.prototype.hasOwnProperty,tN=Object.prototype.propertyIsEnumerable,iO=(e,t,r)=>t in e?GZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qZ=(e,t)=>{for(var r in t||(t={}))eN.call(t,r)&&iO(e,r,t[r]);if(Dp)for(var r of Dp(t))tN.call(t,r)&&iO(e,r,t[r]);return e},QZ=(e,t)=>{var r={};for(var n in e)eN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Dp)for(var n of Dp(e))t.indexOf(n)<0&&tN.call(e,n)&&(r[n]=e[n]);return r};const KZ={icon:UZ},ux=f.forwardRef((e,t)=>{const r=H("PaginationDots",KZ,e),{className:n,icon:o}=r,i=QZ(r,["className","icon"]),a=lm(),{classes:l,cx:c}=HZ(null,a.stylesApi);return S.createElement(oe,qZ({ref:t,className:c(l.dots,n)},i),S.createElement(o,{size:ZD(a.stylesApi.size)}))});ux.displayName="@mantine/core/PaginationDots";var YZ=Object.defineProperty,aO=Object.getOwnPropertySymbols,XZ=Object.prototype.hasOwnProperty,JZ=Object.prototype.propertyIsEnumerable,sO=(e,t,r)=>t in e?YZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZZ=(e,t)=>{for(var r in t||(t={}))XZ.call(t,r)&&sO(e,r,t[r]);if(aO)for(var r of aO(t))JZ.call(t,r)&&sO(e,r,t[r]);return e};function dx({dotsIcon:e}){const t=lm(),r=t.range.map((n,o)=>{var i;return n==="dots"?S.createElement(ux,{icon:e,key:o}):S.createElement(cm,ZZ({key:o,active:n===t.active,"aria-current":n===t.active?"page":void 0,onClick:()=>t.onChange(n),disabled:t.disabled},(i=t.getItemProps)==null?void 0:i.call(t,n)),n)});return S.createElement(S.Fragment,null,r)}dx.displayName="@mantine/core/PaginationItems";var eee=W(e=>({icon:{transform:e.dir==="rtl"?"rotate(180deg)":"unset"}}));const tee=eee;var ree=Object.defineProperty,Np=Object.getOwnPropertySymbols,rN=Object.prototype.hasOwnProperty,nN=Object.prototype.propertyIsEnumerable,lO=(e,t,r)=>t in e?ree(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nee=(e,t)=>{for(var r in t||(t={}))rN.call(t,r)&&lO(e,r,t[r]);if(Np)for(var r of Np(t))nN.call(t,r)&&lO(e,r,t[r]);return e},oee=(e,t)=>{var r={};for(var n in e)rN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Np)for(var n of Np(e))t.indexOf(n)<0&&nN.call(e,n)&&(r[n]=e[n]);return r};function um({icon:e,name:t,action:r,type:n}){const o={icon:e},i=f.forwardRef((a,l)=>{const c=H(t,o,a),{icon:u}=c,d=oee(c,["icon"]),{classes:p}=tee(),h=lm(),m=n==="next"?h.active===h.total:h.active===1;return S.createElement(cm,nee({disabled:h.disabled||m,ref:l,onClick:h[r],withPadding:!1},d),S.createElement(u,{className:p.icon,size:ZD(h.stylesApi.size)}))});return i.displayName=`@mantine/core/${t}`,i}const oN=um({icon:zZ,name:"PaginationNext",action:"onNext",type:"next"}),iN=um({icon:FZ,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),aN=um({icon:VZ,name:"PaginationFirst",action:"onFirst",type:"previous"}),sN=um({icon:BZ,name:"PaginationLast",action:"onLast",type:"next"});var iee=Object.defineProperty,Ap=Object.getOwnPropertySymbols,lN=Object.prototype.hasOwnProperty,cN=Object.prototype.propertyIsEnumerable,cO=(e,t,r)=>t in e?iee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sl=(e,t)=>{for(var r in t||(t={}))lN.call(t,r)&&cO(e,r,t[r]);if(Ap)for(var r of Ap(t))cN.call(t,r)&&cO(e,r,t[r]);return e},aee=(e,t)=>{var r={};for(var n in e)lN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ap)for(var n of Ap(e))t.indexOf(n)<0&&cN.call(e,n)&&(r[n]=e[n]);return r};const see={withControls:!0,siblings:1,boundaries:1};function oo(e){const t=H("Pagination",see,e),{withEdges:r,withControls:n,classNames:o,styles:i,unstyled:a,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:v,boundaries:g,color:b,radius:y,onNextPage:x,onPreviousPage:_,onFirstPage:w,onLastPage:j,getItemProps:C,getControlProps:P,spacing:E,nextIcon:k,previousIcon:$,lastIcon:I,firstIcon:T,dotsIcon:z}=t,M=aee(t,["withEdges","withControls","classNames","styles","unstyled","variant","size","total","value","defaultValue","onChange","disabled","siblings","boundaries","color","radius","onNextPage","onPreviousPage","onFirstPage","onLastPage","getItemProps","getControlProps","spacing","nextIcon","previousIcon","lastIcon","firstIcon","dotsIcon"]),L=Zt();return u<=0?null:S.createElement(QD,{classNames:o,styles:i,unstyled:a,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:v,boundaries:g,color:b,radius:y,onNextPage:x,onPreviousPage:_,onFirstPage:w,onLastPage:j,getItemProps:C},S.createElement(K,sl({spacing:E??`calc(${A({size:c,sizes:L.spacing})} / 2)`},M),r&&S.createElement(aN,sl({icon:T},P==null?void 0:P("first"))),n&&S.createElement(iN,sl({icon:$},P==null?void 0:P("previous"))),S.createElement(dx,{dotsIcon:z}),n&&S.createElement(oN,sl({icon:k},P==null?void 0:P("next"))),r&&S.createElement(sN,sl({icon:I},P==null?void 0:P("last")))))}oo.displayName="@mantine/core/Pagination";oo.Root=QD;oo.Items=dx;oo.Control=cm;oo.Dots=ux;oo.Next=oN;oo.Previous=iN;oo.Last=sN;oo.First=aN;const lee=({reveal:e,size:t})=>S.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:t,height:t}},S.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 cee=Object.defineProperty,uee=Object.defineProperties,dee=Object.getOwnPropertyDescriptors,uO=Object.getOwnPropertySymbols,fee=Object.prototype.hasOwnProperty,pee=Object.prototype.propertyIsEnumerable,dO=(e,t,r)=>t in e?cee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Eg=(e,t)=>{for(var r in t||(t={}))fee.call(t,r)&&dO(e,r,t[r]);if(uO)for(var r of uO(t))pee.call(t,r)&&dO(e,r,t[r]);return e},fO=(e,t)=>uee(e,dee(t)),hee=W((e,{rightSectionWidth:t},{size:r})=>({visibilityToggle:{},input:{position:"relative",overflow:"hidden"},innerInput:fO(Eg(Eg({},e.fn.fontStyles()),e.fn.cover(0)),{backgroundColor:"transparent",border:`${O(1)} solid transparent`,borderLeftWidth:0,borderRightWidth:0,boxSizing:"border-box",display:"block",width:`calc(100% - ${O(t)})`,paddingLeft:`calc(${A({size:r,sizes:$t})} / 3)`,fontSize:A({size:r,sizes:e.fontSizes}),height:`calc(${A({size:r,sizes:$t})} - ${O(2)})`,lineHeight:`calc(${A({size:r,sizes:$t})} - ${O(4)})`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"&::-ms-reveal, &::-ms-clear":{display:"none"},"&:focus":{outline:0},"&:disabled":{cursor:"not-allowed",pointerEvents:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"&::placeholder":fO(Eg({},e.fn.placeholderStyles()),{opacity:1}),"&[data-invalid]":{color:e.fn.variant({variant:"filled",color:"red"}).background,"&::placeholder":{opacity:1,color:e.fn.variant({variant:"filled",color:"red"}).background}},"&[data-with-icon]":{paddingLeft:A({size:r,sizes:$t})}})}));const mee=hee;var gee=Object.defineProperty,vee=Object.defineProperties,yee=Object.getOwnPropertyDescriptors,Mp=Object.getOwnPropertySymbols,uN=Object.prototype.hasOwnProperty,dN=Object.prototype.propertyIsEnumerable,pO=(e,t,r)=>t in e?gee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fu=(e,t)=>{for(var r in t||(t={}))uN.call(t,r)&&pO(e,r,t[r]);if(Mp)for(var r of Mp(t))dN.call(t,r)&&pO(e,r,t[r]);return e},xee=(e,t)=>vee(e,yee(t)),wee=(e,t)=>{var r={};for(var n in e)uN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Mp)for(var n of Mp(e))t.indexOf(n)<0&&dN.call(e,n)&&(r[n]=e[n]);return r};const _ee={xs:O(22),sm:O(26),md:O(28),lg:O(32),xl:O(40)},bee={xs:O(12),sm:O(15),md:O(17),lg:O(19),xl:O(21)},See={xs:O(28),sm:O(32),md:O(34),lg:O(44),xl:O(54)},Pee={size:"sm",toggleTabIndex:-1,visibilityToggleIcon:lee,__staticSelector:"PasswordInput"},_o=f.forwardRef((e,t)=>{const r=H("PasswordInput",Pee,e),{radius:n,disabled:o,size:i,toggleTabIndex:a,className:l,id:c,label:u,error:d,required:p,style:h,icon:m,description:v,wrapperProps:g,classNames:b,styles:y,variant:x,visibilityToggleIcon:_,__staticSelector:w,sx:j,labelProps:C,descriptionProps:P,errorProps:E,unstyled:k,visibilityToggleLabel:$,withAsterisk:I,inputContainer:T,iconWidth:z,inputWrapperOrder:M,visible:L,defaultVisible:q,onVisibilityChange:Y}=r,R=wee(r,["radius","disabled","size","toggleTabIndex","className","id","label","error","required","style","icon","description","wrapperProps","classNames","styles","variant","visibilityToggleIcon","__staticSelector","sx","labelProps","descriptionProps","errorProps","unstyled","visibilityToggleLabel","withAsterisk","inputContainer","iconWidth","inputWrapperOrder","visible","defaultVisible","onVisibilityChange"]),N=A({size:i,sizes:See}),{classes:V}=mee({rightSectionWidth:N},{name:"PasswordInput",classNames:b,styles:y,unstyled:k,size:i,variant:x}),Q=Ir(c),{systemStyles:ee,rest:_e}=no(R),[we,Ue]=kr({value:L,defaultValue:q,finalValue:!1,onChange:Y}),Ae=()=>Ue(!we),pt=S.createElement(pr,{className:V.visibilityToggle,tabIndex:a,radius:n,size:A({size:i,sizes:_ee}),"aria-hidden":!$,"aria-label":$,unstyled:k,onMouseDown:Nt=>{Nt.preventDefault(),Ae()},onKeyDown:Nt=>{Nt.key===" "&&(Nt.preventDefault(),Ae())}},S.createElement(_,{reveal:we,size:A({size:i,sizes:bee})}));return S.createElement(Wt.Wrapper,Fu(Fu({required:p,id:Q,label:u,error:d,description:v,size:i,className:l,style:h,classNames:b,styles:y,__staticSelector:w,sx:j,errorProps:E,descriptionProps:P,labelProps:C,unstyled:k,withAsterisk:I,inputWrapperOrder:M,inputContainer:T,variant:x},ee),g),S.createElement(Wt,{component:"div",error:d,icon:m,size:i,classNames:xee(Fu({},b),{input:V.input}),styles:y,radius:n,disabled:o,__staticSelector:w,rightSectionWidth:N,rightSection:!o&&pt,variant:x,unstyled:k,iconWidth:z},S.createElement("input",Fu({type:we?"text":"password",required:p,"data-invalid":!!d||void 0,"data-with-icon":!!m||void 0,className:V.innerInput,disabled:o,id:Q,ref:t,autoComplete:"off"},_e))))});_o.displayName="@mantine/core/PasswordInput";const fN=f.createContext(!1),Oee=fN.Provider,jee=()=>f.useContext(fN);function pN({children:e,openDelay:t=0,closeDelay:r=0}){return S.createElement(Oee,{value:!0},S.createElement(lU,{delay:{open:t,close:r}},e))}pN.displayName="@mantine/core/TooltipGroup";var Cee=Object.defineProperty,Eee=Object.defineProperties,$ee=Object.getOwnPropertyDescriptors,hO=Object.getOwnPropertySymbols,kee=Object.prototype.hasOwnProperty,Ree=Object.prototype.propertyIsEnumerable,mO=(e,t,r)=>t in e?Cee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gO=(e,t)=>{for(var r in t||(t={}))kee.call(t,r)&&mO(e,r,t[r]);if(hO)for(var r of hO(t))Ree.call(t,r)&&mO(e,r,t[r]);return e},Tee=(e,t)=>Eee(e,$ee(t));function Iee(e,t){if(!t)return{backgroundColor:e.colorScheme==="dark"?e.colors.gray[2]:e.colors.gray[9],color:e.colorScheme==="dark"?e.black:e.white};const r=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:r.background,color:r.color}}var Dee=W((e,{color:t,radius:r,width:n,multiline:o})=>({tooltip:Tee(gO(gO({},e.fn.fontStyles()),Iee(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(r),padding:`calc(${e.spacing.xs} / 2) ${e.spacing.xs}`,position:"absolute",whiteSpace:o?"unset":"nowrap",pointerEvents:"none",width:n}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));const hN=Dee,mN={children:"Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"};function Nee({offset:e,position:t}){const[r,n]=f.useState(!1),o=f.useRef(),{x:i,y:a,reference:l,floating:c,refs:u,update:d,placement:p}=Z0({placement:t,middleware:[q0({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=p.includes("right")?e:t.includes("left")?e*-1:0,m=p.includes("bottom")?e:t.includes("top")?e*-1:0,v=f.useCallback(({clientX:g,clientY:b})=>{l({getBoundingClientRect(){return{width:0,height:0,x:g,y:b,left:g+h,top:b+m,right:g,bottom:b}}})},[l]);return f.useEffect(()=>{if(u.floating.current){const g=o.current;g.addEventListener("mousemove",v);const b=wo(u.floating.current);return b.forEach(y=>{y.addEventListener("scroll",d)}),()=>{g.removeEventListener("mousemove",v),b.forEach(y=>{y.removeEventListener("scroll",d)})}}},[l,u.floating.current,d,v,r]),{handleMouseMove:v,x:i,y:a,opened:r,setOpened:n,boundaryRef:o,floating:c}}var Aee=Object.defineProperty,Mee=Object.defineProperties,Lee=Object.getOwnPropertyDescriptors,Lp=Object.getOwnPropertySymbols,gN=Object.prototype.hasOwnProperty,vN=Object.prototype.propertyIsEnumerable,vO=(e,t,r)=>t in e?Aee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vu=(e,t)=>{for(var r in t||(t={}))gN.call(t,r)&&vO(e,r,t[r]);if(Lp)for(var r of Lp(t))vN.call(t,r)&&vO(e,r,t[r]);return e},Bu=(e,t)=>Mee(e,Lee(t)),zee=(e,t)=>{var r={};for(var n in e)gN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Lp)for(var n of Lp(e))t.indexOf(n)<0&&vN.call(e,n)&&(r[n]=e[n]);return r};const Fee={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:$n("popover")};function yN(e){var t;const r=H("TooltipFloating",Fee,e),{children:n,refProp:o,withinPortal:i,portalProps:a,style:l,className:c,classNames:u,styles:d,unstyled:p,radius:h,color:m,label:v,offset:g,position:b,multiline:y,width:x,zIndex:_,disabled:w,variant:j}=r,C=zee(r,["children","refProp","withinPortal","portalProps","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled","variant"]),{handleMouseMove:P,x:E,y:k,opened:$,boundaryRef:I,floating:T,setOpened:z}=Nee({offset:g,position:b}),{classes:M,cx:L}=hN({radius:h,color:m,multiline:y,width:x},{name:"TooltipFloating",classNames:u,styles:d,unstyled:p,variant:j});if(!ks(n))throw new Error(mN.children);const q=Ts(I,n.ref),Y=N=>{var V,Q;(Q=(V=n.props).onMouseEnter)==null||Q.call(V,N),P(N),z(!0)},R=N=>{var V,Q;(Q=(V=n.props).onMouseLeave)==null||Q.call(V,N),z(!1)};return S.createElement(S.Fragment,null,S.createElement(Ns,Bu(Vu({},a),{withinPortal:i}),S.createElement(oe,Bu(Vu({},C),{ref:T,className:L(M.tooltip,c),style:Bu(Vu({},l),{zIndex:_,display:!w&&$?"block":"none",top:k??"",left:(t=Math.round(E))!=null?t:""})}),v)),f.cloneElement(n,Bu(Vu({},n.props),{[o]:q,onMouseEnter:Y,onMouseLeave:R})))}yN.displayName="@mantine/core/TooltipFloating";function Vee(e){const[t,r]=f.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=jee(),a=Ir(),{delay:l,currentId:c,setCurrentId:u}=AR(),d=f.useCallback(E=>{r(E),E&&u(a)},[u,a]),{x:p,y:h,reference:m,floating:v,context:g,refs:b,update:y,placement:x,middlewareData:{arrow:{x:_,y:w}={}}}=Z0({placement:e.position,open:o,onOpenChange:d,middleware:[SR(e.offset),q0({padding:8}),wR(),RR({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[bR()]:[]]}),{getReferenceProps:j,getFloatingProps:C}=wU([sU(g,{enabled:e.events.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),yU(g,{enabled:e.events.focus,keyboardOnly:!0}),xU(g,{role:"tooltip"}),vU(g,{enabled:typeof e.opened===void 0}),cU(g,{id:a})]);return LR({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:b,update:y}}),on(()=>{var E;(E=e.onPositionChange)==null||E.call(e,x)},[x]),{x:p,y:h,arrowX:_,arrowY:w,reference:m,floating:v,getFloatingProps:C,getReferenceProps:j,isGroupPhase:o&&c&&c!==a,opened:o,placement:x}}var Bee=Object.defineProperty,Uee=Object.defineProperties,Wee=Object.getOwnPropertyDescriptors,zp=Object.getOwnPropertySymbols,xN=Object.prototype.hasOwnProperty,wN=Object.prototype.propertyIsEnumerable,yO=(e,t,r)=>t in e?Bee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ni=(e,t)=>{for(var r in t||(t={}))xN.call(t,r)&&yO(e,r,t[r]);if(zp)for(var r of zp(t))wN.call(t,r)&&yO(e,r,t[r]);return e},$g=(e,t)=>Uee(e,Wee(t)),Hee=(e,t)=>{var r={};for(var n in e)xN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zp)for(var n of zp(e))t.indexOf(n)<0&&wN.call(e,n)&&(r[n]=e[n]);return r};const Gee={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:$n("popover"),positionDependencies:[]},dm=f.forwardRef((e,t)=>{var r;const n=f.useRef(null),o=H("Tooltip",Gee,e),{children:i,position:a,refProp:l,label:c,openDelay:u,closeDelay:d,onPositionChange:p,opened:h,withinPortal:m,portalProps:v,radius:g,color:b,classNames:y,styles:x,unstyled:_,style:w,className:j,withArrow:C,arrowSize:P,arrowOffset:E,arrowRadius:k,arrowPosition:$,offset:I,transitionProps:T,multiline:z,width:M,events:L,zIndex:q,disabled:Y,positionDependencies:R,onClick:N,onMouseEnter:V,onMouseLeave:Q,inline:ee,variant:_e,keepMounted:we}=o,Ue=Hee(o,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","portalProps","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","offset","transitionProps","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline","variant","keepMounted"]),{classes:Ae,cx:pt,theme:Nt}=hN({radius:g,color:b,width:M,multiline:z},{name:"Tooltip",classNames:y,styles:x,unstyled:_,variant:_e}),Pe=Vee({position:KR(Nt.dir,a),closeDelay:d,openDelay:u,onPositionChange:p,opened:h,events:L,arrowRef:n,arrowOffset:E,offset:I+(C?P/2:0),positionDependencies:[...R,i],inline:ee});if(!ks(i))throw new Error(mN.children);const Gt=Ts(Pe.reference,i.ref,t);return S.createElement(S.Fragment,null,S.createElement(Ns,$g(Ni({},v),{withinPortal:m}),S.createElement(va,$g(Ni({keepMounted:we,mounted:!Y&&Pe.opened},T),{transition:T.transition||"fade",duration:Pe.isGroupPhase?10:(r=T.duration)!=null?r:100}),Ar=>{var cr,qt;return S.createElement(oe,Ni(Ni({},Ue),Pe.getFloatingProps({ref:Pe.floating,className:Ae.tooltip,style:$g(Ni(Ni({},w),Ar),{zIndex:q,top:(cr=Pe.y)!=null?cr:0,left:(qt=Pe.x)!=null?qt:0})})),c,S.createElement(tx,{ref:n,arrowX:Pe.arrowX,arrowY:Pe.arrowY,visible:C,position:Pe.placement,arrowSize:P,arrowOffset:E,arrowRadius:k,arrowPosition:$,className:Ae.arrow}))})),f.cloneElement(i,Pe.getReferenceProps(Ni({onClick:N,onMouseEnter:V,onMouseLeave:Q,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[l]:Gt,className:pt(j,i.props.className)},i.props))))});dm.Group=pN;dm.Floating=yN;dm.displayName="@mantine/core/Tooltip";const _N=dm;var qee=Object.defineProperty,Fp=Object.getOwnPropertySymbols,bN=Object.prototype.hasOwnProperty,SN=Object.prototype.propertyIsEnumerable,xO=(e,t,r)=>t in e?qee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wO=(e,t)=>{for(var r in t||(t={}))bN.call(t,r)&&xO(e,r,t[r]);if(Fp)for(var r of Fp(t))SN.call(t,r)&&xO(e,r,t[r]);return e},Qee=(e,t)=>{var r={};for(var n in e)bN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Fp)for(var n of Fp(e))t.indexOf(n)<0&&SN.call(e,n)&&(r[n]=e[n]);return r};function Kee(e){const t=e,{width:r,height:n,style:o}=t,i=Qee(t,["width","height","style"]);return S.createElement("svg",wO({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:wO({width:r,height:n},o)},i),S.createElement("path",{fill:"currentColor",d:"M0 2.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0z"}))}const PN=f.createContext(null),Yee=PN.Provider,Xee=()=>f.useContext(PN);var Jee=Object.defineProperty,Vp=Object.getOwnPropertySymbols,ON=Object.prototype.hasOwnProperty,jN=Object.prototype.propertyIsEnumerable,_O=(e,t,r)=>t in e?Jee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bO=(e,t)=>{for(var r in t||(t={}))ON.call(t,r)&&_O(e,r,t[r]);if(Vp)for(var r of Vp(t))jN.call(t,r)&&_O(e,r,t[r]);return e},Zee=(e,t)=>{var r={};for(var n in e)ON.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Vp)for(var n of Vp(e))t.indexOf(n)<0&&jN.call(e,n)&&(r[n]=e[n]);return r};const ete={size:"sm"},CN=f.forwardRef((e,t)=>{const r=H("RadioGroup",ete,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c,unstyled:u,name:d}=r,p=Zee(r,["children","value","defaultValue","onChange","size","wrapperProps","unstyled","name"]),h=Ir(d),[m,v]=kr({value:o,defaultValue:i,finalValue:"",onChange:a}),g=b=>v(b.currentTarget.value);return S.createElement(Yee,{value:{value:m,onChange:g,size:l,name:h}},S.createElement(Wt.Wrapper,bO(bO({labelElement:"div",size:l,__staticSelector:"RadioGroup",ref:t,unstyled:u},c),p),n))});CN.displayName="@mantine/core/RadioGroup";var tte=Object.defineProperty,rte=Object.defineProperties,nte=Object.getOwnPropertyDescriptors,SO=Object.getOwnPropertySymbols,ote=Object.prototype.hasOwnProperty,ite=Object.prototype.propertyIsEnumerable,PO=(e,t,r)=>t in e?tte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ate=(e,t)=>{for(var r in t||(t={}))ote.call(t,r)&&PO(e,r,t[r]);if(SO)for(var r of SO(t))ite.call(t,r)&&PO(e,r,t[r]);return e},ste=(e,t)=>rte(e,nte(t));const kg={xs:O(16),sm:O(20),md:O(24),lg:O(30),xl:O(36)},Uu={xs:O(6),sm:O(8),md:O(10),lg:O(14),xl:O(16)};var lte=W((e,{color:t,transitionDuration:r,labelPosition:n,error:o},{size:i})=>{const a=e.fn.variant({variant:"filled",color:t}),l=e.fn.variant({variant:"filled",color:"red"}).background;return{inner:{order:n==="left"?2:1,position:"relative",alignSelf:"flex-start"},icon:{ref:Bt("icon"),color:e.white,opacity:0,transform:`scale(0.75) translateY(${O(2)})`,transition:`opacity ${r}ms ${e.transitionTimingFunction}`,pointerEvents:"none",width:A({sizes:Uu,size:i}),height:A({sizes:Uu,size:i}),position:"absolute",top:`calc(50% - ${A({sizes:Uu,size:i})} / 2)`,left:`calc(50% - ${A({sizes:Uu,size:i})} / 2)`},radio:ste(ate({},e.fn.focusStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${O(1)} solid ${o?l:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,position:"relative",appearance:"none",width:A({sizes:kg,size:i}),height:A({sizes:kg,size:i}),borderRadius:A({sizes:kg,size:i}),margin:0,display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:`${r}ms`,cursor:e.cursorType,"&:checked":{background:a.background,borderColor:a.background,[`& + .${Bt("icon")}`]:{opacity:1,transform:"scale(1)"}},"&:disabled":{borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[4],backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],[`& + .${Bt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[4]}}})}});const cte=lte;var ute=Object.defineProperty,Bp=Object.getOwnPropertySymbols,EN=Object.prototype.hasOwnProperty,$N=Object.prototype.propertyIsEnumerable,OO=(e,t,r)=>t in e?ute(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wu=(e,t)=>{for(var r in t||(t={}))EN.call(t,r)&&OO(e,r,t[r]);if(Bp)for(var r of Bp(t))$N.call(t,r)&&OO(e,r,t[r]);return e},dte=(e,t)=>{var r={};for(var n in e)EN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bp)for(var n of Bp(e))t.indexOf(n)<0&&$N.call(e,n)&&(r[n]=e[n]);return r};const fte={icon:Kee,transitionDuration:100,size:"sm",labelPosition:"right"},Up=f.forwardRef((e,t)=>{var r,n;const o=H("Radio",fte,e),{className:i,style:a,id:l,label:c,size:u,title:d,disabled:p,color:h,classNames:m,styles:v,sx:g,icon:b,transitionDuration:y,wrapperProps:x,unstyled:_,labelPosition:w,description:j,error:C,variant:P}=o,E=dte(o,["className","style","id","label","size","title","disabled","color","classNames","styles","sx","icon","transitionDuration","wrapperProps","unstyled","labelPosition","description","error","variant"]),k=Xee(),$=(r=k==null?void 0:k.size)!=null?r:u,I=e.size?u:$,{classes:T}=cte({color:h,transitionDuration:y,labelPosition:w,error:!!C},{name:"Radio",classNames:m,styles:v,unstyled:_,variant:P,size:I}),{systemStyles:z,rest:M}=no(E),L=Ir(l),q=k?{checked:k.value===M.value,name:(n=M.name)!=null?n:k.name,onChange:k.onChange}:{};return S.createElement(am,Wu(Wu({className:i,sx:g,style:a,id:L,size:I,labelPosition:w,label:c,description:j,error:C,disabled:p,__staticSelector:"Radio",classNames:m,styles:v,unstyled:_,"data-checked":q.checked||void 0,variant:P},z),x),S.createElement("div",{className:T.inner},S.createElement("input",Wu(Wu({ref:t,className:T.radio,type:"radio",id:L,disabled:p},M),q)),S.createElement(b,{className:T.icon,"aria-hidden":!0})))});Up.displayName="@mantine/core/Radio";Up.Group=CN;function pte({size:e,thickness:t,sum:r,value:n,root:o,offset:i}){const a=(e*.9-t*2)/2,l=Math.PI*a*2/100,c=o?`${(100-r)*l}, ${r*l}`:`${n*l}, ${(100-n)*l}`;return{strokeWidth:t,cx:e/2,cy:e/2,r:a,transform:o?`scale(1, -1) translate(0, -${e})`:null,strokeDasharray:c,strokeDashoffset:o?0:i}}var hte=Object.defineProperty,mte=Object.defineProperties,gte=Object.getOwnPropertyDescriptors,Wp=Object.getOwnPropertySymbols,kN=Object.prototype.hasOwnProperty,RN=Object.prototype.propertyIsEnumerable,jO=(e,t,r)=>t in e?hte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,CO=(e,t)=>{for(var r in t||(t={}))kN.call(t,r)&&jO(e,r,t[r]);if(Wp)for(var r of Wp(t))RN.call(t,r)&&jO(e,r,t[r]);return e},vte=(e,t)=>mte(e,gte(t)),yte=(e,t)=>{var r={};for(var n in e)kN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wp)for(var n of Wp(e))t.indexOf(n)<0&&RN.call(e,n)&&(r[n]=e[n]);return r};function TN(e){var t=e,{size:r,value:n,offset:o,sum:i,thickness:a,root:l,color:c,lineRoundCaps:u,tooltip:d}=t,p=yte(t,["size","value","offset","sum","thickness","root","color","lineRoundCaps","tooltip"]);const h=Zt(),m=h.fn.themeColor(c||(h.colorScheme==="dark"?"dark":"gray"),c?h.fn.primaryShade():h.colorScheme==="dark"?4:1,!1);return S.createElement(_N.Floating,{disabled:!d,label:d},S.createElement("circle",CO(vte(CO({},p),{fill:"none",strokeLinecap:u?"round":"butt",stroke:m}),pte({sum:i,size:r,thickness:a,value:n,offset:o,root:l}))))}TN.displayName="@mantine/core/Curve";var xte=Object.defineProperty,wte=Object.defineProperties,_te=Object.getOwnPropertyDescriptors,EO=Object.getOwnPropertySymbols,bte=Object.prototype.hasOwnProperty,Ste=Object.prototype.propertyIsEnumerable,$O=(e,t,r)=>t in e?xte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ll=(e,t)=>{for(var r in t||(t={}))bte.call(t,r)&&$O(e,r,t[r]);if(EO)for(var r of EO(t))Ste.call(t,r)&&$O(e,r,t[r]);return e},cl=(e,t)=>wte(e,_te(t));function Pte({size:e,thickness:t,sections:r,renderRoundedLineCaps:n,rootColor:o}){const i=r.reduce((d,p)=>d+p.value,0),a=Math.PI*((e*.9-t*2)/2)*2;let l=a;const c=[],u=[];for(let d=0;d<r.length;d+=1)c.push({sum:i,offset:l,data:r[d],root:!1}),l-=r[d].value/100*a;if(c.push({sum:i,offset:l,data:{color:o},root:!0}),u.push(cl(ll({},c[c.length-1]),{lineRoundCaps:!1})),c.length>2){u.push(cl(ll({},c[0]),{lineRoundCaps:n})),u.push(cl(ll({},c[c.length-2]),{lineRoundCaps:n}));for(let d=1;d<=c.length-3;d+=1)u.push(cl(ll({},c[d]),{lineRoundCaps:!1}))}else u.push(cl(ll({},c[0]),{lineRoundCaps:n}));return u}var Ote=W({root:{position:"relative"},label:{position:"absolute",top:"50%",transform:"translateY(-50%)"}});const jte=Ote;var Cte=Object.defineProperty,Ete=Object.defineProperties,$te=Object.getOwnPropertyDescriptors,Hp=Object.getOwnPropertySymbols,IN=Object.prototype.hasOwnProperty,DN=Object.prototype.propertyIsEnumerable,kO=(e,t,r)=>t in e?Cte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rg=(e,t)=>{for(var r in t||(t={}))IN.call(t,r)&&kO(e,r,t[r]);if(Hp)for(var r of Hp(t))DN.call(t,r)&&kO(e,r,t[r]);return e},kte=(e,t)=>Ete(e,$te(t)),Rte=(e,t)=>{var r={};for(var n in e)IN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Hp)for(var n of Hp(e))t.indexOf(n)<0&&DN.call(e,n)&&(r[n]=e[n]);return r};const Tte={size:120,thickness:12},fx=f.forwardRef((e,t)=>{const r=H("RingProgress",Tte,e),{className:n,style:o,label:i,sections:a,size:l,thickness:c,classNames:u,styles:d,roundCaps:p,rootColor:h,unstyled:m,variant:v}=r,g=Rte(r,["className","style","label","sections","size","thickness","classNames","styles","roundCaps","rootColor","unstyled","variant"]),{classes:b,cx:y}=jte(null,{name:"RingProgress",classNames:u,styles:d,unstyled:m,variant:v}),x=Pte({size:l,thickness:c,sections:a,renderRoundedLineCaps:p,rootColor:h}).map(({data:_,sum:w,root:j,lineRoundCaps:C,offset:P},E)=>S.createElement(TN,kte(Rg({},_),{key:E,size:l,thickness:c,sum:w,offset:P,color:_==null?void 0:_.color,root:j,lineRoundCaps:C})));return S.createElement(oe,Rg({style:Rg({width:l,height:l},o),className:y(b.root,n),ref:t},g),S.createElement("svg",{style:{width:l,height:l,transform:"rotate(-90deg)"}},x),i&&S.createElement("div",{className:b.label,style:{right:c*2,left:c*2}},i))});fx.displayName="@mantine/core/RingProgress";function Ite(e,t){if(t.length===0)return t;const r="maxWidth"in t[0]?"maxWidth":"minWidth",n=[...t].sort((o,i)=>mr(A({size:i[r],sizes:e.breakpoints}))-mr(A({size:o[r],sizes:e.breakpoints})));return r==="minWidth"?n.reverse():n}var Dte=Object.defineProperty,RO=Object.getOwnPropertySymbols,Nte=Object.prototype.hasOwnProperty,Ate=Object.prototype.propertyIsEnumerable,TO=(e,t,r)=>t in e?Dte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mte=(e,t)=>{for(var r in t||(t={}))Nte.call(t,r)&&TO(e,r,t[r]);if(RO)for(var r of RO(t))Ate.call(t,r)&&TO(e,r,t[r]);return e},Lte=W((e,{spacing:t,breakpoints:r,cols:n,verticalSpacing:o})=>{const i=o!=null,a=Ite(e,r).reduce((l,c)=>{var u,d;const p="maxWidth"in c?"max-width":"min-width",h=A({size:p==="max-width"?c.maxWidth:c.minWidth,sizes:e.breakpoints,units:"em"}),m=mr(h)-(p==="max-width"?1:0);return l[`@media (${p}: ${ar(m)})`]={gridTemplateColumns:`repeat(${c.cols}, minmax(0, 1fr))`,gap:`${A({size:(u=c.verticalSpacing)!=null?u:i?o:t,sizes:e.spacing})} ${A({size:(d=c.spacing)!=null?d:t,sizes:e.spacing})}`},l},{});return{root:Mte({boxSizing:"border-box",display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:`${A({size:i?o:t,sizes:e.spacing})} ${A({size:t,sizes:e.spacing})}`},a)}});const zte=Lte;var Fte=Object.defineProperty,Gp=Object.getOwnPropertySymbols,NN=Object.prototype.hasOwnProperty,AN=Object.prototype.propertyIsEnumerable,IO=(e,t,r)=>t in e?Fte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vte=(e,t)=>{for(var r in t||(t={}))NN.call(t,r)&&IO(e,r,t[r]);if(Gp)for(var r of Gp(t))AN.call(t,r)&&IO(e,r,t[r]);return e},Bte=(e,t)=>{var r={};for(var n in e)NN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gp)for(var n of Gp(e))t.indexOf(n)<0&&AN.call(e,n)&&(r[n]=e[n]);return r};const Ute={breakpoints:[],cols:1,spacing:"md"},MN=f.forwardRef((e,t)=>{const r=H("SimpleGrid",Ute,e),{className:n,breakpoints:o,cols:i,spacing:a,verticalSpacing:l,children:c,unstyled:u,variant:d}=r,p=Bte(r,["className","breakpoints","cols","spacing","verticalSpacing","children","unstyled","variant"]),{classes:h,cx:m}=zte({breakpoints:o,cols:i,spacing:a,verticalSpacing:l},{name:"SimpleGrid",unstyled:u,variant:d});return S.createElement(oe,Vte({className:m(h.root,n),ref:t},p),c)});MN.displayName="@mantine/core/SimpleGrid";var Wte=Object.defineProperty,qp=Object.getOwnPropertySymbols,LN=Object.prototype.hasOwnProperty,zN=Object.prototype.propertyIsEnumerable,DO=(e,t,r)=>t in e?Wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hte=(e,t)=>{for(var r in t||(t={}))LN.call(t,r)&&DO(e,r,t[r]);if(qp)for(var r of qp(t))zN.call(t,r)&&DO(e,r,t[r]);return e},Gte=(e,t)=>{var r={};for(var n in e)LN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&qp)for(var n of qp(e))t.indexOf(n)<0&&zN.call(e,n)&&(r[n]=e[n]);return r};const qte={w:0,h:0},fm=f.forwardRef((e,t)=>{const r=H("Space",qte,e),{w:n,h:o}=r,i=Gte(r,["w","h"]);return S.createElement(oe,Hte({ref:t,w:n,miw:n,h:o,mih:o},i))});fm.displayName="@mantine/core/Space";var Qte=W((e,{spacing:t,align:r,justify:n})=>({root:{display:"flex",flexDirection:"column",alignItems:r,justifyContent:n,gap:A({size:t,sizes:e.spacing})}}));const Kte=Qte;var Yte=Object.defineProperty,Qp=Object.getOwnPropertySymbols,FN=Object.prototype.hasOwnProperty,VN=Object.prototype.propertyIsEnumerable,NO=(e,t,r)=>t in e?Yte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xte=(e,t)=>{for(var r in t||(t={}))FN.call(t,r)&&NO(e,r,t[r]);if(Qp)for(var r of Qp(t))VN.call(t,r)&&NO(e,r,t[r]);return e},Jte=(e,t)=>{var r={};for(var n in e)FN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qp)for(var n of Qp(e))t.indexOf(n)<0&&VN.call(e,n)&&(r[n]=e[n]);return r};const Zte={spacing:"md",align:"stretch",justify:"flex-start"},je=f.forwardRef((e,t)=>{const r=H("Stack",Zte,e),{spacing:n,className:o,align:i,justify:a,unstyled:l,variant:c}=r,u=Jte(r,["spacing","className","align","justify","unstyled","variant"]),{classes:d,cx:p}=Kte({spacing:n,align:i,justify:a},{name:"Stack",unstyled:l,variant:c});return S.createElement(oe,Xte({className:p(d.root,o),ref:t},u))});je.displayName="@mantine/core/Stack";var ere=Object.defineProperty,tre=Object.defineProperties,rre=Object.getOwnPropertyDescriptors,AO=Object.getOwnPropertySymbols,nre=Object.prototype.hasOwnProperty,ore=Object.prototype.propertyIsEnumerable,MO=(e,t,r)=>t in e?ere(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tg=(e,t)=>{for(var r in t||(t={}))nre.call(t,r)&&MO(e,r,t[r]);if(AO)for(var r of AO(t))ore.call(t,r)&&MO(e,r,t[r]);return e},ire=(e,t)=>tre(e,rre(t));const BN={xs:O(34),sm:O(36),md:O(42),lg:O(48),xl:O(52)};var are=W((e,{color:t,iconSize:r,radius:n,allowStepClick:o,iconPosition:i,orientation:a},{size:l})=>{const c=r?O(r):A({size:l,sizes:BN}),u=l==="xl"||l==="lg"?e.spacing.md:e.spacing.sm,d=e.fn.radius(n),p=e.fn.variant({variant:"filled",color:t||e.primaryColor,primaryFallback:!1}),h=`calc(${e.spacing.xs} / 2)`,m={step:{justifyContent:"flex-start",minHeight:`calc(${c} + ${e.spacing.xl} + ${h})`,marginTop:h,overflow:"hidden","&:first-of-type":{marginTop:0},[`&:last-of-type .${Bt("verticalSeparator")}`]:{display:"none"}}};return{stepLoader:{},step:Tg({display:"flex",flexDirection:i==="left"?"row":"row-reverse",cursor:o?"pointer":"default"},a==="vertical"?m.step:{alignItems:"center"}),stepWrapper:{position:"relative"},verticalSeparator:{top:`calc(${c} + ${h})`,left:`calc(${c} / 2)`,height:"100vh",position:"absolute",borderLeft:`${O(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,ref:Bt("verticalSeparator")},verticalSeparatorActive:{borderColor:e.fn.variant({variant:"filled",color:t}).background},stepIcon:{boxSizing:"border-box",height:c,width:c,minWidth:c,borderRadius:d,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],border:`${O(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,transition:"background-color 150ms ease, border-color 150ms ease",position:"relative",fontWeight:700,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],fontSize:A({size:l,sizes:e.fontSizes}),"&[data-progress]":{borderColor:p.background},"&[data-completed]":{backgroundColor:p.background,borderColor:p.background,color:e.white}},stepCompletedIcon:ire(Tg({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.white}),stepBody:Tg({display:"flex",flexDirection:"column",marginLeft:i==="left"?u:void 0,marginRight:i==="right"?u:void 0},a==="vertical"?{marginTop:`calc(${r} / 4)`}:null),stepLabel:{textAlign:i,fontWeight:500,fontSize:A({size:l,sizes:e.fontSizes}),lineHeight:1},stepDescription:{textAlign:i,marginTop:`calc(${A({size:l,sizes:e.spacing})} / 3)`,marginBottom:`calc(${A({size:l,sizes:e.spacing})} / 3)`,fontSize:`calc(${A({size:l,sizes:e.fontSizes})} - ${O(2)})`,lineHeight:1}}});const sre=are;var lre=Object.defineProperty,Kp=Object.getOwnPropertySymbols,UN=Object.prototype.hasOwnProperty,WN=Object.prototype.propertyIsEnumerable,LO=(e,t,r)=>t in e?lre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ig=(e,t)=>{for(var r in t||(t={}))UN.call(t,r)&&LO(e,r,t[r]);if(Kp)for(var r of Kp(t))WN.call(t,r)&&LO(e,r,t[r]);return e},cre=(e,t)=>{var r={};for(var n in e)UN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Kp)for(var n of Kp(e))t.indexOf(n)<0&&WN.call(e,n)&&(r[n]=e[n]);return r};const ure={xs:16,sm:18,md:20,lg:22,xl:24},dre={withIcon:!0,size:"md",radius:"xl",allowStepClick:!0,iconPosition:"left",__staticSelector:"Step"},Hu=(e,t)=>typeof e=="function"?S.createElement(e,{step:t}):e,HN=f.forwardRef((e,t)=>{const r=H("StepperStep",dre,e),{className:n,step:o,state:i,color:a,icon:l,completedIcon:c,progressIcon:u,label:d,description:p,withIcon:h,iconSize:m,size:v,radius:g,loading:b,allowStepClick:y,allowStepSelect:x,iconPosition:_,__staticSelector:w,classNames:j,styles:C,unstyled:P,orientation:E,variant:k}=r,$=cre(r,["className","step","state","color","icon","completedIcon","progressIcon","label","description","withIcon","iconSize","size","radius","loading","allowStepClick","allowStepSelect","iconPosition","__staticSelector","classNames","styles","unstyled","orientation","variant"]),{classes:I,cx:T}=sre({color:a,iconSize:m,radius:g,allowStepClick:y,iconPosition:_,orientation:E},{name:w,classNames:j,styles:C,unstyled:P,variant:k,size:v}),z=A({size:v,sizes:ure}),M=i==="stepCompleted"?null:i==="stepProgress"?u:l,L={"data-progress":i==="stepProgress"||void 0,"data-completed":i==="stepCompleted"||void 0};return S.createElement(So,Ig(Ig({className:T(I.step,n),tabIndex:y?0:-1,ref:t},L),$),h&&S.createElement("div",{className:I.stepWrapper},S.createElement("div",Ig({className:I.stepIcon},L),S.createElement(va,{mounted:i==="stepCompleted",transition:"pop",duration:200},q=>S.createElement("div",{className:I.stepCompletedIcon,style:q},b?S.createElement(dn,{color:"#fff",size:z,className:I.stepLoader}):Hu(c,o)||S.createElement(XT,{indeterminate:!1,width:z,height:z}))),i!=="stepCompleted"?b?S.createElement(dn,{size:z,color:a}):Hu(M||l,o):null),E==="vertical"&&S.createElement("div",{className:T(I.verticalSeparator,{[I.verticalSeparatorActive]:i==="stepCompleted"})})),(d||p)&&S.createElement("div",{className:I.stepBody},d&&S.createElement(re,{className:I.stepLabel},Hu(d,o)),p&&S.createElement(re,{className:I.stepDescription,color:"dimmed"},Hu(p,o))))});HN.displayName="@mantine/core/Step";function Yp(e){return null}Yp.displayName="@mantine/core/StepCompleted";var fre=Object.defineProperty,pre=Object.defineProperties,hre=Object.getOwnPropertyDescriptors,zO=Object.getOwnPropertySymbols,mre=Object.prototype.hasOwnProperty,gre=Object.prototype.propertyIsEnumerable,FO=(e,t,r)=>t in e?fre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ul=(e,t)=>{for(var r in t||(t={}))mre.call(t,r)&&FO(e,r,t[r]);if(zO)for(var r of zO(t))gre.call(t,r)&&FO(e,r,t[r]);return e},vre=(e,t)=>pre(e,hre(t)),yre=W((e,{contentPadding:t,color:r,orientation:n,iconPosition:o,iconSize:i,breakpoint:a},{size:l})=>{const c=typeof a<"u",u=mr(A({size:a,sizes:e.breakpoints})),d=typeof i<"u"?`calc(${O(i)} / 2 - ${O(1)})`:`calc(${A({size:l,sizes:BN})} / 2 - ${O(1)})`,p={steps:{flexDirection:"column",alignItems:o==="left"?"flex-start":"flex-end"},separator:{width:O(2),minHeight:e.spacing.xl,marginLeft:o==="left"?d:0,marginRight:o==="right"?d:0,marginTop:`calc(${e.spacing.xs} / 2)`,marginBottom:`calc(${e.spacing.xs} - ${O(2)})`}},h={steps:{[`@media (max-width: ${ar(u-1)})`]:p.steps},separator:{[`@media (max-width: ${ar(u-1)})`]:p.separator}};return{root:{},steps:ul(ul({display:"flex",boxSizing:"border-box",alignItems:"center"},n==="vertical"?p.steps:null),c?h.steps:null),separator:ul(ul({boxSizing:"border-box",transition:"background-color 150ms ease",flex:1,height:O(2),backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],marginLeft:e.spacing.md,marginRight:e.spacing.md},n==="vertical"?p.separator:null),c?h.separator:null),separatorActive:{backgroundColor:e.fn.variant({variant:"filled",color:r||e.primaryColor,primaryFallback:!1}).background},content:vre(ul({},e.fn.fontStyles()),{paddingTop:A({size:t,sizes:e.spacing})})}});const xre=yre;var wre=Object.defineProperty,Xp=Object.getOwnPropertySymbols,GN=Object.prototype.hasOwnProperty,qN=Object.prototype.propertyIsEnumerable,VO=(e,t,r)=>t in e?wre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_re=(e,t)=>{for(var r in t||(t={}))GN.call(t,r)&&VO(e,r,t[r]);if(Xp)for(var r of Xp(t))qN.call(t,r)&&VO(e,r,t[r]);return e},bre=(e,t)=>{var r={};for(var n in e)GN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xp)for(var n of Xp(e))t.indexOf(n)<0&&qN.call(e,n)&&(r[n]=e[n]);return r};const Sre={contentPadding:"md",size:"md",radius:"xl",orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0},lc=f.forwardRef((e,t)=>{var r,n,o;const i=H("Stepper",Sre,e),{className:a,children:l,onStepClick:c,active:u,icon:d,completedIcon:p,progressIcon:h,color:m,iconSize:v,contentPadding:g,size:b,radius:y,orientation:x,breakpoint:_,iconPosition:w,allowNextStepsSelect:j,classNames:C,styles:P,unstyled:E,variant:k}=i,$=bre(i,["className","children","onStepClick","active","icon","completedIcon","progressIcon","color","iconSize","contentPadding","size","radius","orientation","breakpoint","iconPosition","allowNextStepsSelect","classNames","styles","unstyled","variant"]),{classes:I,cx:T}=xre({contentPadding:g,color:m,orientation:x,iconPosition:w,iconSize:v,breakpoint:_},{name:"Stepper",classNames:C,styles:P,unstyled:E,variant:k,size:b}),z=f.Children.toArray(l),M=z.filter(V=>V.type!==Yp),L=z.find(V=>V.type===Yp),q=M.reduce((V,Q,ee)=>{const _e=u===ee?"stepProgress":u>ee?"stepCompleted":"stepInactive",Ue=(()=>typeof c!="function"?!1:typeof Q.props.allowStepSelect=="boolean"?Q.props.allowStepSelect:_e==="stepCompleted"||j)();return V.push(f.cloneElement(Q,{__staticSelector:"Stepper",icon:Q.props.icon||d||ee+1,key:ee,step:ee,variant:k,state:_e,onClick:()=>Ue&&c(ee),allowStepClick:Ue,completedIcon:Q.props.completedIcon||p,progressIcon:Q.props.progressIcon||h,color:Q.props.color||m,iconSize:v,size:b,radius:y,classNames:C,styles:P,iconPosition:Q.props.iconPosition||w,orientation:x,unstyled:E})),x==="horizontal"&&ee!==M.length-1&&V.push(S.createElement("div",{className:T(I.separator,{[I.separatorActive]:ee<u}),key:`separator-${ee}`})),V},[]),Y=(n=(r=M[u])==null?void 0:r.props)==null?void 0:n.children,R=(o=L==null?void 0:L.props)==null?void 0:o.children,N=u>M.length-1?R:Y;return S.createElement(oe,_re({className:T(I.root,a),ref:t},$),S.createElement("div",{className:I.steps},q),N&&S.createElement("div",{className:I.content},N))});lc.Step=HN;lc.Completed=Yp;lc.displayName="@mantine/core/Stepper";const QN=f.createContext(null),Pre=QN.Provider,Ore=()=>f.useContext(QN);var jre=Object.defineProperty,Jp=Object.getOwnPropertySymbols,KN=Object.prototype.hasOwnProperty,YN=Object.prototype.propertyIsEnumerable,BO=(e,t,r)=>t in e?jre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,UO=(e,t)=>{for(var r in t||(t={}))KN.call(t,r)&&BO(e,r,t[r]);if(Jp)for(var r of Jp(t))YN.call(t,r)&&BO(e,r,t[r]);return e},Cre=(e,t)=>{var r={};for(var n in e)KN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Jp)for(var n of Jp(e))t.indexOf(n)<0&&YN.call(e,n)&&(r[n]=e[n]);return r};const Ere={size:"sm"},XN=f.forwardRef((e,t)=>{const r=H("SwitchGroup",Ere,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c}=r,u=Cre(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=kr({value:o,defaultValue:i,finalValue:[],onChange:a}),h=m=>{const v=m.currentTarget.value;p(d.includes(v)?d.filter(g=>g!==v):[...d,v])};return S.createElement(Pre,{value:{value:d,onChange:h,size:l}},S.createElement(Wt.Wrapper,UO(UO({labelElement:"div",size:l,__staticSelector:"SwitchGroup",ref:t},c),u),n))});XN.displayName="@mantine/core/SwitchGroup";var $re=Object.defineProperty,kre=Object.defineProperties,Rre=Object.getOwnPropertyDescriptors,WO=Object.getOwnPropertySymbols,Tre=Object.prototype.hasOwnProperty,Ire=Object.prototype.propertyIsEnumerable,HO=(e,t,r)=>t in e?$re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dre=(e,t)=>{for(var r in t||(t={}))Tre.call(t,r)&&HO(e,r,t[r]);if(WO)for(var r of WO(t))Ire.call(t,r)&&HO(e,r,t[r]);return e},Nre=(e,t)=>kre(e,Rre(t));const Are={xs:O(16),sm:O(20),md:O(24),lg:O(30),xl:O(36)},Mre={xs:O(32),sm:O(38),md:O(46),lg:O(56),xl:O(72)},Lre={xs:O(12),sm:O(14),md:O(18),lg:O(22),xl:O(28)},zre={xs:O(5),sm:O(6),md:O(7),lg:O(9),xl:O(11)},Fre={xs:O(4),sm:O(5),md:O(6),lg:O(8),xl:O(10)};var Vre=W((e,{radius:t,color:r,labelPosition:n,error:o},{size:i})=>{const a=A({size:i,sizes:Lre}),l=A({size:t,sizes:e.radius}),c=e.fn.variant({variant:"filled",color:r}),u=A({size:i,sizes:Mre}),d=O(i==="xs"?1:2),p=e.fn.variant({variant:"filled",color:"red"}).background;return{root:{position:"relative"},input:{height:0,width:0,overflow:"hidden",whiteSpace:"nowrap",padding:0,WebkitClipPath:"inset(50%)",clipPath:"inset(50%)",position:"absolute"},track:Nre(Dre({},e.fn.focusStyles("input:focus + &")),{cursor:e.cursorType,overflow:"hidden",WebkitTapHighlightColor:"transparent",position:"relative",borderRadius:l,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[2],border:`${O(1)} solid ${o?p:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,height:A({size:i,sizes:Are}),minWidth:u,margin:0,transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:"150ms",boxSizing:"border-box",appearance:"none",display:"flex",alignItems:"center",fontSize:A({size:i,sizes:zre}),fontWeight:600,order:n==="left"?2:1,userSelect:"none",zIndex:0,lineHeight:0,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[6],transition:`color 150ms ${e.transitionTimingFunction}`,"input:checked + &":{backgroundColor:c.background,borderColor:c.background,color:e.white,transition:`color 150ms ${e.transitionTimingFunction}`},"input:disabled + &":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],cursor:"not-allowed",pointerEvents:"none"}}),thumb:{position:"absolute",zIndex:1,borderRadius:l,boxSizing:"border-box",display:"flex",backgroundColor:e.white,height:a,width:a,border:`${O(1)} solid ${e.colorScheme==="dark"?e.white:e.colors.gray[3]}`,left:d,transition:`left 150ms ${e.transitionTimingFunction}`,"& > *":{margin:"auto"},"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":""},"input:checked + * > &":{left:`calc(100% - ${a} - ${d})`,borderColor:e.white},"input:disabled + * > &":{borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],backgroundColor:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[0]}},trackLabel:{height:"100%",display:"grid",placeContent:"center",minWidth:`calc(${u} - ${a})`,paddingInline:A({size:i,sizes:Fre}),marginLeft:`calc(${a} + ${d})`,transition:`margin 150ms ${e.transitionTimingFunction}`,"input:checked + * > &":{marginLeft:0,marginRight:`calc(${a} + ${d})`}}}});const Bre=Vre;var Ure=Object.defineProperty,Wre=Object.defineProperties,Hre=Object.getOwnPropertyDescriptors,Zp=Object.getOwnPropertySymbols,JN=Object.prototype.hasOwnProperty,ZN=Object.prototype.propertyIsEnumerable,GO=(e,t,r)=>t in e?Ure(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dg=(e,t)=>{for(var r in t||(t={}))JN.call(t,r)&&GO(e,r,t[r]);if(Zp)for(var r of Zp(t))ZN.call(t,r)&&GO(e,r,t[r]);return e},Gre=(e,t)=>Wre(e,Hre(t)),qre=(e,t)=>{var r={};for(var n in e)JN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zp)for(var n of Zp(e))t.indexOf(n)<0&&ZN.call(e,n)&&(r[n]=e[n]);return r};const Qre={offLabel:"",onLabel:"",size:"sm",radius:"xl",error:!1},px=f.forwardRef((e,t)=>{var r;const n=H("Switch",Qre,e),{className:o,color:i,label:a,offLabel:l,onLabel:c,id:u,style:d,size:p,radius:h,wrapperProps:m,children:v,unstyled:g,styles:b,classNames:y,thumbIcon:x,sx:_,checked:w,defaultChecked:j,onChange:C,labelPosition:P,description:E,error:k,disabled:$,variant:I}=n,T=qre(n,["className","color","label","offLabel","onLabel","id","style","size","radius","wrapperProps","children","unstyled","styles","classNames","thumbIcon","sx","checked","defaultChecked","onChange","labelPosition","description","error","disabled","variant"]),z=Ore(),M=(z==null?void 0:z.size)||p,{classes:L,cx:q}=Bre({color:i,radius:h,labelPosition:P,error:!!k},{name:"Switch",classNames:y,styles:b,unstyled:g,size:M,variant:I}),{systemStyles:Y,rest:R}=no(T),N=Ir(u),V=z?{checked:z.value.includes(R.value),onChange:z.onChange}:{},[Q,ee]=kr({value:(r=V.checked)!=null?r:w,defaultValue:j,finalValue:!1});return S.createElement(am,Dg(Dg({className:q(o,L.root),sx:_,style:d,id:N,size:(z==null?void 0:z.size)||p,labelPosition:P,label:a,description:E,error:k,disabled:$,__staticSelector:"Switch",classNames:y,styles:b,unstyled:g,"data-checked":V.checked||void 0,variant:I},Y),m),S.createElement("input",Gre(Dg({},R),{disabled:$,checked:Q,onChange:_e=>{z?V.onChange(_e):C==null||C(_e),ee(_e.currentTarget.checked)},id:N,ref:t,type:"checkbox",className:L.input})),S.createElement("label",{htmlFor:N,className:L.track},S.createElement("div",{className:L.thumb},x),S.createElement("div",{className:L.trackLabel},Q?c:l)))});px.displayName="@mantine/core/Switch";px.Group=XN;var Kre=Object.defineProperty,Yre=Object.defineProperties,Xre=Object.getOwnPropertyDescriptors,qO=Object.getOwnPropertySymbols,Jre=Object.prototype.hasOwnProperty,Zre=Object.prototype.propertyIsEnumerable,QO=(e,t,r)=>t in e?Kre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ene=(e,t)=>{for(var r in t||(t={}))Jre.call(t,r)&&QO(e,r,t[r]);if(qO)for(var r of qO(t))Zre.call(t,r)&&QO(e,r,t[r]);return e},tne=(e,t)=>Yre(e,Xre(t)),rne=W((e,{captionSide:t,horizontalSpacing:r,verticalSpacing:n,fontSize:o,withBorder:i,withColumnBorders:a})=>{const l=`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`;return{root:tne(ene({},e.fn.fontStyles()),{width:"100%",borderCollapse:"collapse",captionSide:t,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,border:i?l:void 0,"& > caption":{marginTop:t==="top"?0:e.spacing.xs,marginBottom:t==="bottom"?0:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& > thead > tr > th, & > tfoot > tr > th, & > tbody > tr > th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:A({size:o,sizes:e.fontSizes}),padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`},"& > thead > tr > th":{borderBottom:l},"& > tfoot > tr > th, & > tbody > tr > th":{borderTop:l},"& > tbody > tr > td":{padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`,borderTop:l,fontSize:A({size:o,sizes:e.fontSizes})},"& > tbody > tr:first-of-type > td, & > tbody > tr:first-of-type > th":{borderTop:"none"},"& > thead > tr > th, & > tbody > tr > td":{borderRight:a?l:"none","&:last-of-type":{borderRight:"none",borderLeft:a?l:"none"}},"& > tbody > tr > th":{borderRight:a?l:"none"},"&[data-striped] > tbody > tr:nth-of-type(odd)":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]},"&[data-hover] > tbody > tr":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})})}});const nne=rne;var one=Object.defineProperty,ine=Object.defineProperties,ane=Object.getOwnPropertyDescriptors,eh=Object.getOwnPropertySymbols,e5=Object.prototype.hasOwnProperty,t5=Object.prototype.propertyIsEnumerable,KO=(e,t,r)=>t in e?one(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sne=(e,t)=>{for(var r in t||(t={}))e5.call(t,r)&&KO(e,r,t[r]);if(eh)for(var r of eh(t))t5.call(t,r)&&KO(e,r,t[r]);return e},lne=(e,t)=>ine(e,ane(t)),cne=(e,t)=>{var r={};for(var n in e)e5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&eh)for(var n of eh(e))t.indexOf(n)<0&&t5.call(e,n)&&(r[n]=e[n]);return r};const une={striped:!1,highlightOnHover:!1,captionSide:"top",horizontalSpacing:"xs",fontSize:"sm",verticalSpacing:7,withBorder:!1,withColumnBorders:!1},xa=f.forwardRef((e,t)=>{const r=H("Table",une,e),{className:n,children:o,striped:i,highlightOnHover:a,captionSide:l,horizontalSpacing:c,verticalSpacing:u,fontSize:d,unstyled:p,withBorder:h,withColumnBorders:m,variant:v}=r,g=cne(r,["className","children","striped","highlightOnHover","captionSide","horizontalSpacing","verticalSpacing","fontSize","unstyled","withBorder","withColumnBorders","variant"]),{classes:b,cx:y}=nne({captionSide:l,verticalSpacing:u,horizontalSpacing:c,fontSize:d,withBorder:h,withColumnBorders:m},{unstyled:p,name:"Table",variant:v});return S.createElement(oe,lne(sne({},g),{component:"table",ref:t,className:y(b.root,n),"data-striped":i||void 0,"data-hover":a||void 0}),o)});xa.displayName="@mantine/core/Table";const ay={context:"Tabs component was not found in the tree",value:"Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value"},[dne,hx]=Do(ay.context);var fne=Object.defineProperty,YO=Object.getOwnPropertySymbols,pne=Object.prototype.hasOwnProperty,hne=Object.prototype.propertyIsEnumerable,XO=(e,t,r)=>t in e?fne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mne=(e,t)=>{for(var r in t||(t={}))pne.call(t,r)&&XO(e,r,t[r]);if(YO)for(var r of YO(t))hne.call(t,r)&&XO(e,r,t[r]);return e};function gne({orientation:e,inverted:t,placement:r},n,o){const i=e==="vertical";return o==="default"?{[i?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${O(2)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="outline"?{[i?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${O(1)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="pills"?{gap:`calc(${n.spacing.sm} / 2)`}:{}}var vne=W((e,t,{variant:r})=>{const n=t.orientation==="vertical";return{tabsList:mne({display:"flex",flexWrap:"wrap",flexDirection:n?"column":"row",justifyContent:VI[t.position],'& [role="tab"]':{flex:t.grow?1:void 0}},gne(t,e,r))}});const yne=vne;var xne=Object.defineProperty,wne=Object.defineProperties,_ne=Object.getOwnPropertyDescriptors,th=Object.getOwnPropertySymbols,r5=Object.prototype.hasOwnProperty,n5=Object.prototype.propertyIsEnumerable,JO=(e,t,r)=>t in e?xne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bne=(e,t)=>{for(var r in t||(t={}))r5.call(t,r)&&JO(e,r,t[r]);if(th)for(var r of th(t))n5.call(t,r)&&JO(e,r,t[r]);return e},Sne=(e,t)=>wne(e,_ne(t)),Pne=(e,t)=>{var r={};for(var n in e)r5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&th)for(var n of th(e))t.indexOf(n)<0&&n5.call(e,n)&&(r[n]=e[n]);return r};const One={grow:!1,position:"left"},o5=f.forwardRef((e,t)=>{const r=H("TabsList",One,e),{children:n,className:o,grow:i,position:a}=r,l=Pne(r,["children","className","grow","position"]),{orientation:c,variant:u,color:d,radius:p,inverted:h,placement:m,classNames:v,styles:g,unstyled:b}=hx(),{classes:y,cx:x}=yne({orientation:c,grow:i,color:d,position:a,radius:p,inverted:h,placement:m},{name:"Tabs",unstyled:b,classNames:v,styles:g,variant:u});return S.createElement(oe,Sne(bne({},l),{className:x(y.tabsList,o),ref:t,role:"tablist","aria-orientation":c}),n)});o5.displayName="@mantine/core/TabsList";var jne=W((e,{orientation:t})=>({panel:{flex:t==="vertical"?1:void 0}}));const Cne=jne;var Ene=Object.defineProperty,$ne=Object.defineProperties,kne=Object.getOwnPropertyDescriptors,rh=Object.getOwnPropertySymbols,i5=Object.prototype.hasOwnProperty,a5=Object.prototype.propertyIsEnumerable,ZO=(e,t,r)=>t in e?Ene(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rne=(e,t)=>{for(var r in t||(t={}))i5.call(t,r)&&ZO(e,r,t[r]);if(rh)for(var r of rh(t))a5.call(t,r)&&ZO(e,r,t[r]);return e},Tne=(e,t)=>$ne(e,kne(t)),Ine=(e,t)=>{var r={};for(var n in e)i5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rh)for(var n of rh(e))t.indexOf(n)<0&&a5.call(e,n)&&(r[n]=e[n]);return r};const Dne={},s5=f.forwardRef((e,t)=>{const r=H("TabsPanel",Dne,e),{value:n,children:o,sx:i,className:a}=r,l=Ine(r,["value","children","sx","className"]),c=hx(),{classes:u,cx:d}=Cne({orientation:c.orientation,color:c.color,radius:c.radius,inverted:c.inverted,placement:c.placement},{name:"Tabs",unstyled:c.unstyled,classNames:c.classNames,styles:c.styles,variant:c.variant}),p=c.getPanelId(n),h=c.value===n,m=c.keepMounted||h?o:null;return f.useEffect(()=>(c.setMountedPanelIds(v=>[...v,p]),c.setMountedPanelIds(v=>v.filter(g=>g!==p))),[p]),S.createElement(oe,Tne(Rne({},l),{ref:t,sx:[{display:h?void 0:"none"},...vc(i)],className:d(u.panel,a),role:"tabpanel",id:p,"aria-labelledby":c.getTabId(n)}),m)});s5.displayName="@mantine/core/TabsPanel";var Nne=Object.defineProperty,Ane=Object.defineProperties,Mne=Object.getOwnPropertyDescriptors,ej=Object.getOwnPropertySymbols,Lne=Object.prototype.hasOwnProperty,zne=Object.prototype.propertyIsEnumerable,tj=(e,t,r)=>t in e?Nne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ja=(e,t)=>{for(var r in t||(t={}))Lne.call(t,r)&&tj(e,r,t[r]);if(ej)for(var r of ej(t))zne.call(t,r)&&tj(e,r,t[r]);return e},rj=(e,t)=>Ane(e,Mne(t));function Fne(e,{orientation:t,color:r,radius:n,inverted:o,placement:i},a){const l=t==="vertical",c=e.fn.variant({color:r,variant:"filled"}),u=O(e.fn.radius(n)),d=t==="vertical"?i==="left"?`${u} 0 0 ${u}`:` 0 ${u} ${u} 0`:o?`0 0 ${u} ${u}`:`${u} ${u} 0 0`;return a==="default"?rj(Ja({[l?i==="left"?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:`${O(2)} solid transparent`,[l?i==="left"?"marginRight":"marginLeft":o?"marginTop":"marginBottom"]:O(-2),borderRadius:d},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]})),{"&[data-active]":Ja({borderColor:c.background,color:e.colorScheme==="dark"?e.white:e.black},e.fn.hover({borderColor:c.background}))}):a==="outline"?{borderRadius:d,border:`${O(1)} solid transparent`,[l?i==="left"?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:"none","&[data-active]":{borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3],"&::before":{content:'""',backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,position:"absolute",bottom:l?0:o?"unset":O(-1),top:l?0:o?O(-1):"unset",[l?"width":"height"]:O(1),right:l?i==="left"?O(-1):"unset":0,left:l?i==="left"?"unset":O(-1):0}}}:a==="pills"?rj(Ja({borderRadius:e.fn.radius(n)},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]})),{"&[data-active]":Ja({backgroundColor:c.background,color:e.white},e.fn.hover({backgroundColor:c.background}))}):{}}var Vne=W((e,t,{variant:r})=>({tabLabel:{},tab:Ja({position:"relative",padding:`${e.spacing.xs} ${e.spacing.md}`,paddingLeft:t.withIcon?e.spacing.xs:void 0,paddingRight:t.withRightSection?e.spacing.xs:void 0,fontSize:e.fontSizes.sm,whiteSpace:"nowrap",zIndex:0,display:"flex",alignItems:"center",justifyContent:t.orientation==="horizontal"?"center":void 0,lineHeight:1,"&:disabled":Ja({opacity:.5,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),"&:focus":{zIndex:1}},Fne(e,t,r)),tabRightSection:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginLeft:O(7)}},tabIcon:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginRight:O(7)}}}));const Bne=Vne;var Une=Object.defineProperty,Wne=Object.defineProperties,Hne=Object.getOwnPropertyDescriptors,nh=Object.getOwnPropertySymbols,l5=Object.prototype.hasOwnProperty,c5=Object.prototype.propertyIsEnumerable,nj=(e,t,r)=>t in e?Une(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gne=(e,t)=>{for(var r in t||(t={}))l5.call(t,r)&&nj(e,r,t[r]);if(nh)for(var r of nh(t))c5.call(t,r)&&nj(e,r,t[r]);return e},qne=(e,t)=>Wne(e,Hne(t)),Qne=(e,t)=>{var r={};for(var n in e)l5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nh)for(var n of nh(e))t.indexOf(n)<0&&c5.call(e,n)&&(r[n]=e[n]);return r};const Kne={},u5=f.forwardRef((e,t)=>{const r=H("TabsTab",Kne,e),{value:n,children:o,onKeyDown:i,onClick:a,className:l,icon:c,rightSection:u,color:d}=r,p=Qne(r,["value","children","onKeyDown","onClick","className","icon","rightSection","color"]),h=hx(),m=!!c,v=!!u,{theme:g,classes:b,cx:y}=Bne({withIcon:m||v&&!o,withRightSection:v||m&&!o,orientation:h.orientation,color:d||h.color,radius:h.radius,inverted:h.inverted,placement:h.placement},{name:"Tabs",unstyled:h.unstyled,classNames:h.classNames,styles:h.styles,variant:h.variant}),x=n===h.value,_=h.getPanelId(n),w=h.mountedPanelIds.includes(n)?_:void 0,j=C=>{h.onTabChange(h.allowTabDeactivation&&n===h.value?null:n),a==null||a(C)};return S.createElement(So,qne(Gne({},p),{unstyled:h.unstyled,className:y(b.tab,l),"data-active":x||void 0,ref:t,type:"button",role:"tab",id:h.getTabId(n),"aria-selected":x,tabIndex:x||h.value===null?0:-1,"aria-controls":w,onClick:j,onKeyDown:mE({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:h.activateTabWithKeyboard,loop:h.loop,dir:g.dir,orientation:h.orientation,onKeyDown:i})}),c&&S.createElement("span",{className:b.tabIcon},c),o&&S.createElement("span",{className:b.tabLabel},o),u&&S.createElement("span",{className:b.tabRightSection},u))});u5.displayName="@mantine/core/Tab";function d5({defaultValue:e,value:t,onTabChange:r,orientation:n,children:o,loop:i,id:a,activateTabWithKeyboard:l,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,placement:m,keepMounted:v=!0,classNames:g,styles:b,unstyled:y}){const x=Ir(a),[_,w]=f.useState([]),[j,C]=kr({value:t,defaultValue:e,finalValue:null,onChange:r});return S.createElement(dne,{value:{placement:m,value:j,orientation:n,id:x,loop:i,activateTabWithKeyboard:l,getTabId:P1(`${x}-tab`,ay.value),getPanelId:P1(`${x}-panel`,ay.value),onTabChange:C,setMountedPanelIds:w,mountedPanelIds:_,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,keepMounted:v,classNames:g,styles:b,unstyled:y}},o)}d5.displayName="@mantine/core/TabsProvider";var Yne=W((e,{orientation:t,placement:r})=>({root:{display:t==="vertical"?"flex":void 0,flexDirection:r==="right"?"row-reverse":"row"}}));const Xne=Yne;var Jne=Object.defineProperty,Zne=Object.defineProperties,eoe=Object.getOwnPropertyDescriptors,oh=Object.getOwnPropertySymbols,f5=Object.prototype.hasOwnProperty,p5=Object.prototype.propertyIsEnumerable,oj=(e,t,r)=>t in e?Jne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,toe=(e,t)=>{for(var r in t||(t={}))f5.call(t,r)&&oj(e,r,t[r]);if(oh)for(var r of oh(t))p5.call(t,r)&&oj(e,r,t[r]);return e},roe=(e,t)=>Zne(e,eoe(t)),noe=(e,t)=>{var r={};for(var n in e)f5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&oh)for(var n of oh(e))t.indexOf(n)<0&&p5.call(e,n)&&(r[n]=e[n]);return r};const ooe={orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},He=f.forwardRef((e,t)=>{const r=H("Tabs",ooe,e),{defaultValue:n,value:o,orientation:i,loop:a,activateTabWithKeyboard:l,allowTabDeactivation:c,children:u,id:d,onTabChange:p,variant:h,color:m,className:v,unstyled:g,classNames:b,styles:y,radius:x,inverted:_,keepMounted:w,placement:j}=r,C=noe(r,["defaultValue","value","orientation","loop","activateTabWithKeyboard","allowTabDeactivation","children","id","onTabChange","variant","color","className","unstyled","classNames","styles","radius","inverted","keepMounted","placement"]),{classes:P,cx:E}=Xne({orientation:i,color:m,radius:x,inverted:_,placement:j},{unstyled:g,name:"Tabs",classNames:b,styles:y,variant:h});return S.createElement(d5,{activateTabWithKeyboard:l,defaultValue:n,orientation:i,onTabChange:p,value:o,id:d,loop:a,allowTabDeactivation:c,color:m,variant:h,radius:x,inverted:_,keepMounted:w,placement:j,classNames:b,styles:y,unstyled:g},S.createElement(oe,roe(toe({},C),{className:E(P.root,v),id:d,ref:t}),u))});He.List=o5;He.Tab=u5;He.Panel=s5;He.displayName="@mantine/core/Tabs";var ioe=Object.defineProperty,aoe=Object.defineProperties,soe=Object.getOwnPropertyDescriptors,ij=Object.getOwnPropertySymbols,loe=Object.prototype.hasOwnProperty,coe=Object.prototype.propertyIsEnumerable,aj=(e,t,r)=>t in e?ioe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uoe=(e,t)=>{for(var r in t||(t={}))loe.call(t,r)&&aj(e,r,t[r]);if(ij)for(var r of ij(t))coe.call(t,r)&&aj(e,r,t[r]);return e},doe=(e,t)=>aoe(e,soe(t));function foe(e,t,r){return typeof e<"u"?e in r.headings.sizes?r.headings.sizes[e].fontSize:O(e):r.headings.sizes[t].fontSize}function poe(e,t,r){return typeof e<"u"&&e in r.headings.sizes?r.headings.sizes[e].lineHeight:r.headings.sizes[t].lineHeight}var hoe=W((e,{element:t,weight:r,inline:n},{size:o})=>({root:doe(uoe({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:r||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:foe(o,t,e),lineHeight:n?1:poe(o,t,e),margin:0})}));const moe=hoe;var goe=Object.defineProperty,ih=Object.getOwnPropertySymbols,h5=Object.prototype.hasOwnProperty,m5=Object.prototype.propertyIsEnumerable,sj=(e,t,r)=>t in e?goe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,voe=(e,t)=>{for(var r in t||(t={}))h5.call(t,r)&&sj(e,r,t[r]);if(ih)for(var r of ih(t))m5.call(t,r)&&sj(e,r,t[r]);return e},yoe=(e,t)=>{var r={};for(var n in e)h5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ih)for(var n of ih(e))t.indexOf(n)<0&&m5.call(e,n)&&(r[n]=e[n]);return r};const xoe={order:1},he=f.forwardRef((e,t)=>{const r=H("Title",xoe,e),{className:n,order:o,children:i,unstyled:a,size:l,weight:c,inline:u,variant:d}=r,p=yoe(r,["className","order","children","unstyled","size","weight","inline","variant"]),{classes:h,cx:m}=moe({element:`h${o}`,weight:c,inline:u},{name:"Title",unstyled:a,variant:d,size:l});return[1,2,3,4,5,6].includes(o)?S.createElement(re,voe({variant:d,component:`h${o}`,ref:t,className:m(h.root,n)},p),i):null});he.displayName="@mantine/core/Title";function sy(e,t){return sy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sy(e,t)}function g5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,sy(e,t)}var v5={exports:{}},woe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",_oe=woe,boe=_oe;function y5(){}function x5(){}x5.resetWarningCache=y5;var Soe=function(){function e(n,o,i,a,l,c){if(c!==boe){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 r={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:x5,resetWarningCache:y5};return r.PropTypes=r,r};v5.exports=Soe();var Poe=v5.exports;const Te=Dy(Poe),lj={disabled:!1},ah=S.createContext(null);var Sl="unmounted",zi="exited",Fi="entering",za="entered",ly="exiting",zo=function(e){g5(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=o,l=a&&!a.isMounting?n.enter:n.appear,c;return i.appearStatus=null,n.in?l?(c=zi,i.appearStatus=Fi):c=za:n.unmountOnExit||n.mountOnEnter?c=Sl:c=zi,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Sl?{status:zi}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==Fi&&a!==za&&(i=Fi):(a===Fi||a===za)&&(i=ly)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},r.updateStatus=function(o,i){o===void 0&&(o=!1),i!==null?(this.cancelNextCallback(),i===Fi?this.performEnter(o):this.performExit()):this.props.unmountOnExit&&this.state.status===zi&&this.setState({status:Sl})},r.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[pg.findDOMNode(this),l],u=c[0],d=c[1],p=this.getTimeouts(),h=l?p.appear:p.enter;if(!o&&!a||lj.disabled){this.safeSetState({status:za},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Fi},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:za},function(){i.props.onEntered(u,d)})})})},r.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:pg.findDOMNode(this);if(!i||lj.disabled){this.safeSetState({status:zi},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:ly},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:zi},function(){o.props.onExited(l)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:pg.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===Sl)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=cx(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S.createElement(ah.Provider,{value:null},typeof a=="function"?a(o,l):S.cloneElement(S.Children.only(a),l))},t}(S.Component);zo.contextType=ah;zo.propTypes={};function Da(){}zo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Da,onEntering:Da,onEntered:Da,onExit:Da,onExiting:Da,onExited:Da};zo.UNMOUNTED=Sl;zo.EXITED=zi;zo.ENTERING=Fi;zo.ENTERED=za;zo.EXITING=ly;const Ooe=zo;function joe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mx(e,t){var r=function(i){return t&&f.isValidElement(i)?t(i):i},n=Object.create(null);return e&&f.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function Coe(e,t){e=e||{},t=t||{};function r(d){return d in t?t[d]:e[d]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var a,l={};for(var c in t){if(n[c])for(a=0;a<n[c].length;a++){var u=n[c][a];l[n[c][a]]=r(u)}l[c]=r(c)}for(a=0;a<o.length;a++)l[o[a]]=r(o[a]);return l}function Gi(e,t,r){return r[t]!=null?r[t]:e.props[t]}function Eoe(e,t){return mx(e.children,function(r){return f.cloneElement(r,{onExited:t.bind(null,r),in:!0,appear:Gi(r,"appear",e),enter:Gi(r,"enter",e),exit:Gi(r,"exit",e)})})}function $oe(e,t,r){var n=mx(e.children),o=Coe(t,n);return Object.keys(o).forEach(function(i){var a=o[i];if(f.isValidElement(a)){var l=i in t,c=i in n,u=t[i],d=f.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=f.cloneElement(a,{onExited:r.bind(null,a),in:!0,exit:Gi(a,"exit",e),enter:Gi(a,"enter",e)}):!c&&l&&!d?o[i]=f.cloneElement(a,{in:!1}):c&&l&&f.isValidElement(u)&&(o[i]=f.cloneElement(a,{onExited:r.bind(null,a),in:u.props.in,exit:Gi(a,"exit",e),enter:Gi(a,"enter",e)}))}}),o}var koe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Roe={component:"div",childFactory:function(t){return t}},gx=function(e){g5(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=i.handleExited.bind(joe(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}var r=t.prototype;return r.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},r.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var a=i.children,l=i.handleExited,c=i.firstRender;return{children:c?Eoe(o,l):$oe(o,a,l),firstRender:!1}},r.handleExited=function(o,i){var a=mx(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=rt({},l.children);return delete c[o.key],{children:c}}))},r.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=cx(o,["component","childFactory"]),c=this.state.contextValue,u=koe(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?S.createElement(ah.Provider,{value:c},u):S.createElement(ah.Provider,{value:c},S.createElement(i,l,u))},t}(S.Component);gx.propTypes={};gx.defaultProps=Roe;const Toe=gx,[Ioe,Nc]=bM("mantine-notifications"),me=Nc("show"),Doe=Nc("hide"),Noe=Nc("clean"),Aoe=Nc("cleanQueue"),Pl=Nc("update"),bo={show:me,hide:Doe,clean:Noe,cleanQueue:Aoe,update:Pl};function Moe([e,t],r){const n={};return e==="top"&&(n.top=r),e==="bottom"&&(n.bottom=r),t==="left"&&(n.left=r),t==="right"&&(n.right=r),t==="center"&&(n.left="50%",n.transform="translateX(-50%)"),n}var Loe=Object.defineProperty,cj=Object.getOwnPropertySymbols,zoe=Object.prototype.hasOwnProperty,Foe=Object.prototype.propertyIsEnumerable,uj=(e,t,r)=>t in e?Loe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dj=(e,t)=>{for(var r in t||(t={}))zoe.call(t,r)&&uj(e,r,t[r]);if(cj)for(var r of cj(t))Foe.call(t,r)&&uj(e,r,t[r]);return e};const fj={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Voe={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Boe({state:e,maxHeight:t,positioning:r,transitionDuration:n}){const[o,i]=r,a=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:fj[a],transitionDuration:`${n}ms, ${n}ms, ${n}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:Voe[a]},u={opacity:0,maxHeight:0,transform:fj[a]},d={entering:c,entered:c,exiting:u,exited:u};return dj(dj({},l),d[e])}function Uoe(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}var Woe=Object.defineProperty,Hoe=Object.defineProperties,Goe=Object.getOwnPropertyDescriptors,sh=Object.getOwnPropertySymbols,w5=Object.prototype.hasOwnProperty,_5=Object.prototype.propertyIsEnumerable,pj=(e,t,r)=>t in e?Woe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hj=(e,t)=>{for(var r in t||(t={}))w5.call(t,r)&&pj(e,r,t[r]);if(sh)for(var r of sh(t))_5.call(t,r)&&pj(e,r,t[r]);return e},qoe=(e,t)=>Hoe(e,Goe(t)),mj=(e,t)=>{var r={};for(var n in e)w5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sh)for(var n of sh(e))t.indexOf(n)<0&&_5.call(e,n)&&(r[n]=e[n]);return r};function b5(e){var t=e,{notification:r,autoClose:n,onHide:o,innerRef:i}=t,a=mj(t,["notification","autoClose","onHide","innerRef"]);const l=r,{autoClose:c,message:u}=l,d=mj(l,["autoClose","message"]),p=Uoe(n,c),h=f.useRef(),m=()=>{o(r.id),window.clearTimeout(h.current)},v=()=>{clearTimeout(h.current)},g=()=>{typeof p=="number"&&(h.current=window.setTimeout(m,p))};return f.useEffect(()=>{typeof r.onOpen=="function"&&r.onOpen(r)},[]),f.useEffect(()=>(g(),v),[n,r.autoClose]),S.createElement(HD,qoe(hj(hj({},d),a),{onClose:m,onMouseEnter:v,onMouseLeave:g,ref:i}),u)}b5.displayName="@mantine/notifications/NotificationContainer";var Qoe=W((e,{zIndex:t})=>({notifications:{width:`calc(100% - ${e.spacing.md} * 2)`,boxSizing:"border-box",position:"fixed",zIndex:t},notification:{"&:not(:first-of-type)":{marginTop:e.spacing.sm}}}));const Koe=Qoe;var Yoe=Object.defineProperty,Xoe=Object.defineProperties,Joe=Object.getOwnPropertyDescriptors,gj=Object.getOwnPropertySymbols,Zoe=Object.prototype.hasOwnProperty,eie=Object.prototype.propertyIsEnumerable,vj=(e,t,r)=>t in e?Yoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tie=(e,t)=>{for(var r in t||(t={}))Zoe.call(t,r)&&vj(e,r,t[r]);if(gj)for(var r of gj(t))eie.call(t,r)&&vj(e,r,t[r]);return e},rie=(e,t)=>Xoe(e,Joe(t));function nie({limit:e}){const{state:t,queue:r,update:n,cleanQueue:o}=n6({initialValues:[],limit:e});return{notifications:t,queue:r,showNotification:u=>{const d=u.id||Mh();return n(p=>u.id&&p.some(h=>h.id===u.id)?p:[...p,rie(tie({},u),{id:d})]),d},updateNotification:u=>n(d=>{const p=d.findIndex(m=>m.id===u.id);if(p===-1)return d;const h=[...d];return h[p]=u,h}),hideNotification:u=>n(d=>d.filter(p=>p.id===u?(typeof p.onClose=="function"&&p.onClose(p),!1):!0)),cleanQueue:o,clean:()=>n(()=>[])}}var oie=Object.defineProperty,lh=Object.getOwnPropertySymbols,S5=Object.prototype.hasOwnProperty,P5=Object.prototype.propertyIsEnumerable,yj=(e,t,r)=>t in e?oie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ng=(e,t)=>{for(var r in t||(t={}))S5.call(t,r)&&yj(e,r,t[r]);if(lh)for(var r of lh(t))P5.call(t,r)&&yj(e,r,t[r]);return e},iie=(e,t)=>{var r={};for(var n in e)S5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&lh)for(var n of lh(e))t.indexOf(n)<0&&P5.call(e,n)&&(r[n]=e[n]);return r};const aie=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"],wa=e=>{var t=e,{className:r,position:n="bottom-right",autoClose:o=4e3,transitionDuration:i=250,containerWidth:a=O(440),notificationMaxHeight:l=O(200),limit:c=5,zIndex:u=$n("overlay"),style:d,children:p,target:h}=t,m=iie(t,["className","position","autoClose","transitionDuration","containerWidth","notificationMaxHeight","limit","zIndex","style","children","target"]);const v=JL(),g=f.useRef({}),b=f.useRef(0),{notifications:y,showNotification:x,updateNotification:_,hideNotification:w,clean:j,cleanQueue:C}=nie({limit:c}),{classes:P,cx:E,theme:k}=Koe({zIndex:u}),$=Lh(),T=(k.respectReducedMotion?$:!1)?1:i,z=(aie.includes(n)?n:"bottom-right").split("-");on(()=>{y.length>b.current&&setTimeout(()=>v(),0),b.current=y.length},[y]),Ioe({show:x,hide:w,update:_,clean:j,cleanQueue:C});const M=y.map(L=>S.createElement(Ooe,{key:L.id,timeout:T,onEnter:()=>g.current[L.id].offsetHeight,nodeRef:{current:g.current[L.id]}},q=>S.createElement(b5,{innerRef:Y=>{g.current[L.id]=Y},notification:L,onHide:w,className:P.notification,autoClose:o,sx:[Ng({},Boe({state:q,positioning:z,transitionDuration:T,maxHeight:l})),...Array.isArray(L.sx)?L.sx:[L.sx]]})));return S.createElement(z0,{target:h},S.createElement(oe,Ng({className:E(P.notifications,r),style:d,sx:Ng({maxWidth:a},Moe(z,k.spacing.md))},m),S.createElement(Toe,null,M)))};wa.displayName="@mantine/notifications/Notifications";wa.show=bo.show;wa.hide=bo.hide;wa.update=bo.update;wa.clean=bo.clean;wa.cleanQueue=bo.cleanQueue;class sie{constructor(t,r){this.operator=t,this.child=r}toString(){return`${this.operator}(${this.child.toString()})`}}class Ac{constructor(t,r,n){this.operator=t,this.left=r,this.right=n}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class lie{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,r){return this.infixParselets[t]=r,this}registerPrefix(t,r){return this.prefixParselets[t]=r,this}prefix(t,r,n){return this.registerPrefix(t,{parse(o,i){const a=o.consumeAndParse(r);return n(i,a)}})}infixLeft(t,r,n){return this.registerInfix(t,{parse(o,i,a){const l=o.consumeAndParse(r);return n(i,a,l)},precedence:r})}construct(t){return new cie(t,this.prefixParselets,this.infixParselets)}}class cie{constructor(t,r,n){this.tokens=t,this.prefixParselets=r,this.infixParselets=n}hasMore(){return this.tokens.length>0}match(t){const r=this.peek();return(r==null?void 0:r.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const r=this.consume(),n=this.prefixParselets[r.id];if(!n)throw Error(`Parse error at "${r.value}" (line ${r.line}, column ${r.column}). No matching prefix parselet.`);let o=n.parse(this,r);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 r=this.getInfixParselet(t);return r?r.precedence:1/0}consume(t,r){var n,o;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((n=this.peek())==null?void 0:n.id)!==t){const i=this.peek();throw Error(`Expected ${t} but got "${i.id}" at line ${i.line} column ${i.column}.`)}if(r&&((o=this.peek())==null?void 0:o.value)!==r){const i=this.peek();throw Error(`Expected "${r}" 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]}}function dt(e){const t=et(e),r=ko(e);return r===t?{reference:t}:{reference:t,display:r}}function et(e){return Pa(e)?e.reference:`${e.resourceType}/${e.id}`}function vx(e){if(e)return Pa(e)?e.reference.split("/")[1]:e.id}function uie(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function ko(e){var t;if(uie(e)){const r=die(e);if(r)return r}if(e.resourceType==="Device"){const r=fie(e);if(r)return r}return e.resourceType==="Observation"&&"code"in e&&(t=e.code)!=null&&t.text?e.code.text:e.resourceType==="User"&&e.email?e.email:"name"in e&&e.name&&typeof e.name=="string"?e.name:et(e)}function die(e){const t=e.name;if(t&&t.length>0)return Mc(t[0])}function fie(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function pie(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const r of t){const n=xj(r);if(n)return n}else return xj(t)}function xj(e){if(e.url&&e.contentType&&e.contentType.startsWith("image/"))return e.url}function O5(e,t){const r=new Date(e);r.setUTCHours(0,0,0,0);const n=t?new Date(t):new Date;n.setUTCHours(0,0,0,0);const o=r.getUTCFullYear(),i=r.getUTCMonth(),a=r.getUTCDate(),l=n.getUTCFullYear(),c=n.getUTCMonth(),u=n.getUTCDate();let d=l-o;(c<i||c===i&&u<a)&&d--;let p=l*12+c-(o*12+i);u<a&&p--;const h=Math.floor((n.getTime()-r.getTime())/(1e3*60*60*24));return{years:d,months:p,days:h}}function hie(e,t){const{years:r,months:n,days:o}=O5(e,t);return r>=2?r.toString().padStart(3,"0")+"Y":n>=1?n.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function yx(e,...t){var n;let r=e;for(let o=0;o<t.length&&r;o++)r=(n=r==null?void 0:r.extension)==null?void 0:n.find(i=>i.url===t[o]);return r}function Rr(e,t){return JSON.stringify(e,mie,t?2:void 0)}function mie(e,t){return!gie(e)&&yo(t)?void 0:t}function gie(e){return!!/\d+$/.exec(e)}function yo(e){if(e==null)return!0;const t=typeof e;return t==="string"&&e===""||t==="object"&&Object.keys(e).length===0}function pm(e,t,r){return e===t||yo(e)&&yo(t)?!0:yo(e)||yo(t)?!1:Array.isArray(e)&&Array.isArray(t)?vie(e,t):Array.isArray(e)||Array.isArray(t)?!1:Gu(e)&&Gu(t)?yie(e,t,r):(Gu(e)||Gu(t),!1)}function vie(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!pm(e[r],t[r]))return!1;return!0}function yie(e,t,r){const n=new Set;Object.keys(e).forEach(o=>n.add(o)),Object.keys(t).forEach(o=>n.add(o)),r==="meta"&&(n.delete("versionId"),n.delete("lastUpdated"),n.delete("author"));for(const o of n){const i=e[o],a=t[o];if(!pm(i,a,o))return!1}return!0}function _a(e){return JSON.parse(JSON.stringify(e))}function j5(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function Gu(e){return e!==null&&typeof e=="object"}const C5=[];for(let e=0;e<256;e++)C5.push(e.toString(16).padStart(2,"0"));function xie(e){const t=new Uint8Array(e),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=C5[t[n]];return r.join("")}function wie(e){const t=new Uint8Array(e),r=[];for(let n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return window.btoa(r.join(""))}function lr(e){return e.charAt(0).toUpperCase()+e.substring(1)}function _ie(e,t){var r,n;return(n=(r=e.coding)==null?void 0:r.find(o=>o.system===t))==null?void 0:n.code}const wj=e=>new Promise(t=>{setTimeout(t,e)});function bie(e,t){const r=[];if(e.line&&r.push(...e.line),e.city||e.state||e.postalCode){const n=[];e.city&&n.push(e.city),e.state&&n.push(e.state),e.postalCode&&n.push(e.postalCode),r.push(n.join(", "))}return e.use&&(t!=null&&t.all||t!=null&&t.use)&&r.push("["+e.use+"]"),r.join((t==null?void 0:t.lineSeparator)??", ").trim()}function Mc(e,t){const r=[];return e.prefix&&(t==null?void 0:t.prefix)!==!1&&r.push(...e.prefix),e.given&&r.push(...e.given),e.family&&r.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&r.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&r.push("["+e.use+"]"),r.length===0&&e.text?e.text:r.join(" ").trim()}function hm(e){return e instanceof Date&&!isNaN(e.getTime())}function Sie(e,t,r){if(!e)return"";const n=new Date("2000-01-01T"+e+"Z");return hm(n)?n.toLocaleTimeString(t,r):""}function Tr(e,t,r){if(!e)return"";const n=new Date(e);return hm(n)?n.toLocaleString(t,r):""}function Pie(e,t,r){return!e||!e.start&&!e.end?"":Tr(e.start,t,r)+" - "+Tr(e.end,t,r)}const Oie={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},jie={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},Cie={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function E5(e){if(!e)return"";const t=[];return Eie(t,e.repeat),e.event&&t.push(e.event.map(r=>Tr(r)).join(", ")),lr(t.join(" ").trim())}function Eie(e,t){if(!(t!=null&&t.periodUnit))return;const r=t.frequency??1,n=t.period??1,o=t.periodUnit;r===1&&n===1?e.push(Oie[o]):(r===1?e.push("once"):e.push(r+" times"),n===1?e.push("per "+jie[o]):e.push("per "+n+" "+Cie[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(lr).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>Sie(i)).join(", "))}function cc(e,t,r=!1){if(r&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const n=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},o=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(n==null?void 0:n.value)===void 0&&(o==null?void 0:o.value)===void 0?"":(n==null?void 0:n.value)!==void 0&&(o==null?void 0:o.value)===void 0?r&&t!==void 0?(n.value=Rie(n.value,t),`> ${Zo(n,t)}`):`>= ${Zo(n,t)}`:(n==null?void 0:n.value)===void 0&&(o==null?void 0:o.value)!==void 0?r&&t!==void 0?(o.value=kie(o.value,t),`< ${Zo(o,t)}`):`<= ${Zo(o,t)}`:((n==null?void 0:n.unit)===(o==null?void 0:o.unit)&&(n==null||delete n.unit),`${Zo(n,t)} - ${Zo(o,t)}`)}function Zo(e,t){if(!e)return"";const r=[];return e.comparator&&(r.push(e.comparator),r.push(" ")),e.value!==void 0&&(t!==void 0?r.push(e.value.toFixed(t)):r.push(e.value)),e.unit&&(e.unit!=="%"&&r[r.length-1]!==" "&&r.push(" "),r.push(e.unit)),r.join("").trim()}function $ie(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Ps(e){return e?e.text?e.text:e.coding?e.coding.map(t=>ba(t)).join(", "):"":""}function ba(e){return(e==null?void 0:e.display)??(e==null?void 0:e.code)??""}function $5(e){return e?"component"in e?e.component.map(t=>$5(t)).join(" / "):e.valueQuantity?Zo(e.valueQuantity):e.valueCodeableConcept?Ps(e.valueCodeableConcept):e.valueString?e.valueString:"":""}function kie(e,t,r=1){return(k5(e,t)+r)*Math.pow(10,-t)}function Rie(e,t,r=1){return(k5(e,t)-r)*Math.pow(10,-t)}function k5(e,t){return t===void 0?e:Math.round(e*Math.pow(10,t))}function Tie(e){const t=e.max&&e.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:e.max;return{path:"",description:"",type:e.type??[],min:e.min??0,max:t??1,isArray:!!t&&t>1,constraints:[]}}function Iie(e){const t=Object.create(null);for(const[r,n]of Object.entries(e))t[r]={name:r,elements:Object.fromEntries(Object.entries(n.elements).map(([o,i])=>[o,Tie(i)])),constraints:[],innerTypes:[]};return t}const Die={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},Nie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},Aie={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"}]}}},Mie={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"}]}}},Lie={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"}]}}},zie={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"}]}}},Fie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},Vie={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"}]}}},Bie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},Uie={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"}]}}},Wie={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"}]}}},Hie={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"}]}}},Gie={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"}]}}},qie={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"}]}}},Qie={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"}]},maxDosePerLifetime:{type:[{code:"Quantity"}]}}},Kie={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"}]}}},Yie={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"}]}}},Xie={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"}]}}},Jie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"string"}]},"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"}]}}},Zie={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"}]}}},eae={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"]}]}}},tae={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"}]}}},rae={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"}]}}},nae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},oae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},iae={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"]}]}}},aae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},sae={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"}]}}},lae={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"}]}}},cae={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"}]}}},uae={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"}]}}},dae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity"}]},high:{type:[{code:"Quantity"}]}}},fae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},pae={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"}]}}},hae={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"]}]}}},mae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity"}]},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"}]}}},gae={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"}]}}},vae={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"}]}}},yae={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"}]}}},xae={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"}]}}},wae={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"]}]}}},_ae={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"}]}}},bae={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"}]}}},Sae={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"}]}}},Pae={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"}]}}},Oae={Element:Die,BackboneElement:Nie,Address:Aie,Age:Mie,Annotation:Lie,Attachment:zie,CodeableConcept:Fie,Coding:Vie,ContactDetail:Bie,ContactPoint:Uie,Contributor:Wie,Count:Hie,DataRequirement:Gie,Distance:qie,Dosage:Qie,Duration:Kie,ElementDefinition:Yie,Expression:Xie,Extension:Jie,HumanName:Zie,Identifier:eae,MarketingStatus:tae,Meta:rae,Money:nae,Narrative:oae,ParameterDefinition:iae,Period:aae,Population:sae,ProdCharacteristic:lae,ProductShelfLife:cae,Quantity:uae,Range:dae,Ratio:fae,Reference:pae,RelatedArtifact:hae,SampledData:mae,Signature:gae,SubstanceAmount:vae,Timing:yae,TriggerDefinition:xae,UsageContext:wae,MoneyQuantity:_ae,SimpleQuantity:bae,MetadataResource:Sae,IdentityProvider:Pae};function ve(e){return[{type:B.boolean,value:e}]}function ro(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:B.integer,value:e}:typeof e=="number"?{type:B.decimal,value:e}:typeof e=="boolean"?{type:B.boolean,value:e}:typeof e=="string"?{type:B.string,value:e}:ln(e)?{type:B.Quantity,value:e}:Fo(e)?{type:e.resourceType,value:e}:{type:B.BackboneElement,value:e}}function ai(e){return e.length===0?!1:!!e[0].value}function Ro(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 hr(e,t){if(!e.value)return;const r=Sa(e.type,t);return r?jae(e,t,r):Cae(e,t)}function jae(e,t,r){const n=r.type;if(!n||n.length===0)return;let o,i="undefined";if(n.length===1)o=e.value[t],i=n[0].code;else for(const l of n){const c=t.replace("[x]","")+lr(l.code);if(c in e.value){o=e.value[c],i=l.code;break}}const a=e.value["_"+t];if(a&&(Array.isArray(o)?o=o.map((l,c)=>a[c]?Pj(l??{},a[c]):l):o=Pj(o??{},a)),!yo(o))return(i==="Element"||i==="BackboneElement")&&(i=r.type[0].code),Array.isArray(o)?o.map(l=>_j(l,i)):_j(o,i)}function _j(e,t){return t==="Resource"&&Fo(e)&&(t=e.resourceType),{type:t,value:e}}function Cae(e,t){const r=e.value;if(!r||typeof r!="object")return;let n;if(t in r)n=r[t];else for(const o in B){const i=t+lr(o);if(i in r){n=r[i];break}}if(!yo(n))return Array.isArray(n)?n.map(ro):ro(n)}function R5(e){const t=[];for(const r of e){let n=!1;for(const o of t)if(ai(D5(r,o))){n=!0;break}n||t.push(r)}return t}function T5(e){return ve(!ai(e))}function I5(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?ve(!1):ve(e.every((r,n)=>ai(D5(r,t[n]))))}function D5(e,t){var o,i;const r=(o=e.value)==null?void 0:o.valueOf(),n=(i=t.value)==null?void 0:i.valueOf();return typeof r=="number"&&typeof n=="number"?ve(Math.abs(r-n)<1e-8):ln(r)&&ln(n)?ve(M5(r,n)):ve(typeof r=="object"&&typeof n=="object"?xx(e,t):r===n)}function N5(e,t){return e.length===0&&t.length===0?ve(!0):e.length!==t.length?ve(!1):(e.sort(bj),t.sort(bj),ve(e.every((r,n)=>ai(Eae(r,t[n])))))}function Eae(e,t){const{type:r,value:n}=e,{type:o,value:i}=t,a=n==null?void 0:n.valueOf(),l=i==null?void 0:i.valueOf();return typeof a=="number"&&typeof l=="number"?ve(Math.abs(a-l)<.01):ln(a)&&ln(l)?ve(M5(a,l)):ve(r==="Coding"&&o==="Coding"?typeof a!="object"||typeof l!="object"?!1:a.code===l.code&&a.system===l.system:typeof a=="object"&&typeof l=="object"?xx({...a,id:void 0},{...l,id:void 0}):typeof a=="string"&&typeof l=="string"?a.toLowerCase()===l.toLowerCase():a===l)}function bj(e,t){var o,i;const r=(o=e.value)==null?void 0:o.valueOf(),n=(i=t.value)==null?void 0:i.valueOf();return typeof r=="number"&&typeof n=="number"?r-n:typeof r=="string"&&typeof n=="string"?r.localeCompare(n):0}function A5(e,t){const{value:r}=e;if(r==null)return!1;switch(t){case"Boolean":return typeof r=="boolean";case"Decimal":case"Integer":return typeof r=="number";case"Date":return typeof r=="string"&&!!/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r);case"DateTime":return typeof r=="string"&&!!/^\d{4}(-\d{2}(-\d{2})?)?T/.exec(r);case"Time":return typeof r=="string"&&!!/^T\d/.exec(r);case"Period":return $ae(r);case"Quantity":return ln(r);default:return typeof r=="object"&&(r==null?void 0:r.resourceType)===t}}function $ae(e){return!!(e&&typeof e=="object"&&"start"in e)}function ln(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function M5(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 xx(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const o of r){const i=e[o],a=t[o];if(Sj(i)&&Sj(a)){if(!xx(i,a))return!1}else if(i!==a)return!1}return!0}function Sj(e){return e!==null&&typeof e=="object"}function Pj(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}const L5="ok",kae="created",Rae="gone",Tae="not-modified",Iae="not-found",Dae="forbidden",Nae="accepted",Aae={resourceType:"OperationOutcome",id:L5,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Mae={resourceType:"OperationOutcome",id:Iae,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},Lae={resourceType:"OperationOutcome",id:Dae,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Xi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},expression:t?[t]:void 0}]}}function Tt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function zae(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function mm(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function z5(e){return e.id===L5||e.id===kae||e.id===Tae||e.id===Nae}function Fae(e){return e.id===Rae}class Ie extends Error{constructor(t,r){super(F5(t)),this.outcome=t,this.cause=r}}function ct(e){return e instanceof Ie?e.outcome:mm(e)?e:Xi(Ee(e))}function Ee(e){return e?typeof e=="string"?e:e instanceof Error?e.message:mm(e)?F5(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function F5(e){var r;const t=((r=e.issue)==null?void 0:r.map(V5))??[];return t.length>0?t.join("; "):"Unknown error"}function V5(e){var r,n;let t;return(r=e.details)!=null&&r.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(n=e.expression)!=null&&n.length&&(t+=` (${e.expression.join(", ")})`),t}function Vae(e){return new Gae(e).parse()}const uc=Iie(Oae);function Bae(e){var r;const t=Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];for(const n of t)Uae(n)}function Uae(e){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=Vae(e);uc[e.name]=t;for(const r of t.innerTypes)r.parentType=t,uc[r.name]=r}function Wae(e){return!!uc[e]}function wx(e){return uc[e]}function Hae(e){const t=uc[e];if(!t)throw new Ie(zae(Error("Unknown data type: "+e)));return t}class Gae{constructor(t){var r;if(!((r=t.snapshot)!=null&&r.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,url:t.url,kind:t.kind,description:Kae(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var r,n,o,i,a;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((r=t.id)!=null&&r.includes(":")){if((n=this.slicingContext)!=null&&n.current){const l=Ag(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[Ag(t,c.path)]=l;break}c=c.parent}if(!c){const u=Ag(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((a=this.resourceSchema.mandatoryProperties)==null||a.add(u.replace("[x]",""))),this.resourceSchema.elements[u]=l}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,r){this.isInnerType(t)&&this.enterInnerType(t),t.slicing&&!this.slicingContext&&this.enterSlice(t,r)}enterInnerType(t){var r,n,o;for(;this.backboneContext&&!Na((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;this.backboneContext={type:{name:Cj(t),description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:Na((n=this.backboneContext)==null?void 0:n.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,r){var n,o,i,a;Qae(t)&&!((n=this.peek())!=null&&n.sliceName)||(r.slicing={discriminator:(((o=t.slicing)==null?void 0:o.discriminator)??[]).map(l=>{if(l.type!=="value"&&l.type!=="pattern"&&l.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${l.type}`);return{path:l.path,type:l.type}}),slices:[],ordered:((i=t.slicing)==null?void 0:i.ordered)??!1,rule:(a=t.slicing)==null?void 0:a.rules},this.slicingContext={field:r.slicing,path:t.path??""})}checkFieldExit(t=void 0){var r;if(this.backboneContext&&!Na(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&&!Na(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),delete this.backboneContext;this.slicingContext&&!Na(this.slicingContext.path,t==null?void 0:t.path)&&((r=this.slicingContext)!=null&&r.current&&this.slicingContext.field.slices.push(this.slicingContext.current),delete this.slicingContext)}next(){const t=this.peek();if(t)return this.index++,t}peek(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const r=this.elementIndex[t.contentReference.slice(t.contentReference.indexOf("#")+1)];return r?{...r,id:t.id,path:t.path,min:t.min??r.min,max:t.max??r.max,contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var n;const r=this.peek();return!!(Na(t==null?void 0:t.path,r==null?void 0:r.path)&&((n=t.type)!=null&&n.some(o=>["BackboneElement","Element"].includes(o.code))))}parseSliceStart(t){var r;if(!this.slicingContext)throw new Error("Invalid slice start before discriminator: "+t.sliceName);this.slicingContext.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext.current={name:t.sliceName??"",type:(r=t.type)==null?void 0:r.map(n=>({code:n.code??"",targetProfile:n.targetProfile})),elements:{},min:t.min??0,max:t.max==="*"?Number.POSITIVE_INFINITY:Number.parseInt(t.max,10)}}parseElementDefinition(t){var i,a;const r=Oj(t.max),n=(i=t.base)!=null&&i.max?Oj(t.base.max):r,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((a=t.base)==null?void 0:a.path)||"",min:t.min??0,max:r,isArray:n>1,constraints:(t.constraint??[]).map(l=>({key:l.key??"",severity:l.severity??"error",expression:l.expression??"",description:l.human??""})),type:(t.type??[]).map(l=>({code:["BackboneElement","Element"].includes(l.code)?Cj(t):l.code??"",targetProfile:l.targetProfile})),fixed:jj(hr(o,"fixed")),pattern:jj(hr(o,"pattern")),binding:t.binding}}}function Oj(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Ag(e,t=""){return qae(e.path,t)}function qae(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Na(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function jj(e){return Array.isArray(e)&&e.length>0?e[0]:yo(e)?void 0:e}function Qae(e){var r,n;const t=(r=e.slicing)==null?void 0:r.discriminator;return!!((n=e.type)!=null&&n.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function Kae(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}const B={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 Yae(e){for(const t of e.base??[]){let r=wi.types[t];r||(r={searchParamsDetails:{}},wi.types[t]=r),r.searchParams||(r.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"}}),r.searchParams[e.code]=e}}function Cj(e){var r,n,o,i;const t=(n=(r=e.type)==null?void 0:r[0])==null?void 0:n.code;return t==="BackboneElement"||t==="Element"?Xae((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function Xae(e){return e.length===1?e[0]:e.map(lr).join("")}function _x(e){var t;return(t=wi.types[e])==null?void 0:t.searchParams}function Jae(e,t){var r,n;return(n=(r=wi.types[e])==null?void 0:r.searchParams)==null?void 0:n[t]}function cy(e){return e.replaceAll("[x]","").split(".").pop().split(/(?=[A-Z])/).map(ese).join(" ").replace("_"," ").replace(/\s+/g," ")}const Zae=new Set(["ID","IP","PKCE","JWKS","URI","URL"]);function ese(e){const t=e.toUpperCase();return Zae.has(t)?t:t.charAt(0)+e.slice(1)}function Sa(e,t){const r=wx(e);if(r)return r.elements[t]??r.elements[t+"[x]"]}function Fo(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function Pa(e){return!!(e&&typeof e=="object"&&"reference"in e)}const wi={types:{}};function xd(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 dl=()=>[],_r={empty:(e,t)=>ve(t.length===0),exists:(e,t,r)=>ve(r?t.filter(n=>ai(r.eval(e,[n]))).length>0:t.length>0),all:(e,t,r)=>ve(t.every(n=>ai(r.eval(e,[n])))),allTrue:(e,t)=>{for(const r of t)if(!r.value)return ve(!1);return ve(!0)},anyTrue:(e,t)=>{for(const r of t)if(r.value)return ve(!0);return ve(!1)},allFalse:(e,t)=>{for(const r of t)if(r.value)return ve(!1);return ve(!0)},anyFalse:(e,t)=>{for(const r of t)if(!r.value)return ve(!0);return ve(!1)},subsetOf:dl,supersetOf:dl,count:(e,t)=>[{type:B.integer,value:t.length}],distinct:(e,t)=>{const r=[];for(const n of t)r.some(o=>o.value===n.value)||r.push(n);return r},isDistinct:(e,t)=>ve(t.length===_r.distinct(e,t).length),where:(e,t,r)=>t.filter(n=>ai(r.eval(e,[n]))),select:(e,t,r)=>t.map(n=>r.eval(e,[n])).flat(),repeat:dl,ofType:(e,t,r)=>t.filter(n=>n.type===r.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,r)=>{var o;const n=(o=r.eval(e,t)[0])==null?void 0:o.value;if(typeof n!="number")throw new Error("Expected a number for skip(num)");return n>=t.length?[]:n<=0?t:t.slice(n,t.length)},take:(e,t,r)=>{var o;const n=(o=r.eval(e,t)[0])==null?void 0:o.value;if(typeof n!="number")throw new Error("Expected a number for take(num)");return n>=t.length?t:n<=0?[]:t.slice(0,n)},intersect:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t),o=[];for(const i of t)!o.some(a=>a.value===i.value)&&n.some(a=>a.value===i.value)&&o.push(i);return o},exclude:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t),o=[];for(const i of t)n.some(a=>a.value===i.value)||o.push(i);return o},union:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t);return R5([...t,...n])},combine:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t);return[...t,...n]},htmlChecks:(e,t,r)=>[ro(!0)],iif:(e,t,r,n,o)=>{const i=r.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 ai(i)?n.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Wn(t,1);if(typeof r=="boolean")return[{type:B.boolean,value:r}];if(typeof r=="number"&&(r===0||r===1))return ve(!!r);if(typeof r=="string"){const n=r.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(n))return ve(!0);if(["false","f","no","n","0","0.0"].includes(n))return ve(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:ve(_r.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Wn(t,1);return typeof r=="number"?[{type:B.integer,value:r}]:typeof r=="string"&&/^[+-]?\d+$/.exec(r)?[{type:B.integer,value:parseInt(r,10)}]:typeof r=="boolean"?[{type:B.integer,value:r?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:ve(_r.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Wn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:B.date,value:xd(r)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:ve(_r.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Wn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:B.dateTime,value:xd(r)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:ve(_r.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Wn(t,1);return typeof r=="number"?[{type:B.decimal,value:r}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(r)?[{type:B.decimal,value:parseFloat(r)}]:typeof r=="boolean"?[{type:B.decimal,value:r?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:ve(_r.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Wn(t,1);return ln(r)?[{type:B.Quantity,value:r}]:typeof r=="number"?[{type:B.Quantity,value:{value:r,unit:"1"}}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(r)?[{type:B.Quantity,value:{value:parseFloat(r),unit:"1"}}]:typeof r=="boolean"?[{type:B.Quantity,value:{value:r?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:ve(_r.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Wn(t,1);return r==null?[]:ln(r)?[{type:B.string,value:`${r.value} '${r.unit}'`}]:[{type:B.string,value:r.toString()}]},convertsToString:(e,t)=>t.length===0?[]:ve(_r.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Wn(t,1);if(typeof r=="string"){const n=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(r);if(n)return[{type:B.time,value:xd("T"+n[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:ve(_r.toTime(e,t).length===1),indexOf:(e,t,r)=>Jr((n,o)=>n.indexOf(o),e,t,r),substring:(e,t,r,n)=>Jr((o,i,a)=>{const l=i,c=a?l+a:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,r,n),startsWith:(e,t,r)=>Jr((n,o)=>n.startsWith(o),e,t,r),endsWith:(e,t,r)=>Jr((n,o)=>n.endsWith(o),e,t,r),contains:(e,t,r)=>Jr((n,o)=>n.includes(o),e,t,r),upper:(e,t)=>Jr(r=>r.toUpperCase(),e,t),lower:(e,t)=>Jr(r=>r.toLowerCase(),e,t),replace:(e,t,r,n)=>Jr((o,i,a)=>o.replaceAll(i,a),e,t,r,n),matches:(e,t,r)=>Jr((n,o)=>!!new RegExp(o).exec(n),e,t,r),replaceMatches:(e,t,r,n)=>Jr((o,i,a)=>o.replaceAll(i,a),e,t,r,n),length:(e,t)=>Jr(r=>r.length,e,t),toChars:(e,t)=>Jr(r=>r?r.split(""):void 0,e,t),abs:(e,t)=>Vn(Math.abs,e,t),ceiling:(e,t)=>Vn(Math.ceil,e,t),exp:(e,t)=>Vn(Math.exp,e,t),floor:(e,t)=>Vn(Math.floor,e,t),ln:(e,t)=>Vn(Math.log,e,t),log:(e,t,r)=>Vn((n,o)=>Math.log(n)/Math.log(o),e,t,r),power:(e,t,r)=>Vn(Math.pow,e,t,r),round:(e,t)=>Vn(Math.round,e,t),sqrt:(e,t)=>Vn(Math.sqrt,e,t),truncate:(e,t)=>Vn(r=>r|0,e,t),children:dl,descendants:dl,trace:(e,t,r)=>(console.log("trace",t,r),t),now:()=>[{type:B.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:B.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:B.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,r,n,o)=>{var u;const i=_r.toDateTime(e,r.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const a=_r.toDateTime(e,n.eval(e,t));if(a.length===0)throw new Error("Invalid end date");const l=(u=o.eval(e,t)[0])==null?void 0:u.value;if(l!=="years"&&l!=="months"&&l!=="days")throw new Error("Invalid units");const c=O5(i[0].value,a[0].value);return[{type:B.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,r)=>{let n="";return r instanceof bx?n=r.name:r instanceof Px&&(n=r.left.name+"."+r.right.name),n?t.map(o=>({type:B.boolean,value:A5(o,n)})):[]},not:(e,t)=>_r.toBoolean(e,t).map(r=>({type:B.boolean,value:!r.value})),resolve:(e,t)=>t.map(r=>{const n=r.value;let o;if(typeof n=="string")o=n;else if(typeof n=="object"){const i=n;if(i.resource)return ro(i.resource);i.reference?o=i.reference:i.type&&i.identifier&&(o=`${i.type}?identifier=${i.identifier.system}|${i.identifier.value}`)}if(o!=null&&o.includes("?")){const[i]=o.split("?");return{type:i,value:{resourceType:i}}}if(o!=null&&o.includes("/")){const[i,a]=o.split("/");return{type:i,value:{resourceType:i,id:a}}}return{type:B.BackboneElement,value:void 0}}).filter(r=>!!r.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:r})=>typeof r=="boolean"?{type:B.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof r=="number"?{type:B.BackboneElement,value:{namespace:"System",name:"Integer"}}:Fo(r)?{type:B.BackboneElement,value:{namespace:"FHIR",name:r.resourceType}}:{type:B.BackboneElement,value:null}),conformsTo:(e,t,r)=>{const n=r.eval(e,t)[0].value;if(!n.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=n.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(i=>{var a;return{type:B.boolean,value:((a=i.value)==null?void 0:a.resourceType)===o}})}};function Jr(e,t,r,...n){if(r.length===0)return[];const[{value:o}]=Wn(r,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...n.map(a=>{var l;return(l=a==null?void 0:a.eval(t,r)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(ro):[ro(i)]}function Vn(e,t,r,...n){if(r.length===0)return[];const[{value:o}]=Wn(r,1),i=ln(o),a=i?o.value:o;if(typeof a!="number")throw new Error("Math function cannot be called with non-number");const l=e(a,...n.map(d=>{var p;return(p=d.eval(t,r)[0])==null?void 0:p.value})),c=i?B.Quantity:r[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function Wn(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const r of e)if(r==null)throw new Error("Expected non-null argument");return e}class tse{constructor(t,r){this.original=t,this.child=r}eval(t,r){try{return r.length>0?r.map(n=>this.child.eval(t,[n])).flat():this.child.eval(t,[])}catch(n){throw new Error(`FhirPathError on "${this.original}": ${n}`)}}toString(){return this.child.toString()}}class Aa{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class bx{constructor(t){this.name=t}eval(t,r){if(this.name==="$this")return r;if(this.name.startsWith("%")){const n=t.variables[this.name.slice(1)];if(!n)throw new Error(`Undefined variable ${this.name}`);return[n]}return r.flatMap(n=>this.evalValue(n)).filter(n=>(n==null?void 0:n.value)!==void 0)}evalValue(t){const r=t.value;if(!(!r||typeof r!="object"))return Fo(r)&&r.resourceType===this.name?t:hr(t,this.name)}toString(){return this.name}}class rse{eval(){return[]}toString(){return"{}"}}class nse extends sie{constructor(t,r,n){super(t,r),this.impl=n}eval(t,r){return this.impl(this.child.eval(t,r))}toString(){return this.operator+this.child.toString()}}class Sx extends Ac{constructor(t,r){super("as",t,r)}eval(t,r){return _r.ofType(t,this.left.eval(t,r),this.right)}}class Nr extends Ac{}class gn extends Nr{constructor(t,r,n,o){super(t,r,n),this.impl=o}eval(t,r){const n=this.left.eval(t,r);if(n.length!==1)return[];const o=this.right.eval(t,r);if(o.length!==1)return[];const i=n[0].value,a=o[0].value,l=ln(i)?i.value:i,c=ln(a)?a.value:a,u=this.impl(l,c);return typeof u=="boolean"?ve(u):ln(i)?[{type:B.Quantity,value:{...i,value:u}}]:[ro(u)]}}class ose extends Ac{constructor(t,r){super("&",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r),i=[...n,...o];return i.length>0&&i.every(a=>typeof a.value=="string")?[{type:B.string,value:i.map(a=>a.value).join("")}]:i}}class ise extends Nr{constructor(t,r){super("contains",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return ve(n.some(i=>i.value===o[0].value))}}class ase extends Nr{constructor(t,r){super("in",t,r)}eval(t,r){const n=Ro(this.left.eval(t,r)),o=this.right.eval(t,r);return n?ve(o.some(i=>i.value===n.value)):[]}}class Px extends Ac{constructor(t,r){super(".",t,r)}eval(t,r){return this.right.eval(t,this.left.eval(t,r))}toString(){return`${this.left.toString()}.${this.right.toString()}`}}class B5 extends Ac{constructor(t,r){super("|",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return R5([...n,...o])}}class sse extends Nr{constructor(t,r){super("=",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return I5(n,o)}}class lse extends Nr{constructor(t,r){super("!=",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return T5(I5(n,o))}}class cse extends Nr{constructor(t,r){super("~",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return N5(n,o)}}class use extends Nr{constructor(t,r){super("!~",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return T5(N5(n,o))}}class Ox extends Nr{constructor(t,r){super("is",t,r)}eval(t,r){const n=this.left.eval(t,r);if(n.length!==1)return[];const o=this.right.name;return ve(A5(n[0],o))}}class dse extends Nr{constructor(t,r){super("and",t,r)}eval(t,r){const n=Ro(this.left.eval(t,r),"boolean"),o=Ro(this.right.eval(t,r),"boolean");return(n==null?void 0:n.value)===!0&&(o==null?void 0:o.value)===!0?ve(!0):(n==null?void 0:n.value)===!1||(o==null?void 0:o.value)===!1?ve(!1):[]}}class fse extends Nr{constructor(t,r){super("or",t,r)}eval(t,r){const n=Ro(this.left.eval(t,r),"boolean"),o=Ro(this.right.eval(t,r),"boolean");return(n==null?void 0:n.value)===!1&&(o==null?void 0:o.value)===!1?ve(!1):n!=null&&n.value||o!=null&&o.value?ve(!0):[]}}class pse extends Nr{constructor(t,r){super("xor",t,r)}eval(t,r){const n=Ro(this.left.eval(t,r),"boolean"),o=Ro(this.right.eval(t,r),"boolean");return!n||!o?[]:ve(n.value!==o.value)}}class hse extends Nr{constructor(t,r){super("implies",t,r)}eval(t,r){const n=Ro(this.left.eval(t,r),"boolean"),o=Ro(this.right.eval(t,r),"boolean");return(o==null?void 0:o.value)===!0||(n==null?void 0:n.value)===!1?ve(!0):!n||!o?[]:ve(!1)}}class jx{constructor(t,r){this.name=t,this.args=r}eval(t,r){const n=_r[this.name];if(!n)throw new Error("Unrecognized function: "+this.name);return n(t,r,...this.args)}toString(){return`${this.name}(${this.args.map(t=>t.toString()).join(", ")})`}}class Cx{constructor(t,r){this.left=t,this.expr=r}eval(t,r){const n=this.expr.eval(t,r);if(n.length!==1)return[];const o=n[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const i=this.left.eval(t,r);return o in i?[i[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const mse=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class gse{constructor(t,r,n,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=r,this.operators=n,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 r=this.peek();return t==="/"&&r==="*"?this.consumeMultiLineComment():t==="/"&&r==="/"?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(r)?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()!==`
|
|
88
|
-
`))}consumeString(t){this.advance();const r=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t));return this.advance(),r}consumeBacktickSymbol(){this.advance();const t=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),t}consumeDateTime(){this.advance();const t=this.pos.index;return this.consumeWhile(()=>/[\d-]/.exec(this.curr())),this.curr()==="T"&&(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"?this.advance():(this.curr()==="+"||this.curr()==="-")&&(this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.buildToken("DateTime",this.str.substring(t,this.pos.index))}consumeNumber(){const t=this.pos.index;let r="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()===" "&&vse(this.peekToken())&&(r="Quantity",this.consumeToken()),this.buildToken(r,this.str.substring(t,this.pos.index)))}consumeSymbol(){var r;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((r=this.prevToken())==null?void 0:r.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),r=this.peek(),n=t+r;return this.operators.includes(n)?(this.advance(),this.advance(),this.buildToken(n,n)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const r=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(r,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()===`
|
|
89
|
-
`?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,r){const n=this.markStack.pop();if(!n)throw new Error("No mark for token");return{id:t,value:r,...n}}}function vse(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&mse.includes(e.value)))}const yse=["true","false"],xse=["!=","!~","<=",">=","{}","->"];function wse(e){return new gse(e,yse,xse).tokenize()}const We={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},_se={parse(e){var r;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((r=e.peek())==null?void 0:r.value)+"`");return t}},bse={parse(e,t){const r=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new Cx(t,r)},precedence:We.Indexer},Sse={parse(e,t){if(!(t instanceof bx))throw new Error("Unexpected parentheses");const r=[];for(;!e.match(")");)r.push(e.consumeAndParse()),e.match(",");return new jx(t.name,r)},precedence:We.FunctionCall};function Pse(e){const t=e.split(" "),r=parseFloat(t[0]);let n=t[1];return n!=null&&n.startsWith("'")&&n.endsWith("'")?n=n.substring(1,n.length-1):n="{"+n+"}",{value:r,unit:n}}function Ose(){return new lie().registerPrefix("String",{parse:(e,t)=>new Aa({type:B.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Aa({type:B.dateTime,value:xd(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Aa({type:B.Quantity,value:Pse(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Aa({type:B.decimal,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Aa({type:B.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Aa({type:B.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new bx(t.value)}).registerPrefix("{}",{parse:()=>new rse}).registerPrefix("(",_se).registerInfix("[",bse).registerInfix("(",Sse).prefix("+",We.UnaryAdd,(e,t)=>new nse("+",t,r=>r)).prefix("-",We.UnarySubtract,(e,t)=>new gn("-",t,t,(r,n)=>-n)).infixLeft(".",We.Dot,(e,t,r)=>new Px(e,r)).infixLeft("/",We.Divide,(e,t,r)=>new gn("/",e,r,(n,o)=>n/o)).infixLeft("*",We.Multiply,(e,t,r)=>new gn("*",e,r,(n,o)=>n*o)).infixLeft("+",We.Add,(e,t,r)=>new gn("+",e,r,(n,o)=>n+o)).infixLeft("-",We.Subtract,(e,t,r)=>new gn("-",e,r,(n,o)=>n-o)).infixLeft("|",We.Union,(e,t,r)=>new B5(e,r)).infixLeft("=",We.Equals,(e,t,r)=>new sse(e,r)).infixLeft("!=",We.NotEquals,(e,t,r)=>new lse(e,r)).infixLeft("~",We.Equivalent,(e,t,r)=>new cse(e,r)).infixLeft("!~",We.NotEquivalent,(e,t,r)=>new use(e,r)).infixLeft("<",We.LessThan,(e,t,r)=>new gn("<",e,r,(n,o)=>n<o)).infixLeft("<=",We.LessThanOrEquals,(e,t,r)=>new gn("<=",e,r,(n,o)=>n<=o)).infixLeft(">",We.GreaterThan,(e,t,r)=>new gn(">",e,r,(n,o)=>n>o)).infixLeft(">=",We.GreaterThanOrEquals,(e,t,r)=>new gn(">=",e,r,(n,o)=>n>=o)).infixLeft("&",We.Ampersand,(e,t,r)=>new ose(e,r)).infixLeft("and",We.And,(e,t,r)=>new dse(e,r)).infixLeft("as",We.As,(e,t,r)=>new Sx(e,r)).infixLeft("contains",We.Contains,(e,t,r)=>new ise(e,r)).infixLeft("div",We.Divide,(e,t,r)=>new gn("div",e,r,(n,o)=>n/o|0)).infixLeft("in",We.In,(e,t,r)=>new ase(e,r)).infixLeft("is",We.Is,(e,t,r)=>new Ox(e,r)).infixLeft("mod",We.Modulo,(e,t,r)=>new gn("mod",e,r,(n,o)=>n%o)).infixLeft("or",We.Or,(e,t,r)=>new fse(e,r)).infixLeft("xor",We.Xor,(e,t,r)=>new pse(e,r)).infixLeft("implies",We.Implies,(e,t,r)=>new hse(e,r))}const jse=Ose();function U5(e){return new tse(e,jse.construct(wse(e)).consumeAndParse())}function Cse(e,t){const r=Array.isArray(t)?t:[t];for(let n=0;n<r.length;n++){const o=r[n];typeof o=="object"&&"type"in o&&"value"in o||(r[n]=ro(r[n]))}return dc(e,r).map(n=>n.value)}function dc(e,t,r){const n=r??{};return U5(e).eval({variables:n},t).map(i=>{var a;return{type:i.type,value:(a=i.value)==null?void 0:a.valueOf()}})}var ei=(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))(ei||{});function gm(e,t){var n,o;let r=(o=(n=wi.types[e])==null?void 0:n.searchParamsDetails)==null?void 0:o[t.code];return r||(r=$se(e,t)),r}function Ese(e,t,r){const n=wi.types[e];n.searchParamsDetails||(n.searchParamsDetails={}),n.searchParamsDetails[t]=r}function $se(e,t){const r=t.code,n=Tse(r),o=Dse(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=Ml(l);c.length===1&&c[0]instanceof Nr?i.propertyTypes.add("boolean"):W5(i,Ml(l),e,1)}const a={columnName:n,type:Ise(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return Ese(e,r,a),a}function W5(e,t,r,n){const o=t[n];if(o instanceof Sx){e.propertyTypes.add(o.right.toString());return}if(o instanceof jx){kse(e,o);return}const i=o.toString(),a=Sa(r,i);if(!a)throw new Error(`Element definition not found for ${r} ${i}`);let l=!1,c=n+1;if(c<t.length&&t[c]instanceof Cx&&(l=!0,c++),a.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(a);for(const u of a.type)e.propertyTypes.add(u.code);return}for(const u of a.type){let d=u.code;Rse(d)&&(d=a.type[0].code),W5(e,t,d,c)}}function kse(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 Ox){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function Rse(e){return e==="Element"||e==="BackboneElement"}function Tse(e){return e.split("-").reduce((t,r,n)=>t+(n?lr(r):r),"")}function Ise(e,t){switch(e.type){case"date":return t.size===1&&t.has(B.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(B.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(B.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function Dse(e,t){const r=[],n=U5(t);return uy(e,n.child,r),r}function uy(e,t,r){t instanceof B5?(uy(e,t.left,r),uy(e,t.right,r)):t.toString().startsWith(e+".")&&r.push(t)}function Ml(e){if(e instanceof Sx||e instanceof Cx)return[Ml(e.left),e].flat();if(e instanceof Nr)return[e];if(e instanceof Px)return[Ml(e.left),Ml(e.right)].flat();if(e instanceof jx){if(e.name==="where"&&!(e.args[0]instanceof Ox))return[];if(e.name==="last")return[]}return[e]}const Lc=20;var te=(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))(te||{});const H5={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"},Ex={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function Nse(e){let t;for(const r of e.pathname.split("/"))r&&(t=r);return Mse(t,e.searchParams.entries())}function Ase(e){return Nse(new URL(e,"https://example.com/"))}function Mse(e,t){const r={resourceType:e};for(const[n,o]of t)Lse(r,n,o);return r}function Lse(e,t,r){var a,l;let n,o;const i=t.indexOf(":");if(i>=0?(n=t.substring(0,i),o=t.substring(i+1)):(n=t,o=""),n==="_has"||t.includes(".")){Mg(e,{code:t,operator:"eq",value:r});return}switch(n){case"_sort":zse(e,r);break;case"_count":e.count=parseInt(r,10);break;case"_offset":e.offset=parseInt(r,10);break;case"_total":e.total=r;break;case"_summary":r==="count"?(e.total="accurate",e.count=0):(r==="true"||r==="data"||r==="text")&&(e.summary=r);break;case"_include":{const c=Ej(r);o==="iterate"&&(c.modifier="iterate"),e.include?e.include.push(c):e.include=[c];break}case"_revinclude":{const c=Ej(r);o==="iterate"&&(c.modifier="iterate"),e.revInclude?e.revInclude.push(c):e.revInclude=[c];break}case"_fields":case"_elements":e.fields=r.split(",");break;default:{const c=(l=(a=wi.types[e.resourceType])==null?void 0:a.searchParams)==null?void 0:l[n];c?Mg(e,Fse(c,o,r)):Mg(e,Use(n,o,r))}}}function zse(e,t){for(const r of t.split(",")){let n,o=!1;r.startsWith("-")?(n=r.substring(1),o=!0):n=r,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:n,descending:o})}}function Fse(e,t,r){if(t==="missing")return{code:e.code,operator:"missing",value:r};switch(e.type){case"number":case"date":case"quantity":return Vse(e,r);case"reference":case"string":case"token":case"uri":return Bse(e,t,r);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function Vse(e,t){const{operator:r,value:n}=Wse(t);return{code:e.code,operator:r,value:n}}function Bse(e,t,r){return{code:e.code,operator:Hse(t),value:r}}function Use(e,t,r){var o;let n="eq";if(t)n=t;else if(r.length>=2){const i=r.substring(0,2);i in Ex&&(r.length===2||(o=r.at(2))!=null&&o.match(/\d/))&&(n=i,r=r.substring(i.length))}return{code:e,operator:n,value:r}}function Wse(e){const t=e.substring(0,2),r=Ex[t];return r?{operator:r,value:e.substring(2)}:{operator:"eq",value:e}}function Hse(e){return H5[e]??"eq"}function Ej(e){const t=e.split(":");if(t.includes("*"))throw new Ie(Xi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new Ie(Xi(`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 Ie(Xi(`Invalid include value '${e}'`))}function Mg(e,t){e.filters?e.filters.push(t):e.filters=[t]}function Za(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(r=>t.push(Gse(r))),e.sortRules&&e.sortRules.length>0&&t.push(qse(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(r=>t.push($j("_include",r))),e.revInclude&&e.revInclude.forEach(r=>t.push($j("_revinclude",r))),t.length===0?"":(t.sort((r,n)=>r.localeCompare(n)),"?"+t.join("&"))}function Gse(e){const t=e.operator in H5?":"+e.operator:"",r=e.operator!=="eq"&&e.operator in Ex?e.operator:"";return`${e.code}${t}=${r}${encodeURIComponent(e.value)}`}function qse(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function $j(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Qse(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 Kse(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 kj(){const e=new Uint32Array(28);return crypto.getRandomValues(e),xie(e.buffer)}async function Yse(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function G5(){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 q5(e){var o,i,a;const t={};e=_a(e);for(const l of e.entry||[]){(o=l.resource)==null||delete o.meta;const c=(i=l.resource)==null?void 0:i.id;c&&(t[c]=G5(),l.fullUrl="urn:uuid:"+t[c],(a=l.resource)==null||delete a.id)}const r=e.entry,n=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:r==null?void 0:r.map(l=>({fullUrl:l.fullUrl,request:{method:"POST",url:l.resource.resourceType},resource:l.resource}))},(l,c)=>Xse(l,c,t),2);return Jse(JSON.parse(n))}function Xse(e,t,r){if(e==="reference"&&typeof t=="string"){let n;if(t.includes("/")?n=t.split("/")[1]:t.startsWith("urn:uuid:")?n=t.slice(9):t.startsWith("#")&&(n=t.slice(1)),n){const o=r[n];if(o)return"urn:uuid:"+o}}return t}function Jse(e){const t=ele(e),{sorted:r,cycles:n}=Zse(t),o={};for(const a of e.entry||[])a.fullUrl&&(o[a.fullUrl]=a);const i=r.map(a=>o[a]);for(const a of n)for(const l of a){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function Zse(e){const t=[],r={},n=[];for(const i of Object.keys(e))r[i]=0;function o(i,a){if(r[i]===2)return!0;if(r[i]===1){const c=a.lastIndexOf(i);return c!==-1&&n.push(a.slice(c)),!0}r[i]=1,a.push(i);let l=!1;for(const c of e[i])o(c,a)||(l=!0);return r[i]=2,a.pop(),t.unshift(i),!l}for(const i in e)r[i]===0&&o(i,[]);return{sorted:t,cycles:n}}function Q5(e,t){for(const r in e)if(e[r]&&typeof e[r]=="object"){const n=e[r];if(Pa(n)){const o=n.reference;o.startsWith("urn:uuid:")&&t(o)}else Q5(n,t)}}function ele(e){const t={};for(const r of e.entry||[])r.fullUrl&&(t[r.fullUrl]=[]);for(const r of e.entry||[]){const n=r.fullUrl;r.resource&&Q5(r.resource,o=>{t[o]&&t[o].push(n)})}return t}class tle{constructor(t=10){this.max=t,this.cache=new Map}clear(){this.cache.clear()}get(t){const r=this.cache.get(t);return r&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){this.cache.has(t)?this.cache.delete(t):this.cache.size>=this.max&&this.cache.delete(this.first()),this.cache.set(t,r)}delete(t){this.cache.delete(t)}keys(){return this.cache.keys()}first(){return this.cache.keys().next().value}}const Kt={CSS:"text/css",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",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript"};class K5{constructor(){this.listeners={}}addEventListener(t,r){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(r)}removeEventListener(t,r){const n=this.listeners[t];if(n){for(let o=0;o<n.length;o++)if(n[o]===r){n.splice(o,1);return}}}dispatchEvent(t){const r=this.listeners[t.type];if(r)for(const n of r)n.call(this,t);return!t.defaultPrevented}}class rle{constructor(){this.emitter=new K5}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,r){this.emitter.addEventListener(t,r)}removeEventListener(t,r){this.emitter.removeEventListener(t,r)}}const dy={"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"},nle=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],$x=["DiagnosticReport-update"];function ole(e){return $x.includes(e)}function ile(e){if($x.includes(e))throw new Ie(Tt(`'context.version' is required for '${e}'.`))}const ale={"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 sle(e){return nle.includes(e)}function Y5(e){return!!e.endpoint}function Rj(e){if(!kx(e))throw new Ie(Tt("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:r,topic:n,events:o}=e,i={"hub.channel.type":t,"hub.mode":r,"hub.topic":n,"hub.events":o.join(",")};return Y5(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function kx(e){if(typeof e!="object")return!1;const{channelType:t,mode:r,topic:n,events:o}=e;if(!(t&&r&&n&&o)||typeof n!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||r!=="subscribe"&&r!=="unsubscribe")return!1;for(const i of o)if(!dy[i])return!1;return!(Y5(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function Tj(e,t,r,n){if(typeof t!="object")throw new Ie(Tt(`context[${r}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new Ie(Tt(`context[${r}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new Ie(Tt(`context[${r}] is invalid. Resource must contain a resource type. No resource type found.`));const o=n.resourceType;if(o!=="*"){if(!sle(t.resourceType))throw new Ie(Tt(`context[${r}] 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 Ie(Tt(`context[${r}] is invalid. context[${r}] for the '${e}' event should contain resource of type ${o}.`))}}function lle(e,t,r,n,o){if(o.set(t.key,(o.get(t.key)??0)+1),!n.isArray)Tj(e,t.resource,r,n);else{const{resources:i}=t;if(!i)throw new Ie(Tt(`context[${r}] is invalid. context[${r}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(const a of i)Tj(e,a,r,n)}}function cle(e,t){const r=new Map,n=ale[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!n[i])throw new Ie(Tt(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));lle(e,t[o],o,n[i],r)}for(const[o,i]of Object.entries(n)){if(!(i.optional||r.has(o)))throw new Ie(Tt(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(r.get(o)||0)>1)throw new Ie(Tt(`${r.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function Ij(e,t,r,n){if(!(e&&typeof e=="string"))throw new Ie(Tt("Must provide a topic."));if(!dy[t])throw new Ie(Tt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(dy).join(", ")}`));if(typeof r!="object")throw new Ie(Tt("context must be a context object or array of context objects."));if($x.includes(t)&&!n)throw new Ie(Tt(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(r)?r:[r];return cle(t,o),{timestamp:new Date().toISOString(),id:G5(),event:{"hub.topic":e,"hub.event":t,context:o,...n?{"context.versionId":n}:{}}}}class ule extends rle{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new Ie(Tt("Subscription request should contain an endpoint."));if(!kx(t))throw new Ie(Tt("Subscription request failed validation."));const r=new WebSocket(t.endpoint);r.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),r.addEventListener("message",n=>{const o=JSON.parse(n.data);if(o["hub.topic"])return;const i=o;this.dispatchEvent({type:"message",payload:i}),r.send(JSON.stringify({id:o==null?void 0:o.id,timestamp:new Date().toISOString()}))}),r.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=r}disconnect(){this.websocket.close()}}function dle(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=Qse(t),n=Array.from(r).reduce((i,a)=>{const l=("00"+a.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(n);return JSON.parse(o)}function fle(e){return e.split(".").length===3}function X5(e){const[t,r,n]=e.split(".");return dle(r)}function ple(e){try{return typeof X5(e).login_id=="string"}catch{return!1}}var J5;class fo{constructor(t){this[J5]="ReadablePromise",this.status="pending",this.suspender=t.then(r=>(this.status="success",this.response=r,r),r=>{throw this.status="error",this.error=r,r})}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,r){return this.suspender.then(t,r)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}J5=Symbol.toStringTag;class hle{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new mle)}clear(){this.storage.clear()}getString(t){return this.storage.getItem(t)??void 0}setString(t,r){r?this.storage.setItem(t,r):this.storage.removeItem(t)}getObject(t){const r=this.getString(t);return r?JSON.parse(r):void 0}setObject(t,r){this.setString(t,r?Rr(r):void 0)}}class mle{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,r){r?this.data.set(t,r):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}const gle="2.1.20-f56586d6",vle=Kt.FHIR_JSON+", */*; q=0.1",yle="https://api.medplum.com/",xle=1e3,wle=6e4,Dj="Binary/",Nj={resourceType:"Device",id:"system",deviceName:[{name:"System"}]};class _le extends K5{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");if(this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??ble(),this.storage=(t==null?void 0:t.storage)??new hle,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=Mj((t==null?void 0:t.baseUrl)??yle),this.fhirBaseUrl=Mj(qu(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4/")),this.authorizeUrl=qu(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=qu(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=qu(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)??wle,this.cacheTime>0?this.requestCache=new tle((t==null?void 0:t.resourceCacheSize)??xle):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.initPromise=Promise.resolve();else if(this.storage.getInitPromise!==void 0){const r=this.storage.getInitPromise(),n=new Promise(o=>{r.then(()=>{this.attemptResumeActiveLogin().then(o).catch(console.error),this.initComplete=!0}).catch(console.error)});this.initPromise=n,this.initComplete=!1}else this.initPromise=this.attemptResumeActiveLogin().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(),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.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){var r;t=t.toString(),(r=this.requestCache)==null||r.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const r=this.fhirBaseUrl+t;if(this.requestCache)for(const n of this.requestCache.keys())(n.endsWith(r)||n.includes(r+"?"))&&this.requestCache.delete(n)}get(t,r={}){t=t.toString();const n=this.getCacheEntry(t,r);if(n)return n.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue?o=new Promise((a,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:r,resolve:a,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,r);const i=new fo(o);return this.setCacheEntry(t,i),i}post(t,r,n,o={}){return t=t.toString(),this.setRequestBody(o,r),n&&this.setRequestContentType(o,n),this.invalidateUrl(t),this.request("POST",t,o)}put(t,r,n,o={}){return t=t.toString(),this.setRequestBody(o,r),n&&this.setRequestContentType(o,n),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,r,n={}){return t=t.toString(),this.setRequestBody(n,r),this.setRequestContentType(n,Kt.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,n)}delete(t,r){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,r)}async startNewUser(t,r){const{codeChallengeMethod:n,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:n,codeChallenge:o},void 0,r)}async startNewProject(t,r){return this.post("auth/newproject",t,void 0,r)}async startNewPatient(t,r){return this.post("auth/newpatient",t,void 0,r)}async startLogin(t,r){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,r)}async startGoogleLogin(t,r){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,r)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const n=new URLSearchParams(window.location.search).get("code");if(n)return this.processCode(n);await this.requestAuthorization(t)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,r,n,o,i=!0){let a=o;i&&(a=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,r,n,a,i))}async exchangeExternalAccessToken(t,r){if(r=r??this.clientId,!r)throw new Error("MedplumClient is missing clientId");const n=new URLSearchParams;return n.set("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),n.set("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),n.set("client_id",r),n.set("subject_token",t),this.fetchTokens(n)}getExternalAuthRedirectUri(t,r,n,o,i=!0){const a=new URL(t);if(a.searchParams.set("response_type","code"),a.searchParams.set("client_id",r),a.searchParams.set("redirect_uri",n),a.searchParams.set("scope","openid profile email"),a.searchParams.set("state",JSON.stringify(o)),i){const{codeChallenge:l,codeChallengeMethod:c}=o;if(!c)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!l)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");a.searchParams.set("code_challenge_method",c),a.searchParams.set("code_challenge",l)}return a.toString()}fhirUrl(...t){return new URL(t.join("/"),this.fhirBaseUrl)}fhirSearchUrl(t,r){const n=this.fhirUrl(t);return r&&(n.search=new URLSearchParams(r).toString()),n}search(t,r,n){const o=this.fhirSearchUrl(t,r),i=o.toString()+"-search",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new fo((async()=>{const c=await this.get(o,n);if(c.entry)for(const u of c.entry)this.cacheResource(u.resource);return c})());return this.setCacheEntry(i,l),l}searchOne(t,r,n){const o=this.fhirSearchUrl(t,r);o.searchParams.set("_count","1"),o.searchParams.sort();const i=o.toString()+"-searchOne",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new fo(this.search(t,o.searchParams,n).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,r,n){const i=this.fhirSearchUrl(t,r).toString()+"-searchResources",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new fo(this.search(t,r,n).then(zj));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,r,n){var i,a;let o=this.fhirSearchUrl(t,r);for(;o;){const l=new URL(o).searchParams,c=await this.search(t,l,n),u=(i=c.link)==null?void 0:i.find(d=>d.relation==="next");if(!((a=c.entry)!=null&&a.length)&&!u)break;yield zj(c),o=u!=null&&u.url?new URL(u.url):void 0}}searchValueSet(t,r,n){const o=this.fhirUrl("ValueSet","$expand");return o.searchParams.set("url",t),o.searchParams.set("filter",r),this.get(o.toString(),n)}getCached(t,r){var o,i;const n=(i=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,r).toString()))==null?void 0:i.value;return n!=null&&n.isOk()?n.read():void 0}getCachedReference(t){const r=t.reference;if(!r)return;if(r==="system")return Nj;const[n,o]=r.split("/");if(!(!n||!o))return this.getCached(n,o)}readResource(t,r,n){return this.get(this.fhirUrl(t,r),n)}readReference(t,r){const n=t.reference;if(!n)return new fo(Promise.reject(new Error("Missing reference")));if(n==="system")return new fo(Promise.resolve(Nj));const[o,i]=n.split("/");return!o||!i?new fo(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,r)}requestSchema(t){if(Wae(t))return Promise.resolve();const r=t+"-requestSchema",n=this.getCacheEntry(r,void 0);if(n)return n.value;const o=new fo((async()=>{const i=`{
|
|
90
|
-
StructureDefinitionList(name: "${t}") {
|
|
91
|
-
resourceType,
|
|
92
|
-
name,
|
|
93
|
-
kind,
|
|
94
|
-
description,
|
|
95
|
-
snapshot {
|
|
96
|
-
element {
|
|
97
|
-
id,
|
|
98
|
-
path,
|
|
99
|
-
definition,
|
|
100
|
-
min,
|
|
101
|
-
max,
|
|
102
|
-
base {
|
|
103
|
-
path,
|
|
104
|
-
min,
|
|
105
|
-
max
|
|
106
|
-
},
|
|
107
|
-
contentReference,
|
|
108
|
-
type {
|
|
109
|
-
code,
|
|
110
|
-
targetProfile
|
|
111
|
-
},
|
|
112
|
-
binding {
|
|
113
|
-
strength,
|
|
114
|
-
valueSet
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
SearchParameterList(base: "${t}", _count: 100) {
|
|
120
|
-
base,
|
|
121
|
-
code,
|
|
122
|
-
type,
|
|
123
|
-
expression,
|
|
124
|
-
target
|
|
125
|
-
}
|
|
126
|
-
}`.replace(/\s+/g," "),a=await this.graphql(i);Bae(a.data.StructureDefinitionList);for(const l of a.data.SearchParameterList)Yae(l)})());return this.setCacheEntry(r,o),o}readHistory(t,r,n){return this.get(this.fhirUrl(t,r,"_history"),n)}readVersion(t,r,n,o){return this.get(this.fhirUrl(t,r,"_history",n),o)}readPatientEverything(t,r){return this.get(this.fhirUrl("Patient",t,"$everything"),r)}createResource(t,r){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,r)}async createResourceIfNoneExist(t,r,n){return await this.searchOne(t.resourceType,r,n)??this.createResource(t,n)}async createAttachment(t,r,n,o){const i=await this.createBinary(t,r,n,o);return{contentType:n,url:i.url,title:r}}createBinary(t,r,n,o){const i=this.fhirUrl("Binary");return r&&i.searchParams.set("_filename",r),o?this.uploadwithProgress(i,t,n,o):this.post(i,t,n)}uploadwithProgress(t,r,n,o){return new Promise((i,a)=>{const l=new XMLHttpRequest;l.responseType="json",l.onabort=()=>a(new Error("Request aborted")),l.onerror=()=>a(new Error("Request error")),o&&(l.upload.onprogress=c=>o(c),l.upload.onload=c=>o(c)),l.onload=()=>{l.status>=200&&l.status<300?i(l.response):a(new Ie(ct(l.response||l.statusText)))},l.open("POST",t),l.withCredentials=!0,l.setRequestHeader("Authorization","Bearer "+this.accessToken),l.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),l.setRequestHeader("Content-Type",n),l.setRequestHeader("X-Medplum","extended"),l.send(r)})}async createPdf(t,r,n,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=await this.createPdfImpl(t,n,o);return this.createBinary(i,r,"application/pdf")}createComment(t,r,n){const o=this.getProfile();let i,a;return t.resourceType==="Encounter"&&(i=dt(t),a=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,a=t.subject),t.resourceType==="Patient"&&(a=dt(t)),this.createResource({resourceType:"Communication",basedOn:[dt(t)],encounter:i,subject:a,sender:o?dt(o):void 0,sent:new Date().toISOString(),payload:[{contentString:r}]},n)}async updateResource(t,r){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let n=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,r);return n||(n=t),this.cacheResource(n),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),n}patchResource(t,r,n,o){return this.invalidateSearches(t),this.patch(this.fhirUrl(t,r),n,o)}deleteResource(t,r,n){return this.deleteCacheEntry(this.fhirUrl(t,r).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,r),n)}validateResource(t,r){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,r)}executeBot(t,r,n,o){let i;if(typeof t=="string"){const a=t;i=this.fhirUrl("Bot",a,"$execute")}else{const a=t;i=this.fhirUrl("Bot","$execute")+`?identifier=${a.system}|${a.value}`}return this.post(i,r,n,o)}executeBatch(t,r){return this.post(this.fhirBaseUrl.slice(0,-1),t,void 0,r)}sendEmail(t,r){return this.post("email/v1/send",t,Kt.JSON,r)}graphql(t,r,n,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:r,variables:n},Kt.JSON,o)}readResourceGraph(t,r,n,o){return this.get(`${this.fhirUrl(t,r)}/$graph?graph=${n}`,o)}pushToAgent(t,r,n,o,i){return this.post(this.fhirUrl("Agent",vx(t),"$push"),{destination:et(r),body:n,contentType:o},Kt.FHIR_JSON,i)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var r,n;(!((r=this.sessionDetails)!=null&&r.profile)||et(this.sessionDetails.profile)!==((n=t.profile)==null?void 0:n.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,r){this.accessToken=t,this.refreshToken=r,this.sessionDetails=void 0,this.medplumServer=ple(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const r=this.getLogins().filter(n=>{var o,i;return((o=n.profile)==null?void 0:o.reference)!==((i=t.profile)==null?void 0:i.reference)});r.push(t),this.storage.setObject("logins",r)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,r)=>{this.get("auth/me").then(n=>{var i,a;this.profilePromise=void 0;const o=((a=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:a.id)!==n.profile.id;this.sessionDetails=n,o&&this.dispatchEvent({type:"change"}),t(n.profile)}).catch(r)}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!!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,r={}){this.refreshPromise&&await this.refreshPromise;const n=t.toString();return n.startsWith(Dj)&&(t=this.fhirUrl(n)),this.addFetchOptionsDefaults(r),(await this.fetchWithRetry(t.toString(),r)).blob()}async uploadMedia(t,r,n,o,i){const a=await this.createBinary(t,n,r);return this.createResource({resourceType:"Media",status:"completed",content:{contentType:r,url:Dj+a.id,title:n},...o},i)}async bulkExport(t="",r,n,o){const i=t&&`${t}/`,a=this.fhirUrl(`${i}$export`);return r&&a.searchParams.set("_type",r),n&&a.searchParams.set("_since",n),this.startAsyncRequest(a.toString(),o)}async startAsyncRequest(t,r={}){this.addFetchOptionsDefaults(r);const n=r.headers;n.Prefer="respond-async";const o=await this.fetchWithRetry(t,r);if(o.status===202){const i=await Lj(o);if(i)return this.pollStatus(i)}return this.parseResponse(o,"POST",t)}getCacheEntry(t,r){if(!this.requestCache||(r==null?void 0:r.cache)==="no-cache"||(r==null?void 0:r.cache)==="reload")return;const n=this.requestCache.get(t);if(!(!n||n.requestTime+this.cacheTime<Date.now()))return n}setCacheEntry(t,r){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:r})}cacheResource(t){var r,n;t!=null&&t.id&&!((n=(r=t.meta)==null?void 0:r.tag)!=null&&n.some(o=>o.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new fo(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,r,n={}){this.refreshPromise&&await this.refreshPromise,n.method=t,this.addFetchOptionsDefaults(n);const o=await this.fetchWithRetry(r,n);return this.parseResponse(o,t,r,n)}async parseResponse(t,r,n,o={}){if(t.status===401)return this.handleUnauthenticated(r,n,o);if(t.status===204||t.status===304)return;const i=t.headers.get("content-type"),a=i==null?void 0:i.includes("json");if(t.status===404&&!a)throw new Ie(Mae);const l=t.headers.get("content-location"),c=o.redirect??this.options.redirect;if(t.status===201&&l&&c==="follow")return this.request("GET",l,{...o,body:void 0});let u;if(a)try{u=await t.json()}catch(d){throw console.error("Error parsing response",t.status,d),d}else u=await t.text();if(t.status>=400)throw new Ie(ct(u));return u}async fetchWithRetry(t,r){t.startsWith("http")||(t=new URL(t,this.baseUrl).href);const n=3,o=200;let i;for(let a=0;a<n;a++){try{if(this.options.verbose&&this.logRequest(t,r),i=await this.fetch(t,r),this.options.verbose&&this.logResponse(i),i.status<500)return i}catch(l){this.retryCatch(a,n,l)}await wj(o)}return i}logRequest(t,r){if(console.log(`> ${r.method} ${t}`),r.headers){const n=r.headers,o=Object.entries(n).sort((i,a)=>i[0].localeCompare(a[0]));for(const[i,a]of o)console.log(`> ${i}: ${a}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((r,n)=>console.log(`< ${n}: ${r}`))}async pollStatus(t){let r=!0,n;const o=2e3;for(;r;){const i={};this.addFetchOptionsDefaults(i);const a=await this.fetchWithRetry(t,i);if(a.status!==202&&(r=!1,n=a,a.status===201)){const l=await Lj(a);l&&(n=await this.fetchWithRetry(l,i))}await wj(o)}return this.parseResponse(n,"POST",t)}async executeAutoBatch(){var o,i;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const a=t[0];try{a.resolve(await this.request(a.method,this.fhirBaseUrl+a.url,a.options))}catch(l){a.reject(new Ie(ct(l)))}return}const r={resourceType:"Bundle",type:"batch",entry:t.map(a=>({request:{method:a.method,url:a.url},resource:a.options.body?JSON.parse(a.options.body):void 0}))},n=await this.post(this.fhirBaseUrl.slice(0,-1),r);for(let a=0;a<t.length;a++){const l=t[a],c=(o=n.entry)==null?void 0:o[a];(i=c==null?void 0:c.response)!=null&&i.outcome&&!z5(c.response.outcome)?l.reject(new Ie(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){let r=t.headers;r||(r={},t.headers=r),r.Accept||(r.Accept=vle),r["X-Medplum"]="extended",t.body&&!r["Content-Type"]&&(r["Content-Type"]=Kt.FHIR_JSON),this.accessToken?r.Authorization="Bearer "+this.accessToken:this.basicAuth&&(r.Authorization="Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,r){t.headers||(t.headers={});const n=t.headers;n["Content-Type"]=r}setRequestBody(t,r){typeof r=="string"||typeof Blob<"u"&&r instanceof Blob||typeof File<"u"&&r instanceof File||typeof Uint8Array<"u"&&r instanceof Uint8Array?t.body=r:r&&(t.body=JSON.stringify(r))}handleUnauthenticated(t,r,n){return this.refresh()?this.request(t,r,n):(this.clearActiveLogin(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new Error("Unauthenticated")))}async startPkce(){const t=kj();sessionStorage.setItem("pkceState",t);const r=kj();sessionStorage.setItem("codeVerifier",r);const n=await Yse(r),o=wie(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",o),{codeChallengeMethod:"S256",codeChallenge:o}}async requestAuthorization(t){const r=await this.ensureCodeChallenge(t??{}),n=new URL(this.authorizeUrl);n.searchParams.set("response_type","code"),n.searchParams.set("state",sessionStorage.getItem("pkceState")),n.searchParams.set("client_id",r.clientId??this.clientId),n.searchParams.set("redirect_uri",r.redirectUri??Aj()),n.searchParams.set("code_challenge_method",r.codeChallengeMethod),n.searchParams.set("code_challenge",r.codeChallenge),n.searchParams.set("scope",r.scope??"openid profile"),window.location.assign(n.toString())}processCode(t,r){const n=new URLSearchParams;if(n.set("grant_type","authorization_code"),n.set("code",t),n.set("client_id",(r==null?void 0:r.clientId)??this.clientId),n.set("redirect_uri",(r==null?void 0:r.redirectUri)??Aj()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&n.set("code_verifier",o)}return this.fetchTokens(n)}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,r){this.clientId=t,this.clientSecret=r;const n=new URLSearchParams;return n.set("grant_type","client_credentials"),n.set("client_id",t),n.set("client_secret",r),this.fetchTokens(n)}async startJwtBearerLogin(t,r,n){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",r),o.set("scope",n),this.fetchTokens(o)}async startJwtAssertionLogin(t){const r=new URLSearchParams;return r.append("grant_type","client_credentials"),r.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),r.append("client_assertion",t),this.fetchTokens(r)}setBasicAuth(t,r){this.clientId=t,this.clientSecret=r,this.basicAuth=Kse(t+":"+r)}async fhircastSubscribe(t,r){if(!(typeof t=="string"&&t!==""))throw new Ie(Tt("Invalid topic provided. Topic must be a valid string."));if(!(typeof r=="object"&&Array.isArray(r)&&r.length>0))throw new Ie(Tt("Invalid events provided. Events must be an array of event names containing at least one event."));const n={channelType:"websocket",mode:"subscribe",topic:t,events:r},i=(await this.post("/fhircast/STU3",Rj(n),Kt.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return n.endpoint=i,n}async fhircastUnsubscribe(t){if(!kx(t))throw new Ie(Tt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new Ie(Tt("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",Rj(t),Kt.FORM_URL_ENCODED)}fhircastConnect(t){return new ule(t)}async fhircastPublish(t,r,n,o){return ole(r)?this.post(`/fhircast/STU3/${t}`,Ij(t,r,n,o),Kt.JSON):(ile(r),this.post(`/fhircast/STU3/${t}`,Ij(t,r,n),Kt.JSON))}async fhircastGetContext(t){return this.get(`/fhircast/STU3/${t}`)}async invite(t,r){return this.post("admin/projects/"+t+"/invite",r)}async fetchTokens(t){const r={method:"POST",headers:{"Content-Type":Kt.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},n=r.headers;this.basicAuth&&(n.Authorization=`Basic ${this.basicAuth}`);const o=await this.fetchWithRetry(this.tokenUrl,r);if(!o.ok){this.clearActiveLogin();try{const a=await o.json();throw new Ie(Xi(a.error_description))}catch(a){throw new Ie(Xi("Failed to fetch tokens"),a)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const r=t.access_token;if(fle(r)){const n=X5(r);if(Date.now()>=n.exp*1e3)throw this.clearActiveLogin(),new Error("Token expired");if(n.cid){if(n.cid!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}else if(this.clientId&&n.client_id!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}return this.setActiveLogin({accessToken:r,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,r,n){if(n.message==="Failed to fetch"&&t===1&&this.dispatchEvent({type:"offline"}),t>=r-1)throw n}}function ble(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function Aj(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}function Mj(e){return e.endsWith("/")?e:e+"/"}function qu(e,t){return new URL(t,e).toString()}async function Lj(e){var o,i;const t=e.headers.get("content-location");if(t)return t;const r=e.headers.get("location");if(r)return r;const n=await e.json();if(mm(n)&&((i=(o=n.issue)==null?void 0:o[0])!=null&&i.diagnostics))return n.issue[0].diagnostics}function zj(e){var r;const t=((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];return Object.assign(t,{bundle:e})}var Z5=f.createContext(void 0);function vm(){return f.useContext(Z5)}function ae(){return vm().medplum}function ym(){return vm().navigate}function Rx(){return vm().profile}function Sle(e){let t=e.medplum,r=e.navigate??Ple,[n,o]=f.useState({profile:t.getProfile(),loading:!t.isInitialized});f.useEffect(()=>{t&&(t.isInitialized||(o(a=>({...a,loading:!0})),t.getInitPromise().then(()=>o(a=>({...a,loading:!1}))).catch(console.error)))},[t,t.isInitialized]),f.useEffect(()=>{function a(){o({...n,profile:t.getProfile()})}return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[t,n]);let i=f.useMemo(()=>({...n,medplum:t,navigate:r}),[n,t,r]);return s.jsx(Z5.Provider,{value:i,children:e.children})}function Ple(e){window.location.assign(e)}function Ke(e,t){let r=ae(),[n,o]=f.useState(Fj(r,e)),i=f.useCallback(a=>{pm(a,n)||o(a)},[n,o]);return f.useEffect(()=>{i(Fj(r,e))},[r,e,i]),f.useEffect(()=>{let a=!0;return Pa(e)&&r.readReference(e).then(l=>{a&&i(l)}).catch(l=>{a&&(i(void 0),t&&t(ct(l)))}),()=>a=!1},[r,n,e,i,t]),n}function Fj(e,t){if(t){if(Fo(t))return t;if(Pa(t))return e.getCachedReference(t)}}function Ole(e,t){return e4("searchOne",e,t)}function Os(e,t){return e4("searchResources",e,t)}function e4(e,t,r){let n=ae(),[o,i]=f.useState(),[a,l]=f.useState(!1),[c,u]=f.useState(),[d,p]=f.useState();return f.useEffect(()=>{let h=n.fhirSearchUrl(t,r).toString();h!==o&&(i(h),n[e](t,r).then(m=>{l(!1),u(m),p(Aae)}).catch(m=>{l(!1),u(void 0),p(ct(m))}))},[n,e,t,r,o,u]),[c,a,d]}function jle(e){const t=e.value;return t?s.jsx(s.Fragment,{children:bie(t)}):null}function Vj(e,t){return e.line&&e.line.length>t?e.line[t]:""}function Bj(e,t,r){const n=e.line||[];for(;n.length<=t;)n.push("");return n[t]=r,{...e,line:n}}function Cle(e){const[t,r]=f.useState(e.defaultValue||{}),n=f.useRef();n.current=t;function o(h){r(h),e.onChange&&e.onChange(h)}function i(h){o({...n.current,use:h})}function a(h){o({...n.current,type:h})}function l(h){o(Bj(n.current||{},0,h))}function c(h){o(Bj(n.current||{},1,h))}function u(h){o({...n.current,city:h})}function d(h){o({...n.current,state:h})}function p(h){o({...n.current,postalCode:h})}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>i(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(ft,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>a(h.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(le,{placeholder:"Line 1",defaultValue:Vj(t,0),onChange:h=>l(h.currentTarget.value)}),s.jsx(le,{placeholder:"Line 2",defaultValue:Vj(t,1),onChange:h=>c(h.currentTarget.value)}),s.jsx(le,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),s.jsx(le,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),s.jsx(le,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>p(h.currentTarget.value)})]})}function Ele(e){const t=Rx(),[r,n]=f.useState(e.defaultValue||{}),o=f.useRef();o.current=r;function i(a){const l=a?{text:a,authorReference:t&&dt(t),time:new Date().toISOString()}:{};n(l),e.onChange&&e.onChange(l)}return s.jsx(le,{name:e.name,placeholder:"Annotation text",defaultValue:r.text,onChange:a=>i(a.currentTarget.value)})}var $le={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"},kle=Object.defineProperty,Rle=Object.defineProperties,Tle=Object.getOwnPropertyDescriptors,ch=Object.getOwnPropertySymbols,t4=Object.prototype.hasOwnProperty,r4=Object.prototype.propertyIsEnumerable,Uj=(e,t,r)=>t in e?kle(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wj=(e,t)=>{for(var r in t||(t={}))t4.call(t,r)&&Uj(e,r,t[r]);if(ch)for(var r of ch(t))r4.call(t,r)&&Uj(e,r,t[r]);return e},Ile=(e,t)=>Rle(e,Tle(t)),Dle=(e,t)=>{var r={};for(var n in e)t4.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ch)for(var n of ch(e))t.indexOf(n)<0&&r4.call(e,n)&&(r[n]=e[n]);return r},ue=(e,t,r)=>{const n=f.forwardRef((o,i)=>{var a=o,{color:l="currentColor",size:c=24,stroke:u=2,children:d}=a,p=Dle(a,["color","size","stroke","children"]);return f.createElement("svg",Wj(Ile(Wj({ref:i},$le),{width:c,height:c,stroke:l,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),p),[...r.map(([h,m])=>f.createElement(h,m)),...d||[]])});return n.propTypes={color:Te.string,size:Te.oneOfType([Te.string,Te.number]),stroke:Te.oneOfType([Te.string,Te.number])},n.displayName=`${t}`,n},Nle=ue("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"}]]),xm=ue("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"}]]),Ale=ue("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"}]]),Mle=ue("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"}]]),Lle=ue("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"}]]),zle=ue("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"}]]),Fle=ue("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"}]]),Vle=ue("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"}]]),Ble=ue("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"}]]),Ule=ue("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"}]]),Wle=ue("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"}]]),Hle=ue("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"}]]),Ai=ue("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"}]]),wm=ue("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),Gle=ue("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"}]]),qle=ue("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),uh=ue("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"}]]),Tx=ue("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"}]]),Ix=ue("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"}]]),Qle=ue("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"}]]),Kle=ue("copy","IconCopy",[["path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2",key:"svg-1"}]]),Yle=ue("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"}]]),Xle=ue("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"}]]),Jle=ue("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"}]]),Zle=ue("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"}]]),_m=ue("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"}]]),bm=ue("equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]),Hj=ue("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"}]]),ece=ue("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"}]]),tce=ue("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"}]]),rce=ue("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"}]]),nce=ue("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"}]]),oce=ue("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"}]]),ice=ue("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"}]]),ace=ue("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"}]]),sce=ue("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"}]]),n4=ue("math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]),o4=ue("math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]),lce=ue("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"}]]),cce=ue("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"}]]),uce=ue("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"}]]),dce=ue("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"}]]),fce=ue("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"}]]),pce=ue("player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]),hce=ue("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),mce=ue("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"}]]),gce=ue("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"}]]),vce=ue("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"}]]),yce=ue("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"}]]),fy=ue("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"}]]),Dx=ue("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"}]]),Nx=ue("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"}]]),xce=ue("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"}]]),wce=ue("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"}]]),_ce=ue("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"}]]),bce=ue("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"}]]),i4=ue("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"}]]),Gj=ue("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"}]]),Sce=ue("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"}]]),dh=ue("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);class a4 extends f.Component{constructor(t){super(t),this.state={}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error("Uncaught error:",t,r)}render(){return this.state.error?s.jsx(Cc,{icon:s.jsx(xm,{size:16}),title:"Something went wrong",color:"red",children:Ee(this.state.error)}):this.props.children}}function En(){return s.jsx(ir,{style:{width:"100%",height:"100vh"},children:s.jsx(dn,{})})}function Ax(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Mc(t,e.options)}):null}function st(e){e.preventDefault(),e.stopPropagation()}function s4(e){if(qj(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&qj(t[0]))return!0}return!1}function qj(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function ke(e){const t=ym(),{to:r,suffix:n,label:o,onClick:i,children:a,...l}=e;let c=Pce(r);return n&&(c+="/"+n),s.jsx(Le,{href:c,"aria-label":o,onClick:u=>{st(u),i?i(u):r&&t(c)},...l,children:a})}function Pce(e){if(e){if(typeof e=="string")return Oce(e);if(Fo(e))return jce(e);if(Pa(e))return Cce(e)}return"#"}function Oce(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function jce(e){return`/${e.resourceType}/${e.id}`}function Cce(e){return`/${e.reference}`}function _i(e){const t=Ke(e.value),r=t?ko(t):e.alt??"",n=(t&&pie(t))??e.src,o=e.radius??"xl",i={...e};return delete i.value,delete i.link,e.link?s.jsx(ke,{to:t,children:s.jsx(Nf,{src:n,alt:r,radius:o,...i})}):s.jsx(Nf,{src:n,alt:r,radius:o,...i})}function Mx(e){const{defaultValue:t,toKey:r,toOption:n,loadOptions:o,onChange:i,onCreate:a,creatable:l,...c}=e,u=Ece(t),d=f.useRef(null),[p,h]=f.useState(),[m,v]=f.useState(),[g,b]=f.useState(),[y,x]=f.useState(),[_,w]=f.useState(u.map(n)),[j,C]=f.useState([]),P=f.useRef();P.current=p;const E=f.useRef();E.current=m;const k=f.useRef();k.current=g;const $=f.useRef();$.current=y;const I=f.useRef();I.current=j;const T=f.useCallback(()=>{var V;v(void 0);const R=((V=d.current)==null?void 0:V.value.trim())||"";if(R===P.current)return;h(R);const N=new AbortController;b(N),o(R,N.signal).then(Q=>{N.signal.aborted||(C(Q.map(n)),b(void 0),$.current&&(Q.length>0&&i(Q.slice(0,1)),x(!1)))}).catch(Q=>{N.signal.aborted||Q.message.includes("aborted")||me({color:"red",message:Ee(Q)})})},[o,i,n]),z=f.useCallback(()=>{k.current&&(k.current.abort(),b(void 0)),E.current!==void 0&&window.clearTimeout(E.current);const R=window.setTimeout(()=>T(),100);v(R)},[T]),M=f.useCallback(R=>{var Q;const N=[],V=[];for(const ee of R){let _e=(Q=I.current)==null?void 0:Q.find(Ue=>Ue.value===ee),we=_e==null?void 0:_e.resource;!we&&l!==!1&&a&&(we=a(ee),_e=n(we)),we&&N.push(we),_e&&V.push(_e)}i(N),w(V)},[l,i,a,n]),L=f.useCallback(R=>{R.key==="Enter"&&(!E.current&&!k.current?(st(R),I.current&&I.current.length>0&&(C(I.current.slice(0,1)),M([I.current[0].value]))):x(!0))},[M]),q=f.useCallback(R=>{const N=n(a(R));return C([...I.current,N]),N},[a,C,n]),Y=f.useCallback((R,N)=>!N,[]);return f.useEffect(()=>()=>{k.current&&k.current.abort()},[]),s.jsx(sm,{...c,ref:d,defaultValue:u.map(r),searchable:!0,onKeyDown:L,onSearchChange:z,data:[..._,...j],onFocus:T,onChange:M,onCreate:q,rightSectionWidth:40,rightSection:g?s.jsx(dn,{size:16}):null,filter:Y,creatable:!0,withinPortal:!0})}function Ece(e){return e?Array.isArray(e)?e:[e]:[]}const $ce=W(()=>({searchInput:{input:{width:220,transition:"width 0.2s"},"input:focus":{width:400},"@media (max-width: 800px)":{input:{width:150},"input:focus":{width:150}}}}));function kce(e){return e.id}function Rce(e){return{value:e.id,label:ko(e),resource:e}}function Tce(e){const{classes:t}=$ce(),r=ym(),n=ae(),o=f.useCallback(async(a,l)=>{const c=Dce(a),u={signal:l},d=await n.graphql(c,void 0,void 0,u);return Nce(d,a)},[n]),i=f.useCallback(a=>{a.length>0&&r(`/${et(a[0])}`)},[r]);return s.jsx(Mx,{size:"sm",radius:"md",className:t.searchInput,icon:s.jsx(yce,{size:16}),placeholder:"Search",itemComponent:Ice,toKey:kce,toOption:Rce,onChange:i,loadOptions:o,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const Ice=f.forwardRef(({resource:e,...t},r)=>{var o;let n;return e.resourceType==="Patient"?n=e.birthDate:e.resourceType==="ServiceRequest"&&(n=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...t,children:s.jsxs(K,{noWrap:!0,children:[s.jsx(_i,{value:e}),s.jsxs("div",{children:[s.jsx(re,{children:ko(e)}),s.jsx(re,{size:"xs",color:"dimmed",children:n})]})]})})});function Dce(e){const t=JSON.stringify(e);return j5(e)?`{
|
|
127
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
128
|
-
resourceType
|
|
129
|
-
id
|
|
130
|
-
identifier {
|
|
131
|
-
system
|
|
132
|
-
value
|
|
133
|
-
}
|
|
134
|
-
name {
|
|
135
|
-
given
|
|
136
|
-
family
|
|
137
|
-
}
|
|
138
|
-
birthDate
|
|
139
|
-
}
|
|
140
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
141
|
-
resourceType
|
|
142
|
-
id
|
|
143
|
-
identifier {
|
|
144
|
-
system
|
|
145
|
-
value
|
|
146
|
-
}
|
|
147
|
-
subject {
|
|
148
|
-
display
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}`.replace(/\s+/g," "):`{
|
|
152
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
153
|
-
resourceType
|
|
154
|
-
id
|
|
155
|
-
identifier {
|
|
156
|
-
system
|
|
157
|
-
value
|
|
158
|
-
}
|
|
159
|
-
name {
|
|
160
|
-
given
|
|
161
|
-
family
|
|
162
|
-
}
|
|
163
|
-
birthDate
|
|
164
|
-
}
|
|
165
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
166
|
-
resourceType
|
|
167
|
-
id
|
|
168
|
-
identifier {
|
|
169
|
-
system
|
|
170
|
-
value
|
|
171
|
-
}
|
|
172
|
-
name {
|
|
173
|
-
given
|
|
174
|
-
family
|
|
175
|
-
}
|
|
176
|
-
birthDate
|
|
177
|
-
}
|
|
178
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
179
|
-
resourceType
|
|
180
|
-
id
|
|
181
|
-
identifier {
|
|
182
|
-
system
|
|
183
|
-
value
|
|
184
|
-
}
|
|
185
|
-
subject {
|
|
186
|
-
display
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}`.replace(/\s+/g," ")}function Nce(e,t){const r=[];return e.data.Patients1&&r.push(...e.data.Patients1),e.data.Patients2&&r.push(...e.data.Patients2),e.data.ServiceRequestList&&r.push(...e.data.ServiceRequestList),Mce(Ace(r),t).slice(0,5)}function Ace(e){const t=new Set,r=[];for(const n of e)t.has(n.id)||(t.add(n.id),r.push(n));return r}function Mce(e,t){return e.sort((r,n)=>Qj(n,t)-Qj(r,t))}function Qj(e,t){let r=0;if(e.identifier)for(const n of e.identifier)r=Math.max(r,Kj(n.value,t));if(e.resourceType==="Patient"&&e.name)for(const n of e.name)r=Math.max(r,Kj(Mc(n),t));return r}function Kj(e,t){if(!e)return 0;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?0:100-r}const Lce=W(e=>({logoButton:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},user:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},userName:{fontWeight:500,lineHeight:1,marginRight:3,[e.fn.smallerThan("xs")]:{display:"none"}},userActive:{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}}));function zce(e){var d,p,h,m;const t=vm(),{medplum:r,profile:n,navigate:o}=t,i=r.getLogins(),{classes:a,cx:l}=Lce(),[c,u]=f.useState(!1);return s.jsx(Wk,{height:60,p:8,style:{zIndex:101},children:s.jsxs(K,{position:"apart",children:[s.jsxs(K,{spacing:"xs",children:[s.jsx(So,{className:a.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(Tce,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(X,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:c,onClose:()=>u(!1),children:[s.jsx(X.Target,{children:s.jsx(So,{className:l(a.user,{[a.userActive]:c}),onClick:()=>u(v=>!v),children:s.jsxs(K,{spacing:7,children:[s.jsx(_i,{value:n,radius:"xl",size:24}),s.jsx(re,{size:"sm",className:a.userName,children:Mc((d=n==null?void 0:n.name)==null?void 0:d[0])}),s.jsx(qle,{size:12,stroke:1.5})]})})}),s.jsxs(X.Dropdown,{children:[s.jsxs(je,{align:"center",p:"xl",children:[s.jsx(_i,{size:"xl",radius:100,value:t.profile}),s.jsx(Ax,{value:(h=(p=t.profile)==null?void 0:p.name)==null?void 0:h[0]}),s.jsx(re,{color:"dimmed",size:"xs",children:(m=r.getActiveLogin())==null?void 0:m.project.display})]}),i.length>1&&s.jsx(X.Divider,{}),i.map(v=>v.profile.reference!==et(t.profile)&&s.jsx(X.Item,{onClick:()=>{r.setActiveLogin(v).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(K,{children:[s.jsx(Nf,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(re,{size:"sm",weight:500,children:v.profile.display}),s.jsx(re,{color:"dimmed",size:"xs",children:v.project.display})]})]})},v.profile.reference)),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(_ce,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(X.Item,{icon:s.jsx(fy,{size:14,stroke:1.5}),onClick:()=>o(`/${et(n)}`),children:"Account settings"}),s.jsx(X.Item,{icon:s.jsx(sce,{size:14,stroke:1.5}),onClick:async()=>{await r.signOut(),o("/signin")},children:"Sign out"}),s.jsx(re,{size:"xs",color:"dimmed",align:"center",children:e.version})]})]})]})})}function Fce(e){const t={};for(const r of Array.from(e.elements))r instanceof HTMLInputElement?Vce(t,r):r instanceof HTMLTextAreaElement?t[r.name]=r.value:r instanceof HTMLSelectElement&&Bce(t,r);return t}function Vce(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function Bce(e,t){e[t.name]=t.value}function De(e){return s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const r=Fce(t.target);e.onSubmit&&e.onSubmit(r)},children:e.children})}function Uce(e){const t=ae(),r=t.getUserConfiguration();function n(o){var d,p;const{menuname:i,bookmarkname:a}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=_a(r),u=(d=c.menu)==null?void 0:d.find(({title:h})=>h===i);(p=u==null?void 0:u.link)==null||p.push({name:a,target:l}),t.updateResource(c).then(h=>{r.menu=h.menu,t.dispatchEvent({type:"change"}),me({color:"green",message:"Success"}),e.onOk()}).catch(h=>{me({color:"red",message:Ee(h)})})}return s.jsx(Dr,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(De,{onSubmit:n,children:s.jsxs(je,{children:[s.jsx(Wce,{config:r}),s.jsx(le,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(K,{position:"right",children:s.jsx(ne,{mt:"sm",type:"submit",children:"OK"})})]})})})}function Wce(e){function t(n){var o;return(o=n==null?void 0:n.menu)==null?void 0:o.map(i=>i.title)}const r=t(e.config);return s.jsx(ft,{name:"menuname",defaultValue:r[0],label:"Select Menu Option",placeholder:"Menu",data:r,withAsterisk:!0})}function Lx(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function Hce(e){return typeof e.display=="string"?e.display:Lx(e)}function Gce(e){return{value:Lx(e),label:Hce(e),resource:e}}function qce(e){return{code:e,display:e}}function zx(e){const t=ae(),{binding:r,creatable:n,clearable:o,...i}=e,a=f.useCallback(async(l,c)=>{var h;if(!r)return[];const d=(h=(await t.searchValueSet(r,l,{signal:c})).expansion)==null?void 0:h.contains,p=[];for(const m of d)m.code&&!p.some(v=>v.code===m.code)&&p.push(m);return p},[t,r]);return s.jsx(Mx,{...i,creatable:n??!0,clearable:o??!0,toKey:Lx,toOption:Gce,loadOptions:a,onCreate:qce,getCreateLabel:n===!1?void 0:l=>`+ Create ${l}`})}function l4(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=o[0],a=Kce(i);r(a),e.onChange&&e.onChange(a)}return s.jsx(zx,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:Qce(t),onChange:n,creatable:e.creatable,maxSelectedValues:e.maxSelectedValues??1,clearSearchOnChange:e.clearSearchOnChange,clearable:e.clearable})}function Qce(e){return e?{code:e}:void 0}function Kce(e){return e==null?void 0:e.code}function Fx(e){const[t,r]=f.useState(e.defaultValue),n=e.onChange,o=f.useCallback(i=>{r(i),n&&n(i)},[n]);return s.jsx(l4,{"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,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1})}const c4=W(e=>({menuTitle:{margin:"20px 0 4px 6px",fontSize:"9px",fontWeight:"normal",textTransform:"uppercase",letterSpacing:"2px"},link:{...e.fn.focusStyles(),display:"flex",alignItems:"center",textDecoration:"none",fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],padding:"8px 12px",borderRadius:e.radius.sm,fontWeight:500,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],color:e.colorScheme==="dark"?e.white:e.black,textDecoration:"none","& svg":{color:e.colorScheme==="dark"?e.white:e.black}},"& svg":{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],marginRight:e.spacing.sm,strokeWidth:1.5,width:18,height:18}},linkActive:{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:e.primaryColor}).background,color:e.fn.variant({variant:"light",color:e.primaryColor}).color,"& svg":{color:e.fn.variant({variant:"light",color:e.primaryColor}).color}}}}));function Yce(e){var c;const{classes:t}=c4(),r=ym(),n=Zce(e.pathname,e.searchParams,e.menus),[o,i]=f.useState(!1);function a(u,d){u.stopPropagation(),u.preventDefault(),r(d),window.innerWidth<768&&e.closeNavbar()}function l(u){u&&r(`/${u}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Nl,{width:{sm:250},p:"xs",children:s.jsxs(ma,{children:[!e.resourceTypeSearchDisabled&&s.jsx(Nl.Section,{mb:"sm",children:s.jsx(Fx,{name:"resourceType",placeholder:"Resource Type",onChange:u=>l(u)},window.location.pathname)}),s.jsxs(Nl.Section,{grow:!0,children:[(c=e.menus)==null?void 0:c.map(u=>{var d;return s.jsxs(f.Fragment,{children:[s.jsx(re,{className:t.menuTitle,children:u.title}),(d=u.links)==null?void 0:d.map(p=>s.jsxs(Xce,{to:p.href,active:p.href===(n==null?void 0:n.href),onClick:h=>a(h,p.href),children:[s.jsx(Jce,{to:p.href,icon:p.icon}),s.jsx("span",{children:p.label})]},p.href))]},`menu-${u.title}`)}),e.displayAddBookmark&&s.jsx(ne,{variant:"subtle",size:"xs",mt:"xl",leftIcon:s.jsx(hce,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(Uce,{pathname:e.pathname,searchParams:e.searchParams,visible:o,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function Xce(e){const{classes:t,cx:r}=c4();return s.jsx(ke,{onClick:e.onClick,to:e.to,className:r(t.link,{[t.linkActive]:e.active}),children:e.children})}function Jce(e){return e.icon?e.icon:s.jsx(fm,{w:30})}function Zce(e,t,r){if(!e||!t||!r)return;let n,o=0;for(const i of r)if(i.links)for(const a of i.links){const l=eue(e,t,a.href);l>o&&(o=l,n=a)}return n}function eue(e,t,r){const n=new URL(r,"https://example.com");if(e!==n.pathname)return 0;const o=["_count","_offset"];for(const[a,l]of n.searchParams.entries())if(!o.includes(a)&&t.get(a)!==l)return 0;let i=1;for(const[a,l]of t.entries())o.includes(a)||n.searchParams.get(a)===l&&i++;return i}function tue(e){var u;const t=Zt(),[r,n]=f.useState(localStorage.navbarOpen==="true"),o=ae(),i=Rx();f.useEffect(()=>{function d(){me({color:"red",message:"No connection to server",autoClose:!1})}return o.addEventListener("offline",d),()=>o.removeEventListener("offline",d)},[o]);function a(d){localStorage.navbarOpen=d.toString(),n(d)}function l(){a(!1)}function c(){a(!r)}return o.isLoading()?s.jsx(En,{}):s.jsx(Qk,{styles:{main:{background:t.colorScheme==="dark"?t.colors.dark[8]:t.colors.gray[0]}},padding:0,fixed:!0,header:i&&s.jsx(zce,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:c}),navbar:i&&r?s.jsx(Yce,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:l,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,children:s.jsx(a4,{children:s.jsx(f.Suspense,{fallback:s.jsx(En,{}),children:e.children})},`${e.pathname}?${(u=e.searchParams)==null?void 0:u.toString()}`)})}function zc(e){const{contentType:t,url:r,title:n}=e.value??{};return r?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:r,alt:n}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:r})}),t==="application/pdf"&&s.jsx("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{width:"100%",height:"400",src:r+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Le,{href:r,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:rue(n),children:n||"Download"})})]}):null}function rue(e){return e!=null&&e.includes(".")?e:void 0}function nue(e){var t;return s.jsx("div",{children:(t=e.values)==null?void 0:t.map((r,n)=>s.jsx("div",{children:s.jsx(zc,{value:r,maxWidth:e.maxWidth})},"attatchment-"+n))})}function Vx(e){const t=ae(),r=f.useRef(null);function n(a){var l;st(a),(l=r.current)==null||l.click()}function o(a){st(a);const l=a.target.files;l&&Array.from(l).forEach(i)}function i(a){if(!a||!a.name)return;e.onUploadStart&&e.onUploadStart();const c=a.name,u=a.type||"application/octet-stream";t.createBinary(a,c,u,e.onUploadProgress).then(d=>{e.onUpload({contentType:d.contentType,url:d.url,title:c})}).catch(d=>{e.onUploadError&&e.onUploadError(ct(d))})}return s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:r,onChange:a=>o(a)}),e.children({onClick:n})]})}function oue(e){const[t,r]=f.useState(e.defaultValue??[]),n=f.useRef();n.current=t;function o(i){r(i),e.onChange&&e.onChange(i)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((i,a)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(zc,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(pr,{title:"Remove",size:"sm",onClick:l=>{st(l);const c=t.slice();c.splice(a,1),o(c)},children:s.jsx(uh,{})})})]},`${a}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(Vx,{onUpload:i=>{o([...n.current,i])},children:i=>s.jsx(pr,{...i,title:"Add",size:"sm",color:"green",children:s.jsx(Ix,{size:16})})})})]})]})]})}function u4(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return t?s.jsxs(s.Fragment,{children:[s.jsx(zc,{value:t,maxWidth:200}),s.jsx(ne,{onClick:o=>{st(o),n(void 0)},children:"Remove"})]}):s.jsx(Vx,{onUpload:n,children:o=>s.jsx(ne,{...o,children:"Upload..."})})}const d4=["meta","implicitRules","contained","extension","modifierExtension"],f4=["language","text"],iue=W(e=>({root:{display:"grid",gridTemplateColumns:"30% 70%",margin:0,"& > dt, & > dd":{padding:`${e.spacing.sm} ${e.spacing.sm}`,borderTop:`0.1px solid ${e.colors.gray[3]}`,margin:0}},compact:{gridTemplateColumns:"20% 80%","& > dt, & > dd":{padding:`0 ${e.spacing.xs} ${e.spacing.xs} 0`,border:0}}}));function Bx(e){const{children:t,compact:r}=e,{classes:n,cx:o}=iue();return s.jsx("dl",{className:o(n.root,{[n.compact]:r}),children:t})}function cs(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function Zn(e){return s.jsx(s.Fragment,{children:Ps(e.value)})}function aue(e){return s.jsx(s.Fragment,{children:ba(e.value)})}function p4(e){const t=e.value;if(!t)return null;const r=[];return t.value&&r.push(t.value),(t.use||t.system)&&(r.push(" ["),t.use&&r.push(t.use),t.use&&t.system&&r.push(" "),t.system&&r.push(t.system),r.push("]")),s.jsx(s.Fragment,{children:r.join("").trim()})}function sue(e){var r;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(r=t.telecom)==null?void 0:r.map(n=>s.jsx(p4,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function lue(e){var t,r;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(r=e.value)==null?void 0:r.value]})}function cue(e){return s.jsx(s.Fragment,{children:$ie(e.value)})}function fc(e){return s.jsx(s.Fragment,{children:Zo(e.value)})}function Ux(e){return s.jsx(s.Fragment,{children:cc(e.value)})}function uue(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(fc,{value:t.numerator})," / ",s.jsx(fc,{value:t.denominator})]}):null}function fh(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Rr(e.value);return e.link!==!1&&e.value.reference?s.jsx(ke,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function due(e){const{property:t,values:r}=e,n=t.type[0].code;return e.values?s.jsx(s.Fragment,{children:r.map((o,i)=>s.jsx("div",{children:s.jsx(To,{arrayElement:!0,property:t,propertyType:n,value:o,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${i}-${r.length}`))}):s.jsx(s.Fragment,{})}function To(e){var i;const{property:t,propertyType:r,value:n}=e;if((i=t==null?void 0:t.path)==null?void 0:i.endsWith(".id"))return s.jsxs(oe,{component:"div",sx:{display:"flex",gap:3,alignItems:"center"},children:[n,!yo(n)&&s.jsx(dI,{value:n,timeout:2e3,children:({copied:a,copy:l})=>s.jsx(_N,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(pr,{color:a?"teal":"gray",onClick:l,children:a?s.jsx(wm,{size:"1rem"}):s.jsx(Kle,{size:"1rem"})})})})]});if(t!=null&&t.max&&t.max>1&&!e.arrayElement)return r===B.Attachment?s.jsx(nue,{values:n,maxWidth:e.maxWidth}):s.jsx(due,{property:t,values:n,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(r){case B.boolean:return s.jsx(s.Fragment,{children:n===void 0?"":(!!n).toString()});case B.SystemString:case B.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:n});case B.code:case B.date:case B.decimal:case B.id:case B.integer:case B.positiveInt:case B.unsignedInt:case B.uri:case B.url:return s.jsx(s.Fragment,{children:n});case B.canonical:return s.jsx(fh,{value:{reference:n},link:e.link});case B.dateTime:case B.instant:return s.jsx(s.Fragment,{children:Tr(n)});case B.markdown:return s.jsx("pre",{children:n});case B.Address:return s.jsx(jle,{value:n});case B.Annotation:return s.jsx(s.Fragment,{children:n==null?void 0:n.text});case B.Attachment:return s.jsx(zc,{value:n,maxWidth:e.maxWidth});case B.CodeableConcept:return s.jsx(Zn,{value:n});case B.Coding:return s.jsx(aue,{value:n});case B.ContactDetail:return s.jsx(sue,{value:n});case B.ContactPoint:return s.jsx(p4,{value:n});case B.HumanName:return s.jsx(Ax,{value:n});case B.Identifier:return s.jsx(lue,{value:n});case B.Money:return s.jsx(cue,{value:n});case B.Period:return s.jsx(s.Fragment,{children:Pie(n)});case B.Quantity:case B.Duration:return s.jsx(fc,{value:n});case B.Range:return s.jsx(Ux,{value:n});case B.Ratio:return s.jsx(uue,{value:n});case B.Reference:return s.jsx(fh,{value:n,link:e.link});case B.Timing:return s.jsx(s.Fragment,{children:E5(n)});case B.Dosage:case B.UsageContext:return s.jsx(py,{value:{type:r,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);return s.jsx(py,{value:{type:t.type[0].code,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function Fc(e,t){const r=hr(e,t);return r?Array.isArray(r)?[r.map(n=>n.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function py(e){const t=e.value,r=t.value;if(!r)return null;const n=t.type,o=wx(n);return o?typeof r=="object"&&"name"in r&&Object.keys(r).length===1&&typeof r.name=="string"?s.jsx("div",{children:r.name}):s.jsx(Bx,{compact:e.compact,children:Object.entries(o.elements).map(i=>{const[a,l]=i;if(d4.includes(a)||f4.includes(a)&&l.path.split(".").length===2)return null;const[c,u]=Fc(t,a);return e.ignoreMissingValues&&(!c||Array.isArray(c)&&c.length===0)?null:s.jsx(cs,{term:cy(a),children:s.jsx(To,{property:l,propertyType:u,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},a)})}):s.jsxs("div",{children:[n," not implemented"]})}function h4(e){return s.jsxs(K,{noWrap:!0,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(Wt.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk,children:(()=>null)()})})]})}function lt(e,t){var r,n,o;return(o=(n=(r=e==null?void 0:e.issue)==null?void 0:r.filter(i=>{var a;return m4((a=i.expression)==null?void 0:a[0],t)}))==null?void 0:n.map(i=>{var a;return(a=i.details)==null?void 0:a.text}))==null?void 0:o.join(`
|
|
190
|
-
`)}function Wx(e,t){var r;return(r=e==null?void 0:e.issue)==null?void 0:r.filter(n=>{var o;return m4((o=n.expression)==null?void 0:o[0],t)})}function m4(e,t){if(e===t)return!0;if(!e||!t)return!1;const r=e.indexOf(".");if(r>=0&&e.substring(r+1)===t)return!0;const n=t.indexOf(".");return n>=0&&t.substring(n+1)===e}function tt(e){return s.jsx(Wt.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk,error:lt(e.outcome,e.htmlFor),children:e.children})}function hy(e,t,r,n,o){const i=n.type;if(i.length>1)for(const a of i){const l=t.replace("[x]",lr(a.code));l in e&&delete e[l]}return e[r]=o,e}function fue(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=hue(o);r(i),e.onChange&&e.onChange(i)}return s.jsx(zx,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&pue(t),maxSelectedValues:1,onChange:n})}function pue(e){var t;return(t=e.coding)==null?void 0:t.map(r=>({system:r.system,code:r.code,display:r.display}))}function hue(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function g4(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=o[0],a=i&&gue(i);r(a),e.onChange&&e.onChange(a)}return s.jsx(zx,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&mue(t),maxSelectedValues:1,onChange:n})}function mue(e){return{system:e.system,code:e.code,display:e.display}}function gue(e){return{system:e.system,code:e.code,display:e.display}}function v4(e){const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(c){c&&Object.keys(c).length===0&&(c=void 0),r(c),e.onChange&&e.onChange(c)}function i(c){const u={...n.current,system:c};c||delete u.system,o(u)}function a(c){const u={...n.current,use:c};c||delete u.use,o(u)}function l(c){const u={...n.current,value:c};c||delete u.value,o(u)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{"data-testid":"system",defaultValue:t==null?void 0:t.system,onChange:c=>i(c.currentTarget.value),data:["","email","phone","fax","pager","sms","other"]}),s.jsx(ft,{"data-testid":"use",defaultValue:t==null?void 0:t.use,onChange:c=>a(c.currentTarget.value),data:["","home","work","temp","old","mobile"]}),s.jsx(le,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:c=>l(c.currentTarget.value)})]})}function vue(e){var l;const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(c){r(c),e.onChange&&e.onChange(c)}function i(c){const u={...n.current,name:c};c||delete u.name,o(u)}function a(c){const u={...n.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{"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)}),s.jsx(v4,{name:e.name+"-telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:a})]})}function yue(e){if(!e)return"";const t=new Date(e);return hm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function y4(e){if(!e)return"";const t=new Date(e);return hm(t)?t.toISOString():""}function aa(e){return s.jsx(le,{id:e.name,name:e.name,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:xue(),defaultValue:yue(e.defaultValue),autoFocus:e.autoFocus,error:lt(e.outcome,e.name),onChange:t=>{if(e.onChange){const r=t.currentTarget.value;e.onChange(y4(r))}}})}function xue(){return{}.NODE_ENV==="test"?"text":"datetime-local"}function wue(e){return s.jsx(Ls,{id:e.name,name:e.name,"data-testid":"extension-input",defaultValue:Rr(e.defaultValue),deserialize:JSON.parse,onChange:t=>{e.onChange&&e.onChange(JSON.parse(t))}})}function _ue(e){var d,p,h;const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(m){r(m),e.onChange&&e.onChange(m)}function i(m){o({...n.current,use:m||void 0})}function a(m){o({...n.current,prefix:m?m.split(" "):void 0})}function l(m){o({...n.current,given:m?m.split(" "):void 0})}function c(m){o({...n.current,family:m||void 0})}function u(m){o({...n.current,suffix:m?m.split(" "):void 0})}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{defaultValue:t==null?void 0:t.use,name:e.name+"-use","data-testid":"use",onChange:m=>i(m.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"]}),s.jsx(le,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(d=t==null?void 0:t.prefix)==null?void 0:d.join(" "),onChange:m=>a(m.currentTarget.value)}),s.jsx(le,{placeholder:"Given",name:e.name+"-given",defaultValue:(p=t==null?void 0:t.given)==null?void 0:p.join(" "),onChange:m=>l(m.currentTarget.value)}),s.jsx(le,{name:e.name+"-family",placeholder:"Family",defaultValue:t==null?void 0:t.family,onChange:m=>c(m.currentTarget.value)}),s.jsx(le,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(h=t==null?void 0:t.suffix)==null?void 0:h.join(" "),onChange:m=>u(m.currentTarget.value)})]})}function bue(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{placeholder:"System",defaultValue:t==null?void 0:t.system,onChange:o=>n({...t,system:o.currentTarget.value})}),s.jsx(le,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:o=>n({...t,value:o.currentTarget.value})})]})}const Sue=["USD","EUR","CAD","GBP","AUD"];function Pue(e){var c;const{onChange:t}=e,[r,n]=f.useState(e.defaultValue),o=f.useCallback(u=>{n(u),t&&t(u)},[t]),i=f.useCallback(u=>{o({...r,currency:u.currentTarget.value})},[r,o]),a=f.useCallback(u=>{o({...r,value:u.currentTarget.valueAsNumber})},[r,o]),l=s.jsx(ft,{defaultValue:r==null?void 0:r.currency,data:Sue,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:i});return s.jsx(le,{type:"number",label:e.label,placeholder:e.placeholder??"Value",defaultValue:((c=r==null?void 0:r.value)==null?void 0:c.toString())??"USD",icon:s.jsx(Yle,{size:14}),rightSection:l,rightSectionWidth:92,onChange:a})}function Oue(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(aa,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>n({...t,start:o})}),s.jsx(aa,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>n({...t,end:o})})]})}function sa(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:o=>n({...t,comparator:o.currentTarget.value})}),s.jsx(le,{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=>{n({...t,value:jue(o.currentTarget.value)})}}),s.jsx(le,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>n({...t,unit:o.currentTarget.value})})]})}function jue(e){if(e)return parseFloat(e)}function Hx(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(sa,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>n({...t,low:o})}),s.jsx(sa,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>n({...t,high:o})})]})}function Cue(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(sa,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>n({...t,numerator:o})}),s.jsx(sa,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>n({...t,denominator:o})})]})}const Eue={Observation:"code",User:"email:contains"},$ue=["AccessPolicy","Account","ActivityDefinition","Bot","CapabilityStatement","ClientApplication","CodeSystem","CompartmentDefinition","ConceptMap","EffectEvidenceSynthesis","Endpoint","EventDefinition","Evidence","EvidenceVariable","ExampleScenario","GraphDefinition","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 kue(e){return{value:et(e),label:ko(e),resource:e}}function zs(e){const t=ae(),r=e.resourceType,[n,o]=f.useState(),i=Ke(e.defaultValue,o),a=e.onChange,l=f.useCallback(async(u,d)=>{const p=Tue(r),h=new URLSearchParams({[p]:u,_count:"10"});return await t.searchResources(r,h,{signal:d})},[t,r]),c=f.useCallback(u=>{a&&a(u[0])},[a]);return e.defaultValue&&!n&&!i?null:s.jsx(Mx,{name:e.name,required:e.required,itemComponent:Rue,defaultValue:i,placeholder:e.placeholder,maxSelectedValues:1,toKey:et,toOption:kue,loadOptions:l,onChange:c,clearable:!0})}const Rue=f.forwardRef(({label:e,resource:t,...r},n)=>s.jsx("div",{ref:n,...r,children:s.jsxs(K,{noWrap:!0,children:[s.jsx(_i,{value:t}),s.jsxs("div",{children:[s.jsx(re,{children:e}),s.jsx(re,{size:"xs",color:"dimmed",children:t.birthDate})]})]})}));function Tue(e){return Eue[e]??($ue.includes(e)?"name":"_id")}function Sm(e){const t=Iue(e.targetTypes),r=Due(e.defaultValue,t),[n,o]=f.useState(e.defaultValue),[i,a]=f.useState(r);function l(c){o(c),e.onChange&&e.onChange(c)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[t&&t.length>1&&s.jsx(ft,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:i,autoFocus:e.autoFocus,onChange:c=>a(c.currentTarget.value),data:t}),!t&&s.jsx(Fx,{autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:i,onChange:a,name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(zs,{resourceType:i,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:n,onChange:c=>{l(c?dt(c):void 0)}})]})}function Iue(e){if(!(!e||e.length===0||e.length===1&&e[0]==="Resource"))return e}function Due(e,t){var n;const r=(n=e==null?void 0:e.reference)==null?void 0:n.split("/")[0];if(r)return r;if(t&&t.length>0)return t[0]}function Nue(e){const[t,r]=f.useState(e.defaultValue&&Array.isArray(e.defaultValue)?e.defaultValue:[]),n=f.useRef();n.current=t;function o(i){r(i),e.onChange&&e.onChange(i)}return s.jsxs(je,{style:{marginTop:"1rem",marginLeft:"1rem"},children:[t.map((i,a)=>s.jsxs(K,{noWrap:!0,children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(la,{arrayElement:!0,property:e.property,name:e.name+"."+a,defaultValue:i,onChange:l=>{const c=[...n.current];c[a]=l,o(c)}})}),s.jsx("div",{children:s.jsx(pr,{title:"Remove",size:"sm",onClick:l=>{st(l);const c=[...n.current];c.splice(a,1),o(c)},children:s.jsx(uh,{})})})]},`${a}-${t.length}`)),s.jsx(K,{noWrap:!0,style:{justifyContent:"flex-end"},children:s.jsx("div",{children:s.jsx(pr,{title:"Add",size:"sm",color:"green",onClick:i=>{st(i);const a=[...n.current];a.push(void 0),o(a)},children:s.jsx(Tx,{})})})})]})}const Aue=["sun","mon","tue","wed","thu","fri","sat"];function Mue(e){const[t,r]=f.useState(e.defaultValue),[n,o]=f.useState(!1),i=f.useRef();return i.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx("span",{children:E5(i.current)||"No repeat"}),s.jsx(ne,{onClick:()=>o(!0),children:"Edit"})]}),s.jsx(Lue,{visible:n,defaultValue:i.current,onOk:a=>{e.onChange&&e.onChange(a),r(a),o(!1)},onCancel:()=>o(!1)})]})}const Yj={repeat:{period:1,periodUnit:"d"}};function Lue(e){const[t,r]=f.useState(e.defaultValue||Yj),n=f.useRef();n.current=t;function o(u){r({...n.current,event:[u]})}function i(u){r({...n.current,repeat:u})}function a(u){var d;i({...(d=n.current)==null?void 0:d.repeat,period:u})}function l(u){var d;i({...(d=n.current)==null?void 0:d.repeat,periodUnit:u})}function c(u){var d;i({...(d=n.current)==null?void 0:d.repeat,dayOfWeek:u})}return s.jsx(Dr,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(je,{children:[s.jsx(tt,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(aa,{name:"timing-dialog-start",onChange:u=>o(u)})}),s.jsx(px,{label:"Repeat",checked:!!t.repeat,onChange:u=>i(u.currentTarget.checked?Yj.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(tt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:u=>a(parseInt(u.currentTarget.value,10)||1)}),s.jsx(ft,{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"&&s.jsx(tt,{title:"Repeat on",children:s.jsx(Kf.Group,{multiple:!0,onChange:c,children:s.jsx(K,{position:"apart",mt:"md",spacing:"xs",children:Aue.map(u=>s.jsx(Kf,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),s.jsx(K,{position:"right",children:s.jsx(ne,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function la(e){const t=e.property,r=e.defaultPropertyType??t.type[0].code,n=e.name,o=e.defaultValue;if(t.max>1&&!e.arrayElement)return r===B.Attachment?s.jsx(oue,{name:n,defaultValue:o,onChange:e.onChange}):s.jsx(Nue,{property:t,name:n,defaultValue:o,onChange:e.onChange});const i=t.type;return i.length>1?s.jsx(zue,{elementDefinitionTypes:i,...e}):s.jsx(x4,{elementDefinitionType:i[0],...e})}function zue(e){const t=e.elementDefinitionTypes;let r;e.defaultPropertyType&&(r=t.find(i=>i.code===e.defaultPropertyType)),r||(r=t[0]);const[n,o]=f.useState(r);return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{style:{width:"200px"},defaultValue:n.code,onChange:i=>{o(t.find(a=>a.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),s.jsx(x4,{...e,elementDefinitionType:n,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",lr(n.code)))}})]})}function x4(e){var a,l,c;const t=e.property,r=e.elementDefinitionType.code,n=e.name,o=e.defaultValue,i=t.min!==void 0&&t.min>0;switch(r){case B.SystemString:case B.canonical:case B.string:case B.time:case B.uri:case B.url:return s.jsx(le,{id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)},error:lt(e.outcome,n)});case B.date:return s.jsx(le,{type:"date",id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)},error:lt(e.outcome,n)});case B.dateTime:case B.instant:return s.jsx(aa,{name:n,defaultValue:o,onChange:e.onChange,outcome:e.outcome});case B.decimal:case B.integer:case B.positiveInt:case B.unsignedInt:return s.jsx(le,{type:"number",step:r===B.decimal?"any":"1",id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.valueAsNumber)}});case B.code:return s.jsx(l4,{binding:(a=t.binding)==null?void 0:a.valueSet,name:n,defaultValue:o,onChange:e.onChange});case B.boolean:return s.jsx(Cn,{id:n,name:n,"data-testid":n,defaultChecked:!!o,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.checked)}});case B.markdown:return s.jsx(Rc,{id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)}});case B.Address:return s.jsx(Cle,{name:n,defaultValue:o,onChange:e.onChange});case B.Annotation:return s.jsx(Ele,{name:n,defaultValue:o,onChange:e.onChange});case B.Attachment:return s.jsx(u4,{name:n,defaultValue:o,onChange:e.onChange});case B.CodeableConcept:return s.jsx(fue,{binding:(l=t.binding)==null?void 0:l.valueSet,name:n,defaultValue:o,onChange:e.onChange});case B.Coding:return s.jsx(g4,{binding:(c=t.binding)==null?void 0:c.valueSet,name:n,defaultValue:o,onChange:e.onChange});case B.ContactDetail:return s.jsx(vue,{name:n,defaultValue:o,onChange:e.onChange});case B.ContactPoint:return s.jsx(v4,{name:n,defaultValue:o,onChange:e.onChange});case B.Extension:return s.jsx(wue,{name:n,defaultValue:o,onChange:e.onChange});case B.HumanName:return s.jsx(_ue,{name:n,defaultValue:o,onChange:e.onChange});case B.Identifier:return s.jsx(bue,{name:n,defaultValue:o,onChange:e.onChange});case B.Money:return s.jsx(Pue,{name:n,defaultValue:o,onChange:e.onChange});case B.Period:return s.jsx(Oue,{name:n,defaultValue:o,onChange:e.onChange});case B.Duration:case B.Quantity:return s.jsx(sa,{name:n,defaultValue:o,onChange:e.onChange});case B.Range:return s.jsx(Hx,{name:n,defaultValue:o,onChange:e.onChange});case B.Ratio:return s.jsx(Cue,{name:n,defaultValue:o,onChange:e.onChange});case B.Reference:return s.jsx(Sm,{name:n,defaultValue:o,targetTypes:Fue(t),onChange:e.onChange});case B.Timing:return s.jsx(Mue,{name:n,defaultValue:o,onChange:e.onChange});case B.Dosage:case B.UsageContext:return s.jsx(my,{typeName:r,defaultValue:o,onChange:e.onChange,outcome:e.outcome});default:return s.jsx(my,{typeName:t.type[0].code,defaultValue:o,onChange:e.onChange,outcome:e.outcome})}}function Fue(e){var t,r,n;return(n=(r=(t=e==null?void 0:e.type)==null?void 0:t[0])==null?void 0:r.targetProfile)==null?void 0:n.map(o=>o.split("/").pop())}function my(e){const[t,r]=f.useState(e.defaultValue??{});function n(l){r(l),e.onChange&&e.onChange(l)}const o=e.typeName,i=wx(o);if(!i)return s.jsxs("div",{children:[o," not implemented"]});const a={type:o,value:t};return s.jsx(je,{children:Object.entries(i.elements).map(([l,c])=>{if(l==="id"||d4.includes(l)||f4.includes(l)&&c.path.split(".").length===2||!c.type)return null;const[u,d]=Fc(a,l),p=c.min!==void 0&&c.min>0;return c.type.length===1&&c.type[0].code==="boolean"?s.jsx(h4,{title:cy(l),description:c.description,htmlFor:l,children:s.jsx(la,{property:c,name:l,defaultValue:u,defaultPropertyType:d,outcome:e.outcome,onChange:(h,m)=>{n(hy(t,l,m??l,c,h))}})},l):s.jsx(tt,{title:cy(l),description:c.description,withAsterisk:p,htmlFor:l,outcome:e.outcome,children:s.jsx(la,{property:c,name:l,defaultValue:u,defaultPropertyType:d,onChange:(h,m)=>{n(hy(t,l,m??l,c,h))}})},l)})})}const Vue=W(()=>({root:{"@media (max-width: 800px)":{paddingLeft:4,paddingRight:4}}}));function Vc(e){const{children:t,...r}=e,{classes:n}=Vue();return s.jsx(lI,{className:n.root,...r,children:t})}const Bue=W(e=>({noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));function w4({value:e}){const{classes:t}=Bue();return e?s.jsx(je,{justify:"flex-start",spacing:"xs",children:e.map(r=>{var n;return r.text&&s.jsx(RT,{classNames:{cite:t.noteCite,body:t.noteBody,root:t.noteRoot},cite:((n=r.authorReference)==null?void 0:n.display)||r.authorString,icon:null,children:r.text},`note-${r.text}`)})}):null}function Bc(e){const{value:t,link:r,...n}=e,[o,i]=f.useState(),a=Ke(t,i);let l;if(o&&!z5(o))l=`[${Ee(o)}]`;else if(a)l=ko(a);else return null;return r?s.jsx(ke,{to:t,...n,children:l}):s.jsx(re,{component:"span",...n,children:l})}function us(e){return s.jsxs(K,{spacing:"xs",children:[s.jsx(_i,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Bc,{value:e.value,link:e.link})]})}const Uue={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"};function _4(e){return s.jsx(cG,{color:Uue[e.status],children:e.status})}const b4=W(e=>({table:{border:`0.1px solid ${e.colors.gray[5]}`,borderCollapse:"collapse","& td, & th":{border:`0.1px solid ${e.colors.gray[5]}`,padding:4}},criticalRow:{background:e.colorScheme==="dark"?e.colors.red[7]:e.colors.red[1],border:`0.1px solid ${e.colors.red[5]}`,color:e.colors.red[5],fontWeight:500,"& td":{border:`0.1px solid ${e.colors.red[5]}`}},noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));Gx.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Gx(e){var a;const t=ae(),r=Ke(e.value),[n,o]=f.useState();if(f.useEffect(()=>{r!=null&&r.specimen&&Promise.allSettled(r.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,r]),!r)return null;const i=(n==null?void 0:n.flatMap(l=>l.note||[]))||[];if(r.presentedForm&&r.presentedForm.length>0){const l=r.presentedForm[0];(a=l.contentType)!=null&&a.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return s.jsxs(je,{children:[s.jsx(he,{children:"Diagnostic Report"}),s.jsx(Wue,{value:r}),n&&!e.hideSpecimenInfo&&Hue(n),r.result&&s.jsx(Gue,{hideObservationNotes:e.hideObservationNotes,value:r.result}),i.length>0&&s.jsx(w4,{value:i})]})}function Wue({value:e}){var t,r;return s.jsxs(K,{mt:"md",spacing:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Subject"}),s.jsx(re,{children:s.jsx(us,{value:e.subject,link:!0})})]}),(t=e.resultsInterpreter)==null?void 0:t.map(n=>s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Interpreter"}),s.jsx(re,{children:s.jsx(us,{value:n,link:!0})})]},n.reference)),(r=e.performer)==null?void 0:r.map(n=>s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Performer"}),s.jsx(re,{children:s.jsx(us,{value:n,link:!0})})]},n.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Issued"}),s.jsx(re,{children:Tr(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Status"}),s.jsx(re,{children:lr(e.status)})]})]})}function Hue(e){return s.jsxs(je,{spacing:"xs",children:[s.jsx(he,{order:2,size:"h6",children:"Specimens"}),s.jsx(Or,{type:"ordered",children:e==null?void 0:e.map(t=>{var r;return s.jsx(Or.Item,{ml:"sm",children:s.jsxs(K,{spacing:20,children:[s.jsxs(K,{spacing:5,children:[s.jsx(re,{fw:500,children:"Collected:"})," ",Tr((r=t.collection)==null?void 0:r.collectedDateTime)]}),s.jsxs(K,{spacing:5,children:[s.jsx(re,{fw:500,children:"Received:"})," ",Tr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function Gue(e){const{classes:t}=b4();return s.jsxs("table",{className:t.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(S4,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function S4(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(r=>s.jsx(que,{value:r,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Pa(r)?r.reference:r.id}`))})}function que(e){var a,l;const{classes:t,cx:r}=b4(),n=Ke(e.value);if(!n||(a=e.ancestorIds)!=null&&a.includes(n.id))return null;const o=!e.hideObservationNotes&&n.note,i=Yue(n);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:r({[t.criticalRow]:i}),children:[s.jsx("td",{rowSpan:o?2:1,children:s.jsx(ke,{to:n,children:s.jsx(Zn,{value:n.code})})}),s.jsx("td",{children:s.jsx(Que,{value:n})}),s.jsx("td",{children:s.jsx(Kue,{value:n.referenceRange})}),s.jsx("td",{children:n.interpretation&&n.interpretation.length>0&&s.jsx(Zn,{value:n.interpretation[0]})}),s.jsx("td",{children:n.category&&n.category.length>0&&s.jsx(s.Fragment,{children:n.category.map(c=>s.jsx("div",{children:s.jsx(Zn,{value:c})},`category-${Ps(c)}`))})}),s.jsx("td",{children:(l=n.performer)==null?void 0:l.map(c=>s.jsx(fh,{value:c},c.reference))}),s.jsx("td",{children:n.status&&s.jsx(_4,{status:n.status})})]}),n.hasMember&&s.jsx(S4,{value:n.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,n.id]:[n.id],hideObservationNotes:e.hideObservationNotes}),o&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(w4,{value:n.note})})})]})}function Que(e){const t=e.value;return s.jsx(s.Fragment,{children:$5(t)})}function Kue(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(Ux,{value:t}):null}function Yue(e){var r,n,o,i;const t=(i=(o=(n=(r=e.interpretation)==null?void 0:r[0])==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}const Xue=W((e,{width:t,fill:r})=>({paper:{maxWidth:t,margin:`${e.spacing.xl} auto`,padding:r?0:e.spacing.md,"@media (max-width: 800px)":{padding:r?0:8},"& img":{width:"100%",maxWidth:"100%"},"& video":{width:"100%",maxWidth:"100%"}}})),Jue={shadow:"xs",radius:"md",withBorder:!0};function qx(e){const{className:t,children:r,width:n,fill:o,unstyled:i,...a}=H("Panel",Jue,e),{classes:l,cx:c}=Xue({width:n,fill:o},{name:"Panel",unstyled:i});return s.jsx(sn,{className:c(l.paper,t),...a,children:r})}var Ji={},Uc={};Object.defineProperty(Uc,"__esModule",{value:!0});Uc.Pointer=void 0;function Zue(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ede(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var tde=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var r=t.split("/").map(Zue);if(r[0]!=="")throw new Error("Invalid JSON Pointer: "+t);return new e(r)},e.prototype.toString=function(){return this.tokens.map(ede).join("/")},e.prototype.evaluate=function(t){for(var r=null,n="",o=t,i=1,a=this.tokens.length;i<a;i++)r=o,n=this.tokens[i],!(n=="__proto__"||n=="constructor"||n=="prototype")&&(o=(r||{})[n]);return{parent:r,key:n,value:o}},e.prototype.get=function(t){return this.evaluate(t).value},e.prototype.set=function(t,r){for(var n=t,o=1,i=this.tokens.length-1,a=this.tokens[o];o<i;o++)n=(n||{})[a];n&&(n[this.tokens[this.tokens.length-1]]=r)},e.prototype.push=function(t){this.tokens.push(t)},e.prototype.add=function(t){var r=this.tokens.concat(String(t));return new e(r)},e}();Uc.Pointer=tde;var bt={},Qx={};(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 r(o){return o!=null&&typeof o=="object"}function n(o){if(!r(o))return o;if(o.constructor==Array){for(var i=o.length,a=new Array(i),l=0;l<i;l++)a[l]=n(o[l]);return a}if(o.constructor==Date){var c=new Date(+o);return c}var u={};for(var d in o)e.hasOwnProperty.call(o,d)&&(u[d]=n(o[d]));return u}e.clone=n})(Qx);var dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.diffAny=dr.diffObjects=dr.diffArrays=dr.intersection=dr.subtract=dr.isDestructive=void 0;var pc=Qx;function rde(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}dr.isDestructive=rde;function gy(e,t){var r={};for(var n in e)pc.hasOwnProperty.call(e,n)&&e[n]!==void 0&&(r[n]=1);for(var o in t)pc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete r[o];return Object.keys(r)}dr.subtract=gy;function P4(e){for(var t=e.length,r={},n=0;n<t;n++){var o=e[n];for(var i in o)pc.hasOwnProperty.call(o,i)&&o[i]!==void 0&&(r[i]=(r[i]||0)+1)}for(var i in r)r[i]<t&&delete r[i];return Object.keys(r)}dr.intersection=P4;function nde(e){return e.op==="add"}function ode(e){return e.op==="remove"}function Lg(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function O4(e,t,r,n){n===void 0&&(n=Pm);var o={"0,0":{operations:[],cost:0}};function i(d,p){var h=d+","+p,m=o[h];if(m===void 0){if(d>0&&p>0&&!n(e[d-1],t[p-1],r.add(String(d-1))).length)m=i(d-1,p-1);else{var v=[];if(d>0){var g=i(d-1,p),b={op:"remove",index:d-1};v.push(Lg(g,b))}if(p>0){var y=i(d,p-1),x={op:"add",index:d-1,value:t[p-1]};v.push(Lg(y,x))}if(d>0&&p>0){var _=i(d-1,p-1),w={op:"replace",index:d-1,original:e[d-1],value:t[p-1]};v.push(Lg(_,w))}var j=v.sort(function(C,P){return C.cost-P.cost})[0];m=j}o[h]=m}return m}var a=isNaN(e.length)||e.length<=0?0:e.length,l=isNaN(t.length)||t.length<=0?0:t.length,c=i(a,l).operations,u=c.reduce(function(d,p){var h=d[0],m=d[1];if(nde(p)){var v=p.index+1+m,g=v<a+m?String(v):"-",b={op:p.op,path:r.add(g).toString(),value:p.value};return[h.concat(b),m+1]}else if(ode(p)){var b={op:p.op,path:r.add(String(p.index+m)).toString()};return[h.concat(b),m-1]}else{var y=r.add(String(p.index+m)),x=n(p.original,p.value,y);return[h.concat.apply(h,x),m]}},[[],0])[0];return u}dr.diffArrays=O4;function j4(e,t,r,n){n===void 0&&(n=Pm);var o=[];return gy(e,t).forEach(function(i){o.push({op:"remove",path:r.add(i).toString()})}),gy(t,e).forEach(function(i){o.push({op:"add",path:r.add(i).toString(),value:t[i]})}),P4([e,t]).forEach(function(i){o.push.apply(o,n(e[i],t[i],r.add(i)))}),o}dr.diffObjects=j4;function Pm(e,t,r,n){if(n===void 0&&(n=Pm),e===t)return[];var o=pc.objectType(e),i=pc.objectType(t);return o=="array"&&i=="array"?O4(e,t,r,n):o=="object"&&i=="object"?j4(e,t,r,n):[{op:"replace",path:r.toString(),value:t}]}dr.diffAny=Pm;var Kx=m1&&m1.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(bt,"__esModule",{value:!0});bt.apply=bt.InvalidOperationError=bt.test=bt.copy=bt.move=bt.replace=bt.remove=bt.add=bt.TestError=bt.MissingError=void 0;var Io=Uc,C4=Qx,ide=dr,eo=function(e){Kx(t,e);function t(r){var n=e.call(this,"Value required at path: "+r)||this;return n.path=r,n.name="MissingError",n}return t}(Error);bt.MissingError=eo;var E4=function(e){Kx(t,e);function t(r,n){var o=e.call(this,"Test failed: "+r+" != "+n)||this;return o.actual=r,o.expected=n,o.name="TestError",o}return t}(Error);bt.TestError=E4;function Yx(e,t,r){if(Array.isArray(e))if(t=="-")e.push(r);else{var n=parseInt(t,10);e.splice(n,0,r)}else e[t]=r}function $4(e,t){if(Array.isArray(e)){var r=parseInt(t,10);e.splice(r,1)}else delete e[t]}function k4(e,t){var r=Io.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new eo(t.path):(Yx(r.parent,r.key,C4.clone(t.value)),null)}bt.add=k4;function R4(e,t){var r=Io.Pointer.fromJSON(t.path).evaluate(e);return r.value===void 0?new eo(t.path):($4(r.parent,r.key),null)}bt.remove=R4;function T4(e,t){var r=Io.Pointer.fromJSON(t.path).evaluate(e);if(r.parent===null)return new eo(t.path);if(Array.isArray(r.parent)){if(parseInt(r.key,10)>=r.parent.length)return new eo(t.path)}else if(r.value===void 0)return new eo(t.path);return r.parent[r.key]=t.value,null}bt.replace=T4;function I4(e,t){var r=Io.Pointer.fromJSON(t.from).evaluate(e);if(r.value===void 0)return new eo(t.from);var n=Io.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new eo(t.path):($4(r.parent,r.key),Yx(n.parent,n.key,r.value),null)}bt.move=I4;function D4(e,t){var r=Io.Pointer.fromJSON(t.from).evaluate(e);if(r.value===void 0)return new eo(t.from);var n=Io.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new eo(t.path):(Yx(n.parent,n.key,C4.clone(r.value)),null)}bt.copy=D4;function N4(e,t){var r=Io.Pointer.fromJSON(t.path).evaluate(e);return ide.diffAny(r.value,t.value,new Io.Pointer).length?new E4(r.value,t.value):null}bt.test=N4;var A4=function(e){Kx(t,e);function t(r){var n=e.call(this,"Invalid operation: "+r.op)||this;return n.operation=r,n.name="InvalidOperationError",n}return t}(Error);bt.InvalidOperationError=A4;function ade(e,t){switch(t.op){case"add":return k4(e,t);case"remove":return R4(e,t);case"replace":return T4(e,t);case"move":return I4(e,t);case"copy":return D4(e,t);case"test":return N4(e,t)}return new A4(t)}bt.apply=ade;Object.defineProperty(Ji,"__esModule",{value:!0});Ji.createTests=L4=Ji.createPatch=Ji.applyPatch=void 0;var M4=Uc,sde=bt,Xx=dr;function lde(e,t){return t.map(function(r){return sde.apply(e,r)})}Ji.applyPatch=lde;function cde(e){function t(r,n,o){var i=e(r,n,o);return Array.isArray(i)?i:Xx.diffAny(r,n,o,t)}return t}function ude(e,t,r){var n=new M4.Pointer;return(r?cde(r):Xx.diffAny)(e,t,n)}var L4=Ji.createPatch=ude;function Xj(e,t){var r=M4.Pointer.fromJSON(t).evaluate(e);if(r!==void 0)return{op:"test",path:t,value:r.value}}function dde(e,t){var r=new Array;return t.filter(Xx.isDestructive).forEach(function(n){var o=Xj(e,n.path);if(o&&r.push(o),"from"in n){var i=Xj(e,n.from);i&&r.push(i)}}),r}Ji.createTests=dde;const fde=W(e=>({root:{borderCollapse:"collapse",width:"100%","& tr":{borderTop:`0.1px solid ${e.colors.gray[3]}`},"& th, & td":{padding:`${e.spacing.sm} ${e.spacing.sm}`,verticalAlign:"top"}},removed:{color:e.colors.red[7],fontFamily:"monospace",textDecoration:"line-through",whiteSpace:"pre-wrap"},added:{color:e.colors.green[7],fontFamily:"monospace",whiteSpace:"pre-wrap"}}));function pde(e){const{classes:t}=fde(),r=ae(),[n,o]=f.useState(!1);if(f.useEffect(()=>{r.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.original.resourceType]),!n)return null;const i=L4(e.original,e.revised),a=[ro(e.original)],l=[ro(e.revised)];return s.jsxs("table",{className:t.root,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{}),s.jsx("th",{children:"Before"}),s.jsx("th",{children:"After"})]})}),s.jsx("tbody",{children:i.map(c=>{var b,y,x;if(c.path.startsWith("/meta"))return null;const u=c.path,d=hde(u),p=gm(e.original.resourceType,{resourceType:"SearchParameter",base:[e.original.resourceType],code:e.original.resourceType+"."+d,expression:e.original.resourceType+"."+d}),h=(b=p==null?void 0:p.elementDefinitions)==null?void 0:b[0],m=!!(h!=null&&h.isArray),v=c.op==="add"||(y=dc(d,a))==null?void 0:y[0],g=c.op==="remove"||(x=dc(d,l))==null?void 0:x[0];return s.jsxs("tr",{children:[s.jsxs("td",{children:[lr(c.op)," ",d]}),s.jsx("td",{className:t.removed,children:v&&s.jsx(To,{property:h,propertyType:v.type,value:Jj(v.value,m),ignoreMissingValues:!0})}),s.jsx("td",{className:t.added,children:g&&s.jsx(To,{property:h,propertyType:g.type,value:Jj(g.value,m),ignoreMissingValues:!0})})]},`op-${c.op}-${c.path}`)})})]})}function hde(e){const t=e.split("/").filter(Boolean);let r="";for(let n=0;n<t.length;n++){const o=t[n];o==="-"?r+=".last()":/^\d+$/.test(o)?r+=`[${o}]`:(n>0&&(r+="."),r+=o)}return r}function Jj(e,t){return Array.isArray(e)&&!t?e[0]:!Array.isArray(e)&&t?[e]:e}function Jx(e){const t=ae(),r=Ke(e.value),[n,o]=f.useState(!1);return f.useEffect(()=>{r&&t.requestSchema(r.resourceType).then(()=>o(!0)).catch(console.log)},[t,r]),!n||!r?null:s.jsx(py,{value:{type:r.resourceType,value:e.forceUseInput?e.value:r},ignoreMissingValues:e.ignoreMissingValues})}function mde(e){return s.jsx(Vc,{children:e.children})}function ca(e){var c,u;const{resource:t,profile:r,padding:n,popupMenuItems:o,...i}=e,a=r??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return s.jsxs(qx,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(K,{position:"apart",spacing:8,mx:"xs",my:"sm",children:[s.jsx(_i,{value:a,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(re,{size:"sm",children:s.jsx(Bc,{color:"dark",weight:500,value:a,link:!0})}),s.jsxs(re,{size:"xs",children:[s.jsx(ke,{color:"dimmed",to:e.resource,children:Tr(l)}),s.jsx(re,{component:"span",color:"dimmed",mx:8,children:"·"}),s.jsx(ke,{color:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(X,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(X.Target,{children:s.jsx(pr,{radius:"xl","aria-label":`Actions for ${et(e.resource)}`,children:s.jsx(Jle,{})})}),o]})]}),s.jsxs(a4,{children:[n&&s.jsx("div",{style:{padding:"0 16px 16px 16px"},children:e.children}),!n&&s.jsx(s.Fragment,{children:e.children})]})]})}function z4(e,t){e.sort((r,n)=>{const o=Zj(r,t),i=Zj(n,t);return o>i?1:o<i?-1:eC(r,t)-eC(n,t)})}function Zj(e,t){if(!F4(e,t)){const r=e.priority;if(typeof r=="string")return{stat:4,asap:3,urgent:2}[r]??0}return 0}function eC(e,t){var n;if(!F4(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 r=(n=e.meta)==null?void 0:n.lastUpdated;return r?new Date(r).getTime():0}function F4(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const gde=W(e=>({pinnedComment:{backgroundColor:e.colors.blue[0]}}));function Om(e){const t=ae(),r=ym(),n=t.getProfile(),o=f.useRef(null),i=Ke(e.value),[a,l]=f.useState(),[c,u]=f.useState([]),d=e.loadTimelineResources,p=f.useRef(c);p.current=c;const h=f.useCallback(T=>{z4(T,i),T.reverse(),u(T)},[i]),m=f.useCallback(T=>{const z=[];for(const M of T){if(M.status!=="fulfilled")continue;const L=M.value;if(L.type==="history"&&l(L),L.entry)for(const q of L.entry)z.push(q.resource)}h(z)},[h]),v=f.useCallback(T=>h([...p.current,T]),[h]),g=f.useCallback(()=>{var M;let T,z;"resourceType"in e.value?(T=e.value.resourceType,z=e.value.id):[T,z]=(M=e.value.reference)==null?void 0:M.split("/"),d(t,T,z).then(m).catch(console.log)},[t,e.value,d,m]);f.useEffect(()=>g(),[g]);function b(T){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,T)).then(z=>v(z)).catch(console.log)}function y(T){!i||!e.createMedia||t.createResource(e.createMedia(i,n,T)).then(z=>v(z)).then(()=>Pl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(wm,{size:16}),autoClose:2e3})).catch(z=>Pl({id:"upload-notification",color:"red",title:"Upload error",message:Ee(z),icon:s.jsx(Hj,{size:16}),autoClose:2e3}))}function x(T,z){return t.updateResource({...T,priority:z})}function _(T){x(T,"stat").then(g).catch(console.log)}function w(T){x(T,"routine").then(g).catch(console.log)}function j(T){r(`/${T.resourceType}/${T.id}`)}function C(T){r(`/${T.resourceType}/${T.id}/edit`)}function P(T){r(`/${T.resourceType}/${T.id}/delete`)}function E(T){var z;r(`/${T.resourceType}/${T.id}/_history/${(z=T.meta)==null?void 0:z.versionId}`)}function k(){me({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function $(T){Pl({id:"upload-notification",loading:!0,title:"Uploading...",message:Sde(T),autoClose:!1,withCloseButton:!1})}function I(T){Pl({id:"upload-notification",color:"red",title:"Upload error",message:Ee(T),icon:s.jsx(Hj,{size:16}),autoClose:2e3})}return i?s.jsxs(mde,{children:[e.createCommunication&&s.jsx(qx,{children:s.jsx(De,{testid:"timeline-form",onSubmit:T=>{b(T.text);const z=o.current;z&&(z.value="",z.focus())},children:s.jsxs(K,{spacing:"xs",noWrap:!0,style:{width:"100%"},children:[s.jsx(_i,{value:n}),s.jsx(le,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(pr,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(lce,{size:16})}),s.jsx(Vx,{onUpload:y,onUploadStart:k,onUploadProgress:$,onUploadError:I,children:T=>s.jsx(pr,{...T,radius:"xl",color:"blue",variant:"filled",children:s.jsx(Ix,{size:16})})})]})})}),c.map(T=>{var M;if(!T)return null;const z=`${T.resourceType}/${T.id}/${(M=T.meta)==null?void 0:M.versionId}`;if(T.resourceType===i.resourceType&&T.id===i.id)return s.jsx(vde,{history:a,resource:T,onDetails:E},z);switch(T.resourceType){case"AuditEvent":return s.jsx(_de,{resource:T,onDetails:j},z);case"Communication":return s.jsx(xde,{resource:T,onPin:T.priority!=="stat"?_:void 0,onUnpin:T.priority==="stat"?w:void 0,onDetails:j,onEdit:C,onDelete:P},z);case"DiagnosticReport":return s.jsx(bde,{resource:T,onDetails:j,onEdit:C,onDelete:P},z);case"Media":return s.jsx(wde,{resource:T,onDetails:j,onEdit:C,onDelete:P},z);default:return s.jsx(ca,{resource:T,padding:!0,children:s.jsx(Jx,{value:T,ignoreMissingValues:!0})},z)}})]}):s.jsx(ir,{style:{width:"100%",height:"100%"},children:s.jsx(dn,{})})}function js(e){return s.jsxs(X.Dropdown,{children:[s.jsx(X.Label,{children:"Resource"}),e.onPin&&s.jsx(X.Item,{icon:s.jsx(dce,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${et(e.resource)}`,children:"Pin"}),e.onUnpin&&s.jsx(X.Item,{icon:s.jsx(fce,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${et(e.resource)}`,children:"Unpin"}),e.onDetails&&s.jsx(X.Item,{icon:s.jsx(oce,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${et(e.resource)}`,children:"Details"}),e.onEdit&&s.jsx(X.Item,{icon:s.jsx(Zle,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${et(e.resource)}`,children:"Edit"}),e.onDelete&&s.jsxs(s.Fragment,{children:[s.jsx(X.Divider,{}),s.jsx(X.Label,{children:"Danger zone"}),s.jsx(X.Item,{color:"red",icon:s.jsx(i4,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${et(e.resource)}`,children:"Delete"})]})]})}function vde(e){const t=yde(e.history,e.resource);return t?s.jsx(ca,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(js,{...e}),children:s.jsx(pde,{original:t,revised:e.resource})}):s.jsxs(ca,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(js,{...e}),children:[s.jsx("h3",{children:"Created"}),s.jsx(Jx,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function yde(e,t){const r=e.entry,n=r.findIndex(o=>{var i,a,l;return((a=(i=o.resource)==null?void 0:i.meta)==null?void 0:a.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(n>=r.length-1))return r[n+1].resource}function xde(e){var o,i;const{classes:t}=gde(),n=!e.resource.priority||e.resource.priority==="routine"?void 0:t.pinnedComment;return s.jsx(ca,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:s.jsx(js,{...e}),children:s.jsx("p",{children:(i=(o=e.resource.payload)==null?void 0:o[0])==null?void 0:i.contentString})})}function wde(e){var n;const t=(n=e.resource.content)==null?void 0:n.contentType,r=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(ca,{resource:e.resource,padding:!!r,popupMenuItems:s.jsx(js,{...e}),children:s.jsx(zc,{value:e.resource.content})})}function _de(e){return s.jsx(ca,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(js,{...e}),children:s.jsx(ma,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function bde(e){return s.jsx(ca,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(js,{...e}),children:s.jsx(Gx,{value:e.resource})})}function Sde(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${zg(e.loaded)} / ${zg(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${zg(e.loaded)}`}function zg(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 Pde(e){return s.jsx(Om,{value:e.resource,loadTimelineResources:async(t,r,n)=>{const o=`${r}/${n}`,i=100;return Promise.allSettled([t.readHistory(r,n),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:i})])}})}function Se(e){const{children:t,...r}=e;return s.jsx(Vc,{children:s.jsx(qx,{...r,children:t})})}function Ode(e){return s.jsx(Om,{value:e.encounter,loadTimelineResources:async(t,r,n)=>Promise.allSettled([t.readHistory("Encounter",n),t.search("Communication","encounter=Encounter/"+n),t.search("Media","encounter=Encounter/"+n)]),createCommunication:(t,r,n)=>({resourceType:"Communication",status:"completed",encounter:dt(t),subject:t.subject,sender:dt(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",encounter:dt(t),subject:t.subject,operator:dt(r),issued:new Date().toISOString(),content:n})})}function jde(e){let t;try{t=Cse(e.path,e.resource)}catch(r){return console.warn("FhirPathDisplay:",r),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return s.jsx(To,{value:t[0]||"",propertyType:e.propertyType})}function Cde(e){return s.jsxs(Dr,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(oe,{display:"flex",sx:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(tC,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(tC,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(re,{sx:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function tC(e){return s.jsx(ne,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const Ede={string:[te.EQUALS,te.NOT,te.CONTAINS,te.EXACT],fulltext:[te.EQUALS,te.NOT,te.CONTAINS,te.EXACT],token:[te.EQUALS,te.NOT],reference:[te.EQUALS,te.NOT],numeric:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS],quantity:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS],date:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS,te.STARTS_AFTER,te.ENDS_BEFORE,te.APPROXIMATELY],datetime:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS,te.STARTS_AFTER,te.ENDS_BEFORE,te.APPROXIMATELY]},$de={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 Zx(e,t){return{...e,filters:t,offset:0,name:void 0}}function e1(e,t){return Zx(e,(e.filters??[]).filter(r=>r.code!==t))}function jm(e,t,r,n,o){o&&(e=e1(e,t));const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:r,value:n??""}),Zx(e,i)}function kde(e,t){if(!e.filters)return e;const r=[...e.filters];return r.splice(t,1),{...e,filters:r,name:void 0}}function Rde(e,t){return t1(e,t,-1)}function Tde(e,t){return t1(e,t,0)}function Ide(e,t){return t1(e,t,1)}function t1(e,t,r){const n=new Date;n.setDate(n.getDate()+r),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),n1(e,t,n,o)}function Dde(e,t){return r1(e,t,-1)}function Nde(e,t){return r1(e,t,0)}function Ade(e,t){return r1(e,t,1)}function r1(e,t,r){const n=new Date;n.setMonth(n.getMonth()+r),n.setDate(1),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),n1(e,t,n,o)}function Mde(e,t){const r=new Date;return r.setMonth(0),r.setDate(1),r.setHours(0,0,0,0),n1(e,t,r,new Date)}function n1(e,t,r,n){return e=e1(e,t),e=rC(e,t,te.GREATER_THAN_OR_EQUALS,r),e=rC(e,t,te.LESS_THAN_OR_EQUALS,n),e}function rC(e,t,r,n){return jm(e,t,r,n.toISOString())}function nC(e,t,r=!0){return jm(e,t,te.MISSING,r.toString())}function Lde(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function zde(e,t){const r=e.count??Lc,n=(t-1)*r;return Lde(e,n)}function Fde(e,t,r){return t===Vde(e)&&r!==void 0&&r===Bde(e)?e:{...e,sortRules:[{code:t,descending:!!r}],name:void 0}}function Vde(e){const t=e.sortRules;if(!t||t.length===0)return;const r=t[0].code;return r.startsWith("-")?r.substr(1):r}function Bde(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function Ude(e){return Ede[e.type]}function o1(e){return $de[e]??""}function bi(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(lr).join(" "))}function Wde(e,t){var n,o;const r=t.name;return r==="id"?e.id:r==="meta.versionId"?(n=e.meta)==null?void 0:n.versionId:r==="_lastUpdated"?Tr((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?Hde(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?Gde(e,t.searchParams[0]):null}function Hde(e,t){var i,a,l;const r=((l=(a=(i=t.path)==null?void 0:i.split("."))==null?void 0:a.pop())==null?void 0:l.replaceAll("[x]",""))??"",[n,o]=Fc({type:e.resourceType,value:e},r);return n?s.jsx(To,{property:t,propertyType:o,value:n,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function Gde(e,t){const r=dc(t.expression,[{type:e.resourceType,value:e}]);return!r||r.length===0?null:s.jsx(s.Fragment,{children:r.map((n,o)=>s.jsx(To,{propertyType:n.type,value:n.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${r.length}`))})}function qde(e){const t=f.useRef(!1),[r,n]=f.useState({search:JSON.parse(Rr(e.search))}),[o,i]=f.useState(!1);f.useEffect(()=>{n({search:e.search})},[e.search]);const a=f.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=Hae(c),d=_x(c);return Qde(u,d).sort((p,h)=>p.localeCompare(h)).map(p=>({value:p,label:bi(p)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){n({search:{...r.search,fields:c}})}return s.jsx(Dr,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(je,{children:[s.jsx(sm,{withinPortal:!0,style:{width:550},placeholder:"Select fields to display",data:a,value:r.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",dropdownPosition:"bottom",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(K,{position:"right",children:s.jsx(ne,{onClick:()=>e.onOk(r.search),children:"OK"})})]})})}function Qde(e,t){const r=[],n=new Set,o=new Set;for(const i of Object.keys(e.elements))r.push(i),n.add(i.toLowerCase()),o.add(bi(i));if(t)for(const i of Object.keys(t)){const a=bi(i);!n.has(i)&&!o.has(a)&&(r.push(i),n.add(i),o.add(a))}return r}function V4(e){var o;const{resourceType:t,filter:r}=e,n=(o=wi.types[t].searchParams)==null?void 0:o[r.code];if(n){if(n.type==="reference"&&(r.operator===te.EQUALS||r.operator===te.NOT_EQUALS))return s.jsx(Bc,{value:{reference:r.value}});const i=gm(t,n);if(r.code==="_lastUpdated"||i.type===ei.DATETIME)return s.jsx(s.Fragment,{children:Tr(r.value)})}return s.jsx(s.Fragment,{children:r.value})}function B4(e){const t=gm(e.resourceType,e.searchParam),r="filter-value";switch(t.type){case ei.REFERENCE:return s.jsx(Sm,{name:r,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:n=>{n?e.onChange(n.reference):e.onChange("")}});case ei.BOOLEAN:return s.jsx(Cn,{name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.checked.toString())});case ei.DATE:return s.jsx(le,{type:"date",name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.value)});case ei.DATETIME:return s.jsx(aa,{name:r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case ei.NUMBER:return s.jsx(le,{type:"number",name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.value)});case ei.QUANTITY:return s.jsx(sa,{name:r,defaultValue:Kde(e.defaultValue),autoFocus:e.autoFocus,onChange:n=>{n?e.onChange(`${n.value}`):e.onChange("")}});default:return s.jsx(le,{name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.value),placeholder:"Search value"})}}function Kde(e){if(e){const[t,r,n]=e.split("|");if(t)return{value:parseFloat(t),system:r,unit:n}}}function Yde(e){const[t,r]=f.useState(JSON.parse(Rr(e.search))),[n,o]=f.useState(-1),i=f.useRef(t);i.current=t,f.useEffect(()=>{r(JSON.parse(Rr(e.search)))},[e.search]);function a(d){r(jm(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=_x(l)??{},u=t.filters||[];return s.jsxs(Dr,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[s.jsx("div",{children:s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:120}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[u.map((d,p)=>p===n?s.jsx(oC,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[p]=h,r(Zx(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(Xde,{resourceType:l,searchParams:c,filter:d,onEdit:()=>o(p),onDelete:()=>r(kde(i.current,p))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(oC,{resourceType:l,searchParams:c,okText:"Add",onOk:a})]})]})}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function Xde(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:bi(t.code)}),s.jsx("td",{children:o1(t.operator)}),s.jsx("td",{children:s.jsx(V4,{resourceType:e.resourceType,filter:t})}),s.jsxs("td",{children:[s.jsx(ne,{compact:!0,variant:"outline",onClick:e.onEdit,children:"Edit"}),s.jsx(ne,{compact:!0,variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function oC(e){const[t,r]=f.useState(e.defaultValue??{}),n=f.useRef(t);n.current=t;function o(u){r({...n.current,code:u})}function i(u){r({...n.current,operator:u})}function a(u){r({...n.current,value:u})}const l=e.searchParams[t.code],c=l&&Ude(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ft,{"data-testid":"filter-field",defaultValue:n.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:bi(u)}))]})}),s.jsx("td",{children:c&&s.jsx(ft,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:o1(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(B4,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:a})}),s.jsxs("td",{children:[t.code&&t.operator&&s.jsx(ne,{compact:!0,variant:"outline",onClick:()=>{e.onOk(n.current),r({})},children:e.okText}),e.onCancel&&s.jsx(ne,{compact:!0,variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function Jde(e){const[t,r]=f.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function n(){e.onOk({...e.filter,value:t})}return s.jsx(Dr,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(De,{onSubmit:n,children:s.jsxs(nn,{children:[s.jsx(nn.Col,{span:10,children:s.jsx(B4,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:r})}),s.jsx(nn.Col,{span:2,children:s.jsx(ne,{onClick:n,fullWidth:!0,children:"OK"})})]})})})}function Zde(e){if(!e.searchParams)return null;function t(i,a){o(Fde(e.search,i.code,a))}function r(i){o(e1(e.search,i.code))}function n(i,a){e.onPrompt(i,{code:i.code,operator:a,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?s.jsx(efe,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:n,onChange:o,onClear:r}):s.jsx(X.Dropdown,{children:e.searchParams.map(i=>s.jsx(X.Item,{children:bi(i.code)},i.code))})}function efe(e){switch(e.searchParam.type){case"date":return s.jsx(tfe,{...e});case"number":case"quantity":return s.jsx(rfe,{...e});case"reference":return s.jsx(nfe,{...e});case"string":case"token":case"uri":return s.jsx(ofe,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function tfe(e){const{searchParam:t}=e,r=t.code;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(Dx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(X.Item,{icon:s.jsx(Nx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(bm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(_m,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(o4,{size:14}),onClick:()=>e.onPrompt(t,te.ENDS_BEFORE),children:"Before..."}),s.jsx(X.Item,{icon:s.jsx(n4,{size:14}),onClick:()=>e.onPrompt(t,te.STARTS_AFTER),children:"After..."}),s.jsx(X.Item,{icon:s.jsx(Vle,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Between..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ai,{size:14}),onClick:()=>e.onChange(Ide(e.search,r)),children:"Tomorrow"}),s.jsx(X.Item,{icon:s.jsx(Ai,{size:14}),onClick:()=>e.onChange(Tde(e.search,r)),children:"Today"}),s.jsx(X.Item,{icon:s.jsx(Ai,{size:14}),onClick:()=>e.onChange(Rde(e.search,r)),children:"Yesterday"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ai,{size:14}),onClick:()=>e.onChange(Ade(e.search,r)),children:"Next Month"}),s.jsx(X.Item,{icon:s.jsx(Ai,{size:14}),onClick:()=>e.onChange(Nde(e.search,r)),children:"This Month"}),s.jsx(X.Item,{icon:s.jsx(Ai,{size:14}),onClick:()=>e.onChange(Dde(e.search,r)),children:"Last Month"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ai,{size:14}),onClick:()=>e.onChange(Mde(e.search,r)),children:"Year to date"}),s.jsx(Cm,{...e})]})}function rfe(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(Dx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(X.Item,{icon:s.jsx(Nx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(bm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(_m,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(n4,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN),children:"Greater than..."}),s.jsx(X.Item,{icon:s.jsx(fy,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(X.Item,{icon:s.jsx(o4,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN),children:"Less than..."}),s.jsx(X.Item,{icon:s.jsx(fy,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Cm,{...e})]})}function nfe(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(bm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(_m,{size:14}),onClick:()=>e.onPrompt(t,te.NOT),children:"Does not equal..."}),s.jsx(Cm,{...e})]})}function ofe(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(Dx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(X.Item,{icon:s.jsx(Nx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(bm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(_m,{size:14}),onClick:()=>e.onPrompt(t,te.NOT),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Wle,{size:14}),onClick:()=>e.onPrompt(t,te.CONTAINS),children:"Contains..."}),s.jsx(X.Item,{icon:s.jsx(Ule,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Does not contain..."}),s.jsx(Cm,{...e})]})}function Cm(e){const{searchParam:t}=e,r=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(zle,{size:14}),onClick:()=>e.onChange(nC(e.search,r)),children:"Missing"}),s.jsx(X.Item,{icon:s.jsx(Lle,{size:14}),onClick:()=>e.onChange(nC(e.search,r,!1)),children:"Not missing"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(dh,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function ife(e){const t=e.resourceType,r=[];for(const n of e.fields||["id","_lastUpdated"])r.push(afe(t,n));return r}function afe(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 r=Sa(e,t),n=Jae(e,t.toLowerCase());if(r&&n)return{name:t,elementDefinition:r,searchParams:[n]};if(r){const i=_x(e);let a;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);a=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),a.length===0&&(a=void 0)}return{name:t,elementDefinition:r,searchParams:a}}if(n){const i=gm(e,n);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[n]}}return{name:t}}class sfe extends Event{constructor(t){super("change"),this.definition=t}}class lfe extends Event{constructor(t){super("load"),this.response=t}}class ph extends Event{constructor(t,r){super("click"),this.resource=t,this.browserEvent=r}}const cfe=W(e=>({root:{maxWidth:"100%",overflow:"auto",textAlign:"left",marginBottom:"20px"},table:{cursor:"pointer"},tr:{"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.colors.gray[0]}},th:{padding:"0 !important"},control:{width:"100%",padding:`${e.spacing.xs} ${e.spacing.md}`,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]}},icon:{width:21,height:21,borderRadius:21}}));function ufe(e){var L,q,Y;const{classes:t}=cfe(),r=ae(),[n,o]=f.useState(!1),[i,a]=f.useState(),{search:l,onLoad:c}=e,[u,d]=f.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),p=f.useRef(u);p.current=u;const h=l.total??"accurate",m=f.useCallback(R=>{a(void 0),r.search(l.resourceType,Za({...l,total:h,fields:void 0}),R).then(N=>{d({...p.current,searchResponse:N}),c&&c(new lfe(N))}).catch(N=>{d({...p.current,searchResponse:void 0}),a(N)})},[r,l,h,c]),v=f.useCallback(()=>{d({...p.current,searchResponse:void 0}),m({cache:"reload"})},[m]);f.useEffect(()=>{m()},[m]);function g(R,N){R.stopPropagation();const Q=R.target.checked,ee={...p.current.selected};Q?ee[N]=!0:delete ee[N],d({...p.current,selected:ee})}function b(R){R.stopPropagation();const V=R.target.checked,Q={},ee=p.current.searchResponse;V&&(ee!=null&&ee.entry)&&ee.entry.forEach(_e=>{var we;(we=_e.resource)!=null&&we.id&&(Q[_e.resource.id]=!0)}),d({...p.current,selected:Q})}function y(){var N,V;const R=p.current;if(!((N=R.searchResponse)!=null&&N.entry)||R.searchResponse.entry.length===0)return!1;for(const Q of R.searchResponse.entry)if((V=Q.resource)!=null&&V.id&&!R.selected[Q.resource.id])return!1;return!0}function x(R){e.onChange&&e.onChange(new sfe(R))}function _(R,N){if(s4(R.target)||R.button===2)return;st(R);const V=R.button===1||R.ctrlKey||R.metaKey;!V&&e.onClick&&e.onClick(new ph(N,R)),V&&e.onAuxClick&&e.onAuxClick(new ph(N,R))}function w(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(f.useEffect(()=>{o(!1),r.requestSchema(e.search.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.search.resourceType]),!n)return s.jsx(ir,{style:{width:"100%",height:"100%"},children:s.jsx(dn,{})});const j=e.checkboxesEnabled,C=ife(l),P=l.resourceType,E=u.searchResponse,k=E==null?void 0:E.entry,$=k==null?void 0:k.map(R=>R.resource),I="subtle",T="gray",z=16,M=window.innerWidth<768;return s.jsxs("div",{className:t.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(K,{position:"apart",mb:"xl",children:[s.jsxs(K,{spacing:2,children:[s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(Qle,{size:z}),onClick:()=>d({...p.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(tce,{size:z}),onClick:()=>d({...p.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(ece,{size:z}),onClick:e.onNew,children:"New..."}),!M&&w()&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(bce,{size:z}),onClick:e.onExport?e.onExport:()=>d({...p.current,exportDialogVisible:!0}),children:"Export..."}),!M&&e.onDelete&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(i4,{size:z}),onClick:()=>e.onDelete(Object.keys(u.selected)),children:"Delete..."}),!M&&e.onBulk&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(Fle,{size:z}),onClick:()=>e.onBulk(Object.keys(u.selected)),children:"Bulk..."})]}),s.jsxs(K,{spacing:2,children:[E&&s.jsxs(re,{size:"xs",color:"dimmed",children:[hfe(l,E.total),"-",mfe(l,E.total)," of"," ",`${h==="estimate"?"~":""}${(L=E.total)==null?void 0:L.toLocaleString()}`]}),s.jsx(pr,{title:"Refresh",onClick:v,children:s.jsx(gce,{size:"1.125rem"})})]})]}),s.jsxs(xa,{className:t.table,children:[s.jsxs("thead",{children:[s.jsxs("tr",{children:[j&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:y(),onChange:R=>b(R)})}),C.map(R=>s.jsx("th",{children:s.jsxs(X,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(X.Target,{children:s.jsx(So,{className:t.control,children:s.jsxs(K,{position:"apart",noWrap:!0,children:[s.jsx(re,{weight:500,size:"sm",children:bi(R.name)}),s.jsx(ir,{className:t.icon,children:s.jsx(Nle,{size:14,stroke:1.5})})]})})}),s.jsx(Zde,{search:e.search,searchParams:R.searchParams,onPrompt:(N,V)=>{d({...p.current,filterDialogVisible:!0,filterDialogSearchParam:N,filterDialogFilter:V})},onChange:N=>{x(N)}})]})},R.name))]}),!e.hideFilters&&s.jsxs("tr",{children:[j&&s.jsx("th",{}),C.map(R=>s.jsx("th",{children:R.searchParams&&s.jsx(dfe,{resourceType:P,searchParams:R.searchParams,filters:e.search.filters})},R.name))]})]}),s.jsx("tbody",{children:$==null?void 0:$.map(R=>R&&s.jsxs("tr",{className:t.tr,"data-testid":"search-control-row",onClick:N=>_(N,R),onAuxClick:N=>_(N,R),children:[j&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${R.id}`,checked:!!u.selected[R.id],onChange:N=>g(N,R.id)})}),C.map(N=>s.jsx("td",{children:Wde(R,N)},N.name))]},R.id))})]}),($==null?void 0:$.length)===0&&s.jsx(Vc,{children:s.jsx(ir,{style:{height:150},children:s.jsx(re,{size:"xl",color:"dimmed",children:"No results"})})}),(E==null?void 0:E.total)!==void 0&&E.total>0&&s.jsx(ir,{m:"md",p:"md",children:s.jsx(oo,{value:ffe(l),total:pfe(l,E.total),onChange:R=>x(zde(l,R)),getControlProps:R=>{switch(R){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),i&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),s.jsx(qde,{search:e.search,visible:p.current.fieldEditorVisible,onOk:R=>{x(R),d({...p.current,fieldEditorVisible:!1})},onCancel:()=>{d({...p.current,fieldEditorVisible:!1})}}),s.jsx(Yde,{search:e.search,visible:p.current.filterEditorVisible,onOk:R=>{x(R),d({...p.current,filterEditorVisible:!1})},onCancel:()=>{d({...p.current,filterEditorVisible:!1})}}),s.jsx(Cde,{visible:p.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{d({...p.current,exportDialogVisible:!1})}}),s.jsx(Jde,{visible:p.current.filterDialogVisible,title:(q=u.filterDialogSearchParam)!=null&&q.code?bi(u.filterDialogSearchParam.code):"",resourceType:P,searchParam:u.filterDialogSearchParam,filter:u.filterDialogFilter,defaultValue:"",onOk:R=>{x(jm(e.search,R.code,R.operator,R.value)),d({...p.current,filterDialogVisible:!1})},onCancel:()=>{d({...p.current,filterDialogVisible:!1})}},(Y=u.filterDialogSearchParam)==null?void 0:Y.code)]})}const Wc=f.memo(ufe);function dfe(e){const t=(e.filters??[]).filter(r=>e.searchParams.find(n=>n.code===r.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(r=>s.jsxs("div",{children:[o1(r.operator)," ",s.jsx(V4,{resourceType:e.resourceType,filter:r})]},`filter-${r.code}-${r.operator}-${r.value}`))})}function ffe(e){return Math.floor((e.offset??0)/(e.count??Lc))+1}function pfe(e,t){const r=e.count??Lc;return Math.ceil(t/r)}function hfe(e,t){return Math.min(t,(e.offset??0)+1)}function mfe(e,t){return Math.min(t,((e.offset??0)+1)*(e.count??Lc))}function gfe(e){const t=ae(),[r,n]=f.useState(!1),[o,i]=f.useState(),{query:a,fields:l}=e,[c,u]=f.useState(),[d,p]=f.useState({}),h=f.useRef();h.current=c;const m=f.useRef({});m.current=d,f.useEffect(()=>{i(void 0),t.graphql(a).then(u).catch(_=>i(ct(_)))},[t,a]);function v(_,w){_.stopPropagation();const C=_.target.checked,P={...m.current};C?P[w]=!0:delete P[w],p(P)}function g(_){var E;_.stopPropagation();const j=_.target.checked,C={},P=(E=h.current)==null?void 0:E.data.ResourceList;j&&P&&P.forEach(k=>{k.id&&(C[k.id]=!0)}),p(C)}function b(){var w;const _=(w=h.current)==null?void 0:w.data.ResourceList;if(!_||_.length===0)return!1;for(const j of _)if(j.id&&!m.current[j.id])return!1;return!0}function y(_,w){s4(_.target)||(st(_),_.button!==1&&e.onClick&&e.onClick(new ph(w,_)),_.button===1&&e.onAuxClick&&e.onAuxClick(new ph(w,_)))}if(f.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>n(!0)).catch(console.log)},[t,e.resourceType]),!r)return s.jsx(dn,{});const x=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:_=>st(_),"data-testid":"search-control",children:[s.jsxs(xa,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[x&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:b(),onChange:_=>g(_)})}),l.map(_=>s.jsx("th",{children:_.name},_.name))]})}),s.jsx("tbody",{children:c==null?void 0:c.data.ResourceList.map(_=>_&&s.jsxs("tr",{"data-testid":"search-control-row",onClick:w=>y(w,_),onAuxClick:w=>y(w,_),children:[x&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${_.id}`,checked:!!d[_.id],onChange:w=>v(w,_.id)})}),l.map(w=>s.jsx("td",{children:s.jsx(jde,{propertyType:w.propertyType,path:w.fhirPath,resource:_})},w.name))]},_.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&s.jsx(ne,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const vfe=f.memo(gfe);function kn(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),s.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function yfe(e){const{group:t}=e;return s.jsx(sn,{withBorder:!0,radius:"md",p:"xs",display:"flex",sx:{alignItems:"center",justifyContent:"center"},children:s.jsxs(K,{children:[t.measureScore&&s.jsx(_fe,{group:t}),!t.measureScore&&s.jsx(wfe,{group:t})]})})}function xfe(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(re,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(re,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function wfe(e){const{group:t}=e,r=t.population,n=r==null?void 0:r.find(c=>Ps(c.code)==="numerator"),o=r==null?void 0:r.find(c=>Ps(c.code)==="denominator"),i=n==null?void 0:n.count,a=o==null?void 0:o.count;if(a===0)return s.jsxs(oe,{children:[s.jsx(he,{order:3,children:"Not Applicable"}),s.jsx(re,{children:`Denominator: ${a}`})]});if(i===void 0||a===void 0)return s.jsxs(oe,{children:[s.jsx(he,{order:3,children:"Insufficient Data"}),s.jsx(re,{children:`Numerator: ${i}`}),s.jsx(re,{children:`Denominator: ${a}`})]});const l=i/a*100;return s.jsx(fx,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:U4(l)}],label:s.jsx(sp,{justify:"center",children:s.jsxs(re,{fw:700,fz:18,children:[i," / ",a]})})})}function _fe(e){var n,o,i;const{group:t}=e,r=((n=t.measureScore)==null?void 0:n.unit)??((o=t.measureScore)==null?void 0:o.code);return s.jsx(s.Fragment,{children:r==="%"?s.jsx(fx,{size:120,thickness:12,roundCaps:!0,sections:[{value:bfe(t),color:U4(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(sp,{justify:"center",children:s.jsx(re,{fw:700,fz:18,children:s.jsx(fc,{value:t.measureScore})})})}):s.jsx(sp,{h:120,align:"center",children:s.jsx(he,{order:3,children:s.jsx(fc,{value:t.measureScore})})})})}function bfe(e){var n,o;const t=(n=e.measureScore)==null?void 0:n.value,r=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&r==="%"?t*100:t:0}function U4(e){return e<=33?"red":e<=67?"yellow":"green"}function Sfe(e){var n;const t=Ke(e.measureReport),[r]=Ole("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(oe,{children:[r&&s.jsx(xfe,{measure:r}),s.jsx(MN,{cols:3,breakpoints:[{maxWidth:"48rem",cols:2,spacing:"md"},{maxWidth:"36rem",cols:1,spacing:"sm"}],spacing:"md",children:(n=t.group)==null?void 0:n.map((o,i)=>s.jsx(yfe,{group:o},o.id??i))})]}):null}function ji(e){var r;const t=((r=e.outcome)==null?void 0:r.issue)||e.issues;return!t||t.length===0?null:s.jsx(Cc,{icon:s.jsx(xm,{size:16}),color:"red",children:t.map(n=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:V5(n)},(o=n.details)==null?void 0:o.text)})})}function Pfe(e){const t=f.useCallback((r,n,o)=>{const i=`${n}/${o}`,a=100;return Promise.allSettled([r.readHistory("Patient",o),r.search("Communication",{subject:i,_count:a}),r.search("Device",{patient:i,_count:a}),r.search("DeviceRequest",{patient:i,_count:a}),r.search("DiagnosticReport",{subject:i,_count:a}),r.search("Media",{subject:i,_count:a}),r.search("ServiceRequest",{subject:i,_count:a}),r.search("Task",{subject:i,_count:a})])},[]);return s.jsx(Om,{value:e.patient,loadTimelineResources:t,createCommunication:(r,n,o)=>({resourceType:"Communication",status:"completed",subject:dt(r),sender:dt(n),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,n,o)=>({resourceType:"Media",status:"completed",subject:dt(r),operator:dt(n),issued:new Date().toISOString(),content:o})})}const W4=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}}}));function Ofe(e){const t=ae(),r=Ke(e.value),[n,o]=f.useState(!1),[i,a]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){c(void 0)}function h(){a(void 0)}const m=f.useRef();if(m.current=u,f.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(d(Rfe(r??{resourceType:"PlanDefinition"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!u)return null;function v(g,b){d({...m.current,[g]:b})}return s.jsx("div",{children:s.jsxs(De,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[s.jsx(le,{label:"Plan Title",defaultValue:u.title,onChange:g=>v("title",g.currentTarget.value)}),s.jsx(H4,{actions:u.action||[],selectedKey:i,setSelectedKey:a,hoverKey:l,setHoverKey:c,onChange:g=>v("action",g)}),s.jsx(ne,{type:"submit",children:"Save"})]})})}function H4(e){const{classes:t}=W4(),r=f.useRef();r.current=e.actions;function n(a){e.onChange(r.current.map(l=>l.id===a.id?a:l))}function o(a){e.onChange([...r.current,a]),e.setSelectedKey(a.id)}function i(a){e.onChange(r.current.filter(l=>l!==a))}return s.jsxs("div",{className:t.section,children:[e.actions.map(a=>s.jsx("div",{children:s.jsx(jfe,{action:a,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(a)})},a.id)),s.jsx("div",{className:t.bottomActions,children:s.jsx(Le,{href:"#",onClick:a=>{st(a),o({id:q4()})},children:"Add action"})})]})}function jfe(e){const{classes:t,cx:r}=W4(),{action:n}=e,o=kfe(n),i=e.selectedKey===e.action.id,a=e.hoverKey===e.action.id;function l(d){d.stopPropagation(),e.setSelectedKey(e.action.id)}function c(d){st(d),e.setHoverKey(e.action.id)}const u=r(t.section,{[t.editing]:i,[t.hovering]:a&&!i});return s.jsxs("div",{"data-testid":n.id,className:u,onClick:l,onMouseOver:c,children:[i?s.jsx(Efe,{action:n,actionType:o,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx(Cfe,{action:n,actionType:o}),s.jsx("div",{className:t.bottomActions,children:s.jsx(Le,{href:"#",onClick:d=>{d.preventDefault(),e.onRemove()},children:"Remove"})})]})}const vy={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function Cfe(e){const{action:t,actionType:r}=e,[n,o]=G4(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",r&&`(${r})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(fh,{value:{reference:t.definitionCanonical}})}),n&&s.jsx("div",{children:s.jsx(To,{property:vy,propertyType:o,value:n})})]})}function Efe(e){const{action:t}=e,[r,n]=f.useState(e.actionType);function o(i,a){e.onChange({...t,[i]:a})}return s.jsxs(je,{spacing:"xl",children:[s.jsx(le,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),s.jsx(le,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),s.jsx(ft,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:r,onChange:i=>n(i.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&s.jsx(H4,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:i=>o("action",i)}),(()=>{switch(r){case"appointment":return s.jsx(Qu,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(Qu,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(Qu,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(Qu,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(tt,{title:"Timing",description:"When the action should take place.",children:s.jsx($fe,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function Qu(e){const{id:t,definitionCanonical:r}=e.action,n=r!=null&&r.startsWith(e.resourceType+"/")?{reference:r}:void 0;return s.jsx(zs,{name:t,resourceType:e.resourceType,defaultValue:n,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:et(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function $fe(e){const t=e.action,r="timing",[n,o]=G4(t);return s.jsx(la,{property:vy,name:"timing[x]",defaultValue:n,defaultPropertyType:o,onChange:(i,a)=>{e.onChange(hy(t,r,a??r,vy,i))}})}function kfe(e){var t,r,n;if((t=e.definitionCanonical)!=null&&t.startsWith("Schedule"))return"appointment";if((r=e.definitionCanonical)!=null&&r.startsWith("Questionnaire/"))return"questionnaire";if((n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition/"))return"task"}function G4(e){return Fc({type:"PlanDefinitionAction",value:e},"timing")}let Fg=1;function q4(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Fg=Math.max(Fg,t+1))}return e}return"id-"+Fg++}function Rfe(e){return{...e,action:Q4(e.action)}}function Q4(e){if(e)return e.map(t=>({...t,id:q4(t.id),action:Q4(t.action)}))}var it=(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))(it||{});function Tfe(e){return e.type==="choice"||e.type==="open-choice"}function Ife(e,t){if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const n of e.enableWhen){const o=K4(t,n.question);if(n.operator==="exists"&&!n.answerBoolean&&!(o!=null&&o.length)){if(r==="any")return!0;continue}const{anyMatch:i,allMatch:a}=Afe(n,o,r);if(r==="any"&&i)return!0;if(r==="all"&&!a)return!1}return r!=="any"}function Dfe(e,t,r){return e.map(n=>{var a;const o=(a=r.answerOption)==null?void 0:a.find(l=>ba(l.valueCoding)===n||l[t]===n),i=hr({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function K4(e,t){if(e)for(const r of e){if(r.linkId===t)return r.answer;if(r.item){const n=K4(r.item,t);if(n)return n}}}function Nfe(e,t,r){if(r==="exists")return!!e===t.value;if(e){const n=r==="="||r==="!="?r==null?void 0:r.replace("=","~"):r,[{value:o}]=dc(`%actualAnswer ${n} %expectedAnswer`,[e],{actualAnswer:e,expectedAnswer:t});return o}else return!1}function Afe(e,t,r){const n=t||[],o=hr({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,a=!0;for(const l of n){const c=hr({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(Nfe(c,o,u)?i=!0:a=!1,r==="any"&&i)break}return{anyMatch:i,allMatch:a}}function Y4(e){var r,n;const t=yx(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(n=(r=t.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:n.map(o=>o.code)}}function Vg(e,t){var o;const r=_a(e);let n=yx(r,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(n&&(r.extension=(o=r.extension)==null?void 0:o.filter(i=>i!==n)),r):(n||(r.extension||(r.extension=[]),n={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},r.extension.push(n)),t.length===1?(n.valueCode=t[0],delete n.valueCodeableConcept):(n.valueCodeableConcept={coding:t.map(i=>({code:i}))},delete n.valueCode),r)}function Mfe(e){return{resourceType:"QuestionnaireResponse",questionnaire:et(e),item:X4(e.item)}}function X4(e){return(e==null?void 0:e.map(J4))??[]}function J4(e){var t;return{id:zfe(),linkId:e.linkId,text:e.text,item:X4(e.item),answer:((t=e.initial)==null?void 0:t.map(Ffe))??[]}}let Lfe=1;function zfe(){return"id-"+Lfe++}function Ffe(e){return{...e}}function Vfe(e){return e.value.display||e.value.reference||Rr(e.value)}function Bfe(e){var r,n,o,i;const t=(r=e==null?void 0:e.item)==null?void 0:r[0];if(t){const a=yx(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(n=a==null?void 0:a.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}function yy(e){const t=e.item,r=e.response;function n(c){var d,p,h,m;let u;Array.isArray(c)?u=c:e.index>=(((p=(d=e.response)==null?void 0:d.answer)==null?void 0:p.length)??0)?u=(((h=e.response)==null?void 0:h.answer)??[]).concat([c]):u=(((m=e.response)==null?void 0:m.answer)??[]).map((g,b)=>b===e.index?c:g)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:t.text,answer:u})}const o=t.type;if(!o)return null;const i=t.linkId;if(!i)return null;const a=t.initial&&t.initial.length>0?t.initial[0]:void 0,l=i1(r,e.index)??hr({type:"QuestionnaireItemInitial",value:a},"value");switch(o){case it.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case it.boolean:return s.jsx(h4,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Cn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:l==null?void 0:l.value,onChange:c=>n({valueBoolean:c.currentTarget.checked})})},e.item.linkId);case it.decimal:return s.jsx(le,{type:"number",step:"any",id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDecimal:c.currentTarget.valueAsNumber})});case it.integer:return s.jsx(le,{type:"number",step:1,id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueInteger:c.currentTarget.valueAsNumber})});case it.date:return s.jsx(le,{type:"date",id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDate:c.currentTarget.value})});case it.dateTime:return s.jsx(aa,{name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDateTime:c})});case it.time:return s.jsx(le,{type:"time",id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueTime:c.currentTarget.value})});case it.string:case it.url:return s.jsx(le,{id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueString:c.currentTarget.value})});case it.text:return s.jsx(Rc,{id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueString:c.currentTarget.value})});case it.attachment:return s.jsx(K,{py:4,children:s.jsx(u4,{name:i,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueAttachment:c})})});case it.reference:return s.jsx(Sm,{name:i,required:t.required,targetTypes:Y4(t),defaultValue:l==null?void 0:l.value,onChange:c=>n({valueReference:c})});case it.quantity:return s.jsx(sa,{name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueQuantity:c}),disableWheel:!0});case it.choice:case it.openChoice:return Qfe(t)&&!t.answerValueSet?s.jsx(Ufe,{name:i,item:t,initial:a,response:r,onChangeAnswer:c=>n(c)}):s.jsx(Wfe,{name:i,item:t,initial:a,response:r,onChangeAnswer:c=>n(c)});default:return null}}function Ufe(e){var c;const{name:t,item:r,initial:n,response:o}=e;if(!((c=r.answerOption)!=null&&c.length))return s.jsx(Z4,{});const i=hr({type:"QuestionnaireItemInitial",value:n},"value"),a=[""];for(const u of r.answerOption){const d=hr({type:"QuestionnaireItemAnswerOption",value:u},"value");a.push(iC(d))}const l=i1(o)??i;if(r.repeats){const{propertyName:u,data:d}=Kfe(e.item),p=Gfe(o);return s.jsx(sm,{data:d,placeholder:"Select items",searchable:!0,defaultValue:p||[iC(i)],onChange:h=>{const m=Dfe(h,u,r);e.onChangeAnswer(m)}})}return s.jsx(ft,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const p=r.answerOption[d-1],h=hr({type:"QuestionnaireItemAnswerOption",value:p},"value"),m="value"+lr(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:ba(l==null?void 0:l.value)||(l==null?void 0:l.value),data:a})}function Wfe(e){var a;const{name:t,item:r,initial:n,onChangeAnswer:o,response:i}=e;return!((a=r.answerOption)!=null&&a.length)&&!r.answerValueSet?s.jsx(Z4,{}):r.answerValueSet?s.jsx(g4,{name:t,binding:r.answerValueSet,onChange:l=>o({valueCoding:l})}):s.jsx(Hfe,{name:(i==null?void 0:i.id)??t,item:r,initial:n,response:i,onChangeAnswer:o})}function Hfe(e){const{name:t,item:r,initial:n,onChangeAnswer:o,response:i}=e,a=Sa("QuestionnaireItemAnswerOption","value[x]"),l=hr({type:"QuestionnaireItemInitial",value:n},"value"),c=[];let u;if(r.answerOption)for(let h=0;h<r.answerOption.length;h++){const m=r.answerOption[h],v=`${t}-option-${h}`,g=hr({type:"QuestionnaireItemAnswerOption",value:m},"value");l&&Rr(g)===Rr(l)&&(u=v),c.push([v,g])}const d=i1(i),p=qfe(c,d);return s.jsx(Up.Group,{name:t,value:p??u,onChange:h=>{const m=c.find(v=>v[0]===h);if(m){const v=m[1],g="value"+lr(v.type);o({[g]:v.value})}},children:c.map(([h,m])=>s.jsx(Up,{id:h,value:h,py:4,label:s.jsx(To,{property:a,propertyType:m.type,value:m.value})},h))})}function Z4(){return s.jsx(le,{disabled:!0,placeholder:"No Answers Defined"})}function e3(e){return hr({type:"QuestionnaireItemAnswer",value:e},"value")}function i1(e,t=0){const r=e.answer;return e3((r==null?void 0:r[t])??{})}function Gfe(e){const t=e.answer;return t?t.map(n=>e3(n)).map(n=>ba(n==null?void 0:n.value)||(n==null?void 0:n.value)):[]}function qfe(e,t){var r;return(r=e.find(n=>pm(n[1].value,t==null?void 0:t.value)))==null?void 0:r[0]}function iC(e){if(e)return e.type==="CodeableConcept"?Ps(e.value):e.type==="Coding"?ba(e.value):e.type==="Reference"?Vfe(e):e.value.toString()}function Qfe(e){var t;return!!((t=e.extension)!=null&&t.some(r=>{var n,o,i;return r.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(n=r.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code)==="drop-down"}))}function Kfe(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],r=hr({type:"QuestionnaireItemAnswerOption",value:t},"value"),n="value"+lr(r.type),o=(e.answerOption??[]).map(a=>({value:aC(a,n),label:aC(a,n)}));return{propertyName:n,data:o}}function aC(e,t){var r;return ba(e.valueCoding)||((r=e[t])==null?void 0:r.toString())}const Yfe=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},questionBody:{maxWidth:600},topActions:{position:"absolute",right:32,top:1,padding:4,color:e.colors.gray[5],fontSize:e.fontSizes.xs},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementActions:{position:"absolute",right:8,top:0,paddingTop:8,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementIcons:{color:e.colors.gray[5]},columnAlignment:{display:"flex",flexDirection:"column"},linkIdInput:{width:100,marginBottom:4},typeSelect:{width:100}}));function Xfe(e){const t=ae(),r=Ke(e.questionnaire),[n,o]=f.useState(!1),[i,a]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){d(void 0)}function h(){c(void 0)}return f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(a(tpe(r??{resourceType:"Questionnaire"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!i?null:s.jsx("div",{children:s.jsxs(De,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[s.jsx(t3,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:a}),s.jsx(ne,{type:"submit",children:"Save"})]})})}function t3(e){var j;const{classes:t,cx:r}=Yfe(),n=e.item,o=e.item,i=Fo(e.item),a=i||o.type===it.group,l=o.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,d=f.useRef();d.current=e.item;function p(C){st(C),e.setSelectedKey(e.item.id)}function h(C){st(C),e.setHoverKey(e.item.id)}function m(C){var E;const P=d.current;e.onChange({...P,item:(E=P.item)==null?void 0:E.map(k=>k.id===C.id?C:k)})}function v(C){e.onChange({...e.item,item:[...e.item.item??[],C]})}function g(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.filter(E=>E!==C)})}function b(C,P){e.onChange({...d.current,[C]:P})}function y(C){e.onChange({...e.item,...C})}function x(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.map(E=>E===C?{...E,repeats:!E.repeats}:E)})}function _(C,P){const E=ope(e.item.item,C,P);e.onChange({...e.item,item:E})}const w=r(t.section,{[t.editing]:c,[t.hovering]:u&&!c});return s.jsxs("div",{"data-testid":o.linkId,className:w,onClick:p,onMouseOver:h,children:[s.jsx("div",{className:t.questionBody,children:c?s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{size:"xl",defaultValue:n.title,onChange:C=>b("title",C.currentTarget.value)}),!i&&s.jsx(Rc,{autosize:!0,minRows:2,defaultValue:o.text,onChange:C=>b("text",C.currentTarget.value)}),o.type==="reference"&&s.jsx(epe,{item:o,onChange:y}),Tfe(o)&&s.jsx(Jfe,{item:o,onChange:C=>y(C)})]}):s.jsxs(s.Fragment,{children:[n.title&&s.jsx(he,{children:n.title}),o.text&&s.jsx("div",{children:o.text}),!a&&s.jsx(yy,{item:o,index:0,onChange:()=>{},response:{}})]})}),(j=o.item)==null?void 0:j.map((C,P)=>s.jsx("div",{children:s.jsx(t3,{item:C,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:P===0,isLast:P===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:m,onRemove:()=>g(C),onRepeatable:x,onMoveUp:()=>_(P,-1),onMoveDown:()=>_(P,1)})},C.id)),!a&&s.jsx("div",{className:t.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:"xs",className:t.linkIdInput,defaultValue:o.linkId,onChange:C=>b("linkId",C.currentTarget.value)}),!a&&s.jsx(ft,{size:"xs",className:t.typeSelect,defaultValue:o.type,onChange:C=>b("type",C.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:l})}),!i&&s.jsx(oe,{className:t.movementActions,children:s.jsxs(oe,{className:t.columnAlignment,children:[!e.isFirst&&s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(Mle,{"data-testid":"up-button",size:15,className:t.movementIcons})}),!e.isLast&&s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(Ale,{"data-testid":"down-button",size:15,className:t.movementIcons})})]})}),s.jsxs("div",{className:t.bottomActions,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),v({id:ua(),linkId:_y("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),v({id:ua(),linkId:_y("g"),type:"group",text:"Group"})},children:"Add group"})]}),i&&s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),v(npe())},children:"Add Page"}),c&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onRepeatable&&e.onRepeatable(o)},children:o.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function Jfe(e){const t=Sa("QuestionnaireItemAnswerOption","value[x]"),r=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(le,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:n=>e.onChange({...e.item,answerValueSet:n.target.value})}):s.jsx(Zfe,{options:r,property:t,item:e.item,onChange:e.onChange}),s.jsxs(oe,{display:"flex",children:[s.jsx(Le,{href:"#",onClick:n=>{st(n),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...r,{id:ua()}]})},children:"Add choice"}),s.jsx(fm,{w:"lg"}),s.jsx(Le,{href:"#",onClick:n=>{st(n),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function Zfe(e){return s.jsx("div",{children:e.options.map(t=>{const[r,n]=Fc({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(la,{name:"value[x]",property:e.property,defaultPropertyType:n,defaultValue:r,onChange:(o,i)=>{const a=[...e.options],l=a.findIndex(c=>c.id===t.id);a[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:a})}},t.id)}),s.jsx("div",{children:s.jsx(Le,{href:"#",onClick:o=>{st(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function epe(e){const t=Y4(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((r,n)=>s.jsxs(K,{children:[s.jsx(Fx,{name:"resourceType",placeholder:"Resource Type",defaultValue:r,onChange:o=>{e.onChange(Vg(e.item,t.map(i=>i===r?o:i)))}}),s.jsx(Le,{href:"#",onClick:o=>{st(o),e.onChange(Vg(e.item,t.filter(i=>i!==r)))},children:"Remove"})]},`${r}-${n}`)),s.jsx(Le,{href:"#",onClick:r=>{st(r),e.onChange(Vg(e.item,[...t,""]))},children:"Add Resource Type"})]})}let xy=1,wy=1;function _y(e){return e+xy++}function ua(){return"id-"+wy++}function tpe(e){return{...e,id:e.id||ua(),item:r3(e.item)}}function r3(e){if(e)return e.forEach(t=>{var r,n;(r=t.id)!=null&&r.match(/^id-\d+$/)&&(wy=Math.max(wy,parseInt(t.id.substring(3),10)+1)),(n=t.linkId)!=null&&n.match(/^q\d+$/)&&(xy=Math.max(xy,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||ua(),item:r3(t.item),answerOption:rpe(t.answerOption)}))}function rpe(e){if(e)return e.map(t=>({...t,id:t.id||ua()}))}function npe(){return{id:ua(),linkId:_y("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 ope(e,t,r){const n=e??[],o=t+r;if(o<0||o>=n.length)return n;const i=[...n];return[i[t],i[o]]=[i[o],i[t]],i}function n3(e){const{item:t,response:r,onChange:n}=e,[o,i]=f.useState(ipe(t,r??{}));if(!e.checkForQuestionEnabled(t)||!r)return null;if(t.type===it.display)return s.jsx("p",{children:t.text},t.linkId);const a=(t==null?void 0:t.repeats)&&t.type!==it.choice&&t.type!==it.openChoice;return t.type===it.boolean?s.jsx(yy,{item:t,response:r,onChange:l=>n([l]),index:0},t.linkId):s.jsxs(tt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx(yy,{item:t,response:r,onChange:u=>n([u]),index:c},`${t.linkId}-${c}`)),a&&s.jsx(Le,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function ipe(e,t){if(e.type===it.choice||e.type===it.openChoice)return 1;const r=t.answer;return r!=null&&r.length?r.length:1}function o3(e){const[t,r]=f.useState(e.response);if(t.length===0)return null;function n(i,a){const l=t.map((c,u)=>u===a?i[0]:c);r(l),e.onChange(l)}function o(){const i=J4(e.item);r([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,a)=>s.jsx(i3,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>n(l,a)},i.id)),e.item.repeats&&s.jsx(Le,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function i3(e){var i;const{response:t,checkForQuestionEnabled:r,onChange:n}=e;function o(a){var d;const l=(d=t.item)==null?void 0:d.map(p=>a.find(m=>m.id===p.id)??p),c=l==null?void 0:l.concat(a.slice(1)),u={...t,item:c};n([u])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(he,{order:3,mb:"md",children:e.item.text}),s.jsx(je,{children:(i=e.item.item)==null?void 0:i.map(a=>{var l,c,u;return a.type===it.group?a.repeats?s.jsx(o3,{item:a,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===a.linkId))??[],checkForQuestionEnabled:r,onChange:o},a.linkId):s.jsx(i3,{item:a,checkForQuestionEnabled:r,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===a.linkId))??{},onChange:o},a.linkId):s.jsx(n3,{item:a,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===a.linkId),onChange:o,checkForQuestionEnabled:r},a.linkId)})})]},e.item.linkId):null}function ape(e){const{items:t,response:r,activePage:n,onChange:o,nextStep:i,prevStep:a,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,p=t.map(h=>{var g;const m=((g=r==null?void 0:r.item)==null?void 0:g.filter(b=>b.linkId===h.linkId))??[],v=h.type===it.group?s.jsx(o3,{item:h,response:m,onChange:o,checkForQuestionEnabled:d},h.linkId):s.jsx(n3,{item:h,response:m==null?void 0:m[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?s.jsx(lc.Step,{label:h.text,children:v},h.linkId):v});return s.jsxs(s.Fragment,{children:[c&&s.jsx(lc,{active:n??0,allowNextStepsSelect:!1,p:6,children:p}),!c&&s.jsx(je,{children:p}),s.jsx(spe,{activePage:n??0,numberOfPages:l,nextStep:i,prevStep:a,submitButtonText:u})]})}function spe(e){const t=e.activePage>0,r=e.activePage<e.numberOfPages-1,n=e.activePage===e.numberOfPages-1;return s.jsxs(K,{position:"right",mt:"xl",spacing:"xs",children:[t&&s.jsx(ne,{onClick:e.prevStep,children:"Back"}),r&&s.jsx(ne,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),n&&s.jsx(ne,{type:"submit",children:e.submitButtonText??"Submit"})]})}function a3(e){const t=ae(),r=t.getProfile(),[n,o]=f.useState(!1),i=Ke(e.questionnaire),[a,l]=f.useState(),[c,u]=f.useState(0);f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>{l(i?Mfe(i):void 0)},[i]);function d(g){const b=(a==null?void 0:a.item)??[],x={resourceType:"QuestionnaireResponse",item:s3(b,Array.isArray(g)?g:[g])};l(x)}function p(g){return Ife(g,(a==null?void 0:a.item)??[])}if(!n||!i)return null;const h=Bfe(i),m=()=>u(g=>g+1),v=()=>u(g=>g-1);return s.jsxs(De,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&a&&e.onSubmit({...a,questionnaire:et(i),subject:e.subject,source:dt(r),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&s.jsx(he,{children:i.title}),s.jsx(ape,{items:i.item??[],response:a,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:p,nextStep:m,prevStep:v})]})}function lpe(e,t){const r=s3(e.item??[],t.item??[]);return{...t,item:r.length>0?r:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function s3(e,t){const r=[],n=new Set;for(const o of e){const i=o.id,a=t.find(l=>l.id===i);a?(r.push(lpe(o,a)),n.add(a.id)):r.push(o)}for(const o of t)n.has(o.id)||r.push(o);return r}const cpe=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[3]}`,borderRadius:e.radius.sm,transition:"all 0.1s"}})),upe=["gender","age","gestationalAge","context","appliesTo","category"],dpe={definition:{resourceType:"ObservationDefinition"},onSubmit:()=>{}};function fpe(e){e=Object.assign(dpe,e);const t=e.definition,[r,n]=f.useState([]),[o,i]=f.useState(1),[a,l]=f.useState(1);return f.useEffect(()=>{const v=mpe(t,l);n(gpe(v.qualifiedInterval||[],i))},[t]),s.jsxs(De,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx(je,{children:r.map(v=>{var g;return s.jsx(ppe,{unit:ype((g=t.quantitativeDetails)==null?void 0:g.unit),onChange:p,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:v},`group-${v.id}`)})}),s.jsx(pr,{title:"Add Group",size:"sm",onClick:v=>{st(v),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(g=>g+1)},children:s.jsx(Tx,{})}),s.jsx(K,{position:"right",children:s.jsx(ne,{type:"submit",children:"Save"})})]});function c(){const v=r.flatMap(g=>g.intervals).filter(g=>!xpe(g));e.onSubmit({...t,qualifiedInterval:v})}function u(v){n(g=>[...g,v])}function d(v){n(g=>g.filter(b=>b.id!==v.id))}function p(v,g){n(b=>{b=[...b];const y=b.find(_=>_.id===v),x=y==null?void 0:y.intervals.findIndex(_=>_.id===g.id);return x!==void 0&&(y!=null&&y.intervals[x])&&(y.intervals[x]=g),b})}function h(v,g){g.id===void 0&&(g.id=`id-${a}`,l(b=>b+1)),n(b=>{b=[...b];const y=b.findIndex(x=>x.id===v);if(y!==-1){const x={...b[y]};g={...g,...x.filters},x.intervals=[...x.intervals,g],b[y]=x}return b})}function m(v,g){n(b=>{b=[...b];const y=b.find(x=>x.id===v);return y&&(y.intervals=y.intervals.filter(x=>x.id!==g.id)),b})}}function ppe(e){const{intervalGroup:t,unit:r}=e,{classes:n}=cpe();return s.jsx(Vc,{"data-testid":t.id,className:n.section,children:s.jsxs(je,{spacing:"lg",children:[s.jsx(K,{position:"right",children:s.jsx(pr,{title:"Remove Group","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:o=>{st(o),e.onRemoveGroup(t)},children:s.jsx(uh,{})},`remove-group-button-${t.id}`)}),s.jsx(hpe,{intervalGroup:t,onChange:e.onChange}),s.jsx(br,{}),t.intervals.map(o=>s.jsxs(je,{spacing:"xs",children:[s.jsxs(K,{children:[s.jsx(le,{"data-testid":`condition-${o.id}`,defaultValue:o.condition,label:"Condition: ",size:"sm",onChange:i=>{st(i),e.onChange(t.id,{...o,condition:i.currentTarget.value.trim()})}},`condition-${o.id}`),s.jsx(pr,{title:"Remove Interval",size:"sm","data-testid":`remove-interval-${o.id}`,onClick:i=>{st(i),e.onRemove(t.id,o)},children:s.jsx(uh,{})},`remove-interval-${o.id}`)]}),s.jsx(Hx,{onChange:i=>{e.onChange(t.id,{...o,range:i})},name:`range-${o.id}`,defaultValue:o.range},`range-${o.id}`)]},`interval-${o.id}`)),s.jsx(pr,{title:"Add Interval",size:"sm",onClick:o=>{st(o),e.onAdd(t.id,{range:{low:{unit:r},high:{unit:r}}})},children:s.jsx(Tx,{})})]})})}function hpe(e){var n,o;const{intervalGroup:t,onChange:r}=e;t.filters.age||(t.filters.age={});for(const i of["low","high"])(n=t.filters.age[i])!=null&&n.unit||(t.filters.age[i]={...t.filters.age[i],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(je,{style:{maxWidth:"50%"},children:[s.jsx(K,{children:s.jsx(ft,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),r(t.id,{...a,gender:l})}}})}),s.jsxs(K,{spacing:"xs",children:[s.jsx(re,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Hx,{name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const a of t.intervals)r(t.id,{...a,age:i})}},`age-${t.id}`)})]}),s.jsx(ft,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,r(t.id,{...a,context:void 0})):r(t.id,{...a,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(ft,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const a of t.intervals){const l=i.currentTarget.value;l===""?r(t.id,{...a,category:void 0}):r(t.id,{...a,category:l})}}})]})}function mpe(e,t){const r=e.qualifiedInterval||[];let n=Math.max(...r.map(o=>{var a;const i=parseInt(((a=o.id)==null?void 0:a.substring(3))||"",10);return isNaN(i)?Number.NEGATIVE_INFINITY:i}))+1;return Number.isFinite(n)||(n=1),e={...e,qualifiedInterval:r.map(o=>({...o,id:o.id||`id-${n++}`}))},t(n),e}function gpe(e,t){let r=1;const n={};for(const o of e){const i=vpe(o);i in n||(n[i]={id:`group-id-${r++}`,filters:Object.fromEntries(upe.map(a=>[a,o[a]])),intervals:[]}),n[i].intervals.push(o)}return t(r),Object.values(n)}function vpe(e){var r,n;return[`gender=${e.gender}`,`age=${cc(e.age)}`,`gestationalAge=${cc(e.gestationalAge)}`,`context=${(r=e.context)==null?void 0:r.text}`,`appliesTo=${(n=e.appliesTo)==null?void 0:n.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function ype(e){return e&&(_ie(e,"http://unitsofmeasure.org")||e.text)}function xpe(e){var t,r,n,o;return((r=(t=e.range)==null?void 0:t.low)==null?void 0:r.value)===void 0&&((o=(n=e.range)==null?void 0:n.high)==null?void 0:o.value)===void 0}function wpe(e){var u;const t=ae(),r=Ke(e.value),[n,o]=f.useState(!1),[i,a]=f.useState();if(f.useEffect(()=>{r&&!n&&(t.executeBatch(l(r)).then(a).catch(console.log),o(!0))},[t,r,n]),!r||!i)return null;return s.jsx(nn,{children:(u=r.action)==null?void 0:u.map((d,p)=>{var g,b,y,x,_,w;const h=d.resource&&c(d.resource),m=(b=(g=h==null?void 0:h.input)==null?void 0:g[0])==null?void 0:b.valueReference,v=(x=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:x.valueReference;return s.jsxs(f.Fragment,{children:[s.jsx(nn.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(Gle,{}):s.jsx(xce,{color:"gray"})}),s.jsxs(nn.Col,{span:9,p:"xs",children:[s.jsx(re,{weight:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Bc,{value:(_=h==null?void 0:h.meta)==null?void 0:_.author})," on ",Tr((w=h==null?void 0:h.meta)==null?void 0:w.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(_4,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(nn.Col,{span:2,p:"md",children:[m&&!v&&s.jsx(ne,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&v&&s.jsx(ne,{onClick:()=>e.onEdit(h,m,v),children:"Edit"})]})]},`action-${p}`)})});function l(d){var h;const p=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&p.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:p}}function c(d){for(const p of i==null?void 0:i.entry)if(p.resource&&d.reference===et(p.resource))return p.resource}}function l3(e,t){const r=_pe(e,t);return bpe(r,e,t)}function _pe(e,t){const r=e.length,n=t.length,o=r+n+1,i=1+2*o,a=i/2|0,l=new Array(i);l[a+1]={i:0,j:-1,prev:void 0,snake:!0};for(let c=0;c<o;c++){for(let u=-c;u<=c;u+=2){const d=a+u,p=d+1,h=d-1,m=l[p],v=l[h];let g,b=0;u===-c||u!==c&&v.i<m.i?(b=m.i,g=m):(b=v.i+1,g=v),l[h]=void 0;let y=b-u,x={i:b,j:y,prev:Spe(g),snake:!1};for(;b<r&&y<n&&e[b]===t[y];)b++,y++;if(b>x.i&&(x={i:b,j:y,prev:x,snake:!0}),l[d]=x,b>=r&&y>=n)return l[d]}l[a+c-1]=void 0}}function bpe(e,t,r){const n=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const i=o.i,a=o.j;o=o.prev;const l=o.i,c=o.j,u={position:l,lines:t.slice(l,i)},d={position:c,lines:r.slice(c,a)};let p;u.lines.length===0&&d.lines.length>0?p="insert":u.lines.length>0&&d.lines.length===0?p="delete":p="change",n.push({original:u,revised:d,type:p}),o.snake&&(o=o.prev)}return n}function Spe(e){return e&&!e.snake&&e.prev?e.prev:e}function Ppe(e){const t=e.entry.filter(n=>!!n.resource).map(n=>{var o;return{meta:(o=n.resource)==null?void 0:o.meta,lines:Rr(n.resource,!0).match(/[^\r\n]+/g)}}).sort((n,o)=>n.meta.lastUpdated.localeCompare(o.meta.lastUpdated)),r=t[0].lines.map(n=>({id:t[0].meta.versionId,meta:t[0].meta,value:n,span:1}));return Ope(r,t),jpe(r),r}function Ope(e,t){for(let r=1;r<t.length;r++){const n=l3(t[r-1].lines,t[r].lines);for(const o of n){const i=o.original.position,a=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,a.length),o.type==="insert"||o.type==="change")for(let c=0;c<o.revised.lines.length;c++)e.splice(i+c,0,{id:t[r].meta.versionId,meta:t[r].meta,value:l[c],span:1})}}}function jpe(e){let t=0;for(;t<e.length;){let r=t;for(;r<e.length&&e[r].id===e[t].id;)e[r].span=-1,r++;e[t].span=r-t,t=r}}function Cpe(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function Epe(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),r=Math.floor(t/31536e3);if(r>0)return Ma(r,"year");const n=Math.floor(t/2592e3);if(n>0)return Ma(n,"month");const o=Math.floor(t/86400);if(o>0)return Ma(o,"day");const i=Math.floor(t/3600);if(i>0)return Ma(i,"hour");const a=Math.floor(t/60);return a>0?Ma(a,"minute"):Ma(t,"second")}function Ma(e,t){return`${e} ${e===1?t:t+"s"} ago`}const $pe=W(e=>({container:{overflowX:"auto"},root:{border:`0.1px solid ${e.colors.gray[3]}`,borderCollapse:"collapse",borderRadius:e.radius.sm,borderSpacing:0,fontSize:e.fontSizes.xs,width:"100%","& td":{padding:"2px 4px 0 4px",verticalAlign:"top",whiteSpace:"nowrap"}},startRow:{borderTop:`0.1px solid ${e.colors.gray[3]}`},normalRow:{borderTop:0},author:{lineHeight:"10px"},dateTime:{borderRight:`0.1px solid ${e.colors.gray[3]}`,lineHeight:"20px"},lineNumber:{backgroundColor:e.colors.gray[1],border:0,color:e.colors.gray[5],fontFamily:e.fontFamilyMonospace,padding:`${e.spacing.xs} ${e.spacing.sm}`,textAlign:"right"},line:{fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.sm,padding:`${e.spacing.xs} ${e.spacing.sm}`},pre:{margin:0}}));function kpe(e){var l,c;const{classes:t}=$pe(),r=ae(),[n,o]=f.useState(e.history);if(f.useEffect(()=>{!e.history&&e.resourceType&&e.id&&r.readHistory(e.resourceType,e.id).then(o).catch(console.log)},[r,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const i=(c=(l=n.entry)==null?void 0:l[0])==null?void 0:c.resource;if(!i)return null;const a=Ppe(n);return s.jsx("div",{className:t.container,children:s.jsx("table",{className:t.root,children:s.jsx("tbody",{children:a.map((u,d)=>s.jsxs("tr",{className:u.span>0?t.startRow:t.normalRow,children:[u.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:t.author,rowSpan:u.span,children:s.jsx(us,{value:u.meta.author,link:!0})}),s.jsx("td",{className:t.dateTime,rowSpan:u.span,children:s.jsx(ke,{to:Cpe(i,u.meta.versionId),children:Epe(u.meta.lastUpdated)})})]}),s.jsx("td",{className:t.lineNumber,children:d+1}),s.jsx("td",{className:t.line,children:s.jsx("pre",{className:t.pre,children:u.value})})]},"row-"+d))})})})}const Rpe=W(e=>({removed:{color:e.colors.red[7],textDecoration:"line-through"},added:{color:e.colors.green[7]}}));function Tpe(e){let t=e.original,r=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},r={...r,meta:void 0});const n=Rr(t,!0).match(/[^\r\n]+/g),o=Rr(r,!0).match(/[^\r\n]+/g),i=l3(n,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((a,l)=>s.jsx(Ipe,{delta:a},"delta"+l))})}function Ipe(e){const{classes:t}=Rpe();return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:t.removed,children:e.delta.original.lines.join(`
|
|
191
|
-
`)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:t.added,children:e.delta.revised.lines.join(`
|
|
192
|
-
`)}),"...",s.jsx("br",{})]})}function c3(e){const t=ae(),r=Ke(e.defaultValue),[n,o]=f.useState(!1),[i,a]=f.useState();return f.useEffect(()=>{r&&(a(_a(r)),t.requestSchema(r.resourceType).then(()=>o(!0)).catch(console.log))},[t,r]),!n||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.onSubmit&&e.onSubmit(i)},children:[s.jsxs(je,{mb:"xl",children:[s.jsx(tt,{title:"Resource Type",htmlFor:"resourceType",outcome:e.outcome,children:s.jsx(le,{name:"resourceType",defaultValue:i.resourceType,disabled:!0})}),s.jsx(tt,{title:"ID",htmlFor:"id",outcome:e.outcome,children:s.jsx(le,{name:"id",defaultValue:i.id,disabled:!0})})]}),s.jsx(my,{typeName:i.resourceType,defaultValue:i,outcome:e.outcome,onChange:a}),s.jsxs(K,{position:"right",mt:"xl",children:[s.jsx(ne,{type:"submit",children:"OK"}),e.onDelete&&s.jsx(ne,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(i)},children:"Delete"})]})]})}function Dpe(e){var o;const t=ae(),[r,n]=f.useState(e.history);return f.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(n).catch(console.log)},[t,e.history,e.resourceType,e.id]),r?s.jsxs(xa,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Author"}),s.jsx("th",{children:"Date"}),s.jsx("th",{children:"Version"})]})}),s.jsx("tbody",{children:(o=r.entry)==null?void 0:o.map((i,a)=>s.jsx(Npe,{entry:i},"entry-"+a))})]}):s.jsx("div",{children:"Loading..."})}function Npe(e){var n,o,i;const{response:t,resource:r}=e.entry;return r?s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(us,{value:(n=r.meta)==null?void 0:n.author,link:!0})}),s.jsx("td",{children:Tr((o=r.meta)==null?void 0:o.lastUpdated)}),s.jsx("td",{children:s.jsx(ke,{to:Ape(r),children:(i=r.meta)==null?void 0:i.versionId})})]}):s.jsx("tr",{children:s.jsx("td",{colSpan:3,children:Ee(t==null?void 0:t.outcome)})})}function Ape(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function Mpe(e){return s.jsx(Om,{value:e.serviceRequest,loadTimelineResources:async(t,r,n)=>{const o=`${r}/${n}`,i=100;return Promise.allSettled([t.readHistory("ServiceRequest",n),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,r,n)=>({resourceType:"Communication",status:"completed",basedOn:[dt(t)],subject:t.subject,sender:dt(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",basedOn:[dt(t)],subject:t.subject,operator:dt(r),issued:new Date().toISOString(),content:n})})}function u3(e){const t=ae(),[r,n]=f.useState();return s.jsxs(De,{style:{maxWidth:400},onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){n(ct(i))}},children:[s.jsxs(ir,{sx:{flexDirection:"column"},children:[s.jsx(kn,{size:32}),s.jsx(he,{children:"Create project"})]}),s.jsxs(je,{spacing:"xl",children:[s.jsx(le,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:lt(r,"firstName")}),s.jsxs(re,{color:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Le,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Le,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"Create project"})})]})}function d3(e,t){const r=document.getElementsByTagName("head")[0],n=document.createElement("script");n.async=!0,n.src=e,n.onload=t??null,r.appendChild(n)}function f3(e){const t=ae(),{googleClientId:r,handleGoogleCredential:n}=e,o=f.useRef(null),[i,a]=f.useState(typeof google<"u"),[l,c]=f.useState(!1),[u,d]=f.useState(!1);return f.useEffect(()=>{if(typeof google>"u"){d3("https://accounts.google.com/gsi/client",()=>a(!0));return}l||(google.accounts.id.initialize({client_id:r,callback:n}),c(!0)),o.current&&!u&&(google.accounts.id.renderButton(o.current,{}),d(!0))},[t,r,l,i,o,u,n]),r?s.jsx("div",{ref:o}):null}function p3(e){var t;if(e)return e;if(typeof window<"u"){const r=window.location.protocol+"//"+window.location.host;if((((t={}.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(r))return"__GOOGLE_CLIENT_ID__"}}function h3(e){typeof grecaptcha>"u"&&d3("https://www.google.com/recaptcha/api.js?render="+e)}function m3(e){return new Promise((t,r)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(n){r(n)}})})}function Lpe(e){const t=p3(e.googleClientId),r=e.recaptchaSiteKey,n=ae(),[o,i]=f.useState(),a=Wx(o,void 0);return f.useEffect(()=>{r&&h3(r)},[r]),s.jsxs(De,{style:{maxWidth:400},onSubmit:async l=>{try{let c="";r&&(c=await m3(r)),e.handleAuthResponse(await n.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:l.firstName,lastName:l.lastName,email:l.email,password:l.password,remember:l.remember==="true",recaptchaSiteKey:r,recaptchaToken:c}))}catch(c){i(ct(c))}},children:[s.jsx(ir,{sx:{flexDirection:"column"},children:e.children}),s.jsx(ji,{issues:a}),t&&s.jsxs(s.Fragment,{children:[s.jsx(K,{position:"center",p:"xl",style:{height:70},children:s.jsx(f3,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await n.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,createUser:!0}))}catch(c){i(ct(c))}}})}),s.jsx(br,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(je,{spacing:"xl",children:[s.jsx(le,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:lt(o,"firstName")}),s.jsx(le,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:lt(o,"lastName")}),s.jsx(le,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:lt(o,"email")}),s.jsx(_o,{name:"password",label:"Password",autoComplete:"off",required:!0,error:lt(o,"password")}),s.jsxs(re,{color:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Le,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Le,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(re,{color:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Le,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Le,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(K,{position:"apart",mt:"xl",noWrap:!0,children:[s.jsx(Cn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(ne,{type:"submit",children:"Create account"})]})]})}function zpe(e){const{type:t,projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:i,onSuccess:a}=e,l=ae(),[c,u]=f.useState(),[d,p]=f.useState();f.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:r}).then(m=>l.processCode(m.code)).then(()=>a()).catch(m=>p(ct(m)))},[l,t,r,c,a]);function h(m){m.code?l.processCode(m.code).then(()=>a()).catch(console.log):m.login&&u(m.login)}return s.jsxs(Se,{width:450,children:[d&&s.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&s.jsx(Lpe,{projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&s.jsx(u3,{login:c,handleAuthResponse:h})]})}function Fpe(e){const[t,r]=f.useState();return t?s.jsx(Bpe,{email:t,...e}):s.jsx(Vpe,{setEmail:r,...e})}function Vpe(e){const{setEmail:t,onRegister:r,handleAuthResponse:n,children:o,disableEmailAuth:i,...a}=e,l=ae(),c=!e.disableGoogleAuth&&p3(e.googleClientId),u=f.useCallback(async h=>{if(!h.authorizeUrl)return!1;const m=JSON.stringify({...await l.ensureCodeChallenge(a),domain:h.domain}),v=new URL(h.authorizeUrl);return v.searchParams.set("state",m),window.location.assign(v.toString()),!0},[l,a]),d=f.useCallback(async h=>{const m=await l.post("auth/method",{email:h.email});await u(m)||t(h.email)},[l,u,t]),p=f.useCallback(async h=>{const m=await l.startGoogleLogin({...a,googleCredential:h.credential});await u(m)||n(m)},[l,a,u,n]);return s.jsxs(De,{style:{maxWidth:400},onSubmit:d,children:[s.jsx(ir,{sx:{flexDirection:"column"},children:o}),c&&s.jsxs(s.Fragment,{children:[s.jsx(K,{position:"center",p:"xl",style:{height:70},children:s.jsx(f3,{googleClientId:c,handleGoogleCredential:p})}),!i&&s.jsx(br,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&s.jsx(le,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0}),s.jsxs(K,{position:"apart",mt:"xl",spacing:0,noWrap:!0,children:[s.jsx("div",{children:r&&s.jsx(Le,{component:"button",type:"button",color:"dimmed",onClick:r,size:"xs",children:"Register"})}),!i&&s.jsx(ne,{type:"submit",children:"Next"})]})]})}function Bpe(e){const{onForgotPassword:t,handleAuthResponse:r,children:n,...o}=e,i=ae(),[a,l]=f.useState(),c=Wx(a,void 0),u=f.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(r).catch(p=>l(ct(p)))},[i,o,r]);return s.jsxs(De,{style:{maxWidth:400},onSubmit:u,children:[s.jsx(ir,{sx:{flexDirection:"column"},children:n}),s.jsx(ji,{issues:c}),s.jsx(je,{spacing:"xl",children:s.jsx(_o,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:lt(a,"password")})}),s.jsxs(K,{position:"apart",mt:"xl",spacing:0,noWrap:!0,children:[t&&s.jsx(Le,{component:"button",type:"button",color:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Cn,{id:"remember",name:"remember",label:"Remember me",size:"xs",sx:{lineHeight:1}}),s.jsx(ne,{type:"submit",children:"Sign in"})]})]})}function Upe(e){const t=ae(),[r,n]=f.useState();return s.jsxs(je,{children:[s.jsxs(ir,{sx:{flexDirection:"column"},children:[s.jsx(kn,{size:32}),s.jsx(he,{order:3,children:"Choose profile"})]}),s.jsx(ji,{outcome:r}),e.memberships.map(o=>{var i,a;return s.jsx(So,{onClick:()=>{t.post("auth/profile",{login:e.login,profile:o.id}).then(e.handleAuthResponse).catch(l=>n(ct(l)))},children:s.jsxs(K,{children:[s.jsx(Nf,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(re,{size:"sm",weight:500,children:(i=o.profile)==null?void 0:i.display}),s.jsx(re,{color:"dimmed",size:"xs",children:(a=o.project)==null?void 0:a.display})]})]})},o.id)})]})}function Wpe(e){const t=ae();return s.jsx(De,{style:{maxWidth:400},onSubmit:r=>{t.post("auth/scope",{login:e.login,scope:Object.keys(r).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(je,{children:[s.jsxs(ir,{sx:{flexDirection:"column"},children:[s.jsx(kn,{size:32}),s.jsx(he,{children:"Choose scope"})]}),s.jsx(je,{children:(e.scope??"openid").split(" ").map(r=>s.jsx(Cn,{id:r,name:r,label:r,defaultChecked:!0},r))}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{type:"submit",children:"Set scope"})})]})})}function Hpe(e){const t=ae(),[r,n]=f.useState();return s.jsx(De,{style:{maxWidth:400},onSubmit:o=>{n(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>n(Ee(i)))},children:s.jsxs(je,{children:[s.jsxs(ir,{sx:{flexDirection:"column"},children:[s.jsx(kn,{size:32}),s.jsx(he,{children:"Enter MFA code"})]}),r&&s.jsx(Cc,{icon:s.jsx(xm,{size:16}),title:"Error",color:"red",children:r}),s.jsx(je,{children:s.jsx(le,{name:"token",label:"MFA code",required:!0})}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{type:"submit",children:"Submit code"})})]})})}function g3(e){const{login:t,chooseScopes:r,onSuccess:n,onForgotPassword:o,onRegister:i,onCode:a,...l}=e,c=ae(),[u,d]=f.useState(),[p,h]=f.useState(!1),[m,v]=f.useState(),g=f.useCallback(x=>{a?a(x):c.processCode(x).then(()=>{n&&n()}).catch(_=>me({color:"red",message:Ee(_)}))},[c,a,n]),b=f.useCallback(x=>{h(!!x.mfaRequired),x.login&&d(x.login),x.memberships&&v(x.memberships),x.code&&(r?v(void 0):g(x.code))},[r,g]),y=f.useCallback(x=>{g(x.code)},[g]);return f.useEffect(()=>{t&&!u&&c.get("auth/login/"+t).then(b).catch(x=>me({color:"red",message:Ee(x)}))},[c,t,u,b]),s.jsx(Se,{width:450,children:(()=>u?p?s.jsx(Hpe,{login:u,handleAuthResponse:b}):m?s.jsx(Upe,{login:u,memberships:m,handleAuthResponse:b}):e.projectId==="new"?s.jsx(u3,{login:u,handleAuthResponse:b}):e.chooseScopes?s.jsx(Wpe,{login:u,scope:e.scope,handleAuthResponse:y}):s.jsx("div",{children:"Success"}):s.jsx(Fpe,{onForgotPassword:o,onRegister:i,handleAuthResponse:b,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children}))()})}var v3,sC=Oc;v3=sC.createRoot,sC.hydrateRoot;/**
|
|
193
|
-
* @remix-run/router v1.11.0
|
|
194
|
-
*
|
|
195
|
-
* Copyright (c) Remix Software Inc.
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the MIT license found in the
|
|
198
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
199
|
-
*
|
|
200
|
-
* @license MIT
|
|
201
|
-
*/function Pt(){return Pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pt.apply(this,arguments)}var Ct;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ct||(Ct={}));const lC="popstate";function Gpe(e){e===void 0&&(e={});function t(n,o){let{pathname:i,search:a,hash:l}=n.location;return hc("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(n,o){return typeof o=="string"?o:Hc(o)}return Qpe(t,r,null,e)}function $e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function da(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qpe(){return Math.random().toString(36).substr(2,8)}function cC(e,t){return{usr:e.state,key:e.key,idx:t}}function hc(e,t,r,n){return r===void 0&&(r=null),Pt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Vo(t):t,{state:r,key:t&&t.key||n||qpe()})}function Hc(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Vo(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Qpe(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,a=o.history,l=Ct.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Pt({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function p(){l=Ct.Pop;let b=d(),y=b==null?null:b-u;u=b,c&&c({action:l,location:g.location,delta:y})}function h(b,y){l=Ct.Push;let x=hc(g.location,b,y);r&&r(x,b),u=d()+1;let _=cC(x,u),w=g.createHref(x);try{a.pushState(_,"",w)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;o.location.assign(w)}i&&c&&c({action:l,location:g.location,delta:1})}function m(b,y){l=Ct.Replace;let x=hc(g.location,b,y);r&&r(x,b),u=d();let _=cC(x,u),w=g.createHref(x);a.replaceState(_,"",w),i&&c&&c({action:l,location:g.location,delta:0})}function v(b){let y=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof b=="string"?b:Hc(b);return $e(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let g={get action(){return l},get location(){return e(o,a)},listen(b){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(lC,p),c=b,()=>{o.removeEventListener(lC,p),c=null}},createHref(b){return t(o,b)},createURL:v,encodeLocation(b){let y=v(b);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:m,go(b){return a.go(b)}};return g}var Et;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Et||(Et={}));const Kpe=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ype(e){return e.index===!0}function by(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((o,i)=>{let a=[...r,i],l=typeof o.id=="string"?o.id:a.join("-");if($e(o.index!==!0||!o.children,"Cannot specify children on an index route"),$e(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),Ype(o)){let c=Pt({},o,t(o),{id:l});return n[l]=c,c}else{let c=Pt({},o,t(o),{id:l,children:void 0});return n[l]=c,o.children&&(c.children=by(o.children,t,a,n)),c}})}function es(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?Vo(t):t,o=Gc(n.pathname||"/",r);if(o==null)return null;let i=y3(e);Jpe(i);let a=null;for(let l=0;a==null&&l<i.length;++l)a=she(i[l],uhe(o));return a}function Xpe(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}function y3(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let o=(i,a,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&($e(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=mi([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&($e(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),y3(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:ihe(u,i.index),routesMeta:d})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let c of x3(i.path))o(i,a,c)}),t}function x3(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return o?[i,""]:[i];let a=x3(n.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Jpe(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ahe(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Zpe=/^:\w+$/,ehe=3,the=2,rhe=1,nhe=10,ohe=-2,uC=e=>e==="*";function ihe(e,t){let r=e.split("/"),n=r.length;return r.some(uC)&&(n+=ohe),t&&(n+=the),r.filter(o=>!uC(o)).reduce((o,i)=>o+(Zpe.test(i)?ehe:i===""?rhe:nhe),n)}function ahe(e,t){return e.length===t.length&&e.slice(0,-1).every((n,o)=>n===t[o])?e[e.length-1]-t[t.length-1]:0}function she(e,t){let{routesMeta:r}=e,n={},o="/",i=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=lhe({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u);if(!d)return null;Object.assign(n,d.params);let p=l.route;i.push({params:n,pathname:mi([o,d.pathname]),pathnameBase:hhe(mi([o,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(o=mi([o,d.pathnameBase]))}return i}function lhe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=che(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce((u,d,p)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let g=l[p]||"";a=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const v=l[p];return m&&!v?u[h]=void 0:u[h]=dhe(v||"",h),u},{}),pathname:i,pathnameBase:a,pattern:e}}function che(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),da(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 n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(a,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function uhe(e){try{return decodeURI(e)}catch(t){return da(!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 dhe(e,t){try{return decodeURIComponent(e)}catch(r){return da(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function Gc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function fhe(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Vo(e):e;return{pathname:r?r.startsWith("/")?r:phe(r,t):t,search:mhe(n),hash:ghe(o)}}function phe(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Bg(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function a1(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function w3(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Vo(e):(o=Pt({},e),$e(!o.pathname||!o.pathname.includes("?"),Bg("?","pathname","search",o)),$e(!o.pathname||!o.pathname.includes("#"),Bg("#","pathname","hash",o)),$e(!o.search||!o.search.includes("#"),Bg("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(n||a==null)l=r;else{let p=t.length-1;if(a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),p-=1;o.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=fhe(o,l),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const mi=e=>e.join("/").replace(/\/\/+/g,"/"),hhe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),mhe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ghe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class s1{constructor(t,r,n,o){o===void 0&&(o=!1),this.status=t,this.statusText=r||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function _3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const b3=["post","put","patch","delete"],vhe=new Set(b3),yhe=["get",...b3],xhe=new Set(yhe),whe=new Set([301,302,303,307,308]),_he=new Set([307,308]),Ug={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bhe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},S3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,She=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),P3="remix-router-transitions";function Phe(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;$e(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 D=e.detectErrorBoundary;o=F=>({hasErrorBoundary:D(F)})}else o=She;let i={},a=by(e.routes,o,void 0,i),l,c=e.basename||"/",u=Pt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),d=null,p=new Set,h=null,m=null,v=null,g=e.hydrationData!=null,b=es(a,e.history.location,c),y=null;if(b==null){let D=Zr(404,{pathname:e.history.location.pathname}),{matches:F,route:U}=yC(a);b=F,y={[U.id]:D}}let x=!b.some(D=>D.route.lazy)&&(!b.some(D=>D.route.loader)||e.hydrationData!=null),_,w={historyAction:e.history.action,location:e.history.location,matches:b,initialized:x,navigation:Ug,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||y,fetchers:new Map,blockers:new Map},j=Ct.Pop,C=!1,P,E=!1,k=new Map,$=null,I=!1,T=!1,z=[],M=[],L=new Map,q=0,Y=-1,R=new Map,N=new Set,V=new Map,Q=new Map,ee=new Set,_e=new Map,we=new Map,Ue=!1;function Ae(){if(d=e.history.listen(D=>{let{action:F,location:U,delta:Z}=D;if(Ue){Ue=!1;return}da(we.size===0||Z!=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 de=Bo({currentLocation:w.location,nextLocation:U,historyAction:F});if(de&&Z!=null){Ue=!0,e.history.go(Z*-1),Dn(de,{state:"blocked",location:U,proceed(){Dn(de,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),e.history.go(Z)},reset(){let se=new Map(w.blockers);se.set(de,fl),Pe({blockers:se})}});return}return qt(F,U)}),r){Nhe(t,k);let D=()=>Ahe(t,k);t.addEventListener("pagehide",D),$=()=>t.removeEventListener("pagehide",D)}return w.initialized||qt(Ct.Pop,w.location),_}function pt(){d&&d(),$&&$(),p.clear(),P&&P.abort(),w.fetchers.forEach((D,F)=>J(F)),w.blockers.forEach((D,F)=>yr(F))}function Nt(D){return p.add(D),()=>p.delete(D)}function Pe(D,F){w=Pt({},w,D);let U=[],Z=[];u.v7_fetcherPersist&&w.fetchers.forEach((de,se)=>{de.state==="idle"&&(ee.has(se)?Z.push(se):U.push(se))}),p.forEach(de=>de(w,{deletedFetchers:Z,unstable_viewTransitionOpts:F})),u.v7_fetcherPersist&&(U.forEach(de=>w.fetchers.delete(de)),Z.forEach(de=>J(de)))}function Gt(D,F){var U,Z;let de=w.actionData!=null&&w.navigation.formMethod!=null&&xn(w.navigation.formMethod)&&w.navigation.state==="loading"&&((U=D.state)==null?void 0:U._isRedirect)!==!0,se;F.actionData?Object.keys(F.actionData).length>0?se=F.actionData:se=null:de?se=w.actionData:se=null;let fe=F.loaderData?vC(w.loaderData,F.loaderData,F.matches||[],F.errors):w.loaderData,ye=w.blockers;ye.size>0&&(ye=new Map(ye),ye.forEach((nt,be)=>ye.set(be,fl)));let ce=C===!0||w.navigation.formMethod!=null&&xn(w.navigation.formMethod)&&((Z=D.state)==null?void 0:Z._isRedirect)!==!0;l&&(a=l,l=void 0),I||j===Ct.Pop||(j===Ct.Push?e.history.push(D,D.state):j===Ct.Replace&&e.history.replace(D,D.state));let Be;if(j===Ct.Pop){let nt=k.get(w.location.pathname);nt&&nt.has(D.pathname)?Be={currentLocation:w.location,nextLocation:D}:k.has(D.pathname)&&(Be={currentLocation:D,nextLocation:w.location})}else if(E){let nt=k.get(w.location.pathname);nt?nt.add(D.pathname):(nt=new Set([D.pathname]),k.set(w.location.pathname,nt)),Be={currentLocation:w.location,nextLocation:D}}Pe(Pt({},F,{actionData:se,loaderData:fe,historyAction:j,location:D,initialized:!0,navigation:Ug,revalidation:"idle",restoreScrollPosition:co(D,F.matches||w.matches),preventScrollReset:ce,blockers:ye}),Be),j=Ct.Pop,C=!1,E=!1,I=!1,T=!1,z=[],M=[]}async function Ar(D,F){if(typeof D=="number"){e.history.go(D);return}let U=Sy(w.location,w.matches,c,u.v7_prependBasename,D,F==null?void 0:F.fromRouteId,F==null?void 0:F.relative),{path:Z,submission:de,error:se}=dC(u.v7_normalizeFormMethod,!1,U,F),fe=w.location,ye=hc(w.location,Z,F&&F.state);ye=Pt({},ye,e.history.encodeLocation(ye));let ce=F&&F.replace!=null?F.replace:void 0,Be=Ct.Push;ce===!0?Be=Ct.Replace:ce===!1||de!=null&&xn(de.formMethod)&&de.formAction===w.location.pathname+w.location.search&&(Be=Ct.Replace);let nt=F&&"preventScrollReset"in F?F.preventScrollReset===!0:void 0,be=Bo({currentLocation:fe,nextLocation:ye,historyAction:Be});if(be){Dn(be,{state:"blocked",location:ye,proceed(){Dn(be,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),Ar(D,F)},reset(){let Me=new Map(w.blockers);Me.set(be,fl),Pe({blockers:Me})}});return}return await qt(Be,ye,{submission:de,pendingError:se,preventScrollReset:nt,replace:F&&F.replace,enableViewTransition:F&&F.unstable_viewTransition})}function cr(){if(ki(),Pe({revalidation:"loading"}),w.navigation.state!=="submitting"){if(w.navigation.state==="idle"){qt(w.historyAction,w.location,{startUninterruptedRevalidation:!0});return}qt(j||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation})}}async function qt(D,F,U){P&&P.abort(),P=null,j=D,I=(U&&U.startUninterruptedRevalidation)===!0,xr(w.location,w.matches),C=(U&&U.preventScrollReset)===!0,E=(U&&U.enableViewTransition)===!0;let Z=l||a,de=U&&U.overrideNavigation,se=es(Z,F,c);if(!se){let Me=Zr(404,{pathname:F.pathname}),{matches:jt,route:Nn}=yC(Z);hn(),Gt(F,{matches:jt,loaderData:{},errors:{[Nn.id]:Me}});return}if(w.initialized&&!T&&$he(w.location,F)&&!(U&&U.submission&&xn(U.submission.formMethod))){Gt(F,{matches:se});return}P=new AbortController;let fe=hl(e.history,F,P.signal,U&&U.submission),ye,ce;if(U&&U.pendingError)ce={[Ll(se).route.id]:U.pendingError};else if(U&&U.submission&&xn(U.submission.formMethod)){let Me=await At(fe,F,U.submission,se,{replace:U.replace});if(Me.shortCircuited)return;ye=Me.pendingActionData,ce=Me.pendingActionError,de=Wg(F,U.submission),fe=new Request(fe.url,{signal:fe.signal})}let{shortCircuited:Be,loaderData:nt,errors:be}=await io(fe,F,se,de,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,ye,ce);Be||(P=null,Gt(F,Pt({matches:se},ye?{actionData:ye}:{},{loaderData:nt,errors:be})))}async function At(D,F,U,Z,de){de===void 0&&(de={}),ki();let se=Ihe(F,U);Pe({navigation:se});let fe,ye=Oy(Z,F);if(!ye.route.action&&!ye.route.lazy)fe={type:Et.error,error:Zr(405,{method:D.method,pathname:F.pathname,routeId:ye.route.id})};else if(fe=await pl("action",D,ye,Z,i,o,c),D.signal.aborted)return{shortCircuited:!0};if(ds(fe)){let ce;return de&&de.replace!=null?ce=de.replace:ce=fe.location===w.location.pathname+w.location.search,await Ft(w,fe,{submission:U,replace:ce}),{shortCircuited:!0}}if(zl(fe)){let ce=Ll(Z,ye.route.id);return(de&&de.replace)!==!0&&(j=Ct.Push),{pendingActionData:{},pendingActionError:{[ce.route.id]:fe.error}}}if(qi(fe))throw Zr(400,{type:"defer-action"});return{pendingActionData:{[ye.route.id]:fe.data}}}async function io(D,F,U,Z,de,se,fe,ye,ce){let Be=Z||Wg(F,de),nt=de||se||_C(Be),be=l||a,[Me,jt]=fC(e.history,w,U,nt,F,T,z,M,V,N,be,c,ye,ce);if(hn(Ce=>!(U&&U.some(wr=>wr.route.id===Ce))||Me&&Me.some(wr=>wr.route.id===Ce)),Y=++q,Me.length===0&&jt.length===0){let Ce=_t();return Gt(F,Pt({matches:U,loaderData:{},errors:ce||null},ye?{actionData:ye}:{},Ce?{fetchers:new Map(w.fetchers)}:{})),{shortCircuited:!0}}if(!I){jt.forEach(wr=>{let Mn=w.fetchers.get(wr.key),mt=ml(void 0,Mn?Mn.data:void 0);w.fetchers.set(wr.key,mt)});let Ce=ye||w.actionData;Pe(Pt({navigation:Be},Ce?Object.keys(Ce).length===0?{actionData:null}:{actionData:Ce}:{},jt.length>0?{fetchers:new Map(w.fetchers)}:{}))}jt.forEach(Ce=>{L.has(Ce.key)&&ze(Ce.key),Ce.controller&&L.set(Ce.key,Ce.controller)});let Nn=()=>jt.forEach(Ce=>ze(Ce.key));P&&P.signal.addEventListener("abort",Nn);let{results:Qr,loaderResults:Wo,fetcherResults:Bs}=await Oa(w.matches,U,Me,jt,D);if(D.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",Nn),jt.forEach(Ce=>L.delete(Ce.key));let Kr=xC(Qr);if(Kr){if(Kr.idx>=Me.length){let Ce=jt[Kr.idx-Me.length].key;N.add(Ce)}return await Ft(w,Kr.result,{replace:fe}),{shortCircuited:!0}}let{loaderData:Yr,errors:ja}=gC(w,U,Me,Wo,ce,jt,Bs,_e);_e.forEach((Ce,wr)=>{Ce.subscribe(Mn=>{(Mn||Ce.done)&&_e.delete(wr)})});let Ti=_t(),Xe=Tn(Y),An=Ti||Xe||jt.length>0;return Pt({loaderData:Yr,errors:ja},An?{fetchers:new Map(w.fetchers)}:{})}function ao(D){return u.v7_fetcherPersist&&(Q.set(D,(Q.get(D)||0)+1),ee.has(D)&&ee.delete(D)),w.fetchers.get(D)||bhe}function Ye(D,F,U,Z){if(n)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.");L.has(D)&&ze(D);let de=l||a,se=Sy(w.location,w.matches,c,u.v7_prependBasename,U,F,Z==null?void 0:Z.relative),fe=es(de,se,c);if(!fe){lo(D,F,Zr(404,{pathname:se}));return}let{path:ye,submission:ce,error:Be}=dC(u.v7_normalizeFormMethod,!0,se,Z);if(Be){lo(D,F,Be);return}let nt=Oy(fe,ye);if(C=(Z&&Z.preventScrollReset)===!0,ce&&xn(ce.formMethod)){so(D,F,ye,nt,fe,ce);return}V.set(D,{routeId:F,path:ye}),Rn(D,F,ye,nt,fe,ce)}async function so(D,F,U,Z,de,se){if(ki(),V.delete(D),!Z.route.action&&!Z.route.lazy){let mt=Zr(405,{method:se.formMethod,pathname:U,routeId:F});lo(D,F,mt);return}let fe=w.fetchers.get(D),ye=Dhe(se,fe);w.fetchers.set(D,ye),Pe({fetchers:new Map(w.fetchers)});let ce=new AbortController,Be=hl(e.history,U,ce.signal,se);L.set(D,ce);let nt=q,be=await pl("action",Be,Z,de,i,o,c);if(Be.signal.aborted){L.get(D)===ce&&L.delete(D);return}if(ee.has(D)){w.fetchers.set(D,Yo(void 0)),Pe({fetchers:new Map(w.fetchers)});return}if(ds(be))if(L.delete(D),Y>nt){let mt=Yo(void 0);w.fetchers.set(D,mt),Pe({fetchers:new Map(w.fetchers)});return}else{N.add(D);let mt=ml(se);return w.fetchers.set(D,mt),Pe({fetchers:new Map(w.fetchers)}),Ft(w,be,{fetcherSubmission:se})}if(zl(be)){lo(D,F,be.error);return}if(qi(be))throw Zr(400,{type:"defer-action"});let Me=w.navigation.location||w.location,jt=hl(e.history,Me,ce.signal),Nn=l||a,Qr=w.navigation.state!=="idle"?es(Nn,w.navigation.location,c):w.matches;$e(Qr,"Didn't find any matches after fetcher action");let Wo=++q;R.set(D,Wo);let Bs=ml(se,be.data);w.fetchers.set(D,Bs);let[Kr,Yr]=fC(e.history,w,Qr,se,Me,T,z,M,V,N,Nn,c,{[Z.route.id]:be.data},void 0);Yr.filter(mt=>mt.key!==D).forEach(mt=>{let gt=mt.key,Ln=w.fetchers.get(gt),Yc=ml(void 0,Ln?Ln.data:void 0);w.fetchers.set(gt,Yc),L.has(gt)&&ze(gt),mt.controller&&L.set(gt,mt.controller)}),Pe({fetchers:new Map(w.fetchers)});let ja=()=>Yr.forEach(mt=>ze(mt.key));ce.signal.addEventListener("abort",ja);let{results:Ti,loaderResults:Xe,fetcherResults:An}=await Oa(w.matches,Qr,Kr,Yr,jt);if(ce.signal.aborted)return;ce.signal.removeEventListener("abort",ja),R.delete(D),L.delete(D),Yr.forEach(mt=>L.delete(mt.key));let Ce=xC(Ti);if(Ce){if(Ce.idx>=Kr.length){let mt=Yr[Ce.idx-Kr.length].key;N.add(mt)}return Ft(w,Ce.result)}let{loaderData:wr,errors:Mn}=gC(w,w.matches,Kr,Xe,void 0,Yr,An,_e);if(w.fetchers.has(D)){let mt=Yo(be.data);w.fetchers.set(D,mt)}Tn(Wo),w.navigation.state==="loading"&&Wo>Y?($e(j,"Expected pending action"),P&&P.abort(),Gt(w.navigation.location,{matches:Qr,loaderData:wr,errors:Mn,fetchers:new Map(w.fetchers)})):(Pe({errors:Mn,loaderData:vC(w.loaderData,wr,Qr,Mn),fetchers:new Map(w.fetchers)}),T=!1)}async function Rn(D,F,U,Z,de,se){let fe=w.fetchers.get(D),ye=ml(se,fe?fe.data:void 0);w.fetchers.set(D,ye),Pe({fetchers:new Map(w.fetchers)});let ce=new AbortController,Be=hl(e.history,U,ce.signal);L.set(D,ce);let nt=q,be=await pl("loader",Be,Z,de,i,o,c);if(qi(be)&&(be=await C3(be,Be.signal,!0)||be),L.get(D)===ce&&L.delete(D),Be.signal.aborted)return;if(ee.has(D)){w.fetchers.set(D,Yo(void 0)),Pe({fetchers:new Map(w.fetchers)});return}if(ds(be))if(Y>nt){let jt=Yo(void 0);w.fetchers.set(D,jt),Pe({fetchers:new Map(w.fetchers)});return}else{N.add(D),await Ft(w,be);return}if(zl(be)){lo(D,F,be.error);return}$e(!qi(be),"Unhandled fetcher deferred data");let Me=Yo(be.data);w.fetchers.set(D,Me),Pe({fetchers:new Map(w.fetchers)})}async function Ft(D,F,U){let{submission:Z,fetcherSubmission:de,replace:se}=U===void 0?{}:U;F.revalidate&&(T=!0);let fe=hc(D.location,F.location,{_isRedirect:!0});if($e(fe,"Expected a location on the redirect navigation"),r){let Me=!1;if(F.reloadDocument)Me=!0;else if(S3.test(F.location)){const jt=e.history.createURL(F.location);Me=jt.origin!==t.location.origin||Gc(jt.pathname,c)==null}if(Me){se?t.location.replace(F.location):t.location.assign(F.location);return}}P=null;let ye=se===!0?Ct.Replace:Ct.Push,{formMethod:ce,formAction:Be,formEncType:nt}=D.navigation;!Z&&!de&&ce&&Be&&nt&&(Z=_C(D.navigation));let be=Z||de;if(_he.has(F.status)&&be&&xn(be.formMethod))await qt(ye,fe,{submission:Pt({},be,{formAction:F.location}),preventScrollReset:C});else{let Me=Wg(fe,Z);await qt(ye,fe,{overrideNavigation:Me,fetcherSubmission:de,preventScrollReset:C})}}async function Oa(D,F,U,Z,de){let se=await Promise.all([...U.map(ce=>pl("loader",de,ce,F,i,o,c)),...Z.map(ce=>ce.matches&&ce.match&&ce.controller?pl("loader",hl(e.history,ce.path,ce.controller.signal),ce.match,ce.matches,i,o,c):{type:Et.error,error:Zr(404,{pathname:ce.path})})]),fe=se.slice(0,U.length),ye=se.slice(U.length);return await Promise.all([wC(D,U,fe,fe.map(()=>de.signal),!1,w.loaderData),wC(D,Z.map(ce=>ce.match),ye,Z.map(ce=>ce.controller?ce.controller.signal:null),!0)]),{results:se,loaderResults:fe,fetcherResults:ye}}function ki(){T=!0,z.push(...hn()),V.forEach((D,F)=>{L.has(F)&&(M.push(F),ze(F))})}function lo(D,F,U){let Z=Ll(w.matches,F);J(D),Pe({errors:{[Z.route.id]:U},fetchers:new Map(w.fetchers)})}function J(D){let F=w.fetchers.get(D);L.has(D)&&!(F&&F.state==="loading"&&R.has(D))&&ze(D),V.delete(D),R.delete(D),N.delete(D),ee.delete(D),w.fetchers.delete(D)}function ge(D){if(u.v7_fetcherPersist){let F=(Q.get(D)||0)-1;F<=0?(Q.delete(D),ee.add(D)):Q.set(D,F)}else J(D);Pe({fetchers:new Map(w.fetchers)})}function ze(D){let F=L.get(D);$e(F,"Expected fetch controller: "+D),F.abort(),L.delete(D)}function ht(D){for(let F of D){let U=ao(F),Z=Yo(U.data);w.fetchers.set(F,Z)}}function _t(){let D=[],F=!1;for(let U of N){let Z=w.fetchers.get(U);$e(Z,"Expected fetcher: "+U),Z.state==="loading"&&(N.delete(U),D.push(U),F=!0)}return ht(D),F}function Tn(D){let F=[];for(let[U,Z]of R)if(Z<D){let de=w.fetchers.get(U);$e(de,"Expected fetcher: "+U),de.state==="loading"&&(ze(U),R.delete(U),F.push(U))}return ht(F),F.length>0}function In(D,F){let U=w.blockers.get(D)||fl;return we.get(D)!==F&&we.set(D,F),U}function yr(D){w.blockers.delete(D),we.delete(D)}function Dn(D,F){let U=w.blockers.get(D)||fl;$e(U.state==="unblocked"&&F.state==="blocked"||U.state==="blocked"&&F.state==="blocked"||U.state==="blocked"&&F.state==="proceeding"||U.state==="blocked"&&F.state==="unblocked"||U.state==="proceeding"&&F.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+F.state);let Z=new Map(w.blockers);Z.set(D,F),Pe({blockers:Z})}function Bo(D){let{currentLocation:F,nextLocation:U,historyAction:Z}=D;if(we.size===0)return;we.size>1&&da(!1,"A router only supports one blocker at a time");let de=Array.from(we.entries()),[se,fe]=de[de.length-1],ye=w.blockers.get(se);if(!(ye&&ye.state==="proceeding")&&fe({currentLocation:F,nextLocation:U,historyAction:Z}))return se}function hn(D){let F=[];return _e.forEach((U,Z)=>{(!D||D(Z))&&(U.cancel(),F.push(Z),_e.delete(Z))}),F}function Ri(D,F,U){if(h=D,v=F,m=U||null,!g&&w.navigation===Ug){g=!0;let Z=co(w.location,w.matches);Z!=null&&Pe({restoreScrollPosition:Z})}return()=>{h=null,v=null,m=null}}function Uo(D,F){return m&&m(D,F.map(Z=>Xpe(Z,w.loaderData)))||D.key}function xr(D,F){if(h&&v){let U=Uo(D,F);h[U]=v()}}function co(D,F){if(h){let U=Uo(D,F),Z=h[U];if(typeof Z=="number")return Z}return null}function Vs(D){i={},l=by(D,o,void 0,i)}return _={get basename(){return c},get state(){return w},get routes(){return a},get window(){return t},initialize:Ae,subscribe:Nt,enableScrollRestoration:Ri,navigate:Ar,fetch:Ye,revalidate:cr,createHref:D=>e.history.createHref(D),encodeLocation:D=>e.history.encodeLocation(D),getFetcher:ao,deleteFetcher:ge,dispose:pt,getBlocker:In,deleteBlocker:yr,_internalFetchControllers:L,_internalActiveDeferreds:_e,_internalSetRoutes:Vs},_}function Ohe(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Sy(e,t,r,n,o,i,a){let l,c;if(i!=null&&a!=="path"){l=[];for(let d of t)if(l.push(d),d.route.id===i){c=d;break}}else l=t,c=t[t.length-1];let u=w3(o||".",a1(l).map(d=>d.pathnameBase),Gc(e.pathname,r)||e.pathname,a==="path");return o==null&&(u.search=e.search,u.hash=e.hash),(o==null||o===""||o===".")&&c&&c.route.index&&!l1(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(u.pathname=u.pathname==="/"?r:mi([r,u.pathname])),Hc(u)}function dC(e,t,r,n){if(!n||!Ohe(n))return{path:r};if(n.formMethod&&!The(n.formMethod))return{path:r,error:Zr(405,{method:n.formMethod})};let o=()=>({path:r,error:Zr(400,{type:"invalid-body"})}),i=n.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=j3(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!xn(a))return o();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,v)=>{let[g,b]=v;return""+m+g+"="+b+`
|
|
202
|
-
`},""):String(n.body);return{path:r,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!xn(a))return o();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}$e(typeof FormData=="function","FormData is not available in this environment");let c,u;if(n.formData)c=Py(n.formData),u=n.formData;else if(n.body instanceof FormData)c=Py(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=mC(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=mC(c)}catch{return o()}let d={formMethod:a,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(xn(d.formMethod))return{path:r,submission:d};let p=Vo(r);return t&&p.search&&l1(p.search)&&c.append("index",""),p.search="?"+c,{path:Hc(p),submission:d}}function jhe(e,t){let r=e;if(t){let n=e.findIndex(o=>o.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function fC(e,t,r,n,o,i,a,l,c,u,d,p,h,m){let v=m?Object.values(m)[0]:h?Object.values(h)[0]:void 0,g=e.createURL(t.location),b=e.createURL(o),y=m?Object.keys(m)[0]:void 0,_=jhe(r,y).filter((j,C)=>{if(j.route.lazy)return!0;if(j.route.loader==null)return!1;if(Che(t.loaderData,t.matches[C],j)||a.some(k=>k===j.route.id))return!0;let P=t.matches[C],E=j;return pC(j,Pt({currentUrl:g,currentParams:P.params,nextUrl:b,nextParams:E.params},n,{actionResult:v,defaultShouldRevalidate:i||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||O3(P,E)}))}),w=[];return c.forEach((j,C)=>{if(!r.some(I=>I.route.id===j.routeId))return;let P=es(d,j.path,p);if(!P){w.push({key:C,routeId:j.routeId,path:j.path,matches:null,match:null,controller:null});return}let E=t.fetchers.get(C),k=Oy(P,j.path),$=!1;u.has(C)?$=!1:l.includes(C)?$=!0:E&&E.state!=="idle"&&E.data===void 0?$=i:$=pC(k,Pt({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:i})),$&&w.push({key:C,routeId:j.routeId,path:j.path,matches:P,match:k,controller:new AbortController})}),[_,w]}function Che(e,t,r){let n=!t||r.route.id!==t.route.id,o=e[r.route.id]===void 0;return n||o}function O3(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function pC(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function hC(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let o=r[e.id];$e(o,"No route found in manifest");let i={};for(let a in n){let c=o[a]!==void 0&&a!=="hasErrorBoundary";da(!c,'Route "'+o.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!c&&!Kpe.has(a)&&(i[a]=n[a])}Object.assign(o,i),Object.assign(o,Pt({},t(o),{lazy:void 0}))}async function pl(e,t,r,n,o,i,a,l){l===void 0&&(l={});let c,u,d,p=v=>{let g,b=new Promise((y,x)=>g=x);return d=()=>g(),t.signal.addEventListener("abort",d),Promise.race([v({request:t,params:r.params,context:l.requestContext}),b])};try{let v=r.route[e];if(r.route.lazy)if(v){let g,b=await Promise.all([p(v).catch(y=>{g=y}),hC(r.route,i,o)]);if(g)throw g;u=b[0]}else if(await hC(r.route,i,o),v=r.route[e],v)u=await p(v);else if(e==="action"){let g=new URL(t.url),b=g.pathname+g.search;throw Zr(405,{method:t.method,pathname:b,routeId:r.route.id})}else return{type:Et.data,data:void 0};else if(v)u=await p(v);else{let g=new URL(t.url),b=g.pathname+g.search;throw Zr(404,{pathname:b})}$e(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(v){c=Et.error,u=v}finally{d&&t.signal.removeEventListener("abort",d)}if(Rhe(u)){let v=u.status;if(whe.has(v)){let y=u.headers.get("Location");if($e(y,"Redirects returned/thrown from loaders/actions must have a Location header"),!S3.test(y))y=Sy(new URL(t.url),n.slice(0,n.indexOf(r)+1),a,!0,y);else if(!l.isStaticRequest){let x=new URL(t.url),_=y.startsWith("//")?new URL(x.protocol+y):new URL(y),w=Gc(_.pathname,a)!=null;_.origin===x.origin&&w&&(y=_.pathname+_.search+_.hash)}if(l.isStaticRequest)throw u.headers.set("Location",y),u;return{type:Et.redirect,status:v,location:y,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===Et.error?Et.error:Et.data,response:u};let g,b=u.headers.get("Content-Type");return b&&/\bapplication\/json\b/.test(b)?g=await u.json():g=await u.text(),c===Et.error?{type:c,error:new s1(v,u.statusText,g),headers:u.headers}:{type:Et.data,data:g,statusCode:u.status,headers:u.headers}}if(c===Et.error)return{type:c,error:u};if(khe(u)){var h,m;return{type:Et.deferred,deferredData:u,statusCode:(h=u.init)==null?void 0:h.status,headers:((m=u.init)==null?void 0:m.headers)&&new Headers(u.init.headers)}}return{type:Et.data,data:u}}function hl(e,t,r,n){let o=e.createURL(j3(t)).toString(),i={signal:r};if(n&&xn(n.formMethod)){let{formMethod:a,formEncType:l}=n;i.method=a.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(n.json)):l==="text/plain"?i.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?i.body=Py(n.formData):i.body=n.formData}return new Request(o,i)}function Py(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function mC(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Ehe(e,t,r,n,o){let i={},a=null,l,c=!1,u={};return r.forEach((d,p)=>{let h=t[p].route.id;if($e(!ds(d),"Cannot handle redirect results in processLoaderData"),zl(d)){let m=Ll(e,h),v=d.error;n&&(v=Object.values(n)[0],n=void 0),a=a||{},a[m.route.id]==null&&(a[m.route.id]=v),i[h]=void 0,c||(c=!0,l=_3(d.error)?d.error.status:500),d.headers&&(u[h]=d.headers)}else qi(d)?(o.set(h,d.deferredData),i[h]=d.deferredData.data):i[h]=d.data,d.statusCode!=null&&d.statusCode!==200&&!c&&(l=d.statusCode),d.headers&&(u[h]=d.headers)}),n&&(a=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:u}}function gC(e,t,r,n,o,i,a,l){let{loaderData:c,errors:u}=Ehe(t,r,n,o,l);for(let d=0;d<i.length;d++){let{key:p,match:h,controller:m}=i[d];$e(a!==void 0&&a[d]!==void 0,"Did not find corresponding fetcher result");let v=a[d];if(!(m&&m.signal.aborted))if(zl(v)){let g=Ll(e.matches,h==null?void 0:h.route.id);u&&u[g.route.id]||(u=Pt({},u,{[g.route.id]:v.error})),e.fetchers.delete(p)}else if(ds(v))$e(!1,"Unhandled fetcher revalidation redirect");else if(qi(v))$e(!1,"Unhandled fetcher deferred data");else{let g=Yo(v.data);e.fetchers.set(p,g)}}return{loaderData:c,errors:u}}function vC(e,t,r,n){let o=Pt({},t);for(let i of r){let a=i.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(o[a]=t[a]):e[a]!==void 0&&i.route.loader&&(o[a]=e[a]),n&&n.hasOwnProperty(a))break}return o}function Ll(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function yC(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Zr(e,t){let{pathname:r,routeId:n,method:o,type:i}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"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?(a="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(a="Not Found",l='No route matches URL "'+r+'"'):e===405&&(a="Method Not Allowed",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new s1(e||500,a,new Error(l),!0)}function xC(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(ds(r))return{result:r,idx:t}}}function j3(e){let t=typeof e=="string"?Vo(e):e;return Hc(Pt({},t,{hash:""}))}function $he(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function qi(e){return e.type===Et.deferred}function zl(e){return e.type===Et.error}function ds(e){return(e&&e.type)===Et.redirect}function khe(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 Rhe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function The(e){return xhe.has(e.toLowerCase())}function xn(e){return vhe.has(e.toLowerCase())}async function wC(e,t,r,n,o,i){for(let a=0;a<r.length;a++){let l=r[a],c=t[a];if(!c)continue;let u=e.find(p=>p.route.id===c.route.id),d=u!=null&&!O3(u,c)&&(i&&i[c.route.id])!==void 0;if(qi(l)&&(o||d)){let p=n[a];$e(p,"Expected an AbortSignal for revalidating fetcher deferred result"),await C3(l,p,o).then(h=>{h&&(r[a]=h||r[a])})}}}async function C3(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:Et.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Et.error,error:o}}return{type:Et.data,data:e.deferredData.data}}}function l1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Oy(e,t){let r=typeof t=="string"?Vo(t).search:t.search;if(e[e.length-1].route.index&&l1(r||""))return e[e.length-1];let n=a1(e);return n[n.length-1]}function _C(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:i,json:a}=e;if(!(!t||!r||!n)){if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:a,text:void 0}}}function Wg(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 Ihe(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 ml(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 Dhe(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 Yo(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 Nhe(e,t){try{let r=e.sessionStorage.getItem(P3);if(r){let n=JSON.parse(r);for(let[o,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function Ahe(e,t){if(t.size>0){let r={};for(let[n,o]of t)r[n]=[...o];try{e.sessionStorage.setItem(P3,JSON.stringify(r))}catch(n){da(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
|
|
203
|
-
* React Router v6.18.0
|
|
204
|
-
*
|
|
205
|
-
* Copyright (c) Remix Software Inc.
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the MIT license found in the
|
|
208
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
209
|
-
*
|
|
210
|
-
* @license MIT
|
|
211
|
-
*/function hh(){return hh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hh.apply(this,arguments)}const Em=f.createContext(null),E3=f.createContext(null),$m=f.createContext(null),km=f.createContext(null),Ci=f.createContext({outlet:null,matches:[],isDataRoute:!1}),$3=f.createContext(null);function Rm(){return f.useContext(km)!=null}function Ei(){return Rm()||$e(!1),f.useContext(km).location}function k3(e){f.useContext($m).static||f.useLayoutEffect(e)}function Ot(){let{isDataRoute:e}=f.useContext(Ci);return e?Yhe():Mhe()}function Mhe(){Rm()||$e(!1);let e=f.useContext(Em),{basename:t,navigator:r}=f.useContext($m),{matches:n}=f.useContext(Ci),{pathname:o}=Ei(),i=JSON.stringify(a1(n).map(c=>c.pathnameBase)),a=f.useRef(!1);return k3(()=>{a.current=!0}),f.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=w3(c,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:mi([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,i,o,e])}const Lhe=f.createContext(null);function zhe(e){let t=f.useContext(Ci).outlet;return t&&f.createElement(Lhe.Provider,{value:e},t)}function Qe(){let{matches:e}=f.useContext(Ci),t=e[e.length-1];return t?t.params:{}}function Fhe(e,t){return R3(e,t)}function R3(e,t,r){Rm()||$e(!1);let{navigator:n}=f.useContext($m),{matches:o}=f.useContext(Ci),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let c=Ei(),u;if(t){var d;let g=typeof t=="string"?Vo(t):t;l==="/"||(d=g.pathname)!=null&&d.startsWith(l)||$e(!1),u=g}else u=c;let p=u.pathname||"/",h=l==="/"?p:p.slice(l.length)||"/",m=es(e,{pathname:h}),v=Hhe(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},a,g.params),pathname:mi([l,n.encodeLocation?n.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:mi([l,n.encodeLocation?n.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,r);return t&&v?f.createElement(km.Provider,{value:{location:hh({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Ct.Pop}},v):v}function Vhe(){let e=Khe(),t=_3(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:o},r):null,i)}const Bhe=f.createElement(Vhe,null);class Uhe extends f.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error?f.createElement(Ci.Provider,{value:this.props.routeContext},f.createElement($3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Whe(e){let{routeContext:t,match:r,children:n}=e,o=f.useContext(Em);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(Ci.Provider,{value:t},n)}function Hhe(e,t,r){var n;if(t===void 0&&(t=[]),r===void 0&&(r=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let i=e,a=(n=r)==null?void 0:n.errors;if(a!=null){let l=i.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id]));l>=0||$e(!1),i=i.slice(0,Math.min(i.length,l+1))}return i.reduceRight((l,c,u)=>{let d=c.route.id?a==null?void 0:a[c.route.id]:null,p=null;r&&(p=c.route.errorElement||Bhe);let h=t.concat(i.slice(0,u+1)),m=()=>{let v;return d?v=p:c.route.Component?v=f.createElement(c.route.Component,null):c.route.element?v=c.route.element:v=l,f.createElement(Whe,{match:c,routeContext:{outlet:l,matches:h,isDataRoute:r!=null},children:v})};return r&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?f.createElement(Uhe,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()},null)}var T3=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(T3||{}),mh=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}(mh||{});function Ghe(e){let t=f.useContext(Em);return t||$e(!1),t}function qhe(e){let t=f.useContext(E3);return t||$e(!1),t}function Qhe(e){let t=f.useContext(Ci);return t||$e(!1),t}function I3(e){let t=Qhe(),r=t.matches[t.matches.length-1];return r.route.id||$e(!1),r.route.id}function Khe(){var e;let t=f.useContext($3),r=qhe(mh.UseRouteError),n=I3(mh.UseRouteError);return t||((e=r.errors)==null?void 0:e[n])}function Yhe(){let{router:e}=Ghe(T3.UseNavigateStable),t=I3(mh.UseNavigateStable),r=f.useRef(!1);return k3(()=>{r.current=!0}),f.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,hh({fromRouteId:t},i)))},[e,t])}function c1(e){return zhe(e.context)}function pe(e){$e(!1)}function Xhe(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Ct.Pop,navigator:i,static:a=!1}=e;Rm()&&$e(!1);let l=t.replace(/^\/*/,"/"),c=f.useMemo(()=>({basename:l,navigator:i,static:a}),[l,i,a]);typeof n=="string"&&(n=Vo(n));let{pathname:u="/",search:d="",hash:p="",state:h=null,key:m="default"}=n,v=f.useMemo(()=>{let g=Gc(u,l);return g==null?null:{location:{pathname:g,search:d,hash:p,state:h,key:m},navigationType:o}},[l,u,d,p,h,m,o]);return v==null?null:f.createElement($m.Provider,{value:c},f.createElement(km.Provider,{children:r,value:v}))}function Jhe(e){let{children:t,location:r}=e;return Fhe(jy(t),r)}new Promise(()=>{});function jy(e,t){t===void 0&&(t=[]);let r=[];return f.Children.forEach(e,(n,o)=>{if(!f.isValidElement(n))return;let i=[...t,o];if(n.type===f.Fragment){r.push.apply(r,jy(n.props.children,i));return}n.type!==pe&&$e(!1),!n.props.index||!n.props.children||$e(!1);let a={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=jy(n.props.children,i)),r.push(a)}),r}function Zhe(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:f.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
212
|
-
* React Router DOM v6.18.0
|
|
213
|
-
*
|
|
214
|
-
* Copyright (c) Remix Software Inc.
|
|
215
|
-
*
|
|
216
|
-
* This source code is licensed under the MIT license found in the
|
|
217
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
218
|
-
*
|
|
219
|
-
* @license MIT
|
|
220
|
-
*/function gh(){return gh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gh.apply(this,arguments)}function Cy(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function eme(e,t){let r=Cy(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}function tme(e,t){return Phe({basename:t==null?void 0:t.basename,future:gh({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Gpe({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||rme(),routes:e,mapRouteProperties:Zhe,window:t==null?void 0:t.window}).initialize()}function rme(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=gh({},t,{errors:nme(t.errors)})),t}function nme(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new s1(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",r[n]=a}catch{}}if(r[n]==null){let i=new Error(o.message);i.stack="",r[n]=i}}else r[n]=o;return r}const ome=f.createContext({isTransitioning:!1}),ime=f.createContext(new Map),ame="startTransition",bC=Fl[ame];function sme(e){bC?bC(e):e()}class lme{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function cme(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=f.useState(r.state),[a,l]=f.useState(),[c,u]=f.useState({isTransitioning:!1}),[d,p]=f.useState(),[h,m]=f.useState(),[v,g]=f.useState(),b=f.useRef(new Map),{v7_startTransition:y}=n||{},x=f.useCallback(P=>{y?sme(P):P()},[y]),_=f.useCallback((P,E)=>{let{deletedFetchers:k,unstable_viewTransitionOpts:$}=E;k.forEach(I=>b.current.delete(I)),P.fetchers.forEach((I,T)=>{I.data!==void 0&&b.current.set(T,I.data)}),!$||r.window==null||typeof r.window.document.startViewTransition!="function"?x(()=>i(P)):h&&d?(d.resolve(),h.skipTransition(),g({state:P,currentLocation:$.currentLocation,nextLocation:$.nextLocation})):(l(P),u({isTransitioning:!0,currentLocation:$.currentLocation,nextLocation:$.nextLocation}))},[r.window,h,d,b,x]);f.useLayoutEffect(()=>r.subscribe(_),[r,_]),f.useEffect(()=>{c.isTransitioning&&p(new lme)},[c.isTransitioning]),f.useEffect(()=>{if(d&&a&&r.window){let P=a,E=d.promise,k=r.window.document.startViewTransition(async()=>{x(()=>i(P)),await E});k.finished.finally(()=>{p(void 0),m(void 0),l(void 0),u({isTransitioning:!1})}),m(k)}},[x,a,d,r.window]),f.useEffect(()=>{d&&a&&o.location.key===a.location.key&&d.resolve()},[d,h,o.location,a]),f.useEffect(()=>{!c.isTransitioning&&v&&(l(v.state),u({isTransitioning:!0,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),g(void 0))},[c.isTransitioning,v]);let w=f.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:P=>r.navigate(P),push:(P,E,k)=>r.navigate(P,{state:E,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(P,E,k)=>r.navigate(P,{replace:!0,state:E,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[r]),j=r.basename||"/",C=f.useMemo(()=>({router:r,navigator:w,static:!1,basename:j}),[r,w,j]);return f.createElement(f.Fragment,null,f.createElement(Em.Provider,{value:C},f.createElement(E3.Provider,{value:o},f.createElement(ime.Provider,{value:b.current},f.createElement(ome.Provider,{value:c},f.createElement(Xhe,{basename:j,location:o.location,navigationType:o.historyAction,navigator:w},o.initialized?f.createElement(ume,{routes:r.routes,state:o}):t))))),null)}function ume(e){let{routes:t,state:r}=e;return R3(t,void 0,r)}var SC;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(SC||(SC={}));var PC;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(PC||(PC={}));function u1(e){let t=f.useRef(Cy(e)),r=f.useRef(!1),n=Ei(),o=f.useMemo(()=>eme(n.search,r.current?null:t.current),[n.search]),i=Ot(),a=f.useCallback((l,c)=>{const u=Cy(typeof l=="function"?l(o):l);r.current=!0,i("?"+u,c)},[i,o]);return[o,a]}var dme=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 qc(e,t){var r=fme(e);if(typeof r.path!="string"){var n=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof n=="string"&&n.length>0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function fme(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var n=t.split(".").pop().toLowerCase(),o=dme.get(n);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var pme=[".DS_Store","Thumbs.db"];function hme(e){return Es(this,void 0,void 0,function(){return $s(this,function(t){return vh(e)&&mme(e.dataTransfer)?[2,xme(e.dataTransfer,e.type)]:gme(e)?[2,vme(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,yme(e)]:[2,[]]})})}function mme(e){return vh(e)}function gme(e){return vh(e)&&vh(e.target)}function vh(e){return typeof e=="object"&&e!==null}function vme(e){return Ey(e.target.files).map(function(t){return qc(t)})}function yme(e){return Es(this,void 0,void 0,function(){var t;return $s(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(n){return qc(n)})]}})})}function xme(e,t){return Es(this,void 0,void 0,function(){var r,n;return $s(this,function(o){switch(o.label){case 0:return e.items?(r=Ey(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(wme))]):[3,2];case 1:return n=o.sent(),[2,OC(D3(n))];case 2:return[2,OC(Ey(e.files).map(function(i){return qc(i)}))]}})})}function OC(e){return e.filter(function(t){return pme.indexOf(t.name)===-1})}function Ey(e){if(e===null)return[];for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(n)}return t}function wme(e){if(typeof e.webkitGetAsEntry!="function")return jC(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?N3(t):jC(e)}function D3(e){return e.reduce(function(t,r){return Yg(Yg([],x1(t),!1),x1(Array.isArray(r)?D3(r):[r]),!1)},[])}function jC(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var r=qc(t);return Promise.resolve(r)}function _me(e){return Es(this,void 0,void 0,function(){return $s(this,function(t){return[2,e.isDirectory?N3(e):bme(e)]})})}function N3(e){var t=e.createReader();return new Promise(function(r,n){var o=[];function i(){var a=this;t.readEntries(function(l){return Es(a,void 0,void 0,function(){var c,u,d;return $s(this,function(p){switch(p.label){case 0:if(l.length)return[3,5];p.label=1;case 1:return p.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return c=p.sent(),r(c),[3,4];case 3:return u=p.sent(),n(u),[3,4];case 4:return[3,6];case 5:d=Promise.all(l.map(_me)),o.push(d),i(),p.label=6;case 6:return[2]}})})},function(l){n(l)})}i()})}function bme(e){return Es(this,void 0,void 0,function(){return $s(this,function(t){return[2,new Promise(function(r,n){e.file(function(o){var i=qc(o,e.fullPath);r(i)},function(o){n(o)})})]})})}var Sme=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return r.some(function(a){var l=a.trim().toLowerCase();return l.charAt(0)==="."?n.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):o===l})}return!0};function CC(e){return jme(e)||Ome(e)||M3(e)||Pme()}function Pme(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
221
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ome(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jme(e){if(Array.isArray(e))return $y(e)}function EC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function $C(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?EC(Object(r),!0).forEach(function(n){A3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A3(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mc(e,t){return $me(e)||Eme(e,t)||M3(e,t)||Cme()}function Cme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
222
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M3(e,t){if(e){if(typeof e=="string")return $y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $y(e,t)}}function $y(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Eme(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,l;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,l=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function $me(e){if(Array.isArray(e))return e}var kme="file-invalid-type",Rme="file-too-large",Tme="file-too-small",Ime="too-many-files",Dme=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var r=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:kme,message:"File type must be ".concat(r)}},kC=function(t){return{code:Rme,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},RC=function(t){return{code:Tme,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Nme={code:Ime,message:"Too many files"};function L3(e,t){var r=e.type==="application/x-moz-file"||Sme(e,t);return[r,r?null:Dme(t)]}function z3(e,t,r){if(Bi(e.size))if(Bi(t)&&Bi(r)){if(e.size>r)return[!1,kC(r)];if(e.size<t)return[!1,RC(t)]}else{if(Bi(t)&&e.size<t)return[!1,RC(t)];if(Bi(r)&&e.size>r)return[!1,kC(r)]}return[!0,null]}function Bi(e){return e!=null}function Ame(e){var t=e.files,r=e.accept,n=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,l=e.validator;return!i&&t.length>1||i&&a>=1&&t.length>a?!1:t.every(function(c){var u=L3(c,r),d=mc(u,1),p=d[0],h=z3(c,n,o),m=mc(h,1),v=m[0],g=l?l(c):null;return p&&v&&!g})}function yh(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ku(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function TC(e){e.preventDefault()}function Mme(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Lme(e){return e.indexOf("Edge/")!==-1}function zme(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Mme(e)||Lme(e)}function Bn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return t.some(function(l){return!yh(n)&&l&&l.apply(void 0,[n].concat(i)),yh(n)})}}function Fme(){return"showOpenFilePicker"in window}function Vme(e){if(Bi(e)){var t=Object.entries(e).filter(function(r){var n=mc(r,2),o=n[0],i=n[1],a=!0;return F3(o)||(console.warn('Skipped "'.concat(o,'" 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.')),a=!1),(!Array.isArray(i)||!i.every(V3))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(r,n){var o=mc(n,2),i=o[0],a=o[1];return $C($C({},r),{},A3({},i,a))},{});return[{description:"Files",accept:t}]}return e}function Bme(e){if(Bi(e))return Object.entries(e).reduce(function(t,r){var n=mc(r,2),o=n[0],i=n[1];return[].concat(CC(t),[o],CC(i))},[]).filter(function(t){return F3(t)||V3(t)}).join(",")}function Ume(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Wme(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function F3(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function V3(e){return/^.*\.[\w]+$/.test(e)}var Hme=["children"],Gme=["open"],qme=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Qme=["refKey","onChange","onClick"];function Kme(e){return Jme(e)||Xme(e)||B3(e)||Yme()}function Yme(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
223
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xme(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jme(e){if(Array.isArray(e))return ky(e)}function Hg(e,t){return tge(e)||ege(e,t)||B3(e,t)||Zme()}function Zme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
224
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B3(e,t){if(e){if(typeof e=="string")return ky(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ky(e,t)}}function ky(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ege(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,l;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,l=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function tge(e){if(Array.isArray(e))return e}function IC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?IC(Object(r),!0).forEach(function(n){Ry(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ry(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xh(e,t){if(e==null)return{};var r=rge(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rge(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var d1=f.forwardRef(function(e,t){var r=e.children,n=xh(e,Hme),o=W3(n),i=o.open,a=xh(o,Gme);return f.useImperativeHandle(t,function(){return{open:i}},[i]),S.createElement(f.Fragment,null,r(vt(vt({},a),{},{open:i})))});d1.displayName="Dropzone";var U3={disabled:!1,getFilesFromEvent:hme,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};d1.defaultProps=U3;d1.propTypes={children:Te.func,accept:Te.objectOf(Te.arrayOf(Te.string)),multiple:Te.bool,preventDropOnDocument:Te.bool,noClick:Te.bool,noKeyboard:Te.bool,noDrag:Te.bool,noDragEventsBubbling:Te.bool,minSize:Te.number,maxSize:Te.number,maxFiles:Te.number,disabled:Te.bool,getFilesFromEvent:Te.func,onFileDialogCancel:Te.func,onFileDialogOpen:Te.func,useFsAccessApi:Te.bool,autoFocus:Te.bool,onDragEnter:Te.func,onDragLeave:Te.func,onDragOver:Te.func,onDrop:Te.func,onDropAccepted:Te.func,onDropRejected:Te.func,onError:Te.func,validator:Te.func};var Ty={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function W3(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=vt(vt({},U3),e),r=t.accept,n=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,l=t.multiple,c=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,h=t.onDrop,m=t.onDropAccepted,v=t.onDropRejected,g=t.onFileDialogCancel,b=t.onFileDialogOpen,y=t.useFsAccessApi,x=t.autoFocus,_=t.preventDropOnDocument,w=t.noClick,j=t.noKeyboard,C=t.noDrag,P=t.noDragEventsBubbling,E=t.onError,k=t.validator,$=f.useMemo(function(){return Bme(r)},[r]),I=f.useMemo(function(){return Vme(r)},[r]),T=f.useMemo(function(){return typeof b=="function"?b:DC},[b]),z=f.useMemo(function(){return typeof g=="function"?g:DC},[g]),M=f.useRef(null),L=f.useRef(null),q=f.useReducer(nge,Ty),Y=Hg(q,2),R=Y[0],N=Y[1],V=R.isFocused,Q=R.isFileDialogActive,ee=f.useRef(typeof window<"u"&&window.isSecureContext&&y&&Fme()),_e=function(){!ee.current&&Q&&setTimeout(function(){if(L.current){var ge=L.current.files;ge.length||(N({type:"closeDialog"}),z())}},300)};f.useEffect(function(){return window.addEventListener("focus",_e,!1),function(){window.removeEventListener("focus",_e,!1)}},[L,Q,z,ee]);var we=f.useRef([]),Ue=function(ge){M.current&&M.current.contains(ge.target)||(ge.preventDefault(),we.current=[])};f.useEffect(function(){return _&&(document.addEventListener("dragover",TC,!1),document.addEventListener("drop",Ue,!1)),function(){_&&(document.removeEventListener("dragover",TC),document.removeEventListener("drop",Ue))}},[M,_]),f.useEffect(function(){return!n&&x&&M.current&&M.current.focus(),function(){}},[M,x,n]);var Ae=f.useCallback(function(J){E?E(J):console.error(J)},[E]),pt=f.useCallback(function(J){J.preventDefault(),J.persist(),Ft(J),we.current=[].concat(Kme(we.current),[J.target]),Ku(J)&&Promise.resolve(o(J)).then(function(ge){if(!(yh(J)&&!P)){var ze=ge.length,ht=ze>0&&Ame({files:ge,accept:$,minSize:a,maxSize:i,multiple:l,maxFiles:c,validator:k}),_t=ze>0&&!ht;N({isDragAccept:ht,isDragReject:_t,isDragActive:!0,type:"setDraggedFiles"}),u&&u(J)}}).catch(function(ge){return Ae(ge)})},[o,u,Ae,P,$,a,i,l,c,k]),Nt=f.useCallback(function(J){J.preventDefault(),J.persist(),Ft(J);var ge=Ku(J);if(ge&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return ge&&p&&p(J),!1},[p,P]),Pe=f.useCallback(function(J){J.preventDefault(),J.persist(),Ft(J);var ge=we.current.filter(function(ht){return M.current&&M.current.contains(ht)}),ze=ge.indexOf(J.target);ze!==-1&&ge.splice(ze,1),we.current=ge,!(ge.length>0)&&(N({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ku(J)&&d&&d(J))},[M,d,P]),Gt=f.useCallback(function(J,ge){var ze=[],ht=[];J.forEach(function(_t){var Tn=L3(_t,$),In=Hg(Tn,2),yr=In[0],Dn=In[1],Bo=z3(_t,a,i),hn=Hg(Bo,2),Ri=hn[0],Uo=hn[1],xr=k?k(_t):null;if(yr&&Ri&&!xr)ze.push(_t);else{var co=[Dn,Uo];xr&&(co=co.concat(xr)),ht.push({file:_t,errors:co.filter(function(Vs){return Vs})})}}),(!l&&ze.length>1||l&&c>=1&&ze.length>c)&&(ze.forEach(function(_t){ht.push({file:_t,errors:[Nme]})}),ze.splice(0)),N({acceptedFiles:ze,fileRejections:ht,type:"setFiles"}),h&&h(ze,ht,ge),ht.length>0&&v&&v(ht,ge),ze.length>0&&m&&m(ze,ge)},[N,l,$,a,i,c,h,m,v,k]),Ar=f.useCallback(function(J){J.preventDefault(),J.persist(),Ft(J),we.current=[],Ku(J)&&Promise.resolve(o(J)).then(function(ge){yh(J)&&!P||Gt(ge,J)}).catch(function(ge){return Ae(ge)}),N({type:"reset"})},[o,Gt,Ae,P]),cr=f.useCallback(function(){if(ee.current){N({type:"openDialog"}),T();var J={multiple:l,types:I};window.showOpenFilePicker(J).then(function(ge){return o(ge)}).then(function(ge){Gt(ge,null),N({type:"closeDialog"})}).catch(function(ge){Ume(ge)?(z(ge),N({type:"closeDialog"})):Wme(ge)?(ee.current=!1,L.current?(L.current.value=null,L.current.click()):Ae(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Ae(ge)});return}L.current&&(N({type:"openDialog"}),T(),L.current.value=null,L.current.click())},[N,T,z,y,Gt,Ae,I,l]),qt=f.useCallback(function(J){!M.current||!M.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),cr())},[M,cr]),At=f.useCallback(function(){N({type:"focus"})},[]),io=f.useCallback(function(){N({type:"blur"})},[]),ao=f.useCallback(function(){w||(zme()?setTimeout(cr,0):cr())},[w,cr]),Ye=function(ge){return n?null:ge},so=function(ge){return j?null:Ye(ge)},Rn=function(ge){return C?null:Ye(ge)},Ft=function(ge){P&&ge.stopPropagation()},Oa=f.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ge=J.refKey,ze=ge===void 0?"ref":ge,ht=J.role,_t=J.onKeyDown,Tn=J.onFocus,In=J.onBlur,yr=J.onClick,Dn=J.onDragEnter,Bo=J.onDragOver,hn=J.onDragLeave,Ri=J.onDrop,Uo=xh(J,qme);return vt(vt(Ry({onKeyDown:so(Bn(_t,qt)),onFocus:so(Bn(Tn,At)),onBlur:so(Bn(In,io)),onClick:Ye(Bn(yr,ao)),onDragEnter:Rn(Bn(Dn,pt)),onDragOver:Rn(Bn(Bo,Nt)),onDragLeave:Rn(Bn(hn,Pe)),onDrop:Rn(Bn(Ri,Ar)),role:typeof ht=="string"&&ht!==""?ht:"presentation"},ze,M),!n&&!j?{tabIndex:0}:{}),Uo)}},[M,qt,At,io,ao,pt,Nt,Pe,Ar,j,C,n]),ki=f.useCallback(function(J){J.stopPropagation()},[]),lo=f.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ge=J.refKey,ze=ge===void 0?"ref":ge,ht=J.onChange,_t=J.onClick,Tn=xh(J,Qme),In=Ry({accept:$,multiple:l,type:"file",style:{display:"none"},onChange:Ye(Bn(ht,Ar)),onClick:Ye(Bn(_t,ki)),tabIndex:-1},ze,L);return vt(vt({},In),Tn)}},[L,r,l,Ar,n]);return vt(vt({},R),{},{isFocused:V&&!n,getRootProps:Oa,getInputProps:lo,rootRef:M,inputRef:L,open:Ye(cr)})}function nge(e,t){switch(t.type){case"focus":return vt(vt({},e),{},{isFocused:!0});case"blur":return vt(vt({},e),{},{isFocused:!1});case"openDialog":return vt(vt({},Ty),{},{isFileDialogActive:!0});case"closeDialog":return vt(vt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return vt(vt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return vt(vt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return vt({},Ty);default:return e}}function DC(){}const[oge,ige]=Do("Dropzone component was not found in tree");var NC=Object.getOwnPropertySymbols,age=Object.prototype.hasOwnProperty,sge=Object.prototype.propertyIsEnumerable,lge=(e,t)=>{var r={};for(var n in e)age.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&NC)for(var n of NC(e))t.indexOf(n)<0&&sge.call(e,n)&&(r[n]=e[n]);return r};function f1(e){const t=r=>{const n=H(`Dropzone${J1(e)}`,{},r),{children:o}=n,i=lge(n,["children"]),a=ige(),l=ks(o)?o:S.createElement("span",null,o);return a[e]?f.cloneElement(l,i):null};return t.displayName=`@mantine/dropzone/${J1(e)}`,t}const cge=f1("accept"),uge=f1("reject"),dge=f1("idle");var fge=Object.defineProperty,pge=Object.defineProperties,hge=Object.getOwnPropertyDescriptors,AC=Object.getOwnPropertySymbols,mge=Object.prototype.hasOwnProperty,gge=Object.prototype.propertyIsEnumerable,MC=(e,t,r)=>t in e?fge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LC=(e,t)=>{for(var r in t||(t={}))mge.call(t,r)&&MC(e,r,t[r]);if(AC)for(var r of AC(t))gge.call(t,r)&&MC(e,r,t[r]);return e},vge=(e,t)=>pge(e,hge(t)),yge=W((e,{padding:t,radius:r})=>{const n=e.fn.variant({color:"red",variant:"light"}),o=e.fn.variant({color:e.primaryColor,variant:"light"});return{root:vge(LC(LC({},e.fn.fontStyles()),e.fn.focusStyles()),{boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${O(2)} dashed ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,padding:A({size:t,sizes:e.spacing}),borderRadius:e.fn.radius(r),cursor:"pointer",userSelect:"none",transition:"background-color 150ms ease",position:"relative","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]},"&[data-loading]":{cursor:"default","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white}},"&[data-accept]":{backgroundColor:e.colorScheme==="dark"?o.background:e.colors[e.primaryColor][0],borderColor:e.colorScheme==="dark"?o.border:e.colors[e.primaryColor][4],"&:hover":{backgroundColor:e.colorScheme==="dark"?o.background:e.colors[e.primaryColor][0]}},"&[data-reject]":{backgroundColor:e.colorScheme==="dark"?n.background:e.colors.red[0],borderColor:e.colorScheme==="dark"?n.border:e.colors.red[4],"&:hover":{backgroundColor:e.colorScheme==="dark"?n.background:e.colors.red[0]}}}),inner:{pointerEvents:"none",userSelect:"none"}}});const xge=yge;var wge=Object.defineProperty,_ge=Object.defineProperties,bge=Object.getOwnPropertyDescriptors,wh=Object.getOwnPropertySymbols,H3=Object.prototype.hasOwnProperty,G3=Object.prototype.propertyIsEnumerable,zC=(e,t,r)=>t in e?wge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gl=(e,t)=>{for(var r in t||(t={}))H3.call(t,r)&&zC(e,r,t[r]);if(wh)for(var r of wh(t))G3.call(t,r)&&zC(e,r,t[r]);return e},Gg=(e,t)=>_ge(e,bge(t)),Sge=(e,t)=>{var r={};for(var n in e)H3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&wh)for(var n of wh(e))t.indexOf(n)<0&&G3.call(e,n)&&(r[n]=e[n]);return r};const Pge={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0};function Fs(e){const t=H("Dropzone",Pge,e),{className:r,padding:n,radius:o,disabled:i,classNames:a,styles:l,loading:c,multiple:u,maxSize:d,accept:p,children:h,onDropAny:m,onDrop:v,onReject:g,openRef:b,name:y,unstyled:x,maxFiles:_,autoFocus:w,activateOnClick:j,activateOnDrag:C,dragEventsBubbling:P,activateOnKeyboard:E,onDragEnter:k,onDragLeave:$,onDragOver:I,onFileDialogCancel:T,onFileDialogOpen:z,preventDropOnDocument:M,useFsAccessApi:L,getFilesFromEvent:q,validator:Y,variant:R}=t,N=Sge(t,["className","padding","radius","disabled","classNames","styles","loading","multiple","maxSize","accept","children","onDropAny","onDrop","onReject","openRef","name","unstyled","maxFiles","autoFocus","activateOnClick","activateOnDrag","dragEventsBubbling","activateOnKeyboard","onDragEnter","onDragLeave","onDragOver","onFileDialogCancel","onFileDialogOpen","preventDropOnDocument","useFsAccessApi","getFilesFromEvent","validator","variant"]),{classes:V,cx:Q}=xge({radius:o,padding:n},{name:"Dropzone",classNames:a,styles:l,unstyled:x,variant:R}),{getRootProps:ee,getInputProps:_e,isDragAccept:we,isDragReject:Ue,open:Ae}=W3(gl({onDrop:m,onDropAccepted:v,onDropRejected:g,disabled:i||c,accept:Array.isArray(p)?p.reduce((Nt,Pe)=>Gg(gl({},Nt),{[Pe]:[]}),{}):p,multiple:u,maxSize:d,maxFiles:_,autoFocus:w,noClick:!j,noDrag:!C,noDragEventsBubbling:!P,noKeyboard:!E,onDragEnter:k,onDragLeave:$,onDragOver:I,onFileDialogCancel:T,onFileDialogOpen:z,preventDropOnDocument:M,useFsAccessApi:L,validator:Y},q?{getFilesFromEvent:q}:null));QE(b,Ae);const pt=!we&&!Ue;return S.createElement(oge,{value:{accept:we,reject:Ue,idle:pt}},S.createElement(oe,Gg(gl(gl({},N),ee()),{"data-accept":we||void 0,"data-reject":Ue||void 0,"data-idle":pt||void 0,"data-loading":c||void 0,className:Q(V.root,r)}),S.createElement(tD,{visible:c,radius:o,unstyled:x}),S.createElement("input",Gg(gl({},_e()),{name:y})),S.createElement("div",{className:V.inner},h)))}Fs.displayName="@mantine/dropzone/Dropzone";Fs.Accept=cge;Fs.Reject=uge;Fs.Idle=dge;const q3=Fs;var Oge=Object.defineProperty,jge=Object.defineProperties,Cge=Object.getOwnPropertyDescriptors,FC=Object.getOwnPropertySymbols,Ege=Object.prototype.hasOwnProperty,$ge=Object.prototype.propertyIsEnumerable,VC=(e,t,r)=>t in e?Oge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kge=(e,t)=>{for(var r in t||(t={}))Ege.call(t,r)&&VC(e,r,t[r]);if(FC)for(var r of FC(t))$ge.call(t,r)&&VC(e,r,t[r]);return e},Rge=(e,t)=>jge(e,Cge(t)),Tge=W(e=>({wrapper:Rge(kge({},e.fn.cover(0)),{position:"fixed",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,display:"flex",padding:e.spacing.xs,transition:"opacity 100ms ease"}),dropzone:{flex:1}}));const Ige=Tge;var Dge=Object.defineProperty,Nge=Object.defineProperties,Age=Object.getOwnPropertyDescriptors,_h=Object.getOwnPropertySymbols,Q3=Object.prototype.hasOwnProperty,K3=Object.prototype.propertyIsEnumerable,BC=(e,t,r)=>t in e?Dge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qg=(e,t)=>{for(var r in t||(t={}))Q3.call(t,r)&&BC(e,r,t[r]);if(_h)for(var r of _h(t))K3.call(t,r)&&BC(e,r,t[r]);return e},Qg=(e,t)=>Nge(e,Age(t)),Mge=(e,t)=>{var r={};for(var n in e)Q3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&_h)for(var n of _h(e))t.indexOf(n)<0&&K3.call(e,n)&&(r[n]=e[n]);return r};const Lge={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:$n("max"),withinPortal:!0};function Y3(e){const t=H("DropzoneFullScreen",Lge,e),{classNames:r,styles:n,sx:o,className:i,style:a,unstyled:l,active:c,onDrop:u,onReject:d,zIndex:p,withinPortal:h,portalProps:m}=t,v=Mge(t,["classNames","styles","sx","className","style","unstyled","active","onDrop","onReject","zIndex","withinPortal","portalProps"]),[g,b]=S.useState(0),[y,{open:x,close:_}]=c6(!1),{classes:w,cx:j}=Ige(null,{name:"DropzoneFullScreen",classNames:r,styles:n,unstyled:l}),C=E=>{E.dataTransfer.types.includes("Files")&&(b(k=>k+1),x())},P=()=>{b(E=>E-1)};return f.useEffect(()=>{g===0&&_()},[g]),f.useEffect(()=>{if(c)return document.addEventListener("dragenter",C,!1),document.addEventListener("dragleave",P,!1),()=>{document.removeEventListener("dragenter",C,!1),document.removeEventListener("dragleave",P,!1)}},[c]),S.createElement(Ns,Qg(qg({},m),{withinPortal:h}),S.createElement(oe,{className:j(w.wrapper,i),sx:o,style:Qg(qg({},a),{opacity:y?1:0,pointerEvents:y?"all":"none",zIndex:p})},S.createElement(Fs,Qg(qg({},v),{classNames:r,styles:n,unstyled:l,className:w.dropzone,onDrop:E=>{u==null||u(E),_()},onReject:E=>{d==null||d(E),_()}}))))}Y3.displayName="@mantine/dropzone/DropzoneFullScreen";q3.FullScreen=Y3;const Yu=q3,zge='{"resourceType": "Bundle"}';function Kg({id:e,title:t,message:r,color:n,icon:o,withCloseButton:i=!1,method:a="show"}){bo[a]({id:e,loading:!0,title:t,message:r,color:n,icon:o,withCloseButton:i,autoClose:!1})}function Fge(){const e=Zt(),t=ae(),[r,n]=f.useState({}),o=f.useCallback(async(l,c)=>{const u="batch-upload";Kg({id:u,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show"});try{n({});let d=JSON.parse(l);d.type!=="batch"&&d.type!=="transaction"&&(d=q5(d));const p=await t.executeBatch(d);n(h=>({...h,[c]:p})),Kg({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(wm,{size:"1rem"}),withCloseButton:!0})}catch(d){Kg({id:u,title:"Batch Upload Failed",color:"red",message:Ee(d),method:"update",icon:s.jsx(dh,{size:"1rem"}),withCloseButton:!0})}},[t]),i=f.useCallback(async l=>{for(const c of l){const u=new FileReader;u.onload=d=>{var p;return o((p=d.target)==null?void 0:p.result,c.name)},u.readAsText(c)}},[o]),a=f.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return s.jsxs(Se,{children:[s.jsx(he,{children:"Batch Create"}),s.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",s.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(r).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(He,{defaultValue:"upload",children:[s.jsxs(He.List,{children:[s.jsx(He.Tab,{value:"upload",children:"File Upload"}),s.jsx(He.Tab,{value:"json",children:"JSON"})]}),s.jsx(He.Panel,{value:"upload",pt:"xs",children:s.jsx(Yu,{onDrop:i,accept:["application/json"],children:s.jsxs(K,{position:"center",spacing:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(Yu.Accept,{children:s.jsx(Gj,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(Yu.Reject,{children:s.jsx(dh,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(Yu.Idle,{children:s.jsx(Gj,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(re,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(re,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(He.Panel,{value:"json",pt:"xs",children:s.jsxs(De,{onSubmit:a,children:[s.jsx(Ls,{"data-testid":"batch-input",name:"input",minRows:20,defaultValue:zge,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(r).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(He,{defaultValue:Object.keys(r)[0],children:[s.jsx(He.List,{children:Object.keys(r).map(l=>s.jsx(He.Tab,{value:l,children:l},l))}),Object.keys(r).map(l=>s.jsx(He.Panel,{value:l,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(r[l],void 0,2)})},l))]}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{onClick:()=>n({}),children:"Start over"})})]})]})}function Vge(){const{resourceType:e}=Qe(),r=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[n]=Os("Questionnaire",`subject-type=${e}`);return n?n.length===0?s.jsxs(Se,{children:[s.jsxs(he,{children:["No apps for ",e]}),s.jsx(ke,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(Se,{children:s.jsx("div",{children:n.map(o=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(ke,{to:`/forms/${o.id}?subject=`+r.map(i=>`${e}/${i}`).join(","),children:o.name})}),s.jsx("p",{children:o.description})]},o.id))})}):s.jsx(En,{})}function Bge(){const e=ae(),[t,r]=f.useState(),[n,o]=f.useState(!1);return s.jsx(Se,{width:450,children:s.jsxs(De,{style:{maxWidth:400},onSubmit:i=>{r(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(a=>r(ct(a)))},children:[s.jsxs(ir,{sx:{flexDirection:"column"},children:[s.jsx(kn,{size:32}),s.jsx(he,{children:"Change password"})]}),!n&&s.jsxs(je,{spacing:"xl",mt:"xl",children:[s.jsx(_o,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:lt(t,"oldPassword")}),s.jsx(_o,{name:"newPassword",label:"New password",required:!0,error:lt(t,"newPassword")}),s.jsx(_o,{name:"confirmPassword",label:"Confirm new password",required:!0,error:lt(t,"confirmPassword")}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"Change password"})})]}),n&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const X3=["Form","JSON"],Uge=X3[0].toLowerCase();function Wge(){const e=Ot(),{resourceType:t}=Qe(),r=window.location.pathname.split("/").pop(),[n,o]=f.useState(r??Uge);function i(a){o(a),e(`/${t}/new/${a}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(sn,{children:[s.jsxs(re,{p:"md",weight:500,children:["New ",t]}),s.jsx(ma,{children:s.jsx(He,{defaultValue:"form",value:n,onTabChange:i,children:s.jsx(He.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:X3.map(a=>s.jsx(He.Tab,{value:a.toLowerCase(),px:"md",children:a},a))})})})]}),s.jsx(c1,{})]})}function Hge(){return s.jsx(Se,{children:s.jsxs(je,{children:[s.jsx(he,{order:1,children:"Unexpected Error"}),s.jsx(re,{children:"We're sorry, something went wrong."}),s.jsxs(re,{children:["Please contact ",s.jsx(Le,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const Tm=W(e=>({root:{display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 10px"},entry:{display:"inline-block",margin:"5px 20px 5px 5px"},key:{color:e.colors.gray[6],textTransform:"uppercase",fontSize:e.fontSizes.xs,whiteSpace:"nowrap"},value:{fontSize:e.fontSizes.md,fontWeight:600,marginLeft:0,whiteSpace:"nowrap"}}));function Oe(e){const{classes:t}=Tm();return s.jsx(ma,{children:s.jsx("div",{className:t.root,children:e.children})})}Oe.Entry=function(t){const{classes:r}=Tm();return s.jsx("div",{className:r.entry,children:t.children})};Oe.Key=function(t){const{classes:r}=Tm();return s.jsx("div",{className:r.key,children:t.children})};Oe.Value=function(t){const{classes:r}=Tm();return s.jsx("div",{className:r.value,children:t.children})};function Gge(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function J3(e){var r,n;const t=Ke(e.patient);return t?s.jsxs(Oe,{children:[s.jsx(_i,{value:t,size:"lg",color:Gge(t)}),s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"Name"}),s.jsx(Oe.Value,{children:s.jsx(ke,{to:t,children:t.name?s.jsx(Ax,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"DoB"}),s.jsx(Oe.Value,{children:t.birthDate})]}),s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"Age"}),s.jsx(Oe.Value,{children:hie(t.birthDate)})]})]}),t.gender&&s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"Gender"}),s.jsx(Oe.Value,{children:t.gender})]}),t.address&&s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"State"}),s.jsx(Oe.Value,{children:(r=t.address[0])==null?void 0:r.state})]}),(n=t.identifier)==null?void 0:n.map(o=>s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:o==null?void 0:o.system}),s.jsx(Oe.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function Z3(e){const t=Ke(e.resource);if(!t)return null;const r=[{key:"Type",value:s.jsx(ke,{to:`/${t.resourceType}`,children:t.resourceType})}];function n(l,c){l&&c&&r.push({key:l,value:c})}function o(l){l&&n(l.system,l.value)}function i(l,c){Array.isArray(c)?c.forEach(u=>i(l,u)):typeof c=="string"?n(l,c):c&&(Array.isArray(c.coding)?n(l,c.coding.map(u=>u.display||u.code).join(", ")):n(l,c.text))}const a=ko(t);return a!==et(t)&&n("Name",a),"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)),r.length===1&&r.push({key:"ID",value:t.id}),s.jsx(Oe,{children:r.map(l=>s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:l.key}),s.jsx(Oe.Value,{children:l.value})]},`${l.key}-${l.value}`))})}function p1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function qge(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 wd(e,t){return new Promise((r,n)=>{var i;const o=new MessageChannel;o.port1.onmessage=({data:a})=>{o.port1.close(),a.error?n(a.error):r(a.result)},(i=e.contentWindow)==null||i.postMessage(t,"https://codeeditor.medplum.com",[o.port2])})}function $i(e){var t;return vx((t=e.getActiveLogin())==null?void 0:t.project)}function Qge(e,t){const r=new Blob([e],{type:Kt.JSON}),n=URL.createObjectURL(r),o=document.createElement("a");o.href=n;const i=t??new Date().toISOString().replace(/\D/g,"");o.download=`${i}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(n)}function Kge(){const{id:e}=Qe(),t=Ei(),n=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=ae(),[i,a]=f.useState(!0),[l,c]=f.useState(),[u,d]=f.useState(),[p,h]=f.useState(),[m,v]=f.useState(),[g,b]=f.useState();if(f.useEffect(()=>{const _={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(n){const w=n.split(",").filter(j=>!!j);w.length===1&&_.entry.push({request:{method:"GET",url:w[0]}}),d(w)}o.executeBatch(_).then(w=>{var j,C,P,E,k,$,I;((P=(C=(j=w.entry)==null?void 0:j[0])==null?void 0:C.response)==null?void 0:P.status)!=="200"?v((k=(E=w.entry)==null?void 0:E[0])==null?void 0:k.response):(c(($=w.entry[0])==null?void 0:$.resource),h((I=w.entry[1])==null?void 0:I.resource)),a(!1)}).catch(w=>{v(w),a(!1)})},[o,e,n]),m)return s.jsx(Se,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(g)return s.jsxs(Se,{children:[s.jsx(he,{children:l==null?void 0:l.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[g.length===1&&s.jsx("li",{children:s.jsx(ke,{to:g[0],children:"Review your answers"})}),g.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:g.map(_=>s.jsx("li",{children:s.jsx(ke,{to:_,children:et(_)})},_.id))})]}),p&&s.jsx("li",{children:s.jsxs(ke,{to:p,children:["Back to ",ko(p)]})}),s.jsx("li",{children:s.jsx(ke,{to:"/",children:"Go back home"})})]})]});if(i||!l)return s.jsx(En,{});const y=p&&p1(p);return s.jsxs(s.Fragment,{children:[y&&s.jsx(J3,{patient:y}),p&&p.resourceType!=="Patient"&&s.jsx(Z3,{resource:p}),s.jsx(sn,{p:"xl",shadow:"xs",radius:0,children:s.jsxs(re,{children:[ko(l),u&&u.length>1&&s.jsxs(s.Fragment,{children:[" (for ",u.length," resources)"]})]})}),s.jsx(Se,{children:s.jsx(a3,{questionnaire:l,subject:p&&dt(p),onSubmit:x})})]});async function x(_){const w=[];if(!u||u.length===0)w.push(await o.createResource(_));else for(const j of u)w.push(await o.createResource({..._,subject:{reference:j}}));b(w)}}const Yge={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function eA(e,t){const r=e.resourceType||Xge(t),n=e.fields??Jge(r),o=e.filters??(e.resourceType?void 0:Zge(r)),i=e.sortRules??eve(r),a=e.offset??0,l=e.count??Lc;return{...e,resourceType:r,fields:n,filters:o,sortRules:i,offset:a,count:l}}function Xge(e){var t,r;return localStorage.getItem("defaultResourceType")??((r=(t=e==null?void 0:e.option)==null?void 0:t.find(n=>n.id==="defaultResourceType"))==null?void 0:r.valueString)??"Patient"}function Jge(e){const t=h1(e);if(t!=null&&t.fields)return t.fields;const r=["id","_lastUpdated"];switch(e){case"Patient":r.push("name","birthDate","gender");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":r.push("name");break;case"CodeSystem":case"ValueSet":r.push("name","title","status");break;case"Condition":r.push("subject","code","clinicalStatus");break;case"Device":r.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":r.push("manufacturer[x]","deviceName");break;case"DeviceRequest":r.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":r.push("subject","code","status");break;case"Encounter":r.push("subject");break;case"ServiceRequest":r.push("subject","code","status","orderDetail");break;case"Subscription":r.push("criteria");break;case"User":r.push("email");break}return r}function Zge(e){var t;return(t=h1(e))==null?void 0:t.filters}function eve(e){const t=h1(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function h1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function tve(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function rve(e,t){const r={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},n=eA(r,t.getUserConfiguration()),o=await t.search(n.resourceType,Za({...n,total:"accurate",fields:void 0}));return q5(o)}const nve=W(e=>({paper:{[`@media (max-width: ${e.breakpoints.sm})`]:{margin:2,padding:4}}}));function UC(){const{classes:e}=nve(),t=ae(),r=Ot(),n=Ei(),[o,i]=f.useState();return f.useEffect(()=>{const a=Ase(n.pathname+n.search),l=eA(a,t.getUserConfiguration());n.pathname===`/${l.resourceType}`&&n.search===Za(l)?(tve(l),i(l)):r(`/${l.resourceType}${Za(l)}`)},[t,r,n]),!(o!=null&&o.resourceType)||!o.fields||o.fields.length===0?s.jsx(En,{}):s.jsx(sn,{shadow:"xs",m:"md",p:"xs",className:e.paper,children:s.jsx(Wc,{checkboxesEnabled:!0,search:o,userConfig:t.getUserConfiguration(),onClick:a=>r(`/${a.resource.resourceType}/${a.resource.id}`),onAuxClick:a=>window.open(`/${a.resource.resourceType}/${a.resource.id}`,"_blank"),onChange:a=>{r(`/${o.resourceType}${Za(a.definition)}`)},onNew:()=>{r(Yge[o.resourceType]??`/${o.resourceType}/new`)},onExportCsv:()=>{const a=t.fhirUrl(o.resourceType,"$csv")+Za(o);t.download(a).then(l=>{window.open(window.URL.createObjectURL(l),"_blank")}).catch(l=>me({color:"red",message:Ee(l),autoClose:!1}))},onExportTransactionBundle:async()=>{rve(o,t).then(a=>Qge(JSON.stringify(a,void 0,2))).catch(a=>me({color:"red",message:Ee(a),autoClose:!1}))},onDelete:a=>{window.confirm("Are you sure you want to delete these resources?")&&(t.invalidateSearches(o.resourceType),t.executeBatch({resourceType:"Bundle",type:"batch",entry:a.map(l=>({request:{method:"DELETE",url:`${o.resourceType}/${l}`}}))}).then(()=>i({...o})).catch(l=>me({color:"red",message:Ee(l),autoClose:!1})))},onBulk:a=>{r(`/bulk/${o.resourceType}?ids=${a.join(",")}`)}})})}function ove(){const e=ae(),[t,r]=f.useState(),[n,o]=f.useState(void 0);f.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"),r(c.toString()),o(l.enrolled)}).catch(l=>me({color:"red",message:Ee(l),autoClose:!1}))},[e]);const i=f.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),me({color:"green",message:"Success"})}).catch(c=>me({color:"red",message:Ee(c),autoClose:!1}))},[e]),a=f.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return n===void 0?null:n?s.jsx(Se,{children:s.jsxs(K,{children:[s.jsx(he,{children:"MFA is enabled"}),s.jsx(ne,{onClick:a,children:"Disable MFA"})]})}):s.jsx(Se,{width:400,children:s.jsxs(De,{onSubmit:i,children:[s.jsx(he,{children:"Multi Factor Auth Setup"}),s.jsx(ir,{children:s.jsx("img",{src:t})}),s.jsx(le,{name:"token",label:"Code"}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{type:"submit",children:"Enroll"})})]})})}const ive={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function Qc(){return ive}function ave(){const e=Ot(),[t]=u1(),r=t.get("client_id");if(!r)return null;const n=t.get("scope")||"openid";function o(i){const a=new URL(t.get("redirect_uri"));for(const l of["scope","state","nonce"])t.has(l)&&a.searchParams.set(l,t.get(l));a.searchParams.set("code",i),window.location.assign(a.toString())}return s.jsxs(g3,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Qc().googleClientId,clientId:r||void 0,scope:n,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:n!=="openid",children:[s.jsx(kn,{size:32}),s.jsx(he,{children:"Sign in to Medplum"})]})}function sve(){const e=ae(),t=Ot(),r=Qc();return f.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),s.jsxs(zpe,{type:"project",onSuccess:()=>t("/"),googleClientId:r.googleClientId,recaptchaSiteKey:r.recaptchaSiteKey,children:[s.jsx(kn,{size:32}),s.jsx(he,{children:"Create a new account"})]})}function lve(){const e=Ot(),t=ae(),[r,n]=f.useState(),[o,i]=f.useState(!1),a=Qc().recaptchaSiteKey;return f.useEffect(()=>{h3(a)},[a]),s.jsx(Se,{width:450,children:s.jsxs(De,{style:{maxWidth:400},onSubmit:async l=>{let c="";c=await m3(a),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>n(ct(u)))},children:[s.jsxs(je,{spacing:"lg",mb:"xl",align:"center",children:[s.jsx(kn,{size:32}),s.jsx(he,{children:"Medplum Password Reset"})]}),s.jsxs(je,{spacing:"xl",children:[s.jsx(ji,{issues:Wx(r,void 0)}),!o&&s.jsxs(s.Fragment,{children:[s.jsx(le,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:lt(r,"email")}),s.jsxs(K,{position:"apart",mt:"xl",noWrap:!0,children:[s.jsx(Le,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),s.jsx(ne,{type:"submit",children:"Reset password"})]})]}),o&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function cve(){var i;const e=Ot(),t=ae(),[r,n]=f.useState();f.useEffect(()=>{t.get("auth/me").then(n).catch(a=>me({color:"red",message:Ee(a),autoClose:!1}))},[t]);function o(a){t.post("auth/revoke",{loginId:a}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(n).then(()=>me({color:"green",message:"Login revoked"})).catch(l=>me({color:"red",message:Ee(l),autoClose:!1}))}return r?s.jsxs(s.Fragment,{children:[s.jsxs(Se,{children:[s.jsx(he,{children:"Security"}),s.jsxs(Bx,{children:[s.jsx(cs,{term:"ID",children:s.jsx(Le,{href:`/${et(r.profile)}`,children:r.profile.id})}),s.jsx(cs,{term:"Resource Type",children:r.profile.resourceType}),s.jsx(cs,{term:"Name",children:Mc((i=r.profile.name)==null?void 0:i[0])})]})]}),s.jsxs(Se,{children:[s.jsx(he,{children:"Sessions"}),s.jsxs(xa,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:r.security.sessions.map(a=>s.jsxs("tr",{children:[s.jsx("td",{children:a.os}),s.jsx("td",{children:a.browser}),s.jsx("td",{children:a.remoteAddress}),s.jsx("td",{children:a.authMethod}),s.jsx("td",{children:Tr(a.lastUpdated)}),s.jsx("td",{children:s.jsx(Le,{href:"#",onClick:()=>o(a.id),children:"Revoke"})})]},a.id))})]})]}),s.jsxs(Se,{children:[s.jsx(he,{children:"Password"}),s.jsx(ne,{onClick:()=>e("/changepassword"),children:"Change password"})]}),s.jsxs(Se,{children:[s.jsx(he,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",r.security.mfaEnrolled.toString()]}),!r.security.mfaEnrolled&&s.jsx(ne,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function uve(){const{id:e,secret:t}=Qe(),r=ae(),[n,o]=f.useState(),[i,a]=f.useState(!1);return s.jsx(Se,{width:450,children:s.jsxs(De,{style:{maxWidth:400},onSubmit:l=>{if(l.password!==l.confirmPassword){o(Xi("Passwords do not match","confirmPassword"));return}o(void 0);const c={id:e,secret:t,password:l.password};r.post("auth/setpassword",c).then(()=>a(!0)).catch(u=>o(ct(u)))},children:[s.jsxs(ir,{sx:{flexDirection:"column"},children:[s.jsx(kn,{size:32}),s.jsx(he,{children:"Set password"})]}),!i&&s.jsxs(je,{children:[s.jsx(_o,{name:"password",label:"New password",required:!0,error:lt(n,"password")}),s.jsx(_o,{name:"confirmPassword",label:"Confirm new password",required:!0,error:lt(n,"confirmPassword")}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{type:"submit",children:"Set password"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(ke,{to:"/signin",children:"sign in"}),"."]})]})})}function dve(){const e=Rx(),t=Ot(),[r]=u1(),n=Qc(),o=f.useCallback(()=>{const i=r.get("next");t(i!=null&&i.startsWith("/")?i:"/")},[r,t]);return f.useEffect(()=>{e&&r.has("next")&&o()},[e,r,o]),s.jsxs(g3,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:()=>t("/register"),googleClientId:n.googleClientId,login:r.get("login")||void 0,projectId:r.get("project")||void 0,children:[s.jsx(kn,{size:32}),s.jsx(he,{children:"Sign in to Medplum"}),r.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function fve(){const e=Ot(),t=Ei(),[r,n]=f.useState(),[o,i]=f.useState(),[a,l]=f.useState();return f.useEffect(()=>{const c=Object.fromEntries(new URLSearchParams(t.search).entries());n(c.resourceType),i(c.query),l(JSON.parse(c.fields))},[t]),!r||!o||!a?null:s.jsx(vfe,{resourceType:r,checkboxesEnabled:!0,query:o,fields:a,onClick:c=>e(`/${r}/${c.resource.id}`),onAuxClick:c=>window.open(`/${r}/${c.resource.id}`,"_blank"),onBulk:c=>{e(`/bulk/${r}?ids=${c.join(",")}`)}})}function Im(e){const t=ae(),r=$i(t),n=Ot(),[o,i]=f.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:te.EQUALS,value:"Project/"+r},{code:"profile-type",operator:te.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(Wc,{search:o,onClick:a=>n(`/admin/members/${a.resource.id}`),onChange:a=>i(a.definition),hideFilters:!0,hideToolbar:!0})}function pve(){return s.jsxs(s.Fragment,{children:[s.jsx(he,{children:"Bots"}),s.jsx(Im,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(K,{position:"right",children:s.jsx(ke,{to:"/admin/bots/new",children:"Create new bot"})})]})}function hve(){return s.jsxs(s.Fragment,{children:[s.jsx(he,{children:"Clients"}),s.jsx(Im,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(K,{position:"right",children:s.jsx(ke,{to:"/admin/clients/new",children:"Create new client"})})]})}function Dm(e){return s.jsx(zs,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Fo(t)?e.onChange(dt(t)):e.onChange(void 0)}})}function mve(){const e=ae(),t=$i(e),[r,n]=f.useState(""),[o,i]=f.useState(""),[a,l]=f.useState(),[c,u]=f.useState(),[d,p]=f.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(he,{children:"Create new Bot"}),s.jsxs(De,{onSubmit:()=>{const h={name:r,description:o,accessPolicy:a};e.post("admin/projects/"+t+"/bot",h).then(m=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),p(m),me({color:"green",message:"Bot created"})}).catch(m=>{me({color:"red",message:Ee(m),autoClose:!1}),u(ct(m))})},children:[!d&&s.jsxs(je,{children:[s.jsx(tt,{title:"Name",htmlFor:"name",outcome:c,children:s.jsx(le,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>n(h.currentTarget.value),error:lt(c,"name")})}),s.jsx(tt,{title:"Description",htmlFor:"description",outcome:c,children:s.jsx(le,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:lt(c,"description")})}),s.jsx(tt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:s.jsx(Dm,{name:"accessPolicy",onChange:l})}),s.jsx(K,{position:"right",children:s.jsx(ne,{type:"submit",children:"Create Bot"})})]}),d&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(re,{children:"Bot created"}),s.jsxs(Or,{children:[s.jsx(Or.Item,{children:s.jsx(ke,{to:d,children:"Go to new bot"})}),s.jsx(Or.Item,{children:s.jsx(ke,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function gve(){const e=ae(),t=$i(e),[r,n]=f.useState(""),[o,i]=f.useState(""),[a,l]=f.useState(""),[c,u]=f.useState(),[d,p]=f.useState(),[h,m]=f.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(he,{children:"Create new Client"}),s.jsxs(De,{onSubmit:()=>{const v={name:r,description:o,redirectUri:a,accessPolicy:c};e.post("admin/projects/"+t+"/client",v).then(g=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),m(g),me({color:"green",message:"Client created"})}).catch(g=>{me({color:"red",message:Ee(g),autoClose:!1}),p(ct(g))})},children:[!h&&s.jsxs(je,{children:[s.jsx(tt,{title:"Name",htmlFor:"name",outcome:d,children:s.jsx(le,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:v=>n(v.currentTarget.value),error:lt(d,"name")})}),s.jsx(tt,{title:"Description",htmlFor:"description",outcome:d,children:s.jsx(le,{id:"description",name:"description",onChange:v=>i(v.currentTarget.value),error:lt(d,"description")})}),s.jsx(tt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:s.jsx(le,{id:"redirectUri",name:"redirectUri",onChange:v=>l(v.currentTarget.value),error:lt(d,"redirectUri")})}),s.jsx(tt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:s.jsx(Dm,{name:"accessPolicy",onChange:u})}),s.jsx(K,{position:"right",children:s.jsx(ne,{type:"submit",children:"Create Client"})})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(re,{children:"Client created"}),s.jsxs(Or,{children:[s.jsx(Or.Item,{children:s.jsx(ke,{to:h,children:"Go to new client"})}),s.jsx(Or.Item,{children:s.jsx(ke,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function vve(e){return s.jsx(zs,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Fo(t)?e.onChange(dt(t)):e.onChange(void 0)}})}function yve(){const{membershipId:e}=Qe(),t=ae(),r=$i(t),n=Ot(),o=t.get(`admin/projects/${r}/members/${e}`).read(),[i,a]=f.useState(o.accessPolicy),[l,c]=f.useState(o.userConfiguration),[u,d]=f.useState(o.admin),[p,h]=f.useState(),[m,v]=f.useState(!1);function g(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${r}/members/${e}`).then(()=>t.get(`admin/projects/${r}`,{cache:"no-cache"})).then(()=>n("/admin/project")).catch(b=>h(ct(b)))}return s.jsxs(s.Fragment,{children:[s.jsx(he,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(us,{value:o.profile,link:!0})}),s.jsxs(De,{onSubmit:()=>{const b={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${r}/members/${e}`,b).then(()=>v(!0)).catch(y=>h(ct(y)))},children:[!m&&s.jsxs(je,{children:[s.jsx(tt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:p,children:s.jsx(Dm,{name:"accessPolicy",defaultValue:i,onChange:a})}),s.jsx(tt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:p,children:s.jsx(vve,{name:"userConfiguration",defaultValue:l,onChange:c})}),s.jsx(tt,{title:"Admin",htmlFor:"admin",outcome:p,children:s.jsx(Cn,{id:"admin",name:"admin",defaultChecked:u,onChange:b=>d(b.currentTarget.checked)})}),s.jsxs(K,{position:"right",mt:"xl",children:[s.jsx(ne,{type:"submit",children:"Save"}),s.jsx(ne,{type:"button",color:"red",variant:"outline",onClick:g,children:"Remove user"})]})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(p,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(ke,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function xve(){const e=ae(),[t,r]=f.useState(e.getProject()),[n,o]=f.useState(),[i,a]=f.useState(),[l,c]=f.useState(!1),[u,d]=f.useState(void 0),p=f.useCallback(h=>{const m={resourceType:h.resourceType,firstName:h.firstName,lastName:h.lastName,email:h.email,sendEmail:h.sendEmail==="on",accessPolicy:n,admin:h.isAdmin==="on"};e.invite(t==null?void 0:t.id,m).then(v=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),mm(v)?a(v):d(v),c(m.sendEmail??!1),me({color:"green",message:"Invite success"})}).catch(v=>{me({color:"red",message:Ee(v),autoClose:!1}),a(ct(v))})},[e,t,n]);return s.jsxs(De,{onSubmit:p,children:[!u&&!i&&s.jsxs(je,{children:[s.jsx(he,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(tt,{title:"Project",htmlFor:"project",outcome:i,children:s.jsx(zs,{resourceType:"Project",name:"project",defaultValue:t,onChange:r})}),s.jsx(ft,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:lt(i,"resourceType")}),s.jsx(le,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:lt(i,"firstName")}),s.jsx(le,{name:"lastName",label:"Last Name",required:!0,error:lt(i,"lastName")}),s.jsx(le,{name:"email",type:"email",label:"Email",required:!0,error:lt(i,"email")}),s.jsx(tt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:s.jsx(Dm,{name:"accessPolicy",onChange:o})}),s.jsx(Cn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Cn,{name:"isAdmin",label:"Admin"}),s.jsx(K,{position:"right",children:s.jsx(ne,{type:"submit",children:"Invite"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx(ke,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(re,{children:"User created"}),l&&s.jsx(re,{children:"Email sent"}),s.jsxs(Or,{children:[s.jsx(Or.Item,{children:s.jsx(ke,{to:u,children:"Go to new membership"})}),s.jsx(Or.Item,{children:s.jsx(ke,{to:u.profile,children:"Go to new profile"})}),s.jsx(Or.Item,{children:s.jsx(ke,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function wve(){return s.jsxs(s.Fragment,{children:[s.jsx(he,{children:"Patients"}),s.jsx(Im,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(K,{position:"right",children:s.jsx(ke,{to:"/admin/invite",children:"Invite new patient"})})]})}function WC(){const e=ae(),t=$i(e),r=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(he,{children:"Details"}),s.jsxs(Bx,{children:[s.jsx(cs,{term:"ID",children:r.project.id}),s.jsx(cs,{term:"Name",children:r.project.name})]})]})}const HC=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function _ve(){const e=Ot(),r=Ei().pathname.replace("/admin/","")||HC[0],n=ae(),o=$i(n),i=f.useMemo(()=>n.get("admin/projects/"+o).read(),[n,o]);function a(l){e(`/admin/${l}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(sn,{children:[s.jsx(Oe,{children:s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"Project"}),s.jsx(Oe.Value,{children:i.project.name})]})}),s.jsx(ma,{children:s.jsx(He,{value:r.toLowerCase(),onTabChange:a,children:s.jsx(He.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:HC.map(l=>s.jsx(He.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),s.jsx(Se,{children:s.jsx(c1,{})})]})}function bve(){const e=ae(),t=$i(e),r=e.get(`admin/projects/${t}`).read(),[n,o]=f.useState(!1),[i,a]=f.useState();return f.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),f.useEffect(()=>{r&&a(_a(r.project.secret||[]))},[e,r]),!n||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/secrets`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>me({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(he,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(la,{property:Sa("Project","secret"),name:"secret",defaultValue:i,onChange:a}),s.jsx(ne,{type:"submit",children:"Save"})]})}function Sve(){const e=ae(),t=$i(e),r=e.get(`admin/projects/${t}`).read(),[n,o]=f.useState(!1),[i,a]=f.useState();return f.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),f.useEffect(()=>{r&&a(_a(r.project.site||[]))},[e,r]),!n||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/sites`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>me({color:"green",message:"Saved"})).catch(c=>{var d,p,h,m;const u=ct(c);me({color:"red",message:`Error ${(p=(d=u.issue)==null?void 0:d[0].details)==null?void 0:p.text} ${(m=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:m[0]}`,autoClose:!1})})},children:[s.jsx(he,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(la,{property:Sa("Project","site"),name:"site",defaultValue:i,onChange:a}),s.jsx(ne,{type:"submit",children:"Save"})]})}function Pve(){const e=ae();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(ji,{outcome:Lae});function t(){vl(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function r(){vl(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function n(){vl(e,"Rebuilding Value Sets","admin/super/valuesets")}function o(u){vl(e,"Reindexing Resources","admin/super/reindex",u)}function i(u){vl(e,"Rebuilding Compartments","admin/super/compartments",u)}function a(u){e.post("admin/super/removebotidjobsfromqueue",u).then(()=>me({color:"green",message:"Done"})).catch(d=>me({color:"red",message:Ee(d),autoClose:!1}))}function l(u){e.post("admin/super/purge",{...u,before:y4(u.before)}).then(()=>me({color:"green",message:"Done"})).catch(d=>me({color:"red",message:Ee(d),autoClose:!1}))}function c(u){e.post("admin/super/setpassword",u).then(()=>me({color:"green",message:"Done"})).catch(d=>me({color:"red",message:Ee(d),autoClose:!1}))}return s.jsxs(Se,{width:600,children:[s.jsx(he,{order:1,children:"Super Admin"}),s.jsx(br,{my:"lg"}),s.jsx(he,{order:2,children:"Structure Definitions"}),s.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),s.jsx(De,{children:s.jsx(ne,{onClick:t,children:"Rebuild StructureDefinitions"})}),s.jsx(br,{my:"lg"}),s.jsx(he,{order:2,children:"Search Parameters"}),s.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),s.jsx(De,{children:s.jsx(ne,{onClick:r,children:"Rebuild SearchParameters"})}),s.jsx(br,{my:"lg"}),s.jsx(he,{order:2,children:"Value Sets"}),s.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),s.jsx(De,{children:s.jsx(ne,{onClick:n,children:"Rebuild ValueSets"})}),s.jsx(br,{my:"lg"}),s.jsx(he,{order:2,children:"Reindex Resources"}),s.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),s.jsx(De,{onSubmit:o,children:s.jsxs(je,{children:[s.jsx(tt,{title:"Resource Type",children:s.jsx(le,{name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(ne,{type:"submit",children:"Reindex"})]})}),s.jsx(br,{my:"lg"}),s.jsx(he,{order:2,children:"Rebuild Compartments"}),s.jsx("p",{children:"When Medplum changes how resource compartments are derived, the system may require a rebuild for old resources to take effect."}),s.jsx(De,{onSubmit:i,children:s.jsxs(je,{children:[s.jsx(tt,{title:"Resource Type",children:s.jsx(le,{name:"resourceType",placeholder:"Compartments Resource Type"})}),s.jsx(ne,{type:"submit",children:"Rebuild Compartments"})]})}),s.jsx(br,{my:"lg"}),s.jsx(he,{order:2,children:"Purge Resources"}),s.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),s.jsx(De,{onSubmit:l,children:s.jsxs(je,{children:[s.jsx(tt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(ft,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(tt,{title:"Purge Before",htmlFor:"before",children:s.jsx(aa,{name:"before",placeholder:"Before Date"})}),s.jsx(ne,{type:"submit",children:"Purge"})]})}),s.jsx(br,{my:"lg"}),s.jsx(he,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(De,{onSubmit:a,children:s.jsxs(je,{children:[s.jsx(tt,{title:"Bot ID",children:s.jsx(le,{name:"botId",placeholder:"Bot Id"})}),s.jsx(ne,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(br,{my:"lg"}),s.jsx(he,{order:2,children:"Force Set Password"}),s.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),s.jsx(De,{onSubmit:c,children:s.jsxs(je,{children:[s.jsx(le,{name:"email",label:"Email",required:!0}),s.jsx(_o,{name:"password",label:"Password",required:!0}),s.jsx(le,{name:"projectId",label:"Project ID"}),s.jsx(ne,{type:"submit",children:"Force Set Password"})]})})]})}function vl(e,t,r,n){bo.show({id:r,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST"};n&&(o.body=JSON.stringify(n)),e.startAsyncRequest(r,o).then(()=>{bo.update({id:r,color:"green",title:t,message:"Done",icon:s.jsx(wm,{size:"1rem"}),autoClose:!1,withCloseButton:!0})}).catch(i=>{bo.update({id:r,color:"red",title:t,message:Ee(i),icon:s.jsx(dh,{size:"1rem"}),autoClose:!1,withCloseButton:!0})})}function Ove(){return s.jsxs(s.Fragment,{children:[s.jsx(he,{children:"Users"}),s.jsx(Im,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(K,{position:"right",children:s.jsx(ke,{to:"/admin/invite",children:"Invite new user"})})]})}function jve(){const[e]=Os("ObservationDefinition","_count=100");return e?s.jsxs(xa,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var r,n,o,i;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Zn,{value:(r=t.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(Zn,{value:t.code})}),s.jsx("td",{children:s.jsx(Zn,{value:t.method})}),s.jsx("td",{children:(o=(n=t.quantitativeDetails)==null?void 0:n.unit)==null?void 0:o.text}),s.jsx("td",{children:(i=t.quantitativeDetails)==null?void 0:i.decimalPrecision}),s.jsx("td",{children:s.jsx(Iy,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(En,{})}function Iy(e){const{ranges:t}=e;if(!t)return null;const r=GC(t.map(o=>o.gender));if(r.length>1)return r.sort((o,i)=>o.localeCompare(i)),s.jsx(s.Fragment,{children:r.map(o=>{var i;return s.jsxs(f.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:lr(o)})}),s.jsx(Iy,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>a.gender===o)})]},o)})});const n=GC(t.map(o=>o.age&&cc(o.age)));return n.length>1?(n.sort((o,i)=>o.localeCompare(i)),s.jsx(s.Fragment,{children:n.map(o=>{var i;return s.jsxs(f.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:lr(o)})}),s.jsx(Iy,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>cc(a.age)===o)})]},o)})})):s.jsx(s.Fragment,{children:t.map(o=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:o.condition}),s.jsx("td",{children:s.jsx(Ux,{value:o.range})})]})})},`range-${o.condition}`))})}function GC(e){return[...new Set(e.filter(t=>!!t))]}function Cve(){const[e]=Os("ActivityDefinition","_count=100"),[t]=Os("ObservationDefinition","_count=100");return!e||!t?s.jsx(En,{}):s.jsxs(xa,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(r=>s.jsx("th",{children:r.name},r.id))]})}),s.jsx("tbody",{children:t.map(r=>{var n;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Zn,{value:(n=r.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(Zn,{value:r.code})}),e.map(o=>{var i;return s.jsx("td",{children:(i=o.observationResultRequirement)!=null&&i.find(a=>{var l;return(l=a.reference)==null?void 0:l.includes(r.id)})?"✅":""},o.id)})]},r.id)})})]})}function Eve(e){var a;const t=ae(),[r,n]=f.useState(),[o,i]=f.useState();return o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx(ke,{to:o,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(ke,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(De,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueReference:r}]}).then(i).catch(console.log)},children:s.jsxs(je,{children:[s.jsxs(he,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(re,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(re,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(a=e.planDefinition.action)==null?void 0:a.map((l,c)=>{var u;return s.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&s.jsx(s.Fragment,{children:l.title}),l.code&&s.jsx(Zn,{value:l.code[0]})]},`action-${c}`)})}),s.jsx(tt,{title:"Subject",children:s.jsx(Sm,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:r,onChange:n})}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{type:"submit",children:"Go"})})]})})}function $ve(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t});return r?s.jsx(Se,{children:s.jsx(Eve,{planDefinition:r})}):null}function kve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Ke({reference:t+"/"+r}),[o,i]=Os("Questionnaire","subject-type="+t),[a,l]=Os("ClientApplication",{_count:1e3});if(!n||i||l)return s.jsx(En,{});const c=a==null?void 0:a.filter(d=>Rve(t)&&!!d.launchUri);if((!o||o.length===0)&&(!c||c.length===0))return s.jsxs(Se,{children:[s.jsx(he,{children:"Apps"}),s.jsxs("p",{children:["No apps found. Contact your administrator or ",s.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});function u(d){if(!n)return;const p={resourceType:"SmartAppLaunch"};switch(n.resourceType){case"Patient":p.patient=dt(n);break;case"Encounter":p.patient=n.subject,p.encounter=dt(n);break}e.createResource(p).then(h=>{const m=new URL(d.launchUri);m.searchParams.set("iss",e.getBaseUrl()+"fhir/R4"),m.searchParams.set("launch",h.id),window.location.assign(m.toString())}).catch(h=>me({color:"red",message:Ee(h),autoClose:!1}))}return s.jsxs(Se,{children:[o==null?void 0:o.map(d=>s.jsxs("div",{children:[s.jsx(he,{order:3,children:s.jsx(ke,{to:`/forms/${d.id}?subject=${et(n)}`,children:d.title||d.name})}),s.jsx(re,{children:d.description})]},d.id)),c==null?void 0:c.map(d=>s.jsxs("div",{children:[s.jsx(he,{order:3,children:s.jsx(Le,{onClick:()=>u(d),children:d.name})}),s.jsx(re,{children:d.description})]},d.id))]})}function Rve(e){return e==="Patient"||e==="Encounter"}function Tve(){const{resourceType:e,id:t}=Qe(),r=Ot(),[n,o]=f.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:te.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(Se,{children:s.jsx(Wc,{search:n,onClick:i=>r(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function Ive(){const e=ae(),{resourceType:t,id:r}=Qe(),n=e.readHistory(t,r).read();return s.jsx(Se,{children:s.jsx(kpe,{history:n})})}function Dve(e){const t="https://codeeditor.medplum.com/bot-runner.html";return s.jsx("iframe",{frameBorder:"0",src:t,className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function Nve(e){const t=e.defaultValue,r=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&r.searchParams.set("module",e.module),s.jsx("iframe",{frameBorder:"0",src:r.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:n=>{wd(n.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Ave=`{
|
|
225
|
-
"resourceType": "Patient",
|
|
226
|
-
"name": [
|
|
227
|
-
{
|
|
228
|
-
"given": [
|
|
229
|
-
"Alice"
|
|
230
|
-
],
|
|
231
|
-
"family": "Smith"
|
|
232
|
-
}
|
|
233
|
-
]
|
|
234
|
-
}`,Mve="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-",Lve=W(()=>({hl7Input:{fontFamily:"monospace",fontSize:"12px",lineHeight:1.55,padding:"10px 12px",whiteSpace:"nowrap",width:"100%"}}));function zve(){const e=ae(),{id:t}=Qe(),[r,n]=f.useState(),[o,i]=f.useState(),[a,l]=f.useState(Ave),[c,u]=f.useState(Mve),[d,p]=f.useState(Kt.FHIR_JSON),{classes:h}=Lve(),m=f.useRef(null),v=f.useRef(null),[g,b]=f.useState(!1);f.useEffect(()=>{e.readResource("Bot",t).then(async P=>{n(P),i(await Fve(e,P))}).catch(P=>me({color:"red",message:Ee(P),autoClose:!1}))},[e,t]);const y=f.useCallback(()=>wd(m.current,{command:"getValue"}),[]),x=f.useCallback(()=>wd(m.current,{command:"getOutput"}),[]),_=f.useCallback(async()=>d===Kt.FHIR_JSON?JSON.parse(a):c,[d,a,c]),w=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),b(!0);try{const E=await y(),k=await e.createAttachment(E,"index.ts","text/typescript"),$=[];r!=null&&r.sourceCode?$.push({op:"replace",path:"/sourceCode",value:k}):$.push({op:"add",path:"/sourceCode",value:k}),await e.patchResource("Bot",t,$),me({color:"green",message:"Saved"})}catch(E){me({color:"red",message:Ee(E),autoClose:!1})}finally{b(!1)}},[e,t,r,y]),j=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),b(!0);try{const E=await x();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:E}),me({color:"green",message:"Deployed"})}catch(E){me({color:"red",message:Ee(E),autoClose:!1})}finally{b(!1)}},[e,t,x]),C=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),b(!0);try{const E=await _(),k=await e.post(e.fhirUrl("Bot",t,"$execute"),E,d);await wd(v.current,{command:"setValue",value:k}),me({color:"green",message:"Success"})}catch(E){me({color:"red",message:Ee(E),autoClose:!1})}finally{b(!1)}},[e,t,_,d]);return!r||o===void 0?null:s.jsxs(nn,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(nn.Col,{span:8,children:s.jsxs(sn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(Nve,{iframeRef:m,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(K,{position:"right",spacing:"xs",children:[s.jsx(ne,{type:"button",onClick:w,loading:g,leftIcon:s.jsx(Xle,{size:"1rem"}),children:"Save"}),s.jsx(ne,{type:"button",onClick:j,loading:g,leftIcon:s.jsx(Ix,{size:"1rem"}),children:"Deploy"}),s.jsx(ne,{type:"button",onClick:C,loading:g,leftIcon:s.jsx(pce,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(nn.Col,{span:4,children:[s.jsxs(sn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(ft,{data:[{label:"FHIR",value:Kt.FHIR_JSON},{label:"HL7",value:Kt.HL7_V2}],onChange:P=>p(P.currentTarget.value)}),d===Kt.FHIR_JSON?s.jsx(Ls,{value:a,onChange:P=>l(P),minRows:15}):s.jsx("textarea",{className:h.hl7Input,value:c,onChange:P=>u(P.currentTarget.value),rows:15})]}),s.jsx(sn,{m:2,p:"xs",shadow:"md",children:s.jsx(Dve,{iframeRef:v,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Fve(e,t){var r,n,o;if((r=t.sourceCode)!=null&&r.url){const i=(o=(n=t.sourceCode.url)==null?void 0:n.split("/"))==null?void 0:o.find(j5);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Kc(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Vve(){const e=ae(),{resourceType:t,id:r}=Qe(),n={reference:t+"/"+r},o=f.useCallback(i=>{e.updateResource(Kc(i)).then(()=>{me({color:"green",message:"Success"})}).catch(a=>{me({color:"red",message:Ee(a),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(Se,{children:s.jsx(Ofe,{value:n,onSubmit:o})});case"Questionnaire":return s.jsx(Se,{children:s.jsx(Xfe,{questionnaire:n,onSubmit:o})});default:return null}}function Bve(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t}),n=Ot();return r?s.jsx(Se,{children:s.jsx(wpe,{value:r,onStart:(o,i)=>n(`/forms/${vx(i)}`),onEdit:(o,i,a)=>n(`/${a.reference}}`)})}):null}function Uve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Ot();return s.jsxs(Se,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(ne,{color:"red",onClick:()=>{e.deleteResource(t,r).then(()=>n(`/${t}`)).catch(o=>me({color:"red",message:Ee(o),autoClose:!1}))},children:"Delete"})]})}function Wve(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t});return r?s.jsx(Se,{children:s.jsx(Jx,{value:r})}):null}function Hve(){const e=ae(),{resourceType:t,id:r}=Qe(),[n,o]=f.useState(),i=Ot(),[a,l]=f.useState();f.useEffect(()=>{e.readResource(t,r).then(d=>o(_a(d))).catch(d=>{l(ct(d)),me({color:"red",message:Ee(d),autoClose:!1})})},[e,t,r]);const c=f.useCallback(d=>{l(void 0),e.updateResource(Kc(d)).then(()=>{i(`/${t}/${r}/details`),me({color:"green",message:"Success"})}).catch(p=>{l(ct(p)),me({color:"red",message:Ee(p),autoClose:!1})})},[e,t,r,i]),u=f.useCallback(()=>i(`/${t}/${r}/delete`),[i,t,r]);return n?s.jsx(Se,{children:s.jsx(c3,{defaultValue:n,onSubmit:c,onDelete:u,outcome:a})}):null}function Gve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=e.readHistory(t,r).read();return s.jsx(Se,{children:s.jsx(Dpe,{history:n})})}function qve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Ke({reference:t+"/"+r}),o=Ot(),[i,a]=f.useState(),l=f.useCallback(c=>{e.updateResource(Kc(JSON.parse(c.resource))).then(()=>{a(void 0),o(`/${t}/${r}/details`),me({color:"green",message:"Success"})}).catch(u=>{me({color:"red",message:Ee(u),autoClose:!1})})},[e,t,r,o]);return n?s.jsxs(Se,{children:[i&&s.jsx(ji,{outcome:i}),s.jsxs(De,{onSubmit:l,children:[s.jsx(Ls,{name:"resource","data-testid":"resource-json",minRows:24,defaultValue:Rr(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"OK"})})]})]}):null}function Qve(){const{resourceType:e,id:t}=Qe();return Ke({reference:e+"/"+t})?s.jsxs(Se,{children:[s.jsxs(Cc,{icon:s.jsx(xm,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Le,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(a3,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function Kve(){const e=ae(),{id:t}=Qe(),[r,n]=f.useState(),[o,i]=f.useState(0),a=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>Yve(c,t));function l(){r&&e.createResource({resourceType:"Subscription",status:"active",reason:r.name,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:et(r)}}).then(()=>{n(void 0),i(Date.now()),e.invalidateSearches("Subscription"),me({color:"green",message:"Success"})}).catch(c=>me({color:"red",message:Ee(c),autoClose:!1}))}return s.jsxs(Se,{children:[s.jsx(he,{children:"Bots"}),a.length===0&&s.jsx("p",{children:"No bots found."}),a.map(c=>{var u;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Bc,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),s.jsx("hr",{}),s.jsx(he,{children:"Connect to bot"}),s.jsxs(K,{children:[s.jsx(zs,{name:"bot",resourceType:"Bot",onChange:n}),s.jsx(ne,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function Yve(e,t){var o;const r=e.criteria||"",n=((o=e.channel)==null?void 0:o.endpoint)||"";return r.startsWith("QuestionnaireResponse?")&&r.includes(t)&&n.startsWith("Bot/")}function Xve(){const{id:e}=Qe(),t=Ot(),[r,n]=f.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:te.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(Se,{children:s.jsx(Wc,{search:r,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>n(o.definition),hideFilters:!0,hideToolbar:!0})})}function Jve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Ke({reference:t+"/"+r}),o=f.useCallback(i=>{e.updateResource(Kc(i)).then(()=>{me({color:"green",message:"Success"})}).catch(a=>{me({color:"red",message:Ee(a),autoClose:!1})})},[e]);return n?s.jsx(Se,{children:s.jsx(fpe,{onSubmit:o,definition:n})}):null}function Zve(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t});return r?s.jsx(Se,{children:e==="MeasureReport"?s.jsx(Sfe,{measureReport:r}):s.jsx(Gx,{value:r})}):null}const eye=W(e=>({container:{position:"fixed",top:300,left:0,width:160,zIndex:5,fontSize:e.fontSizes.xs,"@media (max-width: 700px)":{display:"none"}},entry:{textAlign:"center",width:150,backgroundColor:e.colors.gray[0],border:`1px solid ${e.colors.gray[3]}`},active:{width:160,backgroundColor:e.colors.yellow[0],border:`1px solid ${e.colors.yellow[5]}`}}));function tye(e){const{classes:t,cx:r}=eye(),n=ae(),o=Ke(e.value),[i,a]=f.useState();return f.useEffect(()=>{if(!o)return;const l=p1(o);if(!l)return;const c="reference"in l?l.reference:et(l);n.search("ServiceRequest","subject="+c).then(u=>{const p=u.entry.map(h=>h.resource);z4(p),p.reverse(),a(p)}).catch(u=>me({color:"red",message:Ee(u),autoClose:!1}))},[n,o]),i?s.jsx("div",{"data-testid":"quick-service-requests",className:t.container,children:i.map(l=>{var c,u,d,p,h,m,v;return s.jsxs("div",{className:r(t.entry,{[t.active]:l.id===(o==null?void 0:o.id)}),children:[s.jsx("p",{children:s.jsx(ke,{to:l,children:rye(l)})}),((u=(c=l.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(d=l.category[0])==null?void 0:d.text}),((m=(h=(p=l.code)==null?void 0:p.coding)==null?void 0:h[0])==null?void 0:m.code)&&s.jsx("p",{children:(v=l.code.coding[0])==null?void 0:v.code}),s.jsx("p",{children:nye(l)})]},l.id)})}):null}function rye(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function nye(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const oye=W(()=>({container:{position:"absolute",top:65,right:5,width:200,height:50,zIndex:15}}));function iye(e){var i,a,l,c;const{classes:t}=oye(),r=Ke(e.valueSet);if(!r)return null;const n=[""],o=(c=(l=(a=(i=r.compose)==null?void 0:i.include)==null?void 0:a[0])==null?void 0:l.concept)==null?void 0:c.map(u=>u.code);return o&&n.push(...o),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:t.container,children:s.jsx(ft,{defaultValue:e.defaultValue,onChange:u=>e.onChange(u.currentTarget.value),data:n})})}function aye(e){var r,n;const t=Ke(e.specimen);return t?s.jsxs(Oe,{children:[s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"Type"}),s.jsx(Oe.Value,{children:"Specimen"})]}),s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"Collected"}),s.jsx(Oe.Value,{children:Tr((r=t.collection)==null?void 0:r.collectedDateTime)})]}),s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"Specimen Age"}),s.jsx(Oe.Value,{children:sye(t)})]}),(n=t.collection)!=null&&n.collectedDateTime&&t.receivedTime?s.jsxs(Oe.Entry,{children:[s.jsx(Oe.Key,{children:"Specimen Stability"}),s.jsx(Oe.Value,{children:lye(t)})]}):s.jsx(s.Fragment,{})]}):null}function sye(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const r=new Date(t);return tA(rA(r,new Date))}function lye(e){var n;if(!((n=e.collection)!=null&&n.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),r=new Date(e.receivedTime);return tA(rA(t,r))}function tA(e){return e.toString().padStart(3,"0")+"D"}function rA(e,t){const r=t.getTime()-e.getTime();return Math.floor(r/(1e3*3600*24))}function cye(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"),t.push("Details","Edit","Event","History","Blame","JSON","Apps"),t}function uye(){var x,_,w,j,C,P,E;const e=ae(),{resourceType:t,id:r}=Qe(),n={reference:t+"/"+r},o=Ot(),[i,a]=f.useState(),l=Ke(n,a),c=cye(t),[u,d]=f.useState(()=>{const k=window.location.pathname.split("/").pop();return k&&c.map($=>$.toLowerCase()).includes(k)?k:c[0].toLowerCase()});async function p(){var I,T;const $=(T=(I=(await e.readHistory(t,r)).entry)==null?void 0:I.find(z=>!!z.resource))==null?void 0:T.resource;$?h($):me({color:"red",message:"No history to restore",autoClose:!1})}function h(k){e.updateResource(Kc(k)).then(()=>{a(void 0),me({color:"green",message:"Success"})}).catch($=>{me({color:"red",message:Ee($),autoClose:!1})})}if(i)return Fae(i)?s.jsxs(Se,{children:[s.jsx(he,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(ne,{color:"red",onClick:p,children:"Restore"})]}):s.jsx(ji,{outcome:i});function m(k){d(k),o(`/${t}/${r}/${k}`)}function v(k){const $=l,I=$.orderDetail||[];I.length===0&&I.push({}),I[0].text!==k&&(I[0].text=k,h({...$,orderDetail:I}))}const g=l&&p1(l),b=l&&qge(l),y=(w=(_=(x=e.getUserConfiguration())==null?void 0:x.option)==null?void 0:_.find(k=>k.id==="statusValueSet"))==null?void 0:w.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&y&&s.jsx(iye,{valueSet:{reference:y},defaultValue:(C=(j=l.orderDetail)==null?void 0:j[0])==null?void 0:C.text,onChange:v},et(l)+"-"+((E=(P=l.orderDetail)==null?void 0:P[0])==null?void 0:E.text)),l&&s.jsx(tye,{value:l}),l&&s.jsxs(sn,{children:[g&&s.jsx(J3,{patient:g}),b&&s.jsx(aye,{specimen:b}),t!=="Patient"&&s.jsx(Z3,{resource:n}),s.jsx(ma,{children:s.jsx(He,{value:u.toLowerCase(),onTabChange:m,children:s.jsx(He.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(k=>s.jsx(He.Tab,{value:k.toLowerCase(),children:k},k))})})})]}),s.jsx(c1,{})]})}function qC(){var y,x,_,w;const e=Ot(),{resourceType:t,id:r,versionId:n,tab:o}=Qe(),i=ae(),[a,l]=f.useState(!0),[c,u]=f.useState(),[d,p]=f.useState();if(f.useEffect(()=>{p(void 0),l(!0),i.readHistory(t,r).then(j=>u(j)).then(()=>l(!1)).catch(j=>{p(j),l(!1)})},[i,t,r]),a)return s.jsx(En,{});if(!c)return s.jsxs(Se,{children:[s.jsx(he,{children:"Resource not found"}),s.jsx(ke,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(j=>{var C,P;return((P=(C=j.resource)==null?void 0:C.meta)==null?void 0:P.versionId)===n});if(m===-1)return s.jsxs(Se,{children:[s.jsx(he,{children:"Version not found"}),s.jsx(ke,{to:`/${t}/${r}`,children:"Return to resource"})]});const v=h[m].resource,g=m<h.length-1?h[m+1].resource:void 0,b="diff";return s.jsx(s.Fragment,{children:s.jsxs(He,{value:o||b,onTabChange:j=>e(`/${t}/${r}/_history/${n}/${j}`),children:[s.jsxs(sn,{children:[s.jsx(Vc,{fluid:!0,p:"md",children:s.jsx(re,{children:`${t} ${r}`})}),s.jsxs(He.List,{children:[s.jsx(He.Tab,{value:"diff",children:"Diff"}),s.jsx(He.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(Se,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(He.Panel,{value:"diff",children:g?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(y=v.meta)==null?void 0:y.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(ke,{to:`/${t}/${r}/_history/${(x=g.meta)==null?void 0:x.versionId}`,children:(_=g.meta)==null?void 0:_.versionId})]})]}),s.jsx(Tpe,{original:g,revised:v})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(w=v.meta)==null?void 0:w.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(v,void 0,2)})]})}),s.jsx(He.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(v,void 0,2)})})]})]})})}function dye(){const{resourceType:e,id:t}=Qe(),r=Ot(),[n,o]=f.useState({resourceType:"Subscription",filters:[{code:"url",operator:te.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(Se,{children:s.jsx(Wc,{search:n,onClick:i=>r(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function QC(){const{resourceType:e,id:t}=Qe(),r={reference:e+"/"+t};switch(e){case"Encounter":return s.jsx(Ode,{encounter:r});case"Patient":return s.jsx(Pfe,{patient:r});case"ServiceRequest":return s.jsx(Mpe,{serviceRequest:r});default:return s.jsx(Pde,{resource:r})}}function nA(e,t){const r=ae(),n=Ot();return{defaultValue:{resourceType:e},handleSubmit:a=>{t&&t(void 0),r.createResource(a).then(l=>n("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(ct(l))})}}}function KC(){const{resourceType:e}=Qe(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=nA(e,r);return s.jsx(Se,{children:s.jsx(c3,{defaultValue:n,onSubmit:o,outcome:t})})}function fye(){const{resourceType:e}=Qe(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=nA(e,r),i=f.useCallback(a=>{o(JSON.parse(a["new-resource"]))},[o]);return s.jsxs(Se,{children:[t&&s.jsx(ji,{outcome:t}),s.jsxs(De,{onSubmit:i,children:[s.jsx(Ls,{name:"new-resource","data-testid":"create-resource-json",minRows:24,defaultValue:Rr(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"OK"})})]})]})}function pye(){return s.jsx(Jhe,{children:s.jsxs(pe,{errorElement:s.jsx(Hge,{}),children:[s.jsx(pe,{path:"/signin",element:s.jsx(dve,{})}),s.jsx(pe,{path:"/oauth",element:s.jsx(ave,{})}),s.jsx(pe,{path:"/resetpassword",element:s.jsx(lve,{})}),s.jsx(pe,{path:"/setpassword/:id/:secret",element:s.jsx(uve,{})}),s.jsx(pe,{path:"/register",element:s.jsx(sve,{})}),s.jsx(pe,{path:"/changepassword",element:s.jsx(Bge,{})}),s.jsx(pe,{path:"/security",element:s.jsx(cve,{})}),s.jsx(pe,{path:"/mfa",element:s.jsx(ove,{})}),s.jsx(pe,{path:"/batch",element:s.jsx(Fge,{})}),s.jsx(pe,{path:"/bulk/:resourceType",element:s.jsx(Vge,{})}),s.jsx(pe,{path:"/smart",element:s.jsx(fve,{})}),s.jsx(pe,{path:"/forms/:id",element:s.jsx(Kge,{})}),s.jsx(pe,{path:"/admin/super",element:s.jsx(Pve,{})}),s.jsxs(pe,{path:"/admin",element:s.jsx(_ve,{}),children:[s.jsx(pe,{path:"patients",element:s.jsx(wve,{})}),s.jsx(pe,{path:"bots/new",element:s.jsx(mve,{})}),s.jsx(pe,{path:"bots",element:s.jsx(pve,{})}),s.jsx(pe,{path:"clients/new",element:s.jsx(gve,{})}),s.jsx(pe,{path:"clients",element:s.jsx(hve,{})}),s.jsx(pe,{path:"details",element:s.jsx(WC,{})}),s.jsx(pe,{path:"invite",element:s.jsx(xve,{})}),s.jsx(pe,{path:"users",element:s.jsx(Ove,{})}),s.jsx(pe,{path:"project",element:s.jsx(WC,{})}),s.jsx(pe,{path:"secrets",element:s.jsx(bve,{})}),s.jsx(pe,{path:"sites",element:s.jsx(Sve,{})}),s.jsx(pe,{path:"members/:membershipId",element:s.jsx(yve,{})})]}),s.jsx(pe,{path:"/lab/assays",element:s.jsx(jve,{})}),s.jsx(pe,{path:"/lab/panels",element:s.jsx(Cve,{})}),s.jsx(pe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(qC,{})}),s.jsx(pe,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(qC,{})}),s.jsxs(pe,{path:"/:resourceType/new",element:s.jsx(Wge,{}),children:[s.jsx(pe,{index:!0,element:s.jsx(KC,{})}),s.jsx(pe,{path:"form",element:s.jsx(KC,{})}),s.jsx(pe,{path:"json",element:s.jsx(fye,{})})]}),s.jsxs(pe,{path:"/:resourceType/:id",element:s.jsx(uye,{}),children:[s.jsx(pe,{index:!0,element:s.jsx(QC,{})}),s.jsx(pe,{path:"apply",element:s.jsx($ve,{})}),s.jsx(pe,{path:"apps",element:s.jsx(kve,{})}),s.jsx(pe,{path:"event",element:s.jsx(Tve,{})}),s.jsx(pe,{path:"blame",element:s.jsx(Ive,{})}),s.jsx(pe,{path:"bots",element:s.jsx(Kve,{})}),s.jsx(pe,{path:"builder",element:s.jsx(Vve,{})}),s.jsx(pe,{path:"checklist",element:s.jsx(Bve,{})}),s.jsx(pe,{path:"delete",element:s.jsx(Uve,{})}),s.jsx(pe,{path:"details",element:s.jsx(Wve,{})}),s.jsx(pe,{path:"edit",element:s.jsx(Hve,{})}),s.jsx(pe,{path:"editor",element:s.jsx(zve,{})}),s.jsx(pe,{path:"history",element:s.jsx(Gve,{})}),s.jsx(pe,{path:"json",element:s.jsx(qve,{})}),s.jsx(pe,{path:"preview",element:s.jsx(Qve,{})}),s.jsx(pe,{path:"responses",element:s.jsx(Xve,{})}),s.jsx(pe,{path:"report",element:s.jsx(Zve,{})}),s.jsx(pe,{path:"ranges",element:s.jsx(Jve,{})}),s.jsx(pe,{path:"subscriptions",element:s.jsx(dye,{})}),s.jsx(pe,{path:"timeline",element:s.jsx(QC,{})})]}),s.jsx(pe,{path:"/:resourceType",element:s.jsx(UC,{})}),s.jsx(pe,{path:"/",element:s.jsx(UC,{})})]})})}function hye(){const e=ae(),t=e.getUserConfiguration(),r=Ei(),[n]=u1();return e.isLoading()?s.jsx(En,{}):s.jsx(tue,{logo:s.jsx(kn,{size:24}),pathname:r.pathname,searchParams:n,version:gle,menus:mye(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(f.Suspense,{fallback:s.jsx(En,{}),children:s.jsx(pye,{})})})}function mye(e){var r;const t=((r=e==null?void 0:e.menu)==null?void 0:r.map(n=>{var o;return{title:n.title,links:((o=n.link)==null?void 0:o.map(i=>({label:i.name,href:i.target,icon:gye(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(ace,{})}]}),t}const YC={Patient:wce,Practitioner:nce,Organization:Hle,ServiceRequest:mce,DiagnosticReport:vce,Questionnaire:rce,admin:Ble,AccessPolicy:ice,Subscription:Sce,batch:uce,Observation:cce};function gye(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in YC){const r=YC[t];return s.jsx(r,{})}}catch{}return s.jsx(fm,{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 vye(){const e=Qc(),t=new _le({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))}}),r={headings:{sizes:{h1:{fontSize:"1.125rem",fontWeight:500,lineHeight:2}}},fontSizes:{xs:"0.6875rem",sm:"0.875rem",md:"0.875rem",lg:"1.0rem",xl:"1.125rem"}},n=tme([{path:"*",element:s.jsx(hye,{})}]),o=a=>n.navigate(a);v3(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(Sle,{medplum:t,navigate:o,children:s.jsxs(FE,{theme:r,withGlobalStyles:!0,withNormalizeCSS:!0,children:[s.jsx(wa,{position:"bottom-right"}),s.jsx(cme,{router:n})]})})}))}vye().catch(console.error);
|
|
235
|
-
//# sourceMappingURL=index-c8a43a1c.js.map
|