@medplum/app 4.1.5 → 4.1.7

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.
@@ -1,581 +0,0 @@
1
- function XP(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function Jy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cv={exports:{}},_u={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Aj;function ZP(){if(Aj)return _u;Aj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var c=null;if(o!==void 0&&(c=""+o),a.key!==void 0&&(c=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:c,ref:a!==void 0?a:null,props:o}}return _u.Fragment=t,_u.jsx=n,_u.jsxs=n,_u}var _j;function JP(){return _j||(_j=1,cv.exports=ZP()),cv.exports}var s=JP(),Ja=function(){return Ja=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ja.apply(this,arguments)};function GT(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function e3(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var uv={exports:{}},vt={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var kj;function t3(){if(kj)return vt;kj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=g&&O[g]||O["@@iterator"],typeof O=="function"?O:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function C(O,U,J){this.props=O,this.context=U,this.refs=j,this.updater=J||b}C.prototype.isReactComponent={},C.prototype.setState=function(O,U){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,U,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=C.prototype;function D(O,U,J){this.props=O,this.context=U,this.refs=j,this.updater=J||b}var E=D.prototype=new R;E.constructor=D,S(E,C.prototype),E.isPureReactComponent=!0;var T=Array.isArray,A={H:null,A:null,T:null,S:null,V:null},_=Object.prototype.hasOwnProperty;function M(O,U,J,te,ye,be){return J=be.ref,{$$typeof:e,type:O,key:U,ref:J!==void 0?J:null,props:be}}function L(O,U){return M(O.type,U,void 0,void 0,void 0,O.props)}function $(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function V(O){var U={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(J){return U[J]})}var Y=/\/+/g;function W(O,U){return typeof O=="object"&&O!==null&&O.key!=null?V(""+O.key):U.toString(36)}function G(){}function X(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(G,G):(O.status="pending",O.then(function(U){O.status==="pending"&&(O.status="fulfilled",O.value=U)},function(U){O.status==="pending"&&(O.status="rejected",O.reason=U)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function Z(O,U,J,te,ye){var be=typeof O;(be==="undefined"||be==="boolean")&&(O=null);var ve=!1;if(O===null)ve=!0;else switch(be){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(O.$$typeof){case e:case t:ve=!0;break;case m:return ve=O._init,Z(ve(O._payload),U,J,te,ye)}}if(ve)return ye=ye(O),ve=te===""?"."+W(O,0):te,T(ye)?(J="",ve!=null&&(J=ve.replace(Y,"$&/")+"/"),Z(ye,U,J,"",function(et){return et})):ye!=null&&($(ye)&&(ye=L(ye,J+(ye.key==null||O&&O.key===ye.key?"":(""+ye.key).replace(Y,"$&/")+"/")+ve)),U.push(ye)),1;ve=0;var Ge=te===""?".":te+":";if(T(O))for(var ke=0;ke<O.length;ke++)te=O[ke],be=Ge+W(te,ke),ve+=Z(te,U,J,be,ye);else if(ke=v(O),typeof ke=="function")for(O=ke.call(O),ke=0;!(te=O.next()).done;)te=te.value,be=Ge+W(te,ke++),ve+=Z(te,U,J,be,ye);else if(be==="object"){if(typeof O.then=="function")return Z(X(O),U,J,te,ye);throw U=String(O),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ve}function P(O,U,J){if(O==null)return O;var te=[],ye=0;return Z(O,te,"","",function(be){return U.call(J,be,ye++)}),te}function I(O){if(O._status===-1){var U=O._result;U=U(),U.then(function(J){(O._status===0||O._status===-1)&&(O._status=1,O._result=J)},function(J){(O._status===0||O._status===-1)&&(O._status=2,O._result=J)}),O._status===-1&&(O._status=0,O._result=U)}if(O._status===1)return O._result.default;throw O._result}var z=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function F(){}return vt.Children={map:P,forEach:function(O,U,J){P(O,function(){U.apply(this,arguments)},J)},count:function(O){var U=0;return P(O,function(){U++}),U},toArray:function(O){return P(O,function(U){return U})||[]},only:function(O){if(!$(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},vt.Component=C,vt.Fragment=n,vt.Profiler=a,vt.PureComponent=D,vt.StrictMode=r,vt.Suspense=f,vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,vt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return A.H.useMemoCache(O)}},vt.cache=function(O){return function(){return O.apply(null,arguments)}},vt.cloneElement=function(O,U,J){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var te=S({},O.props),ye=O.key,be=void 0;if(U!=null)for(ve in U.ref!==void 0&&(be=void 0),U.key!==void 0&&(ye=""+U.key),U)!_.call(U,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&U.ref===void 0||(te[ve]=U[ve]);var ve=arguments.length-2;if(ve===1)te.children=J;else if(1<ve){for(var Ge=Array(ve),ke=0;ke<ve;ke++)Ge[ke]=arguments[ke+2];te.children=Ge}return M(O.type,ye,void 0,void 0,be,te)},vt.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},vt.createElement=function(O,U,J){var te,ye={},be=null;if(U!=null)for(te in U.key!==void 0&&(be=""+U.key),U)_.call(U,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ye[te]=U[te]);var ve=arguments.length-2;if(ve===1)ye.children=J;else if(1<ve){for(var Ge=Array(ve),ke=0;ke<ve;ke++)Ge[ke]=arguments[ke+2];ye.children=Ge}if(O&&O.defaultProps)for(te in ve=O.defaultProps,ve)ye[te]===void 0&&(ye[te]=ve[te]);return M(O,be,void 0,void 0,null,ye)},vt.createRef=function(){return{current:null}},vt.forwardRef=function(O){return{$$typeof:u,render:O}},vt.isValidElement=$,vt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:I}},vt.memo=function(O,U){return{$$typeof:p,type:O,compare:U===void 0?null:U}},vt.startTransition=function(O){var U=A.T,J={};A.T=J;try{var te=O(),ye=A.S;ye!==null&&ye(J,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(F,z)}catch(be){z(be)}finally{A.T=U}},vt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},vt.use=function(O){return A.H.use(O)},vt.useActionState=function(O,U,J){return A.H.useActionState(O,U,J)},vt.useCallback=function(O,U){return A.H.useCallback(O,U)},vt.useContext=function(O){return A.H.useContext(O)},vt.useDebugValue=function(){},vt.useDeferredValue=function(O,U){return A.H.useDeferredValue(O,U)},vt.useEffect=function(O,U,J){var te=A.H;if(typeof J=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return te.useEffect(O,U)},vt.useId=function(){return A.H.useId()},vt.useImperativeHandle=function(O,U,J){return A.H.useImperativeHandle(O,U,J)},vt.useInsertionEffect=function(O,U){return A.H.useInsertionEffect(O,U)},vt.useLayoutEffect=function(O,U){return A.H.useLayoutEffect(O,U)},vt.useMemo=function(O,U){return A.H.useMemo(O,U)},vt.useOptimistic=function(O,U){return A.H.useOptimistic(O,U)},vt.useReducer=function(O,U,J){return A.H.useReducer(O,U,J)},vt.useRef=function(O){return A.H.useRef(O)},vt.useState=function(O){return A.H.useState(O)},vt.useSyncExternalStore=function(O,U,J){return A.H.useSyncExternalStore(O,U,J)},vt.useTransition=function(){return A.H.useTransition()},vt.version="19.1.0",vt}var Pj;function ex(){return Pj||(Pj=1,uv.exports=t3()),uv.exports}var y=ex();const Cn=Jy(y),n3=XP({__proto__:null,default:Cn},[y]);var fh="right-scroll-bar-position",hh="width-before-scroll-bar",r3="with-scroll-bars-hidden",a3="--removed-body-scroll-bar-size";function dv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function i3(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var o3=typeof window<"u"?y.useLayoutEffect:y.useEffect,Nj=new WeakMap;function s3(e,t){var n=i3(null,function(r){return e.forEach(function(a){return dv(a,r)})});return o3(function(){var r=Nj.get(n);if(r){var a=new Set(r),o=new Set(e),c=n.current;a.forEach(function(u){o.has(u)||dv(u,null)}),o.forEach(function(u){a.has(u)||dv(u,c)})}Nj.set(n,e)},[e]),n}function l3(e){return e}function c3(e,t){t===void 0&&(t=l3);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var c=t(o,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(o){for(r=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(o),c=n}var f=function(){var m=c;c=[],m.forEach(o)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(m){c.push(m),p()},filter:function(m){return c=c.filter(m),n}}}};return a}function u3(e){e===void 0&&(e={});var t=c3(null);return t.options=Ja({async:!0,ssr:!1},e),t}var QT=function(e){var t=e.sideCar,n=GT(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Ja({},n))};QT.isSideCarExport=!0;function d3(e,t){return e.useMedium(t),QT}var WT=u3(),fv=function(){},tp=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:fv,onWheelCapture:fv,onTouchMoveCapture:fv}),a=r[0],o=r[1],c=e.forwardProps,u=e.children,f=e.className,p=e.removeScrollBar,m=e.enabled,g=e.shards,v=e.sideCar,b=e.noIsolation,S=e.inert,j=e.allowPinchZoom,C=e.as,R=C===void 0?"div":C,D=e.gapMode,E=GT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=v,A=s3([n,t]),_=Ja(Ja({},E),a);return y.createElement(y.Fragment,null,m&&y.createElement(T,{sideCar:WT,removeScrollBar:p,shards:g,noIsolation:b,inert:S,setCallbacks:o,allowPinchZoom:!!j,lockRef:n,gapMode:D}),c?y.cloneElement(y.Children.only(u),Ja(Ja({},_),{ref:A})):y.createElement(R,Ja({},_,{className:f,ref:A}),u))});tp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tp.classNames={fullWidth:hh,zeroRight:fh};var f3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function h3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=f3();return t&&e.setAttribute("nonce",t),e}function p3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function m3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var g3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=h3())&&(p3(t,n),m3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},v3=function(){var e=g3();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},YT=function(){var e=v3(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},y3={left:0,top:0,right:0,gap:0},hv=function(e){return parseInt(e||"",10)||0},x3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[hv(n),hv(r),hv(a)]},b3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return y3;var t=x3(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},S3=YT(),tc="data-scroll-locked",w3=function(e,t,n,r){var a=e.left,o=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
18
- .`.concat(r3,` {
19
- overflow: hidden `).concat(r,`;
20
- padding-right: `).concat(u,"px ").concat(r,`;
21
- }
22
- body[`).concat(tc,`] {
23
- overflow: hidden `).concat(r,`;
24
- overscroll-behavior: contain;
25
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
26
- padding-left: `.concat(a,`px;
27
- padding-top: `).concat(o,`px;
28
- padding-right: `).concat(c,`px;
29
- margin-left:0;
30
- margin-top:0;
31
- margin-right: `).concat(u,"px ").concat(r,`;
32
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
33
- }
34
-
35
- .`).concat(fh,` {
36
- right: `).concat(u,"px ").concat(r,`;
37
- }
38
-
39
- .`).concat(hh,` {
40
- margin-right: `).concat(u,"px ").concat(r,`;
41
- }
42
-
43
- .`).concat(fh," .").concat(fh,` {
44
- right: 0 `).concat(r,`;
45
- }
46
-
47
- .`).concat(hh," .").concat(hh,` {
48
- margin-right: 0 `).concat(r,`;
49
- }
50
-
51
- body[`).concat(tc,`] {
52
- `).concat(a3,": ").concat(u,`px;
53
- }
54
- `)},Oj=function(){var e=parseInt(document.body.getAttribute(tc)||"0",10);return isFinite(e)?e:0},j3=function(){y.useEffect(function(){return document.body.setAttribute(tc,(Oj()+1).toString()),function(){var e=Oj()-1;e<=0?document.body.removeAttribute(tc):document.body.setAttribute(tc,e.toString())}},[])},C3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;j3();var o=y.useMemo(function(){return b3(a)},[a]);return y.createElement(S3,{styles:w3(o,!t,a,n?"":"!important")})},sy=!1;if(typeof window<"u")try{var Xf=Object.defineProperty({},"passive",{get:function(){return sy=!0,!0}});window.addEventListener("test",Xf,Xf),window.removeEventListener("test",Xf,Xf)}catch{sy=!1}var $l=sy?{passive:!1}:!1,E3=function(e){return e.tagName==="TEXTAREA"},KT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!E3(e)&&n[t]==="visible")},T3=function(e){return KT(e,"overflowY")},R3=function(e){return KT(e,"overflowX")},Mj=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=XT(e,r);if(a){var o=ZT(e,r),c=o[1],u=o[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},D3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},A3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},XT=function(e,t){return e==="v"?T3(t):R3(t)},ZT=function(e,t){return e==="v"?D3(t):A3(t)},_3=function(e,t){return e==="h"&&t==="rtl"?-1:1},k3=function(e,t,n,r,a){var o=_3(e,window.getComputedStyle(t).direction),c=o*r,u=n.target,f=t.contains(u),p=!1,m=c>0,g=0,v=0;do{var b=ZT(e,u),S=b[0],j=b[1],C=b[2],R=j-C-o*S;(S||R)&&XT(e,u)&&(g+=R,v+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(v)<1)&&(p=!0),p},Zf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ij=function(e){return[e.deltaX,e.deltaY]},Lj=function(e){return e&&"current"in e?e.current:e},P3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},N3=function(e){return`
55
- .block-interactivity-`.concat(e,` {pointer-events: none;}
56
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
- `)},O3=0,Ul=[];function M3(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState(O3++)[0],o=y.useState(YT)[0],c=y.useRef(e);y.useEffect(function(){c.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var j=e3([e.lockRef.current],(e.shards||[]).map(Lj),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var R=Zf(j),D=n.current,E="deltaX"in j?j.deltaX:D[0]-R[0],T="deltaY"in j?j.deltaY:D[1]-R[1],A,_=j.target,M=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in j&&M==="h"&&_.type==="range")return!1;var L=Mj(M,_);if(!L)return!0;if(L?A=M:(A=M==="v"?"h":"v",L=Mj(M,_)),!L)return!1;if(!r.current&&"changedTouches"in j&&(E||T)&&(r.current=A),!A)return!0;var $=r.current||A;return k3($,C,j,$==="h"?E:T)},[]),f=y.useCallback(function(j){var C=j;if(!(!Ul.length||Ul[Ul.length-1]!==o)){var R="deltaY"in C?Ij(C):Zf(C),D=t.current.filter(function(A){return A.name===C.type&&(A.target===C.target||C.target===A.shadowParent)&&P3(A.delta,R)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var E=(c.current.shards||[]).map(Lj).filter(Boolean).filter(function(A){return A.contains(C.target)}),T=E.length>0?u(C,E[0]):!c.current.noIsolation;T&&C.cancelable&&C.preventDefault()}}},[]),p=y.useCallback(function(j,C,R,D){var E={name:j,delta:C,target:R,should:D,shadowParent:I3(R)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),m=y.useCallback(function(j){n.current=Zf(j),r.current=void 0},[]),g=y.useCallback(function(j){p(j.type,Ij(j),j.target,u(j,e.lockRef.current))},[]),v=y.useCallback(function(j){p(j.type,Zf(j),j.target,u(j,e.lockRef.current))},[]);y.useEffect(function(){return Ul.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,$l),document.addEventListener("touchmove",f,$l),document.addEventListener("touchstart",m,$l),function(){Ul=Ul.filter(function(j){return j!==o}),document.removeEventListener("wheel",f,$l),document.removeEventListener("touchmove",f,$l),document.removeEventListener("touchstart",m,$l)}},[]);var b=e.removeScrollBar,S=e.inert;return y.createElement(y.Fragment,null,S?y.createElement(o,{styles:N3(a)}):null,b?y.createElement(C3,{gapMode:e.gapMode}):null)}function I3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const L3=d3(WT,M3);var sc=y.forwardRef(function(e,t){return y.createElement(tp,Ja({},e,{ref:t,sideCar:L3}))});sc.classNames=tp.classNames;function sn(e){return Object.keys(e)}function pv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function tx(e,t){const n={...e},r=t;return pv(e)&&pv(t)&&Object.keys(t).forEach(a=>{pv(r[a])&&a in e?n[a]=tx(n[a],r[a]):n[a]=r[a]}),n}function z3(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function $3(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function Qu(e){const t=$3(e);return typeof t=="number"?t:typeof t=="string"?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?Number(t.replace("rem",""))*16:t.includes("em")?Number(t.replace("em",""))*16:Number(t):NaN}function mv(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function JT(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const a=`${r/16}${e}`;return t?mv(a):a}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(o=>n(o)).join(",");if(r.includes(" "))return r.split(" ").map(o=>n(o)).join(" ");if(r.includes(e))return t?mv(r):r;const a=r.replace("px","");if(!Number.isNaN(Number(a))){const o=`${Number(a)/16}${e}`;return t?mv(o):o}}return r}return n}const le=JT("rem",{shouldScale:!0}),jh=JT("em");function Fo(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function eR(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(r=>t.test(r))}return!1}function Fi(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==y.Fragment:!1}function vr(e){const t=y.createContext(null);return[({children:a,value:o})=>s.jsx(t.Provider,{value:o,children:a}),()=>{const a=y.useContext(t);if(a===null)throw new Error(e);return a}]}function Hi(e=null){const t=y.createContext(e);return[({children:a,value:o})=>s.jsx(t.Provider,{value:o,children:a}),()=>y.useContext(t)]}function zj(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Ch(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function U3(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].disabled)return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].disabled)return r}return e}function B3(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].disabled)return r;if(n){for(let r=0;r<t.length;r+=1)if(!t[r].disabled)return r}return e}function V3(e,t,n){return Ch(e,n)===Ch(t,n)}function tR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:a=!1,dir:o="rtl",orientation:c}){return u=>{var S;n==null||n(u);const f=Array.from(((S=Ch(u.currentTarget,e))==null?void 0:S.querySelectorAll(t))||[]).filter(j=>V3(u.currentTarget,j,e)),p=f.findIndex(j=>u.currentTarget===j),m=B3(p,f,r),g=U3(p,f,r),v=o==="rtl"?g:m,b=o==="rtl"?m:g;switch(u.key){case"ArrowRight":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[v].focus(),a&&f[v].click());break}case"ArrowLeft":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[b].focus(),a&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[g].focus(),a&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[m].focus(),a&&f[m].click());break}case"Home":{u.stopPropagation(),u.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{u.stopPropagation(),u.preventDefault();const j=f.length-1;!f[j].disabled&&f[j].focus();break}}}}const F3={app:100,modal:200,popover:300,overlay:400,max:9999};function Wr(e){return F3[e]}const Eh=()=>{};function H3(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Eh:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function nt(e,t="size",n=!0){if(e!==void 0)return eR(e)?n?le(e):e:`var(--${t}-${e})`}function On(e){return nt(e,"mantine-spacing")}function Ft(e){return e===void 0?"var(--mantine-radius-default)":nt(e,"mantine-radius")}function Mn(e){return nt(e,"mantine-font-size")}function nR(e){return nt(e,"mantine-line-height",!1)}function nx(e){if(e)return nt(e,"mantine-shadow",!1)}function Rr(e,t){return n=>{e==null||e(n),t==null||t(n)}}function rx(e,t){return e in t?Qu(t[e]):Qu(e)}function Wu(e,t){const n=e.map(r=>({value:r,px:rx(r,t)}));return n.sort((r,a)=>r.px-a.px),n}function ka(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function q3(e,t,n){var r;return n?Array.from(((r=Ch(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(a=>a===n):null}function G3(){const[e,t]=y.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function ph(e,t,n){return t===void 0&&n===void 0?e:t!==void 0&&n===void 0?Math.max(e,t):Math.min(t===void 0&&n!==void 0?e:Math.max(e,t),n)}function Th(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function Q3(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;const n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let a=0;a<r;a+=1){const o=n[a];if(!(o in t)||e[o]!==t[o])return!1}return!0}function $j(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Ss(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function np(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,a=Ss(e),o=y.useRef(0),c=y.useRef(()=>{}),u=Object.assign(y.useCallback((...f)=>{window.clearTimeout(o.current);const p=()=>{o.current!==0&&(o.current=0,a(...f))};c.current=p,u.flush=p,o.current=window.setTimeout(p,n)},[a,n]),{flush:c.current});return y.useEffect(()=>()=>{window.clearTimeout(o.current),r&&u.flush()},[u,r]),u}const Uj=["mousedown","touchstart"];function W3(e,t,n){const r=y.useRef(null);return y.useEffect(()=>{const a=o=>{const{target:c}=o??{};if(Array.isArray(n)){const u=(c==null?void 0:c.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(c)&&c.tagName!=="HTML";n.every(p=>!!p&&!o.composedPath().includes(p))&&!u&&e()}else r.current&&!r.current.contains(c)&&e()};return(t||Uj).forEach(o=>document.addEventListener(o,a)),()=>{(t||Uj).forEach(o=>document.removeEventListener(o,a))}},[r,e,n]),r}function rR({timeout:e=2e3}={}){const[t,n]=y.useState(null),[r,a]=y.useState(!1),[o,c]=y.useState(null),u=m=>{window.clearTimeout(o),c(window.setTimeout(()=>a(!1),e)),a(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>u(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{a(!1),n(null),window.clearTimeout(o)},error:t,copied:r}}function Y3(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function K3(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function aR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,a]=y.useState(n?t:K3(e)),o=y.useRef(null);return y.useEffect(()=>{if("matchMedia"in window)return o.current=window.matchMedia(e),a(o.current.matches),Y3(o.current,c=>a(c.matches))},[e]),r}function X3(e,t){return aR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const xc=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Li(e,t){const n=y.useRef(!1);y.useEffect(()=>()=>{n.current=!1},[]),y.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function iR({opened:e,shouldReturnFocus:t=!0}){const n=y.useRef(null),r=()=>{var a;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((a=n.current)==null||a.focus({preventScroll:!0}))};return Li(()=>{let a=-1;const o=c=>{c.key==="Tab"&&window.clearTimeout(a)};return document.addEventListener("keydown",o),e?n.current=document.activeElement:t&&(a=window.setTimeout(r,10)),()=>{window.clearTimeout(a),document.removeEventListener("keydown",o)}},[e,t]),r}const Z3=/input|select|textarea|button|object/,oR="a, input, select, textarea, button, object, [tabindex]";function J3(e){return e.style.display==="none"}function eN(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(J3(n))return!1;n=n.parentNode}return!0}function sR(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function ly(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(sR(e));return(Z3.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&eN(e)}function lR(e){const t=sR(e);return(Number.isNaN(t)||t>=0)&&ly(e)}function tN(e){return Array.from(e.querySelectorAll(oR)).filter(lR)}function nN(e,t){const n=tN(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],a=e.getRootNode();let o=r===a.activeElement||e===a.activeElement;const c=a.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(o=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!o)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function rN(e=!0){const t=y.useRef(null),n=a=>{let o=a.querySelector("[data-autofocus]");if(!o){const c=Array.from(a.querySelectorAll(oR));o=c.find(lR)||c.find(ly)||null,!o&&ly(a)&&(o=a)}o&&o.focus({preventScroll:!0})},r=y.useCallback(a=>{e&&a!==null&&t.current!==a&&(a?(setTimeout(()=>{a.getRootNode()&&n(a)}),t.current=a):t.current=null)},[e]);return y.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const a=o=>{o.key==="Tab"&&t.current&&nN(t.current,o)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),r}const aN=e=>(e+1)%1e6;function iN(){const[,e]=y.useReducer(aN,0);return e}const oN=Cn.useId||(()=>{});function sN(){const e=oN();return e?`mantine-${e.replace(/:/g,"")}`:""}function yr(e){const t=sN(),[n,r]=y.useState(t);return xc(()=>{r(Th())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function cR(e,t,n){y.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Yu(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function lN(...e){const t=new Map;return n=>{if(e.forEach(r=>{const a=Yu(r,n);a&&t.set(r,a)}),t.size>0)return()=>{e.forEach(r=>{const a=t.get(r);a?a():Yu(r,null)}),t.clear()}}}function $n(...e){return y.useCallback(lN(...e),e)}function Wn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[a,o]=y.useState(t!==void 0?t:n),c=(u,...f)=>{o(u),r==null||r(u,...f)};return e!==void 0?[e,r,!0]:[a,c,!1]}function Ao(e,t){const n=t-e+1;return Array.from({length:n},(r,a)=>a+e)}const Jf="dots";function cN({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:a=1,onChange:o}){const c=Math.max(Math.trunc(e),0),[u,f]=Wn({value:r,onChange:o,defaultValue:a,finalValue:a}),p=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>p(u+1),g=()=>p(u-1),v=()=>p(1),b=()=>p(c);return{range:y.useMemo(()=>{if(t*2+3+n*2>=c)return Ao(1,c);const C=Math.max(u-t,n),R=Math.min(u+t,c-n),D=C>n+2,E=R<c-(n+1);if(!D&&E){const T=t*2+n+2;return[...Ao(1,T),Jf,...Ao(c-(n-1),c)]}if(D&&!E){const T=n+1+2*t;return[...Ao(1,n),Jf,...Ao(c-T,c)]}return[...Ao(1,n),Jf,...Ao(C,R),Jf,...Ao(c-n+1,c)]},[c,t,u]),active:u,setPage:p,next:m,previous:g,first:v,last:b}}function ax(e,t){return aR("(prefers-reduced-motion: reduce)",e,t)}function uN(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Q3(e[n],t[n]))return!1;return!0}function dN(e){const t=y.useRef([]),n=y.useRef(0);return uN(t.current,e)||(t.current=e,n.current+=1),[n.current]}function fN(e,t){y.useEffect(e,dN(t))}function rp(e=!1,t){const{onOpen:n,onClose:r}={},[a,o]=y.useState(e),c=y.useCallback(()=>{o(p=>p||(n==null||n(),!0))},[n]),u=y.useCallback(()=>{o(p=>p&&(r==null||r(),!1))},[r]),f=y.useCallback(()=>{a?u():c()},[u,c,a]);return[a,{open:c,close:u,toggle:f}]}function hN(e,t,n={autoInvoke:!1}){const r=y.useRef(null),a=y.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),o=y.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return y.useEffect(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function pN(e,t,n){const r=y.useRef(null),a=y.useRef(null);return y.useEffect(()=>{const o=typeof n=="function"?n():n;return(o||a.current)&&(r.current=new MutationObserver(e),r.current.observe(o||a.current,t)),()=>{var c;(c=r.current)==null||c.disconnect()}},[e,t]),a}function mN(){const[e,t]=y.useState(!1);return y.useEffect(()=>t(!0),[]),e}var gN={};function uR(){return typeof process<"u"&&gN?"production":"development"}function ap(e){var n;const t=Cn.version;return typeof Cn.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function dR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=dR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $t(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=dR(e))&&(r&&(r+=" "),r+=t);return r}const vN={};function yN(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,a])=>{t[r]?t[r]=$t(t[r],a):t[r]=a})}),t}function ip({theme:e,classNames:t,props:n,stylesCtx:r}){const o=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||vN);return yN(o)}function Rh({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((o,c)=>typeof c=="function"?{...o,...c(e,n,r)}:{...o,...c},{})}const ix=y.createContext(null);function qi(){const e=y.useContext(ix);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function xN(){return qi().cssVariablesResolver}function bN(){return qi().classNamesPrefix}function op(){return qi().getStyleNonce}function SN(){return qi().withStaticClasses}function wN(){return qi().headless}function jN(){var e;return(e=qi().stylesTransform)==null?void 0:e.sx}function CN(){var e;return(e=qi().stylesTransform)==null?void 0:e.styles}function fR(){return qi().env||"default"}function EN(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function TN(e){let t=e.replace("#","");if(t.length===3){const c=t.split("");t=[c[0],c[0],c[1],c[1],c[2],c[2]].join("")}if(t.length===8){const c=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:c}}const n=parseInt(t,16),r=n>>16&255,a=n>>8&255,o=n&255;return{r,g:a,b:o,a:1}}function RN(e){const[t,n,r,a]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:a||1}}function DN(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),a=parseInt(n[2],10)/100,o=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*o-1))*a,f=r/60,p=u*(1-Math.abs(f%2-1)),m=o-u/2;let g,v,b;return f>=0&&f<1?(g=u,v=p,b=0):f>=1&&f<2?(g=p,v=u,b=0):f>=2&&f<3?(g=0,v=u,b=p):f>=3&&f<4?(g=0,v=p,b=u):f>=4&&f<5?(g=p,v=0,b=u):(g=u,v=0,b=p),{r:Math.round((g+m)*255),g:Math.round((v+m)*255),b:Math.round((b+m)*255),a:c||1}}function ox(e){return EN(e)?TN(e):e.startsWith("rgb")?RN(e):e.startsWith("hsl")?DN(e):{r:0,g:0,b:0,a:1}}function eh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:a,a:o}=ox(e),c=1-t,u=f=>Math.round(f*c);return`rgba(${u(n)}, ${u(r)}, ${u(a)}, ${o})`}function Ku(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function gv(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function AN(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function _N(e){if(e.startsWith("oklch("))return(AN(e)||0)/100;const{r:t,g:n,b:r}=ox(e),a=t/255,o=n/255,c=r/255,u=gv(a),f=gv(o),p=gv(c);return .2126*u+.7152*f+.0722*p}function ku(e,t=.179){return e.startsWith("var(")?!1:_N(e)>t}function da({color:e,theme:t,colorScheme:n}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:n==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ku(n==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:n==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:ku(n==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ku(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,a]=e.split("."),o=a?Number(a):void 0,c=r in t.colors;if(c){const u=o!==void 0?t.colors[r][o]:t.colors[r][Ku(t,n||"light")];return{color:r,value:u,shade:o,isThemeColor:c,isLight:ku(u,t.luminanceThreshold),variable:a?`--mantine-color-${r}-${o}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:ku(e,t.luminanceThreshold),shade:o,variable:void 0}}function Gt(e,t){const n=da({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function cy(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)??t.defaultGradient.deg??0},r=Gt(n.from,t),a=Gt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${a} 100%)`}function sa(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const o=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${o}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:a}=ox(e);return`rgba(${n}, ${r}, ${a}, ${t})`}const Bl=sa,kN=({color:e,theme:t,variant:n,gradient:r,autoContrast:a})=>{const o=da({color:e,theme:t}),c=typeof a=="boolean"?a:t.autoContrast;if(n==="filled"){const u=c&&o.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return o.isThemeColor?o.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${le(1)} solid transparent`}:{background:`var(--mantine-color-${o.color}-${o.shade})`,hover:`var(--mantine-color-${o.color}-${o.shade===9?8:o.shade+1})`,color:u,border:`${le(1)} solid transparent`}:{background:e,hover:eh(e,.1),color:u,border:`${le(1)} solid transparent`}}if(n==="light"){if(o.isThemeColor){if(o.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:sa(u,.1),hover:sa(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:sa(e,.1),hover:sa(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return o.isThemeColor?o.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:sa(t.colors[o.color][o.shade],.05),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid var(--mantine-color-${o.color}-${o.shade})`}:{background:"transparent",hover:sa(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(o.isThemeColor){if(o.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:"transparent",hover:sa(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:sa(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?o.isThemeColor?o.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?o.isThemeColor?o.shade===void 0?{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:cy(r,t),hover:cy(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${le(1)} solid var(--mantine-color-default-border)`}:{}},PN={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Bj="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",sx={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:PN,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:kN,autoContrast:!1,luminanceThreshold:.3,fontFamily:Bj,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:Bj,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:le(34),lineHeight:"1.3"},h2:{fontSize:le(26),lineHeight:"1.35"},h3:{fontSize:le(22),lineHeight:"1.4"},h4:{fontSize:le(18),lineHeight:"1.45"},h5:{fontSize:le(16),lineHeight:"1.5"},h6:{fontSize:le(14),lineHeight:"1.5"}}},fontSizes:{xs:le(12),sm:le(14),md:le(16),lg:le(18),xl:le(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:le(2),sm:le(4),md:le(8),lg:le(16),xl:le(32)},spacing:{xs:le(10),sm:le(12),md:le(16),lg:le(20),xl:le(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), 0 ${le(1)} ${le(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(10)} ${le(15)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(7)} ${le(7)} ${le(-5)}`,md:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(20)} ${le(25)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(10)} ${le(10)} ${le(-5)}`,lg:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(28)} ${le(23)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(12)} ${le(12)} ${le(-7)}`,xl:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(36)} ${le(28)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(17)} ${le(17)} ${le(-7)}`},other:{},components:{}};function Vj(e){return e==="auto"||e==="dark"||e==="light"}function NN({key:e="mantine-color-scheme-value"}={}){let t;return{get:n=>{if(typeof window>"u")return n;try{const r=window.localStorage.getItem(e);return Vj(r)?r:n}catch{return n}},set:n=>{try{window.localStorage.setItem(e,n)}catch(r){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",r)}},subscribe:n=>{t=r=>{r.storageArea===window.localStorage&&r.key===e&&Vj(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const ON="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",Fj="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function vv(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Hj(e){if(!(e.primaryColor in e.colors))throw new Error(ON);if(typeof e.primaryShade=="object"&&(!vv(e.primaryShade.dark)||!vv(e.primaryShade.light)))throw new Error(Fj);if(typeof e.primaryShade=="number"&&!vv(e.primaryShade))throw new Error(Fj)}function MN(e,t){var r;if(!t)return Hj(e),e;const n=tx(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),Hj(n),n}const lx=y.createContext(null),IN=()=>y.useContext(lx)||sx;function Sn(){const e=y.useContext(lx);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function hR({theme:e,children:t,inherit:n=!0}){const r=IN(),a=y.useMemo(()=>MN(n?r:sx,e),[e,r,n]);return s.jsx(lx.Provider,{value:a,children:t})}hR.displayName="@mantine/core/MantineThemeProvider";function LN(){const e=Sn(),t=op(),n=sn(e.breakpoints).reduce((r,a)=>{const o=e.breakpoints[a].includes("px"),c=Qu(e.breakpoints[a]),u=o?`${c-.1}px`:jh(c-.1),f=o?`${c}px`:jh(c);return`${r}@media (max-width: ${u}) {.mantine-visible-from-${a} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${a} {display: none !important;}}`},"");return s.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function yv(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Pu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,a)=>`${a}{${r}}`,t)}function zN(e,t){const n=yv(e.variables),r=n?Pu(t,n):"",a=yv(e.dark),o=yv(e.light),c=a?Pu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,a):"",u=o?Pu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,o):"";return`${r}${c}${u}`}function Gi({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&da({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function qj(e,t){return Gi({color:e.colors[e.primaryColor][Ku(e,t)],theme:e,autoContrast:null})}function th({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:a=!0}){if(!e.colors[t])return{};if(n==="light"){const u=Ku(e,"light"),f={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${u===9?8:u+1})`,[`--mantine-color-${r}-light`]:Bl(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:Bl(e.colors[t][u],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline-hover`]:Bl(e.colors[t][u],.05)};return a?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const o=Ku(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${o})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${o===9?8:o+1})`,[`--mantine-color-${r}-light`]:Bl(e.colors[t][Math.max(0,o-2)],.15),[`--mantine-color-${r}-light-hover`]:Bl(e.colors[t][Math.max(0,o-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(o-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(o-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Bl(e.colors[t][Math.max(o-4,0)],.05)};return a?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...c}:c}function $N(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Vl(e,t,n){sn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const pR=e=>{const t=Ku(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":qj(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":qj(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)"}};Vl(r.variables,e.breakpoints,"breakpoint"),Vl(r.variables,e.spacing,"spacing"),Vl(r.variables,e.fontSizes,"font-size"),Vl(r.variables,e.lineHeights,"line-height"),Vl(r.variables,e.shadows,"shadow"),Vl(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((o,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),sn(e.colors).forEach(o=>{const c=e.colors[o];if($N(c)){Object.assign(r.light,th({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,th({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((u,f)=>{r.variables[`--mantine-color-${o}-${f}`]=u}),Object.assign(r.light,th({theme:e,color:o,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,th({theme:e,color:o,colorScheme:"dark",withColorValues:!1}))});const a=e.headings.sizes;return sn(a).forEach(o=>{r.variables[`--mantine-${o}-font-size`]=a[o].fontSize,r.variables[`--mantine-${o}-line-height`]=a[o].lineHeight,r.variables[`--mantine-${o}-font-weight`]=a[o].fontWeight||e.headings.fontWeight}),r};function UN({theme:e,generator:t}){const n=pR(e),r=t==null?void 0:t(e);return r?tx(n,r):n}const xv=pR(sx);function BN(e){const t={variables:{},light:{},dark:{}};return sn(e.variables).forEach(n=>{xv.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),sn(e.light).forEach(n=>{xv.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),sn(e.dark).forEach(n=>{xv.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function VN(e){return`
58
- ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
59
- ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
60
- `}function mR({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Sn(),r=op(),a=xN(),o=UN({theme:n,generator:a}),c=e===":root"&&t,u=c?BN(o):o,f=zN(u,e);return f?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${f}${c?"":VN(e)}`}}):null}mR.displayName="@mantine/CssVariables";function FN(){const e=console.error;console.error=(...t)=>{t.length>1&&typeof t[0]=="string"&&t[0].toLowerCase().includes("extra attributes from the server")&&typeof t[1]=="string"&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}}function Fl(e,t){var a,o;const n=typeof window<"u"&&"matchMedia"in window&&((a=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:a.matches),r=e!=="auto"?e:n?"dark":"light";(o=t())==null||o.setAttribute("data-mantine-color-scheme",r)}function HN({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const a=y.useRef(null),[o,c]=y.useState(()=>e.get(t)),u=r||o,f=y.useCallback(m=>{r||(Fl(m,n),c(m),e.set(m))},[e.set,u,r]),p=y.useCallback(()=>{c(t),Fl(t,n),e.clear()},[e.clear,t]);return y.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),xc(()=>{Fl(e.get(t),n)},[]),y.useEffect(()=>{var g;if(r)return Fl(r,n),()=>{};r===void 0&&Fl(o,n),typeof window<"u"&&"matchMedia"in window&&(a.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=v=>{o==="auto"&&Fl(v.matches?"dark":"light",n)};return(g=a.current)==null||g.addEventListener("change",m),()=>{var v;return(v=a.current)==null?void 0:v.removeEventListener("change",m)}},[o,r]),{colorScheme:u,setColorScheme:f,clearColorScheme:p}}function qN({respectReducedMotion:e,getRootElement:t}){xc(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}FN();function gR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:a=!0,deduplicateCssVariables:o=!0,withCssVariables:c=!0,cssVariablesSelector:u=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=NN(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:v,forceColorScheme:b,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:R,clearColorScheme:D}=HN({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return qN({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:g}),s.jsx(ix.Provider,{value:{colorScheme:C,setColorScheme:R,clearColorScheme:D,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:v,cssVariablesSelector:u,withStaticClasses:r,stylesTransform:S,env:j},children:s.jsxs(hR,{theme:e,children:[c&&s.jsx(mR,{cssVariablesSelector:u,deduplicateCssVariables:o}),a&&s.jsx(LN,{}),t]})})}gR.displayName="@mantine/core/MantineProvider";function Hs({classNames:e,styles:t,props:n,stylesCtx:r}){const a=Sn();return{resolvedClassNames:ip({theme:a,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Rh({theme:a,styles:t,props:n,stylesCtx:r||void 0})}}const GN={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function QN({theme:e,options:t,unstyled:n}){return $t((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||GN[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function WN({selector:e,stylesCtx:t,options:n,props:r,theme:a}){return ip({theme:a,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function Gj({selector:e,stylesCtx:t,theme:n,classNames:r,props:a}){return ip({theme:n,classNames:r,props:a,stylesCtx:t})[e]}function YN({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function KN({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function XN({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(a=>`${t}-${a}-${n}`)}function ZN({themeName:e,theme:t,selector:n,props:r,stylesCtx:a}){return e.map(o=>{var c,u;return(u=ip({theme:t,classNames:(c=t.components[o])==null?void 0:c.classNames,props:r,stylesCtx:a}))==null?void 0:u[n]})}function JN({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function eO({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:a,classNames:o,classes:c,unstyled:u,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:v,headless:b,transformedStyles:S}){return $t(QN({theme:e,options:t,unstyled:u||b}),ZN({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),JN({options:t,classes:c,selector:r,unstyled:u}),Gj({selector:r,stylesCtx:g,theme:e,classNames:o,props:m}),Gj({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),WN({selector:r,stylesCtx:g,options:t,props:m,theme:e}),YN({rootSelector:p,selector:r,className:f}),KN({selector:r,classes:c,unstyled:u||b}),v&&!b&&XN({themeName:n,classNamesPrefix:a,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function tO({theme:e,themeName:t,props:n,stylesCtx:r,selector:a}){return t.map(o=>{var c;return Rh({theme:e,styles:(c=e.components[o])==null?void 0:c.styles,props:n,stylesCtx:r})[a]}).reduce((o,c)=>({...o,...c}),{})}function uy({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...uy({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function nO(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Fo(n[r])}}),t),{})}function rO({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:a,selector:o,themeName:c,headless:u}){var f;return(f=nO([u?{}:t==null?void 0:t(n,r,a),...c.map(p=>{var m,g,v;return(v=(g=(m=n.components)==null?void 0:m[p])==null?void 0:g.vars)==null?void 0:v.call(g,n,r,a)}),e==null?void 0:e(n,r,a)]))==null?void 0:f[o]}function aO({theme:e,themeName:t,selector:n,options:r,props:a,stylesCtx:o,rootSelector:c,styles:u,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:v}){return{...!v&&tO({theme:e,themeName:t,props:a,stylesCtx:o,selector:n}),...!v&&Rh({theme:e,styles:u,props:a,stylesCtx:o})[n],...!v&&Rh({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||a,stylesCtx:o})[n],...rO({theme:e,props:a,stylesCtx:o,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?uy({style:f,theme:e}):null,...uy({style:r==null?void 0:r.style,theme:e})}}function iO({props:e,stylesCtx:t,themeName:n}){var c;const r=Sn(),a=(c=CN())==null?void 0:c();return{getTransformedStyles:u=>a?[...u.map(p=>a(p,{props:e,theme:r,ctx:t})),...n.map(p=>{var m;return a((m=r.components[p])==null?void 0:m.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!a}}function Me({name:e,classes:t,props:n,stylesCtx:r,className:a,style:o,rootSelector:c="root",unstyled:u,classNames:f,styles:p,vars:m,varsResolver:g}){const v=Sn(),b=bN(),S=SN(),j=wN(),C=(Array.isArray(e)?e:[e]).filter(E=>E),{withStylesTransform:R,getTransformedStyles:D}=iO({props:n,stylesCtx:r,themeName:C});return(E,T)=>({className:eO({theme:v,options:T,themeName:C,selector:E,classNamesPrefix:b,classNames:f,classes:t,unstyled:u,className:a,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:S,headless:j,transformedStyles:D([T==null?void 0:T.styles,p])}),style:aO({theme:v,themeName:C,selector:E,options:T,props:n,stylesCtx:r,rootSelector:c,styles:p,style:o,vars:m,varsResolver:g,headless:j,withStylesTransform:R})})}function qs(e,t){return typeof e=="boolean"?e:t.autoContrast}function Qj(e){const t=document.createElement("style");return t.setAttribute("data-mantine-styles","inline"),t.innerHTML="*, *::before, *::after {transition: none !important;}",t.setAttribute("data-mantine-disable-transition","true"),e&&t.setAttribute("nonce",e),document.head.appendChild(t),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(r=>r.remove())}function oO({keepTransitions:e}={}){const t=y.useRef(Eh),n=y.useRef(-1),r=y.useContext(ix),a=op(),o=y.useRef(a==null?void 0:a());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:Qj(o.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var v;(v=t.current)==null||v.call(t)},10)},u=()=>{r.clearColorScheme(),t.current=e?()=>{}:Qj(o.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var g;(g=t.current)==null||g.call(t)},10)},f=X3("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?f:r.colorScheme,m=y.useCallback(()=>c(p==="light"?"dark":"light"),[c,p]);return y.useEffect(()=>()=>{var g;(g=t.current)==null||g.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:u,toggleColorScheme:m}}function se(e,t,n){var c;const r=Sn(),a=(c=r.components[e])==null?void 0:c.defaultProps,o=typeof a=="function"?a(r):a;return{...t,...o,...Fo(n)}}function bv(e){return sn(e).reduce((t,n)=>e[n]!==void 0?`${t}${z3(n)}:${e[n]};`:t,"").trim()}function sO({selector:e,styles:t,media:n,container:r}){const a=t?bv(t):"",o=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${bv(u.styles)}}}`):[],c=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${bv(u.styles)}}}`):[];return`${a?`${e}{${a}}`:""}${o.join("")}${c.join("")}`.trim()}function Gs(e){const t=op();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:sO(e)}})}function Qi(e){const{m:t,mx:n,my:r,mt:a,mb:o,ml:c,mr:u,me:f,ms:p,p:m,px:g,py:v,pt:b,pb:S,pl:j,pr:C,pe:R,ps:D,bd:E,bg:T,c:A,opacity:_,ff:M,fz:L,fw:$,lts:V,ta:Y,lh:W,fs:G,tt:X,td:Z,w:P,miw:I,maw:z,h:F,mih:O,mah:U,bgsz:J,bgp:te,bgr:ye,bga:be,pos:ve,top:Ge,left:ke,bottom:et,right:Re,inset:ft,display:Ut,flex:Ot,hiddenFrom:xt,visibleFrom:Ht,lightHidden:Bt,darkHidden:Se,sx:Ne,...Ve}=e;return{styleProps:Fo({m:t,mx:n,my:r,mt:a,mb:o,ml:c,mr:u,me:f,ms:p,p:m,px:g,py:v,pt:b,pb:S,pl:j,pr:C,pe:R,ps:D,bd:E,bg:T,c:A,opacity:_,ff:M,fz:L,fw:$,lts:V,ta:Y,lh:W,fs:G,tt:X,td:Z,w:P,miw:I,maw:z,h:F,mih:O,mah:U,bgsz:J,bgp:te,bgr:ye,bga:be,pos:ve,top:Ge,left:ke,bottom:et,right:Re,inset:ft,display:Ut,flex:Ot,hiddenFrom:xt,visibleFrom:Ht,lightHidden:Bt,darkHidden:Se,sx:Ne}),rest:Ve}}const lO={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function cx(e,t){const n=da({color:e,theme:t});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function cO(e,t){const n=da({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:cx(e,t)}function uO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...a]=e.split(" ").filter(c=>c.trim()!=="");let o=`${le(n)}`;return r&&(o+=` ${r}`),a.length>0&&(o+=` ${cx(a.join(" "),t)}`),o.trim()}return e}const Wj={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function dO(e){return typeof e=="string"&&e in Wj?Wj[e]:e}const fO=["h1","h2","h3","h4","h5","h6"];function hO(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&fO.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function pO(e){return e}const mO=["h1","h2","h3","h4","h5","h6"];function gO(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&mO.includes(e)?`var(--mantine-${e}-line-height)`:e}function vO(e){return typeof e=="number"?le(e):e}function yO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return le(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const Sv={color:cx,textColor:cO,fontSize:hO,spacing:yO,identity:pO,size:vO,lineHeight:gO,fontFamily:dO,border:uO};function Yj(e){return e.replace("(min-width: ","").replace("em)","")}function xO({media:e,...t}){const r=Object.keys(e).sort((a,o)=>Number(Yj(a))-Number(Yj(o))).map(a=>({query:a,styles:e[a]}));return{...t,media:r}}function bO(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function SO(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function wO(e){return typeof e=="object"&&e!==null?sn(e).filter(t=>t!=="base"):[]}function jO(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function vR({styleProps:e,data:t,theme:n}){return xO(sn(e).reduce((r,a)=>{if(a==="hiddenFrom"||a==="visibleFrom"||a==="sx")return r;const o=t[a],c=Array.isArray(o.property)?o.property:[o.property],u=SO(e[a]);if(!bO(e[a]))return c.forEach(p=>{r.inlineStyles[p]=Sv[o.type](u,n)}),r;r.hasResponsiveStyles=!0;const f=wO(e[a]);return c.forEach(p=>{u&&(r.styles[p]=Sv[o.type](u,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:Sv[o.type](jO(e[a],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function ud(){return`__m__-${y.useId().replace(/:/g,"")}`}function yR(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...yR(r,t)}),{}):typeof e=="function"?e(t):e??{}}function xR(e){return e.startsWith("data-")?e:`data-${e}`}function CO(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[xR(n)]=e[n]),t},{})}function bR(e){return e?typeof e=="string"?{[xR(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...bR(n)}),{}):CO(e):null}function dy(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...dy(r,t)}),{}):typeof e=="function"?e(t):e??{}}function EO({theme:e,style:t,vars:n,styleProps:r}){const a=dy(t,e),o=dy(n,e);return{...a,...o,...r}}const SR=y.forwardRef(({component:e,style:t,__vars:n,className:r,variant:a,mod:o,size:c,hiddenFrom:u,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:v,...b},S)=>{var L;const j=Sn(),C=e||"div",{styleProps:R,rest:D}=Qi(b),E=jN(),T=(L=E==null?void 0:E())==null?void 0:L(R.sx),A=ud(),_=vR({styleProps:R,theme:j,data:lO}),M={ref:S,style:EO({theme:j,style:t,vars:n,styleProps:_.inlineStyles}),className:$t(r,T,{[A]:_.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${f}`]:f}),"data-variant":a,"data-size":eR(c)?void 0:c||void 0,size:v,...bR(o),...D};return s.jsxs(s.Fragment,{children:[_.hasResponsiveStyles&&s.jsx(Gs,{selector:`.${A}`,styles:_.styles,media:_.media}),typeof g=="function"?g(M):s.jsx(C,{...M})]})});SR.displayName="@mantine/core/Box";const ce=SR;function wR(e){return e}function TO(e){const t=e;return n=>{const r=y.forwardRef((a,o)=>s.jsx(t,{...n,...a,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function me(e){const t=y.forwardRef(e);return t.extend=wR,t.withProps=n=>{const r=y.forwardRef((a,o)=>s.jsx(t,{...n,...a,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function lr(e){const t=y.forwardRef(e);return t.withProps=n=>{const r=y.forwardRef((a,o)=>s.jsx(t,{...n,...a,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=wR,t}const RO=y.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Qs(){return y.useContext(RO)}var wv={exports:{}},ar={};/**
61
- * @license React
62
- * react-dom.production.js
63
- *
64
- * Copyright (c) Meta Platforms, Inc. and affiliates.
65
- *
66
- * This source code is licensed under the MIT license found in the
67
- * LICENSE file in the root directory of this source tree.
68
- */var Kj;function DO(){if(Kj)return ar;Kj=1;var e=ex();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:f,containerInfo:p,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return ar.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ar.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return o(f,p,null,m)},ar.flushSync=function(f){var p=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=p,r.p=m,r.d.f()}},ar.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(f,p))},ar.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},ar.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=u(m,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},ar.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=u(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(f)},ar.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=u(m,p.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},ar.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=u(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},ar.requestFormReset=function(f){r.d.r(f)},ar.unstable_batchedUpdates=function(f,p){return f(p)},ar.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},ar.useFormStatus=function(){return c.H.useHostTransitionStatus()},ar.version="19.1.0",ar}var Xj;function jR(){if(Xj)return wv.exports;Xj=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),wv.exports=DO(),wv.exports}var ux=jR();const Bu=Jy(ux);function sp(){return typeof window<"u"}function bc(e){return CR(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ui(e){var t;return(t=(CR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function CR(e){return sp()?e instanceof Node||e instanceof Dr(e).Node:!1}function vn(e){return sp()?e instanceof Element||e instanceof Dr(e).Element:!1}function Gr(e){return sp()?e instanceof HTMLElement||e instanceof Dr(e).HTMLElement:!1}function fy(e){return!sp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}function dd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=fa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function AO(e){return["table","td","th"].includes(bc(e))}function lp(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function dx(e){const t=cp(),n=vn(e)?fa(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function _O(e){let t=zi(e);for(;Gr(t)&&!zo(t);){if(dx(t))return t;if(lp(t))return null;t=zi(t)}return null}function cp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zo(e){return["html","body","#document"].includes(bc(e))}function fa(e){return Dr(e).getComputedStyle(e)}function up(e){return vn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zi(e){if(bc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fy(e)&&e.host||ui(e);return fy(t)?t.host:t}function ER(e){const t=zi(e);return zo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gr(t)&&dd(t)?t:ER(t)}function Mi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=ER(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),c=Dr(a);if(o){const u=hy(c);return t.concat(c,c.visualViewport||[],dd(a)?a:[],u&&n?Mi(u):[])}return t.concat(a,Mi(a,[],n))}function hy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zj(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Xu(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&fy(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function TR(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function RR(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function kO(e){return OO()?!1:!Jj()&&e.width===0&&e.height===0||Jj()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function PO(){return/apple/i.test(navigator.vendor)}function Jj(){const e=/android/i;return e.test(TR())||e.test(RR())}function NO(){return TR().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function OO(){return RR().includes("jsdom/")}function py(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function MO(e){return"nativeEvent"in e}function IO(e){return e.matches("html,body")}function Es(e){return(e==null?void 0:e.ownerDocument)||document}function jv(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Kl(e){return"composedPath"in e?e.composedPath()[0]:e.target}const LO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function zO(e){return Gr(e)&&e.matches(LO)}const Oa=Math.min,ir=Math.max,Dh=Math.round,nh=Math.floor,ti=e=>({x:e,y:e}),$O={left:"right",right:"left",bottom:"top",top:"bottom"},UO={start:"end",end:"start"};function my(e,t,n){return ir(e,Oa(t,n))}function $i(e,t){return typeof e=="function"?e(t):e}function Ma(e){return e.split("-")[0]}function Sc(e){return e.split("-")[1]}function fx(e){return e==="x"?"y":"x"}function hx(e){return e==="y"?"height":"width"}function ni(e){return["top","bottom"].includes(Ma(e))?"y":"x"}function px(e){return fx(ni(e))}function BO(e,t,n){n===void 0&&(n=!1);const r=Sc(e),a=px(e),o=hx(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(c=Ah(c)),[c,Ah(c)]}function VO(e){const t=Ah(e);return[gy(e),t,gy(t)]}function gy(e){return e.replace(/start|end/g,t=>UO[t])}function FO(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:c;default:return[]}}function HO(e,t,n,r){const a=Sc(e);let o=FO(Ma(e),n==="start",r);return a&&(o=o.map(c=>c+"-"+a),t&&(o=o.concat(o.map(gy)))),o}function Ah(e){return e.replace(/left|right|bottom|top/g,t=>$O[t])}function qO(e){return{top:0,right:0,bottom:0,left:0,...e}}function mx(e){return typeof e!="number"?qO(e):{top:e,right:e,bottom:e,left:e}}function lc(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function eC(e,t,n){let{reference:r,floating:a}=e;const o=ni(t),c=px(t),u=hx(c),f=Ma(t),p=o==="y",m=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,v=r[u]/2-a[u]/2;let b;switch(f){case"top":b={x:m,y:r.y-a.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-a.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Sc(t)){case"start":b[c]-=v*(n&&p?-1:1);break;case"end":b[c]+=v*(n&&p?-1:1);break}return b}const GO=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:c}=n,u=o.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:g}=eC(p,r,f),v=r,b={},S=0;for(let j=0;j<u.length;j++){const{name:C,fn:R}=u[j],{x:D,y:E,data:T,reset:A}=await R({x:m,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=D??m,g=E??g,b={...b,[C]:{...b[C],...T}},A&&S<=50&&(S++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(p=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:m,y:g}=eC(p,v,f)),j=-1)}return{x:m,y:g,placement:v,strategy:a,middlewareData:b}};async function gx(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:c,elements:u,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:v=!1,padding:b=0}=$i(t,e),S=mx(b),C=u[v?g==="floating"?"reference":"floating":g],R=lc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:p,rootBoundary:m,strategy:f})),D=g==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),T=await(o.isElement==null?void 0:o.isElement(E))?await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1}:{x:1,y:1},A=lc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:D,offsetParent:E,strategy:f}):D);return{top:(R.top-A.top+S.top)/T.y,bottom:(A.bottom-R.bottom+S.bottom)/T.y,left:(R.left-A.left+S.left)/T.x,right:(A.right-R.right+S.right)/T.x}}const QO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:c,elements:u,middlewareData:f}=t,{element:p,padding:m=0}=$i(e,t)||{};if(p==null)return{};const g=mx(m),v={x:n,y:r},b=px(a),S=hx(b),j=await c.getDimensions(p),C=b==="y",R=C?"top":"left",D=C?"bottom":"right",E=C?"clientHeight":"clientWidth",T=o.reference[S]+o.reference[b]-v[b]-o.floating[S],A=v[b]-o.reference[b],_=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let M=_?_[E]:0;(!M||!await(c.isElement==null?void 0:c.isElement(_)))&&(M=u.floating[E]||o.floating[S]);const L=T/2-A/2,$=M/2-j[S]/2-1,V=Oa(g[R],$),Y=Oa(g[D],$),W=V,G=M-j[S]-Y,X=M/2-j[S]/2+L,Z=my(W,X,G),P=!f.arrow&&Sc(a)!=null&&X!==Z&&o.reference[S]/2-(X<W?V:Y)-j[S]/2<0,I=P?X<W?X-W:X-G:0;return{[b]:v[b]+I,data:{[b]:Z,centerOffset:X-Z-I,...P&&{alignmentOffset:I}},reset:P}}}),WO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:c,initialPlacement:u,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=$i(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const R=Ma(a),D=ni(u),E=Ma(u)===u,T=await(f.isRTL==null?void 0:f.isRTL(p.floating)),A=v||(E||!j?[Ah(u)]:VO(u)),_=S!=="none";!v&&_&&A.push(...HO(u,j,S,T));const M=[u,...A],L=await gx(t,C),$=[];let V=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&$.push(L[R]),g){const Z=BO(a,c,T);$.push(L[Z[0]],L[Z[1]])}if(V=[...V,{placement:a,overflows:$}],!$.every(Z=>Z<=0)){var Y,W;const Z=(((Y=o.flip)==null?void 0:Y.index)||0)+1,P=M[Z];if(P){var G;const z=g==="alignment"?D!==ni(P):!1,F=((G=V[0])==null?void 0:G.overflows[0])>0;if(!z||F)return{data:{index:Z,overflows:V},reset:{placement:P}}}let I=(W=V.filter(z=>z.overflows[0]<=0).sort((z,F)=>z.overflows[1]-F.overflows[1])[0])==null?void 0:W.placement;if(!I)switch(b){case"bestFit":{var X;const z=(X=V.filter(F=>{if(_){const O=ni(F.placement);return O===D||O==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(O=>O>0).reduce((O,U)=>O+U,0)]).sort((F,O)=>F[1]-O[1])[0])==null?void 0:X[0];z&&(I=z);break}case"initialPlacement":I=u;break}if(a!==I)return{reset:{placement:I}}}return{}}}};function DR(e){const t=Oa(...e.map(o=>o.left)),n=Oa(...e.map(o=>o.top)),r=ir(...e.map(o=>o.right)),a=ir(...e.map(o=>o.bottom));return{x:t,y:n,width:r-t,height:a-n}}function YO(e){const t=e.slice().sort((a,o)=>a.y-o.y),n=[];let r=null;for(let a=0;a<t.length;a++){const o=t[a];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(a=>lc(DR(a)))}const KO=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:a,platform:o,strategy:c}=t,{padding:u=2,x:f,y:p}=$i(e,t),m=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(r.reference))||[]),g=YO(m),v=lc(DR(m)),b=mx(u);function S(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&p!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&p>C.top-b.top&&p<C.bottom+b.bottom)||v;if(g.length>=2){if(ni(n)==="y"){const V=g[0],Y=g[g.length-1],W=Ma(n)==="top",G=V.top,X=Y.bottom,Z=W?V.left:Y.left,P=W?V.right:Y.right,I=P-Z,z=X-G;return{top:G,bottom:X,left:Z,right:P,width:I,height:z,x:Z,y:G}}const C=Ma(n)==="left",R=ir(...g.map(V=>V.right)),D=Oa(...g.map(V=>V.left)),E=g.filter(V=>C?V.left===D:V.right===R),T=E[0].top,A=E[E.length-1].bottom,_=D,M=R,L=M-_,$=A-T;return{top:T,bottom:A,left:_,right:M,width:L,height:$,x:_,y:T}}return v}const j=await o.getElementRects({reference:{getBoundingClientRect:S},floating:r.floating,strategy:c});return a.reference.x!==j.reference.x||a.reference.y!==j.reference.y||a.reference.width!==j.reference.width||a.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}};async function XO(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=Ma(n),u=Sc(n),f=ni(n)==="y",p=["left","top"].includes(c)?-1:1,m=o&&f?-1:1,g=$i(t,e);let{mainAxis:v,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),f?{x:b*m,y:v*p}:{x:v*p,y:b*m}}const ZO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:c,middlewareData:u}=t,f=await XO(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:o+f.y,data:{...f,placement:c}}}}},JO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:C=>{let{x:R,y:D}=C;return{x:R,y:D}}},...f}=$i(e,t),p={x:n,y:r},m=await gx(t,f),g=ni(Ma(a)),v=fx(g);let b=p[v],S=p[g];if(o){const C=v==="y"?"top":"left",R=v==="y"?"bottom":"right",D=b+m[C],E=b-m[R];b=my(D,b,E)}if(c){const C=g==="y"?"top":"left",R=g==="y"?"bottom":"right",D=S+m[C],E=S-m[R];S=my(D,S,E)}const j=u.fn({...t,[v]:b,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[v]:o,[g]:c}}}}}},eM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:p=!0}=$i(e,t),m={x:n,y:r},g=ni(a),v=fx(g);let b=m[v],S=m[g];const j=$i(u,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const E=v==="y"?"height":"width",T=o.reference[v]-o.floating[E]+C.mainAxis,A=o.reference[v]+o.reference[E]-C.mainAxis;b<T?b=T:b>A&&(b=A)}if(p){var R,D;const E=v==="y"?"width":"height",T=["top","left"].includes(Ma(a)),A=o.reference[g]-o.floating[E]+(T&&((R=c.offset)==null?void 0:R[g])||0)+(T?0:C.crossAxis),_=o.reference[g]+o.reference[E]+(T?0:((D=c.offset)==null?void 0:D[g])||0)-(T?C.crossAxis:0);S<A?S=A:S>_&&(S=_)}return{[v]:b,[g]:S}}}},tM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:c,elements:u}=t,{apply:f=()=>{},...p}=$i(e,t),m=await gx(t,p),g=Ma(a),v=Sc(a),b=ni(a)==="y",{width:S,height:j}=o.floating;let C,R;g==="top"||g==="bottom"?(C=g,R=v===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,C=v==="end"?"top":"bottom");const D=j-m.top-m.bottom,E=S-m.left-m.right,T=Oa(j-m[C],D),A=Oa(S-m[R],E),_=!t.middlewareData.shift;let M=T,L=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=D),_&&!v){const V=ir(m.left,0),Y=ir(m.right,0),W=ir(m.top,0),G=ir(m.bottom,0);b?L=S-2*(V!==0||Y!==0?V+Y:ir(m.left,m.right)):M=j-2*(W!==0||G!==0?W+G:ir(m.top,m.bottom))}await f({...t,availableWidth:L,availableHeight:M});const $=await c.getDimensions(u.floating);return S!==$.width||j!==$.height?{reset:{rects:!0}}:{}}}};function AR(e){const t=fa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Gr(e),o=a?e.offsetWidth:n,c=a?e.offsetHeight:r,u=Dh(n)!==o||Dh(r)!==c;return u&&(n=o,r=c),{width:n,height:r,$:u}}function vx(e){return vn(e)?e:e.contextElement}function nc(e){const t=vx(e);if(!Gr(t))return ti(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=AR(t);let c=(o?Dh(n.width):n.width)/r,u=(o?Dh(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const nM=ti(0);function _R(e){const t=Dr(e);return!cp()||!t.visualViewport?nM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function Ps(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=vx(e);let c=ti(1);t&&(r?vn(r)&&(c=nc(r)):c=nc(e));const u=rM(o,n,r)?_R(o):ti(0);let f=(a.left+u.x)/c.x,p=(a.top+u.y)/c.y,m=a.width/c.x,g=a.height/c.y;if(o){const v=Dr(o),b=r&&vn(r)?Dr(r):r;let S=v,j=hy(S);for(;j&&r&&b!==S;){const C=nc(j),R=j.getBoundingClientRect(),D=fa(j),E=R.left+(j.clientLeft+parseFloat(D.paddingLeft))*C.x,T=R.top+(j.clientTop+parseFloat(D.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=E,p+=T,S=Dr(j),j=hy(S)}}return lc({width:m,height:g,x:f,y:p})}function yx(e,t){const n=up(e).scrollLeft;return t?t.left+n:Ps(ui(e)).left+n}function kR(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:yx(e,r)),o=r.top+t.scrollTop;return{x:a,y:o}}function aM(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",c=ui(r),u=t?lp(t.floating):!1;if(r===c||u&&o)return n;let f={scrollLeft:0,scrollTop:0},p=ti(1);const m=ti(0),g=Gr(r);if((g||!g&&!o)&&((bc(r)!=="body"||dd(c))&&(f=up(r)),Gr(r))){const b=Ps(r);p=nc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const v=c&&!g&&!o?kR(c,f,!0):ti(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-f.scrollLeft*p.x+m.x+v.x,y:n.y*p.y-f.scrollTop*p.y+m.y+v.y}}function iM(e){return Array.from(e.getClientRects())}function oM(e){const t=ui(e),n=up(e),r=e.ownerDocument.body,a=ir(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ir(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+yx(e);const u=-n.scrollTop;return fa(r).direction==="rtl"&&(c+=ir(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:c,y:u}}function sM(e,t){const n=Dr(e),r=ui(e),a=n.visualViewport;let o=r.clientWidth,c=r.clientHeight,u=0,f=0;if(a){o=a.width,c=a.height;const p=cp();(!p||p&&t==="fixed")&&(u=a.offsetLeft,f=a.offsetTop)}return{width:o,height:c,x:u,y:f}}function lM(e,t){const n=Ps(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=Gr(e)?nc(e):ti(1),c=e.clientWidth*o.x,u=e.clientHeight*o.y,f=a*o.x,p=r*o.y;return{width:c,height:u,x:f,y:p}}function tC(e,t,n){let r;if(t==="viewport")r=sM(e,n);else if(t==="document")r=oM(ui(e));else if(vn(t))r=lM(t,n);else{const a=_R(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return lc(r)}function PR(e,t){const n=zi(e);return n===t||!vn(n)||zo(n)?!1:fa(n).position==="fixed"||PR(n,t)}function cM(e,t){const n=t.get(e);if(n)return n;let r=Mi(e,[],!1).filter(u=>vn(u)&&bc(u)!=="body"),a=null;const o=fa(e).position==="fixed";let c=o?zi(e):e;for(;vn(c)&&!zo(c);){const u=fa(c),f=dx(c);!f&&u.position==="fixed"&&(a=null),(o?!f&&!a:!f&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||dd(c)&&!f&&PR(e,c))?r=r.filter(m=>m!==c):a=u,c=zi(c)}return t.set(e,r),r}function uM(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const c=[...n==="clippingAncestors"?lp(t)?[]:cM(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((p,m)=>{const g=tC(t,m,a);return p.top=ir(g.top,p.top),p.right=Oa(g.right,p.right),p.bottom=Oa(g.bottom,p.bottom),p.left=ir(g.left,p.left),p},tC(t,u,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function dM(e){const{width:t,height:n}=AR(e);return{width:t,height:n}}function fM(e,t,n){const r=Gr(t),a=ui(t),o=n==="fixed",c=Ps(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=ti(0);function p(){f.x=yx(a)}if(r||!r&&!o)if((bc(t)!=="body"||dd(a))&&(u=up(t)),r){const b=Ps(t,!0,o,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else a&&p();o&&!r&&a&&p();const m=a&&!r&&!o?kR(a,u):ti(0),g=c.left+u.scrollLeft-f.x-m.x,v=c.top+u.scrollTop-f.y-m.y;return{x:g,y:v,width:c.width,height:c.height}}function Cv(e){return fa(e).position==="static"}function nC(e,t){if(!Gr(e)||fa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ui(e)===n&&(n=n.ownerDocument.body),n}function NR(e,t){const n=Dr(e);if(lp(e))return n;if(!Gr(e)){let a=zi(e);for(;a&&!zo(a);){if(vn(a)&&!Cv(a))return a;a=zi(a)}return n}let r=nC(e,t);for(;r&&AO(r)&&Cv(r);)r=nC(r,t);return r&&zo(r)&&Cv(r)&&!dx(r)?n:r||_O(e)||n}const hM=async function(e){const t=this.getOffsetParent||NR,n=this.getDimensions,r=await n(e.floating);return{reference:fM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pM(e){return fa(e).direction==="rtl"}const mM={convertOffsetParentRelativeRectToViewportRelativeRect:aM,getDocumentElement:ui,getClippingRect:uM,getOffsetParent:NR,getElementRects:hM,getClientRects:iM,getDimensions:dM,getScale:nc,isElement:vn,isRTL:pM};function OR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gM(e,t){let n=null,r;const a=ui(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const p=e.getBoundingClientRect(),{left:m,top:g,width:v,height:b}=p;if(u||t(),!v||!b)return;const S=nh(g),j=nh(a.clientWidth-(m+v)),C=nh(a.clientHeight-(g+b)),R=nh(m),E={rootMargin:-S+"px "+-j+"px "+-C+"px "+-R+"px",threshold:ir(0,Oa(1,f))||1};let T=!0;function A(_){const M=_[0].intersectionRatio;if(M!==f){if(!T)return c();M?c(!1,M):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!OR(p,e.getBoundingClientRect())&&c(),T=!1}try{n=new IntersectionObserver(A,{...E,root:a.ownerDocument})}catch{n=new IntersectionObserver(A,E)}n.observe(e)}return c(!0),o}function vM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=vx(e),m=a||o?[...p?Mi(p):[],...Mi(t)]:[];m.forEach(R=>{a&&R.addEventListener("scroll",n,{passive:!0}),o&&R.addEventListener("resize",n)});const g=p&&u?gM(p,n):null;let v=-1,b=null;c&&(b=new ResizeObserver(R=>{let[D]=R;D&&D.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var E;(E=b)==null||E.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let S,j=f?Ps(e):null;f&&C();function C(){const R=Ps(e);j&&!OR(j,R)&&n(),j=R,S=requestAnimationFrame(C)}return n(),()=>{var R;m.forEach(D=>{a&&D.removeEventListener("scroll",n),o&&D.removeEventListener("resize",n)}),g==null||g(),(R=b)==null||R.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const yM=ZO,xM=JO,bM=WO,SM=tM,rC=QO,wM=KO,jM=eM,CM=(e,t,n)=>{const r=new Map,a={platform:mM,...n},o={...a.platform,_c:r};return GO(e,t,{...a,platform:o})};var mh=typeof document<"u"?y.useLayoutEffect:y.useEffect;function _h(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_h(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!_h(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function MR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function aC(e,t){const n=MR(e);return Math.round(t*n)/n}function Ev(e){const t=y.useRef(e);return mh(()=>{t.current=e}),t}function EM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:c}={},transform:u=!0,whileElementsMounted:f,open:p}=e,[m,g]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=y.useState(r);_h(v,r)||b(r);const[S,j]=y.useState(null),[C,R]=y.useState(null),D=y.useCallback(z=>{z!==_.current&&(_.current=z,j(z))},[]),E=y.useCallback(z=>{z!==M.current&&(M.current=z,R(z))},[]),T=o||S,A=c||C,_=y.useRef(null),M=y.useRef(null),L=y.useRef(m),$=f!=null,V=Ev(f),Y=Ev(a),W=Ev(p),G=y.useCallback(()=>{if(!_.current||!M.current)return;const z={placement:t,strategy:n,middleware:v};Y.current&&(z.platform=Y.current),CM(_.current,M.current,z).then(F=>{const O={...F,isPositioned:W.current!==!1};X.current&&!_h(L.current,O)&&(L.current=O,ux.flushSync(()=>{g(O)}))})},[v,t,n,Y,W]);mh(()=>{p===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,g(z=>({...z,isPositioned:!1})))},[p]);const X=y.useRef(!1);mh(()=>(X.current=!0,()=>{X.current=!1}),[]),mh(()=>{if(T&&(_.current=T),A&&(M.current=A),T&&A){if(V.current)return V.current(T,A,G);G()}},[T,A,G,V,$]);const Z=y.useMemo(()=>({reference:_,floating:M,setReference:D,setFloating:E}),[D,E]),P=y.useMemo(()=>({reference:T,floating:A}),[T,A]),I=y.useMemo(()=>{const z={position:n,left:0,top:0};if(!P.floating)return z;const F=aC(P.floating,m.x),O=aC(P.floating,m.y);return u?{...z,transform:"translate("+F+"px, "+O+"px)",...MR(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:O}},[n,u,P.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:G,refs:Z,elements:P,floatingStyles:I}),[m,G,Z,P,I])}const TM=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?rC({element:r.current,padding:a}).fn(n):{}:r?rC({element:r,padding:a}).fn(n):{}}}},IR=(e,t)=>({...yM(e),options:[e,t]}),xx=(e,t)=>({...xM(e),options:[e,t]}),iC=(e,t)=>({...jM(e),options:[e,t]}),kh=(e,t)=>({...bM(e),options:[e,t]}),RM=(e,t)=>({...SM(e),options:[e,t]}),qu=(e,t)=>({...wM(e),options:[e,t]}),LR=(e,t)=>({...TM(e),options:[e,t]});function DM(e){return y.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const zR={...n3},AM=zR.useInsertionEffect,_M=AM||(e=>e());function Oi(e){const t=y.useRef(()=>{});return _M(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}var ri=typeof document<"u"?y.useLayoutEffect:y.useEffect;let oC=!1,kM=0;const sC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+kM++;function PM(){const[e,t]=y.useState(()=>oC?sC():void 0);return ri(()=>{e==null&&t(sC())},[]),y.useEffect(()=>{oC=!0},[]),e}const NM=zR.useId,$R=NM||PM;function OM(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(a=>a!==n))||[])}}}const MM=y.createContext(null),IM=y.createContext(null),bx=()=>{var e;return((e=y.useContext(MM))==null?void 0:e.id)||null},Sx=()=>y.useContext(IM);function wx(e){return"data-floating-ui-"+e}function Tv(e){const t=y.useRef(e);return ri(()=>{t.current=e}),t}const lC=wx("safe-polygon");function gh(e,t,n){return n&&!py(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function LM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,events:o,elements:c}=e,{enabled:u=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:v=!0}=t,b=Sx(),S=bx(),j=Tv(p),C=Tv(f),R=Tv(n),D=y.useRef(),E=y.useRef(-1),T=y.useRef(),A=y.useRef(-1),_=y.useRef(!0),M=y.useRef(!1),L=y.useRef(()=>{}),$=y.useRef(!1),V=y.useCallback(()=>{var I;const z=(I=a.current.openEvent)==null?void 0:I.type;return(z==null?void 0:z.includes("mouse"))&&z!=="mousedown"},[a]);y.useEffect(()=>{if(!u)return;function I(z){let{open:F}=z;F||(clearTimeout(E.current),clearTimeout(A.current),_.current=!0,$.current=!1)}return o.on("openchange",I),()=>{o.off("openchange",I)}},[u,o]),y.useEffect(()=>{if(!u||!j.current||!n)return;function I(F){V()&&r(!1,F,"hover")}const z=Es(c.floating).documentElement;return z.addEventListener("mouseleave",I),()=>{z.removeEventListener("mouseleave",I)}},[c.floating,n,r,u,j,V]);const Y=y.useCallback(function(I,z,F){z===void 0&&(z=!0),F===void 0&&(F="hover");const O=gh(C.current,"close",D.current);O&&!T.current?(clearTimeout(E.current),E.current=window.setTimeout(()=>r(!1,I,F),O)):z&&(clearTimeout(E.current),r(!1,I,F))},[C,r]),W=Oi(()=>{L.current(),T.current=void 0}),G=Oi(()=>{if(M.current){const I=Es(c.floating).body;I.style.pointerEvents="",I.removeAttribute(lC),M.current=!1}}),X=Oi(()=>a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1);y.useEffect(()=>{if(!u)return;function I(U){if(clearTimeout(E.current),_.current=!1,m&&!py(D.current)||g>0&&!gh(C.current,"open"))return;const J=gh(C.current,"open",D.current);J?E.current=window.setTimeout(()=>{R.current||r(!0,U,"hover")},J):n||r(!0,U,"hover")}function z(U){if(X())return;L.current();const J=Es(c.floating);if(clearTimeout(A.current),$.current=!1,j.current&&a.current.floatingContext){n||clearTimeout(E.current),T.current=j.current({...a.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){G(),W(),X()||Y(U,!0,"safe-polygon")}});const ye=T.current;J.addEventListener("mousemove",ye),L.current=()=>{J.removeEventListener("mousemove",ye)};return}(D.current==="touch"?!Xu(c.floating,U.relatedTarget):!0)&&Y(U)}function F(U){X()||a.current.floatingContext&&(j.current==null||j.current({...a.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){G(),W(),X()||Y(U)}})(U))}if(vn(c.domReference)){var O;const U=c.domReference;return n&&U.addEventListener("mouseleave",F),(O=c.floating)==null||O.addEventListener("mouseleave",F),v&&U.addEventListener("mousemove",I,{once:!0}),U.addEventListener("mouseenter",I),U.addEventListener("mouseleave",z),()=>{var J;n&&U.removeEventListener("mouseleave",F),(J=c.floating)==null||J.removeEventListener("mouseleave",F),v&&U.removeEventListener("mousemove",I),U.removeEventListener("mouseenter",I),U.removeEventListener("mouseleave",z)}}},[c,u,e,m,g,v,Y,W,G,r,n,R,b,C,j,a,X]),ri(()=>{var I;if(u&&n&&(I=j.current)!=null&&I.__options.blockPointerEvents&&V()){M.current=!0;const F=c.floating;if(vn(c.domReference)&&F){var z;const O=Es(c.floating).body;O.setAttribute(lC,"");const U=c.domReference,J=b==null||(z=b.nodesRef.current.find(te=>te.id===S))==null||(z=z.context)==null?void 0:z.elements.floating;return J&&(J.style.pointerEvents=""),O.style.pointerEvents="none",U.style.pointerEvents="auto",F.style.pointerEvents="auto",()=>{O.style.pointerEvents="",U.style.pointerEvents="",F.style.pointerEvents=""}}}},[u,n,S,c,b,j,V]),ri(()=>{n||(D.current=void 0,$.current=!1,W(),G())},[n,W,G]),y.useEffect(()=>()=>{W(),clearTimeout(E.current),clearTimeout(A.current),G()},[u,c.domReference,W,G]);const Z=y.useMemo(()=>{function I(z){D.current=z.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(z){const{nativeEvent:F}=z;function O(){!_.current&&!R.current&&r(!0,F,"hover")}m&&!py(D.current)||n||g===0||$.current&&z.movementX**2+z.movementY**2<2||(clearTimeout(A.current),D.current==="touch"?O():($.current=!0,A.current=window.setTimeout(O,g)))}}},[m,r,n,R,g]),P=y.useMemo(()=>({onMouseEnter(){clearTimeout(E.current)},onMouseLeave(I){X()||Y(I.nativeEvent,!1)}}),[Y,X]);return y.useMemo(()=>u?{reference:Z,floating:P}:{},[u,Z,P])}const vy=()=>{},UR=y.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:vy,setState:vy,isInstantPhase:!1}),zM=()=>y.useContext(UR);function $M(e){const{children:t,delay:n,timeoutMs:r=0}=e,[a,o]=y.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=y.useRef(null),u=y.useCallback(f=>{o({currentId:f})},[]);return ri(()=>{a.currentId?c.current===null?c.current=a.currentId:a.isInstantPhase||o({isInstantPhase:!0}):(a.isInstantPhase&&o({isInstantPhase:!1}),c.current=null)},[a.currentId,a.isInstantPhase]),y.createElement(UR.Provider,{value:y.useMemo(()=>({...a,setState:o,setCurrentId:u}),[a,u])},t)}function UM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:a}=e,{id:o,enabled:c=!0}=t,u=o??a,f=zM(),{currentId:p,setCurrentId:m,initialDelay:g,setState:v,timeoutMs:b}=f;return ri(()=>{c&&p&&(v({delay:{open:1,close:gh(g,"close")}}),p!==u&&r(!1))},[c,u,r,v,p,g]),ri(()=>{function S(){r(!1),v({delay:g,currentId:null})}if(c&&p&&!n&&p===u){if(b){const j=window.setTimeout(S,b);return()=>{clearTimeout(j)}}S()}},[c,n,v,p,u,r,g,b]),ri(()=>{c&&(m===vy||!n||m(u))},[c,n,m,u]),f}function Rv(e,t){let n=e.filter(a=>{var o;return a.parentId===t&&((o=a.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(a=>{var o;return(o=r)==null?void 0:o.some(c=>{var u;return a.parentId===c.id&&((u=a.context)==null?void 0:u.open)})}),n=n.concat(r);return n}const BM="data-floating-ui-focusable",VM={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},FM={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},cC=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function HM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:a,dataRef:o}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:b,capture:S}=t,j=Sx(),C=Oi(typeof f=="function"?f:()=>!1),R=typeof f=="function"?C:f,D=y.useRef(!1),E=y.useRef(!1),{escapeKey:T,outsidePress:A}=cC(b),{escapeKey:_,outsidePress:M}=cC(S),L=y.useRef(!1),$=Oi(Z=>{var P;if(!n||!c||!u||Z.key!=="Escape"||L.current)return;const I=(P=o.current.floatingContext)==null?void 0:P.nodeId,z=j?Rv(j.nodesRef.current,I):[];if(!T&&(Z.stopPropagation(),z.length>0)){let F=!0;if(z.forEach(O=>{var U;if((U=O.context)!=null&&U.open&&!O.context.dataRef.current.__escapeKeyBubbles){F=!1;return}}),!F)return}r(!1,MO(Z)?Z.nativeEvent:Z,"escape-key")}),V=Oi(Z=>{var P;const I=()=>{var z;$(Z),(z=Kl(Z))==null||z.removeEventListener("keydown",I)};(P=Kl(Z))==null||P.addEventListener("keydown",I)}),Y=Oi(Z=>{var P;const I=D.current;D.current=!1;const z=E.current;if(E.current=!1,p==="click"&&z||I||typeof R=="function"&&!R(Z))return;const F=Kl(Z),O="["+wx("inert")+"]",U=Es(a.floating).querySelectorAll(O);let J=vn(F)?F:null;for(;J&&!zo(J);){const ve=zi(J);if(zo(ve)||!vn(ve))break;J=ve}if(U.length&&vn(F)&&!IO(F)&&!Xu(F,a.floating)&&Array.from(U).every(ve=>!Xu(J,ve)))return;if(Gr(F)&&X){const ve=F.clientWidth>0&&F.scrollWidth>F.clientWidth,Ge=F.clientHeight>0&&F.scrollHeight>F.clientHeight;let ke=Ge&&Z.offsetX>F.clientWidth;if(Ge&&fa(F).direction==="rtl"&&(ke=Z.offsetX<=F.offsetWidth-F.clientWidth),ke||ve&&Z.offsetY>F.clientHeight)return}const te=(P=o.current.floatingContext)==null?void 0:P.nodeId,ye=j&&Rv(j.nodesRef.current,te).some(ve=>{var Ge;return jv(Z,(Ge=ve.context)==null?void 0:Ge.elements.floating)});if(jv(Z,a.floating)||jv(Z,a.domReference)||ye)return;const be=j?Rv(j.nodesRef.current,te):[];if(be.length>0){let ve=!0;if(be.forEach(Ge=>{var ke;if((ke=Ge.context)!=null&&ke.open&&!Ge.context.dataRef.current.__outsidePressBubbles){ve=!1;return}}),!ve)return}r(!1,Z,"outside-press")}),W=Oi(Z=>{var P;const I=()=>{var z;Y(Z),(z=Kl(Z))==null||z.removeEventListener(p,I)};(P=Kl(Z))==null||P.addEventListener(p,I)});y.useEffect(()=>{if(!n||!c)return;o.current.__escapeKeyBubbles=T,o.current.__outsidePressBubbles=A;let Z=-1;function P(U){r(!1,U,"ancestor-scroll")}function I(){window.clearTimeout(Z),L.current=!0}function z(){Z=window.setTimeout(()=>{L.current=!1},cp()?5:0)}const F=Es(a.floating);u&&(F.addEventListener("keydown",_?V:$,_),F.addEventListener("compositionstart",I),F.addEventListener("compositionend",z)),R&&F.addEventListener(p,M?W:Y,M);let O=[];return v&&(vn(a.domReference)&&(O=Mi(a.domReference)),vn(a.floating)&&(O=O.concat(Mi(a.floating))),!vn(a.reference)&&a.reference&&a.reference.contextElement&&(O=O.concat(Mi(a.reference.contextElement)))),O=O.filter(U=>{var J;return U!==((J=F.defaultView)==null?void 0:J.visualViewport)}),O.forEach(U=>{U.addEventListener("scroll",P,{passive:!0})}),()=>{u&&(F.removeEventListener("keydown",_?V:$,_),F.removeEventListener("compositionstart",I),F.removeEventListener("compositionend",z)),R&&F.removeEventListener(p,M?W:Y,M),O.forEach(U=>{U.removeEventListener("scroll",P)}),window.clearTimeout(Z)}},[o,a,u,R,p,n,r,v,c,T,A,$,_,V,Y,M,W]),y.useEffect(()=>{D.current=!1},[R,p]);const G=y.useMemo(()=>({onKeyDown:$,[VM[g]]:Z=>{m&&r(!1,Z.nativeEvent,"reference-press")}}),[$,r,m,g]),X=y.useMemo(()=>({onKeyDown:$,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[FM[p]]:()=>{D.current=!0}}),[$,p]);return y.useMemo(()=>c?{reference:G,floating:X}:{},[c,G,X])}function qM(e){const{open:t=!1,onOpenChange:n,elements:r}=e,a=$R(),o=y.useRef({}),[c]=y.useState(()=>OM()),u=bx()!=null,[f,p]=y.useState(r.reference),m=Oi((b,S,j)=>{o.current.openEvent=b?S:void 0,c.emit("openchange",{open:b,event:S,reason:j,nested:u}),n==null||n(b,S,j)}),g=y.useMemo(()=>({setPositionReference:p}),[]),v=y.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return y.useMemo(()=>({dataRef:o,open:t,onOpenChange:m,elements:v,events:c,floatingId:a,refs:g}),[t,m,v,c,a,g])}function jx(e){e===void 0&&(e={});const{nodeId:t}=e,n=qM({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,a=r.elements,[o,c]=y.useState(null),[u,f]=y.useState(null),m=(a==null?void 0:a.domReference)||o,g=y.useRef(null),v=Sx();ri(()=>{m&&(g.current=m)},[m]);const b=EM({...e,elements:{...a,...u&&{reference:u}}}),S=y.useCallback(E=>{const T=vn(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),contextElement:E}:E;f(T),b.refs.setReference(T)},[b.refs]),j=y.useCallback(E=>{(vn(E)||E===null)&&(g.current=E,c(E)),(vn(b.refs.reference.current)||b.refs.reference.current===null||E!==null&&!vn(E))&&b.refs.setReference(E)},[b.refs]),C=y.useMemo(()=>({...b.refs,setReference:j,setPositionReference:S,domReference:g}),[b.refs,j,S]),R=y.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),D=y.useMemo(()=>({...b,...r,refs:C,elements:R,nodeId:t}),[b,C,R,t,r]);return ri(()=>{r.dataRef.current.floatingContext=D;const E=v==null?void 0:v.nodesRef.current.find(T=>T.id===t);E&&(E.context=D)}),y.useMemo(()=>({...b,context:D,refs:C,elements:R}),[b,C,R,D])}function GM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:a,dataRef:o,elements:c}=e,{enabled:u=!0,visibleOnly:f=!0}=t,p=y.useRef(!1),m=y.useRef(),g=y.useRef(!0);y.useEffect(()=>{if(!u)return;const b=Dr(c.domReference);function S(){!n&&Gr(c.domReference)&&c.domReference===Zj(Es(c.domReference))&&(p.current=!0)}function j(){g.current=!0}return b.addEventListener("blur",S),b.addEventListener("keydown",j,!0),()=>{b.removeEventListener("blur",S),b.removeEventListener("keydown",j,!0)}},[c.domReference,n,u]),y.useEffect(()=>{if(!u)return;function b(S){let{reason:j}=S;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,u]),y.useEffect(()=>()=>{clearTimeout(m.current)},[]);const v=y.useMemo(()=>({onPointerDown(b){kO(b.nativeEvent)||(g.current=!1)},onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const S=Kl(b.nativeEvent);if(f&&vn(S))try{if(PO()&&NO())throw Error();if(!S.matches(":focus-visible"))return}catch{if(!g.current&&!zO(S))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const S=b.relatedTarget,j=b.nativeEvent,C=vn(S)&&S.hasAttribute(wx("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var R;const D=Zj(c.domReference?c.domReference.ownerDocument:document);!S&&D===c.domReference||Xu((R=o.current.floatingContext)==null?void 0:R.refs.floating.current,D)||Xu(c.domReference,D)||C||r(!1,j,"focus")})}}),[o,c.domReference,r,f]);return y.useMemo(()=>u?{reference:v}:{},[u,v])}const uC="active",dC="selected";function Dv(e,t,n){const r=new Map,a=n==="item";let o=e;if(a&&e){const{[uC]:c,[dC]:u,...f}=e;o=f}return{...n==="floating"&&{tabIndex:-1,[BM]:""},...o,...t.map(c=>{const u=c?c[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((c,u)=>(u&&Object.entries(u).forEach(f=>{let[p,m]=f;if(!(a&&[uC,dC].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof m=="function"){var g;(g=r.get(p))==null||g.push(m),c[p]=function(){for(var v,b=arguments.length,S=new Array(b),j=0;j<b;j++)S[j]=arguments[j];return(v=r.get(p))==null?void 0:v.map(C=>C(...S)).find(C=>C!==void 0)}}}else c[p]=m}),c),{})}}function QM(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),a=y.useCallback(u=>Dv(u,e,"reference"),t),o=y.useCallback(u=>Dv(u,e,"floating"),n),c=y.useCallback(u=>Dv(u,e,"item"),r);return y.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:c}),[a,o,c])}const WM=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function YM(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:a}=e,{enabled:o=!0,role:c="dialog"}=t,u=(n=WM.get(c))!=null?n:c,f=$R(),m=bx()!=null,g=y.useMemo(()=>u==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?a:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":r?a:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:f},...u==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[u,a,m,r,f,c]),v=y.useMemo(()=>{const S={id:a,...u&&{role:u}};return u==="tooltip"||c==="label"?S:{...S,...u==="menu"&&{"aria-labelledby":f}}},[u,a,f,c]),b=y.useCallback(S=>{let{active:j,selected:C}=S;const R={role:"option",...j&&{id:a+"-option"}};switch(c){case"select":return{...R,"aria-selected":j&&C};case"combobox":return{...R,...j&&{"aria-selected":!0}}}return{}},[a,c]);return y.useMemo(()=>o?{reference:g,floating:v,item:b}:{},[o,g,v,b])}const[KM,ga]=vr("ScrollArea.Root component was not found in tree");function cc(e,t){const n=Ss(t);xc(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}const XM=y.forwardRef((e,t)=>{const{style:n,...r}=e,a=ga(),[o,c]=y.useState(0),[u,f]=y.useState(0),p=!!(o&&u);return cc(a.scrollbarX,()=>{var g;const m=((g=a.scrollbarX)==null?void 0:g.offsetHeight)||0;a.onCornerHeightChange(m),f(m)}),cc(a.scrollbarY,()=>{var g;const m=((g=a.scrollbarY)==null?void 0:g.offsetWidth)||0;a.onCornerWidthChange(m),c(m)}),p?s.jsx("div",{...r,ref:t,style:{...n,width:o,height:u}}):null}),ZM=y.forwardRef((e,t)=>{const n=ga(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(XM,{...e,ref:t}):null}),JM={scrollHideDelay:1e3,type:"hover"},BR=y.forwardRef((e,t)=>{const n=se("ScrollAreaRoot",JM,e),{type:r,scrollHideDelay:a,scrollbars:o,...c}=n,[u,f]=y.useState(null),[p,m]=y.useState(null),[g,v]=y.useState(null),[b,S]=y.useState(null),[j,C]=y.useState(null),[R,D]=y.useState(0),[E,T]=y.useState(0),[A,_]=y.useState(!1),[M,L]=y.useState(!1),$=$n(t,V=>f(V));return s.jsx(KM,{value:{type:r,scrollHideDelay:a,scrollArea:u,viewport:p,onViewportChange:m,content:g,onContentChange:v,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:A,onScrollbarXEnabledChange:_,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:M,onScrollbarYEnabledChange:L,onCornerWidthChange:D,onCornerHeightChange:T},children:s.jsx(ce,{...c,ref:$,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${R}px`,"--sa-corner-height":o!=="xy"?"0px":`${E}px`}})})});BR.displayName="@mantine/core/ScrollAreaRoot";function VR(e,t){const n=e/t;return Number.isNaN(n)?0:n}function dp(e){const t=VR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function FR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function e9(e,[t,n]){return Math.min(n,Math.max(t,e))}function fC(e,t,n="ltr"){const r=dp(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,c=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,c]:[c*-1,0],p=e9(e,f);return FR([0,c],[0,u])(p)}function t9(e,t,n,r="ltr"){const a=dp(n),o=a/2,c=t||o,u=a-c,f=n.scrollbar.paddingStart+c,p=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return FR([f,p],g)(e)}function HR(e,t){return e>0&&e<t}function Lo(e){return e?parseInt(e,10):0}function ks(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[n9,qR]=vr("ScrollAreaScrollbar was not found in tree"),GR=y.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,v=ga(),[b,S]=y.useState(null),j=$n(t,L=>S(L)),C=y.useRef(null),R=y.useRef(""),{viewport:D}=v,E=n.content-n.viewport,T=Ss(p),A=Ss(u),_=np(m,10),M=L=>{if(C.current){const $=L.clientX-C.current.left,V=L.clientY-C.current.top;f({x:$,y:V})}};return y.useEffect(()=>{const L=$=>{const V=$.target;(b==null?void 0:b.contains(V))&&T($,E)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[D,b,E,T]),y.useEffect(A,[n,A]),cc(b,_),cc(v.content,_),s.jsx(n9,{value:{scrollbar:b,hasThumb:r,onThumbChange:Ss(a),onThumbPointerUp:Ss(o),onThumbPositionChange:A,onThumbPointerDown:Ss(c)},children:s.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:ks(e.onPointerDown,L=>{L.preventDefault(),L.button===0&&(L.target.setPointerCapture(L.pointerId),C.current=b.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(L))}),onPointerMove:ks(e.onPointerMove,M),onPointerUp:ks(e.onPointerUp,L=>{const $=L.target;$.hasPointerCapture(L.pointerId)&&(L.preventDefault(),$.releasePointerCapture(L.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=R.current,C.current=null}})})}),QR=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:a,...o}=e,c=ga(),[u,f]=y.useState(),p=y.useRef(null),m=$n(t,p,c.onScrollbarXChange);return y.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),s.jsx(GR,{"data-orientation":"horizontal",...o,ref:m,sizes:n,style:{...a,"--sa-thumb-width":`${dp(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(c.viewport){const b=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),HR(b,v)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&u&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:Lo(u.paddingLeft),paddingEnd:Lo(u.paddingRight)}})}})});QR.displayName="@mantine/core/ScrollAreaScrollbarX";const WR=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:a,...o}=e,c=ga(),[u,f]=y.useState(),p=y.useRef(null),m=$n(t,p,c.onScrollbarYChange);return y.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),s.jsx(GR,{...o,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${dp(n)}px`,...a},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(c.viewport){const b=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),HR(b,v)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&u&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:Lo(u.paddingTop),paddingEnd:Lo(u.paddingBottom)}})}})});WR.displayName="@mantine/core/ScrollAreaScrollbarY";const fp=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:a}=Qs(),o=ga(),c=y.useRef(null),u=y.useRef(0),[f,p]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=VR(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:b=>{u.current=b}},v=(b,S)=>t9(b,u.current,f,S);return n==="horizontal"?s.jsx(QR,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollLeft,S=fC(b,f,a);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollLeft=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollLeft=v(b,a))}}):n==="vertical"?s.jsx(WR,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollTop,S=fC(b,f);f.scrollbar.size===0?c.current.style.setProperty("--thumb-opacity","0"):c.current.style.setProperty("--thumb-opacity","1"),c.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollTop=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollTop=v(b))}}):null});fp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Cx=y.forwardRef((e,t)=>{const n=ga(),{forceMount:r,...a}=e,[o,c]=y.useState(!1),u=e.orientation==="horizontal",f=np(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(u?p:m)}},10);return cc(n.viewport,f),cc(n.content,f),r||o?s.jsx(fp,{"data-state":o?"visible":"hidden",...a,ref:t}):null});Cx.displayName="@mantine/core/ScrollAreaScrollbarAuto";const YR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ga(),[o,c]=y.useState(!1);return y.useEffect(()=>{const{scrollArea:u}=a;let f=0;if(u){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",p),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",p),u.removeEventListener("pointerleave",m)}}},[a.scrollArea,a.scrollHideDelay]),n||o?s.jsx(Cx,{"data-state":o?"visible":"hidden",...r,ref:t}):null});YR.displayName="@mantine/core/ScrollAreaScrollbarHover";const r9=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ga(),o=e.orientation==="horizontal",[c,u]=y.useState("hidden"),f=np(()=>u("idle"),100);return y.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>u("hidden"),a.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,a.scrollHideDelay]),y.useEffect(()=>{const{viewport:p}=a,m=o?"scrollLeft":"scrollTop";if(p){let g=p[m];const v=()=>{const b=p[m];g!==b&&(u("scrolling"),f()),g=b};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[a.viewport,o,f]),n||c!=="hidden"?s.jsx(fp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ks(e.onPointerEnter,()=>u("interacting")),onPointerLeave:ks(e.onPointerLeave,()=>u("idle"))}):null}),yy=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ga(),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=a,u=e.orientation==="horizontal";return y.useEffect(()=>(u?o(!0):c(!0),()=>{u?o(!1):c(!1)}),[u,o,c]),a.type==="hover"?s.jsx(YR,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(r9,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(Cx,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(fp,{...r,ref:t}):null});yy.displayName="@mantine/core/ScrollAreaScrollbar";function a9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},c=n.left!==o.left,u=n.top!==o.top;(c||u)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)}const KR=y.forwardRef((e,t)=>{const{style:n,...r}=e,a=ga(),o=qR(),{onThumbPositionChange:c}=o,u=$n(t,m=>o.onThumbChange(m)),f=y.useRef(void 0),p=np(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const{viewport:m}=a;if(m){const g=()=>{if(p(),!f.current){const v=a9(m,c);f.current=v,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[a.viewport,p,c]),s.jsx("div",{"data-state":o.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:ks(e.onPointerDownCapture,m=>{const v=m.target.getBoundingClientRect(),b=m.clientX-v.left,S=m.clientY-v.top;o.onThumbPointerDown({x:b,y:S})}),onPointerUp:ks(e.onPointerUp,o.onThumbPointerUp)})});KR.displayName="@mantine/core/ScrollAreaThumb";const xy=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=qR();return n||a.hasThumb?s.jsx(KR,{ref:t,...r}):null});xy.displayName="@mantine/core/ScrollAreaThumb";const XR=y.forwardRef(({children:e,style:t,...n},r)=>{const a=ga(),o=$n(r,a.onViewportChange);return s.jsx(ce,{...n,ref:o,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t},children:s.jsx("div",{style:{minWidth:"100%"},ref:a.onContentChange,children:e})})});XR.displayName="@mantine/core/ScrollAreaViewport";var Ex={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const ZR={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},i9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Yr=me((e,t)=>{const n=se("ScrollArea",ZR,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:v,viewportRef:b,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:R,onBottomReached:D,onTopReached:E,overscrollBehavior:T,...A}=n,[_,M]=y.useState(!1),[L,$]=y.useState(!1),[V,Y]=y.useState(!1),W=Me({name:"ScrollArea",props:n,classes:Ex,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:i9}),G=y.useRef(null),X=DM([b,G]);return y.useEffect(()=>{if(!G.current||C!=="present")return;const Z=G.current,P=new ResizeObserver(()=>{const{scrollHeight:I,clientHeight:z,scrollWidth:F,clientWidth:O}=Z;$(I>z),Y(F>O)});return P.observe(Z),()=>P.disconnect()},[G,C]),s.jsxs(BR,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:R,...W("root"),...A,children:[s.jsx(XR,{...v,...W("viewport",{style:v==null?void 0:v.style}),ref:X,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":R||void 0,"data-horizontal-hidden":C==="present"&&!V?"true":void 0,"data-vertical-hidden":C==="present"&&!L?"true":void 0,onScroll:Z=>{var F;(F=v==null?void 0:v.onScroll)==null||F.call(v,Z),S==null||S({x:Z.currentTarget.scrollLeft,y:Z.currentTarget.scrollTop});const{scrollTop:P,scrollHeight:I,clientHeight:z}=Z.currentTarget;P-(I-z)>=0&&(D==null||D()),P===0&&(E==null||E())},children:j}),(R==="xy"||R==="x")&&s.jsx(yy,{...W("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!V?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(xy,{...W("thumb")})}),(R==="xy"||R==="y")&&s.jsx(yy,{...W("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(xy,{...W("thumb")})}),s.jsx(ZM,{...W("corner"),"data-hovered":_||void 0,"data-hidden":m==="never"||void 0})]})});Yr.displayName="@mantine/core/ScrollArea";const hp=me((e,t)=>{const{children:n,classNames:r,styles:a,scrollbarSize:o,scrollHideDelay:c,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:v,variant:b,viewportProps:S,scrollbars:j,style:C,vars:R,onBottomReached:D,onTopReached:E,...T}=se("ScrollAreaAutosize",ZR,e);return s.jsx(ce,{...T,ref:t,style:[{display:"flex",overflow:"auto"},C],children:s.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(Yr,{classNames:r,styles:a,scrollHideDelay:c,scrollbarSize:o,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:v,variant:b,viewportProps:S,vars:R,scrollbars:j,onBottomReached:D,onTopReached:E,children:n})})})});Yr.classes=Ex;hp.displayName="@mantine/core/ScrollAreaAutosize";hp.classes=Ex;Yr.Autosize=hp;var JR={root:"m_87cf2631"};const o9={__staticSelector:"UnstyledButton"},tr=lr((e,t)=>{const n=se("UnstyledButton",o9,e),{className:r,component:a="button",__staticSelector:o,unstyled:c,classNames:u,styles:f,style:p,...m}=n,g=Me({name:o,props:n,classes:JR,className:r,style:p,classNames:u,styles:f,unstyled:c});return s.jsx(ce,{...g("root",{focusable:!0}),component:a,ref:t,type:a==="button"?"button":void 0,...m})});tr.classes=JR;tr.displayName="@mantine/core/UnstyledButton";var e2={root:"m_515a97f8"};const s9={},Tx=me((e,t)=>{const n=se("VisuallyHidden",s9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,...p}=n,m=Me({name:"VisuallyHidden",classes:e2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u});return s.jsx(ce,{component:"span",ref:t,...m("root"),...p})});Tx.classes=e2;Tx.displayName="@mantine/core/VisuallyHidden";var t2={root:"m_1b7284a3"};const l9={},c9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Ft(t),"--paper-shadow":nx(n)}}),mr=lr((e,t)=>{const n=se("Paper",l9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,withBorder:f,vars:p,radius:m,shadow:g,variant:v,mod:b,...S}=n,j=Me({name:"Paper",props:n,classes:t2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:c9});return s.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...j("root"),variant:v,...S})});mr.classes=t2;mr.displayName="@mantine/core/Paper";function n2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),a=n==="right"?"left":"right";return r===void 0?a:`${a}-${r}`}return t}function hC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function pC(e,t,n,r,a){return e==="center"||r==="center"?{left:t}:e==="end"?{[a==="ltr"?"right":"left"]:n}:e==="start"?{[a==="ltr"?"left":"right"]:n}:{}}const u9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function d9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:a,arrowX:o,arrowY:c,dir:u}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[u9[f]]:r},g=-t/2;return f==="left"?{...m,...hC(p,c,n,a),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...hC(p,c,n,a),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...pC(p,o,n,a,u),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...pC(p,o,n,a,u),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Rx=y.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:a,visible:o,arrowX:c,arrowY:u,style:f,...p},m)=>{const{dir:g}=Qs();return o?s.jsx("div",{...p,ref:m,style:{...f,...d9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:a,dir:g,arrowX:c,arrowY:u})}}):null});Rx.displayName="@mantine/core/FloatingArrow";var r2={root:"m_9814e45f"};const f9={zIndex:Wr("modal")},h9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:a,radius:o,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&sa(n||"#000",r??.6)||void 0,"--overlay-filter":a?`blur(${le(a)})`:void 0,"--overlay-radius":o===void 0?void 0:Ft(o),"--overlay-z-index":c==null?void 0:c.toString()}}),uc=lr((e,t)=>{const n=se("Overlay",f9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,fixed:p,center:m,children:g,radius:v,zIndex:b,gradient:S,blur:j,color:C,backgroundOpacity:R,mod:D,...E}=n,T=Me({name:"Overlay",props:n,classes:r2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:h9});return s.jsx(ce,{ref:t,...T("root"),mod:[{center:m,fixed:p},D],...E,children:g})});uc.classes=r2;uc.displayName="@mantine/core/Overlay";function Av(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),typeof e.className=="string"&&t.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(t.style,e.style),typeof e.id=="string"&&t.setAttribute("id",e.id),t}function p9({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Av(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const a=Av(n);return a.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(a),a}return Av(n)}const m9={},a2=me((e,t)=>{const{children:n,target:r,reuseTargetNode:a,...o}=se("Portal",m9,e),[c,u]=y.useState(!1),f=y.useRef(null);return xc(()=>(u(!0),f.current=p9({target:r,reuseTargetNode:a,...o}),Yu(t,f.current),!r&&!a&&f.current&&document.body.appendChild(f.current),()=>{!r&&!a&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:ux.createPortal(s.jsx(s.Fragment,{children:n}),f.current)});a2.displayName="@mantine/core/Portal";const Ho=me(({withinPortal:e=!0,children:t,...n},r)=>fR()==="test"||!e?s.jsx(s.Fragment,{children:t}):s.jsx(a2,{ref:r,...n,children:t}));Ho.displayName="@mantine/core/OptionalPortal";const Nu=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),rh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...Nu("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Nu("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Nu("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Nu("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Nu("top"),common:{transformOrigin:"top right"}}},mC={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function g9({transition:e,state:t,duration:n,timingFunction:r}){const a={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in rh?{transitionProperty:rh[e].transitionProperty,...a,...rh[e].common,...rh[e][mC[t]]}:{}:{transitionProperty:e.transitionProperty,...a,...e.common,...e[mC[t]]}}function v9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:a,onExit:o,onEntered:c,onExited:u,enterDelay:f,exitDelay:p}){const m=Sn(),g=ax(),v=m.respectReducedMotion?g:!1,[b,S]=y.useState(v?0:e),[j,C]=y.useState(r?"entered":"exited"),R=y.useRef(-1),D=y.useRef(-1),E=y.useRef(-1),T=_=>{const M=_?a:o,L=_?c:u;window.clearTimeout(R.current);const $=v?0:_?e:t;S($),$===0?(typeof M=="function"&&M(),typeof L=="function"&&L(),C(_?"entered":"exited")):E.current=requestAnimationFrame(()=>{Bu.flushSync(()=>{C(_?"pre-entering":"pre-exiting")}),E.current=requestAnimationFrame(()=>{typeof M=="function"&&M(),C(_?"entering":"exiting"),R.current=window.setTimeout(()=>{typeof L=="function"&&L(),C(_?"entered":"exited")},$)})})},A=_=>{if(window.clearTimeout(D.current),typeof(_?f:p)!="number"){T(_);return}D.current=window.setTimeout(()=>{T(_)},_?f:p)};return Li(()=>{A(r)},[r]),y.useEffect(()=>()=>{window.clearTimeout(R.current),cancelAnimationFrame(E.current)},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function di({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:a,children:o,timingFunction:c="ease",onExit:u,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:v}){const b=fR(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=v9({mounted:a,exitDuration:r,duration:n,timingFunction:c,onExit:u,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:v});return S===0||b==="test"?a?s.jsx(s.Fragment,{children:o({})}):e?o({display:"none"}):null:j==="exited"?e?o({display:"none"}):null:s.jsx(s.Fragment,{children:o(g9({transition:t,duration:S,state:j,timingFunction:C}))})}di.displayName="@mantine/core/Transition";const[y9,i2]=vr("Popover component was not found in the tree");function pp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const a=rN(t),o=$n(a,r);return Fi(e)?y.cloneElement(e,{[n]:o}):e}function o2(e){return s.jsx(Tx,{tabIndex:-1,"data-autofocus":!0,...e})}pp.displayName="@mantine/core/FocusTrap";o2.displayName="@mantine/core/FocusTrapInitialFocus";pp.InitialFocus=o2;var s2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const x9={},Dx=me((e,t)=>{var C,R,D,E;const n=se("PopoverDropdown",x9,e),{className:r,style:a,vars:o,children:c,onKeyDownCapture:u,variant:f,classNames:p,styles:m,...g}=n,v=i2(),b=iR({opened:v.opened,shouldReturnFocus:v.returnFocus}),S=v.withRoles?{"aria-labelledby":v.getTargetId(),id:v.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=$n(t,v.floating);return v.disabled?null:s.jsx(Ho,{...v.portalProps,withinPortal:v.withinPortal,children:s.jsx(di,{mounted:v.opened,...v.transitionProps,transition:((C=v.transitionProps)==null?void 0:C.transition)||"fade",duration:((R=v.transitionProps)==null?void 0:R.duration)??150,keepMounted:v.keepMounted,exitDuration:typeof((D=v.transitionProps)==null?void 0:D.exitDuration)=="number"?v.transitionProps.exitDuration:(E=v.transitionProps)==null?void 0:E.duration,children:T=>s.jsx(pp,{active:v.trapFocus&&v.opened,innerRef:j,children:s.jsxs(ce,{...S,...g,variant:f,onKeyDownCapture:H3(()=>{var A,_;(A=v.onClose)==null||A.call(v),(_=v.onDismiss)==null||_.call(v)},{active:v.closeOnEscape,onTrigger:b,onKeyDown:u}),"data-position":v.placement,"data-fixed":v.floatingStrategy==="fixed"||void 0,...v.getStyles("dropdown",{className:r,props:n,classNames:p,styles:m,style:[{...T,zIndex:v.zIndex,top:v.y??0,left:v.x??0,width:v.width==="target"?void 0:le(v.width)},v.resolvedStyles.dropdown,m==null?void 0:m.dropdown,a]}),children:[c,s.jsx(Rx,{ref:v.arrowRef,arrowX:v.arrowX,arrowY:v.arrowY,visible:v.withArrow,position:v.placement,arrowSize:v.arrowSize,arrowRadius:v.arrowRadius,arrowOffset:v.arrowOffset,arrowPosition:v.arrowPosition,...v.getStyles("arrow",{props:n,classNames:p,styles:m})})]})})})})});Dx.classes=s2;Dx.displayName="@mantine/core/PopoverDropdown";const b9={refProp:"ref",popupType:"dialog"},l2=me((e,t)=>{const{children:n,refProp:r,popupType:a,...o}=se("PopoverTarget",b9,e);if(!Fi(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=o,u=i2(),f=$n(u.reference,ap(n),t),p=u.withRoles?{"aria-haspopup":a,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return y.cloneElement(n,{...c,...p,...u.targetProps,className:$t(u.targetProps.className,c.className,n.props.className),[r]:f,...u.controlled?null:{onClick:u.onToggle}})});l2.displayName="@mantine/core/PopoverTarget";function c2({opened:e,floating:t,position:n,positionDependencies:r}){const[a,o]=y.useState(0);y.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return vM(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,a,n]),Li(()=>{t.update()},r),Li(()=>{o(c=>c+1)},[e])}function S9(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function w9(e,t){const n=S9(e.middlewares),r=[IR(e.offset)];return n.shift&&r.push(xx(typeof n.shift=="boolean"?{limiter:iC(),padding:5}:{limiter:iC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?kh():kh(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?qu():qu(n.inline)),r.push(LR({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(RM({...typeof n.size=="boolean"?{}:n.size,apply({rects:a,availableWidth:o,availableHeight:c,...u}){var m;const p=((m=t().refs.floating.current)==null?void 0:m.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:a,availableWidth:o,availableHeight:c,...u}):Object.assign(p,{maxWidth:`${o}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(p,{width:`${a.reference.width}px`})}})),r}function j9(e){const[t,n]=Wn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=y.useRef(t),a=()=>{t&&n(!1)},o=()=>n(!t),c=jx({strategy:e.strategy,placement:e.position,middleware:w9(e,()=>c)});return c2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),Li(()=>{var u;(u=e.onPositionChange)==null||u.call(e,c.placement)},[c.placement]),Li(()=>{var u,f;t!==r.current&&(t?(f=e.onOpen)==null||f.call(e):(u=e.onClose)==null||u.call(e)),r.current=t},[t,e.onClose,e.onOpen]),{floating:c,controlled:typeof e.opened=="boolean",opened:t,onClose:a,onToggle:o}}const C9={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Wr("popover"),__staticSelector:"Popover",width:"max-content"},E9=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ft(t),"--popover-shadow":nx(n)}});function La(e){var $e,gt,ht,Wt,_t,mn;const t=se("Popover",C9,e),{children:n,position:r,offset:a,onPositionChange:o,positionDependencies:c,opened:u,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:v,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,unstyled:D,classNames:E,styles:T,closeOnClickOutside:A,withinPortal:_,portalProps:M,closeOnEscape:L,clickOutsideEvents:$,trapFocus:V,onClose:Y,onDismiss:W,onOpen:G,onChange:X,zIndex:Z,radius:P,shadow:I,id:z,defaultOpened:F,__staticSelector:O,withRoles:U,disabled:J,returnFocus:te,variant:ye,keepMounted:be,vars:ve,floatingStrategy:Ge,withOverlay:ke,overlayProps:et,...Re}=t,ft=Me({name:O,props:t,classes:s2,classNames:E,styles:T,unstyled:D,rootSelector:"dropdown",vars:ve,varsResolver:E9}),{resolvedStyles:Ut}=Hs({classNames:E,styles:T,props:t}),Ot=y.useRef(null),[xt,Ht]=y.useState(null),[Bt,Se]=y.useState(null),{dir:Ne}=Qs(),Ve=yr(z),Te=j9({middlewares:v,width:g,position:n2(Ne,r),offset:typeof a=="number"?a+(b?S/2:0):a,arrowRef:Ot,arrowOffset:j,onPositionChange:o,positionDependencies:c,opened:u,defaultOpened:F,onChange:X,onOpen:G,onClose:Y,onDismiss:W,strategy:Ge});W3(()=>{A&&(Te.onClose(),W==null||W())},$,[xt,Bt]);const ge=y.useCallback(St=>{Ht(St),Te.floating.refs.setReference(St)},[Te.floating.refs.setReference]),we=y.useCallback(St=>{Se(St),Te.floating.refs.setFloating(St)},[Te.floating.refs.setFloating]),Le=y.useCallback(()=>{var St;(St=f==null?void 0:f.onExited)==null||St.call(f),p==null||p()},[f==null?void 0:f.onExited,p]),xe=y.useCallback(()=>{var St;(St=f==null?void 0:f.onEntered)==null||St.call(f),m==null||m()},[f==null?void 0:f.onEntered,m]);return s.jsxs(y9,{value:{returnFocus:te,disabled:J,controlled:Te.controlled,reference:ge,floating:we,x:Te.floating.x,y:Te.floating.y,arrowX:(ht=(gt=($e=Te.floating)==null?void 0:$e.middlewareData)==null?void 0:gt.arrow)==null?void 0:ht.x,arrowY:(mn=(_t=(Wt=Te.floating)==null?void 0:Wt.middlewareData)==null?void 0:_t.arrow)==null?void 0:mn.y,opened:Te.opened,arrowRef:Ot,transitionProps:{...f,onExited:Le,onEntered:xe},width:g,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,placement:Te.floating.placement,trapFocus:V,withinPortal:_,portalProps:M,zIndex:Z,radius:P,shadow:I,closeOnEscape:L,onDismiss:W,onClose:Te.onClose,onToggle:Te.onToggle,getTargetId:()=>`${Ve}-target`,getDropdownId:()=>`${Ve}-dropdown`,withRoles:U,targetProps:Re,__staticSelector:O,classNames:E,styles:T,unstyled:D,variant:ye,keepMounted:be,getStyles:ft,resolvedStyles:Ut,floatingStrategy:Ge},children:[n,ke&&s.jsx(di,{transition:"fade",mounted:Te.opened,duration:(f==null?void 0:f.duration)||250,exitDuration:(f==null?void 0:f.exitDuration)||250,children:St=>s.jsx(Ho,{withinPortal:_,children:s.jsx(uc,{...et,...ft("overlay",{className:et==null?void 0:et.className,style:[St,et==null?void 0:et.style]})})})})]})}La.Target=l2;La.Dropdown=Dx;La.displayName="@mantine/core/Popover";La.extend=e=>e;var Pa={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const u2=y.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:$t(Pa.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Pa.bar}),s.jsx("span",{className:Pa.bar}),s.jsx("span",{className:Pa.bar})]}));u2.displayName="@mantine/core/Bars";const d2=y.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:$t(Pa.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Pa.dot}),s.jsx("span",{className:Pa.dot}),s.jsx("span",{className:Pa.dot})]}));d2.displayName="@mantine/core/Dots";const f2=y.forwardRef(({className:e,...t},n)=>s.jsx(ce,{component:"span",className:$t(Pa.ovalLoader,e),...t,ref:n}));f2.displayName="@mantine/core/Oval";const h2={bars:u2,oval:f2,dots:d2},T9={loaders:h2,type:"oval"},R9=(e,{size:t,color:n})=>({root:{"--loader-size":nt(t,"loader-size"),"--loader-color":n?Gt(n,e):void 0}}),_r=me((e,t)=>{const n=se("Loader",T9,e),{size:r,color:a,type:o,vars:c,className:u,style:f,classNames:p,styles:m,unstyled:g,loaders:v,variant:b,children:S,...j}=n,C=Me({name:"Loader",props:n,classes:Pa,className:u,style:f,classNames:p,styles:m,unstyled:g,vars:c,varsResolver:R9});return S?s.jsx(ce,{...C("root"),ref:t,...j,children:S}):s.jsx(ce,{...C("root"),ref:t,component:v[o],variant:b,size:r,...j})});_r.defaultLoaders=h2;_r.classes=Pa;_r.displayName="@mantine/core/Loader";var wc={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const gC={orientation:"horizontal"},D9=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Ax=me((e,t)=>{const n=se("ActionIconGroup",gC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,orientation:f,vars:p,borderWidth:m,variant:g,mod:v,...b}=se("ActionIconGroup",gC,e),S=Me({name:"ActionIconGroup",props:n,classes:wc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:p,varsResolver:D9,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},v],role:"group",...b})});Ax.classes=wc;Ax.displayName="@mantine/core/ActionIconGroup";const vC={},A9=(e,{radius:t,color:n,gradient:r,variant:a,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:o});return{groupSection:{"--section-height":nt(c,"section-height"),"--section-padding-x":nt(c,"section-padding-x"),"--section-fz":Mn(c),"--section-radius":t===void 0?void 0:Ft(t),"--section-bg":n||a?u.background:void 0,"--section-color":u.color,"--section-bd":n||a?u.border:void 0}}},_x=me((e,t)=>{const n=se("ActionIconGroupSection",vC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,variant:p,gradient:m,radius:g,autoContrast:v,...b}=se("ActionIconGroupSection",vC,e),S=Me({name:"ActionIconGroupSection",props:n,classes:wc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:A9,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});_x.classes=wc;_x.displayName="@mantine/core/ActionIconGroupSection";const _9={},k9=(e,{size:t,radius:n,variant:r,gradient:a,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:a,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":nt(t,"ai-size"),"--ai-radius":n===void 0?void 0:Ft(n),"--ai-bg":o||r?u.background:void 0,"--ai-hover":o||r?u.hover:void 0,"--ai-hover-color":o||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":o||r?u.border:void 0}}},_n=lr((e,t)=>{const n=se("ActionIcon",_9,e),{className:r,unstyled:a,variant:o,classNames:c,styles:u,style:f,loading:p,loaderProps:m,size:g,color:v,radius:b,__staticSelector:S,gradient:j,vars:C,children:R,disabled:D,"data-disabled":E,autoContrast:T,mod:A,..._}=n,M=Me({name:["ActionIcon",S],props:n,className:r,style:f,classes:wc,classNames:c,styles:u,unstyled:a,vars:C,varsResolver:k9});return s.jsxs(tr,{...M("root",{active:!D&&!p&&!E}),..._,unstyled:a,variant:o,size:g,disabled:D||p,ref:t,mod:[{loading:p,disabled:D||E},A],children:[s.jsx(di,{mounted:!!p,transition:"slide-down",duration:150,children:L=>s.jsx(ce,{component:"span",...M("loader",{style:L}),"aria-hidden":!0,children:s.jsx(_r,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),s.jsx(ce,{component:"span",mod:{loading:p},...M("icon"),children:R})]})});_n.classes=wc;_n.displayName="@mantine/core/ActionIcon";_n.Group=Ax;_n.GroupSection=_x;const p2=y.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>s.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:s.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));p2.displayName="@mantine/core/CloseIcon";var m2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const P9={variant:"subtle"},N9=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":nt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Ft(n),"--cb-icon-size":le(r)}}),qo=lr((e,t)=>{const n=se("CloseButton",P9,e),{iconSize:r,children:a,vars:o,radius:c,className:u,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":v,disabled:b,variant:S,icon:j,mod:C,__staticSelector:R,...D}=n,E=Me({name:R||"CloseButton",props:n,className:u,style:p,classes:m2,classNames:f,styles:m,unstyled:g,vars:o,varsResolver:N9});return s.jsxs(tr,{ref:t,...D,unstyled:g,variant:S,disabled:b,mod:[{disabled:b||v},C],...E("root",{variant:S,active:!b&&!v}),children:[j||s.jsx(p2,{}),a]})});qo.classes=m2;qo.displayName="@mantine/core/CloseButton";function O9(e){return y.Children.toArray(e).filter(Boolean)}var g2={root:"m_4081bf90"};const M9={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},I9=(e,{grow:t,preventGrowOverflow:n,gap:r,align:a,justify:o,wrap:c},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":On(r),"--group-align":a,"--group-justify":o,"--group-wrap":c}}),Ce=me((e,t)=>{const n=se("Group",M9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,children:f,gap:p,align:m,justify:g,wrap:v,grow:b,preventGrowOverflow:S,vars:j,variant:C,__size:R,mod:D,...E}=n,T=O9(f),A=T.length,_=On(p??"md"),L={childWidth:`calc(${100/A}% - (${_} - ${_} / ${A}))`},$=Me({name:"Group",props:n,stylesCtx:L,className:a,style:o,classes:g2,classNames:r,styles:c,unstyled:u,vars:j,varsResolver:I9});return s.jsx(ce,{...$("root"),ref:t,variant:C,mod:[{grow:b},D],size:R,...E,children:T})});Ce.classes=g2;Ce.displayName="@mantine/core/Group";const[L9,Wi]=vr("ModalBase component was not found in tree");function z9({opened:e,transitionDuration:t}){const[n,r]=y.useState(e),a=y.useRef(-1),c=ax()?0:t;return y.useEffect(()=>(e?(r(!0),window.clearTimeout(a.current)):c===0?r(!1):a.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(a.current)),[e,c]),n}function $9({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:a,onClose:o,returnFocus:c}){const u=yr(e),[f,p]=y.useState(!1),[m,g]=y.useState(!1),v=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,b=z9({opened:n,transitionDuration:v});return cR("keydown",S=>{var j;S.key==="Escape"&&a&&!S.isComposing&&n&&((j=S.target)==null?void 0:j.getAttribute("data-mantine-stop-propagation"))!=="true"&&o()},{capture:!0}),iR({opened:n,shouldReturnFocus:r&&c}),{_id:u,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const v2=y.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:a,onExitTransitionEnd:o,onEnterTransitionEnd:c,trapFocus:u,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:v,lockScroll:b,children:S,zIndex:j,shadow:C,padding:R,__vars:D,unstyled:E,removeScrollProps:T,...A},_)=>{const{_id:M,titleMounted:L,bodyMounted:$,shouldLockScroll:V,setTitleMounted:Y,setBodyMounted:W}=$9({id:r,transitionProps:a,opened:t,trapFocus:u,closeOnEscape:f,onClose:n,returnFocus:p}),{key:G,...X}=T||{};return s.jsx(Ho,{...v,withinPortal:g,children:s.jsx(L9,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:o,onEnterTransitionEnd:c,transitionProps:{...a,keepMounted:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:L,bodyMounted:$,setTitleMounted:Y,setBodyMounted:W,trapFocus:u,closeOnEscape:f,zIndex:j,unstyled:E},children:s.jsx(sc,{enabled:V&&b,...X,children:s.jsx(ce,{ref:_,...A,__vars:{...D,"--mb-z-index":(j||Wr("modal")).toString(),"--mb-shadow":nx(C),"--mb-padding":On(R)},children:S})},G)})})});v2.displayName="@mantine/core/ModalBase";function U9(){const e=Wi();return y.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var dc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const y2=y.forwardRef(({className:e,...t},n)=>{const r=U9(),a=Wi();return s.jsx(ce,{ref:n,...t,id:r,className:$t({[dc.body]:!a.unstyled},e)})});y2.displayName="@mantine/core/ModalBaseBody";const x2=y.forwardRef(({className:e,onClick:t,...n},r)=>{const a=Wi();return s.jsx(qo,{ref:r,...n,onClick:o=>{a.onClose(),t==null||t(o)},className:$t({[dc.close]:!a.unstyled},e),unstyled:a.unstyled})});x2.displayName="@mantine/core/ModalBaseCloseButton";const b2=y.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:a,...o},c)=>{const u=Wi();return s.jsx(di,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{var f,p,m;(f=u.onExitTransitionEnd)==null||f.call(u),(m=(p=u.transitionProps)==null?void 0:p.onExited)==null||m.call(p)},onEntered:()=>{var f,p,m;(f=u.onEnterTransitionEnd)==null||f.call(u),(m=(p=u.transitionProps)==null?void 0:p.onEntered)==null||m.call(p)},...e,children:f=>s.jsx("div",{...n,className:$t({[dc.inner]:!u.unstyled},n.className),children:s.jsx(pp,{active:u.opened&&u.trapFocus,innerRef:c,children:s.jsx(mr,{...o,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":u.bodyMounted?u.getBodyId():void 0,"aria-labelledby":u.titleMounted?u.getTitleId():void 0,style:[a,f],className:$t({[dc.content]:!u.unstyled},t),unstyled:u.unstyled,children:o.children})})})})});b2.displayName="@mantine/core/ModalBaseContent";const S2=y.forwardRef(({className:e,...t},n)=>{const r=Wi();return s.jsx(ce,{component:"header",ref:n,className:$t({[dc.header]:!r.unstyled},e),...t})});S2.displayName="@mantine/core/ModalBaseHeader";const B9={duration:200,timingFunction:"ease",transition:"fade"};function V9(e){const t=Wi();return{...B9,...t.transitionProps,...e}}const w2=y.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...a},o)=>{const c=Wi(),u=V9(t);return s.jsx(di,{mounted:r!==void 0?r:c.opened,...u,transition:"fade",children:f=>s.jsx(uc,{ref:o,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e==null||e(p),c.closeOnClickOutside&&c.onClose()},...a})})});w2.displayName="@mantine/core/ModalBaseOverlay";function F9(){const e=Wi();return y.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const j2=y.forwardRef(({className:e,...t},n)=>{const r=F9(),a=Wi();return s.jsx(ce,{component:"h2",ref:n,className:$t({[dc.title]:!a.unstyled},e),...t,id:r})});j2.displayName="@mantine/core/ModalBaseTitle";function H9({children:e}){return s.jsx(s.Fragment,{children:e})}const[q9,G9]=Hi({size:"sm"}),Q9={},C2=me((e,t)=>{const n=se("InputClearButton",Q9,e),{size:r,variant:a,vars:o,classNames:c,styles:u,...f}=n,p=G9(),{resolvedClassNames:m,resolvedStyles:g}=Hs({classNames:c,styles:u,props:n});return s.jsx(qo,{variant:a||"transparent",ref:t,size:r||(p==null?void 0:p.size)||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});C2.displayName="@mantine/core/InputClearButton";const[W9,jc]=Hi({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var va={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const yC={},Y9=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Mn(t)} - ${le(2)})`}}),mp=me((e,t)=>{const n=se("InputDescription",yC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:v,...b}=se("InputDescription",yC,n),S=jc(),j=Me({name:["InputWrapper",m],props:n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"description",vars:f,varsResolver:Y9}),C=g&&(S==null?void 0:S.getStyles)||j;return s.jsx(ce,{component:"p",ref:t,variant:v,size:p,...C("description",S!=null&&S.getStyles?{className:a,style:o}:void 0),...b})});mp.classes=va;mp.displayName="@mantine/core/InputDescription";const K9={},X9=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Mn(t)} - ${le(2)})`}}),gp=me((e,t)=>{const n=se("InputError",K9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:v,...b}=n,S=Me({name:["InputWrapper",m],props:n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"error",vars:f,varsResolver:X9}),j=jc(),C=g&&(j==null?void 0:j.getStyles)||S;return s.jsx(ce,{component:"p",ref:t,variant:v,size:p,...C("error",j!=null&&j.getStyles?{className:a,style:o}:void 0),...b})});gp.classes=va;gp.displayName="@mantine/core/InputError";const xC={labelElement:"label"},Z9=(e,{size:t})=>({label:{"--input-label-size":Mn(t),"--input-asterisk-color":void 0}}),fd=me((e,t)=>{const n=se("InputLabel",xC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,labelElement:p,size:m,required:g,htmlFor:v,onMouseDown:b,children:S,__staticSelector:j,variant:C,mod:R,...D}=se("InputLabel",xC,n),E=Me({name:["InputWrapper",j],props:n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"label",vars:f,varsResolver:Z9}),T=jc(),A=(T==null?void 0:T.getStyles)||E;return s.jsxs(ce,{...A("label",T!=null&&T.getStyles?{className:a,style:o}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?v:void 0,mod:[{required:g},R],onMouseDown:_=>{b==null||b(_),!_.defaultPrevented&&_.detail>1&&_.preventDefault()},...D,children:[S,g&&s.jsx("span",{...A("required"),"aria-hidden":!0,children:" *"})]})});fd.classes=va;fd.displayName="@mantine/core/InputLabel";const bC={},kx=me((e,t)=>{const n=se("InputPlaceholder",bC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,__staticSelector:p,variant:m,error:g,mod:v,...b}=se("InputPlaceholder",bC,n),S=Me({name:["InputPlaceholder",p],props:n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"placeholder"});return s.jsx(ce,{...S("placeholder"),mod:[{error:!!g},v],component:"span",variant:m,ref:t,...b})});kx.classes=va;kx.displayName="@mantine/core/InputPlaceholder";function J9(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),a=e.slice(0,r),o=e.slice(r+1),c=t&&a.includes("description")||n&&a.includes("error");return{offsetBottom:t&&o.includes("description")||n&&o.includes("error"),offsetTop:c}}const e5={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},t5=(e,{size:t})=>({label:{"--input-label-size":Mn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Mn(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Mn(t)} - ${le(2)})`}}),Px=me((e,t)=>{const n=se("InputWrapper",e5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:v,inputWrapperOrder:b,label:S,error:j,description:C,labelProps:R,descriptionProps:D,errorProps:E,labelElement:T,children:A,withAsterisk:_,id:M,required:L,__stylesApiProps:$,mod:V,...Y}=n,W=Me({name:["InputWrapper",g],props:$||n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:t5}),G={size:p,variant:m,__staticSelector:g},X=yr(M),Z=typeof _=="boolean"?_:L,P=(E==null?void 0:E.id)||`${X}-error`,I=(D==null?void 0:D.id)||`${X}-description`,z=X,F=!!j&&typeof j!="boolean",O=!!C,U=`${F?P:""} ${O?I:""}`,J=U.trim().length>0?U.trim():void 0,te=(R==null?void 0:R.id)||`${X}-label`,ye=S&&s.jsx(fd,{labelElement:T,id:te,htmlFor:z,required:Z,...G,...R,children:S},"label"),be=O&&s.jsx(mp,{...D,...G,size:(D==null?void 0:D.size)||G.size,id:(D==null?void 0:D.id)||I,children:C},"description"),ve=s.jsx(y.Fragment,{children:v(A)},"input"),Ge=F&&y.createElement(gp,{...E,...G,size:(E==null?void 0:E.size)||G.size,key:"error",id:(E==null?void 0:E.id)||P},j),ke=b.map(et=>{switch(et){case"label":return ye;case"input":return ve;case"description":return be;case"error":return Ge;default:return null}});return s.jsx(W9,{value:{getStyles:W,describedBy:J,inputId:z,labelId:te,...J9(b,{hasDescription:O,hasError:F})},children:s.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},V],...W("root"),...Y,children:ke})})});Px.classes=va;Px.displayName="@mantine/core/InputWrapper";const n5={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},r5=(e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":nt(t.size,"input-height"),"--input-fz":Mn(t.size),"--input-radius":t.radius===void 0?void 0:Ft(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?le(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?le(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?nt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),pn=lr((e,t)=>{const n=se("Input",n5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:v,error:b,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:R,rightSection:D,rightSectionProps:E,rightSectionWidth:T,rightSectionPointerEvents:A,leftSectionPointerEvents:_,variant:M,vars:L,pointer:$,multiline:V,radius:Y,id:W,withAria:G,withErrorStyles:X,mod:Z,inputSize:P,__clearSection:I,__clearable:z,__defaultRightSection:F,...O}=n,{styleProps:U,rest:J}=Qi(O),te=jc(),ye={offsetBottom:te==null?void 0:te.offsetBottom,offsetTop:te==null?void 0:te.offsetTop},be=Me({name:["Input",p],props:m||n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,stylesCtx:ye,rootSelector:"wrapper",vars:L,varsResolver:r5}),ve=G?{required:f,disabled:S,"aria-invalid":!!b,"aria-describedby":te==null?void 0:te.describedBy,id:(te==null?void 0:te.inputId)||W}:{},Ge=D||z&&I||F;return s.jsx(q9,{value:{size:g||"sm"},children:s.jsxs(ce,{...be("wrapper"),...U,...v,mod:[{error:!!b&&X,pointer:$,disabled:S,multiline:V,"data-with-right-section":!!Ge,"data-with-left-section":!!j},Z],variant:M,size:g,children:[j&&s.jsx("div",{...C,"data-position":"left",...be("section",{className:C==null?void 0:C.className,style:C==null?void 0:C.style}),children:j}),s.jsx(ce,{component:"input",...J,...ve,ref:t,required:f,mod:{disabled:S,error:!!b&&X},variant:M,__size:P,...be("input")}),Ge&&s.jsx("div",{...E,"data-position":"right",...be("section",{className:E==null?void 0:E.className,style:E==null?void 0:E.style}),children:Ge})]})})});pn.classes=va;pn.Wrapper=Px;pn.Label=fd;pn.Error=gp;pn.Description=mp;pn.Placeholder=kx;pn.ClearButton=C2;pn.displayName="@mantine/core/Input";function a5(e,t,n){const r=se(e,t,n),{label:a,description:o,error:c,required:u,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:v,__stylesApiProps:b,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:R,id:D,size:E,style:T,inputContainer:A,inputWrapperOrder:_,withAsterisk:M,variant:L,vars:$,mod:V,...Y}=r,{styleProps:W,rest:G}=Qi(Y),X={label:a,description:o,error:c,required:u,classNames:f,className:m,__staticSelector:v,__stylesApiProps:b||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:E,style:T,inputContainer:A,inputWrapperOrder:_,withAsterisk:M,variant:L,id:D,mod:V,...R};return{...G,classNames:f,styles:p,unstyled:g,wrapperProps:{...X,...W},inputProps:{required:u,classNames:f,styles:p,unstyled:g,size:E,__staticSelector:v,__stylesApiProps:b||r,error:c,variant:L,id:D}}}const i5={__staticSelector:"InputBase",withAria:!0},Pr=lr((e,t)=>{const{inputProps:n,wrapperProps:r,...a}=a5("InputBase",i5,e);return s.jsx(pn.Wrapper,{...r,children:s.jsx(pn,{...n,...a,ref:t})})});Pr.classes={...pn.classes,...pn.Wrapper.classes};Pr.displayName="@mantine/core/InputBase";const o5={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 E2={root:"m_8bffd616"};const s5={},$o=lr((e,t)=>{const n=se("Flex",s5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,gap:p,rowGap:m,columnGap:g,align:v,justify:b,wrap:S,direction:j,...C}=n,R=Me({name:"Flex",classes:E2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f}),D=Sn(),E=ud(),T=vR({styleProps:{gap:p,rowGap:m,columnGap:g,align:v,justify:b,wrap:S,direction:j},theme:D,data:o5});return s.jsxs(s.Fragment,{children:[T.hasResponsiveStyles&&s.jsx(Gs,{selector:`.${E}`,styles:T.styles,media:T.media}),s.jsx(ce,{ref:t,...R("root",{className:E,style:Fo(T.inlineStyles)}),...C})]})});$o.classes=E2;$o.displayName="@mantine/core/Flex";function l5(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;n!=null;){if(n===e)return!0;n=n.parentNode}return!1}function c5({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const a=y.useRef(-1),[o,c]=y.useState(!1),[u,f]=y.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const b=e.getBoundingClientRect(),S=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),R=Lo(j.borderTopWidth)+Lo(C.borderTopWidth),D=Lo(j.borderLeftWidth)+Lo(C.borderLeftWidth),E={top:b.top-S.top-R,left:b.left-S.left-D,width:b.width,height:b.height};n.current.style.transform=`translateY(${E.top}px) translateX(${E.left}px)`,n.current.style.width=`${E.width}px`,n.current.style.height=`${E.height}px`},m=()=>{window.clearTimeout(a.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),a.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=y.useRef(null),v=y.useRef(null);return y.useEffect(()=>{if(p(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(v.current=new ResizeObserver(m),v.current.observe(t)),()=>{var b,S;(b=g.current)==null||b.disconnect(),(S=v.current)==null||S.disconnect()}},[t,e]),y.useEffect(()=>{if(t){const b=S=>{l5(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),hN(()=>{uR()!=="test"&&c(!0)},20,{autoInvoke:!0}),pN(b=>{b.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:o,hidden:u}}var T2={root:"m_96b553a6"};const u5={},d5=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Nx=me((e,t)=>{const n=se("FloatingIndicator",u5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,target:p,parent:m,transitionDuration:g,mod:v,displayAfterTransitionEnd:b,...S}=n,j=Me({name:"FloatingIndicator",classes:T2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:d5}),C=y.useRef(null),{initialized:R,hidden:D}=c5({target:p,parent:m,ref:C,displayAfterTransitionEnd:b}),E=$n(t,C);return!p||!m?null:s.jsx(ce,{ref:E,mod:[{initialized:R,hidden:D},v],...j("root"),...S})});Nx.displayName="@mantine/core/FloatingIndicator";Nx.classes=T2;var R2={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const f5={},h5=(e,{radius:t,color:n,variant:r,autoContrast:a})=>{const o=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:a});return{root:{"--alert-radius":t===void 0?void 0:Ft(t),"--alert-bg":n||r?o.background:void 0,"--alert-color":o.color,"--alert-bd":n||r?o.border:void 0}}},Yi=me((e,t)=>{const n=se("Alert",f5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,radius:p,color:m,title:g,children:v,id:b,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:R,variant:D,autoContrast:E,...T}=n,A=Me({name:"Alert",classes:R2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:h5}),_=yr(b),M=g&&`${_}-title`||void 0,L=`${_}-body`;return s.jsx(ce,{id:_,...A("root",{variant:D}),variant:D,ref:t,...T,role:"alert","aria-describedby":L,"aria-labelledby":M,children:s.jsxs("div",{...A("wrapper"),children:[S&&s.jsx("div",{...A("icon"),children:S}),s.jsxs("div",{...A("body"),children:[g&&s.jsx("div",{...A("title"),"data-with-close-button":j||void 0,children:s.jsx("span",{id:M,...A("label"),children:g})}),v&&s.jsx("div",{id:L,...A("message"),"data-variant":D,children:v})]}),j&&s.jsx(qo,{...A("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":R,unstyled:u})]})})});Yi.classes=R2;Yi.displayName="@mantine/core/Alert";var D2={root:"m_b6d8b162"};function p5(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const m5={inherit:!1},g5=(e,{variant:t,lineClamp:n,gradient:r,size:a,color:o})=>({root:{"--text-fz":Mn(a),"--text-lh":nR(a),"--text-gradient":t==="gradient"?cy(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":o?Gt(o,e):void 0}}),Ae=lr((e,t)=>{const n=se("Text",m5,e),{lineClamp:r,truncate:a,inline:o,inherit:c,gradient:u,span:f,__staticSelector:p,vars:m,className:g,style:v,classNames:b,styles:S,unstyled:j,variant:C,mod:R,size:D,...E}=n,T=Me({name:["Text",p],props:n,classes:D2,className:g,style:v,classNames:b,styles:S,unstyled:j,vars:m,varsResolver:g5});return s.jsx(ce,{...T("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":p5(a),"data-line-clamp":typeof r=="number","data-inline":o,"data-inherit":c},R],size:D,...E})});Ae.classes=D2;Ae.displayName="@mantine/core/Text";var A2={root:"m_849cf0da"};const v5={underline:"hover"},Pt=lr((e,t)=>{const{underline:n,className:r,unstyled:a,mod:o,...c}=se("Anchor",v5,e);return s.jsx(Ae,{component:"a",ref:t,className:$t({[A2.root]:!a},r),...c,mod:[{underline:n},o],__staticSelector:"Anchor",unstyled:a})});Pt.classes=A2;Pt.displayName="@mantine/core/Anchor";const[y5,Cc]=vr("AppShell was not found in tree");var Go={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const x5={},Ox=me((e,t)=>{const n=se("AppShellAside",x5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Cc();return b.disabled?null:s.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("aside",{className:a,classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});Ox.classes=Go;Ox.displayName="@mantine/core/AppShellAside";const b5={},Mx=me((e,t)=>{var S;const n=se("AppShellFooter",b5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Cc();return b.disabled?null:s.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("footer",{className:$t({[sc.classNames.zeroRight]:b.offsetScrollbars},a),classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-footer-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Mx.classes=Go;Mx.displayName="@mantine/core/AppShellFooter";const S5={},Ix=me((e,t)=>{var S;const n=se("AppShellHeader",S5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Cc();return b.disabled?null:s.jsx(ce,{component:"header",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("header",{className:$t({[sc.classNames.zeroRight]:b.offsetScrollbars},a),classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-header-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Ix.classes=Go;Ix.displayName="@mantine/core/AppShellHeader";const w5={},Lx=me((e,t)=>{const n=se("AppShellMain",w5,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=Cc();return s.jsx(ce,{component:"main",ref:t,...p.getStyles("main",{className:a,style:o,classNames:r,styles:c}),...f})});Lx.classes=Go;Lx.displayName="@mantine/core/AppShellMain";function hd(e){return typeof e=="object"?e.base:e}function pd(e){const t=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||t}function md(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function j5({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:a}){var f,p,m;const o=r==null?void 0:r.width,c="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-aside-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-aside-offset"]="0px"),pd(o)){const g=le(hd(o));e["--app-shell-aside-width"]=g,e["--app-shell-aside-offset"]=g}if(md(o)&&(typeof o.base<"u"&&(e["--app-shell-aside-width"]=le(o.base),e["--app-shell-aside-offset"]=le(o.base)),sn(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-aside-width"]=le(o[g]),t[g]["--app-shell-aside-offset"]=le(o[g]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-aside-transform"]=c,t[g]["--app-shell-aside-transform-rtl"]=u,t[g]["--app-shell-aside-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=rx(r.breakpoint,a.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-aside-width"]="100%",n[g]["--app-shell-aside-offset"]="0px",n[g]["--app-shell-aside-transform"]=c,n[g]["--app-shell-aside-transform-rtl"]=u}}function C5({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,a="translateY(var(--app-shell-footer-height))",o=(n==null?void 0:n.offset)??!0;if(pd(r)){const c=le(hd(r));e["--app-shell-footer-height"]=c,o&&(e["--app-shell-footer-offset"]=c)}md(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),o&&(e["--app-shell-footer-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),o&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=a,e["--app-shell-footer-offset"]="0px !important")}function E5({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,a="translateY(calc(var(--app-shell-header-height) * -1))",o=(n==null?void 0:n.offset)??!0;if(pd(r)){const c=le(hd(r));e["--app-shell-header-height"]=c,o&&(e["--app-shell-header-offset"]=c)}md(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),o&&(e["--app-shell-header-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),o&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=a,e["--app-shell-header-offset"]="0px !important")}function T5({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:a}){var f,p,m;const o=r==null?void 0:r.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-navbar-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-navbar-offset"]="0px"),pd(o)){const g=le(hd(o));e["--app-shell-navbar-width"]=g,e["--app-shell-navbar-offset"]=g}if(md(o)&&(typeof o.base<"u"&&(e["--app-shell-navbar-width"]=le(o.base),e["--app-shell-navbar-offset"]=le(o.base)),sn(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-navbar-width"]=le(o[g]),t[g]["--app-shell-navbar-offset"]=le(o[g]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-navbar-transform"]=c,t[g]["--app-shell-navbar-transform-rtl"]=u,t[g]["--app-shell-navbar-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=rx(r.breakpoint,a.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-navbar-width"]="100%",n[g]["--app-shell-navbar-offset"]="0px",n[g]["--app-shell-navbar-transform"]=c,n[g]["--app-shell-navbar-transform-rtl"]=u}}function _v(e){return Number(e)===0?"0px":On(e)}function R5({padding:e,baseStyles:t,minMediaStyles:n}){pd(e)&&(t["--app-shell-padding"]=_v(hd(e))),md(e)&&(e.base&&(t["--app-shell-padding"]=_v(e.base)),sn(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=_v(e[r]))}))}function D5({navbar:e,header:t,footer:n,aside:r,padding:a,theme:o}){const c={},u={},f={};T5({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,navbar:e,theme:o}),j5({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,aside:r,theme:o}),E5({baseStyles:f,minMediaStyles:c,header:t}),C5({baseStyles:f,minMediaStyles:c,footer:n}),R5({baseStyles:f,minMediaStyles:c,padding:a});const p=Wu(sn(c),o.breakpoints).map(v=>({query:`(min-width: ${jh(v.px)})`,styles:c[v.value]})),m=Wu(sn(u),o.breakpoints).map(v=>({query:`(max-width: ${jh(v.px)})`,styles:u[v.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function A5({navbar:e,header:t,aside:n,footer:r,padding:a}){const o=Sn(),c=qi(),{media:u,baseStyles:f}=D5({navbar:e,header:t,footer:r,aside:n,padding:a,theme:o});return s.jsx(Gs,{media:u,styles:f,selector:c.cssVariablesSelector})}const _5={},zx=me((e,t)=>{const n=se("AppShellNavbar",_5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Cc();return b.disabled?null:s.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("navbar",{className:a,classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});zx.classes=Go;zx.displayName="@mantine/core/AppShellNavbar";const k5={},$x=lr((e,t)=>{const n=se("AppShellSection",k5,e),{classNames:r,className:a,style:o,styles:c,vars:u,grow:f,mod:p,...m}=n,g=Cc();return s.jsx(ce,{ref:t,mod:[{grow:f},p],...g.getStyles("section",{className:a,style:o,classNames:r,styles:c}),...m})});$x.classes=Go;$x.displayName="@mantine/core/AppShellSection";function P5({transitionDuration:e,disabled:t}){const[n,r]=y.useState(!0),a=y.useRef(-1),o=y.useRef(-1);return cR("resize",()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),200)}),xc(()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const N5={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Wr("app")},O5=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Ar=me((e,t)=>{const n=se("AppShell",N5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:v,transitionTimingFunction:b,header:S,zIndex:j,layout:C,disabled:R,aside:D,footer:E,offsetScrollbars:T=C!=="alt",mod:A,..._}=n,M=Me({name:"AppShell",classes:Go,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:O5}),L=P5({disabled:R,transitionDuration:v});return s.jsxs(y5,{value:{getStyles:M,withBorder:m,zIndex:j,disabled:R,offsetScrollbars:T},children:[s.jsx(A5,{navbar:p,header:S,aside:D,footer:E,padding:g}),s.jsx(ce,{ref:t,...M("root"),mod:[{resizing:L,layout:C,disabled:R},A],..._})]})});Ar.classes=Go;Ar.displayName="@mantine/core/AppShell";Ar.Navbar=zx;Ar.Header=Ix;Ar.Main=Lx;Ar.Aside=Ox;Ar.Footer=Mx;Ar.Section=$x;function _2(e){return typeof e=="string"?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e=="number"?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(t=>_2(t))}:e}function k2(e){return e?e.map(t=>_2(t)):[]}function P2(e){return e.reduce((t,n)=>"group"in n?{...t,...P2(n.items)}:(t[n.value]=n,t),{})}var kr={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const M5={error:null},I5=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":nt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Gt(n,e):void 0}}),vp=me((e,t)=>{const n=se("ComboboxChevron",M5,e),{size:r,error:a,style:o,className:c,classNames:u,styles:f,unstyled:p,vars:m,mod:g,...v}=n,b=Me({name:"ComboboxChevron",classes:kr,props:n,style:o,className:c,classNames:u,styles:f,unstyled:p,vars:m,varsResolver:I5,rootSelector:"chevron"});return s.jsx(ce,{component:"svg",...v,...b("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:a},g],ref:t,children:s.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});vp.classes=kr;vp.displayName="@mantine/core/ComboboxChevron";const[L5,ya]=vr("Combobox component was not found in tree"),N2=y.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...a},o)=>s.jsx(pn.ClearButton,{ref:o,tabIndex:-1,"aria-hidden":!0,...a,onMouseDown:c=>{c.preventDefault(),t==null||t(c)},onClick:c=>{r(),n==null||n(c)}}));N2.displayName="@mantine/core/ComboboxClearButton";const z5={},Ux=me((e,t)=>{const{classNames:n,styles:r,className:a,style:o,hidden:c,...u}=se("ComboboxDropdown",z5,e),f=ya();return s.jsx(La.Dropdown,{...u,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:a,style:o,classNames:n,styles:r})})});Ux.classes=kr;Ux.displayName="@mantine/core/ComboboxDropdown";const $5={refProp:"ref"},O2=me((e,t)=>{const{children:n,refProp:r}=se("ComboboxDropdownTarget",$5,e);if(ya(),!Fi(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return s.jsx(La.Target,{ref:t,refProp:r,children:n})});O2.displayName="@mantine/core/ComboboxDropdownTarget";const U5={},Bx=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("ComboboxEmpty",U5,e),f=ya();return s.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:o,style:a}),...u})});Bx.classes=kr;Bx.displayName="@mantine/core/ComboboxEmpty";function Vx({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:a,autoComplete:o}){const c=ya(),[u,f]=y.useState(null),p=g=>{if(e==null||e(g),!c.readOnly&&t){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectNextOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectPreviousOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const v=c.store.getSelectedOptionIndex();c.store.dropdownOpened&&v!==-1?(g.preventDefault(),c.store.clickSelectedOption()):a==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&a==="button"&&(g.preventDefault(),c.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(c.store.listId&&c.store.dropdownOpened)||void 0,"aria-controls":c.store.dropdownOpened?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&u||void 0,autoComplete:o,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const B5={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},M2=me((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...p}=se("ComboboxEventsTarget",B5,e);if(!Fi(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=ya(),g=Vx({targetType:u,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return y.cloneElement(n,{...g,...p,[r]:$n(t,m.store.targetRef,ap(n))})});M2.displayName="@mantine/core/ComboboxEventsTarget";const V5={},Fx=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("ComboboxFooter",V5,e),f=ya();return s.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:a,styles:o}),...u,onMouseDown:p=>{p.preventDefault()}})});Fx.classes=kr;Fx.displayName="@mantine/core/ComboboxFooter";const F5={},Hx=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,children:u,label:f,...p}=se("ComboboxGroup",F5,e),m=ya();return s.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:a,styles:o}),...p,children:[f&&s.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:o}),children:f}),u]})});Hx.classes=kr;Hx.displayName="@mantine/core/ComboboxGroup";const H5={},qx=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("ComboboxHeader",H5,e),f=ya();return s.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:a,styles:o}),...u,onMouseDown:p=>{p.preventDefault()}})});qx.classes=kr;qx.displayName="@mantine/core/ComboboxHeader";function I2({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}I2.displayName="@mantine/core/ComboboxHiddenInput";const q5={},Gx=me((e,t)=>{const n=se("ComboboxOption",q5,e),{classNames:r,className:a,style:o,styles:c,vars:u,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:v,disabled:b,selected:S,mod:j,...C}=n,R=ya(),D=y.useId(),E=p||D;return s.jsx(ce,{...R.getStyles("option",{className:a,classNames:r,styles:c,style:o}),...C,ref:t,id:E,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":S},j],role:"option",onClick:T=>{var A;b?T.preventDefault():((A=R.onOptionSubmit)==null||A.call(R,n.value,n),f==null||f(T))},onMouseDown:T=>{T.preventDefault(),g==null||g(T)},onMouseOver:T=>{R.resetSelectionOnOptionHover&&R.store.resetSelectedOption(),v==null||v(T)}})});Gx.classes=kr;Gx.displayName="@mantine/core/ComboboxOption";const G5={},Qx=me((e,t)=>{const n=se("ComboboxOptions",G5,e),{classNames:r,className:a,style:o,styles:c,id:u,onMouseDown:f,labelledBy:p,...m}=n,g=ya(),v=yr(u);return y.useEffect(()=>{g.store.setListId(v)},[v]),s.jsx(ce,{ref:t,...g.getStyles("options",{className:a,style:o,classNames:r,styles:c}),...m,id:v,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f==null||f(b)}})});Qx.classes=kr;Qx.displayName="@mantine/core/ComboboxOptions";const Q5={withAriaAttributes:!0,withKeyboardNavigation:!0},Wx=me((e,t)=>{const n=se("ComboboxSearch",Q5,e),{classNames:r,styles:a,unstyled:o,vars:c,withAriaAttributes:u,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,v=ya(),b=v.getStyles("search"),S=Vx({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return s.jsx(pn,{ref:$n(t,v.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},a],size:m||v.size,...S,...g,__staticSelector:"Combobox"})});Wx.classes=kr;Wx.displayName="@mantine/core/ComboboxSearch";const W5={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},L2=me((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...p}=se("ComboboxTarget",W5,e);if(!Fi(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=ya(),g=Vx({targetType:u,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),v=y.cloneElement(n,{...g,...p});return s.jsx(La.Target,{ref:$n(t,m.store.targetRef),children:v})});L2.displayName="@mantine/core/ComboboxTarget";function Y5(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function K5(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=0;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function X5(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function gd({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:a,loop:o=!0,scrollBehavior:c="instant"}={}){const[u,f]=Wn({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=y.useRef(null),m=y.useRef(-1),g=y.useRef(null),v=y.useRef(null),b=y.useRef(-1),S=y.useRef(-1),j=y.useRef(-1),C=y.useCallback((P="unknown")=>{u||(f(!0),a==null||a(P))},[f,a,u]),R=y.useCallback((P="unknown")=>{u&&(f(!1),r==null||r(P))},[f,r,u]),D=y.useCallback((P="unknown")=>{u?R(P):C(P)},[R,C,u]),E=y.useCallback(()=>{const P=document.querySelector(`#${p.current} [data-combobox-selected]`);P==null||P.removeAttribute("data-combobox-selected"),P==null||P.removeAttribute("aria-selected")},[]),T=y.useCallback(P=>{const I=document.getElementById(p.current),z=I==null?void 0:I.querySelectorAll("[data-combobox-option]");if(!z)return null;const F=P>=z.length?0:P<0?z.length-1:P;return m.current=F,z!=null&&z[F]&&!z[F].hasAttribute("data-combobox-disabled")?(E(),z[F].setAttribute("data-combobox-selected","true"),z[F].setAttribute("aria-selected","true"),z[F].scrollIntoView({block:"nearest",behavior:c}),z[F].id):null},[c,E]),A=y.useCallback(()=>{const P=document.querySelector(`#${p.current} [data-combobox-active]`);if(P){const I=document.querySelectorAll(`#${p.current} [data-combobox-option]`),z=Array.from(I).findIndex(F=>F===P);return T(z)}return T(0)},[T]),_=y.useCallback(()=>T(K5(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),o)),[T,o]),M=y.useCallback(()=>T(Y5(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),o)),[T,o]),L=y.useCallback(()=>T(X5(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[T]),$=y.useCallback((P="selected",I)=>{j.current=window.setTimeout(()=>{var O;const z=document.querySelectorAll(`#${p.current} [data-combobox-option]`),F=Array.from(z).findIndex(U=>U.hasAttribute(`data-combobox-${P}`));m.current=F,I!=null&&I.scrollIntoView&&((O=z[F])==null||O.scrollIntoView({block:"nearest",behavior:c}))},0)},[]),V=y.useCallback(()=>{m.current=-1,E()},[E]),Y=y.useCallback(()=>{const P=document.querySelectorAll(`#${p.current} [data-combobox-option]`),I=P==null?void 0:P[m.current];I==null||I.click()},[]),W=y.useCallback(P=>{p.current=P},[]),G=y.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),X=y.useCallback(()=>{S.current=window.setTimeout(()=>v.current.focus(),0)},[]),Z=y.useCallback(()=>m.current,[]);return y.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(S.current),window.clearTimeout(j.current)},[]),{dropdownOpened:u,openDropdown:C,closeDropdown:R,toggleDropdown:D,selectedOptionIndex:m.current,getSelectedOptionIndex:Z,selectOption:T,selectFirstOption:L,selectActiveOption:A,selectNextOption:_,selectPreviousOption:M,resetSelectedOption:V,updateSelectedOptionIndex:$,listId:p.current,setListId:W,clickSelectedOption:Y,searchRef:g,focusSearchInput:G,targetRef:v,focusTarget:X}}const Z5={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},J5=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Mn(t),"--combobox-option-padding":nt(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":Mn(t),"--combobox-option-padding":nt(t,"combobox-option-padding")}});function ct(e){const t=se("Combobox",Z5,e),{classNames:n,styles:r,unstyled:a,children:o,store:c,vars:u,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:v,__staticSelector:b,readOnly:S,...j}=t,C=gd(),R=c||C,D=Me({name:b||"Combobox",classes:kr,props:t,classNames:n,styles:r,unstyled:a,vars:u,varsResolver:J5}),E=()=>{p==null||p(),R.closeDropdown()};return s.jsx(L5,{value:{getStyles:D,store:R,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:v,readOnly:S},children:s.jsx(La,{opened:R.dropdownOpened,...j,onChange:T=>!T&&E(),withRoles:!1,unstyled:a,children:o})})}const e7=e=>e;ct.extend=e7;ct.classes=kr;ct.displayName="@mantine/core/Combobox";ct.Target=L2;ct.Dropdown=Ux;ct.Options=Qx;ct.Option=Gx;ct.Search=Wx;ct.Empty=Bx;ct.Chevron=vp;ct.Footer=Fx;ct.Header=qx;ct.EventsTarget=M2;ct.DropdownTarget=O2;ct.Group=Hx;ct.ClearButton=N2;ct.HiddenInput=I2;var z2={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const $2=z2,yp=y.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:a,unstyled:o,children:c,label:u,description:f,id:p,disabled:m,error:g,size:v,labelPosition:b="left",bodyElement:S="div",labelElement:j="label",variant:C,style:R,vars:D,mod:E,...T},A)=>{const _=Me({name:e,props:t,className:n,style:R,classes:z2,classNames:r,styles:a,unstyled:o});return s.jsx(ce,{..._("root"),ref:A,__vars:{"--label-fz":Mn(v),"--label-lh":nt(v,"label-lh")},mod:[{"label-position":b},E],variant:C,size:v,...T,children:s.jsxs(ce,{component:S,htmlFor:S==="label"?p:void 0,..._("body"),children:[c,s.jsxs("div",{..._("labelWrapper"),"data-disabled":m||void 0,children:[u&&s.jsx(ce,{component:j,htmlFor:j==="label"?p:void 0,..._("label"),"data-disabled":m||void 0,children:u}),f&&s.jsx(pn.Description,{size:v,__inheritStyles:!1,..._("description"),children:f}),g&&typeof g!="boolean"&&s.jsx(pn.Error,{size:v,__inheritStyles:!1,..._("error"),children:g})]})]})})});yp.displayName="@mantine/core/InlineInput";const U2=y.createContext(null),t7=U2.Provider,B2=()=>y.useContext(U2),[n7,r7]=Hi();var V2={card:"m_26775b0a"};const a7={withBorder:!0},i7=(e,{radius:t})=>({card:{"--card-radius":Ft(t)}}),Yx=me((e,t)=>{const n=se("CheckboxCard",a7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,checked:p,mod:m,withBorder:g,value:v,onClick:b,defaultChecked:S,onChange:j,...C}=n,R=Me({name:"CheckboxCard",classes:V2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:i7,rootSelector:"card"}),D=B2(),E=typeof p=="boolean"?p:D?D.value.includes(v||""):void 0,[T,A]=Wn({value:E,defaultValue:S,finalValue:!1,onChange:j});return s.jsx(n7,{value:{checked:T},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:T},m],...R("card"),...C,role:"checkbox","aria-checked":T,onClick:_=>{b==null||b(_),D==null||D.onChange(v||""),A(!T)}})})});Yx.displayName="@mantine/core/CheckboxCard";Yx.classes=V2;function Kx({children:e,role:t}){const n=jc();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const o7={},Xx=me((e,t)=>{const{value:n,defaultValue:r,onChange:a,size:o,wrapperProps:c,children:u,readOnly:f,...p}=se("CheckboxGroup",o7,e),[m,g]=Wn({value:n,defaultValue:r,finalValue:[],onChange:a}),v=b=>{const S=typeof b=="string"?b:b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return s.jsx(t7,{value:{value:m,onChange:v,size:o},children:s.jsx(pn.Wrapper,{size:o,ref:t,...c,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(Kx,{role:"group",children:u})})})});Xx.classes=pn.Wrapper.classes;Xx.displayName="@mantine/core/CheckboxGroup";function xp({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(e),...t}:t;return s.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:s.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function F2({indeterminate:e,...t}){return e?s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:s.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):s.jsx(xp,{...t})}var H2={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const s7={icon:F2},l7=(e,{radius:t,color:n,size:r,iconColor:a,variant:o,autoContrast:c})=>{const u=da({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--checkbox-size":nt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ft(t),"--checkbox-color":o==="outline"?f:Gt(n,e),"--checkbox-icon-color":a?Gt(a,e):qs(c,e)?Gi({color:n,theme:e,autoContrast:c}):void 0}}},Zx=me((e,t)=>{const n=se("CheckboxIndicator",s7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,icon:p,indeterminate:m,radius:g,color:v,iconColor:b,autoContrast:S,checked:j,mod:C,variant:R,disabled:D,...E}=n,T=p,A=Me({name:"CheckboxIndicator",classes:H2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:l7,rootSelector:"indicator"}),_=r7(),M=typeof j=="boolean"||typeof m=="boolean"?j||m:(_==null?void 0:_.checked)||!1;return s.jsx(ce,{ref:t,...A("indicator",{variant:R}),variant:R,mod:[{checked:M,disabled:D},C],...E,children:s.jsx(T,{indeterminate:m,...A("icon")})})});Zx.displayName="@mantine/core/CheckboxIndicator";Zx.classes=H2;var q2={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const c7={labelPosition:"right",icon:F2},u7=(e,{radius:t,color:n,size:r,iconColor:a,variant:o,autoContrast:c})=>{const u=da({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--checkbox-size":nt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ft(t),"--checkbox-color":o==="outline"?f:Gt(n,e),"--checkbox-icon-color":a?Gt(a,e):qs(c,e)?Gi({color:n,theme:e,autoContrast:c}):void 0}}},Qn=me((e,t)=>{const n=se("Checkbox",c7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,label:m,id:g,size:v,radius:b,wrapperProps:S,checked:j,labelPosition:C,description:R,error:D,disabled:E,variant:T,indeterminate:A,icon:_,rootRef:M,iconColor:L,onChange:$,autoContrast:V,mod:Y,...W}=n,G=B2(),X=v||(G==null?void 0:G.size),Z=_,P=Me({name:"Checkbox",props:n,classes:q2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:u7}),{styleProps:I,rest:z}=Qi(W),F=yr(g),O=G?{checked:G.value.includes(z.value),onChange:te=>{G.onChange(te),$==null||$(te)}}:{},U=y.useRef(null),J=t||U;return y.useEffect(()=>{J&&"current"in J&&J.current&&(J.current.indeterminate=A||!1)},[A,J]),s.jsx(yp,{...P("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:F,size:X,labelPosition:C,label:m,description:R,error:D,disabled:E,classNames:r,styles:c,unstyled:u,"data-checked":O.checked||j||void 0,variant:T,ref:M,mod:Y,...I,...S,children:s.jsxs(ce,{...P("inner"),mod:{"data-label-position":C},children:[s.jsx(ce,{component:"input",id:F,ref:J,checked:j,disabled:E,mod:{error:!!D,indeterminate:A},...P("input",{focusable:!0,variant:T}),onChange:$,...z,...O,type:"checkbox"}),s.jsx(Z,{indeterminate:A,...P("icon")})]})})});Qn.classes={...q2,...$2};Qn.displayName="@mantine/core/Checkbox";Qn.Group=Xx;Qn.Indicator=Zx;Qn.Card=Yx;function fc(e){return"group"in e}function G2({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),a=[];for(let o=0;o<e.length;o+=1){const c=e[o];if(a.length===n)return a;fc(c)&&a.push({group:c.group,items:G2({options:c.items,search:t,limit:n-a.length})}),fc(c)||c.label.toLowerCase().includes(r)&&a.push(c)}return a}function d7(e){if(e.length===0)return!0;for(const t of e)if(!("group"in t)||t.items.length>0)return!1;return!0}function Q2(e,t=new Set){if(Array.isArray(e))for(const n of e)if(fc(n))Q2(n.items,t);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof n.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(t.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function f7(e,t){return Array.isArray(e)?e.includes(t):e===t}function W2({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:a,renderOption:o}){if(!fc(e)){const u=f7(n,e.value),f=t&&u&&s.jsx(xp,{className:kr.optionsDropdownCheckIcon}),p=s.jsxs(s.Fragment,{children:[r==="left"&&f,s.jsx("span",{children:e.label}),r==="right"&&f]});return s.jsx(ct.Option,{value:e.value,disabled:e.disabled,className:$t({[kr.optionsDropdownOption]:!a}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof o=="function"?o({option:e,checked:u}):p})}const c=e.items.map(u=>s.jsx(W2,{data:u,value:n,unstyled:a,withCheckIcon:t,checkIconPosition:r,renderOption:o},u.value));return s.jsx(ct.Group,{label:e.group,children:c})}function h7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:a,limit:o,maxDropdownHeight:c,withScrollArea:u=!0,filterOptions:f=!0,withCheckIcon:p=!1,value:m,checkIconPosition:g,nothingFoundMessage:v,unstyled:b,labelId:S,renderOption:j,scrollAreaProps:C,"aria-label":R}){Q2(e);const E=typeof a=="string"?(r||G2)({options:e,search:f?a:"",limit:o??1/0}):e,T=d7(E),A=E.map(_=>s.jsx(W2,{data:_,withCheckIcon:p,value:m,checkIconPosition:g,unstyled:b,renderOption:j},fc(_)?_.group:_.value));return s.jsx(ct.Dropdown,{hidden:t||n&&T,"data-composed":!0,children:s.jsxs(ct.Options,{labelledBy:S,"aria-label":R,children:[u?s.jsx(Yr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:A}):A,T&&v&&s.jsx(ct.Empty,{children:v})]})})}const Y2=y.createContext(null),p7=Y2.Provider;function m7(){return{withinGroup:!!y.useContext(Y2)}}var bp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const g7={},v7=(e,{spacing:t})=>({group:{"--ag-spacing":On(t)}}),Jx=me((e,t)=>{const n=se("AvatarGroup",g7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,spacing:p,...m}=n,g=Me({name:"AvatarGroup",classes:bp,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:v7,rootSelector:"group"});return s.jsx(p7,{value:!0,children:s.jsx(ce,{ref:t,...g("group"),...m})})});Jx.classes=bp;Jx.displayName="@mantine/core/AvatarGroup";function y7(e){return s.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function x7(e){let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}const b7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function S7(e,t=b7){const n=x7(e),r=Math.abs(n)%t.length;return t[r]}function w7(e,t=2){const n=e.split(" ");return n.length===1?e.slice(0,t).toUpperCase():n.map(r=>r[0]).slice(0,t).join("").toUpperCase()}const j7={},C7=(e,{size:t,radius:n,variant:r,gradient:a,color:o,autoContrast:c,name:u,allowedInitialsColors:f})=>{const p=o==="initials"&&typeof u=="string"?S7(u,f):o,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:a,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":nt(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Ft(n),"--avatar-bg":p||r?m.background:void 0,"--avatar-color":p||r?m.color:void 0,"--avatar-bd":p||r?m.border:void 0}}},Ns=lr((e,t)=>{const n=se("Avatar",j7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,src:p,alt:m,radius:g,color:v,gradient:b,imageProps:S,children:j,autoContrast:C,mod:R,name:D,allowedInitialsColors:E,...T}=n,A=m7(),[_,M]=y.useState(!p),L=Me({name:"Avatar",props:n,classes:bp,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:C7});return y.useEffect(()=>M(!p),[p]),s.jsx(ce,{...L("root"),mod:[{"within-group":A.withinGroup},R],ref:t,...T,children:_?s.jsx("span",{...L("placeholder"),title:m,children:j||typeof D=="string"&&w7(D)||s.jsx(y7,{})}):s.jsx("img",{...S,...L("image"),src:p,alt:m,onError:$=>{var V;M(!0),(V=S==null?void 0:S.onError)==null||V.call(S,$)}})})});Ns.classes=bp;Ns.displayName="@mantine/core/Avatar";Ns.Group=Jx;var K2={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const E7={},T7=(e,{radius:t,color:n,gradient:r,variant:a,size:o,autoContrast:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:c});return{root:{"--badge-height":nt(o,"badge-height"),"--badge-padding-x":nt(o,"badge-padding-x"),"--badge-fz":nt(o,"badge-fz"),"--badge-radius":t===void 0?void 0:Ft(t),"--badge-bg":n||a?u.background:void 0,"--badge-color":n||a?u.color:void 0,"--badge-bd":n||a?u.border:void 0,"--badge-dot-color":a==="dot"?Gt(n,e):void 0}}},Sp=lr((e,t)=>{const n=se("Badge",E7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,radius:p,color:m,gradient:g,leftSection:v,rightSection:b,children:S,variant:j,fullWidth:C,autoContrast:R,circle:D,mod:E,...T}=n,A=Me({name:"Badge",props:n,classes:K2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:T7});return s.jsxs(ce,{variant:j,mod:[{block:C,circle:D,"with-right-section":!!b,"with-left-section":!!v},E],...A("root",{variant:j}),ref:t,...T,children:[v&&s.jsx("span",{...A("section"),"data-position":"left",children:v}),s.jsx("span",{...A("label"),children:S}),b&&s.jsx("span",{...A("section"),"data-position":"right",children:b})]})});Sp.classes=K2;Sp.displayName="@mantine/core/Badge";var X2={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const R7={iconSize:48},D7=(e,{color:t,iconSize:n,radius:r})=>{const a=da({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),o=da({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":sa(o.value,.07),"--bq-bg-dark":sa(a.value,.06),"--bq-bd":Gt(t,e),"--bq-icon-size":le(n),"--bq-radius":Ft(r)}}},e0=me((e,t)=>{const n=se("Blockquote",R7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,icon:m,iconSize:g,cite:v,...b}=n,S=Me({name:"Blockquote",classes:X2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:D7});return s.jsxs(ce,{component:"blockquote",ref:t,...S("root"),...b,children:[m&&s.jsx("span",{...S("icon"),children:m}),p,v&&s.jsx("cite",{...S("cite"),children:v})]})});e0.classes=X2;e0.displayName="@mantine/core/Blockquote";var Ec={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const SC={orientation:"horizontal"},A7=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),t0=me((e,t)=>{const n=se("ButtonGroup",SC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,orientation:f,vars:p,borderWidth:m,variant:g,mod:v,...b}=se("ButtonGroup",SC,e),S=Me({name:"ButtonGroup",props:n,classes:Ec,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:p,varsResolver:A7,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},v],role:"group",...b})});t0.classes=Ec;t0.displayName="@mantine/core/ButtonGroup";const wC={},_7=(e,{radius:t,color:n,gradient:r,variant:a,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:o});return{groupSection:{"--section-height":nt(c,"section-height"),"--section-padding-x":nt(c,"section-padding-x"),"--section-fz":c!=null&&c.includes("compact")?Mn(c.replace("compact-","")):Mn(c),"--section-radius":t===void 0?void 0:Ft(t),"--section-bg":n||a?u.background:void 0,"--section-color":u.color,"--section-bd":n||a?u.border:void 0}}},n0=me((e,t)=>{const n=se("ButtonGroupSection",wC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,variant:p,gradient:m,radius:g,autoContrast:v,...b}=se("ButtonGroupSection",wC,e),S=Me({name:"ButtonGroupSection",props:n,classes:Ec,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:_7,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});n0.classes=Ec;n0.displayName="@mantine/core/ButtonGroupSection";const k7={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},P7={},N7=(e,{radius:t,color:n,gradient:r,variant:a,size:o,justify:c,autoContrast:u})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:u});return{root:{"--button-justify":c,"--button-height":nt(o,"button-height"),"--button-padding-x":nt(o,"button-padding-x"),"--button-fz":o!=null&&o.includes("compact")?Mn(o.replace("compact-","")):Mn(o),"--button-radius":t===void 0?void 0:Ft(t),"--button-bg":n||a?f.background:void 0,"--button-hover":n||a?f.hover:void 0,"--button-color":f.color,"--button-bd":n||a?f.border:void 0,"--button-hover-color":n||a?f.hoverColor:void 0}}},Pe=lr((e,t)=>{const n=se("Button",P7,e),{style:r,vars:a,className:o,color:c,disabled:u,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:v,radius:b,loading:S,loaderProps:j,gradient:C,classNames:R,styles:D,unstyled:E,"data-disabled":T,autoContrast:A,mod:_,...M}=n,L=Me({name:"Button",props:n,classes:Ec,className:o,style:r,classNames:R,styles:D,unstyled:E,vars:a,varsResolver:N7}),$=!!p,V=!!m;return s.jsxs(tr,{ref:t,...L("root",{active:!u&&!S&&!T}),unstyled:E,variant:v,disabled:u||S,mod:[{disabled:u||T,loading:S,block:g,"with-left-section":$,"with-right-section":V},_],...M,children:[s.jsx(di,{mounted:!!S,transition:k7,duration:150,children:Y=>s.jsx(ce,{component:"span",...L("loader",{style:Y}),"aria-hidden":!0,children:s.jsx(_r,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),s.jsxs("span",{...L("inner"),children:[p&&s.jsx(ce,{component:"span",...L("section"),mod:{position:"left"},children:p}),s.jsx(ce,{component:"span",mod:{loading:S},...L("label"),children:f}),m&&s.jsx(ce,{component:"span",...L("section"),mod:{position:"right"},children:m})]})]})});Pe.classes=Ec;Pe.displayName="@mantine/core/Button";Pe.Group=t0;Pe.GroupSection=n0;var Z2={root:"m_4451eb3a"};const O7={},er=lr((e,t)=>{const n=se("Center",O7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,inline:p,mod:m,...g}=n,v=Me({name:"Center",props:n,classes:Z2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f});return s.jsx(ce,{ref:t,mod:[{inline:p},m],...v("root"),...g})});er.classes=Z2;er.displayName="@mantine/core/Center";const[M7,I7]=Hi(),L7={};function J2(e){const{value:t,defaultValue:n,onChange:r,multiple:a,children:o}=se("ChipGroup",L7,e),[c,u]=Wn({value:t,defaultValue:n,finalValue:a?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,p=m=>{const g=m.currentTarget.value;Array.isArray(c)?u(c.includes(g)?c.filter(v=>v!==g):[...c,g]):u(g)};return s.jsx(M7,{value:{isChipSelected:f,onChange:p,multiple:a},children:o})}J2.displayName="@mantine/core/ChipGroup";var eD={root:"m_f59ffda3",label:"m_be049a53","label--outline":"m_3904c1af","label--filled":"m_fa109255","label--light":"m_f7e165c3",iconWrapper:"m_9ac86df9",checkIcon:"m_d6d72580",input:"m_bde07329"};const z7={type:"checkbox"},$7=(e,{size:t,radius:n,variant:r,color:a,autoContrast:o})=>{const c=e.variantColorResolver({color:a||e.primaryColor,theme:e,variant:r||"filled",autoContrast:o});return{root:{"--chip-fz":Mn(t),"--chip-size":nt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Ft(n),"--chip-checked-padding":nt(t,"chip-checked-padding"),"--chip-padding":nt(t,"chip-padding"),"--chip-icon-size":nt(t,"chip-icon-size"),"--chip-bg":a||r?c.background:void 0,"--chip-hover":a||r?c.hover:void 0,"--chip-color":a||r?c.color:void 0,"--chip-bd":a||r?c.border:void 0,"--chip-spacing":nt(t,"chip-spacing")}}},Zu=me((e,t)=>{const n=se("Chip",z7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,id:p,checked:m,defaultChecked:g,onChange:v,value:b,wrapperProps:S,type:j,disabled:C,children:R,size:D,variant:E,icon:T,rootRef:A,autoContrast:_,mod:M,...L}=n,$=Me({name:"Chip",classes:eD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:$7}),V=I7(),Y=yr(p),{styleProps:W,rest:G}=Qi(L),[X,Z]=Wn({value:m,defaultValue:g,finalValue:!1,onChange:v}),P=V?{checked:V.isChipSelected(b),onChange:z=>{V.onChange(z),v==null||v(z.currentTarget.checked)},type:V.multiple?"checkbox":"radio"}:{},I=P.checked||X;return s.jsxs(ce,{size:D,variant:E,ref:A,mod:M,...$("root"),...W,...S,children:[s.jsx("input",{type:j,...$("input"),checked:I,onChange:z=>Z(z.currentTarget.checked),id:Y,disabled:C,ref:t,value:b,...P,...G}),s.jsxs("label",{htmlFor:Y,"data-checked":I||void 0,"data-disabled":C||void 0,...$("label",{variant:E||"filled"}),children:[I&&s.jsx("span",{...$("iconWrapper"),children:T||s.jsx(xp,{...$("checkIcon")})}),s.jsx("span",{children:R})]})]})});Zu.classes=eD;Zu.displayName="@mantine/core/Chip";Zu.Group=J2;var tD={root:"m_b183c0a2"};const U7={},B7=(e,{color:t})=>({root:{"--code-bg":t?Gt(t,e):void 0}}),r0=me((e,t)=>{const n=se("Code",U7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,block:m,variant:g,mod:v,...b}=n,S=Me({name:"Code",props:n,classes:tD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:B7});return s.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},v],...S("root"),...b,dir:"ltr"})});r0.classes=tD;r0.displayName="@mantine/core/Code";var nD={root:"m_7485cace"};const V7={},F7=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:nt(t,"container-size")}}),a0=me((e,t)=>{const n=se("Container",V7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,fluid:p,mod:m,...g}=n,v=Me({name:"Container",classes:nD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:F7});return s.jsx(ce,{ref:t,mod:[{fluid:p},m],...v("root"),...g})});a0.classes=nD;a0.displayName="@mantine/core/Container";const H7={timeout:1e3};function rD(e){const{children:t,timeout:n,value:r,...a}=se("CopyButton",H7,e),o=rR({timeout:n}),c=()=>o.copy(r);return s.jsx(s.Fragment,{children:t({copy:c,copied:o.copied,...a})})}rD.displayName="@mantine/core/CopyButton";var aD={root:"m_3eebeb36",label:"m_9e365f20"};const q7={orientation:"horizontal"},G7=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Gt(t,e):void 0,"--divider-border-style":n,"--divider-size":nt(r,"divider-size")}}),jn=me((e,t)=>{const n=se("Divider",q7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,orientation:m,label:g,labelPosition:v,mod:b,...S}=n,j=Me({name:"Divider",classes:aD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:G7});return s.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...j("root"),...S,role:"separator",children:g&&s.jsx(ce,{component:"span",mod:{position:v},...j("label"),children:g})})});jn.classes=aD;jn.displayName="@mantine/core/Divider";function Q7({open:e,close:t,openDelay:n,closeDelay:r}){const a=y.useRef(-1),o=y.useRef(-1),c=()=>{window.clearTimeout(a.current),window.clearTimeout(o.current)},u=()=>{c(),n===0||n===void 0?e():a.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():o.current=window.setTimeout(t,r)};return y.useEffect(()=>c,[]),{openDropdown:u,closeDropdown:f}}const[jC,iD]=vr("Grid component was not found in tree"),by=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,CC=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":by(e,t),EC=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},TC=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function W7({span:e,order:t,offset:n,selector:r}){var b;const a=Sn(),o=iD(),c=o.breakpoints||a.breakpoints,f=ka(e)===void 0?12:ka(e),p=Fo({"--col-order":(b=ka(t))==null?void 0:b.toString(),"--col-flex-grow":EC(f,o.grow),"--col-flex-basis":by(f,o.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":CC(f,o.columns,o.grow),"--col-offset":TC(ka(n),o.columns)}),m=sn(c).reduce((S,j)=>{var C;return S[j]||(S[j]={}),typeof t=="object"&&t[j]!==void 0&&(S[j]["--col-order"]=(C=t[j])==null?void 0:C.toString()),typeof e=="object"&&e[j]!==void 0&&(S[j]["--col-flex-grow"]=EC(e[j],o.grow),S[j]["--col-flex-basis"]=by(e[j],o.columns),S[j]["--col-width"]=e[j]==="content"?"auto":void 0,S[j]["--col-max-width"]=CC(e[j],o.columns,o.grow)),typeof n=="object"&&n[j]!==void 0&&(S[j]["--col-offset"]=TC(n[j],o.columns)),S},{}),v=Wu(sn(m),c).filter(S=>sn(m[S.value]).length>0).map(S=>({query:o.type==="container"?`mantine-grid (min-width: ${c[S.value]})`:`(min-width: ${c[S.value]})`,styles:m[S.value]}));return s.jsx(Gs,{styles:p,media:o.type==="container"?void 0:v,container:o.type==="container"?v:void 0,selector:r})}var i0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const Y7={span:12},o0=me((e,t)=>{const n=se("GridCol",Y7,e),{classNames:r,className:a,style:o,styles:c,vars:u,span:f,order:p,offset:m,...g}=n,v=iD(),b=ud();return s.jsxs(s.Fragment,{children:[s.jsx(W7,{selector:`.${b}`,span:f,order:p,offset:m}),s.jsx(ce,{ref:t,...v.getStyles("col",{className:$t(a,b),style:o,classNames:r,styles:c}),...g})]})});o0.classes=i0;o0.displayName="@mantine/core/GridCol";function RC({gutter:e,selector:t,breakpoints:n,type:r}){const a=Sn(),o=n||a.breakpoints,c=Fo({"--grid-gutter":On(ka(e))}),u=sn(o).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=On(e[g])),m),{}),p=Wu(sn(u),o).filter(m=>sn(u[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${o[m.value]})`:`(min-width: ${o[m.value]})`,styles:u[m.value]}));return s.jsx(Gs,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const K7={gutter:"md",grow:!1,columns:12},X7=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),or=me((e,t)=>{const n=se("Grid",K7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,grow:p,gutter:m,columns:g,align:v,justify:b,children:S,breakpoints:j,type:C,...R}=n,D=Me({name:"Grid",classes:i0,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:X7}),E=ud();return C==="container"&&j?s.jsxs(jC,{value:{getStyles:D,grow:p,columns:g||12,breakpoints:j,type:C},children:[s.jsx(RC,{selector:`.${E}`,...n}),s.jsx("div",{...D("container"),children:s.jsx(ce,{ref:t,...D("root",{className:E}),...R,children:s.jsx("div",{...D("inner"),children:S})})})]}):s.jsxs(jC,{value:{getStyles:D,grow:p,columns:g||12,breakpoints:j,type:C},children:[s.jsx(RC,{selector:`.${E}`,...n}),s.jsx(ce,{ref:t,...D("root",{className:E}),...R,children:s.jsx("div",{...D("inner"),children:S})})]})});or.classes=i0;or.displayName="@mantine/core/Grid";or.Col=o0;function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ph.apply(null,arguments)}function s0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Z7=y.useLayoutEffect,J7=function(t){var n=Cn.useRef(t);return Z7(function(){n.current=t}),n},DC=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},eI=function(t,n){var r=Cn.useRef();return Cn.useCallback(function(a){t.current=a,r.current&&DC(r.current,null),r.current=n,n&&DC(n,a)},[n])},AC={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},tI=function(t){Object.keys(AC).forEach(function(n){t.style.setProperty(n,AC[n],"important")})},_C=tI,dr=null,kC=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function nI(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),dr||(dr=document.createElement("textarea"),dr.setAttribute("tabindex","-1"),dr.setAttribute("aria-hidden","true"),_C(dr)),dr.parentNode===null&&document.body.appendChild(dr);var a=e.paddingSize,o=e.borderSize,c=e.sizingStyle,u=c.boxSizing;Object.keys(c).forEach(function(v){var b=v;dr.style[b]=c[b]}),_C(dr),dr.value=t;var f=kC(dr,e);dr.value=t,f=kC(dr,e),dr.value="x";var p=dr.scrollHeight-a,m=p*n;u==="border-box"&&(m=m+a+o),f=Math.max(m,f);var g=p*r;return u==="border-box"&&(g=g+a+o),f=Math.min(g,f),[f,p]}var PC=function(){},rI=function(t,n){return t.reduce(function(r,a){return r[a]=n[a],r},{})},aI=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],iI=!!document.documentElement.currentStyle,oI=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=rI(aI,n),a=r.boxSizing;if(a==="")return null;iI&&a==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:c}},sI=oI;function l0(e,t,n){var r=J7(n);y.useLayoutEffect(function(){var a=function(c){return r.current(c)};if(e)return e.addEventListener(t,a),function(){return e.removeEventListener(t,a)}},[])}var lI=function(t,n){l0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},cI=function(t){l0(window,"resize",t)},uI=function(t){l0(document.fonts,"loadingdone",t)},dI=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],fI=function(t,n){var r=t.cacheMeasurements,a=t.maxRows,o=t.minRows,c=t.onChange,u=c===void 0?PC:c,f=t.onHeightChange,p=f===void 0?PC:f,m=s0(t,dI),g=m.value!==void 0,v=y.useRef(null),b=eI(v,n),S=y.useRef(0),j=y.useRef(),C=function(){var E=v.current,T=r&&j.current?j.current:sI(E);if(T){j.current=T;var A=nI(T,E.value||E.placeholder||"x",o,a),_=A[0],M=A[1];S.current!==_&&(S.current=_,E.style.setProperty("height",_+"px","important"),p(_,{rowHeight:M}))}},R=function(E){g||C(),u(E)};return y.useLayoutEffect(C),lI(v,function(){if(!g){var D=v.current.value;requestAnimationFrame(function(){var E=v.current;E&&D!==E.value&&C()})}}),cI(C),uI(C),y.createElement("textarea",Ph({},m,{onChange:R,ref:b}))},hI=y.forwardRef(fI);const pI={},Ws=me((e,t)=>{const{autosize:n,maxRows:r,minRows:a,__staticSelector:o,resize:c,...u}=se("Textarea",pI,e),f=n&&uR()!=="test",p=f?{maxRows:r,minRows:a}:{};return s.jsx(Pr,{component:f?hI:"textarea",ref:t,...u,__staticSelector:o||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});Ws.classes=Pr.classes;Ws.displayName="@mantine/core/Textarea";function NC(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const mI={serialize:JSON.stringify,deserialize:JSON.parse},Tc=me((e,t)=>{const{value:n,defaultValue:r,onChange:a,formatOnBlur:o,validationError:c,serialize:u,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:v,...b}=se("JsonInput",mI,e),[S,j]=Wn({value:n,defaultValue:r,finalValue:"",onChange:a}),[C,R]=y.useState(NC(S,f)),D=T=>{p==null||p(T),R(!0)},E=T=>{typeof m=="function"&&m(T);const A=NC(T.currentTarget.value,f);o&&!g&&A&&T.currentTarget.value.trim()!==""&&j(u(f(T.currentTarget.value),null,2)),R(A)};return s.jsx(Ws,{value:S,onChange:T=>j(T.currentTarget.value),onFocus:D,onBlur:E,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?v:c||!0,"data-monospace":!0})});Tc.classes=Pr.classes;Tc.displayName="@mantine/core/JsonInput";const[gI,vI]=vr("List component was not found in tree");var c0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const yI={},u0=me((e,t)=>{const n=se("ListItem",yI,e),{classNames:r,className:a,style:o,styles:c,vars:u,icon:f,children:p,mod:m,...g}=n,v=vI(),b=f||v.icon,S={classNames:r,styles:c};return s.jsx(ce,{...v.getStyles("item",{...S,className:a,style:o}),component:"li",mod:[{"with-icon":!!b,centered:v.center},m],ref:t,...g,children:s.jsxs("div",{...v.getStyles("itemWrapper",S),children:[b&&s.jsx("span",{...v.getStyles("itemIcon",S),children:b}),s.jsx("span",{...v.getStyles("itemLabel",S),children:p})]})})});u0.classes=c0;u0.displayName="@mantine/core/ListItem";const xI={type:"unordered"},bI=(e,{size:t,spacing:n})=>({root:{"--list-fz":Mn(t),"--list-lh":nR(t),"--list-spacing":On(n)}}),pr=me((e,t)=>{const n=se("List",xI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,type:m,withPadding:g,icon:v,spacing:b,center:S,listStyleType:j,mod:C,...R}=n,D=Me({name:"List",classes:c0,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:bI});return s.jsx(gI,{value:{center:S,icon:v,getStyles:D},children:s.jsx(ce,{...D("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g},C],ref:t,...R,children:p})})});pr.classes=c0;pr.displayName="@mantine/core/List";pr.Item=u0;var oD={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const OC={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Wr("overlay")},SI=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),d0=me((e,t)=>{const n=se("LoadingOverlay",OC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:v,zIndex:b,...S}=n,j=Sn(),C=Me({name:"LoadingOverlay",classes:oD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:SI}),R={...OC.overlayProps,...g};return s.jsx(di,{transition:"fade",...p,mounted:!!v,children:D=>s.jsxs(ce,{...C("root",{style:D}),ref:t,...S,children:[s.jsx(_r,{...C("loader"),unstyled:u,...m}),s.jsx(uc,{...R,...C("overlay"),darkHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.white}),s.jsx(uc,{...R,...C("overlay"),lightHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.colors.dark[5]})]})})});d0.classes=oD;d0.displayName="@mantine/core/LoadingOverlay";const[wI,vd]=vr("Menu component was not found in the tree");var Rc={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const jI={},f0=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("MenuDivider",jI,e),f=vd();return s.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:a,styles:o,classNames:n}),...u})});f0.classes=Rc;f0.displayName="@mantine/core/MenuDivider";const CI={},h0=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,onMouseEnter:u,onMouseLeave:f,onKeyDown:p,children:m,...g}=se("MenuDropdown",CI,e),v=y.useRef(null),b=vd(),S=Rr(p,R=>{var D,E;(R.key==="ArrowUp"||R.key==="ArrowDown")&&(R.preventDefault(),(E=(D=v.current)==null?void 0:D.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||E.focus())}),j=Rr(u,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=Rr(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return s.jsxs(La.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:$n(t,v),...b.getStyles("dropdown",{className:r,style:a,styles:o,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[b.withInitialFocusPlaceholder&&s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});h0.classes=Rc;h0.displayName="@mantine/core/MenuDropdown";const EI={},p0=lr((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,color:u,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:v,"data-disabled":b,...S}=se("MenuItem",EI,e),j=vd(),C=Sn(),{dir:R}=Qs(),D=y.useRef(null),E=j.getItemIndex(D.current),T=S,A=Rr(T.onMouseLeave,()=>j.setHovered(-1)),_=Rr(T.onMouseEnter,()=>j.setHovered(j.getItemIndex(D.current))),M=Rr(T.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),L=Rr(T.onFocus,()=>j.setHovered(j.getItemIndex(D.current))),$=u?C.variantColorResolver({color:u,theme:C,variant:"light"}):void 0,V=u?da({color:u,theme:C}):null;return s.jsxs(tr,{...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,onFocus:L,...j.getStyles("item",{className:r,style:a,styles:o,classNames:n}),ref:$n(D,t),role:"menuitem",disabled:v,"data-menu-item":!0,"data-disabled":v||b||void 0,"data-hovered":j.hovered===E?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:_,onMouseLeave:A,onClick:M,onKeyDown:tR({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:T.onKeyDown}),__vars:{"--menu-item-color":V!=null&&V.isThemeColor&&(V==null?void 0:V.shade)===void 0?`var(--mantine-color-${V.color}-6)`:$==null?void 0:$.color,"--menu-item-hover":$==null?void 0:$.hover},children:[p&&s.jsx("div",{...j.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"left",children:p}),g&&s.jsx("div",{...j.getStyles("itemLabel",{styles:o,classNames:n}),children:g}),m&&s.jsx("div",{...j.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"right",children:m})]})});p0.classes=Rc;p0.displayName="@mantine/core/MenuItem";const TI={},m0=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("MenuLabel",TI,e),f=vd();return s.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:a,styles:o,classNames:n}),...u})});m0.classes=Rc;m0.displayName="@mantine/core/MenuLabel";const RI={refProp:"ref"},sD=y.forwardRef((e,t)=>{const{children:n,refProp:r,...a}=se("MenuTarget",RI,e);if(!Fi(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const o=vd(),c=n.props,u=Rr(c.onClick,()=>{o.trigger==="click"?o.toggleDropdown():o.trigger==="click-hover"&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),f=Rr(c.onMouseEnter,()=>(o.trigger==="hover"||o.trigger==="click-hover")&&o.openDropdown()),p=Rr(c.onMouseLeave,()=>{(o.trigger==="hover"||o.trigger==="click-hover"&&!o.openedViaClick)&&o.closeDropdown()});return s.jsx(La.Target,{refProp:r,popupType:"menu",ref:t,...a,children:y.cloneElement(n,{onClick:u,onMouseEnter:f,onMouseLeave:p,"data-expanded":o.opened?!0:void 0})})});sD.displayName="@mantine/core/MenuTarget";const DI={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function je(e){const t=se("Menu",DI,e),{children:n,onOpen:r,onClose:a,opened:o,defaultOpened:c,trapFocus:u,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:v,openDelay:b,closeDelay:S,classNames:j,styles:C,unstyled:R,variant:D,vars:E,menuItemTabIndex:T,keepMounted:A,withInitialFocusPlaceholder:_,...M}=t,L=Me({name:"Menu",classes:Rc,props:t,classNames:j,styles:C,unstyled:R}),[$,{setHovered:V,resetHovered:Y}]=G3(),[W,G]=Wn({value:o,defaultValue:c,finalValue:!1,onChange:f}),[X,Z]=y.useState(!1),P=()=>{G(!1),Z(!1),W&&(a==null||a())},I=()=>{G(!0),!W&&(r==null||r())},z=()=>{W?P():I()},{openDropdown:F,closeDropdown:O}=Q7({open:I,close:P,closeDelay:S,openDelay:b}),U=ye=>q3("[data-menu-item]","[data-menu-dropdown]",ye),{resolvedClassNames:J,resolvedStyles:te}=Hs({classNames:j,styles:C,props:t});return Li(()=>{Y()},[W]),s.jsx(wI,{value:{getStyles:L,opened:W,toggleDropdown:z,getItemIndex:U,hovered:$,setHovered:V,openedViaClick:X,setOpenedViaClick:Z,closeOnItemClick:p,closeDropdown:v==="click"?P:O,openDropdown:v==="click"?I:F,closeDropdownImmediately:P,loop:m,trigger:v,unstyled:R,menuItemTabIndex:T,withInitialFocusPlaceholder:_},children:s.jsx(La,{...M,opened:W,onChange:z,defaultOpened:c,trapFocus:A?!1:u,closeOnEscape:g,__staticSelector:"Menu",classNames:J,styles:te,unstyled:R,variant:D,keepMounted:A,children:n})})}je.extend=e=>e;je.withProps=TO(je);je.classes=Rc;je.displayName="@mantine/core/Menu";je.Item=p0;je.Label=m0;je.Dropdown=h0;je.Target=sD;je.Divider=f0;const[AI,Dc]=vr("Modal component was not found in tree");var Ki={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const _I={},wp=me((e,t)=>{const n=se("ModalBody",_I,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=Dc();return s.jsx(y2,{ref:t,...p.getStyles("body",{classNames:r,style:o,styles:c,className:a}),...f})});wp.classes=Ki;wp.displayName="@mantine/core/ModalBody";const kI={},jp=me((e,t)=>{const n=se("ModalCloseButton",kI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=Dc();return s.jsx(x2,{ref:t,...p.getStyles("close",{classNames:r,style:o,styles:c,className:a}),...f})});jp.classes=Ki;jp.displayName="@mantine/core/ModalCloseButton";const PI={},Cp=me((e,t)=>{const n=se("ModalContent",PI,e),{classNames:r,className:a,style:o,styles:c,vars:u,children:f,__hidden:p,...m}=n,g=Dc(),v=g.scrollAreaComponent||H9;return s.jsx(b2,{...g.getStyles("content",{className:a,style:o,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:a,style:o,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...m,children:s.jsx(v,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});Cp.classes=Ki;Cp.displayName="@mantine/core/ModalContent";const NI={},Ep=me((e,t)=>{const n=se("ModalHeader",NI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=Dc();return s.jsx(S2,{ref:t,...p.getStyles("header",{classNames:r,style:o,styles:c,className:a}),...f})});Ep.classes=Ki;Ep.displayName="@mantine/core/ModalHeader";const OI={},Tp=me((e,t)=>{const n=se("ModalOverlay",OI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=Dc();return s.jsx(w2,{ref:t,...p.getStyles("overlay",{classNames:r,style:o,styles:c,className:a}),...f})});Tp.classes=Ki;Tp.displayName="@mantine/core/ModalOverlay";const MI={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},II=(e,{radius:t,size:n,yOffset:r,xOffset:a})=>({root:{"--modal-radius":t===void 0?void 0:Ft(t),"--modal-size":nt(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(a)}}),Rp=me((e,t)=>{const n=se("ModalRoot",MI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:v,centered:b,xOffset:S,__staticSelector:j,...C}=n,R=Me({name:j,classes:Ki,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:II});return s.jsx(AI,{value:{yOffset:p,scrollAreaComponent:m,getStyles:R,fullScreen:v},children:s.jsx(v2,{ref:t,...R("root"),"data-full-screen":v||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Yr.Autosize||void 0,unstyled:u,...C})})});Rp.classes=Ki;Rp.displayName="@mantine/core/ModalRoot";const[LI,zI]=Hi();function lD({children:e}){const[t,n]=y.useState([]),[r,a]=y.useState(Wr("modal"));return s.jsx(LI,{value:{stack:t,addModal:(o,c)=>{n(u=>[...new Set([...u,o])]),a(u=>typeof c=="number"&&typeof u=="number"?Math.max(u,c):u)},removeModal:o=>n(c=>c.filter(u=>u!==o)),getZIndex:o=>`calc(${r} + ${t.indexOf(o)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}lD.displayName="@mantine/core/ModalStack";const $I={},Dp=me((e,t)=>{const n=se("ModalTitle",$I,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=Dc();return s.jsx(j2,{ref:t,...p.getStyles("title",{classNames:r,style:o,styles:c,className:a}),...f})});Dp.classes=Ki;Dp.displayName="@mantine/core/ModalTitle";const UI={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Un=me((e,t)=>{const{title:n,withOverlay:r,overlayProps:a,withCloseButton:o,closeButtonProps:c,children:u,radius:f,opened:p,stackId:m,zIndex:g,...v}=se("Modal",UI,e),b=zI(),S=!!n||o,j=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:p;return y.useEffect(()=>{b&&m&&(p?b.addModal(m,g||Wr("modal")):b.removeModal(m))},[p,m,g]),s.jsxs(Rp,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...v,...j,children:[r&&s.jsx(Tp,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...a}),s.jsxs(Cp,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[S&&s.jsxs(Ep,{children:[n&&s.jsx(Dp,{children:n}),o&&s.jsx(jp,{...c})]}),s.jsx(wp,{children:u})]})]})});Un.classes=Ki;Un.displayName="@mantine/core/Modal";Un.Root=Rp;Un.Overlay=Tp;Un.Content=Cp;Un.Body=wp;Un.Header=Ep;Un.Title=Dp;Un.CloseButton=jp;Un.Stack=lD;const[BI,g0]=Hi(),[VI,FI]=Hi();var Ap={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const HI={},qI=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?nt(t):nt(n,"pg-gap")}}),v0=me((e,t)=>{const n=se("PillGroup",HI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,disabled:m,...g}=n,v=g0(),b=(v==null?void 0:v.size)||p||void 0,S=Me({name:"PillGroup",classes:Ap,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:qI,stylesCtx:{size:b},rootSelector:"group"});return s.jsx(VI,{value:{size:b,disabled:m},children:s.jsx(ce,{ref:t,size:b,...S("group"),...g})})});v0.classes=Ap;v0.displayName="@mantine/core/PillGroup";const GI={variant:"default"},QI=(e,{radius:t},{size:n})=>({root:{"--pill-fz":nt(n,"pill-fz"),"--pill-height":nt(n,"pill-height"),"--pill-radius":t===void 0?void 0:Ft(t)}}),Os=me((e,t)=>{const n=se("Pill",GI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:v,removeButtonProps:b,radius:S,size:j,disabled:C,mod:R,...D}=n,E=FI(),T=g0(),A=j||(E==null?void 0:E.size)||void 0,_=(T==null?void 0:T.variant)==="filled"?"contrast":p||"default",M=Me({name:"Pill",classes:Ap,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:QI,stylesCtx:{size:A}});return s.jsxs(ce,{component:"span",ref:t,variant:_,size:A,...M("root",{variant:_}),mod:[{"with-remove":g&&!C,disabled:C||(E==null?void 0:E.disabled)},R],...D,children:[s.jsx("span",{...M("label"),children:m}),g&&s.jsx(qo,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:u,...b,...M("remove",{className:b==null?void 0:b.className,style:b==null?void 0:b.style}),onMouseDown:L=>{var $;L.preventDefault(),L.stopPropagation(),($=b==null?void 0:b.onMouseDown)==null||$.call(b,L)},onClick:L=>{var $;L.stopPropagation(),v==null||v(),($=b==null?void 0:b.onClick)==null||$.call(b,L)}})]})});Os.classes=Ap;Os.displayName="@mantine/core/Pill";Os.Group=v0;var cD={field:"m_45c4369d"};const WI={type:"visible"},y0=me((e,t)=>{const n=se("PillsInputField",WI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,type:p,disabled:m,id:g,pointer:v,mod:b,...S}=n,j=g0(),C=jc(),R=Me({name:"PillsInputField",classes:cD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"field"}),D=m||(j==null?void 0:j.disabled);return s.jsx(ce,{component:"input",ref:$n(t,j==null?void 0:j.fieldRef),"data-type":p,disabled:D,mod:[{disabled:D,pointer:v},b],...R("field"),...S,id:(C==null?void 0:C.inputId)||g,"aria-invalid":j==null?void 0:j.hasError,"aria-describedby":C==null?void 0:C.describedBy,type:"text",onMouseDown:E=>!v&&E.stopPropagation()})});y0.classes=cD;y0.displayName="@mantine/core/PillsInputField";const YI={},hc=me((e,t)=>{const n=se("PillsInput",YI,e),{children:r,onMouseDown:a,onClick:o,size:c,disabled:u,__staticSelector:f,error:p,variant:m,...g}=n,v=y.useRef(null);return s.jsx(BI,{value:{fieldRef:v,size:c,disabled:u,hasError:!!p,variant:m},children:s.jsx(Pr,{size:c,error:p,variant:m,component:"div",ref:t,onMouseDown:b=>{var S;b.preventDefault(),a==null||a(b),(S=v.current)==null||S.focus()},onClick:b=>{var j;b.preventDefault();const S=b.currentTarget.closest("fieldset");S!=null&&S.disabled||((j=v.current)==null||j.focus(),o==null||o(b))},...g,multiline:!0,disabled:u,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});hc.displayName="@mantine/core/PillsInput";hc.Field=y0;function KI({data:e,value:t}){const n=t.map(a=>a.trim().toLowerCase());return e.reduce((a,o)=>(fc(o)?a.push({group:o.group,items:o.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(o.value.toLowerCase().trim())===-1&&a.push(o),a),[])}const XI={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},yd=me((e,t)=>{const n=se("MultiSelect",XI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,value:m,defaultValue:g,onChange:v,onKeyDown:b,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:R,onDropdownOpen:D,onDropdownClose:E,selectFirstOptionOnChange:T,onOptionSubmit:A,comboboxProps:_,filter:M,limit:L,withScrollArea:$,maxDropdownHeight:V,searchValue:Y,defaultSearchValue:W,onSearchChange:G,readOnly:X,disabled:Z,onFocus:P,onBlur:I,onPaste:z,radius:F,rightSection:O,rightSectionWidth:U,rightSectionPointerEvents:J,rightSectionProps:te,leftSection:ye,leftSectionWidth:be,leftSectionPointerEvents:ve,leftSectionProps:Ge,inputContainer:ke,inputWrapperOrder:et,withAsterisk:Re,labelProps:ft,descriptionProps:Ut,errorProps:Ot,wrapperProps:xt,description:Ht,label:Bt,error:Se,maxValues:Ne,searchable:Ve,nothingFoundMessage:Te,withCheckIcon:ge,checkIconPosition:we,hidePickedOptions:Le,withErrorStyles:xe,name:$e,form:gt,id:ht,clearable:Wt,clearButtonProps:_t,hiddenInputProps:mn,placeholder:St,hiddenInputValuesDivider:Ba,required:ba,mod:pi,renderOption:Sa,onRemove:Yn,onClear:xr,scrollAreaProps:al,chevronColor:no,...Xo}=n,Va=yr(ht),wa=k2(j),ja=P2(wa),kn=gd({opened:C,defaultOpened:R,onDropdownOpen:D,onDropdownClose:()=>{E==null||E(),kn.resetSelectedOption()}}),{styleProps:mi,rest:{type:il,autoComplete:Zo,...H}}=Qi(Xo),[Q,re]=Wn({value:m,defaultValue:g,finalValue:[],onChange:v}),[he,Ee]=Wn({value:Y,defaultValue:W,finalValue:"",onChange:G}),Be=at=>{Ee(at),kn.resetSelectedOption()},tt=Me({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:u}),{resolvedClassNames:Ue,resolvedStyles:Xe}=Hs({props:n,styles:c,classNames:r}),Ze=at=>{b==null||b(at),at.key===" "&&!Ve&&(at.preventDefault(),kn.toggleDropdown()),at.key==="Backspace"&&he.length===0&&Q.length>0&&(Yn==null||Yn(Q[Q.length-1]),re(Q.slice(0,Q.length-1)))},rt=Q.map((at,rn)=>{var kt,jt;return s.jsx(Os,{withRemoveButton:!X&&!((kt=ja[at])!=null&&kt.disabled),onRemove:()=>{re(Q.filter(Fa=>at!==Fa)),Yn==null||Yn(at)},unstyled:u,disabled:Z,...tt("pill"),children:((jt=ja[at])==null?void 0:jt.label)||at},`${at}-${rn}`)});y.useEffect(()=>{T&&kn.selectFirstOption()},[T,he]);const Ye=s.jsx(ct.ClearButton,{..._t,onClear:()=>{xr==null||xr(),re([]),Be("")}}),lt=KI({data:wa,value:Q}),At=Wt&&Q.length>0&&!Z&&!X;return s.jsxs(s.Fragment,{children:[s.jsxs(ct,{store:kn,classNames:Ue,styles:Xe,unstyled:u,size:p,readOnly:X,__staticSelector:"MultiSelect",onOptionSubmit:at=>{A==null||A(at),Be(""),kn.updateSelectedOptionIndex("selected"),Q.includes(ja[at].value)?(re(Q.filter(rn=>rn!==ja[at].value)),Yn==null||Yn(ja[at].value)):Q.length<Ne&&re([...Q,ja[at].value])},..._,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(hc,{...mi,__staticSelector:"MultiSelect",classNames:Ue,styles:Xe,unstyled:u,size:p,className:a,style:o,variant:S,disabled:Z,radius:F,__defaultRightSection:s.jsx(ct.Chevron,{size:p,error:Se,unstyled:u,color:no}),__clearSection:Ye,__clearable:At,rightSection:O,rightSectionPointerEvents:J||(Ye?"all":"none"),rightSectionWidth:U,rightSectionProps:te,leftSection:ye,leftSectionWidth:be,leftSectionPointerEvents:ve,leftSectionProps:Ge,inputContainer:ke,inputWrapperOrder:et,withAsterisk:Re,labelProps:ft,descriptionProps:Ut,errorProps:Ot,wrapperProps:xt,description:Ht,label:Bt,error:Se,withErrorStyles:xe,__stylesApiProps:{...n,rightSectionPointerEvents:J||(At?"all":"none"),multiline:!0},pointer:!Ve,onClick:()=>Ve?kn.openDropdown():kn.toggleDropdown(),"data-expanded":kn.dropdownOpened||void 0,id:Va,required:ba,mod:pi,children:s.jsxs(Os.Group,{disabled:Z,unstyled:u,...tt("pillsList"),children:[rt,s.jsx(ct.EventsTarget,{autoComplete:Zo,children:s.jsx(hc.Field,{...H,ref:t,id:Va,placeholder:St,type:!Ve&&!St?"hidden":"visible",...tt("inputField"),unstyled:u,onFocus:at=>{P==null||P(at),Ve&&kn.openDropdown()},onBlur:at=>{I==null||I(at),kn.closeDropdown(),Be("")},onKeyDown:Ze,value:he,onChange:at=>{Be(at.currentTarget.value),Ve&&kn.openDropdown(),T&&kn.selectFirstOption()},disabled:Z,readOnly:X||!Ve,pointer:!Ve})})]})})}),s.jsx(h7,{data:Le?lt:wa,hidden:X||Z,filter:M,search:he,limit:L,hiddenWhenEmpty:!Te,withScrollArea:$,maxDropdownHeight:V,filterOptions:Ve,value:Q,checkIconPosition:we,withCheckIcon:ge,nothingFoundMessage:Te,unstyled:u,labelId:Bt?`${Va}-label`:void 0,"aria-label":Bt?void 0:Xo["aria-label"],renderOption:Sa,scrollAreaProps:al})]}),s.jsx(ct.HiddenInput,{name:$e,valuesDivider:Ba,value:Q,form:gt,disabled:Z,...mn})]})});yd.classes={...Pr.classes,...ct.classes};yd.displayName="@mantine/core/MultiSelect";function ZI(e){return"group"in e}function x0({data:e}){if(ZI(e)){const a=e.items.map(o=>s.jsx(x0,{data:o},o.value));return s.jsx("optgroup",{label:e.group,children:a})}const{value:t,label:n,...r}=e;return s.jsx("option",{value:e.value,...r,children:e.label},e.value)}x0.displayName="@mantine/core/NativeSelectOption";const JI={rightSectionPointerEvents:"none"},ln=me((e,t)=>{const{data:n,children:r,size:a,error:o,rightSection:c,unstyled:u,...f}=se("NativeSelect",JI,e),p=k2(n).map((m,g)=>s.jsx(x0,{data:m},g));return s.jsx(Pr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:a,pointer:!0,error:o,unstyled:u,rightSection:c||s.jsx(vp,{size:a,error:o,unstyled:u}),children:r||p})});ln.classes=Pr.classes;ln.displayName="@mantine/core/NativeSelect";var uD={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const e6={withCloseButton:!0},t6=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Ft(t),"--notification-color":n?Gt(n,e):void 0}}),b0=me((e,t)=>{const n=se("Notification",e6,e),{className:r,color:a,radius:o,loading:c,withCloseButton:u,withBorder:f,title:p,icon:m,children:g,onClose:v,closeButtonProps:b,classNames:S,style:j,styles:C,unstyled:R,variant:D,vars:E,mod:T,loaderProps:A,role:_,...M}=n,L=Me({name:"Notification",classes:uD,props:n,className:r,style:j,classNames:S,styles:C,unstyled:R,vars:E,varsResolver:t6});return s.jsxs(ce,{...L("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},T],ref:t,variant:D,role:_||"alert",...M,children:[m&&!c&&s.jsx("div",{...L("icon"),children:m}),c&&s.jsx(_r,{size:28,color:a,...A,...L("loader")}),s.jsxs("div",{...L("body"),children:[p&&s.jsx("div",{...L("title"),children:p}),s.jsx(ce,{...L("description"),mod:{"data-with-title":!!p},children:g})]}),u&&s.jsx(qo,{iconSize:16,color:"gray",...b,unstyled:R,onClick:v,...L("closeButton")})]})});b0.classes=uD;b0.displayName="@mantine/core/Notification";function dD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}var Ju;(function(e){e.event="event",e.props="prop"})(Ju||(Ju={}));function Mo(){}function n6(e){var t,n=void 0;return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return t&&r.length===t.length&&r.every(function(o,c){return o===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function ed(e){return!!(e||"").match(/\d/)}function rc(e){return e==null}function r6(e){return typeof e=="number"&&isNaN(e)}function fD(e){return rc(e)||r6(e)||typeof e=="number"&&!isFinite(e)}function hD(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function a6(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function i6(e,t,n){var r=a6(n),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(r,"$1"+t)}function o6(e){var t=y.useRef(e);t.current=e;var n=y.useRef(function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return t.current.apply(t,r)});return n.current}function S0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var a=e.split("."),o=a[0],c=a[1]||"";return{beforeDecimal:o,afterDecimal:c,hasNegation:n,addNegation:r}}function s6(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",a=n[1]||"";return(t?"-":"")+r+(a?"."+a:"")}function pD(e,t,n){for(var r="",a=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||a;return r}function MC(e,t){return Array(t+1).join(e)}function mD(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),a=r[0],o=r[1];if(o=Number(o),!o)return n+a;a=a.replace(".","");var c=1+o,u=a.length;return c<0?a="0."+MC("0",Math.abs(c))+a:c>=u?a=a+MC("0",c-u):a=(a.substring(0,c)||"0")+"."+a.substring(c),n+a}function IC(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,a=S0(e),o=a.beforeDecimal,c=a.afterDecimal,u=a.hasNegation,f=parseFloat("0."+(c||"0")),p=c.length<=t?"0."+c:f.toFixed(t),m=p.split("."),g=o;o&&Number(m[0])&&(g=o.split("").reverse().reduce(function(j,C,R){return j.length>R?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var v=pD(m[1]||"",t,n),b=u?"-":"",S=r?".":"";return""+b+g+S+v}function ws(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var gD=n6(function(e,t){for(var n=0,r=0,a=e.length,o=t.length;e[n]===t[n]&&n<a;)n++;for(;e[a-1-r]===t[o-1-r]&&o-r>n&&a-r>n;)r++;return{from:{start:n,end:a-r},to:{start:n,end:o-r}}}),l6=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function c6(e,t,n){return Math.min(Math.max(e,t),n)}function kv(e){return Math.max(e.selectionStart,e.selectionEnd)}function u6(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function d6(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function f6(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,a=e.formattedValueIndex;return t[r]===n[a]}function h6(e,t,n,r,a,o,c){c===void 0&&(c=f6);var u=a.findIndex(function(T){return T}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var p=n.length,m=e.length,g={},v=new Array(p),b=0;b<p;b++){v[b]=-1;for(var S=0,j=m;S<j;S++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:S});if(C&&g[S]!==!0){v[b]=S,g[S]=!0;break}}}for(var R=r;R<p&&(v[R]===-1||!o(n[R]));)R++;var D=R===p||v[R]===-1?m:v[R];for(R=r-1;R>0&&v[R]===-1;)R--;var E=R===-1||v[R]===-1?0:v[R]+1;return E>D?D:r-E<D-r?E:D}function LC(e,t,n,r){var a=e.length;if(t=c6(t,0,a),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=a&&!n[t];)t++;t>a&&(t=n.lastIndexOf(!0))}return t===-1&&(t=a),t}function p6(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(ed(e[n])||ed(e[n-1]));return t}function vD(e,t,n,r,a,o){o===void 0&&(o=Mo);var c=o6(function(S,j){var C,R;return fD(S)?(R="",C=""):typeof S=="number"||j?(R=typeof S=="number"?mD(S):S,C=r(R)):(R=a(S,void 0),C=r(R)),{formattedValue:C,numAsString:R}}),u=y.useState(function(){return c(rc(e)?t:e,n)}),f=u[0],p=u[1],m=function(S,j){S.formattedValue!==f.formattedValue&&p({formattedValue:S.formattedValue,numAsString:S.value}),o(S,j)},g=e,v=n;rc(e)&&(g=f.numAsString,v=!0);var b=c(g,v);return y.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function m6(e){return e.replace(/[^0-9]/g,"")}function g6(e){return e}function v6(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,a=e.renderText,o=e.getInputRef,c=e.format;c===void 0&&(c=g6);var u=e.removeFormatting;u===void 0&&(u=m6);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,v=e.onChange;v===void 0&&(v=Mo);var b=e.onKeyDown;b===void 0&&(b=Mo);var S=e.onMouseUp;S===void 0&&(S=Mo);var j=e.onFocus;j===void 0&&(j=Mo);var C=e.onBlur;C===void 0&&(C=Mo);var R=e.value,D=e.getCaretBoundary;D===void 0&&(D=p6);var E=e.isValidInputCharacter;E===void 0&&(E=ed);var T=e.isCharacterSame,A=dD(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),_=vD(R,f,!!p,c,u,m),M=_[0],L=M.formattedValue,$=M.numAsString,V=_[1],Y=y.useRef(),W=y.useRef({formattedValue:L,numAsString:$}),G=function(Se,Ne){W.current={formattedValue:Se.formattedValue,numAsString:Se.value},V(Se,Ne)},X=y.useState(!1),Z=X[0],P=X[1],I=y.useRef(null),z=y.useRef({setCaretTimeout:null,focusTimeout:null});y.useEffect(function(){return P(!0),function(){clearTimeout(z.current.setCaretTimeout),clearTimeout(z.current.focusTimeout)}},[]);var F=c,O=function(Se,Ne){var Ve=parseFloat(Ne);return{formattedValue:Se,value:Ne,floatValue:isNaN(Ve)?void 0:Ve}},U=function(Se,Ne,Ve){Se.selectionStart===0&&Se.selectionEnd===Se.value.length||(ws(Se,Ne),z.current.setCaretTimeout=setTimeout(function(){Se.value===Ve&&Se.selectionStart!==Ne&&ws(Se,Ne)},0))},J=function(Se,Ne,Ve){return LC(Se,Ne,D(Se),Ve)},te=function(Se,Ne,Ve){var Te=D(Ne),ge=h6(Ne,L,Se,Ve,Te,E,T);return ge=LC(Ne,ge,Te),ge},ye=function(Se){var Ne=Se.formattedValue;Ne===void 0&&(Ne="");var Ve=Se.input,Te=Se.source,ge=Se.event,we=Se.numAsString,Le;if(Ve){var xe=Se.inputValue||Ve.value,$e=kv(Ve);Ve.value=Ne,Le=te(xe,Ne,$e),Le!==void 0&&U(Ve,Le,Ne)}Ne!==L&&G(O(Ne,we),{event:ge,source:Te})};y.useEffect(function(){var Se=W.current,Ne=Se.formattedValue,Ve=Se.numAsString;(L!==Ne||$!==Ve)&&G(O(L,$),{event:void 0,source:Ju.props})},[L,$]);var be=I.current?kv(I.current):void 0,ve=typeof window<"u"?y.useLayoutEffect:y.useEffect;ve(function(){var Se=I.current;if(L!==W.current.formattedValue&&Se){var Ne=te(W.current.formattedValue,L,be);Se.value=L,U(Se,Ne,L)}},[L]);var Ge=function(Se,Ne,Ve){var Te=Ne.target,ge=Y.current?l6(Y.current,Te.selectionEnd):gD(L,Se),we=Object.assign(Object.assign({},ge),{lastValue:L}),Le=u(Se,we),xe=F(Le);if(Le=u(xe,void 0),g&&!g(O(xe,Le))){var $e=Ne.target,gt=kv($e),ht=te(Se,L,gt);return $e.value=L,U($e,ht,L),!1}return ye({formattedValue:xe,numAsString:Le,inputValue:Se,event:Ne,source:Ve,input:Ne.target}),!0},ke=function(Se,Ne){Ne===void 0&&(Ne=0);var Ve=Se.selectionStart,Te=Se.selectionEnd;Y.current={selectionStart:Ve,selectionEnd:Te+Ne}},et=function(Se){var Ne=Se.target,Ve=Ne.value,Te=Ge(Ve,Se,Ju.event);Te&&v(Se),Y.current=void 0},Re=function(Se){var Ne=Se.target,Ve=Se.key,Te=Ne.selectionStart,ge=Ne.selectionEnd,we=Ne.value;we===void 0&&(we="");var Le;Ve==="ArrowLeft"||Ve==="Backspace"?Le=Math.max(Te-1,0):Ve==="ArrowRight"?Le=Math.min(Te+1,we.length):Ve==="Delete"&&(Le=Te);var xe=0;Ve==="Delete"&&Te===ge&&(xe=1);var $e=Ve==="ArrowLeft"||Ve==="ArrowRight";if(Le===void 0||Te!==ge&&!$e){b(Se),ke(Ne,xe);return}var gt=Le;if($e){var ht=Ve==="ArrowLeft"?"left":"right";gt=J(we,Le,ht),gt!==Le&&Se.preventDefault()}else Ve==="Delete"&&!E(we[Le])?gt=J(we,Le,"right"):Ve==="Backspace"&&!E(we[Le])&&(gt=J(we,Le,"left"));gt!==Le&&U(Ne,gt,we),b(Se),ke(Ne,xe)},ft=function(Se){var Ne=Se.target,Ve=function(){var Te=Ne.selectionStart,ge=Ne.selectionEnd,we=Ne.value;if(we===void 0&&(we=""),Te===ge){var Le=J(we,Te);Le!==Te&&U(Ne,Le,we)}};Ve(),requestAnimationFrame(function(){Ve()}),S(Se),ke(Ne)},Ut=function(Se){Se.persist&&Se.persist();var Ne=Se.target,Ve=Se.currentTarget;I.current=Ne,z.current.focusTimeout=setTimeout(function(){var Te=Ne.selectionStart,ge=Ne.selectionEnd,we=Ne.value;we===void 0&&(we="");var Le=J(we,Te);Le!==Te&&!(Te===0&&ge===we.length)&&U(Ne,Le,we),j(Object.assign(Object.assign({},Se),{currentTarget:Ve}))},0)},Ot=function(Se){I.current=null,clearTimeout(z.current.focusTimeout),clearTimeout(z.current.setCaretTimeout),C(Se)},xt=Z&&u6()?"numeric":void 0,Ht=Object.assign({inputMode:xt},A,{type:t,value:L,onChange:et,onKeyDown:Re,onMouseUp:ft,onFocus:Ut,onBlur:Ot});if(n==="text")return a?Cn.createElement(Cn.Fragment,null,a(L,A)||null):Cn.createElement("span",Object.assign({},A,{ref:o}),L);if(r){var Bt=r;return Cn.createElement(Bt,Object.assign({},Ht,{ref:o}))}return Cn.createElement("input",Object.assign({},Ht,{ref:o}))}function zC(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var o=t.suffix;o===void 0&&(o="");var c=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=_p(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,v=S0(e,c),b=v.beforeDecimal,S=v.afterDecimal,j=v.addNegation;return n!==void 0&&(S=pD(S,n,!!r)),p&&(b=i6(b,p,u)),a&&(b=a+b),o&&(S=S+o),j&&(b="-"+b),e=b+(g&&m||"")+S,e}function _p(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function y6(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),a=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),a&&!o&&t&&(e="-"+e),e}function x6(e,t){return new RegExp("(^-)|[0-9]|"+hD(e),"g")}function b6(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function S6(e,t,n){var r;t===void 0&&(t=d6(e));var a=n.allowNegative,o=n.prefix;o===void 0&&(o="");var c=n.suffix;c===void 0&&(c="");var u=n.decimalScale,f=t.from,p=t.to,m=p.start,g=p.end,v=_p(n),b=v.allowedDecimalSeparators,S=v.decimalSeparator,j=e[g]===S;if(ed(e)&&(e===o||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=u===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var R=function(I,z,F){var O=!1,U=!1;o.startsWith("-")?O=!1:I.startsWith("--")?(O=!1,U=!0):c.startsWith("-")&&I.length===c.length?O=!1:I[0]==="-"&&(O=!0);var J=O?1:0;return U&&(J=2),J&&(I=I.substring(J),z-=J,F-=J),{value:I,start:z,end:F,hasNegation:O}},D=R(e,m,g),E=D.hasNegation;r=D,e=r.value,m=r.start,g=r.end;var T=R(t.lastValue,f.start,f.end),A=T.start,_=T.end,M=T.value,L=e.substring(m,g);e.length&&M.length&&(A>M.length-c.length||_<o.length)&&!(L&&c.startsWith(L))&&(e=M);var $=0;e.startsWith(o)?$+=o.length:m<o.length&&($=m),e=e.substring($),g-=$;var V=e.length,Y=e.length-c.length;e.endsWith(c)?V=Y:(g>Y||g>e.length-c.length)&&(V=g),e=e.substring(0,V),e=y6(E?"-"+e:e,a),e=(e.match(x6(S))||[]).join("");var W=e.indexOf(S);e=e.replace(new RegExp(hD(S),"g"),function(I,z){return z===W?".":""});var G=S0(e,a),X=G.beforeDecimal,Z=G.afterDecimal,P=G.addNegation;return p.end-p.start<f.end-f.start&&X===""&&j&&!parseFloat(Z)&&(e=P?"-":""),e}function w6(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var a=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";a.fill(!1,0,n.length+(o?1:0));var c=e.length;return a.fill(!1,c-r.length+1,c+1),a}function j6(e){var t=_p(e),n=t.thousandSeparator,r=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
69
- Decimal separator can't be same as thousand separator.
70
- thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
71
- decimalSeparator: `+r+` (default value for decimalSeparator is .)
72
- `);return a.startsWith("-")&&o&&(console.error(`
73
- Prefix can't start with '-' when allowNegative is true.
74
- prefix: `+a+`
75
- allowNegative: `+o+`
76
- `),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function C6(e){e=j6(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,a=e.onKeyDown;a===void 0&&(a=Mo);var o=e.onBlur;o===void 0&&(o=Mo);var c=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var m=e.defaultValue,g=e.value,v=e.valueIsNumericString,b=e.onValueChange,S=dD(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=_p(e),C=j.decimalSeparator,R=j.allowedDecimalSeparators,D=function(P){return zC(P,e)},E=function(P,I){return S6(P,I,e)},T=rc(g)?m:g,A=v??b6(T,p,t);rc(g)?rc(m)||(A=A||typeof m=="number"):A=A||typeof g=="number";var _=function(P){return fD(P)?P:(typeof P=="number"&&(P=mD(P)),A&&typeof u=="number"?IC(P,u,!!f):P)},M=vD(_(g),_(m),!!A,D,E,b),L=M[0],$=L.numAsString,V=L.formattedValue,Y=M[1],W=function(P){var I=P.target,z=P.key,F=I.selectionStart,O=I.selectionEnd,U=I.value;if(U===void 0&&(U=""),(z==="Backspace"||z==="Delete")&&O<p.length){P.preventDefault();return}if(F!==O){a(P);return}z==="Backspace"&&U[0]==="-"&&F===p.length+1&&n&&ws(I,1),u&&f&&(z==="Backspace"&&U[F-1]===C?(ws(I,F-1),P.preventDefault()):z==="Delete"&&U[F]===C&&P.preventDefault()),R!=null&&R.includes(z)&&U[F]===C&&ws(I,F+1);var J=c===!0?",":c;z==="Backspace"&&U[F-1]===J&&ws(I,F-1),z==="Delete"&&U[F]===J&&ws(I,F+1),a(P)},G=function(P){var I=$;if(I.match(/\d/g)||(I=""),r||(I=s6(I)),f&&u&&(I=IC(I,u,f)),I!==$){var z=zC(I,e);Y({formattedValue:z,value:I,floatValue:parseFloat(I)},{event:P,source:Ju.event})}o(P)},X=function(P){return P===C?!0:ed(P)},Z=function(P){var I=P.currentValue,z=P.lastValue,F=P.formattedValue,O=P.currentValueIndex,U=P.formattedValueIndex,J=I[O],te=F[U],ye=gD(z,I),be=ye.to,ve=function(Ge){return E(Ge).indexOf(".")+p.length};return g===0&&f&&u&&I[be.start]===C&&ve(I)<O&&ve(F)>U?!1:O>=be.start&&O<be.end&&R&&R.includes(J)&&te===C?!0:J===te};return Object.assign(Object.assign({},S),{value:V,valueIsNumericString:!1,isValidInputCharacter:X,isCharacterSame:Z,onValueChange:Y,format:D,removeFormatting:E,getCaretBoundary:function(P){return w6(P,e)},onKeyDown:W,onBlur:G})}function E6(e){var t=C6(e);return Cn.createElement(v6,Object.assign({},t))}function $C({direction:e,style:t,...n}){return s.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:e==="up"?"rotate(180deg)":void 0,...t},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:s.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var Sy={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const T6=/^(0\.0*|-0(\.0*)?)$/,R6=/^-?0\d+(\.\d+)?\.?$/;function wy(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function Pv(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||wy(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function D6(e){return e.toString().replace(".","").length}function A6(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&D6(t)<14&&t!==""}function UC(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,a=n===void 0||e<=n;return r&&a}const _6={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},k6=(e,{size:t})=>({controls:{"--ni-chevron-size":nt(t,"ni-chevron-size")}});function P6(e,t,n){const r=e.toString().replace(/^0+/,""),a=parseFloat(r);return Number.isNaN(a)?r:a>Number.MAX_SAFE_INTEGER?t!==void 0?String(t):r:ph(a,n,t)}const kp=me((e,t)=>{const n=se("NumberInput",_6,e),{className:r,classNames:a,styles:o,unstyled:c,vars:u,onChange:f,onValueChange:p,value:m,defaultValue:g,max:v,min:b,step:S,hideControls:j,rightSection:C,isAllowed:R,clampBehavior:D,onBlur:E,allowDecimal:T,decimalScale:A,onKeyDown:_,onKeyDownCapture:M,handlersRef:L,startValue:$,disabled:V,rightSectionPointerEvents:Y,allowNegative:W,readOnly:G,size:X,rightSectionWidth:Z,stepHoldInterval:P,stepHoldDelay:I,allowLeadingZeros:z,withKeyboardEvents:F,trimLeadingZeroesOnBlur:O,...U}=n,J=Me({name:"NumberInput",classes:Sy,props:n,classNames:a,styles:o,unstyled:c,vars:u,varsResolver:k6}),{resolvedClassNames:te,resolvedStyles:ye}=Hs({classNames:a,styles:o,props:n}),[be,ve]=Wn({value:m,defaultValue:g,finalValue:"",onChange:f}),Ge=I!==void 0&&P!==void 0,ke=y.useRef(null),et=y.useRef(null),Re=y.useRef(0),ft=(xe,$e)=>{$e.source==="event"&&ve(A6(xe.floatValue,xe.value)&&!T6.test(xe.value)&&!(z&&R6.test(xe.value))?xe.floatValue:xe.value),p==null||p(xe,$e)},Ut=xe=>{const $e=String(xe).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return $e?Math.max(0,($e[1]?$e[1].length:0)-($e[2]?+$e[2]:0)):0},Ot=xe=>{ke.current&&typeof xe<"u"&&ke.current.setSelectionRange(xe,xe)},xt=y.useRef(Eh);xt.current=()=>{if(!Pv(be))return;let xe;const $e=Ut(be),gt=Ut(S),ht=Math.max($e,gt),Wt=10**ht;if(!wy(be)&&(typeof be!="number"||Number.isNaN(be)))xe=ph($,b,v);else if(v!==void 0){const mn=(Math.round(Number(be)*Wt)+Math.round(S*Wt))/Wt;xe=mn<=v?mn:v}else xe=(Math.round(Number(be)*Wt)+Math.round(S*Wt))/Wt;const _t=xe.toFixed(ht);ve(parseFloat(_t)),p==null||p({floatValue:parseFloat(_t),formattedValue:_t,value:_t},{source:"increment"}),setTimeout(()=>{var mn;return Ot((mn=ke.current)==null?void 0:mn.value.length)},0)};const Ht=y.useRef(Eh);Ht.current=()=>{if(!Pv(be))return;let xe;const $e=b!==void 0?b:W?Number.MIN_SAFE_INTEGER:0,gt=Ut(be),ht=Ut(S),Wt=Math.max(gt,ht),_t=10**Wt;if(!wy(be)&&typeof be!="number"||Number.isNaN(be))xe=ph($,$e,v);else{const St=(Math.round(Number(be)*_t)-Math.round(S*_t))/_t;xe=$e!==void 0&&St<$e?$e:St}const mn=xe.toFixed(Wt);ve(parseFloat(mn)),p==null||p({floatValue:parseFloat(mn),formattedValue:mn,value:mn},{source:"decrement"}),setTimeout(()=>{var St;return Ot((St=ke.current)==null?void 0:St.value.length)},0)};const Bt=xe=>{_==null||_(xe),!(G||!F)&&(xe.key==="ArrowUp"&&(xe.preventDefault(),xt.current()),xe.key==="ArrowDown"&&(xe.preventDefault(),Ht.current()))},Se=xe=>{if(M==null||M(xe),xe.key==="Backspace"){const $e=ke.current;$e.selectionStart===0&&$e.selectionStart===$e.selectionEnd&&(xe.preventDefault(),window.setTimeout(()=>Ot(0),0))}},Ne=xe=>{let $e=be;D==="blur"&&typeof $e=="number"&&($e=ph($e,b,v)),O&&typeof $e=="string"&&Ut($e)<15&&($e=P6($e,v,b)),be!==$e&&ve($e),E==null||E(xe)};Yu(L,{increment:xt.current,decrement:Ht.current});const Ve=xe=>{xe?xt.current():Ht.current(),Re.current+=1},Te=xe=>{if(Ve(xe),Ge){const $e=typeof P=="number"?P:P(Re.current);et.current=window.setTimeout(()=>Te(xe),$e)}},ge=(xe,$e)=>{var gt;xe.preventDefault(),(gt=ke.current)==null||gt.focus(),Ve($e),Ge&&(et.current=window.setTimeout(()=>Te($e),I))},we=()=>{et.current&&window.clearTimeout(et.current),et.current=null,Re.current=0},Le=s.jsxs("div",{...J("controls"),children:[s.jsx(tr,{...J("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof be=="number"&&v!==void 0&&be>=v,mod:{direction:"up"},onMouseDown:xe=>xe.preventDefault(),onPointerDown:xe=>{ge(xe,!0)},onPointerUp:we,onPointerLeave:we,children:s.jsx($C,{direction:"up"})}),s.jsx(tr,{...J("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof be=="number"&&b!==void 0&&be<=b,mod:{direction:"down"},onMouseDown:xe=>xe.preventDefault(),onPointerDown:xe=>{ge(xe,!1)},onPointerUp:we,onPointerLeave:we,children:s.jsx($C,{direction:"down"})})]});return s.jsx(Pr,{component:E6,allowNegative:W,className:$t(Sy.root,r),size:X,...U,readOnly:G,disabled:V,value:be,getInputRef:$n(t,ke),onValueChange:ft,rightSection:j||G||!Pv(be)?C:C||Le,classNames:te,styles:ye,unstyled:c,__staticSelector:"NumberInput",decimalScale:T?A:0,onKeyDown:Bt,onKeyDownCapture:Se,rightSectionPointerEvents:Y??(V?"none":void 0),rightSectionWidth:Z??`var(--ni-right-section-width-${X||"sm"})`,allowLeadingZeros:z,onBlur:Ne,isAllowed:xe=>D==="strict"?R?R(xe)&&UC(xe.floatValue,b,v):UC(xe.floatValue,b,v):R?R(xe):!0})});kp.classes={...Pr.classes,...Sy};kp.displayName="@mantine/core/NumberInput";const[N6,Pp]=vr("Pagination.Root component was not found in tree");var xd={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const O6={withPadding:!0},bd=me((e,t)=>{const n=se("PaginationControl",O6,e),{classNames:r,className:a,style:o,styles:c,vars:u,active:f,disabled:p,withPadding:m,mod:g,...v}=n,b=Pp(),S=p||b.disabled;return s.jsx(tr,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...b.getStyles("control",{className:a,style:o,classNames:r,styles:c,active:!S}),...v})});bd.classes=xd;bd.displayName="@mantine/core/PaginationControl";function Sd({style:e,children:t,path:n,...r}){return s.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...e},...r,children:s.jsx("path",{d:n,fill:"currentColor"})})}const M6=e=>s.jsx(Sd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),I6=e=>s.jsx(Sd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),L6=e=>s.jsx(Sd,{...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"}),z6=e=>s.jsx(Sd,{...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"}),$6=e=>s.jsx(Sd,{...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"}),U6={icon:$6},Np=me((e,t)=>{const n=se("PaginationDots",U6,e),{classNames:r,className:a,style:o,styles:c,vars:u,icon:f,...p}=n,m=Pp(),g=f;return s.jsx(ce,{ref:t,...m.getStyles("dots",{className:a,style:o,styles:c,classNames:r}),...p,children:s.jsx(g,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Np.classes=xd;Np.displayName="@mantine/core/PaginationDots";function Op({icon:e,name:t,action:n,type:r}){const a={icon:e},o=y.forwardRef((c,u)=>{const{icon:f,...p}=se(t,a,c),m=f,g=Pp(),v=r==="next"?g.active===g.total:g.active===1;return s.jsx(bd,{disabled:g.disabled||v,ref:u,onClick:g[n],withPadding:!1,...p,children:s.jsx(m,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return o.displayName=`@mantine/core/${t}`,o}const yD=Op({icon:M6,name:"PaginationNext",action:"onNext",type:"next"}),xD=Op({icon:I6,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),bD=Op({icon:L6,name:"PaginationFirst",action:"onFirst",type:"previous"}),SD=Op({icon:z6,name:"PaginationLast",action:"onLast",type:"next"});function w0({dotsIcon:e}){const t=Pp(),n=t.range.map((r,a)=>{var o,c,u;return r==="dots"?s.jsx(Np,{icon:e},a):s.jsx(bd,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(o=t.getItemProps)==null?void 0:o.call(t,r),children:((u=(c=t.getItemProps)==null?void 0:c.call(t,r))==null?void 0:u.children)??r},a)});return s.jsx(s.Fragment,{children:n})}w0.displayName="@mantine/core/PaginationItems";const B6={siblings:1,boundaries:1},V6=(e,{size:t,radius:n,color:r,autoContrast:a})=>({root:{"--pagination-control-radius":n===void 0?void 0:Ft(n),"--pagination-control-size":nt(t,"pagination-control-size"),"--pagination-control-fz":Mn(t),"--pagination-active-bg":r?Gt(r,e):void 0,"--pagination-active-color":qs(a,e)?Gi({color:r,theme:e,autoContrast:a}):void 0}}),Mp=me((e,t)=>{const n=se("PaginationRoot",B6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,total:p,value:m,defaultValue:g,onChange:v,disabled:b,siblings:S,boundaries:j,color:C,radius:R,onNextPage:D,onPreviousPage:E,onFirstPage:T,onLastPage:A,getItemProps:_,autoContrast:M,...L}=n,$=Me({name:"Pagination",classes:xd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:V6}),{range:V,setPage:Y,next:W,previous:G,active:X,first:Z,last:P}=cN({page:m,initialPage:g,onChange:v,total:p,siblings:S,boundaries:j}),I=Rr(D,W),z=Rr(E,G),F=Rr(T,Z),O=Rr(A,P);return s.jsx(N6,{value:{total:p,range:V,active:X,disabled:b,getItemProps:_,onChange:Y,onNext:I,onPrevious:z,onFirst:F,onLast:O,getStyles:$},children:s.jsx(ce,{ref:t,...$("root"),...L})})});Mp.classes=xd;Mp.displayName="@mantine/core/PaginationRoot";const F6={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},za=me((e,t)=>{const n=se("Pagination",F6,e),{withEdges:r,withControls:a,getControlProps:o,nextIcon:c,previousIcon:u,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:v,hideWithOnePage:b,withPages:S,...j}=n;return g<=0||b&&g===1?null:s.jsx(Mp,{ref:t,total:g,...j,children:s.jsxs(Ce,{gap:v,children:[r&&s.jsx(bD,{icon:p,...o==null?void 0:o("first")}),a&&s.jsx(xD,{icon:u,...o==null?void 0:o("previous")}),S&&s.jsx(w0,{dotsIcon:m}),a&&s.jsx(yD,{icon:c,...o==null?void 0:o("next")}),r&&s.jsx(SD,{icon:f,...o==null?void 0:o("last")})]})})});za.classes=xd;za.displayName="@mantine/core/Pagination";za.Root=Mp;za.Control=bd;za.Dots=Np;za.First=bD;za.Last=SD;za.Next=yD;za.Previous=xD;za.Items=w0;const H6=({reveal:e})=>s.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:s.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var jy={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const q6={visibilityToggleIcon:H6},G6=(e,{size:t})=>({root:{"--psi-icon-size":nt(t,"psi-icon-size"),"--psi-button-size":nt(t,"psi-button-size")}}),Na=me((e,t)=>{const n=se("PasswordInput",q6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,required:p,error:m,leftSection:g,disabled:v,id:b,variant:S,inputContainer:j,description:C,label:R,size:D,errorProps:E,descriptionProps:T,labelProps:A,withAsterisk:_,inputWrapperOrder:M,wrapperProps:L,radius:$,rightSection:V,rightSectionWidth:Y,rightSectionPointerEvents:W,leftSectionWidth:G,visible:X,defaultVisible:Z,onVisibilityChange:P,visibilityToggleIcon:I,visibilityToggleButtonProps:z,rightSectionProps:F,leftSectionProps:O,leftSectionPointerEvents:U,withErrorStyles:J,mod:te,...ye}=n,be=yr(b),[ve,Ge]=Wn({value:X,defaultValue:Z,finalValue:!1,onChange:P}),ke=()=>Ge(!ve),et=Me({name:"PasswordInput",classes:jy,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:G6}),{resolvedClassNames:Re,resolvedStyles:ft}=Hs({classNames:r,styles:c,props:n}),{styleProps:Ut,rest:Ot}=Qi(ye),xt=I,Ht=s.jsx(_n,{...et("visibilityToggle"),disabled:v,radius:$,"aria-hidden":!z,tabIndex:-1,...z,variant:(z==null?void 0:z.variant)??"subtle",color:"gray",unstyled:u,onTouchEnd:Bt=>{var Se;Bt.preventDefault(),(Se=z==null?void 0:z.onTouchEnd)==null||Se.call(z,Bt),ke()},onMouseDown:Bt=>{var Se;Bt.preventDefault(),(Se=z==null?void 0:z.onMouseDown)==null||Se.call(z,Bt),ke()},onKeyDown:Bt=>{var Se;(Se=z==null?void 0:z.onKeyDown)==null||Se.call(z,Bt),Bt.key===" "&&(Bt.preventDefault(),ke())},children:s.jsx(xt,{reveal:ve})});return s.jsx(pn.Wrapper,{required:p,id:be,label:R,error:m,description:C,size:D,classNames:Re,styles:ft,__staticSelector:"PasswordInput",errorProps:E,descriptionProps:T,unstyled:u,withAsterisk:_,inputWrapperOrder:M,inputContainer:j,variant:S,labelProps:{...A,htmlFor:be},mod:te,...et("root"),...Ut,...L,children:s.jsx(pn,{component:"div",error:m,leftSection:g,size:D,classNames:{...Re,input:$t(jy.input,Re.input)},styles:ft,radius:$,disabled:v,__staticSelector:"PasswordInput",rightSectionWidth:Y,rightSection:V??Ht,variant:S,unstyled:u,leftSectionWidth:G,rightSectionPointerEvents:W||"all",rightSectionProps:F,leftSectionProps:O,leftSectionPointerEvents:U,withAria:!1,withErrorStyles:J,children:s.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...et("innerInput"),disabled:v,id:be,ref:t,...Ot,autoComplete:Ot.autoComplete||"off",type:ve?"text":"password"})})})});Na.classes={...Pr.classes,...jy};Na.displayName="@mantine/core/PasswordInput";const[Q6,wD]=Hi(),[W6,Y6]=Hi();var jD={card:"m_9dc8ae12"};const K6={withBorder:!0},X6=(e,{radius:t})=>({card:{"--card-radius":Ft(t)}}),j0=me((e,t)=>{const n=se("RadioCard",K6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,checked:p,mod:m,withBorder:g,value:v,onClick:b,name:S,onKeyDown:j,...C}=n,R=Me({name:"RadioCard",classes:jD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:X6,rootSelector:"card"}),{dir:D}=Qs(),E=wD(),T=typeof p=="boolean"?p:(E==null?void 0:E.value)===v||!1,A=S||(E==null?void 0:E.name),_=M=>{if(j==null||j(M),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(M.nativeEvent.code)){M.preventDefault();const L=Array.from(document.querySelectorAll(`[role="radio"][name="${A||"__mantine"}"]`)),$=L.findIndex(W=>W===M.target),V=$+1>=L.length?0:$+1,Y=$-1<0?L.length-1:$-1;M.nativeEvent.code==="ArrowDown"&&(L[V].focus(),L[V].click()),M.nativeEvent.code==="ArrowUp"&&(L[Y].focus(),L[Y].click()),M.nativeEvent.code==="ArrowLeft"&&(L[D==="ltr"?Y:V].focus(),L[D==="ltr"?Y:V].click()),M.nativeEvent.code==="ArrowRight"&&(L[D==="ltr"?V:Y].focus(),L[D==="ltr"?V:Y].click())}};return s.jsx(W6,{value:{checked:T},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:T},m],...R("card"),...C,role:"radio","aria-checked":T,name:A,onClick:M=>{b==null||b(M),E==null||E.onChange(v||"")},onKeyDown:_})})});j0.displayName="@mantine/core/RadioCard";j0.classes=jD;const Z6={},C0=me((e,t)=>{const{value:n,defaultValue:r,onChange:a,size:o,wrapperProps:c,children:u,name:f,readOnly:p,...m}=se("RadioGroup",Z6,e),g=yr(f),[v,b]=Wn({value:n,defaultValue:r,finalValue:"",onChange:a}),S=j=>!p&&b(typeof j=="string"?j:j.currentTarget.value);return s.jsx(Q6,{value:{value:v,onChange:S,size:o,name:g},children:s.jsx(pn.Wrapper,{size:o,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(Kx,{role:"radiogroup",children:u})})})});C0.classes=pn.Wrapper.classes;C0.displayName="@mantine/core/RadioGroup";function CD({size:e,style:t,...n}){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:le(e),height:le(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var ED={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const J6={icon:CD},eL=(e,{radius:t,color:n,size:r,iconColor:a,variant:o,autoContrast:c})=>{const u=da({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--radio-size":nt(r,"radio-size"),"--radio-radius":t===void 0?void 0:Ft(t),"--radio-color":o==="outline"?f:Gt(n,e),"--radio-icon-size":nt(r,"radio-icon-size"),"--radio-icon-color":a?Gt(a,e):qs(c,e)?Gi({color:n,theme:e,autoContrast:c}):void 0}}},E0=me((e,t)=>{const n=se("RadioIndicator",J6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,icon:p,radius:m,color:g,iconColor:v,autoContrast:b,checked:S,mod:j,variant:C,disabled:R,...D}=n,E=p,T=Me({name:"RadioIndicator",classes:ED,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:eL,rootSelector:"indicator"}),A=Y6(),_=typeof S=="boolean"?S:(A==null?void 0:A.checked)||!1;return s.jsx(ce,{ref:t,...T("indicator",{variant:C}),variant:C,mod:[{checked:_,disabled:R},j],...D,children:s.jsx(E,{...T("icon")})})});E0.displayName="@mantine/core/RadioIndicator";E0.classes=ED;var TD={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const tL={labelPosition:"right"},nL=(e,{size:t,radius:n,color:r,iconColor:a,variant:o,autoContrast:c})=>{const u=da({color:r||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--radio-size":nt(t,"radio-size"),"--radio-radius":n===void 0?void 0:Ft(n),"--radio-color":o==="outline"?f:Gt(r,e),"--radio-icon-color":a?Gt(a,e):qs(c,e)?Gi({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":nt(t,"radio-icon-size")}}},Ms=me((e,t)=>{const n=se("Radio",tL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,id:p,size:m,label:g,labelPosition:v,description:b,error:S,radius:j,color:C,variant:R,disabled:D,wrapperProps:E,icon:T=CD,rootRef:A,iconColor:_,onChange:M,mod:L,...$}=n,V=Me({name:"Radio",classes:TD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:nL}),Y=wD(),W=(Y==null?void 0:Y.size)??m,G=n.size?m:W,{styleProps:X,rest:Z}=Qi($),P=yr(p),I=Y?{checked:Y.value===Z.value,name:Z.name??Y.name,onChange:z=>{Y.onChange(z),M==null||M(z)}}:{};return s.jsx(yp,{...V("root"),__staticSelector:"Radio",__stylesApiProps:n,id:P,size:G,labelPosition:v,label:g,description:b,error:S,disabled:D,classNames:r,styles:c,unstyled:u,"data-checked":I.checked||void 0,variant:R,ref:A,mod:L,...X,...E,children:s.jsxs(ce,{...V("inner"),mod:{"label-position":v},children:[s.jsx(ce,{...V("radio",{focusable:!0,variant:R}),onChange:M,...Z,...I,component:"input",mod:{error:!!S},ref:t,id:P,disabled:D,type:"radio"}),s.jsx(T,{...V("icon"),"aria-hidden":!0})]})})});Ms.classes=TD;Ms.displayName="@mantine/core/Radio";Ms.Group=C0;Ms.Card=j0;Ms.Indicator=E0;const rL={duration:100,transition:"fade"};function aL(e,t){return{...rL,...t,...e}}function iL({offset:e,position:t,defaultOpened:n}){const[r,a]=y.useState(n),o=y.useRef(null),{x:c,y:u,elements:f,refs:p,update:m,placement:g}=jx({placement:t,middleware:[xx({crossAxis:!0,padding:5,rootBoundary:"document"})]}),v=g.includes("right")?e:t.includes("left")?e*-1:0,b=g.includes("bottom")?e:t.includes("top")?e*-1:0,S=y.useCallback(({clientX:j,clientY:C})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+v,top:C+b,right:j,bottom:C}}})},[f.reference]);return y.useEffect(()=>{if(p.floating.current){const j=o.current;j.addEventListener("mousemove",S);const C=Mi(p.floating.current);return C.forEach(R=>{R.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(R=>{R.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:u,opened:r,setOpened:a,boundaryRef:o,floating:p.setFloating}}var Ip={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const oL={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Wr("popover")},sL=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ft(t),"--tooltip-bg":n?Gt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),T0=me((e,t)=>{const n=se("TooltipFloating",oL,e),{children:r,refProp:a,withinPortal:o,style:c,className:u,classNames:f,styles:p,unstyled:m,radius:g,color:v,label:b,offset:S,position:j,multiline:C,zIndex:R,disabled:D,defaultOpened:E,variant:T,vars:A,portalProps:_,...M}=n,L=Sn(),$=Me({name:"TooltipFloating",props:n,classes:Ip,className:u,style:c,classNames:f,styles:p,unstyled:m,rootSelector:"tooltip",vars:A,varsResolver:sL}),{handleMouseMove:V,x:Y,y:W,opened:G,boundaryRef:X,floating:Z,setOpened:P}=iL({offset:S,position:j,defaultOpened:E});if(!Fi(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const I=$n(X,ap(r),t),z=r.props,F=U=>{var J;(J=z.onMouseEnter)==null||J.call(z,U),V(U),P(!0)},O=U=>{var J;(J=z.onMouseLeave)==null||J.call(z,U),P(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(Ho,{..._,withinPortal:o,children:s.jsx(ce,{...M,...$("tooltip",{style:{...yR(c,L),zIndex:R,display:!D&&G?"block":"none",top:(W&&Math.round(W))??"",left:(Y&&Math.round(Y))??""}}),variant:T,ref:Z,mod:{multiline:C},children:b})}),y.cloneElement(r,{...z,[a]:I,onMouseEnter:F,onMouseLeave:O})]})});T0.classes=Ip;T0.displayName="@mantine/core/TooltipFloating";const RD=y.createContext(!1),lL=RD.Provider,cL=()=>y.useContext(RD),uL={openDelay:0,closeDelay:0};function R0(e){const{openDelay:t,closeDelay:n,children:r}=se("TooltipGroup",uL,e);return s.jsx(lL,{value:!0,children:s.jsx($M,{delay:{open:t,close:n},children:r})})}R0.displayName="@mantine/core/TooltipGroup";R0.extend=e=>e;function dL(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function fL(e){const t=dL(e.middlewares),n=[IR(e.offset)];return t.shift&&n.push(xx(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?kh():kh(t.flip)),n.push(LR({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?qu():qu(t.inline)):e.inline&&n.push(qu()),n}function hL(e){var _,M,L;const[t,n]=y.useState(e.defaultOpened),a=typeof e.opened=="boolean"?e.opened:t,o=cL(),c=yr(),u=y.useCallback($=>{n($),$&&D(c)},[c]),{x:f,y:p,context:m,refs:g,update:v,placement:b,middlewareData:{arrow:{x:S,y:j}={}}}=jx({strategy:e.strategy,placement:e.position,open:a,onOpenChange:u,middleware:fL(e)}),{delay:C,currentId:R,setCurrentId:D}=UM(m,{id:c}),{getReferenceProps:E,getFloatingProps:T}=QM([LM(m,{enabled:(_=e.events)==null?void 0:_.hover,delay:o?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((M=e.events)!=null&&M.touch)}),GM(m,{enabled:(L=e.events)==null?void 0:L.focus,visibleOnly:!0}),YM(m,{role:"tooltip"}),HM(m,{enabled:typeof e.opened>"u"})]);c2({opened:a,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),Li(()=>{var $;($=e.onPositionChange)==null||$.call(e,b)},[b]);const A=a&&R&&R!==c;return{x:f,y:p,arrowX:S,arrowY:j,reference:g.setReference,floating:g.setFloating,getFloatingProps:T,getReferenceProps:E,isGroupPhase:A,opened:a,placement:b}}const BC={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Wr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},pL=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ft(t),"--tooltip-bg":n?Gt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Ys=me((e,t)=>{const n=se("Tooltip",BC,e),{children:r,position:a,refProp:o,label:c,openDelay:u,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:v,radius:b,color:S,classNames:j,styles:C,unstyled:R,style:D,className:E,withArrow:T,arrowSize:A,arrowOffset:_,arrowRadius:M,arrowPosition:L,offset:$,transitionProps:V,multiline:Y,events:W,zIndex:G,disabled:X,positionDependencies:Z,onClick:P,onMouseEnter:I,onMouseLeave:z,inline:F,variant:O,keepMounted:U,vars:J,portalProps:te,mod:ye,floatingStrategy:be,middlewares:ve,...Ge}=se("Tooltip",BC,n),{dir:ke}=Qs(),et=y.useRef(null),Re=hL({position:n2(ke,a),closeDelay:f,openDelay:u,onPositionChange:p,opened:m,defaultOpened:g,events:W,arrowRef:et,arrowOffset:_,offset:typeof $=="number"?$+(T?A/2:0):$,positionDependencies:[...Z,r],inline:F,strategy:be,middlewares:ve}),ft=Me({name:"Tooltip",props:n,classes:Ip,className:E,style:D,classNames:j,styles:C,unstyled:R,rootSelector:"tooltip",vars:J,varsResolver:pL});if(!Fi(r))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Ut=$n(Re.reference,ap(r),t),Ot=aL(V,{duration:100,transition:"fade"}),xt=r.props;return s.jsxs(s.Fragment,{children:[s.jsx(Ho,{...te,withinPortal:v,children:s.jsx(di,{...Ot,keepMounted:U,mounted:!X&&!!Re.opened,duration:Re.isGroupPhase?10:Ot.duration,children:Ht=>s.jsxs(ce,{...Ge,"data-fixed":be==="fixed"||void 0,variant:O,mod:[{multiline:Y},ye],...Re.getFloatingProps({ref:Re.floating,className:ft("tooltip").className,style:{...ft("tooltip").style,...Ht,zIndex:G,top:Re.y??0,left:Re.x??0}}),children:[c,s.jsx(Rx,{ref:et,arrowX:Re.arrowX,arrowY:Re.arrowY,visible:T,position:Re.placement,arrowSize:A,arrowOffset:_,arrowRadius:M,arrowPosition:L,...ft("arrow")})]})})}),y.cloneElement(r,Re.getReferenceProps({onClick:P,onMouseEnter:I,onMouseLeave:z,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:$t(E,xt.className),...xt,[o]:Ut}))]})});Ys.classes=Ip;Ys.displayName="@mantine/core/Tooltip";Ys.Floating=T0;Ys.Group=R0;function mL({size:e,thickness:t,sum:n,value:r,root:a,offset:o}){const c=(e*.9-t*2)/2,u=Math.PI*c*2/100,f=a||r===void 0?`${(100-n)*u}, ${n*u}`:`${r*u}, ${(100-r)*u}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:c||0,transform:a?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:a?0:o||0}}function DD({size:e,value:t,offset:n,sum:r,thickness:a,root:o,color:c,lineRoundCaps:u,tooltip:f,getStyles:p,display:m,...g}){const v=Sn();return s.jsx(Ys.Floating,{disabled:!f,label:f,children:s.jsx(ce,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Gt(c,v):void 0},fill:"none",strokeLinecap:u?"round":"butt",...mL({sum:r,size:e,thickness:a,value:t,offset:n,root:o})})})}DD.displayName="@mantine/core/Curve";function gL({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:a}){const o=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let u=c;const f=[],p=[];for(let m=0;m<n.length;m+=1)f.push({sum:o,offset:u,data:n[m],root:!1}),u-=n[m].value/100*c;if(f.push({sum:o,offset:u,data:{color:a},root:!0}),p.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){p.push({...f[0],lineRoundCaps:r}),p.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)p.push({...f[m],lineRoundCaps:!1})}else p.push({...f[0],lineRoundCaps:r});return p}var AD={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function vL(e,t){return Math.min(e||12,(t||120)/4)}const yL={size:120,thickness:12},xL=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":le(t),"--rp-label-offset":le(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Lp=me((e,t)=>{const n=se("RingProgress",yL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,label:p,sections:m,size:g,thickness:v,roundCaps:b,rootColor:S,transitionDuration:j,...C}=n,R=Me({name:"RingProgress",classes:AD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:xL}),D=vL(v,g),E=gL({size:g,thickness:D,sections:m,renderRoundedLineCaps:b,rootColor:S}).map(({data:T,sum:A,root:_,lineRoundCaps:M,offset:L},$)=>y.createElement(DD,{...T,key:$,size:g,thickness:D,sum:A,offset:L,color:T==null?void 0:T.color,root:_,lineRoundCaps:M,getStyles:R}));return s.jsxs(ce,{...R("root"),size:g,ref:t,...C,children:[s.jsx("svg",{...R("svg"),children:E}),p&&s.jsx("div",{...R("label"),children:p})]})});Lp.classes=AD;Lp.displayName="@mantine/core/RingProgress";var _D={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const bL={withItemsBorders:!0},SL=(e,{radius:t,color:n,transitionDuration:r,size:a,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:Ft(t),"--sc-color":n?Gt(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":o,"--sc-padding":nt(a,"sc-padding"),"--sc-font-size":Mn(a)}}),zp=me((e,t)=>{var ke,et;const n=se("SegmentedControl",bL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,data:p,value:m,defaultValue:g,onChange:v,size:b,name:S,disabled:j,readOnly:C,fullWidth:R,orientation:D,radius:E,color:T,transitionDuration:A,transitionTimingFunction:_,variant:M,autoContrast:L,withItemsBorders:$,mod:V,...Y}=n,W=Me({name:"SegmentedControl",props:n,classes:_D,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:SL}),G=Sn(),X=p.map(Re=>typeof Re=="string"?{label:Re,value:Re}:Re),Z=mN(),[P,I]=y.useState(Th()),[z,F]=y.useState(null),[O,U]=y.useState({}),J=(Re,ft)=>{O[ft]=Re,U(O)},[te,ye]=Wn({value:m,defaultValue:g,finalValue:Array.isArray(p)?((ke=X.find(Re=>!Re.disabled))==null?void 0:ke.value)??((et=p[0])==null?void 0:et.value)??null:null,onChange:v}),be=yr(S),ve=X.map(Re=>y.createElement(ce,{...W("control"),mod:{active:te===Re.value,orientation:D},key:Re.value},y.createElement("input",{...W("input"),disabled:j||Re.disabled,type:"radio",name:be,value:Re.value,id:`${be}-${Re.value}`,checked:te===Re.value,onChange:()=>!C&&ye(Re.value),"data-focus-ring":G.focusRing,key:`${Re.value}-input`}),y.createElement(ce,{component:"label",...W("label"),mod:{active:te===Re.value&&!(j||Re.disabled),disabled:j||Re.disabled,"read-only":C},htmlFor:`${be}-${Re.value}`,ref:ft=>J(ft,Re.value),__vars:{"--sc-label-color":T!==void 0?Gi({color:T,theme:G,autoContrast:L}):void 0},key:`${Re.value}-label`},s.jsx("span",{...W("innerLabel"),children:Re.label})))),Ge=$n(t,Re=>F(Re));return fN(()=>{I(Th())},[p.length]),p.length===0?null:s.jsxs(ce,{...W("root"),variant:M,size:b,ref:Ge,mod:[{"full-width":R,orientation:D,initialized:Z,"with-items-borders":$},V],...Y,role:"radiogroup","data-disabled":j,children:[typeof te=="string"&&s.jsx(Nx,{target:O[te],parent:z,component:"span",transitionDuration:"var(--sc-transition-duration)",...W("indicator")},P),ve]})});zp.classes=_D;zp.displayName="@mantine/core/SegmentedControl";function wL({spacing:e,verticalSpacing:t,cols:n,selector:r}){var m;const a=Sn(),o=t===void 0?e:t,c=Fo({"--sg-spacing-x":On(ka(e)),"--sg-spacing-y":On(ka(o)),"--sg-cols":(m=ka(n))==null?void 0:m.toString()}),u=sn(a.breakpoints).reduce((g,v)=>(g[v]||(g[v]={}),typeof e=="object"&&e[v]!==void 0&&(g[v]["--sg-spacing-x"]=On(e[v])),typeof o=="object"&&o[v]!==void 0&&(g[v]["--sg-spacing-y"]=On(o[v])),typeof n=="object"&&n[v]!==void 0&&(g[v]["--sg-cols"]=n[v]),g),{}),p=Wu(sn(u),a.breakpoints).filter(g=>sn(u[g.value]).length>0).map(g=>({query:`(min-width: ${a.breakpoints[g.value]})`,styles:u[g.value]}));return s.jsx(Gs,{styles:c,media:p,selector:r})}function Nv(e){return typeof e=="object"&&e!==null?sn(e):[]}function jL(e){return e.sort((t,n)=>Qu(t)-Qu(n))}function CL({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Nv(e),...Nv(t),...Nv(n)]));return jL(r)}function EL({spacing:e,verticalSpacing:t,cols:n,selector:r}){var p;const a=t===void 0?e:t,o=Fo({"--sg-spacing-x":On(ka(e)),"--sg-spacing-y":On(ka(a)),"--sg-cols":(p=ka(n))==null?void 0:p.toString()}),c=CL({spacing:e,verticalSpacing:t,cols:n}),u=c.reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=On(e[g])),typeof a=="object"&&a[g]!==void 0&&(m[g]["--sg-spacing-y"]=On(a[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),f=c.map(m=>({query:`simple-grid (min-width: ${m})`,styles:u[m]}));return s.jsx(Gs,{styles:o,container:f,selector:r})}var kD={container:"m_925c2d2c",root:"m_2415a157"};const TL={cols:1,spacing:"md",type:"media"},D0=me((e,t)=>{const n=se("SimpleGrid",TL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,cols:p,verticalSpacing:m,spacing:g,type:v,...b}=n,S=Me({name:"SimpleGrid",classes:kD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f}),j=ud();return v==="container"?s.jsxs(s.Fragment,{children:[s.jsx(EL,{...n,selector:`.${j}`}),s.jsx("div",{...S("container"),children:s.jsx(ce,{ref:t,...S("root",{className:j}),...b})})]}):s.jsxs(s.Fragment,{children:[s.jsx(wL,{...n,selector:`.${j}`}),s.jsx(ce,{ref:t,...S("root",{className:j}),...b})]})});D0.classes=kD;D0.displayName="@mantine/core/SimpleGrid";const RL={},$p=me((e,t)=>{const{w:n,h:r,miw:a,mih:o,...c}=se("Space",RL,e);return s.jsx(ce,{ref:t,...c,w:n,miw:a??n,h:r,mih:o??r})});$p.displayName="@mantine/core/Space";var PD={root:"m_6d731127"};const DL={gap:"md",align:"stretch",justify:"flex-start"},AL=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":On(t),"--stack-align":n,"--stack-justify":r}}),We=me((e,t)=>{const n=se("Stack",DL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,align:p,justify:m,gap:g,variant:v,...b}=n,S=Me({name:"Stack",props:n,classes:PD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:AL});return s.jsx(ce,{ref:t,...S("root"),variant:v,...b})});We.classes=PD;We.displayName="@mantine/core/Stack";const[_L,kL]=vr("Stepper component was not found in tree"),Nh=()=>null;Nh.displayName="@mantine/core/StepperCompleted";var A0={root:"m_cbb4ea7e",steps:"m_aaf89d0b",separator:"m_2a371ac9",content:"m_78da155d",step:"m_cbb57068","step--horizontal":"m_f56b1e2c","step--vertical":"m_833edb7e",verticalSeparator:"m_6496b3f3",stepWrapper:"m_818e70b",stepIcon:"m_1959ad01",stepCompletedIcon:"m_a79331dc",stepBody:"m_1956aa2a",stepLabel:"m_12051f6c",stepDescription:"m_164eea74"};const ah=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,PL={withIcon:!0,allowStepClick:!0,iconPosition:"left"},_0=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,step:u,state:f,color:p,icon:m,completedIcon:g,progressIcon:v,label:b,description:S,withIcon:j,iconSize:C,loading:R,allowStepClick:D,allowStepSelect:E,iconPosition:T,orientation:A,mod:_,...M}=se("StepperStep",PL,e),L=kL(),$=Sn(),V={classNames:n,styles:o},Y=f==="stepCompleted"?null:f==="stepProgress"?v:m,W={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return s.jsxs(tr,{...L.getStyles("step",{className:r,style:a,variant:L.orientation,...V}),mod:[{"icon-position":T||L.iconPosition,"allow-click":D},_],ref:t,...W,...M,__vars:{"--step-color":p?Gt(p,$):void 0},tabIndex:D?0:-1,children:[j&&s.jsxs("span",{...L.getStyles("stepWrapper",V),children:[s.jsxs("span",{...L.getStyles("stepIcon",V),...W,children:[s.jsx(di,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:G=>s.jsx("span",{...L.getStyles("stepCompletedIcon",{style:G,...V}),children:R?s.jsx(_r,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...L.getStyles("stepLoader",V)}):ah(g,u)||s.jsx(xp,{size:"60%"})})}),f!=="stepCompleted"?R?s.jsx(_r,{...L.getStyles("stepLoader",V),size:"calc(var(--stepper-icon-size) / 2)",color:p}):ah(Y||m,u):null]}),A==="vertical"&&s.jsx("span",{...L.getStyles("verticalSeparator",V),"data-active":f==="stepCompleted"||void 0})]}),(b||S)&&s.jsxs("span",{...L.getStyles("stepBody",V),"data-orientation":L.orientation,"data-icon-position":T||L.iconPosition,children:[b&&s.jsx("span",{...L.getStyles("stepLabel",V),children:ah(b,u)}),S&&s.jsx("span",{...L.getStyles("stepDescription",V),children:ah(S,u)})]})]})});_0.classes=A0;_0.displayName="@mantine/core/StepperStep";const NL={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},OL=(e,{color:t,iconSize:n,size:r,contentPadding:a,radius:o,autoContrast:c})=>({root:{"--stepper-color":t?Gt(t,e):void 0,"--stepper-icon-color":qs(c,e)?Gi({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?nt(r,"stepper-icon-size"):le(n),"--stepper-content-padding":On(a),"--stepper-radius":o===void 0?void 0:Ft(o),"--stepper-fz":Mn(r),"--stepper-spacing":On(r)}}),pc=me((e,t)=>{var z,F,O;const n=se("Stepper",NL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,onStepClick:m,active:g,icon:v,completedIcon:b,progressIcon:S,color:j,iconSize:C,contentPadding:R,orientation:D,iconPosition:E,size:T,radius:A,allowNextStepsSelect:_,wrap:M,autoContrast:L,...$}=n,V=Me({name:"Stepper",classes:A0,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:OL}),Y=y.Children.toArray(p),W=Y.filter(U=>U.type!==Nh),G=Y.find(U=>U.type===Nh),X=W.reduce((U,J,te)=>{const ye=g===te?"stepProgress":g>te?"stepCompleted":"stepInactive",ve=typeof m!="function"?!1:typeof J.props.allowStepSelect=="boolean"?J.props.allowStepSelect:ye==="stepCompleted"||_;return U.push(y.cloneElement(J,{icon:J.props.icon||v||te+1,key:te,step:te,state:ye,onClick:()=>ve&&(m==null?void 0:m(te)),allowStepClick:ve,completedIcon:J.props.completedIcon||b,progressIcon:J.props.progressIcon||S,color:J.props.color||j,iconSize:C,iconPosition:J.props.iconPosition||E,orientation:D})),D==="horizontal"&&te!==W.length-1&&U.push(y.createElement("div",{...V("separator"),"data-active":te<g||void 0,"data-orientation":D,key:`separator-${te}`})),U},[]),Z=(F=(z=W[g])==null?void 0:z.props)==null?void 0:F.children,P=(O=G==null?void 0:G.props)==null?void 0:O.children,I=g>W.length-1?P:Z;return s.jsx(_L,{value:{getStyles:V,orientation:D,iconPosition:E},children:s.jsxs(ce,{...V("root"),ref:t,size:T,...$,children:[s.jsx(ce,{...V("steps"),mod:{orientation:D,"icon-position":E,wrap:M&&D!=="vertical"},children:X}),I&&s.jsx("div",{...V("content"),children:I})]})})});pc.classes=A0;pc.displayName="@mantine/core/Stepper";pc.Completed=Nh;pc.Step=_0;const ND=y.createContext(null),ML=ND.Provider,IL=()=>y.useContext(ND),LL={},k0=me((e,t)=>{const{value:n,defaultValue:r,onChange:a,size:o,wrapperProps:c,children:u,readOnly:f,...p}=se("SwitchGroup",LL,e),[m,g]=Wn({value:n,defaultValue:r,finalValue:[],onChange:a}),v=b=>{const S=b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return s.jsx(ML,{value:{value:m,onChange:v,size:o},children:s.jsx(pn.Wrapper,{size:o,ref:t,...c,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(Kx,{role:"group",children:u})})})});k0.classes=pn.Wrapper.classes;k0.displayName="@mantine/core/SwitchGroup";var OD={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const zL={labelPosition:"right"},$L=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Ft(t),"--switch-height":nt(r,"switch-height"),"--switch-width":nt(r,"switch-width"),"--switch-thumb-size":nt(r,"switch-thumb-size"),"--switch-label-font-size":nt(r,"switch-label-font-size"),"--switch-track-label-padding":nt(r,"switch-track-label-padding"),"--switch-color":n?Gt(n,e):void 0}}),wd=me((e,t)=>{const n=se("Switch",zL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,label:m,offLabel:g,onLabel:v,id:b,size:S,radius:j,wrapperProps:C,thumbIcon:R,checked:D,defaultChecked:E,onChange:T,labelPosition:A,description:_,error:M,disabled:L,variant:$,rootRef:V,mod:Y,...W}=n,G=IL(),X=S||(G==null?void 0:G.size),Z=Me({name:"Switch",props:n,classes:OD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:$L}),{styleProps:P,rest:I}=Qi(W),z=yr(b),F=G?{checked:G.value.includes(I.value),onChange:G.onChange}:{},[O,U]=Wn({value:F.checked??D,defaultValue:E,finalValue:!1});return s.jsxs(yp,{...Z("root"),__staticSelector:"Switch",__stylesApiProps:n,id:z,size:X,labelPosition:A,label:m,description:_,error:M,disabled:L,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:u,"data-checked":F.checked||D||void 0,variant:$,ref:V,mod:Y,...P,...C,children:[s.jsx("input",{...I,disabled:L,checked:O,"data-checked":F.checked||D||void 0,onChange:J=>{var te;G?(te=F.onChange)==null||te.call(F,J):T==null||T(J),U(J.currentTarget.checked)},id:z,ref:t,type:"checkbox",role:"switch",...Z("input")}),s.jsxs(ce,{"aria-hidden":"true",mod:{error:M,"label-position":A,"without-labels":!v&&!g},...Z("track"),children:[s.jsx(ce,{component:"span",mod:"reduce-motion",...Z("thumb"),children:R}),s.jsx("span",{...Z("trackLabel"),children:O?v:g})]})]})});wd.classes={...OD,...$2};wd.displayName="@mantine/core/Switch";wd.Group=k0;const[UL,BL]=vr("Table component was not found in the tree");var jd={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function VL(e,t){if(!t)return;const n={};return t.columnBorder&&e.withColumnBorders&&(n["data-with-column-border"]=!0),t.rowBorder&&e.withRowBorders&&(n["data-with-row-border"]=!0),t.striped&&e.striped&&(n["data-striped"]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n["data-hover"]=!0),t.captionSide&&e.captionSide&&(n["data-side"]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n["data-sticky"]=!0),n}function Ks(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=me((a,o)=>{const c=se(n,{},a),{classNames:u,className:f,style:p,styles:m,...g}=c,v=BL();return s.jsx(ce,{component:e,ref:o,...VL(v,t),...v.getStyles(e,{className:f,classNames:u,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=jd,r}const Cy=Ks("th",{columnBorder:!0}),MD=Ks("td",{columnBorder:!0}),vh=Ks("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),ID=Ks("thead",{stickyHeader:!0}),LD=Ks("tbody"),zD=Ks("tfoot"),$D=Ks("caption",{captionSide:!0});function P0({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx($D,{children:e.caption}),e.head&&s.jsx(ID,{children:s.jsx(vh,{children:e.head.map((t,n)=>s.jsx(Cy,{children:t},n))})}),e.body&&s.jsx(LD,{children:e.body.map((t,n)=>s.jsx(vh,{children:t.map((r,a)=>s.jsx(MD,{children:r},a))},n))}),e.foot&&s.jsx(zD,{children:s.jsx(vh,{children:e.foot.map((t,n)=>s.jsx(Cy,{children:t},n))})})]})}P0.displayName="@mantine/core/TableDataRenderer";const FL={type:"scrollarea"},HL=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":le(t),"--table-max-height":le(n),"--table-overflow":r==="native"?"auto":void 0}}),N0=me((e,t)=>{const n=se("TableScrollContainer",FL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,minWidth:m,maxHeight:g,type:v,...b}=n,S=Me({name:"TableScrollContainer",classes:jd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:HL,rootSelector:"scrollContainer"});return s.jsx(ce,{component:v==="scrollarea"?Yr:"div",...v==="scrollarea"?g?{offsetScrollbars:"xy"}:{offsetScrollbars:"x"}:{},ref:t,...S("scrollContainer"),...b,children:s.jsx("div",{...S("scrollContainerInner"),children:p})})});N0.classes=jd;N0.displayName="@mantine/core/TableScrollContainer";const qL={withRowBorders:!0,verticalSpacing:7},GL=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:a,borderColor:o,stripedColor:c,highlightOnHoverColor:u,striped:f,highlightOnHover:p,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":On(r),"--table-vertical-spacing":On(a),"--table-border-color":o?Gt(o,e):void 0,"--table-striped-color":f&&c?Gt(c,e):void 0,"--table-highlight-on-hover-color":p&&u?Gt(u,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),Oe=me((e,t)=>{const n=se("Table",qL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:v,highlightOnHoverColor:b,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,withTableBorder:D,borderColor:E,layout:T,variant:A,data:_,children:M,stickyHeader:L,stickyHeaderOffset:$,mod:V,tabularNums:Y,...W}=n,G=Me({name:"Table",props:n,className:a,style:o,classes:jd,classNames:r,styles:c,unstyled:u,rootSelector:"table",vars:f,varsResolver:GL});return s.jsx(UL,{value:{getStyles:G,stickyHeader:L,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,captionSide:g||"bottom"},children:s.jsx(ce,{component:"table",variant:A,ref:t,mod:[{"data-with-table-border":D,"data-tabular-nums":Y},V],...G("table"),...W,children:M||!!_&&s.jsx(P0,{data:_})})})});Oe.classes=jd;Oe.displayName="@mantine/core/Table";Oe.Td=MD;Oe.Th=Cy;Oe.Tr=vh;Oe.Thead=ID;Oe.Tbody=LD;Oe.Tfoot=zD;Oe.Caption=$D;Oe.ScrollContainer=N0;Oe.DataRenderer=P0;const[QL,O0]=vr("Tabs component was not found in the tree");var Cd={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",panel:"m_b0c91715",tab:"m_4ec4dce6",tabSection:"m_fc420b1f","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const WL={},M0=me((e,t)=>{const n=se("TabsList",WL,e),{children:r,className:a,grow:o,justify:c,classNames:u,styles:f,style:p,mod:m,...g}=n,v=O0();return s.jsx(ce,{...g,...v.getStyles("list",{className:a,style:p,classNames:u,styles:f,props:n,variant:v.variant}),ref:t,role:"tablist",variant:v.variant,mod:[{grow:o,orientation:v.orientation,placement:v.orientation==="vertical"&&v.placement,inverted:v.inverted},m],"aria-orientation":v.orientation,__vars:{"--tabs-justify":c},children:r})});M0.classes=Cd;M0.displayName="@mantine/core/TabsList";const YL={},I0=me((e,t)=>{const n=se("TabsPanel",YL,e),{children:r,className:a,value:o,classNames:c,styles:u,style:f,mod:p,keepMounted:m,...g}=n,v=O0(),b=v.value===o,S=v.keepMounted||m||b?r:null;return s.jsx(ce,{...g,...v.getStyles("panel",{className:a,classNames:c,styles:u,style:[f,b?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:v.orientation},p],role:"tabpanel",id:v.getPanelId(o),"aria-labelledby":v.getTabId(o),children:S})});I0.classes=Cd;I0.displayName="@mantine/core/TabsPanel";const KL={},L0=me((e,t)=>{const n=se("TabsTab",KL,e),{className:r,children:a,rightSection:o,leftSection:c,value:u,onClick:f,onKeyDown:p,disabled:m,color:g,style:v,classNames:b,styles:S,vars:j,mod:C,tabIndex:R,...D}=n,E=Sn(),{dir:T}=Qs(),A=O0(),_=u===A.value,M=$=>{A.onChange(A.allowTabDeactivation&&u===A.value?null:u),f==null||f($)},L={classNames:b,styles:S,props:n};return s.jsxs(tr,{...D,...A.getStyles("tab",{className:r,style:v,variant:A.variant,...L}),disabled:m,unstyled:A.unstyled,variant:A.variant,mod:[{active:_,disabled:m,orientation:A.orientation,inverted:A.inverted,placement:A.orientation==="vertical"&&A.placement},C],ref:t,role:"tab",id:A.getTabId(u),"aria-selected":_,tabIndex:R!==void 0?R:_||A.value===null?0:-1,"aria-controls":A.getPanelId(u),onClick:M,__vars:{"--tabs-color":g?Gt(g,E):void 0},onKeyDown:tR({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:A.activateTabWithKeyboard,loop:A.loop,orientation:A.orientation||"horizontal",dir:T,onKeyDown:p}),children:[c&&s.jsx("span",{...A.getStyles("tabSection",L),"data-position":"left",children:c}),a&&s.jsx("span",{...A.getStyles("tabLabel",L),children:a}),o&&s.jsx("span",{...A.getStyles("tabSection",L),"data-position":"right",children:o})]})});L0.classes=Cd;L0.displayName="@mantine/core/TabsTab";const VC="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",XL={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},ZL=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Ft(t),"--tabs-color":Gt(n,e),"--tabs-text-color":qs(r,e)?Gi({color:n,theme:e,autoContrast:r}):void 0}}),It=me((e,t)=>{const n=se("Tabs",XL,e),{defaultValue:r,value:a,onChange:o,orientation:c,children:u,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:v,color:b,radius:S,inverted:j,placement:C,keepMounted:R,classNames:D,styles:E,unstyled:T,className:A,style:_,vars:M,autoContrast:L,mod:$,...V}=n,Y=yr(p),[W,G]=Wn({value:a,defaultValue:r,finalValue:null,onChange:o}),X=Me({name:"Tabs",props:n,classes:Cd,className:A,style:_,classNames:D,styles:E,unstyled:T,vars:M,varsResolver:ZL});return s.jsx(QL,{value:{placement:C,value:W,orientation:c,id:Y,loop:f,activateTabWithKeyboard:m,getTabId:zj(`${Y}-tab`,VC),getPanelId:zj(`${Y}-panel`,VC),onChange:G,allowTabDeactivation:g,variant:v,color:b,radius:S,inverted:j,keepMounted:R,unstyled:T,getStyles:X},children:s.jsx(ce,{ref:t,id:Y,variant:v,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},$],...X("root"),...V,children:u})})});It.classes=Cd;It.displayName="@mantine/core/Tabs";It.Tab=L0;It.Panel=I0;It.List=M0;const JL={},ze=me((e,t)=>{const n=se("TextInput",JL,e);return s.jsx(Pr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ze.classes=Pr.classes;ze.displayName="@mantine/core/TextInput";var UD={root:"m_7341320d"};const ez={},tz=(e,{size:t,radius:n,variant:r,gradient:a,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:a,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":nt(t,"ti-size"),"--ti-radius":n===void 0?void 0:Ft(n),"--ti-bg":o||r?u.background:void 0,"--ti-color":o||r?u.color:void 0,"--ti-bd":o||r?u.border:void 0}}},z0=me((e,t)=>{const n=se("ThemeIcon",ez,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,autoContrast:p,...m}=n,g=Me({name:"ThemeIcon",classes:UD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:tz});return s.jsx(ce,{ref:t,...g("root"),...m})});z0.classes=UD;z0.displayName="@mantine/core/ThemeIcon";const nz=["h1","h2","h3","h4","h5","h6"],rz=["xs","sm","md","lg","xl"];function az(e,t){const n=t!==void 0?t:`h${e}`;return nz.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:rz.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:le(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var BD={root:"m_8a5d1357"};const iz={order:1},oz=(e,{order:t,size:n,lineClamp:r,textWrap:a})=>{const o=az(t,n);return{root:{"--title-fw":o.fontWeight,"--title-lh":o.lineHeight,"--title-fz":o.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":a}}},Ie=me((e,t)=>{const n=se("Title",iz,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,order:f,vars:p,size:m,variant:g,lineClamp:v,textWrap:b,mod:S,...j}=n,C=Me({name:"Title",props:n,classes:BD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:oz});return[1,2,3,4,5,6].includes(f)?s.jsx(ce,{...C("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof v=="number"},S],size:m,...j}):null});Ie.classes=BD;Ie.displayName="@mantine/core/Title";function sz(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(a){t=typeof a=="function"?a(t):a},setState(a){this.updateState(a),r.forEach(o=>o(t))},initialize(a){n||(t=a,n=!0)},subscribe(a){return r.add(a),()=>r.delete(a)}}}function lz(e){return y.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function cz(e,t,n){const r=[],a=[],o={};for(const c of e){const u=c.position||t;o[u]=o[u]||0,o[u]+=1,o[u]<=n?a.push(c):r.push(c)}return{notifications:a,queue:r}}const uz=()=>sz({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Xs=uz(),dz=(e=Xs)=>lz(e);function Ac(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),a=cz(r,n.defaultPosition,n.limit);e.setState({notifications:a.notifications,queue:a.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function _e(e,t=Xs){const n=e.id||Th();return Ac(t,r=>e.id&&r.some(a=>a.id===e.id)?r:[...r,{...e,id:n}]),n}function VD(e,t=Xs){return Ac(t,n=>n.filter(r=>{var a;return r.id===e?((a=r.onClose)==null||a.call(r,r),!1):!0})),e}function Ts(e,t=Xs){return Ac(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function fz(e=Xs){Ac(e,()=>[])}function hz(e=Xs){Ac(e,t=>t.slice(0,e.getState().limit))}const ca={show:_e,hide:VD,update:Ts,clean:fz,cleanQueue:hz,updateState:Ac};function Ey(e,t){return Ey=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ey(e,t)}function FD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ey(e,t)}var Ov={exports:{}},Mv,FC;function pz(){if(FC)return Mv;FC=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Mv=e,Mv}var Iv,HC;function mz(){if(HC)return Iv;HC=1;var e=pz();function t(){}function n(){}return n.resetWarningCache=t,Iv=function(){function r(c,u,f,p,m,g){if(g!==e){var v=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 v.name="Invariant Violation",v}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Iv}var qC;function gz(){return qC||(qC=1,Ov.exports=mz()()),Ov.exports}var vz=gz();const on=Jy(vz),GC={disabled:!1},Oh=Cn.createContext(null);var yz=function(t){return t.scrollTop},Vu="unmounted",xs="exited",bs="entering",Xl="entered",Ty="exiting",Xi=function(e){FD(t,e);function t(r,a){var o;o=e.call(this,r,a)||this;var c=a,u=c&&!c.isMounting?r.enter:r.appear,f;return o.appearStatus=null,r.in?u?(f=xs,o.appearStatus=bs):f=Xl:r.unmountOnExit||r.mountOnEnter?f=Vu:f=xs,o.state={status:f},o.nextCallback=null,o}t.getDerivedStateFromProps=function(a,o){var c=a.in;return c&&o.status===Vu?{status:xs}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(a){var o=null;if(a!==this.props){var c=this.state.status;this.props.in?c!==bs&&c!==Xl&&(o=bs):(c===bs||c===Xl)&&(o=Ty)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var a=this.props.timeout,o,c,u;return o=c=u=a,a!=null&&typeof a!="number"&&(o=a.exit,c=a.enter,u=a.appear!==void 0?a.appear:c),{exit:o,enter:c,appear:u}},n.updateStatus=function(a,o){if(a===void 0&&(a=!1),o!==null)if(this.cancelNextCallback(),o===bs){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:Bu.findDOMNode(this);c&&yz(c)}this.performEnter(a)}else this.performExit();else this.props.unmountOnExit&&this.state.status===xs&&this.setState({status:Vu})},n.performEnter=function(a){var o=this,c=this.props.enter,u=this.context?this.context.isMounting:a,f=this.props.nodeRef?[u]:[Bu.findDOMNode(this),u],p=f[0],m=f[1],g=this.getTimeouts(),v=u?g.appear:g.enter;if(!a&&!c||GC.disabled){this.safeSetState({status:Xl},function(){o.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:bs},function(){o.props.onEntering(p,m),o.onTransitionEnd(v,function(){o.safeSetState({status:Xl},function(){o.props.onEntered(p,m)})})})},n.performExit=function(){var a=this,o=this.props.exit,c=this.getTimeouts(),u=this.props.nodeRef?void 0:Bu.findDOMNode(this);if(!o||GC.disabled){this.safeSetState({status:xs},function(){a.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:Ty},function(){a.props.onExiting(u),a.onTransitionEnd(c.exit,function(){a.safeSetState({status:xs},function(){a.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(a,o){o=this.setNextCallback(o),this.setState(a,o)},n.setNextCallback=function(a){var o=this,c=!0;return this.nextCallback=function(u){c&&(c=!1,o.nextCallback=null,a(u))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(a,o){this.setNextCallback(o);var c=this.props.nodeRef?this.props.nodeRef.current:Bu.findDOMNode(this),u=a==null&&!this.props.addEndListener;if(!c||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],p=f[0],m=f[1];this.props.addEndListener(p,m)}a!=null&&setTimeout(this.nextCallback,a)},n.render=function(){var a=this.state.status;if(a===Vu)return null;var o=this.props,c=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var u=s0(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Cn.createElement(Oh.Provider,{value:null},typeof c=="function"?c(a,u):Cn.cloneElement(Cn.Children.only(c),u))},t}(Cn.Component);Xi.contextType=Oh;Xi.propTypes={};function Hl(){}Xi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Hl,onEntering:Hl,onEntered:Hl,onExit:Hl,onExiting:Hl,onExited:Hl};Xi.UNMOUNTED=Vu;Xi.EXITED=xs;Xi.ENTERING=bs;Xi.ENTERED=Xl;Xi.EXITING=Ty;function xz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $0(e,t){var n=function(o){return t&&y.isValidElement(o)?t(o):o},r=Object.create(null);return e&&y.Children.map(e,function(a){return a}).forEach(function(a){r[a.key]=n(a)}),r}function bz(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),a=[];for(var o in e)o in t?a.length&&(r[o]=a,a=[]):a.push(o);var c,u={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var p=r[f][c];u[r[f][c]]=n(p)}u[f]=n(f)}for(c=0;c<a.length;c++)u[a[c]]=n(a[c]);return u}function Rs(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Sz(e,t){return $0(e.children,function(n){return y.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Rs(n,"appear",e),enter:Rs(n,"enter",e),exit:Rs(n,"exit",e)})})}function wz(e,t,n){var r=$0(e.children),a=bz(t,r);return Object.keys(a).forEach(function(o){var c=a[o];if(y.isValidElement(c)){var u=o in t,f=o in r,p=t[o],m=y.isValidElement(p)&&!p.props.in;f&&(!u||m)?a[o]=y.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:Rs(c,"exit",e),enter:Rs(c,"enter",e)}):!f&&u&&!m?a[o]=y.cloneElement(c,{in:!1}):f&&u&&y.isValidElement(p)&&(a[o]=y.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:Rs(c,"exit",e),enter:Rs(c,"enter",e)}))}}),a}var jz=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Cz={component:"div",childFactory:function(t){return t}},Po=function(e){FD(t,e);function t(r,a){var o;o=e.call(this,r,a)||this;var c=o.handleExited.bind(xz(o));return o.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},o}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(a,o){var c=o.children,u=o.handleExited,f=o.firstRender;return{children:f?Sz(a,u):wz(a,c,u),firstRender:!1}},n.handleExited=function(a,o){var c=$0(this.props.children);a.key in c||(a.props.onExited&&a.props.onExited(o),this.mounted&&this.setState(function(u){var f=Ph({},u.children);return delete f[a.key],{children:f}}))},n.render=function(){var a=this.props,o=a.component,c=a.childFactory,u=s0(a,["component","childFactory"]),f=this.state.contextValue,p=jz(this.state.children).map(c);return delete u.appear,delete u.enter,delete u.exit,o===null?Cn.createElement(Oh.Provider,{value:f},p):Cn.createElement(Oh.Provider,{value:f},Cn.createElement(o,u,p))},t}(Cn.Component);Po.propTypes={};Po.defaultProps=Cz;const HD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function Ez(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),HD.reduce((n,r)=>(n[r]=[],n),{}))}const QC={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Tz={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Rz({state:e,maxHeight:t,position:n,transitionDuration:r}){const[a,o]=n.split("-"),c=o==="center"?`${a}-center`:o,u={opacity:0,maxHeight:t,transform:QC[c],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},f={opacity:1,transform:Tz[c]},p={opacity:0,maxHeight:0,transform:QC[c]};return{...u,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function Dz(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const qD=y.forwardRef(({data:e,onHide:t,autoClose:n,...r},a)=>{const{autoClose:o,message:c,...u}=e,f=Dz(n,e.autoClose),p=y.useRef(-1),m=()=>window.clearTimeout(p.current),g=()=>{t(e.id),m()},v=()=>{typeof f=="number"&&(p.current=window.setTimeout(g,f))};return y.useEffect(()=>{var b;(b=e.onOpen)==null||b.call(e,e)},[]),y.useEffect(()=>(v(),m),[f]),s.jsx(b0,{...r,...u,onClose:g,ref:a,onMouseEnter:m,onMouseLeave:v,children:c})});qD.displayName="@mantine/notifications/NotificationContainer";var GD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const Az=Xi,_z={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Wr("overlay"),store:Xs,withinPortal:!0},kz=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":le(n)}}),Zi=me((e,t)=>{const n=se("Notifications",_z,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:v,notificationMaxHeight:b,limit:S,zIndex:j,store:C,portalProps:R,withinPortal:D,...E}=n,T=Sn(),A=dz(C),_=iN(),M=ax(),L=y.useRef({}),$=y.useRef(0),Y=(T.respectReducedMotion?M:!1)?1:g,W=Me({name:"Notifications",classes:GD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:kz});y.useEffect(()=>{C==null||C.updateState(Z=>({...Z,limit:S||5,defaultPosition:p}))},[S,p]),Li(()=>{A.notifications.length>$.current&&setTimeout(()=>_(),0),$.current=A.notifications.length},[A.notifications]);const G=Ez(A.notifications,p),X=HD.reduce((Z,P)=>(Z[P]=G[P].map(({style:I,...z})=>s.jsx(Az,{timeout:Y,onEnter:()=>L.current[z.id].offsetHeight,nodeRef:{current:L.current[z.id]},children:F=>s.jsx(qD,{ref:O=>{L.current[z.id]=O},data:z,onHide:O=>VD(O,C),autoClose:m,...W("notification",{style:{...Rz({state:F,position:P,transitionDuration:Y,maxHeight:b}),...I}})})},z.id)),Z),{});return s.jsxs(Ho,{withinPortal:D,...R,children:[s.jsx(ce,{...W("root"),"data-position":"top-center",ref:t,...E,children:s.jsx(Po,{children:X["top-center"]})}),s.jsx(ce,{...W("root"),"data-position":"top-left",...E,children:s.jsx(Po,{children:X["top-left"]})}),s.jsx(ce,{...W("root",{className:sc.classNames.fullWidth}),"data-position":"top-right",...E,children:s.jsx(Po,{children:X["top-right"]})}),s.jsx(ce,{...W("root",{className:sc.classNames.fullWidth}),"data-position":"bottom-right",...E,children:s.jsx(Po,{children:X["bottom-right"]})}),s.jsx(ce,{...W("root"),"data-position":"bottom-left",...E,children:s.jsx(Po,{children:X["bottom-left"]})}),s.jsx(ce,{...W("root"),"data-position":"bottom-center",...E,children:s.jsx(Po,{children:X["bottom-center"]})})]})});Zi.classes=GD;Zi.displayName="@mantine/notifications/Notifications";Zi.show=ca.show;Zi.hide=ca.hide;Zi.update=ca.update;Zi.clean=ca.clean;Zi.cleanQueue=ca.cleanQueue;Zi.updateState=ca.updateState;class Pz{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Ed{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class Nz{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(a,o){const c=a.consumeAndParse(n);return r(o,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(a,o,c){const u=a.consumeAndParse(n);return r(o,c,u)},precedence:n})}construct(t){return new Oz(t,this.prefixParselets,this.infixParselets)}}class Oz{constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){const n=this.peek();return(n==null?void 0:n.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let a=r.parse(this,n);for(;t>this.getPrecedence();){const o=this.consume();a=this.getInfixParselet(o).parse(this,a,o)}return a}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){var r,a;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const o=this.peek();throw Error(`Expected ${t} but got "${o.id}" (${o.value}) at line ${o.line} column ${o.column}.`)}if(n&&((a=this.peek())==null?void 0:a.value)!==n){const o=this.peek();throw Error(`Expected "${n}" but got "${o.value}" at line ${o.line} column ${o.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}class QD{constructor(t=10){this.max=t,this.cache=new Map}clear(){this.cache.clear()}get(t){const n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){this.cache.has(t)?this.cache.delete(t):this.cache.size>=this.max&&this.cache.delete(this.first()),this.cache.set(t,n)}delete(t){this.cache.delete(t)}keys(){return this.cache.keys()}first(){return this.cache.keys().next().value}}const _c="http://hl7.org",WD="ok",Mz="created",Iz="gone",Lz="not-modified",zz="not-found",$z="unauthorized",Uz="forbidden",Bz="accepted",Vz={resourceType:"OperationOutcome",id:WD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Fz={resourceType:"OperationOutcome",id:zz,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},td={resourceType:"OperationOutcome",id:$z,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},Hz={...td,issue:[...td.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},WC={...td,issue:[...td.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},YD={resourceType:"OperationOutcome",id:Uz,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function ai(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function yn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function qz(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Up(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function KD(e){return e.id===WD||e.id===Mz||e.id===Lz||e.id===Bz}function Gz(e){return e.id===Iz}class dt extends Error{constructor(t,n){super(XD(t)),this.outcome=t,this.cause=n}}function Jt(e){return e instanceof dt?e.outcome:Up(e)?e:ai(Ke(e))}function Ke(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Up(e)?XD(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function XD(e){var n;const t=((n=e.issue)==null?void 0:n.map(ZD))??[];return t.length>0?t.join("; "):"Unknown error"}function ZD(e){var n,r;let t;return(n=e.details)!=null&&n.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(r=e.expression)!=null&&r.length&&(t+=` (${e.expression.join(", ")})`),t}function Qz(e,t){const n=t.max&&t.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:t.max;return{path:e,description:"",type:t.type??[],min:t.min??0,max:n??1,isArray:!!n&&n>1,constraints:[]}}function Wz(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,type:n,path:n,elements:Object.fromEntries(Object.entries(r.elements).map(([a,o])=>[a,Qz(a,o)])),constraints:[],innerTypes:[]};return t}const Yz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},Kz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},Xz={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"}]}}},Zz={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"}]}}},Jz={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"}]}}},e8={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"}]}}},t8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},n8={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"}]}}},r8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},a8={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"}]}}},i8={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"}]}}},o8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},s8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},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"}]}}},l8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]},code:{max:9007199254740991,type:[{code:"Coding"}]}}},c8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},"value[x]":{type:[{code:"dateTime"},{code:"Period"},{code:"Duration"}]}}},u8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},d8={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"}]}}},f8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},sequence:{type:[{code:"integer"}]},text:{type:[{code:"string"}]},additionalInstruction:{max:9007199254740991,type:[{code:"CodeableConcept"}]},patientInstruction:{type:[{code:"string"}]},timing:{type:[{code:"Timing"}]},"asNeeded[x]":{type:[{code:"boolean"},{code:"CodeableConcept"}]},site:{type:[{code:"CodeableConcept"}]},route:{type:[{code:"CodeableConcept"}]},method:{type:[{code:"CodeableConcept"}]},doseAndRate:{max:9007199254740991,type:[{code:"DosageDoseAndRate"}]},maxDosePerPeriod:{type:[{code:"Ratio"}]},maxDosePerAdministration:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},maxDosePerLifetime:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},h8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{type:[{code:"CodeableConcept"}]},"dose[x]":{type:[{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},"rate[x]":{type:[{code:"Ratio"},{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},p8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},m8={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"}]}}},g8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},v8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},discriminator:{max:9007199254740991,type:[{code:"ElementDefinitionSlicingDiscriminator"}]},description:{type:[{code:"string"}]},ordered:{type:[{code:"boolean"}]},rules:{min:1,type:[{code:"code"}]}}},y8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},min:{min:1,type:[{code:"unsignedInt"}]},max:{min:1,type:[{code:"string"}]}}},x8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},targetProfile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},aggregation:{max:9007199254740991,type:[{code:"code"}]},versioning:{type:[{code:"code"}]}}},b8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},label:{min:1,type:[{code:"string"}]},"value[x]":{min:1,type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},S8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},key:{min:1,type:[{code:"id"}]},requirements:{type:[{code:"string"}]},severity:{min:1,type:[{code:"code"}]},human:{min:1,type:[{code:"string"}]},expression:{type:[{code:"string"}]},xpath:{type:[{code:"string"}]},source:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},w8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},strength:{min:1,type:[{code:"code"}]},description:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]}}},j8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},identity:{min:1,type:[{code:"id"}]},language:{type:[{code:"code"}]},map:{min:1,type:[{code:"string"}]},comment:{type:[{code:"string"}]}}},C8={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"}]}}},E8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"uri"}]},"value[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},T8={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"}]}}},R8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"CodeableConcept"}]},system:{type:[{code:"uri"}]},value:{type:[{code:"string"}]},period:{type:[{code:"Period"}]},assigner:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},D8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},country:{min:1,type:[{code:"CodeableConcept"}]},jurisdiction:{type:[{code:"CodeableConcept"}]},status:{min:1,type:[{code:"CodeableConcept"}]},dateRange:{min:1,type:[{code:"Period"}]},restoreDate:{type:[{code:"dateTime"}]}}},A8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},onBehalfOf:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},accounts:{max:9007199254740991,type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},_8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},k8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},P8={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"]}]}}},N8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},O8={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"}]}}},M8={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"}]}}},I8={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"}]}}},L8={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"}]}}},z8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},high:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},$8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},U8={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"}]}}},B8={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"]}]}}},V8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},period:{min:1,type:[{code:"decimal"}]},factor:{type:[{code:"decimal"}]},lowerLimit:{type:[{code:"decimal"}]},upperLimit:{type:[{code:"decimal"}]},dimensions:{min:1,type:[{code:"positiveInt"}]},data:{type:[{code:"string"}]}}},F8={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"}]}}},H8={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"}]}}},q8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},G8={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"}]}}},Q8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"bounds[x]":{type:[{code:"Duration"},{code:"Range"},{code:"Period"}]},count:{type:[{code:"positiveInt"}]},countMax:{type:[{code:"positiveInt"}]},duration:{type:[{code:"decimal"}]},durationMax:{type:[{code:"decimal"}]},durationUnit:{type:[{code:"code"}]},frequency:{type:[{code:"positiveInt"}]},frequencyMax:{type:[{code:"positiveInt"}]},period:{type:[{code:"decimal"}]},periodMax:{type:[{code:"decimal"}]},periodUnit:{type:[{code:"code"}]},dayOfWeek:{max:9007199254740991,type:[{code:"code"}]},timeOfDay:{max:9007199254740991,type:[{code:"time"}]},when:{max:9007199254740991,type:[{code:"code"}]},offset:{type:[{code:"unsignedInt"}]}}},W8={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"}]}}},Y8={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"]}]}}},K8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},X8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{max:0,type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Z8={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"}]}}},J8={Element:Yz,BackboneElement:Kz,Address:Xz,Age:Zz,Annotation:Jz,Attachment:e8,CodeableConcept:t8,Coding:n8,ContactDetail:r8,ContactPoint:a8,Contributor:i8,Count:o8,DataRequirement:s8,DataRequirementCodeFilter:l8,DataRequirementDateFilter:c8,DataRequirementSort:u8,Distance:d8,Dosage:f8,DosageDoseAndRate:h8,Duration:p8,ElementDefinition:m8,ElementDefinitionSlicingDiscriminator:g8,ElementDefinitionSlicing:v8,ElementDefinitionBase:y8,ElementDefinitionType:x8,ElementDefinitionExample:b8,ElementDefinitionConstraint:S8,ElementDefinitionBinding:w8,ElementDefinitionMapping:j8,Expression:C8,Extension:E8,HumanName:T8,Identifier:R8,MarketingStatus:D8,Meta:A8,Money:_8,Narrative:k8,ParameterDefinition:P8,Period:N8,Population:O8,ProdCharacteristic:M8,ProductShelfLife:I8,Quantity:L8,Range:z8,Ratio:$8,Reference:U8,RelatedArtifact:B8,SampledData:V8,Signature:F8,SubstanceAmount:H8,SubstanceAmountReferenceRange:q8,Timing:G8,TimingRepeat:Q8,TriggerDefinition:W8,UsageContext:Y8,MoneyQuantity:K8,SimpleQuantity:X8,IdentityProvider:Z8};function e$(e){return new n$(e).parse()}const Mh=Wz(J8),U0=Object.create(null),YC=Object.create(null),t$={"http://hl7.org/fhir/StructureDefinition/MoneyQuantity":"MoneyQuantity","http://hl7.org/fhir/StructureDefinition/SimpleQuantity":"SimpleQuantity","http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition":"ViewDefinition"};function JD(e){let t;return t=YC[e],t||(t=YC[e]=Object.create(null)),t}function KC(e){var r;const n=(Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(a=>a.resource))??[]).filter(a=>(a==null?void 0:a.resourceType)==="StructureDefinition");Q$(n);for(const a of n)eA(a)}function eA(e){var o,c;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=e$(e),n=t$[e.url];let r,a;n?(r=Mh,a=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(o=e.type)!=null&&o.startsWith("http://")||(c=e.type)!=null&&c.startsWith("https://")?(r=Mh,a=e.type):(r=JD(e.url),a=e.type),r[a]=t;for(const u of t.innerTypes)u.parentType=t,r[u.name]=u;U0[e.url]=t}function tA(e){return!!Mh[e]}function Bp(e,t){if(t){const n=JD(t)[e];if(n)return n}return Mh[e]}function nA(e,t){const n=Bp(e,t);if(!n)throw new dt(ai("Unknown data type: "+e));return n}function B0(e){return!!U0[e]}function kc(e){return U0[e]}class n${constructor(t){var n;if(!((n=t.snapshot)!=null&&n.element)||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,path:this.root.path,title:t.title,type:t.type,url:t.url,version:t.version,kind:t.kind,description:i$(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,a,o,c;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((n=t.id)!=null&&n.includes(":")){if((r=this.slicingContext)!=null&&r.current){const u=Lv(t,this.slicingContext.path);this.slicingContext.current.elements[u]=this.parseElementDefinition(t)}}else{const u=this.parseElementDefinition(t);this.checkFieldEnter(t,u);let f=this.backboneContext;for(;f;){if((a=t.path)!=null&&a.startsWith(f.path+".")){f.type.elements[Lv(t,f.path)]=u;break}f=f.parent}if(!f){const p=Lv(t,this.root.path);t.isSummary&&((o=this.resourceSchema.summaryProperties)==null||o.add(p.replace("[x]",""))),u.min>0&&((c=this.resourceSchema.mandatoryProperties)==null||c.add(p.replace("[x]",""))),this.resourceSchema.elements[p]=u}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),this.slicingContext&&!ql(this.slicingContext.path,t==null?void 0:t.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var r,a,o;for(;this.backboneContext&&!ql((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=iE(t);this.backboneContext={type:{name:n,type:n,path:t.path,title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path,parent:ql((a=this.backboneContext)==null?void 0:a.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,n){var r,a,o,c;a$(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((a=t.slicing)==null?void 0:a.discriminator)??[]).map(u=>{if(u.type!=="value"&&u.type!=="pattern"&&u.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${u.type}`);return{path:u.path,type:u.type}}),slices:[],ordered:((o=t.slicing)==null?void 0:o.ordered)??!1,rule:(c=t.slicing)==null?void 0:c.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!ql(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&&!ql(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){const t=this.peek();if(t)return this.index++,t}peek(){var n,r,a,o,c;const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const u=t.contentReference.slice(t.contentReference.indexOf("#")+1),f=this.elementIndex[u];return f?{...f,id:t.id,path:t.path,min:t.min??f.min,max:t.max??f.max,base:{path:((n=f.base)==null?void 0:n.path)??u,min:((r=t.base)==null?void 0:r.min)??((a=f.base)==null?void 0:a.min)??f.min,max:((o=t.base)==null?void 0:o.max)??((c=f.base)==null?void 0:c.max)??f.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(ql(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(a=>["BackboneElement","Element"].includes(a.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var a;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=iE(t)),r||(r=(a=Ji(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:a.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var o,c;const n=XC(t.max),r=(o=t.base)!=null&&o.max?XC(t.base.max):n,a={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((c=t.base)==null?void 0:c.path)||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(u=>({key:u.key??"",severity:u.severity??"error",expression:u.expression??"",description:u.human??""})),type:this.parseElementDefinitionType(t),fixed:ZC(mc(a,"fixed[x]")),pattern:ZC(mc(a,"pattern[x]")),binding:t.binding}}}function XC(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Lv(e,t=""){return r$(e.path,t)}function r$(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function ql(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function ZC(e){return Array.isArray(e)&&e.length>0?e[0]:Tn(e)?void 0:e}function a$(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(a=>a.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function i$(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function o$(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?s$:mc,[a,...o]=t.split(".");let c=[r(e,a,n)];for(const u of o){const f=[];for(const p of c)if(Array.isArray(p))for(const m of p)f.push(r(m,u,n));else(n!=null&&n.withPath&&p&&p.value!==void 0||!(n!=null&&n.withPath)&&p!==void 0)&&f.push(r(p,u,n));c=f}return c}function s$(e,t,n){const r=e.path;return l$(mc(e,t,n),r,t)}function l$(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((a,o)=>({...a,path:`${r}${n}[${o}]`})):{...e,path:`${r}${n}`}}const rA={date:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/,dateTime:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/};function c$(e,t,n,r){var c;if(Array.isArray(e))return!1;let a;t.path==="$this"?a=n:a=(r??n.elements)[t.path];const o=n.type;switch(t.type){case"value":case"pattern":if(!e||!a)return!1;if(a.pattern)return H0(e,a.pattern);if(a.fixed)return Uo(e,a.fixed);if(((c=a.binding)==null?void 0:c.strength)==="required"&&a.binding.valueSet)return!0;break;case"type":return!e||!(o!=null&&o.length)?!1:o.some(u=>u.code===e.type)}return!1}function Qe(e){return[{type:oe.boolean,value:e}]}function ha(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:oe.integer,value:e}:typeof e=="number"?{type:oe.decimal,value:e}:typeof e=="boolean"?{type:oe.boolean,value:e}:typeof e=="string"?{type:oe.string,value:e}:ua(e)?{type:oe.Quantity,value:e}:fi(e)?{type:e.resourceType,value:e}:fA(e)?{type:oe.CodeableConcept,value:e}:dA(e)?{type:oe.Coding,value:e}:{type:oe.BackboneElement,value:e}}function ei(e){return e.length===0?!1:!!e[0].value}function Ui(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 mc(e,t,n){if(!e.value)return;const r=Zs(e.type,t,n==null?void 0:n.profileUrl);return r?aA(e,t,r):Td(e,t)}function aA(e,t,n){const r=e.value,a=n.type;if(!a||a.length===0)return;let o,c="undefined",u;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of a){const g=p.replace("[x]",Fn(m.code));if(o=r[g],u=r["_"+g],o!==void 0||u!==void 0){c=m.code;break}}if(u)if(Array.isArray(o)){o=o.slice();for(let m=0;m<Math.max(o.length,u.length);m++)o[m]=nE(o[m],u[m])}else o=nE(o,u);if(!Tn(o))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(o)?o.map(m=>JC(m,c)):JC(o,c)}function JC(e,t){return t==="Resource"&&fi(e)&&(t=e.resourceType),{type:t,value:e}}function Td(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const a=n[t];Array.isArray(a)?r=a.map(ha):r=ha(a)}else{const a=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const o of Object.values(oe)){const c=a+Fn(o);if(c in n){const u=n[c];Array.isArray(u)?r=u.map(f=>({type:o,value:f})):r={type:o,value:u};break}}}if(Array.isArray(r)){if(r.length===0||Tn(r[0]))return}else if(Tn(r))return;return r}function iA(e){const t=[];for(const n of e){let r=!1;for(const a of t)if(ei(Vp(n,a))){r=!0;break}r||t.push(n)}return t}function u$(e){return Qe(!ei(e))}function d$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Qe(!1):Qe(e.every((n,r)=>ei(Vp(n,t[r]))))}function f$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Qe(!0):Qe(e.some((n,r)=>!ei(Vp(n,t[r]))))}function Vp(e,t){var a,o;const n=(a=e.value)==null?void 0:a.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?Qe(Math.abs(n-r)<1e-8):ua(n)&&ua(r)?Qe(lA(n,r)):Qe(typeof n=="object"&&typeof r=="object"?V0(e,t):n===r)}function oA(e,t){return e.length===0&&t.length===0?Qe(!0):e.length!==t.length?Qe(!1):(e.sort(eE),t.sort(eE),Qe(e.every((n,r)=>ei(h$(n,t[r])))))}function h$(e,t){const{type:n,value:r}=e,{type:a,value:o}=t,c=r==null?void 0:r.valueOf(),u=o==null?void 0:o.valueOf();return typeof c=="number"&&typeof u=="number"?Qe(Math.abs(c-u)<.01):ua(c)&&ua(u)?Qe(lA(c,u)):Qe(n==="Coding"&&a==="Coding"?typeof c!="object"||typeof u!="object"?!1:c.code===u.code&&c.system===u.system:typeof c=="object"&&typeof u=="object"?V0({...c,id:void 0},{...u,id:void 0}):typeof c=="string"&&typeof u=="string"?c.toLowerCase()===u.toLowerCase():c===u)}function eE(e,t){var a,o;const n=(a=e.value)==null?void 0:a.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function sA(e,t){const{value:n}=e;if(n==null)return!1;let r=t;switch(r.startsWith("System.")&&(r=r.substring(7)),r.startsWith("FHIR.")&&(r=r.substring(5)),r){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return p$(n);case"DateTime":return Ih(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return m$(n);case"Quantity":return ua(n);default:return e.type===r||typeof n=="object"&&(n==null?void 0:n.resourceType)===r}}function p$(e){return typeof e=="string"&&!!rA.date.exec(e)}function Ih(e){return typeof e=="string"&&!!rA.dateTime.exec(e)}function m$(e){return!!(e&&typeof e=="object"&&("start"in e&&Ih(e.start)||"end"in e&&Ih(e.end)))}function ua(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function lA(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 V0(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n){const o=e[a],c=t[a];if(tE(o)&&tE(c)){if(!V0(o,c))return!1}else if(o!==c)return!1}return!0}function tE(e){return e!==null&&typeof e=="object"}function nE(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return g$(e??{},t)}return e}function g$(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function v$(e,t){return fi(e,t)&&"id"in e&&typeof e.id=="string"}function fn(e){const t=Lt(e)??"undefined/undefined",n=Bi(e);return n===t?{reference:t}:{reference:t,display:n}}function Lt(e){if(Qo(e))return e.reference;if(v$(e))return`${e.resourceType}/${e.id}`}function Is(e){if(e)return Qo(e)?e.reference.split("/")[1]:e.id}function y$(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Bi(e){if(y$(e)){const t=x$(e);if(t)return t}if(e.resourceType==="Device"){const t=b$(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Bo(e.medicationCodeableConcept);if(e.resourceType==="Subscription"&&e.criteria)return e.criteria;if(e.resourceType==="User"&&e.email)return e.email;if("name"in e&&e.name&&typeof e.name=="string")return e.name;if("code"in e&&e.code){let t=e.code;if(Array.isArray(t)&&(t=t[0]),fA(t))return Bo(t);if(A$(t))return t.text}return Lt(e)??""}function x$(e){const t=e.name;if(t&&t.length>0)return Pc(t[0])}function b$(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function S$(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=rE(n);if(r)return r}else return rE(t)}function rE(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function cA(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const a=n.getUTCFullYear(),o=n.getUTCMonth(),c=n.getUTCDate(),u=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=u-a;(f<o||f===o&&p<c)&&m--;let g=u*12+f-(a*12+o);p<c&&g--;const v=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:v}}function w$(e,t){const{years:n,months:r,days:a}=cA(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":a.toString().padStart(3,"0")+"D"}function Ji(e,...t){var r;let n=e;for(let a=0;a<t.length&&n;a++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(o=>o.url===t[a]);return n}function Ia(e,t){const n=F0(e);return JSON.stringify(n,null,t?2:void 0)??""}function F0(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?j$(e):C$(e):e}function j$(e){const t=e.length;if(t===0)return;let n,r=0;for(let a=0;a<t;a++){const o=e[a],c=F0(o);c!==o&&!n&&(n=Array.from(e)),c===void 0?n&&(n[a]=null):(n&&(n[a]=c),r++)}if(r!==0)return n??e}function C$(e){let t,n=0;for(const r in e){const a=e[r],o=F0(a);o!==a&&!t&&(t={...e}),o===void 0?t&&delete t[r]:(t&&(t[r]=o),n++)}if(n!==0)return t??e}function Tn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!En(e):!1}function En(e){if(e==null)return!1;const t=typeof e;return t==="string"&&e!==""||t==="object"&&("length"in e&&e.length>0||Object.keys(e).length>0)}function Uo(e,t,n){return e===t||Tn(e)&&Tn(t)?!0:Tn(e)||Tn(t)?!1:Array.isArray(e)&&Array.isArray(t)?E$(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?T$(e,t,n):(sr(e)||sr(t),!1)}function E$(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Uo(e[n],t[n]))return!1;return!0}function T$(e,t,n){const r=new Set;Object.keys(e).forEach(a=>r.add(a)),Object.keys(t).forEach(a=>r.add(a)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const a of r){const o=e[a],c=t[a];if(!Uo(o,c,a))return!1}return!0}function H0(e,t){return Tn(e)?!0:Tn(t)?!1:Array.isArray(e)&&Array.isArray(t)?R$(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?D$(e,t):sr(e)||sr(t)?!1:e===t}function R$(e,t){return t.every(n=>e.some(r=>H0(r,n)))}function D$(e,t){return Object.entries(t).every(([n,r])=>n in e&&H0(e[n],r))}function Qr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function uA(e){return/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i.test(e)}function sr(e){return e!==null&&typeof e=="object"}function dA(e){return sr(e)&&"code"in e&&typeof e.code=="string"}function fA(e){return sr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(dA)}function A$(e){return sr(e)&&"text"in e&&typeof e.text=="string"}const hA=[];for(let e=0;e<256;e++)hA.push(e.toString(16).padStart(2,"0"));function _$(e){const t=pA(e),n=new Uint8Array(t),r=new Array(n.length);for(let a=0;a<n.length;a++)r[a]=hA[n[a]];return r.join("")}function k$(e){const t=pA(e),n=new Uint8Array(t),r=new Array(n.length);for(let a=0;a<n.length;a++)r[a]=String.fromCharCode(n[a]);return window.btoa(r.join(""))}function pA(e){return ArrayBuffer.isView(e)?e.buffer:e}function Fn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function q0(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function Ds(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function P$(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(a=>a.system===t))==null?void 0:r.code}function N$(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const aE=e=>new Promise(t=>{setTimeout(t,e)});function Ry(e,t,n){const r=[];for(let a=0;a<n-1;a++){const o=e.indexOf(t);if(o<0)break;r.push(e.slice(0,o)),e=e.slice(o+t.length)}return r.push(e),r}function O$(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Ou(e,t){return e?(e.push(t),e):[t]}function nd(e){return e.sort((t,n)=>t.localeCompare(n))}function G0(e){return e.endsWith("/")?e:e+"/"}function M$(e){return e.startsWith("/")?e.slice(1):e}function Xa(e,t){return new URL(M$(t),G0(e.toString())).toString()}function I$(e,t){return Xa(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function L$(e){return typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)&&(e=Object.fromEntries(Object.entries(e).filter(t=>t[1]!==void 0))),new URLSearchParams(e).toString()}function mA(e,t){var n,r;return(r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function z$(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const a=e.meta.profile.indexOf(t);e.meta.profile.splice(a,1)}return e}function rd(e){if(!e)return"";switch(e.type){case"Address":return gA(e.value);case"CodeableConcept":return Bo(e.value);case"Coding":return Rd(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Pc(e.value);case"Quantity":return As(e.value);case"Reference":return $$(e.value);default:return e.value.toString()}}function $$(e){return e?e.display??e.reference??Ia(e):""}function gA(e,t){if(!e)return"";const n=[];if(e.line&&n.push(...e.line),e.city||e.state||e.postalCode){const r=[];e.city&&r.push(e.city),e.state&&r.push(e.state),e.postalCode&&r.push(e.postalCode),n.push(r.join(", "))}return e.use&&(t!=null&&t.use)&&n.push("["+e.use+"]"),n.join(", ").trim()}function Pc(e,t){if(!e)return"";const n=[];if(e.prefix&&(t==null?void 0:t.prefix)!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&n.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&n.push("["+e.use+"]"),n.length===0){const r=id(e.text);if(r)return r}return n.join(" ").trim()}function Fp(e){return e instanceof Date&&!isNaN(e.getTime())}function U$(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Fp(r)?r.toLocaleTimeString(t,n):""}function gr(e,t,n){if(!e)return"";const r=new Date(e);return Fp(r)?r.toLocaleString(t,n):""}function B$(e,t,n){return!e||!e.start&&!e.end?"":gr(e.start,t,n)+" - "+gr(e.end,t,n)}const V$={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},F$={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},H$={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function vA(e){if(!e)return"";const t=[];return q$(t,e.repeat),e.event&&t.push(e.event.map(n=>gr(n)).join(", ")),Fn(t.join(" ").trim())}function q$(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,a=t.periodUnit;n===1&&r===1?e.push(V$[a]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+F$[a]):e.push("per "+r+" "+H$[a])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Fn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(o=>U$(o)).join(", "))}function ad(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},a=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(a==null?void 0:a.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(a==null?void 0:a.value)===void 0?`>= ${As(r)}`:(r==null?void 0:r.value)===void 0&&(a==null?void 0:a.value)!==void 0?`<= ${As(a)}`:((r==null?void 0:r.unit)===(a==null?void 0:a.unit)&&(r==null||delete r.unit),`${As(r)} - ${As(a)}`)}function As(e,t){if(!e)return"";const n=[];return e.comparator&&(n.push(e.comparator),n.push(" ")),e.value!==void 0&&n.push(e.value),e.unit&&(e.unit!=="%"&&n[n.length-1]!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function G$(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Bo(e){if(!e)return"";const t=id(e.text);return t||(e.coding?e.coding.map(n=>Rd(n)).join(", "):"")}function Rd(e,t){const n=id(e==null?void 0:e.display);return n?`${n}`:id(e==null?void 0:e.code)??""}function yA(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(As(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Bo(e.valueCodeableConcept));else{const n=id(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>yA(n)).join(" / ")),t.join(" / ").trim()}function id(e){return typeof e=="string"?e:void 0}const oe={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 Q$(e){var n;const t=Array.isArray(e)?e:((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];for(const r of t)(r==null?void 0:r.resourceType)==="StructureDefinition"&&r.kind==="resource"&&xA(r.type)}function xA(e){let t=li.types[e];return t||(t={searchParamsDetails:{}},li.types[e]=t),t.searchParams||(t.searchParams={_id:{base:[e],code:"_id",type:"token",expression:e+".id"},_lastUpdated:{base:[e],code:"_lastUpdated",type:"date",expression:e+".meta.lastUpdated"},_compartment:{base:[e],code:"_compartment",type:"reference",expression:e+".meta.compartment"},_profile:{base:[e],code:"_profile",type:"uri",expression:e+".meta.profile"},_security:{base:[e],code:"_security",type:"token",expression:e+".meta.security"},_source:{base:[e],code:"_source",type:"uri",expression:e+".meta.source"},_tag:{base:[e],code:"_tag",type:"token",expression:e+".meta.tag"}}),t}function W$(e){for(const t of e.base??[]){const n=xA(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function iE(e){var n,r,a,o;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?Y$((o=((a=e.base)==null?void 0:a.path)??e.path)==null?void 0:o.split(".")):t}function Y$(e){return e.length===1?e[0]:e.map(Fn).join("")}function Q0(e){var t;return(t=li.types[e])==null?void 0:t.searchParams}function K$(e,t){var n,r;return(r=(n=li.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function Ls(e){const t=e.replaceAll("[x]","").split(".").pop();return bA(t)}function bA(e){let t;return e.length<100?t=e.match(/[A-Z]+(?![a-z])|[A-Z]?[a-z]+|\d+/g)??[]:t=e.split(/(?=[A-Z])/),t.map(Z$).join(" ").replace("_"," ").replace(/\s+/g," ")}const X$=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function Z$(e){const t=e.toUpperCase();return e===t?e:X$.has(t)?t:t.charAt(0)+e.slice(1)}function Zs(e,t,n){const r=Bp(e,n);if(r)return J$(r.elements,t)}function J$(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const a=t[r];if(a>="A"&&a<="Z"){const o=t.slice(0,r)+"[x]",c=e[o];if(c)return c}}}function fi(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function Qo(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const li={types:{}};function yh(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 ki=()=>[],Tr={empty:(e,t)=>Qe(t.length===0||t.every(n=>Tn(n.value))),hasValue:(e,t)=>Qe(t.length!==0),exists:(e,t,n)=>Qe(n?t.filter(r=>ei(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Tn(r.value))),all:(e,t,n)=>Qe(t.every(r=>ei(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Qe(!1);return Qe(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Qe(!0);return Qe(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Qe(!1);return Qe(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Qe(!0);return Qe(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Qe(!0);const r=n.eval(e,gs(e));return r.length===0?Qe(!1):Qe(t.every(a=>r.some(o=>o.value===a.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,gs(e));return r.length===0?Qe(!0):t.length===0?Qe(!1):Qe(r.every(a=>t.some(o=>o.value===a.value)))},count:(e,t)=>[{type:oe.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(a=>a.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Qe(t.length===Tr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>ei(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:ki,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{var a;const r=(a=n.eval(e,t)[0])==null?void 0:a.value;if(typeof r!="number")throw new Error("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{var a;const r=(a=n.eval(e,t)[0])==null?void 0:a.value;if(typeof r!="number")throw new Error("Expected a number for take(num)");return r>=t.length?t:r<=0?[]:t.slice(0,r)},intersect:(e,t,n)=>{if(!n)return t;const r=n.eval(e,gs(e)),a=[];for(const o of t)!a.some(c=>c.value===o.value)&&r.some(c=>c.value===o.value)&&a.push(o);return a},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,gs(e)),a=[];for(const o of t)r.some(c=>c.value===o.value)||a.push(o);return a},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,gs(e));return iA([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,gs(e));return[...t,...r]},htmlChecks:(e,t,n)=>[ha(!0)],iif:(e,t,n,r,a)=>{const o=n.eval(e,t);if(o.length>1||o.length===1&&typeof o[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ei(o)?r.eval(e,t):a?a.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);if(typeof n=="boolean")return[{type:oe.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Qe(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Qe(!0);if(["false","f","no","n","0","0.0"].includes(r))return Qe(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Qe(Tr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return typeof n=="number"?[{type:oe.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:oe.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:oe.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Qe(Tr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:oe.date,value:yh(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Qe(Tr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:oe.dateTime,value:yh(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Qe(Tr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return typeof n=="number"?[{type:oe.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:oe.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:oe.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Qe(Tr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return ua(n)?[{type:oe.Quantity,value:n}]:typeof n=="number"?[{type:oe.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:oe.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:oe.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Qe(Tr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return n==null?[]:ua(n)?[{type:oe.string,value:`${n.value} '${n.unit}'`}]:[{type:oe.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Qe(Tr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:oe.time,value:yh("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Qe(Tr.toTime(e,t).length===1),indexOf:(e,t,n)=>oa((r,a)=>r.indexOf(a),e,t,n),substring:(e,t,n,r)=>oa((a,o,c)=>{const u=o,f=c?u+c:a.length;return u<0||u>=a.length?void 0:a.substring(u,f)},e,t,n,r),startsWith:(e,t,n)=>oa((r,a)=>r.startsWith(a),e,t,n),endsWith:(e,t,n)=>oa((r,a)=>r.endsWith(a),e,t,n),contains:(e,t,n)=>oa((r,a)=>r.includes(a),e,t,n),upper:(e,t)=>oa(n=>n.toUpperCase(),e,t),lower:(e,t)=>oa(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>oa((a,o,c)=>a.replaceAll(o,c),e,t,n,r),matches:(e,t,n)=>oa((r,a)=>!!new RegExp(a).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>oa((a,o,c)=>a.replaceAll(o,c),e,t,n,r),length:(e,t)=>oa(n=>n.length,e,t),toChars:(e,t)=>oa(n=>n?n.split(""):void 0,e,t),encode:ki,decode:ki,escape:ki,unescape:ki,trim:ki,split:ki,join:(e,t,n)=>{var a;const r=((a=n==null?void 0:n.eval(e,gs(e))[0])==null?void 0:a.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:oe.string,value:t.map(o=>{var c;return((c=o.value)==null?void 0:c.toString())??""}).join(r)}]},abs:(e,t)=>Ya(Math.abs,e,t),ceiling:(e,t)=>Ya(Math.ceil,e,t),exp:(e,t)=>Ya(Math.exp,e,t),floor:(e,t)=>Ya(Math.floor,e,t),ln:(e,t)=>Ya(Math.log,e,t),log:(e,t,n)=>Ya((r,a)=>Math.log(r)/Math.log(a),e,t,n),power:(e,t,n)=>Ya(Math.pow,e,t,n),round:(e,t)=>Ya(Math.round,e,t),sqrt:(e,t)=>Ya(Math.sqrt,e,t),truncate:(e,t)=>Ya(n=>n|0,e,t),children:ki,descendants:ki,trace:(e,t,n)=>t,now:()=>[{type:oe.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:oe.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:oe.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,a)=>{var p;const o=Tr.toDateTime(e,n.eval(e,t));if(o.length===0)throw new Error("Invalid start date");const c=Tr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const u=(p=a.eval(e,t)[0])==null?void 0:p.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const f=cA(o[0].value,c[0].value);return[{type:oe.Quantity,value:{value:f[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof Lh?r=n.name:n instanceof W0&&(r=n.left.name+"."+n.right.name),r?t.map(a=>({type:oe.boolean,value:sA(a,r)})):[]},not:(e,t)=>Tr.toBoolean(e,t).map(n=>({type:oe.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let a;if(typeof r=="string")a=r;else if(typeof r=="object"){const o=r;if(o.resource)return ha(o.resource);o.reference?a=o.reference:o.type&&o.identifier&&(a=`${o.type}?identifier=${o.identifier.system}|${o.identifier.value}`)}if(a!=null&&a.includes("?")){const[o]=a.split("?");return{type:o,value:{resourceType:o}}}if(a!=null&&a.includes("/")){const[o,c]=a.split("/");return{type:o,value:{resourceType:o,id:c}}}return{type:oe.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:oe.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:oe.BackboneElement,value:{namespace:"System",name:"Integer"}}:fi(n)?{type:oe.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:oe.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const a=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(o=>{var c;return{type:oe.boolean,value:((c=o.value)==null?void 0:c.resourceType)===a}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:oe.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let a="";return n instanceof Lh&&(a=n.name),a&&!r.reference.startsWith(a+"/")?[]:[{type:oe.id,value:Is(r)}]},extension:(e,t,n)=>{var o;const r=n.eval(e,t)[0].value,a=(o=t==null?void 0:t[0])==null?void 0:o.value;if(a){const c=Ji(a,r);if(c)return[{type:oe.Extension,value:c}]}return[]}};function oa(e,t,n,...r){if(n.length===0)return[];const[{value:a}]=Za(n,1);if(typeof a!="string")throw new Error("String function cannot be called with non-string");const o=e(a,...r.map(c=>{var u;return(u=c==null?void 0:c.eval(t,n)[0])==null?void 0:u.value}));return o===void 0?[]:Array.isArray(o)?o.map(ha):[ha(o)]}function Ya(e,t,n,...r){if(n.length===0)return[];const[{value:a}]=Za(n,1),o=ua(a),c=o?a.value:a;if(typeof c!="number")throw new Error("Math function cannot be called with non-number");const u=e(c,...r.map(m=>{var g;return(g=m.eval(t,n)[0])==null?void 0:g.value})),f=o?oe.Quantity:n[0].type,p=o?{...a,value:u}:u;return[{type:f,value:p}]}function Za(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const n of e)if(n==null)throw new Error("Expected non-null argument");return e}function gs(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class SA{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const a of n)r.push(this.child.eval({parent:t,variables:{$this:a}},[a]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`,{cause:r})}}toString(){return this.child.toString()}}class Gl{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Lh{constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(a=>this.evalValue(a)).filter(a=>(a==null?void 0:a.value)!==void 0)}getVariable(t){const n=t.variables[this.name];if(n!==void 0)return n;if(t.parent)return this.getVariable(t.parent)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return fi(n,this.name)?t:mc(t,this.name)}toString(){return this.name}}class eU{eval(){return[]}toString(){return"{}"}}class tU extends Pz{constructor(t,n,r){super(t,n),this.impl=r}eval(t,n){return this.impl(this.child.eval(t,n))}toString(){return this.operator+this.child.toString()}}class zh extends Ed{constructor(t,n){super("as",t,n)}eval(t,n){return Tr.ofType(t,this.left.eval(t,n),this.right)}}class Nr extends Ed{}class Aa extends Nr{constructor(t,n,r,a){super(t,n,r),this.impl=a}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const a=this.right.eval(t,n);if(a.length!==1)return[];const o=r[0].value,c=a[0].value,u=ua(o)?o.value:o,f=ua(c)?c.value:c,p=this.impl(u,f);return typeof p=="boolean"?Qe(p):ua(o)?[{type:oe.Quantity,value:{...o,value:p}}]:[ha(p)]}}class nU extends Ed{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n),o=[...r,...a];return o.length>0&&o.every(c=>typeof c.value=="string")?[{type:oe.string,value:o.map(c=>c.value).join("")}]:o}}class rU extends Nr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return Qe(r.some(o=>o.value===a[0].value))}}class aU extends Nr{constructor(t,n){super("in",t,n)}eval(t,n){const r=Ui(this.left.eval(t,n)),a=this.right.eval(t,n);return r?Qe(a.some(o=>Vp(r,o)[0].value)):[]}}class W0 extends Ed{constructor(t,n){super(".",t,n)}eval(t,n){return this.right.eval(t,this.left.eval(t,n))}toString(){return`${this.left.toString()}.${this.right.toString()}`}}class Y0 extends Ed{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return iA([...r,...a])}}class iU extends Nr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return d$(r,a)}}class oU extends Nr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return f$(r,a)}}class sU extends Nr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return oA(r,a)}}class lU extends Nr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return u$(oA(r,a))}}class K0 extends Nr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const a=this.right.name;return Qe(sA(r[0],a))}}class cU extends Nr{constructor(t,n){super("and",t,n)}eval(t,n){const r=Ui(this.left.eval(t,n),"boolean"),a=Ui(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(a==null?void 0:a.value)===!0?Qe(!0):(r==null?void 0:r.value)===!1||(a==null?void 0:a.value)===!1?Qe(!1):[]}}class uU extends Nr{constructor(t,n){super("or",t,n)}eval(t,n){const r=Ui(this.left.eval(t,n),"boolean"),a=Ui(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(a==null?void 0:a.value)===!1?Qe(!1):r!=null&&r.value||a!=null&&a.value?Qe(!0):[]}}class dU extends Nr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Ui(this.left.eval(t,n),"boolean"),a=Ui(this.right.eval(t,n),"boolean");return!r||!a?[]:Qe(r.value!==a.value)}}class fU extends Nr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Ui(this.left.eval(t,n),"boolean"),a=Ui(this.right.eval(t,n),"boolean");return(a==null?void 0:a.value)===!0||(r==null?void 0:r.value)===!1?Qe(!0):!r||!a?[]:Qe(!1)}}class X0{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Tr[this.name];if(!r)throw new Error("Unrecognized function: "+this.name);return r(t,n,...this.args)}toString(){return`${this.name}(${this.args.map(t=>t.toString()).join(", ")})`}}class Z0{constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const a=r[0].value;if(typeof a!="number")throw new Error("Invalid indexer expression: should return integer}");const o=this.left.eval(t,n);return a in o?[o[a]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const hU=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class pU{constructor(t,n,r,a){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(a!=null&&a.dateTimeLiterals),this.symbolRegex=(a==null?void 0:a.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
77
- `))}consumeString(t){this.advance();const r=this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t).replace(/\\u([0-9a-fA-F]{4})/g,(o,c)=>String.fromCodePoint(parseInt(c,16))),a=this.buildToken(t==="`"?"Symbol":"String",r);return this.advance(),a}consumeQuotedSymbol(t){this.mark();const n=this.pos.index;this.advance(),this.consumeString(t);const r=this.str.substring(n,this.pos.index);return this.buildToken("Symbol",r)}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;if(this.curr()==="T"&&(n=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?(r=!0,this.advance()):(this.curr()==="+"||this.curr()==="-")&&(r=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.pos.index===t)throw new Error("Invalid DateTime literal");let a=this.str.substring(t,this.pos.index);return a.endsWith("T")?a=a.substring(0,a.length-1):!a.startsWith("T")&&n&&!r&&(a+="Z"),this.buildToken("DateTime",a)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&mU(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){var n;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((n=this.prevToken())==null?void 0:n.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
78
- `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,n){const r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:t,value:n,...r}}}function mU(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&hU.includes(e.value)))}const gU=["true","false"],vU=["!=","!~","<=",">=","{}","->"];function yU(e){return new pU(e,gU,vU).tokenize()}const Zt={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,Modulo:4,Add:5,Subtract:5,Ampersand:5,Is:6,As:6,Union:7,GreaterThan:8,GreaterThanOrEquals:8,LessThan:8,LessThanOrEquals:8,Equals:9,Equivalent:9,NotEquals:9,NotEquivalent:9,In:10,Contains:10,And:11,Xor:12,Or:12,Implies:13},xU={parse(e){var n;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((n=e.peek())==null?void 0:n.value)+"`");return t}},bU={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new Z0(t,n)},precedence:Zt.Indexer},SU={parse(e,t){if(!(t instanceof Lh))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new X0(t.name,n)},precedence:Zt.FunctionCall};function wU(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r!=null&&r.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function jU(){return new Nz().registerPrefix("String",{parse:(e,t)=>new Gl({type:oe.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Gl({type:oe.dateTime,value:yh(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Gl({type:oe.Quantity,value:wU(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Gl({type:t.value.includes(".")?oe.decimal:oe.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Gl({type:oe.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Gl({type:oe.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Lh(t.value)}).registerPrefix("{}",{parse:()=>new eU}).registerPrefix("(",xU).registerInfix("[",bU).registerInfix("(",SU).prefix("+",Zt.UnaryAdd,(e,t)=>new tU("+",t,n=>n)).prefix("-",Zt.UnarySubtract,(e,t)=>new Aa("-",t,t,(n,r)=>-r)).infixLeft(".",Zt.Dot,(e,t,n)=>new W0(e,n)).infixLeft("/",Zt.Divide,(e,t,n)=>new Aa("/",e,n,(r,a)=>r/a)).infixLeft("*",Zt.Multiply,(e,t,n)=>new Aa("*",e,n,(r,a)=>r*a)).infixLeft("+",Zt.Add,(e,t,n)=>new Aa("+",e,n,(r,a)=>r+a)).infixLeft("-",Zt.Subtract,(e,t,n)=>new Aa("-",e,n,(r,a)=>r-a)).infixLeft("|",Zt.Union,(e,t,n)=>new Y0(e,n)).infixLeft("=",Zt.Equals,(e,t,n)=>new iU(e,n)).infixLeft("!=",Zt.NotEquals,(e,t,n)=>new oU(e,n)).infixLeft("~",Zt.Equivalent,(e,t,n)=>new sU(e,n)).infixLeft("!~",Zt.NotEquivalent,(e,t,n)=>new lU(e,n)).infixLeft("<",Zt.LessThan,(e,t,n)=>new Aa("<",e,n,(r,a)=>r<a)).infixLeft("<=",Zt.LessThanOrEquals,(e,t,n)=>new Aa("<=",e,n,(r,a)=>r<=a)).infixLeft(">",Zt.GreaterThan,(e,t,n)=>new Aa(">",e,n,(r,a)=>r>a)).infixLeft(">=",Zt.GreaterThanOrEquals,(e,t,n)=>new Aa(">=",e,n,(r,a)=>r>=a)).infixLeft("&",Zt.Ampersand,(e,t,n)=>new nU(e,n)).infixLeft("and",Zt.And,(e,t,n)=>new cU(e,n)).infixLeft("as",Zt.As,(e,t,n)=>new zh(e,n)).infixLeft("contains",Zt.Contains,(e,t,n)=>new rU(e,n)).infixLeft("div",Zt.Divide,(e,t,n)=>new Aa("div",e,n,(r,a)=>r/a|0)).infixLeft("in",Zt.In,(e,t,n)=>new aU(e,n)).infixLeft("is",Zt.Is,(e,t,n)=>new K0(e,n)).infixLeft("mod",Zt.Modulo,(e,t,n)=>new Aa("mod",e,n,(r,a)=>r%a)).infixLeft("or",Zt.Or,(e,t,n)=>new uU(e,n)).infixLeft("xor",Zt.Xor,(e,t,n)=>new dU(e,n)).infixLeft("implies",Zt.Implies,(e,t,n)=>new fU(e,n))}const CU=jU();function J0(e){return new SA(e,CU.construct(yU(e)).consumeAndParse())}function Nc(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const a=n[r];typeof a=="object"&&"type"in a&&"value"in a||(n[r]=ha(n[r]))}return zs(e,n).map(r=>r.value)}function zs(e,t,n={},r=void 0){let a;if(typeof e=="string"){const o=r==null?void 0:r.get(e);a=o??J0(e),r&&!o&&r.set(e,a)}else a=e;return a.eval({variables:n},t).map(o=>{var c;return{type:o.type,value:(c=o.value)==null?void 0:c.valueOf()}})}const Jn={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Oc(e,t){var r,a;let n=(a=(r=li.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:a[t.code];return n||(n=TU(e,t)),n}function EU(e,t,n){let r=li.types[e];r||(r={},li.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function TU(e,t){const n=t.code,r=_U(e,t.expression),a={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const u=xh(c),f=O$(()=>u.join("."));u.length===1&&u[0]instanceof Nr?a.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?a.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(a.array=!0,a.propertyTypes.add("code")):wA(a,u,e,1),f().endsWith("extension.valueDateTime")&&(a.array=!1)}const o={type:AU(t,a.propertyTypes),elementDefinitions:a.elementDefinitions,parsedExpression:kU(e,t.expression),array:a.array};return EU(e,n,o),o}function wA(e,t,n,r){const a=t[r];if(a instanceof zh){e.propertyTypes.add(a.right.toString());return}if(a instanceof X0){RU(e,a);return}const o=a.toString(),c=Zs(n,o);if(!c)throw new Error(`Element definition not found for ${n} ${o}`);let u=!1,f=r+1;f<t.length&&t[f]instanceof Z0&&(u=!0,f++);const p=t[f];if(c.isArray&&!u&&(e.array=!0),f===t.length-1&&p instanceof zh){e.elementDefinitions.push(c),e.propertyTypes.add(p.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type)e.propertyTypes.add(m.code);return}for(const m of c.type){let g=m.code;DU(g)&&(g=c.type[0].code),wA(e,t,g,f)}}function RU(e,t){if(t.name==="as"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="ofType"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="resolve"){e.propertyTypes.add("string");return}if(t.name==="where"&&t.args[0]instanceof K0){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function DU(e){return e==="Element"||e==="BackboneElement"}function AU(e,t){switch(e.type){case"date":return t.size===1&&t.has(oe.date)?Jn.DATE:Jn.DATETIME;case"number":return Jn.NUMBER;case"quantity":return Jn.QUANTITY;case"reference":return t.has(oe.canonical)?Jn.CANONICAL:Jn.REFERENCE;case"token":return t.size===1&&t.has(oe.boolean)?Jn.BOOLEAN:Jn.TEXT;default:return Jn.TEXT}}function _U(e,t){const n=[],r=J0(t);return $h(e,r.child,n),n}function kU(e,t){const n=[],r=J0(t);if($h(e,r.child,n),n.length===0)return r;let a=n[0];for(let o=1;o<n.length;o++)a=new Y0(a,n[o]);return new SA("<original-not-available>",a)}function $h(e,t,n){t instanceof Y0?($h(e,t.left,n),$h(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function xh(e){if(e instanceof zh||e instanceof Z0)return[xh(e.left),e].flat();if(e instanceof Nr)return[e];if(e instanceof W0)return[xh(e.left),xh(e.right)].flat();if(e instanceof X0){if(e.name==="where"&&!(e.args[0]instanceof K0))return[];if(e.name==="last")return[]}return[e]}const Hp=20,de={EQUALS:"eq",NOT_EQUALS:"ne",GREATER_THAN:"gt",LESS_THAN:"lt",GREATER_THAN_OR_EQUALS:"ge",LESS_THAN_OR_EQUALS:"le",STARTS_AFTER:"sa",ENDS_BEFORE:"eb",APPROXIMATELY:"ap",CONTAINS:"contains",STARTS_WITH:"sw",EXACT:"exact",TEXT:"text",NOT:"not",ABOVE:"above",BELOW:"below",IN:"in",NOT_IN:"not-in",OF_TYPE:"of-type",MISSING:"missing",PRESENT:"present",IDENTIFIER:"identifier",ITERATE:"iterate"},jA={contains:de.CONTAINS,exact:de.EXACT,above:de.ABOVE,below:de.BELOW,text:de.TEXT,not:de.NOT,in:de.IN,"not-in":de.NOT_IN,"of-type":de.OF_TYPE,missing:de.MISSING,identifier:de.IDENTIFIER,iterate:de.ITERATE},eb={eq:de.EQUALS,ne:de.NOT_EQUALS,lt:de.LESS_THAN,le:de.LESS_THAN_OR_EQUALS,gt:de.GREATER_THAN,ge:de.GREATER_THAN_OR_EQUALS,sa:de.STARTS_AFTER,eb:de.ENDS_BEFORE,ap:de.APPROXIMATELY,sw:de.STARTS_WITH};function CA(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,u]=e.split("?");n=c,r=new URLSearchParams(u)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let a;n.includes("/")?a=n.split("/").filter(Boolean).pop():a=n;const o=[];return r&&o.push(...r.entries()),PU(a,o)}function PU(e,t){const n={resourceType:e};for(const[r,a]of t)NU(n,r,a);return n}function NU(e,t,n){var c,u;let r,a;const o=t.indexOf(":");if(o>=0?(r=t.substring(0,o),a=t.substring(o+1)):(r=t,a=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Ou(e.filters,{code:t,operator:de.EQUALS,value:n});return}switch(r){case"_sort":OU(e,n);break;case"_cursor":e.cursor=n;break;case"_count":e.count=parseInt(n,10);break;case"_offset":e.offset=parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const f=oE(n);a==="iterate"&&(f.modifier=de.ITERATE),e.include=Ou(e.include,f);break}case"_revinclude":{const f=oE(n);a==="iterate"&&(f.modifier=de.ITERATE),e.revInclude=Ou(e.revInclude,f);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const f=(u=(c=li.types[e.resourceType])==null?void 0:c.searchParams)==null?void 0:u[r];f?e.filters=Ou(e.filters,IU(f,a,n)):e.filters=Ou(e.filters,LU(r,a,n))}}}}function OU(e,t){for(const n of t.split(",")){let r,a=!1;n.startsWith("-")?(r=n.substring(1),a=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:a})}}const MU=[de.MISSING,de.PRESENT];function IU(e,t,n){if(MU.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:a}=zU(n);if(!sE(e,a))throw new dt(ai(`Invalid format for ${e.type} search parameter: ${a}`));return{code:e.code,operator:r,value:a}}case"reference":case"string":case"token":case"uri":if(!sE(e,n))throw new dt(ai(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:$U(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function LU(e,t,n){var a;let r=de.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in eb&&(n.length===2||(a=n.at(2))!=null&&a.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function zU(e){const t=e.substring(0,2),n=eb[t];return n?{operator:n,value:e.substring(2)}:{operator:de.EQUALS,value:e}}function $U(e){return jA[e]??de.EQUALS}function oE(e){const t=e.split(":");if(t.includes("*"))throw new dt(ai("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new dt(ai(`Invalid include value '${e}': must be of the form ResourceType:search-parameter`));if(t.length===2)return{resourceType:t[0],searchParam:t[1]};if(t.length===3)return{resourceType:t[0],searchParam:t[1],targetType:t[2]};throw new dt(ai(`Invalid include value '${e}'`))}function sE(e,t){switch(e.type){case"date":return Ih(t);default:return!0}}function Jl(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(UU(n))),e.sortRules&&e.sortRules.length>0&&t.push(BU(e.sortRules)),e.cursor!==void 0&&t.push("_cursor="+encodeURIComponent(e.cursor)),e.offset!==void 0&&e.offset!==0&&t.push("_offset="+e.offset),e.count!==void 0&&t.push("_count="+e.count),e.total!==void 0&&t.push("_total="+e.total),e.types&&e.types.length>0&&t.push("_type="+e.types.join(",")),e.include&&e.include.forEach(n=>t.push(lE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(lE("_revinclude",n))),t.length===0?"":(nd(t),"?"+t.join("&"))}function UU(e){const t=e.operator in jA?":"+e.operator:"",n=e.operator!==de.EQUALS&&e.operator in eb?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function BU(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function lE(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function tb(e){const t=[];let n="",r=!1;for(const a of e)r?(n+=a,r=!1):a==="\\"?r=!0:a===","?(t.push(n),n=""):n+=a;return t.push(n),t}function VU(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!FU(e,t,n))return!1}return!0}function FU(e,t,n){var a,o;const r=(o=(a=li.types[t.resourceType])==null?void 0:a.searchParams)==null?void 0:o[n.code];if(!r)return!1;if(n.operator===de.MISSING||n.operator===de.PRESENT)return HU(e,n,r);switch(r.type){case"reference":return qU(e,n,r);case"string":case"uri":return EA(e,n,r);case"token":return GU(e,n,r);case"date":return KU(e,n,r);default:return!1}}function HU(e,t,n){const a=Nc(n.expression,e).length>0;return(t.operator===de.MISSING&&t.value==="false"||t.operator===de.PRESENT&&t.value==="true")===a}function qU(e,t,n){const r=Nc(n.expression,e),a=qp(t.operator);if(t.value===""&&r.length===0)return t.operator===de.EQUALS;const o=r.map(c=>typeof c=="string"?c:c.reference);for(const c of tb(t.value)){let u=o.includes(c);if(!u&&t.code==="_compartment"&&(u=o.some(f=>f==null?void 0:f.endsWith("/"+c))),u)return!a}return a}function GU(e,t,n){return Oc(e.resourceType,n).type===Jn.BOOLEAN?QU(e,t,n):EA(e,t,n,!0)}function QU(e,t,n){const r=Nc(n.expression,e),a=t.value==="true",o=r.includes(a);return qp(t.operator)?!o:o}function EA(e,t,n,r){var p,m,g,v;const o=(v=(g=(m=(p=Oc(e.resourceType,n).elementDefinitions)==null?void 0:p[0])==null?void 0:m.type)==null?void 0:g[0])==null?void 0:v.code,c=Nc(n.expression,e),u=tb(t.value),f=qp(t.operator);for(const b of c)for(const S of u){let j;if(o===oe.Identifier?j=WU(b,t.operator,S):o===oe.CodeableConcept?j=YU(b,t.operator,S):j=Dy(b,t.operator,S,r),j)return!f}return f}function Dy(e,t,n,r){if(r&&n.includes("|")){const[o,c]=n.split("|");return Dy(e,t,o,!1)&&(!c||Dy(e,t,c,!1))}let a="";return e&&(typeof e=="string"?a=e:typeof e=="object"&&(a=JSON.stringify(e))),a.toLowerCase().includes(n.toLowerCase())}function WU(e,t,n){var r,a,o,c;if(n.includes("|")){const[u,f]=n.split("|").map(p=>p.toLowerCase());return!u&&!f?!1:u?((a=e.system)==null?void 0:a.toLowerCase())===u&&(!f||((o=e.value)==null?void 0:o.toLowerCase())===f):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===f}return((c=e.value)==null?void 0:c.toLowerCase())===n.toLowerCase()}function YU(e,t,n){var r,a,o,c;if(n.includes("|")){const[u,f]=n.split("|").map(p=>p.toLowerCase());return!u&&!f?!1:u?((a=e.coding)==null?void 0:a.some(p=>{var m,g;return((m=p.system)==null?void 0:m.toLowerCase())===u&&(!f||((g=p.code)==null?void 0:g.toLowerCase())===f)}))??!1:((r=e.coding)==null?void 0:r.some(p=>{var m;return!p.system&&((m=p.code)==null?void 0:m.toLowerCase())===f}))??!1}return((o=e.text)==null?void 0:o.toLowerCase())===n.toLowerCase()||(((c=e.coding)==null?void 0:c.some(u=>{var f;return((f=u.code)==null?void 0:f.toLowerCase())===n.toLowerCase()}))??!1)}function KU(e,t,n){const r=Nc(n.expression,e),a=tb(t.value),o=qp(t.operator);for(const c of r)for(const u of a)if(XU(c,t.operator,u))return!o;return o}function XU(e,t,n){switch(t){case de.STARTS_AFTER:case de.GREATER_THAN:return e>n;case de.GREATER_THAN_OR_EQUALS:return e>=n;case de.ENDS_BEFORE:case de.LESS_THAN:return e<n;case de.LESS_THAN_OR_EQUALS:return e<=n;case de.EQUALS:case de.NOT_EQUALS:return e===n;default:return!1}}function qp(e){return e===de.NOT_EQUALS||e===de.NOT}const ZU={resourceType:"*"},JU=["DomainConfiguration","JsonWebKey","Login"],eB=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],ec={READ:"read",VREAD:"vread",HISTORY:"history",HISTORY_INSTANCE:"history-instance"},tB=[ec.READ,ec.VREAD,ec.HISTORY,ec.HISTORY_INSTANCE];function nB(e,t){if(JU.includes(t))return!1;if(e.resource){for(const n of e.resource)if(RA(n.resourceType,t)&&!n.readonly)return!0}return!1}function TA(e,t,n){if(!n)return ZU;if(n.resource){for(const r of n.resource)if(rB(e,t,r))return r}}function rB(e,t,n){var a,o;const r=e.resourceType;return!(!RA(n.resourceType,r)||n.readonly&&!tB.includes(t)||n.compartment&&!((o=(a=e.meta)==null?void 0:a.compartment)!=null&&o.find(c=>{var u;return c.reference===((u=n.compartment)==null?void 0:u.reference)}))||n.criteria&&!VU(e,CA(n.criteria)))}function RA(e,t){return e===t||e==="*"&&!eB.includes(t)}function aB(e){if(typeof window<"u"){const t=window.atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new window.TextDecoder().decode(n)}if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function cE(e){if(typeof window<"u"){const t=new window.TextEncoder().encode(e),n=String.fromCharCode.apply(null,t);return window.btoa(n)}if(typeof Buffer<"u")return Buffer.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function uE(){const e=new Uint32Array(28);return crypto.getRandomValues(e),_$(e.buffer)}async function iB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function DA(){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 AA(e){var a;const t={};e=Qr(e);for(const o of e.entry||[]){const c=o.resource;if(!c)continue;c.meta!==void 0&&(delete c.meta.author,delete c.meta.compartment,delete c.meta.lastUpdated,delete c.meta.project,delete c.meta.versionId,Object.keys(c.meta).length===0&&delete c.meta);const u=c==null?void 0:c.id;u&&(t[u]=DA(),o.fullUrl="urn:uuid:"+t[u],(a=o.resource)==null||delete a.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(o=>{var c;return{fullUrl:o.fullUrl,request:{method:"POST",url:(c=o.resource)==null?void 0:c.resourceType},resource:o.resource}})},(o,c)=>oB(o,c,t),2);return sB(JSON.parse(r))}function oB(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const a=n[r];if(a)return"urn:uuid:"+a}}return t}function sB(e){const t=cB(e),{sorted:n,cycles:r}=lB(t),a={};for(const c of e.entry??[])c.fullUrl&&(a[c.fullUrl]=c);const o=n.map(c=>a[c]);for(const c of r)for(const u of c){const f=a[u],p={...f,request:{...f.request,method:"PUT"}};o.push(p)}return{...e,entry:o}}const Ql={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function lB(e){const t=[],n={},r=[];for(const o of Object.keys(e))n[o]=Ql.NotVisited;function a(o,c){if(n[o]===Ql.Visited)return!0;if(n[o]===Ql.Visiting){const f=c.lastIndexOf(o);return f!==-1&&r.push(c.slice(f)),!0}n[o]=Ql.Visiting,c.push(o);let u=!1;for(const f of e[o])a(f,c)||(u=!0);return n[o]=Ql.Visited,c.pop(),t.unshift(o),!u}for(const o in e)n[o]===Ql.NotVisited&&a(o,[]);return{sorted:t,cycles:r}}function _A(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Qo(r)){const a=r.reference;a.startsWith("urn:uuid:")&&t(a)}else _A(r,t)}}function cB(e){const t={};for(const n of e.entry||[])n.fullUrl&&(t[n.fullUrl]=[]);for(const n of e.entry||[]){const r=n.fullUrl;n.resource&&_A(n.resource,a=>{t[a]&&t[a].push(r)})}return t}const dn={FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",JSON:"application/json",JSON_PATCH:"application/json-patch+json",TEXT:"text/plain",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml"};class uB{constructor(){this.listeners={}}addEventListener(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}removeEventListener(t,n){const r=this.listeners[t];if(r){for(let a=0;a<r.length;a++)if(r[a]===n){r.splice(a,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}}class Gp{constructor(){this.emitter=new uB}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,n){this.emitter.addEventListener(t,n)}removeEventListener(t,n){this.emitter.removeEventListener(t,n)}removeAllListeners(){this.emitter.removeAllListeners()}}const Ay={"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"},dB=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],nb=["DiagnosticReport-update"];function fB(e){return nb.includes(e)}function hB(e){if(nb.includes(e))throw new dt(yn(`'context.version' is required for '${e}'.`))}const pB={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},select:{resourceType:"*",reference:!0,manyAllowed:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function mB(e){return dB.includes(e)}function kA(e){return!!e.endpoint}function dE(e){if(!rb(e))throw new dt(yn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:a}=e,o={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":a.join(",")};return kA(e)&&(o.endpoint=e.endpoint),new URLSearchParams(o).toString()}function rb(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:a}=e;if(!(t&&n&&r&&a)||typeof r!="string"||typeof a!="object"||!Array.isArray(a)||a.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const o of a)if(!Ay[o])return!1;return!(kA(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function gB(e,t,n,r){if(typeof t!="object")throw new dt(yn(`context[${n}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new dt(yn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new dt(yn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const a=r.resourceType;if(a!=="*"){if(!mB(t.resourceType))throw new dt(yn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(a&&t.resourceType!==a)throw new dt(yn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${a}.`))}}function vB(e,t,n,r,a){if(a.set(t.key,(a.get(t.key)??0)+1),r.reference){if(!Qo(t.reference))throw new dt(yn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else gB(e,t.resource,n,r)}function yB(e,t){const n=new Map,r=pB[e];for(let a=0;a<t.length;a++){const o=t[a].key;if(!r[o])throw new dt(yn(`Key '${o}' not found for event '${e}'. Make sure to add only valid keys.`));vB(e,t[a],a,r[o],n)}for(const[a,o]of Object.entries(r)){if(!(o.optional||n.has(a)))throw new dt(yn(`Missing required key '${a}' on context for '${e}' event.`));if(!o.manyAllowed&&(n.get(a)??0)>1)throw new dt(yn(`${n.get(a)} context entries with key '${a}' found for the '${e}' event when schema only allows for 1.`))}}function fE(e,t,n,r){if(!(e&&typeof e=="string"))throw new dt(yn("Must provide a topic."));if(!Ay[t])throw new dt(yn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Ay).join(", ")}`));if(typeof n!="object")throw new dt(yn("context must be a context object or array of context objects."));if(nb.includes(t)&&!r)throw new dt(yn(`The '${t}' event must contain a 'context.versionId'.`));const a=Array.isArray(n)?n:[n];return yB(t,a),{timestamp:new Date().toISOString(),id:DA(),event:{"hub.topic":e,"hub.event":t,context:a,...r?{"context.versionId":r}:{}}}}class xB extends Gp{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new dt(yn("Subscription request should contain an endpoint."));if(!rb(t))throw new dt(yn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const a=JSON.parse(r.data);if(a["hub.topic"])return;const o=a;o.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:o}),n.send(JSON.stringify({id:a==null?void 0:a.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function bB(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=aB(t),r=Array.from(n).reduce((o,c)=>{const u=("00"+c.charCodeAt(0).toString(16)).slice(-2);return`${o}%${u}`},""),a=decodeURIComponent(r);return JSON.parse(a)}function SB(e){return e.split(".").length===3}function ab(e){const[t,n,r]=e.split(".");return bB(n)}function wB(e){try{return typeof ab(e).login_id=="string"}catch{return!1}}function jB(e){try{const n=ab(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class CB{constructor(t){this.medplum=t}async get(t){return this.medplum.get(`keyvalue/v1/${t}`)}async set(t,n){await this.medplum.put(`keyvalue/v1/${t}`,n,dn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var PA;PA=Symbol.toStringTag;class _a{constructor(t){this[PA]="ReadablePromise",this.status="pending",this.suspender=t.then(n=>(this.status="success",this.response=n,n),n=>{throw this.status="error",this.error=n,n})}isPending(){return this.status==="pending"}isOk(){return this.status==="success"}read(){switch(this.status){case"pending":throw this.suspender;case"error":throw this.error;default:return this.response}}then(t,n){return this.suspender.then(t,n)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}class EB{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new TB)}clear(){this.storage.clear()}getString(t){return this.storage.getItem(t)??void 0}setString(t,n){n?this.storage.setItem(t,n):this.storage.removeItem(t)}getObject(t){const n=this.getString(t);return n?JSON.parse(n):void 0}setObject(t,n){this.setString(t,n?Ia(n):void 0)}}class TB{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}/*!
79
- * Reconnecting WebSocket
80
- * by Pedro Ladaria <pedro.ladaria@gmail.com>
81
- * https://github.com/pladaria/reconnecting-websocket
82
- * License MIT
83
- *
84
- * Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
85
- * https://github.com/partykit/partykit/blob/main/packages/partysocket
86
- */const ac={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let hE=!1;function RB(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");ac.Event=globalThis.Event,ac.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},ac.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function DB(e,t){if(!e)throw new Error(t)}function ih(e){return new e.constructor(e.type,e)}const vs={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let pE=!1;class No extends Gp{constructor(t,n,r={}){hE||(RB(),hE=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._closeCalled=!1,this._messageQueue=[],this._debugLogger=console.log.bind(console),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=a=>{this._debug("open event");const{minUptime:o=vs.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),o),DB(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(c=>{var u;return(u=this._ws)==null?void 0:u.send(c)}),this._messageQueue=[],this.onopen&&this.onopen(a),this.dispatchEvent(ih(a))},this._handleMessage=a=>{this._debug("message event"),this.onmessage&&this.onmessage(a),this.dispatchEvent(ih(a))},this._handleError=a=>{this._debug("error event",a.message),this._disconnect(void 0,a.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(a),this._debug("exec error listeners"),this.dispatchEvent(ih(a)),this._connect()},this._handleClose=a=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(a),this.dispatchEvent(ih(a))},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.binaryType?this._binaryType=this._options.binaryType:this._binaryType="blob",this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return No.CONNECTING}get OPEN(){return No.OPEN}get CLOSING(){return No.CLOSING}get CLOSED(){return No.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){var n;return this._messageQueue.reduce((r,a)=>(typeof a=="string"?r+=a.length:a instanceof Blob?r+=a.size:r+=a.byteLength,r),0)+(((n=this._ws)==null?void 0:n.bufferedAmount)??0)}get extensions(){var t;return((t=this._ws)==null?void 0:t.extensions)??""}get protocol(){var t;return((t=this._ws)==null?void 0:t.protocol)??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?No.CLOSED:No.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(t=1e3,n){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)}reconnect(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=vs.maxEnqueuedMessages}=this._options;this._messageQueue.length<n&&(this._debug("enqueue",t),this._messageQueue.push(t))}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t)}_getNextDelay(){const{reconnectionDelayGrowFactor:t=vs.reconnectionDelayGrowFactor,minReconnectionDelay:n=vs.minReconnectionDelay,maxReconnectionDelay:r=vs.maxReconnectionDelay}=this._options;let a=0;return this._retryCount>0&&(a=n*Math.pow(t,this._retryCount-1),a>r&&(a=r)),this._debug("next delay",a),a}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=vs.maxRetries,connectionTimeout:n=vs.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!pE&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),pE=!0);const r=this._options.WebSocket||WebSocket;this._debug("connect",{url:this._url,protocols:this._protocols}),this._ws=this._protocols?new r(this._url,this._protocols):new r(this._url),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),n)}).catch(r=>{this._connectLock=!1,this._handleError(new ac.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new ac.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new ac.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}}const AB=5e3;class _y extends Gp{constructor(...t){super(),this.criteria=new Set(t)}getCriteria(){return this.criteria}_addCriteria(t){this.criteria.add(t)}_removeCriteria(t){this.criteria.delete(t)}}class _B{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new _y(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class kB{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof OA))throw new dt(yn("First arg of constructor should be a `MedplumClient`"));let a;try{a=new URL(n).toString()}catch{throw new dt(yn("Not a valid URL"))}const o=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(a,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new No(a,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=o,this.masterSubEmitter=new _y,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??AB,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,a,o,c,u,f;try{const p=JSON.parse(n.data);if(p.type==="pong"){this.waitingForPong=!1;return}const m=p,g=(a=(r=m==null?void 0:m.entry)==null?void 0:r[0])==null?void 0:a.resource;if(g.type==="heartbeat"){(o=this.masterSubEmitter)==null||o.dispatchEvent({type:"heartbeat",payload:m});return}if(g.type==="handshake"){const b=Is(g.subscription),S={type:"connect",payload:{subscriptionId:b}};(c=this.masterSubEmitter)==null||c.dispatchEvent(S);const j=this.criteriaEntriesBySubscriptionId.get(b);if(!j){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}j.connecting=!1,j.emitter.dispatchEvent({...S});return}(u=this.masterSubEmitter)==null||u.dispatchEvent({type:"message",payload:m});const v=this.criteriaEntriesBySubscriptionId.get(Is(g.subscription));if(!v){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}v.emitter.dispatchEvent({type:"message",payload:m})}catch(p){console.error(p);const m={type:"error",payload:p};(f=this.masterSubEmitter)==null||f.dispatchEvent(m);for(const g of this.getAllCriteriaEmitters())g.dispatchEvent({...m})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new dt(qz(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const a of this.getAllCriteriaEmitters())a.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,a;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(a=this.masterSubEmitter)==null||a.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const a of this.getAllCriteriaEmitters())a.dispatchEvent({...n});this.refreshAllSubscriptions().catch(console.error),this.pingTimer||(this.pingTimer=setInterval(()=>{if(this.waitingForPong){this.waitingForPong=!1,t.reconnect();return}t.send(JSON.stringify({type:"ping"})),this.waitingForPong=!0},this.pingIntervalMs))}),this.medplum.addEventListener("change",()=>{var r;const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&((r=this.currentProfile)==null?void 0:r.id)!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){var a;const r={type:"error",payload:n};(a=this.masterSubEmitter)==null||a.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const a={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(a),t.emitter.dispatchEvent({...a})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var c,u;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${Lt(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),a=(c=r==null?void 0:r.find(f=>f.name==="token"))==null?void 0:c.valueString,o=(u=r==null?void 0:r.find(f=>f.name==="websocket-url"))==null?void 0:u.valueUrl;if(!a)throw new dt(yn("Failed to get token"));if(!o)throw new dt(yn("Failed to get URL from $get-ws-binding-token"));return[n,a]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const a of r.criteriaWithProps)if(Uo(n,a.subscriptionProps))return a}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let a;this.criteriaEntries.has(n)?a=this.criteriaEntries.get(n):(a={criteriaWithProps:[]},this.criteriaEntries.set(n,a)),r?a.criteriaWithProps.push(t):a.bareCriteria=t}removeCriteriaEntry(t){var u;const{criteria:n,subscriptionProps:r,subscriptionId:a,token:o}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(f=>{const p=f.subscriptionProps;return!Uo(r,p)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(u=this.masterSubEmitter)==null||u._removeCriteria(n)),a&&this.criteriaEntriesBySubscriptionId.delete(a),o&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:o}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Ke(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const a=new _B(t,n);return this.addCriteriaEntry(a),this.subscribeToCriteria(a).catch(console.error),a.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}getWebSocket(){return this.ws}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}reconnectWebSocket(){this.ws.reconnect(),this.wsClosed=!1}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new _y(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const NA="4.1.5-5edfca7f7",PB=dn.FHIR_JSON+", */*; q=0.1",NB="https://api.medplum.com/",OB=1e3,MB=6e4,IB=0,LB=3e5,zB="Binary/",mE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},Wl={ClientCredentials:"client_credentials",AuthorizationCode:"authorization_code",RefreshToken:"refresh_token",JwtBearer:"urn:ietf:params:oauth:grant-type:jwt-bearer",TokenExchange:"urn:ietf:params:oauth:grant-type:token-exchange"},$B={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},UB={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class OA extends Gp{constructor(t){if(super(),this.initComplete=!0,t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??BB(),this.storage=(t==null?void 0:t.storage)??new EB,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=G0((t==null?void 0:t.baseUrl)??NB),this.fhirBaseUrl=Xa(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Xa(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Xa(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Xa(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=Xa(this.baseUrl,(t==null?void 0:t.fhircastHubUrl)??"fhircast/STU3"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.credentialsInHeader=(t==null?void 0:t.authCredentialsMethod)==="header",this.defaultHeaders=(t==null?void 0:t.defaultHeaders)??{},this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.refreshGracePeriod=(t==null?void 0:t.refreshGracePeriod)??LB,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?IB:MB),this.cacheTime>0?this.requestCache=new QD((t==null?void 0:t.resourceCacheSize)??OB):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initPromise=Promise.resolve(),this.dispatchEvent({type:"storageInitialized"})):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0,this.dispatchEvent({type:"storageInitialized"})}).catch(n=>{console.error(n),this.initComplete=!0,this.dispatchEvent({type:"storageInitFailed",payload:{error:n}})})),this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}getFhircastHubUrl(){return this.fhircastHubUrl}getDefaultHeaders(){return this.defaultHeaders}clear(){this.storage.clear(),typeof window<"u"&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.refreshPromise=void 0,this.accessTokenExpires=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){var n;t=t.toString(),(n=this.requestCache)==null||n.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const n=Xa(this.fhirBaseUrl,t);if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let a;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?a=new Promise((c,u)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:u}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):a=this.request("GET",t,n);const o=new _a(a);return this.setCacheEntry(t,o),o}post(t,n,r,a={}){return t=t.toString(),this.setRequestBody(a,n),r&&this.setRequestContentType(a,r),this.invalidateUrl(t),this.request("POST",t,a)}put(t,n,r,a={}){return t=t.toString(),this.setRequestBody(a,n),r&&this.setRequestContentType(a,r),this.invalidateUrl(t),this.request("PUT",t,a)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,dn.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:a}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:a},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(window.location.search).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,a,o=!0){let c=a;o&&(c=await this.ensureCodeChallenge(a)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,c,o))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:Wl.TokenExchange,subject_token_type:$B.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,a,o=!0){const c=new URL(t);if(c.searchParams.set("response_type","code"),c.searchParams.set("client_id",n),c.searchParams.set("redirect_uri",r),c.searchParams.set("scope",a.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(a)),o){const{codeChallenge:u,codeChallengeMethod:f}=a;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!u)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",u)}return c.toString()}fhirUrl(...t){return new URL(Xa(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=L$(n)),r}search(t,n,r){const a=this.fhirSearchUrl(t,n),o="search-"+a.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=this.getBundle(a,r);return this.setCacheEntry(o,u),u}searchOne(t,n,r){const a=this.fhirSearchUrl(t,n);a.searchParams.set("_count","1"),a.searchParams.sort();const o="searchOne-"+a.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new _a(this.search(t,a.searchParams,r).then(f=>{var p,m;return(m=(p=f.entry)==null?void 0:p[0])==null?void 0:m.resource}));return this.setCacheEntry(o,u),u}searchResources(t,n,r){const o="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new _a(this.search(t,n,r).then(yE));return this.setCacheEntry(o,u),u}async*searchResourcePages(t,n,r){var o,c;let a=this.fhirSearchUrl(t,n);for(;a;){const u=new URL(a).searchParams,f=await this.search(t,u,r),p=(o=f.link)==null?void 0:o.find(m=>m.relation==="next");if(!((c=f.entry)!=null&&c.length)&&!p)break;yield yE(f),a=p!=null&&p.url?new URL(p.url):void 0}}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){var a,o;const r=(o=(a=this.requestCache)==null?void 0:a.get(this.fhirUrl(t,n).toString()))==null?void 0:o.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return mE;const[r,a]=n.split("/");if(!(!r||!a))return this.getCached(r,a)}readResource(t,n,r){if(!n)throw new Error('The "id" parameter cannot be null, undefined, or an empty string.');return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new _a(Promise.reject(new Error("Missing reference")));if(r==="system")return new _a(Promise.resolve(mE));const[a,o]=r.split("/");return!a||!o?new _a(Promise.reject(new Error("Invalid reference"))):this.readResource(a,o,n)}requestSchema(t){if(tA(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const a=new _a((async()=>{const o=`{
87
- StructureDefinitionList(name: "${t}") {
88
- resourceType,
89
- name,
90
- kind,
91
- description,
92
- type,
93
- url,
94
- snapshot {
95
- element {
96
- id,
97
- path,
98
- definition,
99
- min,
100
- max,
101
- base {
102
- path,
103
- min,
104
- max
105
- },
106
- contentReference,
107
- type {
108
- code,
109
- profile,
110
- targetProfile
111
- },
112
- binding {
113
- strength,
114
- valueSet
115
- }
116
- }
117
- }
118
- }
119
- SearchParameterList(base: "${t}", _count: 100) {
120
- base,
121
- code,
122
- type,
123
- expression,
124
- target
125
- }
126
- }`.replace(/\s+/g," "),c=await this.graphql(o);KC(c.data.StructureDefinitionList.filter(u=>u.name===t));for(const u of c.data.SearchParameterList)W$(u)})());return this.setCacheEntry(n,a),a}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&B0(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),a=this.getCacheEntry(r,void 0);if(a)return a.value;const o=new _a((async()=>{if(n!=null&&n.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const u=await this.post(c.toString(),{});KC(u)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}eA(c)}})());return this.setCacheEntry(r,o),o}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,a){return this.get(this.fhirUrl(t,n,"_history",r),a)}readPatientEverything(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$everything"),n)}readPatientSummary(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$summary"),n)}createResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,n)}async createResourceIfNoneExist(t,n,r){const a=this.fhirUrl(t.resourceType);r?r.headers?Array.isArray(r.headers)?r.headers.push(["If-None-Exist",n]):r.headers instanceof Headers?r.headers.set("If-None-Exist",n):r.headers["If-None-Exist"]=n:r.headers={"If-None-Exist":n}:r={headers:{"If-None-Exist":n}};const o=await this.post(a,t,void 0,r);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async upsertResource(t,n,r){const a=this.fhirSearchUrl(t.resourceType,n);let o=await this.put(a,t,void 0,r);return o||(o=t),this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async createAttachment(t,n,r,a,o){let c=xE(t,n,r,a);if(c.contentType===dn.XML){const p=c.data;let m;p instanceof Blob?m=await new Promise((g,v)=>{const b=new FileReader;b.onload=()=>{if(!b.result){v(new Error("Failed to load file"));return}g(b.result)},b.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?m=new TextDecoder().decode(p):m=p,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:dn.CDA_XML})}const u=o??(typeof n=="object"?n:{}),f=await this.createBinary(c,u);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,a,o){const c=xE(t,n,r,a),u=o??(typeof n=="object"?n:{}),{data:f,contentType:p,filename:m,securityContext:g,onProgress:v}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g!=null&&g.reference&&this.setRequestHeader(u,"X-Security-Context",g.reference),v?this.uploadwithProgress(b,f,p,v,u):this.post(b,f,p,u)}uploadwithProgress(t,n,r,a,o){return new Promise((c,u)=>{var g;const f=new XMLHttpRequest,p=()=>f.abort();(g=o==null?void 0:o.signal)==null||g.addEventListener("abort",p);const m=v=>{var b;(b=o==null?void 0:o.signal)==null||b.removeEventListener("abort",p),v instanceof Error?u(v):c(v)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),a&&(f.upload.onprogress=v=>a(v),f.upload.onload=v=>a(v)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new dt(Jt(f.response||f.statusText)))},f.open("POST",t),f.withCredentials=!0,f.setRequestHeader("Authorization","Bearer "+this.accessToken),f.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),f.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&f.setRequestHeader("X-Medplum","extended"),o!=null&&o.headers){const v=o.headers;for(const[b,S]of Object.entries(v))f.setRequestHeader(b,S)}f.send(n)})}async createPdf(t,n,r,a){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const o=HB(t,n,r,a),c=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:f,fonts:p,...m}=o,g=await this.createPdfImpl(u,f,p),v={...m,data:g,contentType:"application/pdf"};return this.createBinary(v,c)}createComment(t,n,r){const a=this.getProfile();let o,c;return t.resourceType==="Encounter"&&(o=fn(t),c=t.subject),t.resourceType==="ServiceRequest"&&(o=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=fn(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[fn(t)],encounter:o,subject:c,sender:a?fn(a):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,a){const o=await this.patch(this.fhirUrl(t,n),r,a);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),o}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,a){let o;if(typeof t=="string"){const c=t;o=this.fhirUrl("Bot",c,"$execute")}else{const c=t;o=this.fhirUrl("Bot","$execute"),o.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(o,n,r,a)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,dn.JSON,n)}graphql(t,n,r,a){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},dn.JSON,a)}readResourceGraph(t,n,r,a){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,a)}pushToAgent(t,n,r,a,o,c){return this.post(this.fhirUrl("Agent",Is(t),"$push"),{destination:typeof n=="string"?n:Lt(n),body:r,contentType:a,waitForResponse:o},dn.FHIR_JSON,c)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||Lt(this.sessionDetails.profile)!==((r=t.profile)==null?void 0:r.reference))&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}isAuthenticated(t){return this.accessTokenExpires!==void 0&&Date.now()<this.accessTokenExpires-(t??this.refreshGracePeriod)}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=jB(t),this.medplumServer=wB(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var a,o;return((a=r.profile)==null?void 0:a.reference)!==((o=t.profile)==null?void 0:o.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{var o,c;this.profilePromise=void 0;const a=((c=(o=this.sessionDetails)==null?void 0:o.profile)==null?void 0:c.id)!==r.profile.id;this.sessionDetails=r,a&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){var t;return!this.isInitialized||!!this.profilePromise&&!((t=this.sessionDetails)!=null&&t.profile)}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(zB)&&(t=this.fhirUrl(r));let a=n.headers;return a||(a={},n.headers=a),a.Accept||(a.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...a}=t,o=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});a.securityContext||(a.securityContext=fn(o));const c=await this.createAttachment(a,n);return this.updateResource({...o,status:"completed",content:c})}async uploadMedia(t,n,r,a,o){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:a},o)}async bulkExport(t="",n,r,a){const o=t&&`${t}/`,c=this.fhirUrl(`${o}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),a)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;return r.Prefer="respond-async",this.request("POST",t,n)}get keyValue(){return this.keyValueClient||(this.keyValueClient=new CB(this)),this.keyValueClient}getBundle(t,n){return new _a((async()=>{const r=await this.get(t,n);if(r.entry)for(const a of r.entry)this.cacheResource(a.resource);return r})())}getCacheEntry(t,n){if(!this.requestCache||(n==null?void 0:n.cache)==="no-cache"||(n==null?void 0:n.cache)==="reload")return;const r=this.requestCache.get(t);if(!(!r||r.requestTime+this.cacheTime<Date.now()))return r}setCacheEntry(t,n){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t){var n,r;t!=null&&t.id&&!((r=(n=t.meta)==null?void 0:n.tag)!=null&&r.some(a=>a.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new _a(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},a={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const o=await this.fetchWithRetry(n,r);if(o.status===401)return this.handleUnauthenticated(t,n,r);if(o.status===204||o.status===304)return;const c=o.headers.get("content-type"),u=c==null?void 0:c.includes("json");if(o.status===404&&!u)throw new dt(Fz);const f=await this.parseBody(o,u);if(o.status===200&&r.followRedirectOnOk||o.status===201&&r.followRedirectOnCreated){const p=await vE(o,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(o.status===202&&r.pollStatusOnAccepted){const m=await vE(o,f)??a.statusUrl;if(m)return this.pollStatus(m,r,a)}if(o.status>=400)throw new dt(Jt(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(a){throw console.error("Error parsing response",t.status,a),a}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Xa(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2,a=200;for(let o=0;o<=r;o++){try{this.options.verbose&&this.logRequest(t,n);const c=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(c),c.status<500||o===r)return c}catch(c){if(c.message==="Failed to fetch"&&o===0&&this.dispatchEvent({type:"offline"}),c.name==="AbortError"||o===r)throw c}await aE(a)}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const a of nd(Object.keys(r)))console.log(`> ${a}: ${r[a]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}async pollStatus(t,n,r){const a={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(a.headers={...n.headers},delete a.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const o=n.pollStatusPeriod??1e3;await aE(o),r.pollCount++}return this.request("GET",t,a,r)}async executeAutoBatch(){var a,o;if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const c=t[0];try{c.resolve(await this.request(c.method,Xa(this.fhirBaseUrl,c.url),c.options))}catch(u){c.reject(new dt(Jt(u)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(c=>({request:{method:c.method,url:c.url},resource:c.options.body?JSON.parse(c.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let c=0;c<t.length;c++){const u=t[c],f=(a=r.entry)==null?void 0:a[c];(o=f==null?void 0:f.response)!=null&&o.outcome&&!KD(f.response.outcome)?u.reject(new dt(f.response.outcome)):u.resolve(f==null?void 0:f.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",PB,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",dn.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,a=!1){t.headers||(t.headers={});const o=t.headers;a&&o[n]||(o[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||(n==null?void 0:n.constructor.name)==="Blob")||typeof File<"u"&&(n instanceof File||(n==null?void 0:n.constructor.name)==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||(n==null?void 0:n.constructor.name)==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new dt(td)))}async startPkce(){const t=uE();sessionStorage.setItem("pkceState",t);const n=uE().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await iB(n),a=k$(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",a),{codeChallengeMethod:"S256",codeChallenge:a}}async requestAuthorization(t){const n=await this.ensureCodeChallenge(t??{}),r=new URL(this.authorizeUrl);r.searchParams.set("response_type","code"),r.searchParams.set("state",sessionStorage.getItem("pkceState")),r.searchParams.set("client_id",n.clientId??this.clientId),r.searchParams.set("redirect_uri",n.redirectUri??gE()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),window.location.assign(r.toString())}processCode(t,n){const r={grant_type:Wl.AuthorizationCode,code:t,client_id:(n==null?void 0:n.clientId)??this.clientId??"",redirect_uri:(n==null?void 0:n.redirectUri)??gE()};if(typeof sessionStorage<"u"){const a=sessionStorage.getItem("codeVerifier");a&&(r.code_verifier=a)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken)return this.refreshPromise=this.fetchTokens({grant_type:Wl.RefreshToken,client_id:this.clientId??"",refresh_token:this.refreshToken}),this.refreshPromise;if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){return this.clientId=t,this.clientSecret=n,this.fetchTokens({grant_type:Wl.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:Wl.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:Wl.ClientCredentials,client_assertion_type:UB.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=cE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new dt(yn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new dt(yn("Invalid events provided. Events must be an array of event names containing at least one event."));const r={channelType:"websocket",mode:"subscribe",topic:t,events:n},o=(await this.post(this.fhircastHubUrl,dE(r),dn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!o)throw new Error("Invalid response!");return r.endpoint=o,r}async fhircastUnsubscribe(t){if(!rb(t))throw new dt(yn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new dt(yn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,dE(t),dn.FORM_URL_ENCODED)}fhircastConnect(t){return new xB(t)}async fhircastPublish(t,n,r,a){return fB(n)?this.post(this.fhircastHubUrl,fE(t,n,r,a),dn.JSON):(hB(n),this.post(this.fhircastHubUrl,fE(t,n,r),dn.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`,{cache:"no-cache"})}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":dn.FORM_URL_ENCODED};this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`),this.credentialsInHeader&&(n.delete("client_id"),n.delete("client_secret"),!this.basicAuth&&t.client_id&&t.client_secret&&(r.Authorization=`Basic ${cE(t.client_id+":"+t.client_secret)}`));const a={method:"POST",headers:r,body:n.toString(),credentials:"include"};let o;try{o=await this.fetchWithRetry(this.tokenUrl,a)}catch(u){throw this.refreshPromise=void 0,u}if(!o.ok){this.clearActiveLogin();try{const u=await o.json();throw new dt(ai(u.error_description))}catch(u){throw new dt(ai("Failed to fetch tokens"),u)}}const c=await o.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(SB(n)){const r=ab(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new dt(Hz);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new dt(WC)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new dt(WC)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){var n,r;return this.sessionDetails&&t?((r=(n=t.profile)==null?void 0:n.reference)==null?void 0:r.endsWith(this.sessionDetails.profile.id))??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)window.location.reload();else if(t.key==="activeLogin"){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;(n==null?void 0:n.profile.reference)!==(r==null?void 0:r.profile.reference)||!this.checkSessionDetailsMatchLogin(r)?window.location.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new kB(this,I$(this.baseUrl,"/ws/subscriptions-r4"))),this.subscriptionManager}subscribeToCriteria(t,n){return this.getSubscriptionManager().addCriteria(t,n)}unsubscribeFromCriteria(t,n){this.subscriptionManager&&(this.subscriptionManager.removeCriteria(t,n),this.subscriptionManager.getCriteriaCount()===0&&this.subscriptionManager.closeWebSocket())}getMasterSubscriptionEmitter(){return this.getSubscriptionManager().getMasterEmitter()}}function BB(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function gE(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function vE(e,t){var a,o;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Up(t)&&((o=(a=t.issue)==null?void 0:a[0])!=null&&o.diagnostics))return t.issue[0].diagnostics}function yE(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function VB(e){return sr(e)&&"data"in e&&"contentType"in e}function xE(e,t,n,r){return VB(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function FB(e){return sr(e)&&"docDefinition"in e}function HB(e,t,n,r){return FB(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function gc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:a,accessPolicyResource:o}){if(t===(e==null?void 0:e.path))return;a??(a=(e==null?void 0:e.debugMode)??!1),o??(o=e==null?void 0:e.accessPolicyResource);let c=qB(t,n,e,!!a);const u=Ry(t,".",2)[1];c=GB(c,o,u),c=QB(c,o,u);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const m=Object.create(null);p=g=>{const v=Ry(g,".",2)[1];if(v){if(!m[v]){const b=Uh(v,o==null?void 0:o.hiddenFields);m[v]={hidden:b,readonly:b||Uh(v,o==null?void 0:o.readonlyFields)}}return m[v]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:a,getExtendedProps:p,accessPolicyResource:o}}function qB(e,t,n,r){const a=Object.create(null);if(n)for(const[c,u]of Object.entries(n.elementsByPath)){const f=Ds(e,c);f!==void 0&&(a[f]=u)}let o=!1;if(t)for(const[c,u]of Object.entries(t))c in a||(a[c]=u,o=!0);return r&&console.assert(o,"Unnecessary ElementsContext; not using any newly provided elements"),a}function GB(e,t,n){var a;if(!((a=t==null?void 0:t.hiddenFields)!=null&&a.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!Uh(r+o,t.hiddenFields)))}function QB(e,t,n){var o;if(!((o=t==null?void 0:t.readonlyFields)!=null&&o.length))return e;const r=Object.create(null),a=n?n+".":"";for(const[c,u]of Object.entries(e))Uh(a+c,t.readonlyFields)?r[c]={...u,readonly:!0}:r[c]=u;return r}function Uh(e,t){if(!(t!=null&&t.length))return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const a=n.slice(0,r).join(".");if(t.includes(a))return!0}return!1}function MA(e){return e.type!==void 0&&e.type.length>0}function WB(e,t,n,r){var o;const a=o$(e,t.path,{profileUrl:r});if(a){const c=((o=n.typeSchema)==null?void 0:o.elements)??n.elements;return a.some(u=>c$(u,t,n,c))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function IA(e,t,n,r){var a,o;if(e)for(const c of t){const u={value:e,type:((a=c.typeSchema)==null?void 0:a.type)??((o=c.type)==null?void 0:o[0].code)};if(n.every(f=>{var p;return WB(u,f,c,((p=c.typeSchema)==null?void 0:p.url)??r)}))return c.name}}class YB{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const a=gc({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(a===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[a],this.visitor=n}get elementsContext(){return this.elementsContextStack[this.elementsContextStack.length-1]}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const a=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([o])=>o.startsWith(n)));this.crawlElementsImpl(a,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const a=this.prepareSlices(r.slices,r);if(!En(a.slices))throw new Error(`cannot crawl slice ${n.name} since it has no type information`);this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.sliceAllowList=[n],this.crawlSliceImpl(a.slices[0],n.path,a),this.sliceAllowList=void 0,this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlResource(){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.crawlElementsImpl(this.rootSchema.elements,this.rootSchema.type),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlElementsImpl(t,n){const r=KB(t);for(const a of r)this.crawlElementNode(a,n)}crawlElementNode(t,n){var a,o;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const c of t.children)this.crawlElementNode(c,n);En((o=(a=t.element)==null?void 0:a.slicing)==null?void 0:o.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var o,c;const r=[];for(const u of t){if(!MA(u))continue;const f=(c=(o=u.type.find(p=>En(p.profile)))==null?void 0:o.profile)==null?void 0:c[0];if(En(f)){const p=kc(f);p&&(u.typeSchema=p)}r.push(u)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const a of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(a))&&this.crawlSliceImpl(a,n,r)}crawlSliceImpl(t,n,r){const a=t.typeSchema;a&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(a),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let o;const c=(a==null?void 0:a.elements)??t.elements;En(c)&&(o=gc({path:n,parentContext:this.elementsContext,elements:c})),o&&this.elementsContextStack.push(o),this.crawlElementsImpl(c,n),o&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),a&&this.visitor.onExitSchema&&this.visitor.onExitSchema(a)}}function KB(e){const t=[];function n(o,c){return c.startsWith(o+".")}function r(o,c){for(const u of o.children)if(n(u.key,c.key)){r(u,c);return}o.children.push(c)}const a=Object.entries(e);a.sort((o,c)=>o[0].localeCompare(c[0]));for(const[o,c]of a){const u={key:o,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,o)){r(p,u),f=!0;break}f||t.push(u)}return t}const zv="__sliceName";function XB(e,t){const n=new ZB(e,e.resourceType,"resource");return new YB(t,n).crawlResource(),n.getDefaultValue()}function bE(e,t,n){for(const[r,a]of Object.entries(t)){if(n===void 0||n===r){Bh(e,r,a,t);continue}const o=Ds(n,r);o!==void 0&&Bh(e,o,a,t)}return e}class ZB{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Qr(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const a=this.value.values,o=this.value.path,c=Ds(o,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${o}`);const u=[];for(const f of a){if(f===void 0)continue;const p=Ds(r.path,o),m=Array.isArray(f)?f:[f];for(const g of m){JB(g,c,n,r.elements,p),Bh(g,c,n,r.elements);const v=Py(g,c,r.elements,p);v!==void 0&&u.push(v)}}this.valueStack.push({type:"element",path:t,values:u})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const o=Ds(this.value.path,t);if(o===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=Ds(r.path,this.value.path);for(const u of this.value.values){const f=Py(u,o,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];En(m)||f.splice(p,1)}Tn(f)&&ky(u,void 0,o,n)}}onEnterSlice(t,n,r){const a=this.value.values,o=[];for(const c of a)if(c!==void 0){const u=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(u,n,r);o.push(f)}this.valueStack.push({type:"slice",path:t,values:o})}getMatchingSliceValues(t,n,r){const a=[];for(const o of t)(o[zv]??IA(o,[n],r.discriminator,this.schema.url))===n.name&&a.push(o);for(let o=a.length;o<n.min;o++)if(q0(n.type[0].code)){const c=Object.create(null);a.push(c),t.push(c)}return a}onExitSlice(){const t=this.valueStack.pop();if(!t)throw new Error("Expected value context to exist in onExitSlice");for(const n of t.values)for(let r=n.length-1;r>=0;r--){const a=n[r];zv in a&&delete a[zv]}}getDefaultValue(){return this.rootValue}}function JB(e,t,n,r,a){const o=Py(e,t,r,a);n.min>0&&o===void 0&&q0(n.type[0].code)&&(n.isArray?ky(e,[Object.create(null)],t,n):ky(e,Object.create(null),t,n))}function ky(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let a=n;if(n.includes("[x]")){const o=r.type[0].code;a=n.replace("[x]",Fn(o))}t===void 0?delete e[a]:e[a]=t}function Py(e,t,n,r){const a=t.split(".");let o=e,c;for(let u=0;u<a.length;u++){let f=a[u];if(f.includes("[x]")){const p=(r?r+".":"")+a.slice(0,u+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",Fn(g))}if(u===a.length-1){Array.isArray(o)?c=o.map(p=>p[f]):c=o[f];continue}if(Array.isArray(o))o=o.map(p=>p[f]);else if(sr(o)){if(o[f]===void 0)return;o=o[f]}else return}return c}function Bh(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>Bh(u,t,n,r));e==null&&(e=Object.create(null));const a=e,o=t.split(".");let c=a;for(let u=0;u<o.length;u++){let f=o[u];if(f.includes("[x]")){const m=r[o.slice(0,u+1).join(".")].type[0].code;f=f.replace("[x]",Fn(m))}if(u===o.length-1){const p=Array.isArray(c)?c:[c];for(const m of p)n.fixed?m[f]??(m[f]=n.fixed.value):n.pattern&&(m[f]=LA(m[f],n.pattern.value))}else{if(!(f in c)){const p=o.slice(0,u+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return a}function LA(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Qr(t);if(sr(t)&&(sr(e)&&!Array.isArray(e)||e===void 0)){const n=Qr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=LA(n[r],t[r]);return n}return e}const eV="https://meta.medplum.com/releases",$v=new Map;function tV(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!(n!=null&&n.length))throw new Error("Manifest missing assets list");for(const r of n){if(!r.browser_download_url)throw new Error("Asset missing browser download URL");if(!r.name)throw new Error("Asset missing name")}}async function nV(e,t,n){let r=$v.get("latest");if(!r){const a="latest",o=new URL(`${eV}/${a}.json`);o.searchParams.set("a",e),o.searchParams.set("c",NA);const c=await fetch(o.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(p){console.error(`Failed to parse message from body: ${Ke(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const u=await c.json();tV(u),r=u,$v.set("latest",r),$v.set(r.tag_name.slice(1),r)}return r}async function rV(e){const t=await nV(e);if(!t.tag_name.startsWith("v"))throw new Error(`Invalid release name found. Release tag '${t.tag_name}' did not start with 'v'`);return t.tag_name.slice(1)}const zA=y.createContext(void 0);function Qp(){return y.useContext(zA)}function De(){return Qp().medplum}function Wp(){return Qp().navigate}function Yp(){return Qp().profile}const SE=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function aV(e){const t=e.medplum,n=e.navigate??iV,[r,a]=y.useState({profile:t.getProfile(),loading:t.isLoading()});y.useEffect(()=>{function c(){a(u=>({...u,profile:t.getProfile(),loading:t.isLoading()}))}for(const u of SE)t.addEventListener(u,c);return()=>{for(const u of SE)t.removeEventListener(u,c)}},[t]);const o=y.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(zA.Provider,{value:o,children:e.children})}function iV(e){window.location.assign(e)}const wE=new Map,$A=e=>y.useMemo(()=>{if(!e)return;const t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;const r=n.get("Expires");if(!r||r.length>13)return e;const a=wE.get(t);if(a){const c=new URLSearchParams(new URL(a).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return a}return wE.set(t,e),e},[e]);function oV(e){const t=y.useRef(void 0);return y.useEffect(()=>{t.current=e}),t.current}function Yt(e,t){const n=De(),[r,a]=y.useState(()=>jE(n,e)),o=y.useCallback(c=>{Uo(c,r)||a(c)},[r]);return y.useEffect(()=>{let c=!0;const u=jE(n,e);return!u&&Qo(e)?n.readReference(e).then(f=>{c&&o(f)}).catch(f=>{c&&(o(void 0),t&&t(Jt(f)))}):o(u),()=>c=!1},[n,e,o,t]),r}function jE(e,t){if(t){if(fi(t))return t;if(Qo(t))return e.getCachedReference(t)}}function sV(e,t,n={leading:!1}){const[r,a]=y.useState(e),o=y.useRef(!1),c=y.useRef(void 0),u=y.useRef(!1),f=y.useCallback(()=>window.clearTimeout(c.current),[]);return y.useEffect(()=>{o.current&&(!u.current&&n.leading?(u.current=!0,a(e)):(f(),c.current=setTimeout(()=>{u.current=!1,a(e)},t)))},[e,n.leading,t,f]),y.useEffect(()=>(o.current=!0,f),[f]),[r,f]}const lV=250;function cV(e,t,n){return UA("searchOne",e,t)}function vc(e,t,n){return UA("searchResources",e,t)}function UA(e,t,n,r){const a=De(),[o,c]=y.useState(),[u,f]=y.useState(!0),[p,m]=y.useState(),[g,v]=y.useState(),b=a.fhirSearchUrl(t,n).toString(),[S]=sV(b,lV,{leading:!0});return y.useEffect(()=>{S!==o&&(c(S),a[e](t,n).then(j=>{f(!1),m(j),v(Vz)}).catch(j=>{f(!1),m(void 0),v(Jt(j))}))},[a,e,t,n,o,S]),[p,u,g]}function uV(e){const t=e.value;return t?s.jsx(s.Fragment,{children:gA(t)}):null}const BA=["meta","implicitRules","contained","extension","modifierExtension"],VA=["language","text"],cn=y.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});cn.displayName="ElementsContext";const ib=["extension","modifierExtension"],dV=["id",...BA].filter(e=>!ib.includes(e));function fV(e){return Object.entries(e).filter(([n,r])=>{var a;return!En(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||ib.includes(n)&&!En((a=r.slicing)==null?void 0:a.slices)||dV.includes(n)?!1:!(VA.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function CE(e,t){return e.line&&e.line.length>t?e.line[t]:""}function EE(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function hV(e){const[t,n]=y.useState(e.defaultValue||{}),r=y.useRef(t);r.current=t;const{getExtendedProps:a}=y.useContext(cn),[o,c,u,f,p,m,g]=y.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(T=>a(e.path+"."+T)),[a,e.path]);function v(T){n(T),e.onChange&&e.onChange(T)}function b(T){v({...r.current,use:T})}function S(T){v({...r.current,type:T})}function j(T){v(EE(r.current||{},0,T))}function C(T){v(EE(r.current||{},1,T))}function R(T){v({...r.current,city:T})}function D(T){v({...r.current,state:T})}function E(T){v({...r.current,postalCode:T})}return s.jsxs(Ce,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(ln,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:T=>b(T.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(ln,{disabled:e.disabled||(c==null?void 0:c.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:T=>S(T.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Line 1",defaultValue:CE(t,0),onChange:T=>j(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Line 2",defaultValue:CE(t,1),onChange:T=>C(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(p==null?void 0:p.readonly),placeholder:"City",defaultValue:t.city,onChange:T=>R(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"State",defaultValue:t.state,onChange:T=>D(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(g==null?void 0:g.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:T=>E(T.currentTarget.value)})]})}function pV(e){const t=Yp(),[n,r]=y.useState(e.defaultValue||{});function a(o){const c=o?{text:o,authorReference:t&&fn(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return s.jsx(ze,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:o=>a(o.currentTarget.value)})}/**
127
- * @license @tabler/icons-react v3.17.0 - MIT
128
- *
129
- * This source code is licensed under the MIT license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */var mV={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
132
- * @license @tabler/icons-react v3.17.0 - MIT
133
- *
134
- * This source code is licensed under the MIT license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const Fe=(e,t,n,r)=>{const a=y.forwardRef(({color:o="currentColor",size:c=24,stroke:u=2,title:f,className:p,children:m,...g},v)=>y.createElement("svg",{ref:v,...mV[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:o}:{strokeWidth:u,stroke:o},...g},[f&&y.createElement("title",{key:"svg-title"},f),...r.map(([b,S])=>y.createElement(b,S)),...Array.isArray(m)?m:[m]]));return a.displayName=`${n}`,a};/**
137
- * @license @tabler/icons-react v3.17.0 - MIT
138
- *
139
- * This source code is licensed under the MIT license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */var gV=Fe("outline","adjustments-horizontal","IconAdjustmentsHorizontal",[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]]);/**
142
- * @license @tabler/icons-react v3.17.0 - MIT
143
- *
144
- * This source code is licensed under the MIT license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */var Js=Fe("outline","alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]);/**
147
- * @license @tabler/icons-react v3.17.0 - MIT
148
- *
149
- * This source code is licensed under the MIT license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */var vV=Fe("outline","arrow-down","IconArrowDown",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]]);/**
152
- * @license @tabler/icons-react v3.17.0 - MIT
153
- *
154
- * This source code is licensed under the MIT license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */var yV=Fe("outline","arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);/**
157
- * @license @tabler/icons-react v3.17.0 - MIT
158
- *
159
- * This source code is licensed under the MIT license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */var xV=Fe("outline","bleach-off","IconBleachOff",[["path",{d:"M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]]);/**
162
- * @license @tabler/icons-react v3.17.0 - MIT
163
- *
164
- * This source code is licensed under the MIT license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */var bV=Fe("outline","bleach","IconBleach",[["path",{d:"M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",key:"svg-0"}]]);/**
167
- * @license @tabler/icons-react v3.17.0 - MIT
168
- *
169
- * This source code is licensed under the MIT license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */var SV=Fe("outline","box-multiple","IconBoxMultiple",[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]]);/**
172
- * @license @tabler/icons-react v3.17.0 - MIT
173
- *
174
- * This source code is licensed under the MIT license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */var wV=Fe("outline","brackets-contain","IconBracketsContain",[["path",{d:"M7 4h-4v16h4",key:"svg-0"}],["path",{d:"M17 4h4v16h-4",key:"svg-1"}],["path",{d:"M8 16h.01",key:"svg-2"}],["path",{d:"M12 16h.01",key:"svg-3"}],["path",{d:"M16 16h.01",key:"svg-4"}]]);/**
177
- * @license @tabler/icons-react v3.17.0 - MIT
178
- *
179
- * This source code is licensed under the MIT license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */var jV=Fe("outline","brand-asana","IconBrandAsana",[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]]);/**
182
- * @license @tabler/icons-react v3.17.0 - MIT
183
- *
184
- * This source code is licensed under the MIT license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */var CV=Fe("outline","bucket-off","IconBucketOff",[["path",{d:"M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]);/**
187
- * @license @tabler/icons-react v3.17.0 - MIT
188
- *
189
- * This source code is licensed under the MIT license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */var EV=Fe("outline","bucket","IconBucket",[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]]);/**
192
- * @license @tabler/icons-react v3.17.0 - MIT
193
- *
194
- * This source code is licensed under the MIT license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */var TV=Fe("outline","building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]);/**
197
- * @license @tabler/icons-react v3.17.0 - MIT
198
- *
199
- * This source code is licensed under the MIT license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */var _o=Fe("outline","calendar","IconCalendar",[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]]);/**
202
- * @license @tabler/icons-react v3.17.0 - MIT
203
- *
204
- * This source code is licensed under the MIT license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */var eo=Fe("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
207
- * @license @tabler/icons-react v3.17.0 - MIT
208
- *
209
- * This source code is licensed under the MIT license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */var RV=Fe("outline","checkbox","IconCheckbox",[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]]);/**
212
- * @license @tabler/icons-react v3.17.0 - MIT
213
- *
214
- * This source code is licensed under the MIT license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */var ob=Fe("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
217
- * @license @tabler/icons-react v3.17.0 - MIT
218
- *
219
- * This source code is licensed under the MIT license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */var DV=Fe("outline","circle-check","IconCircleCheck",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]);/**
222
- * @license @tabler/icons-react v3.17.0 - MIT
223
- *
224
- * This source code is licensed under the MIT license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */var Vh=Fe("outline","circle-minus","IconCircleMinus",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]]);/**
227
- * @license @tabler/icons-react v3.17.0 - MIT
228
- *
229
- * This source code is licensed under the MIT license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */var Fh=Fe("outline","circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]);/**
232
- * @license @tabler/icons-react v3.17.0 - MIT
233
- *
234
- * This source code is licensed under the MIT license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */var sb=Fe("outline","cloud-upload","IconCloudUpload",[["path",{d:"M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1",key:"svg-0"}],["path",{d:"M9 15l3 -3l3 3",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}]]);/**
237
- * @license @tabler/icons-react v3.17.0 - MIT
238
- *
239
- * This source code is licensed under the MIT license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */var AV=Fe("outline","columns","IconColumns",[["path",{d:"M4 6l5.5 0",key:"svg-0"}],["path",{d:"M4 10l5.5 0",key:"svg-1"}],["path",{d:"M4 14l5.5 0",key:"svg-2"}],["path",{d:"M4 18l5.5 0",key:"svg-3"}],["path",{d:"M14.5 6l5.5 0",key:"svg-4"}],["path",{d:"M14.5 10l5.5 0",key:"svg-5"}],["path",{d:"M14.5 14l5.5 0",key:"svg-6"}],["path",{d:"M14.5 18l5.5 0",key:"svg-7"}]]);/**
242
- * @license @tabler/icons-react v3.17.0 - MIT
243
- *
244
- * This source code is licensed under the MIT license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */var FA=Fe("outline","copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);/**
247
- * @license @tabler/icons-react v3.17.0 - MIT
248
- *
249
- * This source code is licensed under the MIT license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */var _V=Fe("outline","currency-dollar","IconCurrencyDollar",[["path",{d:"M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2",key:"svg-0"}],["path",{d:"M12 3v3m0 12v3",key:"svg-1"}]]);/**
252
- * @license @tabler/icons-react v3.17.0 - MIT
253
- *
254
- * This source code is licensed under the MIT license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */var kV=Fe("outline","device-floppy","IconDeviceFloppy",[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]]);/**
257
- * @license @tabler/icons-react v3.17.0 - MIT
258
- *
259
- * This source code is licensed under the MIT license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */var PV=Fe("outline","dots","IconDots",[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);/**
262
- * @license @tabler/icons-react v3.17.0 - MIT
263
- *
264
- * This source code is licensed under the MIT license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */var HA=Fe("outline","edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);/**
267
- * @license @tabler/icons-react v3.17.0 - MIT
268
- *
269
- * This source code is licensed under the MIT license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */var Dd=Fe("outline","equal-not","IconEqualNot",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]]);/**
272
- * @license @tabler/icons-react v3.17.0 - MIT
273
- *
274
- * This source code is licensed under the MIT license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */var Ad=Fe("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
277
- * @license @tabler/icons-react v3.17.0 - MIT
278
- *
279
- * This source code is licensed under the MIT license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */var TE=Fe("outline","file-alert","IconFileAlert",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]]);/**
282
- * @license @tabler/icons-react v3.17.0 - MIT
283
- *
284
- * This source code is licensed under the MIT license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */var NV=Fe("outline","file-plus","IconFilePlus",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]]);/**
287
- * @license @tabler/icons-react v3.17.0 - MIT
288
- *
289
- * This source code is licensed under the MIT license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */var OV=Fe("outline","filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);/**
292
- * @license @tabler/icons-react v3.17.0 - MIT
293
- *
294
- * This source code is licensed under the MIT license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */var MV=Fe("outline","forms","IconForms",[["path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3",key:"svg-0"}],["path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3",key:"svg-1"}],["path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7",key:"svg-2"}],["path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1",key:"svg-3"}],["path",{d:"M17 12h.01",key:"svg-4"}],["path",{d:"M13 12h.01",key:"svg-5"}]]);/**
297
- * @license @tabler/icons-react v3.17.0 - MIT
298
- *
299
- * This source code is licensed under the MIT license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */var IV=Fe("outline","id","IconId",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 8l2 0",key:"svg-2"}],["path",{d:"M15 12l2 0",key:"svg-3"}],["path",{d:"M7 16l10 0",key:"svg-4"}]]);/**
302
- * @license @tabler/icons-react v3.17.0 - MIT
303
- *
304
- * This source code is licensed under the MIT license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */var RE=Fe("outline","list-details","IconListDetails",[["path",{d:"M13 5h8",key:"svg-0"}],["path",{d:"M13 9h5",key:"svg-1"}],["path",{d:"M13 15h8",key:"svg-2"}],["path",{d:"M13 19h5",key:"svg-3"}],["path",{d:"M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-5"}]]);/**
307
- * @license @tabler/icons-react v3.17.0 - MIT
308
- *
309
- * This source code is licensed under the MIT license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */var LV=Fe("outline","lock-access","IconLockAccess",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M8 11m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]]);/**
312
- * @license @tabler/icons-react v3.17.0 - MIT
313
- *
314
- * This source code is licensed under the MIT license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */var zV=Fe("outline","lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]);/**
317
- * @license @tabler/icons-react v3.17.0 - MIT
318
- *
319
- * This source code is licensed under the MIT license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */var $V=Fe("outline","logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]);/**
322
- * @license @tabler/icons-react v3.17.0 - MIT
323
- *
324
- * This source code is licensed under the MIT license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */var qA=Fe("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
327
- * @license @tabler/icons-react v3.17.0 - MIT
328
- *
329
- * This source code is licensed under the MIT license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */var GA=Fe("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
332
- * @license @tabler/icons-react v3.17.0 - MIT
333
- *
334
- * This source code is licensed under the MIT license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */var UV=Fe("outline","message","IconMessage",[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]]);/**
337
- * @license @tabler/icons-react v3.17.0 - MIT
338
- *
339
- * This source code is licensed under the MIT license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */var BV=Fe("outline","microscope","IconMicroscope",[["path",{d:"M5 21h14",key:"svg-0"}],["path",{d:"M6 18h2",key:"svg-1"}],["path",{d:"M7 18v3",key:"svg-2"}],["path",{d:"M9 11l3 3l6 -6l-3 -3z",key:"svg-3"}],["path",{d:"M10.5 12.5l-1.5 1.5",key:"svg-4"}],["path",{d:"M17 3l3 3",key:"svg-5"}],["path",{d:"M12 21a6 6 0 0 0 3.715 -10.712",key:"svg-6"}]]);/**
342
- * @license @tabler/icons-react v3.17.0 - MIT
343
- *
344
- * This source code is licensed under the MIT license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */var VV=Fe("outline","packages","IconPackages",[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-0"}],["path",{d:"M2 13.5v5.5l5 3",key:"svg-1"}],["path",{d:"M7 16.545l5 -3.03",key:"svg-2"}],["path",{d:"M17 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-3"}],["path",{d:"M12 19l5 3",key:"svg-4"}],["path",{d:"M17 16.5l5 -3",key:"svg-5"}],["path",{d:"M12 13.5v-5.5l-5 -3l5 -3l5 3v5.5",key:"svg-6"}],["path",{d:"M7 5.03v5.455",key:"svg-7"}],["path",{d:"M12 8l5 -3",key:"svg-8"}]]);/**
347
- * @license @tabler/icons-react v3.17.0 - MIT
348
- *
349
- * This source code is licensed under the MIT license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */var FV=Fe("outline","pin","IconPin",[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]]);/**
352
- * @license @tabler/icons-react v3.17.0 - MIT
353
- *
354
- * This source code is licensed under the MIT license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */var HV=Fe("outline","pinned-off","IconPinnedOff",[["path",{d:"M3 3l18 18",key:"svg-0"}],["path",{d:"M15 4.5l-3.249 3.249m-2.57 1.433l-2.181 .818l-1.5 1.5l7 7l1.5 -1.5l.82 -2.186m1.43 -2.563l3.25 -3.251",key:"svg-1"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-2"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-3"}]]);/**
357
- * @license @tabler/icons-react v3.17.0 - MIT
358
- *
359
- * This source code is licensed under the MIT license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */var qV=Fe("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
362
- * @license @tabler/icons-react v3.17.0 - MIT
363
- *
364
- * This source code is licensed under the MIT license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */var GV=Fe("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
367
- * @license @tabler/icons-react v3.17.0 - MIT
368
- *
369
- * This source code is licensed under the MIT license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */var QV=Fe("outline","receipt","IconReceipt",[["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2m4 -14h6m-6 4h6m-2 4h2",key:"svg-0"}]]);/**
372
- * @license @tabler/icons-react v3.17.0 - MIT
373
- *
374
- * This source code is licensed under the MIT license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */var WV=Fe("outline","refresh","IconRefresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]);/**
377
- * @license @tabler/icons-react v3.17.0 - MIT
378
- *
379
- * This source code is licensed under the MIT license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */var YV=Fe("outline","repeat","IconRepeat",[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]]);/**
382
- * @license @tabler/icons-react v3.17.0 - MIT
383
- *
384
- * This source code is licensed under the MIT license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */var KV=Fe("outline","report-medical","IconReportMedical",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]]);/**
387
- * @license @tabler/icons-react v3.17.0 - MIT
388
- *
389
- * This source code is licensed under the MIT license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */var XV=Fe("outline","router","IconRouter",[["path",{d:"M3 13m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17l0 .01",key:"svg-1"}],["path",{d:"M13 17l0 .01",key:"svg-2"}],["path",{d:"M15 13l0 -2",key:"svg-3"}],["path",{d:"M11.75 8.75a4 4 0 0 1 6.5 0",key:"svg-4"}],["path",{d:"M8.5 6.5a8 8 0 0 1 13 0",key:"svg-5"}]]);/**
392
- * @license @tabler/icons-react v3.17.0 - MIT
393
- *
394
- * This source code is licensed under the MIT license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */var ZV=Fe("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);/**
397
- * @license @tabler/icons-react v3.17.0 - MIT
398
- *
399
- * This source code is licensed under the MIT license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */var Ny=Fe("outline","settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]);/**
402
- * @license @tabler/icons-react v3.17.0 - MIT
403
- *
404
- * This source code is licensed under the MIT license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */var lb=Fe("outline","sort-ascending","IconSortAscending",[["path",{d:"M4 6l7 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l9 0",key:"svg-2"}],["path",{d:"M15 9l3 -3l3 3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
407
- * @license @tabler/icons-react v3.17.0 - MIT
408
- *
409
- * This source code is licensed under the MIT license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */var cb=Fe("outline","sort-descending","IconSortDescending",[["path",{d:"M4 6l9 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l7 0",key:"svg-2"}],["path",{d:"M15 15l3 3l3 -3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
412
- * @license @tabler/icons-react v3.17.0 - MIT
413
- *
414
- * This source code is licensed under the MIT license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */var JV=Fe("outline","square","IconSquare",[["path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}]]);/**
417
- * @license @tabler/icons-react v3.17.0 - MIT
418
- *
419
- * This source code is licensed under the MIT license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */var eF=Fe("outline","star","IconStar",[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z",key:"svg-0"}]]);/**
422
- * @license @tabler/icons-react v3.17.0 - MIT
423
- *
424
- * This source code is licensed under the MIT license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */var tF=Fe("outline","switch-horizontal","IconSwitchHorizontal",[["path",{d:"M16 3l4 4l-4 4",key:"svg-0"}],["path",{d:"M10 7l10 0",key:"svg-1"}],["path",{d:"M8 13l-4 4l4 4",key:"svg-2"}],["path",{d:"M4 17l9 0",key:"svg-3"}]]);/**
427
- * @license @tabler/icons-react v3.17.0 - MIT
428
- *
429
- * This source code is licensed under the MIT license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */var nF=Fe("outline","table-export","IconTableExport",[["path",{d:"M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-4"}]]);/**
432
- * @license @tabler/icons-react v3.17.0 - MIT
433
- *
434
- * This source code is licensed under the MIT license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */var rF=Fe("outline","text-recognition","IconTextRecognition",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M12 16v-7",key:"svg-4"}],["path",{d:"M9 9h6",key:"svg-5"}]]);/**
437
- * @license @tabler/icons-react v3.17.0 - MIT
438
- *
439
- * This source code is licensed under the MIT license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */var ub=Fe("outline","trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);/**
442
- * @license @tabler/icons-react v3.17.0 - MIT
443
- *
444
- * This source code is licensed under the MIT license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */var DE=Fe("outline","upload","IconUpload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]);/**
447
- * @license @tabler/icons-react v3.17.0 - MIT
448
- *
449
- * This source code is licensed under the MIT license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */var aF=Fe("outline","webhook","IconWebhook",[["path",{d:"M4.876 13.61a4 4 0 1 0 6.124 3.39h6",key:"svg-0"}],["path",{d:"M15.066 20.502a4 4 0 1 0 1.934 -7.502c-.706 0 -1.424 .179 -2 .5l-3 -5.5",key:"svg-1"}],["path",{d:"M16 8a4 4 0 1 0 -8 0c0 1.506 .77 2.818 2 3.5l-3 5.5",key:"svg-2"}]]);/**
452
- * @license @tabler/icons-react v3.17.0 - MIT
453
- *
454
- * This source code is licensed under the MIT license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */var $s=Fe("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
457
- * @license @tabler/icons-react v3.17.0 - MIT
458
- *
459
- * This source code is licensed under the MIT license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */var iF=Fe("filled","circle-filled","IconCircleFilled",[["path",{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",key:"svg-0"}]]);class QA extends y.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?s.jsx(Yi,{icon:s.jsx(Js,{size:16}),title:"Something went wrong",color:"red",children:Ke(this.state.error)}):this.props.children}}function pa(){return s.jsx(er,{style:{width:"100%",height:"100vh"},children:s.jsx(_r,{})})}const oF="_main_6f7o5_1",sF={main:oF};function hn(e){e.preventDefault(),e.stopPropagation()}function WA(e){return e.button===1||e.ctrlKey||e.metaKey}function YA(e){if(AE(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&AE(t[0]))return!0}return!1}function AE(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Gu(e,t){return new Promise((n,r)=>{var o;const a=new MessageChannel;a.port1.onmessage=({data:c})=>{a.port1.close(),c.error?r(c.error):n(c.result)},(o=e.contentWindow)==null||o.postMessage(t,new URL(e.src).origin,[a.port2])})}function KA(e,t){const n=new Blob([e],{type:dn.JSON}),r=URL.createObjectURL(n),a=document.createElement("a");a.href=r;const o=t??new Date().toISOString().replace(/\D/g,"");a.download=`${o}.json`,document.body.appendChild(a),a.click(),URL.revokeObjectURL(r)}function bt(e){const t=Wp(),{to:n,suffix:r,label:a,onClick:o,children:c,...u}=e;let f=lF(n);return r&&(f+="/"+r),s.jsx(Pt,{href:f,"aria-label":a,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),o?(p.preventDefault(),o(p)):n&&(WA(p)||(p.preventDefault(),t(f)))},...u,children:c})}function lF(e){if(e){if(typeof e=="string")return cF(e);if(fi(e))return uF(e);if(Qo(e))return dF(e)}return"#"}function cF(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function uF(e){return`/${e.resourceType}/${e.id}`}function dF(e){return`/${e.reference}`}function fF(e){const t=e.split(" ").filter(Boolean);return t.length>1?t[0][0]+t[t.length-1][0]:t.length===1?t[0][0]:""}function Wo(e){const t=Yt(e.value),n=t?Bi(t):e.alt??"",r=fF(n),a=(t&&S$(t))??e.src,o=$A(a??void 0),c=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?s.jsx(bt,{to:t,children:s.jsx(Ns,{src:o,alt:n,radius:c,...u,children:r})}):s.jsx(Ns,{src:o,alt:n,radius:c,...u,children:r})}const hF="_logoButton_189g3_1",pF="_user_189g3_11",mF="_userName_189g3_21",gF="_userActive_189g3_31",oh={logoButton:hF,user:pF,userName:mF,userActive:gF};function db(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Pc(t,e.options)}):null}function vF(e){var f,p,m;const t=Qp(),{medplum:n,profile:r,navigate:a}=t,o=n.getLogins(),{colorScheme:c,setColorScheme:u}=oO();return s.jsxs(s.Fragment,{children:[s.jsxs(We,{align:"center",p:"xl",children:[s.jsx(Wo,{size:"xl",radius:100,value:t.profile}),s.jsx(db,{value:(p=(f=t.profile)==null?void 0:f.name)==null?void 0:p[0]}),s.jsx(Ae,{c:"dimmed",size:"xs",children:(m=n.getActiveLogin())==null?void 0:m.project.display})]}),o.length>1&&s.jsx(je.Divider,{}),o.map(g=>g.profile.reference!==Lt(t.profile)&&s.jsx(je.Item,{onClick:()=>{n.setActiveLogin(g).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(Ce,{children:[s.jsx(Ns,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Ae,{size:"sm",fw:500,children:g.profile.display}),s.jsx(Ae,{c:"dimmed",size:"xs",children:g.project.display})]})]})},g.profile.reference)),s.jsx(je.Divider,{}),s.jsx(Ce,{justify:"center",children:s.jsx(zp,{size:"xs",value:c,onChange:g=>u(g),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(tF,{size:14,stroke:1.5}),onClick:()=>a("/signin"),children:"Add another account"}),s.jsx(je.Item,{leftSection:s.jsx(Ny,{size:14,stroke:1.5}),onClick:()=>a(`/${Lt(r)}`),children:"Account settings"}),s.jsx(je.Item,{leftSection:s.jsx($V,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),a("/signin")},children:"Sign out"}),s.jsx(Ae,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const _E={selectedItems:"selected-items",options:"options"};function fb(e){const t=gd({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:a,error:o,defaultValue:c,toOption:u,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:v,onCreate:b,creatable:S,clearable:j,required:C,placeholder:R,leftSection:D,maxValues:E,optionsDropdownMaxHeight:T=320,minInputLength:A=0,..._}=e,M=_.disabled,L=yF(c),[$,V]=y.useState(""),[Y,W]=y.useState(),[G,X]=y.useState(),[Z,P]=y.useState(),[I,z]=y.useState(L.map(u)),[F,O]=y.useState([]),U=p??xF,J=m??bF,te=g??SF,ye=y.useRef($);ye.current=$;const be=y.useRef(void 0),ve=y.useRef(void 0),Ge=y.useRef(Y);Ge.current=Y;const ke=y.useRef(G);ke.current=G;const et=y.useRef(Z);et.current=Z;const Re=y.useRef(F);Re.current=F;const ft=y.useCallback(()=>{var ge;if(W(void 0),ye.current===ve.current&&f===be.current||(((ge=ye.current)==null?void 0:ge.length)??0)<A)return;ve.current=ye.current,be.current=f;const Te=new AbortController;X(Te),f(ye.current??"",Te.signal).then(we=>{Te.signal.aborted||(O(we.map(u)),et.current?(we.length>0&&v(we.slice(0,1)),P(!1)):we.length>0&&t.openDropdown())}).catch(we=>{Te.signal.aborted||we.message.includes("aborted")||_e({color:"red",message:Ke(we)})}).finally(()=>{Te.signal.aborted||X(void 0)})},[t,f,v,u,A]),Ut=y.useCallback(Te=>{(F&&F.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),V(Te.currentTarget.value),ke.current&&(ke.current.abort(),X(void 0)),Ge.current!==void 0&&window.clearTimeout(Ge.current);const ge=window.setTimeout(()=>ft(),100);W(ge)},[t,F,S,ft]),Ot=y.useCallback(Te=>{const ge=I.some(xe=>xe.value===Te),we=ge?I.filter(xe=>xe.value!==Te):[...I];let Le=F==null?void 0:F.find(xe=>xe.value===Te);if(!Le&&S!==!1&&b){const xe=b(Te);Le=u(xe)}if(Le){if(E===0){v([Le.resource]),I.length>0&&z([]);return}ge||we.push(Le)}if(E!==void 0)for(;we.length>E;)we.shift();v(we.map(xe=>xe.resource)),z(we)},[S,F,I,E,v,b,u]),xt=y.useMemo(()=>{if(!M)return Te=>{M||(E===1&&(V(""),O([]),t.closeDropdown()),ve.current=void 0,Te==="$create"?(V(""),Ot($)):Ot(Te))}},[Ot,t,M,E,$]),Ht=y.useCallback(Te=>{const ge=I.filter(we=>we.value!==Te.value);v(ge.map(we=>we.resource)),z(ge)},[I,v]),Bt=y.useCallback(Te=>{Te.key==="Enter"?(Y||G)&&P(!0):Te.key==="Backspace"&&$.length===0&&(hn(Te),Ht(I[I.length-1]))},[G,Ht,$.length,I,Y]);y.useEffect(()=>()=>{ke.current&&ke.current.abort()},[]);const Se=!M&&j&&I.length>0&&s.jsx(ct.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{V(""),z([]),v([]),t.closeDropdown()}}),Ne=S&&$.trim().length>0,Ve=F.length>0||Ne;return s.jsxs(ct,{store:t,onOptionSubmit:xt,withinPortal:!0,shadow:"xl",..._,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(hc,{label:r,description:a,error:o,className:e.className,leftSection:D,rightSection:G?s.jsx(_r,{size:16}):Se,required:C,disabled:M,children:s.jsxs(Os.Group,{"data-testid":_E.selectedItems,children:[I.map(Te=>s.jsx(J,{item:Te,disabled:M,onRemove:()=>Ht(Te)},Te.value)),!M&&(E===void 0||E===0||I.length<E)&&s.jsx(ct.EventsTarget,{children:s.jsx(hc.Field,{role:"searchbox",name:n,value:$,placeholder:R,onFocus:Ut,onBlur:()=>{t.closeDropdown(),V("")},onKeyDown:Bt,onChange:Ut})})]})})}),s.jsx(ct.Dropdown,{hidden:!Ve,"data-testid":_E.options,children:s.jsx(ct.Options,{children:s.jsxs(hp,{type:"scroll",mah:T,children:[F.map(Te=>{const ge=I.some(we=>we.value===Te.value);return s.jsx(ct.Option,{value:Te.value,active:ge,children:s.jsx(U,{...Te,active:ge})},Te.value)}),Ne&&s.jsxs(ct.Option,{value:"$create",children:["+ Create ",$]}),!S&&$.trim().length>0&&F.length===0&&s.jsx(te,{search:$})]})})})]})}function yF(e){return e?Array.isArray(e)?e:[e]:[]}function xF(e){return s.jsxs(Ce,{gap:"xs",children:[e.active&&s.jsx(eo,{size:12}),s.jsx("span",{children:e.label})]})}function bF({item:e,disabled:t,onRemove:n}){return s.jsx(Os,{withRemoveButton:!t,onRemove:n,children:e.label})}function SF(){return s.jsx(ct.Empty,{children:"Nothing found"})}const wF="_searchInput_dick8_1",jF={searchInput:wF};function CF(e){return{value:e.id,label:Bi(e),resource:e}}function EF(e){const t=Wp(),n=De(),r=y.useCallback(async(o,c)=>{const u=RF(o),f={signal:c},p=await n.graphql(u,void 0,void 0,f);return DF(p,o)},[n]),a=y.useCallback(o=>{o.length>0&&t(`/${Lt(o[0])}`)},[t]);return s.jsx(fb,{size:"sm",radius:"md",className:jF.searchInput,leftSection:s.jsx(ZV,{size:16}),placeholder:"Search",itemComponent:TF,toOption:CF,onChange:a,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const TF=y.forwardRef(({resource:e,active:t,...n},r)=>{var o;let a;return e.resourceType==="Patient"?a=e.birthDate:e.resourceType==="ServiceRequest"&&(a=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...n,children:s.jsxs(Ce,{wrap:"nowrap",children:[s.jsx(Wo,{value:e}),s.jsxs("div",{children:[s.jsx(Ae,{children:Bi(e)}),s.jsx(Ae,{size:"xs",c:"dimmed",children:a})]})]})})});function RF(e){const t=JSON.stringify(e);return uA(e)?`{
462
- Patients1: PatientList(_id: ${t}, _count: 1) {
463
- resourceType
464
- id
465
- identifier {
466
- system
467
- value
468
- }
469
- name {
470
- given
471
- family
472
- }
473
- birthDate
474
- }
475
- ServiceRequestList(_id: ${t}, _count: 1) {
476
- resourceType
477
- id
478
- identifier {
479
- system
480
- value
481
- }
482
- subject {
483
- display
484
- }
485
- }
486
- }`.replace(/\s+/g," "):`{
487
- Patients1: PatientList(name: ${t}, _count: 5) {
488
- resourceType
489
- id
490
- identifier {
491
- system
492
- value
493
- }
494
- name {
495
- given
496
- family
497
- }
498
- birthDate
499
- }
500
- Patients2: PatientList(identifier: ${t}, _count: 5) {
501
- resourceType
502
- id
503
- identifier {
504
- system
505
- value
506
- }
507
- name {
508
- given
509
- family
510
- }
511
- birthDate
512
- }
513
- ServiceRequestList(identifier: ${t}, _count: 5) {
514
- resourceType
515
- id
516
- identifier {
517
- system
518
- value
519
- }
520
- subject {
521
- display
522
- }
523
- }
524
- }`.replace(/\s+/g," ")}function DF(e,t){const n=[];return e.data.Patients1&&n.push(...e.data.Patients1),e.data.Patients2&&n.push(...e.data.Patients2),e.data.ServiceRequestList&&n.push(...e.data.ServiceRequestList),_F(AF(n),t).slice(0,5)}function AF(e){const t=new Set,n=[];for(const r of e)t.has(r.id)||(t.add(r.id),n.push(r));return n}function _F(e,t){return e.sort((n,r)=>kE(r,t)-kE(n,t))}function kE(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,PE(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,PE(Pc(r),t));return n}function PE(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function kF(e){var a;const t=Yp(),[n,r]=y.useState(!1);return s.jsx(Ar.Header,{p:8,style:{zIndex:101},children:s.jsxs(Ce,{justify:"space-between",children:[s.jsxs(Ce,{gap:"xs",children:[s.jsx(tr,{className:oh.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(EF,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(Ce,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(je,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(je.Target,{children:s.jsx(tr,{className:$t(oh.user,{[oh.userActive]:n}),onClick:()=>r(o=>!o),children:s.jsxs(Ce,{gap:7,children:[s.jsx(Wo,{value:t,radius:"xl",size:24}),s.jsx(Ae,{size:"sm",className:oh.userName,children:Pc((a=t==null?void 0:t.name)==null?void 0:a[0])}),s.jsx(ob,{size:12,stroke:1.5})]})})}),s.jsx(je.Dropdown,{children:s.jsx(vF,{version:e.version})})]})]})]})})}const hb=y.createContext({submitting:!1});hb.displayName="FormContext";function PF(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?NF(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&OF(t,n);return t}function NF(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function OF(e,t){e[t.name]=t.value}function mt(e){const[t,n]=y.useState(!1);return s.jsx(hb.Provider,{value:{submitting:t},children:s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const a=PF(r.target);if(e.onSubmit){n(!0);const o=e.onSubmit(a);o!=null&&o.then?o.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function Or(e){const{children:t,...n}=e,{submitting:r}=y.useContext(hb);return s.jsx(Pe,{type:"submit",loading:r,...n,children:t})}function MF(e){const t=De(),n=t.getUserConfiguration();function r(a){var m,g;const{menuname:o,bookmarkname:c}=a,u=`${e.pathname}?${e.searchParams.toString()}`,f=Qr(n),p=(m=f.menu)==null?void 0:m.find(({title:v})=>v===o);(g=p==null?void 0:p.link)==null||g.push({name:c,target:u}),t.updateResource(f).then(v=>{n.menu=v.menu,t.dispatchEvent({type:"change"}),_e({color:"green",message:"Success"}),e.onOk()}).catch(v=>{_e({color:"red",message:Ke(v)})})}return s.jsx(Un,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(mt,{onSubmit:r,children:s.jsxs(We,{children:[s.jsx(IF,{config:n}),s.jsx(ze,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Or,{mt:"sm",children:"OK"})})]})})})}function IF(e){function t(r){var a;return(a=r==null?void 0:r.menu)==null?void 0:a.map(o=>o.title)}const n=t(e.config);return s.jsx(ln,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function XA(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function LF(e){return typeof e.display=="string"?e.display:XA(e)}function zF(e){return{value:XA(e),label:LF(e),resource:e}}function $F(e){return{code:e,display:e}}function pb(e){const t=De(),{binding:n,creatable:r,clearable:a,expandParams:o,withHelpText:c,...u}=e,f=y.useCallback(async(p,m)=>{var S;if(!n)return[];const v=((S=(await t.valueSetExpand({...o,url:n,filter:p,count:10},{signal:m})).expansion)==null?void 0:S.contains)??[],b=[];for(const j of v)j.code&&!b.some(C=>C.code===j.code)&&b.push(j);return b},[t,o,n]);return s.jsx(fb,{...u,creatable:r??!0,clearable:a??!0,toOption:zF,loadOptions:f,onCreate:$F,itemComponent:c?UF:void 0})}const UF=y.forwardRef(({label:e,resource:t,active:n,...r},a)=>s.jsx("div",{ref:a,...r,children:s.jsxs(Ce,{wrap:"nowrap",gap:"xs",children:[n&&s.jsx(eo,{size:12}),s.jsxs("div",{children:[s.jsx(Ae,{children:e}),s.jsx(Ae,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function ZA(e){const{defaultValue:t,onChange:n,withHelpText:r,...a}=e,[o,c]=y.useState(t);function u(f){const p=f[0],m=VF(p);c(m),n&&n(m)}return s.jsx(pb,{defaultValue:BF(o),onChange:u,withHelpText:r??!0,...a})}function BF(e){return e?{code:e}:void 0}function VF(e){return e==null?void 0:e.code}function mb(e){const[t,n]=y.useState(e.defaultValue),r=e.onChange,a=y.useCallback(o=>{n(o),r&&r(o)},[r]);return s.jsx(ZA,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:a,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const FF="_menuTitle_9g6l5_1",HF="_link_9g6l5_9",qF="_linkActive_9g6l5_38",Oy={menuTitle:FF,link:HF,linkActive:qF};function GF(e){var u;const t=Wp(),n=YF(e.pathname,e.searchParams,e.menus),[r,a]=y.useState(!1);function o(f,p){f.stopPropagation(),f.preventDefault(),t(p),window.innerWidth<768&&e.closeNavbar()}function c(f){f&&t(`/${f}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Ar.Navbar,{children:s.jsxs(Yr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(Ar.Section,{mb:"sm",children:s.jsx(mb,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:f=>c(f)},window.location.pathname)}),s.jsxs(Ar.Section,{grow:!0,children:[(u=e.menus)==null?void 0:u.map(f=>{var p;return s.jsxs(y.Fragment,{children:[s.jsx(Ae,{className:Oy.menuTitle,children:f.title}),(p=f.links)==null?void 0:p.map(m=>s.jsxs(QF,{to:m.href,active:m.href===(n==null?void 0:n.href),onClick:g=>o(g,m.href),children:[s.jsx(WF,{icon:m.icon}),s.jsx("span",{children:m.label})]},m.href))]},`menu-${f.title}`)}),e.displayAddBookmark&&s.jsx(Pe,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(GV,{size:"0.75rem"}),onClick:()=>a(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(MF,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>a(!1),onCancel:()=>a(!1)})]})}function QF(e){return s.jsx(bt,{onClick:e.onClick,to:e.to,className:$t(Oy.link,{[Oy.linkActive]:e.active}),children:e.children})}function WF(e){return e.icon?e.icon:s.jsx($p,{w:30})}function YF(e,t,n){if(!e||!t||!n)return;let r,a=0;for(const o of n)if(o.links)for(const c of o.links){const u=KF(e,t,c.href);u>a&&(a=u,r=c)}return r}function KF(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const a=["_count","_offset"];for(const[c,u]of r.searchParams.entries())if(!a.includes(c)&&t.get(c)!==u)return 0;let o=1;for(const[c,u]of t.entries())a.includes(c)||r.searchParams.get(c)===u&&o++;return o}function XF(e){const[t,n]=y.useState(localStorage.navbarOpen==="true"),r=De(),a=Yp();y.useEffect(()=>{function f(){_e({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",f),()=>r.removeEventListener("offline",f)},[r]);function o(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){o(!1)}function u(){o(!t)}return r.isLoading()?s.jsx(pa,{}):s.jsxs(Ar,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!a||!t,mobile:!a||!t}},padding:0,children:[a&&s.jsx(kF,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:u,notifications:e.notifications}),a&&t?s.jsx(GF,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(Ar.Main,{className:sF.main,children:s.jsx(QA,{children:s.jsx(y.Suspense,{fallback:s.jsx(pa,{}),children:e.children})})})]})}const ZF="https://ccda.medplum.com",JF="https://ccda-validator.medplum.com/";function eH(e){const{url:t}=e,[n,r]=y.useState(!1),a=y.useRef(null),[o,c]=y.useState(),[u,f]=y.useState(!1);y.useEffect(()=>{t&&n&&a.current&&(Gu(a.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{f(!0);const b=await(await fetch(t)).text(),S=new FormData;S.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${JF}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(j,{method:"POST",body:S,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const R=await C.json();c(R)}catch(v){c(void 0),console.error("CCDA validation error:",v)}finally{f(!1)}},m=()=>{if(!o)return;const v=JSON.stringify(o,null,2);KA(v,"ccda-validation-results")},g=()=>o?o.resultsMetaData.resultMetaData.filter(v=>v==null?void 0:v.type.includes("Error")).reduce((v,b)=>v+(b.count||0),0):0;return t?s.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[s.jsx("div",{style:{minHeight:400},children:s.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:a,src:ZF,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),s.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[s.jsx(Pe,{type:"button",onClick:p,disabled:u,children:u?"Validating...":"Validate"}),o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{marginLeft:"15px"},children:[s.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),s.jsx(Pe,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function _d(e){const{contentType:t,url:n,title:r}=e.value??{},a=$A(n);return a?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:a,alt:r}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:a})}),((t==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&s.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:a+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===dn.CDA_XML&&s.jsx(eH,{url:a}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Pt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:tH(r),children:r||"Download"})})]}):null}function tH(e){return e!=null&&e.includes(".")?e:void 0}const nH="_root_17n8t_1",rH="_compact_17n8t_25",NE={root:nH,compact:rH};function gb(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:$t(NE.root,{[NE.compact]:n}),children:t})}function Ii(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function aH(e){var r;const t=(r=e.values)==null?void 0:r.map((a,o)=>s.jsx("div",{children:s.jsx(_d,{value:a,maxWidth:e.maxWidth})},"attatchment-"+o));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!En(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const a=e.path.split(".").pop();n=s.jsx(Ii,{term:Ls(a),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function vb(e){const t=De(),n=y.useRef(null);function r(c){var u;hn(c),(u=n.current)==null||u.click()}function a(c){hn(c);const u=c.target.files;u&&Array.from(u).forEach(o)}function o(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Jt(f))}))}return s.jsxs(s.Fragment,{children:[s.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:c=>a(c)}),e.children({onClick:r,disabled:e.disabled})]})}function iH(e){const[t,n]=y.useState(e.defaultValue??[]),r=y.useRef(t);r.current=t;function a(o){n(o),e.onChange&&e.onChange(o)}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((o,c)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(_d,{value:o,maxWidth:200})}),s.jsx("td",{children:s.jsx(_n,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{hn(u);const f=t.slice();f.splice(c,1),a(f)},children:s.jsx(Vh,{})})})]},`${c}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(vb,{disabled:e.disabled,onUpload:o=>{a([...r.current,o])},children:o=>s.jsx(_n,{...o,title:"Add",variant:"subtle",size:"sm",color:o.disabled?"gray":"green",children:s.jsx(sb,{})})})})]})]})]})}function JA(e){const[t,n]=y.useState(e.defaultValue);function r(a){n(a),e.onChange&&e.onChange(a)}return t?s.jsxs(s.Fragment,{children:[s.jsx(_d,{value:t,maxWidth:200}),s.jsx(Pe,{disabled:e.disabled,onClick:a=>{hn(a),r(void 0)},children:"Remove"})]}):s.jsx(vb,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:a=>s.jsx(Pe,{...a,children:"Upload..."})})}const oH="_root_1vii2_1",sH={root:oH};function kd(e){const{children:t,...n}=e;return s.jsx(a0,{className:sH.root,...n,children:t})}const lH="_paper_1igaj_1",cH="_fill_1igaj_20",OE={paper:lH,fill:cH};function yb(e){const{width:t,fill:n,className:r,children:a,...o}=e,c=t?{maxWidth:t}:void 0;return s.jsx(mr,{className:$t(OE.paper,n&&OE.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...o,children:a})}function ot(e){const{children:t,...n}=e;return s.jsx(kd,{children:s.jsx(yb,{...n,children:t})})}function $a(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 Nt(e,t){var n,r,a;return(a=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(o=>{var c;return e_((c=o.expression)==null?void 0:c[0],t)}))==null?void 0:r.map(o=>{var c;return(c=o.details)==null?void 0:c.text}))==null?void 0:a.join(`
525
- `)}function Pd(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var a;return e_((a=r.expression)==null?void 0:a[0],t)})}const sh=/\[\d+\]/;function e_(e,t){const n=typeof e=="string"&&sh.test(e),r=typeof t=="string"&&sh.test(t);if(n!==r&&(e=e==null?void 0:e.replace(sh,""),t=t==null?void 0:t.replace(sh,"")),e===t)return!0;if(!e||!t)return!1;const a=e.indexOf(".");if(a>=0&&e.substring(a+1)===t)return!0;const o=t.indexOf(".");return o>=0&&t.substring(o+1)===e}function t_(e){const t=De(),[n,r]=y.useState();return s.jsxs(mt,{onSubmit:async a=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:a.projectName}))}catch(o){r(Jt(o))}},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx($a,{size:32}),s.jsx(Ie,{children:"Create project"})]}),s.jsxs(We,{gap:"xl",children:[s.jsx(ze,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Nt(n,"projectName")}),s.jsxs(Ae,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Or,{children:"Create project"})})]})}function n_(e,t){const n=document.getElementsByTagName("head")[0],r=document.createElement("script");r.async=!0,r.src=e,r.onload=t??null,n.appendChild(r)}function r_(e){const t=De(),{googleClientId:n,handleGoogleCredential:r}=e,a=y.useRef(null),[o,c]=y.useState(typeof google<"u"),[u,f]=y.useState(!1),[p,m]=y.useState(!1);return y.useEffect(()=>{if(typeof google>"u"){n_("https://accounts.google.com/gsi/client",()=>c(!0));return}u||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),a.current&&!p&&(google.accounts.id.renderButton(a.current,{}),m(!0))},[t,n,u,o,a,p,r]),n?s.jsx("div",{ref:a}):null}function a_(e){if(e)return e;if(typeof window<"u"){const t=window.location.protocol+"//"+window.location.host;if([].includes(t))return"__GOOGLE_CLIENT_ID__"}}function xa(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Yi,{icon:s.jsx(Js,{size:16}),color:"red",children:t.map(r=>{var a;return s.jsx("div",{"data-testid":"text-field-error",children:ZD(r)},(a=r.details)==null?void 0:a.text)})})}function i_(e){typeof grecaptcha>"u"&&n_("https://www.google.com/recaptcha/api.js?render="+e)}function o_(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function uH(e){const t=a_(e.googleClientId),n=e.recaptchaSiteKey,r=De(),[a,o]=y.useState(),c=Pd(a,void 0);return y.useEffect(()=>{n&&i_(n)},[n]),s.jsxs(mt,{onSubmit:async u=>{o(void 0);try{let f="";n&&(f=await o_(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:u.firstName,lastName:u.lastName,email:u.email,password:u.password,remember:u.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){o(Jt(f))}},children:[s.jsx(er,{style:{flexDirection:"column"},children:e.children}),s.jsx(xa,{issues:c}),t&&s.jsxs(s.Fragment,{children:[s.jsx(Ce,{justify:"center",p:"xl",style:{height:70},children:s.jsx(r_,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(f){o(Jt(f))}}})}),s.jsx(jn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(We,{gap:"xl",children:[s.jsx(ze,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Nt(a,"firstName")}),s.jsx(ze,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Nt(a,"lastName")}),s.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Nt(a,"email")}),s.jsx(Na,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Nt(a,"password")}),s.jsxs(Ae,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(Ae,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Pt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(Ce,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Qn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(Or,{children:"Create account"})]})]})}function dH(e){const{type:t,projectId:n,clientId:r,googleClientId:a,recaptchaSiteKey:o,onSuccess:c}=e,u=De(),[f,p]=y.useState(),[m,g]=y.useState();y.useEffect(()=>{t==="patient"&&f&&u.startNewPatient({login:f,projectId:n}).then(b=>u.processCode(b.code)).then(()=>c()).catch(b=>g(Jt(b)))},[u,t,n,f,c]);function v(b){b.code?u.processCode(b.code).then(()=>c()).catch(console.log):b.login&&p(b.login)}return s.jsxs(ot,{width:450,children:[m&&s.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&s.jsx(uH,{projectId:n,clientId:r,googleClientId:a,recaptchaSiteKey:o,handleAuthResponse:v,children:e.children}),f&&t==="project"&&s.jsx(t_,{login:f,handleAuthResponse:v})]})}function fH(e){const[t,n]=y.useState();return t?s.jsx(pH,{email:t,...e}):s.jsx(hH,{setEmail:n,...e})}function hH(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:a,disableEmailAuth:o,...c}=e,u=De(),f=!e.disableGoogleAuth&&a_(e.googleClientId),[p,m]=y.useState(),g=Pd(p,void 0),v=y.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await u.ensureCodeChallenge(c),domain:j.domain}),R=new URL(j.authorizeUrl);return R.searchParams.set("state",C),window.location.assign(R.toString()),!0},[u,c]),b=y.useCallback(async j=>{const C=await u.post("auth/method",{email:j.email});await v(C)||t(j.email)},[u,v,t]),S=y.useCallback(async j=>{try{const C=await u.startGoogleLogin({...c,googleCredential:j.credential});await v(C)||r(C)}catch(C){m(Jt(C))}},[u,c,v,r]);return s.jsxs(mt,{onSubmit:b,children:[s.jsx(er,{style:{flexDirection:"column"},children:a}),s.jsx(xa,{issues:g}),f&&s.jsxs(s.Fragment,{children:[s.jsx(Ce,{justify:"center",p:"xl",style:{height:70},children:s.jsx(r_,{googleClientId:f,handleGoogleCredential:S})}),!o&&s.jsx(jn,{label:"or",labelPosition:"center",my:"lg"})]}),!o&&s.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Nt(p,"email")}),s.jsxs(Ce,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Pt,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!o&&s.jsx(Or,{children:"Next"})]})]})}function pH(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...a}=e,o=De(),[c,u]=y.useState(),f=Pd(c,void 0),p=y.useCallback(m=>{o.startLogin({...a,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>u(Jt(g)))},[o,a,n]);return s.jsxs(mt,{onSubmit:p,children:[s.jsx(er,{style:{flexDirection:"column"},children:r}),s.jsx(xa,{issues:f}),s.jsx(We,{gap:"xl",children:s.jsx(Na,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Nt(c,"password")})}),s.jsxs(Ce,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Pt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Qn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(Or,{children:"Sign in"})]})]})}function mH(e){const t=De(),n=gd(),[r,a]=y.useState(""),[o,c]=y.useState();function u(g){var v;return!!((v=g==null?void 0:g.toLowerCase())!=null&&v.includes(r.toLowerCase()))}function f(g){var v,b;return u((v=g.profile)==null?void 0:v.display)||u((b=g.project)==null?void 0:b.display)}function p(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(v=>c(Jt(v)))}const m=e.memberships.filter(f).slice(0,10).map(g=>s.jsx(ct.Option,{value:g.id,children:s.jsx(gH,{...g})},g.id));return s.jsxs(We,{children:[s.jsxs($o,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx($a,{size:32}),s.jsx(Ie,{order:3,children:"Choose profile"})]}),s.jsx(xa,{outcome:o}),s.jsxs(ct,{store:n,onOptionSubmit:p,children:[s.jsx(ct.EventsTarget,{children:s.jsx(ze,{placeholder:"Search",value:r,onChange:g=>{a(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(ct.Options,{children:m.length>0?m:s.jsx(ct.Empty,{children:"Nothing found..."})})})]})]})}function gH(e){var t,n;return s.jsxs(Ce,{children:[s.jsx(Ns,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(Ae,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(Ae,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}const vH=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,yH="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",xH="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",bH="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",SH=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,wH="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",jH="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",CH="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",EH="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",TH="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",RH="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function DH(e){const t=De();return s.jsx(mt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(We,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx($a,{size:32}),s.jsx(Ie,{children:"Choose scope"})]}),s.jsx(We,{children:(e.scope??"openid").split(" ").map(n=>{let r;return vH.test(n)?r=[n+yH,n+xH,n+bH]:SH.test(n)&&(r=[n+wH,n+jH,n+CH,n+EH,n+TH,n+RH]),s.jsxs(s.Fragment,{children:[s.jsx(Qn,{id:n,name:n,label:n,defaultChecked:!0},n),r==null?void 0:r.map(a=>s.jsx(Qn,{id:a,name:a,label:a},a))]},n+"_group")})}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Or,{children:"Set scope"})})]})})}function s_(e){const[t,n]=y.useState();return s.jsx(mt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(a=>n(Ke(a)))},children:s.jsxs(We,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx($a,{size:32}),s.jsx(Ie,{children:"Enter MFA code"})]}),t&&s.jsx(Yi,{icon:s.jsx(Js,{size:16}),title:"Error",color:"red",children:t}),s.jsx(We,{children:s.jsx(ze,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Or,{children:"Submit code"})})]})})}function l_(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:a,onRegister:o,onCode:c,...u}=e,f=De(),[p,m]=y.useState(),g=y.useRef(!1),[v,b]=y.useState(!1),[S,j]=y.useState(),C=y.useCallback(E=>{c?c(E):f.processCode(E).then(()=>{r&&r()}).catch(T=>_e({color:"red",message:Ke(T)}))},[f,c,r]),R=y.useCallback(E=>{b(!!E.mfaRequired),E.login&&m(E.login),E.memberships&&j(E.memberships),E.code&&(n?j(void 0):C(E.code))},[n,C]),D=y.useCallback(E=>{C(E.code)},[C]);return y.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(R).catch(E=>_e({color:"red",message:Ke(E)})))},[f,t,g,p,R]),s.jsx(ot,{width:450,px:"sm",py:"md",children:p?v?s.jsx(s_,{onSubmit:async E=>{const T=await f.post("auth/mfa/verify",{login:p,token:E.token});R(T)}}):S?s.jsx(mH,{login:p,memberships:S,handleAuthResponse:R}):e.projectId==="new"?s.jsx(t_,{login:p,handleAuthResponse:R}):e.chooseScopes?s.jsx(DH,{login:p,scope:e.scope,handleAuthResponse:D}):s.jsx("div",{children:"Success"}):s.jsx(fH,{onForgotPassword:a,onRegister:o,handleAuthResponse:R,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function ii(e){return s.jsx(s.Fragment,{children:Bo(e.value)})}function AH(e){return s.jsx(s.Fragment,{children:Rd(e.value)})}function c_(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),s.jsx(s.Fragment,{children:n.join("").trim()})}function _H(e){var n;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>s.jsx(c_,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function Kp(e,t,n){const r=mc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(a=>a.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function kH(e,t,n){const r=aA(e,t,n);return r?Array.isArray(r)?[r.map(a=>a.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function PH(e){const{elementDefinitionType:t}=e,n=De(),r=y.useContext(cn),[a,o]=y.useState(nA("Extension")),c=y.useMemo(()=>{if(En(t==null?void 0:t.profile))return t.profile[0]},[t]),[u,f]=y.useState(c!==void 0);if(y.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=kc(c);f(!1),g&&o(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(u||!B0(c)))return s.jsx("div",{children:"Loading..."});const p=a.elements["value[x]"];if((p==null?void 0:p.max)!==0){const[g,v]=Kp({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return s.jsx(ci,{propertyType:v,value:g})}return s.jsx(Hh,{path:e.path,value:{type:a.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function NH(e){var t,n;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function OH(e){return s.jsx(s.Fragment,{children:G$(e.value)})}function od(e){return s.jsx(s.Fragment,{children:As(e.value)})}function xb(e){return s.jsx(s.Fragment,{children:ad(e.value)})}function MH(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(od,{value:t.numerator})," / ",s.jsx(od,{value:t.denominator})]}):null}function My(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Ia(e.value);return e.link!==!1&&e.value.reference?s.jsx(bt,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function u_(e,t,n,r){if(!En(n==null?void 0:n.slices))return[e];const a=new Array(t.length+1);for(let o=0;o<a.length;o++)a[o]=[];for(const o of e){const c=IA(o,t,n.discriminator,r);let u=c?t.findIndex(f=>f.name===c):-1;u===-1&&(u=t.length),a[u].push(o)}return a}async function d_({medplum:e,property:t}){return new Promise((n,r)=>{var u,f;if(!t.slicing){n([]);return}const a=[],o=[],c=[];for(const p of t.slicing.slices){if(!MA(p)){console.debug("Unsupported slice definition",p);continue}let m;En(p.elements)||(m=(f=(u=p.type[0])==null?void 0:u.profile)==null?void 0:f[0]),a.push(p),o.push(m),m&&c.push(e.requestProfileSchema(m))}Promise.all(c).then(()=>{for(let p=0;p<a.length;p++){const m=a[p],g=o[p];if(g){const v=kc(g);m.typeSchema=v}}n(a)}).catch(r)})}function Xp(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function IH(e){var c,u;const{slice:t,property:n}=e,r=((c=t.typeSchema)==null?void 0:c.elements)??t.elements,a=y.useContext(cn),o=y.useMemo(()=>{var f;if(En(r))return gc({parentContext:a,elements:r,path:e.path,profileUrl:(f=t.typeSchema)==null?void 0:f.url})},[a,e.path,(u=t.typeSchema)==null?void 0:u.url,r]);return Xp(cn.Provider,o,s.jsx(s.Fragment,{children:e.value.map((f,p)=>s.jsx("div",{children:s.jsx(ci,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:f,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${p}-${e.value.length}`))}))}function LH(e){var S;const{property:t,propertyType:n}=e,r=De(),a=y.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[o,c]=y.useState(!0),[u,f]=y.useState([]),[p,m]=y.useState(()=>[a]),g=y.useContext(cn);if(y.useEffect(()=>{d_({medplum:r,property:t}).then(j=>{f(j);const C=u_(a,j,t.slicing,g.profileUrl);m(C),c(!1)}).catch(j=>{console.error(j),c(!1)})},[r,t,g.profileUrl,m,a]),o)return s.jsx("div",{children:"Loading..."});let v;if(((S=t.type[0])==null?void 0:S.code)!=="Extension"){const j=p[u.length],C=j.map((R,D)=>s.jsx("div",{children:s.jsx(ci,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:R,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${D}-${j.length}`));if(e.includeDescriptionListEntry){if(!En(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const R=e.path.split(".").pop();v=s.jsx(Ii,{term:Ls(R),children:C})}else v=s.jsx(s.Fragment,{children:C})}return s.jsxs(s.Fragment,{children:[u.map((j,C)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let R=s.jsx(IH,{path:e.path,slice:j,property:t,value:p[C],ignoreMissingValues:e.ignoreMissingValues,link:e.link},j.name);return e.includeDescriptionListEntry&&(R=s.jsx(Ii,{term:Ls(j.name),children:R},j.name)),R}),v]})}function ci(e){var o;const{property:t,propertyType:n,value:r}=e;if((o=t==null?void 0:t.path)==null?void 0:o.endsWith(".id"))return s.jsxs(ce,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Tn(r)&&s.jsx(rD,{value:r,timeout:2e3,children:({copied:c,copy:u})=>s.jsx(Ys,{label:c?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(_n,{variant:"subtle",color:c?"teal":"gray",onClick:u,children:c?s.jsx(eo,{size:"1rem"}):s.jsx(FA,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===oe.Attachment?s.jsx(aH,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(LH,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case oe.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case oe.SystemString:case oe.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case oe.code:case oe.date:case oe.decimal:case oe.id:case oe.integer:case oe.positiveInt:case oe.unsignedInt:case oe.uri:case oe.url:return s.jsx(s.Fragment,{children:r});case oe.canonical:return s.jsx(My,{value:{reference:r},link:e.link});case oe.dateTime:case oe.instant:return s.jsx(s.Fragment,{children:gr(r)});case oe.markdown:return s.jsx("pre",{children:r});case oe.Address:return s.jsx(uV,{value:r});case oe.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case oe.Attachment:return s.jsx(_d,{value:r,maxWidth:e.maxWidth});case oe.CodeableConcept:return s.jsx(ii,{value:r});case oe.Coding:return s.jsx(AH,{value:r});case oe.ContactDetail:return s.jsx(_H,{value:r});case oe.ContactPoint:return s.jsx(c_,{value:r});case oe.HumanName:return s.jsx(db,{value:r});case oe.Identifier:return s.jsx(NH,{value:r});case oe.Money:return s.jsx(OH,{value:r});case oe.Period:return s.jsx(s.Fragment,{children:B$(r)});case oe.Quantity:case oe.Duration:return s.jsx(od,{value:r});case oe.Range:return s.jsx(xb,{value:r});case oe.Ratio:return s.jsx(MH,{value:r});case oe.Reference:return s.jsx(My,{value:r,link:e.link});case oe.Timing:return s.jsx(s.Fragment,{children:vA(r)});case oe.Dosage:case oe.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Hh,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case oe.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(PH,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Hh,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const f_=["extension","modifierExtension"],zH=BA.filter(e=>!f_.includes(e));function Hh(e){const t=e.value,{value:n,type:r}=t,a=y.useContext(cn),o=e.profileUrl??(a==null?void 0:a.profileUrl),c=y.useMemo(()=>Bp(r,o),[o,r]),u=y.useMemo(()=>{if(c)return gc({parentContext:a,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,a,e.path,e.accessPolicyResource]);if(Tn(n))return null;if(!c)return s.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return s.jsx("div",{children:n.name});const f=u??a;return Xp(cn.Provider,u,s.jsx(gb,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{var j;if(f_.includes(p)&&Tn((j=m.slicing)==null?void 0:j.slices))return null;if(zH.includes(p))return null;if(VA.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,v]=Kp(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Tn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,S=s.jsx(ci,{property:m,propertyType:v,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?S:s.jsx(Ii,{term:Ls(p),children:S},p)})}))}const $H="_dimmed_11me5_1",UH="_preserveBreaks_11me5_5",Iy={dimmed:$H,preserveBreaks:UH},h_="Read Only";function p_(e,t){return e?s.jsx(Ys.Floating,{label:e,children:t}):t}function m_(e){const{debugMode:t}=y.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,p_(e!=null&&e.readonly?h_:void 0,s.jsxs(Ce,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?Iy.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function zt(e){const{debugMode:t}=y.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,p_(e!=null&&e.readonly?h_:void 0,s.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:$t({[Iy.dimmed]:e==null?void 0:e.readonly},Iy.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Nt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function BH(e,t,n,r,a){const o=r.type;if(o.length>1)for(const c of o){const u=t.replace("[x]",Fn(c.code));u in e&&delete e[u]}return Tn(a)?e[n]=void 0:e[n]=a,e}function VH(e){return!!e&&!Tn(e.url)&&!Tn(e.name)}function FH(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:a,path:o,valuePath:c,...u}=e,[f,p]=y.useState(t);function m(g){const v=qH(g);p(v),n&&n(v)}return s.jsx(pb,{defaultValue:f&&HH(f),onChange:m,withHelpText:r??!0,...u})}function HH(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function qH(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function g_(e){var p,m;const{defaultValue:t,onChange:n,withHelpText:r,response:a,...o}=e,[c,u]=y.useState(((m=(p=a==null?void 0:a.answer)==null?void 0:p[0])==null?void 0:m.valueCoding)??t);function f(g){const v=g[0],b=v&&QH(v);u(b),n&&n(b)}return s.jsx(pb,{defaultValue:c?GH(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...o})}function GH(e){return{system:e.system,code:e.code,display:e.display}}function QH(e){return{system:e.system,code:e.code,display:e.display}}function v_(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:a}=y.useContext(cn),[o,c]=y.useState(e.defaultValue),u=y.useRef(o);u.current=o;const[f,p,m]=y.useMemo(()=>["system","use","value"].map(E=>r[t+"."+E]),[r,t]),[g,v,b]=y.useMemo(()=>["system","use","value"].map(E=>a(t+"."+E)),[a,t]);function S(E){E&&Object.keys(E).length===0&&(E=void 0),c(E),e.onChange&&e.onChange(E)}function j(E){const T={...u.current,system:E};E||delete T.system,S(T)}function C(E){const T={...u.current,use:E};E||delete T.use,S(T)}function R(E){const T={...u.current,value:E};E||delete T.value,S(T)}const D=e.valuePath??t;return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ln,{disabled:e.disabled||(g==null?void 0:g.readonly),"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((f==null?void 0:f.min)??0)>0,onChange:E=>j(E.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Nt(n,D+".system")}),s.jsx(ln,{disabled:e.disabled||(v==null?void 0:v.readonly),"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((p==null?void 0:p.min)??0)>0,onChange:E=>C(E.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Nt(n,D+".use")}),s.jsx(ze,{disabled:e.disabled||(b==null?void 0:b.readonly),placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((m==null?void 0:m.min)??0)>0,onChange:E=>R(E.currentTarget.value),error:Nt(n,D+".value")})]})}function WH(e){var m;const[t,n]=y.useState(e.defaultValue),r=y.useRef(t);r.current=t;const{getExtendedProps:a}=y.useContext(cn),[o,c]=y.useMemo(()=>["name","telecom"].map(g=>a(e.path+"."+g)),[a,e.path]);function u(g){n(g),e.onChange&&e.onChange(g)}function f(g){const v={...r.current,name:g};g||delete v.name,u(v)}function p(g){const v={...r.current,telecom:g&&[g]};g||delete v.telecom,u(v)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ze,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:g=>f(g.currentTarget.value)}),s.jsx(v_,{disabled:e.disabled||(c==null?void 0:c.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(m=t==null?void 0:t.telecom)==null?void 0:m[0],onChange:p,outcome:e.outcome})]})}function YH(e){if(!e)return"";const t=new Date(e);return Fp(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function bb(e){if(!e)return"";const t=new Date(e);return Fp(t)?t.toISOString():""}function oi(e){return s.jsx(ze,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e["data-testid"]??e.name,placeholder:e.placeholder,required:e.required,disabled:e.disabled,type:KH(),step:1,defaultValue:YH(e.defaultValue),autoFocus:e.autoFocus,error:Nt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(bb(n))}}})}function KH(){return"datetime-local"}function XH(e){const{propertyType:t}=e,n=De(),r=y.useMemo(()=>{if(En(t.profile))return t.profile[0]},[t]),[a,o]=y.useState(r!==void 0);return y.useEffect(()=>{r&&(o(!0),n.requestProfileSchema(r).then(()=>o(!1)).catch(c=>{o(!1),console.warn(c)}))},[n,r]),r&&(a||!B0(r))?s.jsx("div",{children:"Loading..."}):s.jsx(Cb,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function ZH(e){var D,E,T;const{outcome:t,path:n}=e,[r,a]=y.useState(e.defaultValue),{getExtendedProps:o}=y.useContext(cn),[c,u,f,p,m]=y.useMemo(()=>["use","prefix","given","family","suffix"].map(A=>o(e.path+"."+A)),[o,e.path]);function g(A){a(A),e.onChange&&e.onChange(A)}function v(A){g({...r,use:A||void 0})}function b(A){g({...r,prefix:A?A.split(" "):void 0})}function S(A){g({...r,given:A?A.split(" "):void 0})}function j(A){g({...r,family:A||void 0})}function C(A){g({...r,suffix:A?A.split(" "):void 0})}const R=e.valuePath??n;return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ln,{disabled:e.disabled||(c==null?void 0:c.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:A=>v(A.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Nt(t,R+".use")}),s.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(D=r==null?void 0:r.prefix)==null?void 0:D.join(" "),onChange:A=>b(A.currentTarget.value),error:Nt(t,R+".prefix")}),s.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(E=r==null?void 0:r.given)==null?void 0:E.join(" "),onChange:A=>S(A.currentTarget.value),error:Nt(t,R+".given")}),s.jsx(ze,{disabled:e.disabled||(p==null?void 0:p.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:A=>j(A.currentTarget.value),error:Nt(t,R+".family")}),s.jsx(ze,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(T=r==null?void 0:r.suffix)==null?void 0:T.join(" "),onChange:A=>C(A.currentTarget.value),error:Nt(t,R+".suffix")})]})}function JH(e){const[t,n]=y.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:a}=y.useContext(cn),[o,c]=y.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[u,f]=y.useMemo(()=>["system","value"].map(g=>a(e.path+"."+g)),[a,e.path]);function p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"System",required:((o==null?void 0:o.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:Nt(e.outcome,m+".system")}),s.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Value",required:((c==null?void 0:c.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:g=>p({...t,value:g.currentTarget.value}),error:Nt(e.outcome,m+".value")})]})}const eq=["USD","EUR","CAD","GBP","AUD"];function tq(e){var g;const{onChange:t}=e,[n,r]=y.useState(e.defaultValue),{getExtendedProps:a}=y.useContext(cn),[o,c]=y.useMemo(()=>["currency","value"].map(v=>a(e.path+"."+v)),[a,e.path]),u=y.useCallback(v=>{r(v),t&&t(v)},[t]),f=y.useCallback(v=>{u({...n,currency:v.currentTarget.value})},[n,u]),p=y.useCallback(v=>{u({...n,value:v.currentTarget.valueAsNumber})},[n,u]),m=s.jsx(ln,{disabled:e.disabled||(o==null?void 0:o.readonly),defaultValue:n==null?void 0:n.currency,data:eq,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return s.jsx(ze,{disabled:e.disabled||(c==null?void 0:c.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((g=n==null?void 0:n.value)==null?void 0:g.toString())??"USD",leftSection:s.jsx(_V,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function nq(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o]=y.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(oi,{disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:u=>c({...t,start:u})}),s.jsx(oi,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:u=>c({...t,end:u})})]})}function Us(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o,c]=y.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function u(f){n(f),e.onChange&&e.onChange(f)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ln,{disabled:e.disabled||(a==null?void 0:a.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:f=>u({...t,comparator:f.currentTarget.value})}),s.jsx(ze,{disabled:e.disabled||(o==null?void 0:o.readonly),id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{u({...t,value:rq(f.currentTarget.value)})}}),s.jsx(ze,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:f=>u({...t,unit:f.currentTarget.value})})]})}function rq(e){if(e)return parseFloat(e)}function Sb(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o]=y.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Us,{path:e.path+".low",disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:u=>c({...t,low:u})}),s.jsx(Us,{path:e.path+".high",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:u=>c({...t,high:u})})]})}function aq(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o]=y.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Us,{path:e.path+".numerator",disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:u=>c({...t,numerator:u})}),s.jsx(Us,{path:e.path+".denominator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:u=>c({...t,denominator:u})})]})}const iq={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},oq=["AccessPolicy","Account","ActivityDefinition","Bot","CapabilityStatement","CareTeam","ClientApplication","CodeSystem","CompartmentDefinition","ConceptMap","EffectEvidenceSynthesis","Endpoint","EventDefinition","Evidence","EvidenceVariable","ExampleScenario","GraphDefinition","Group","HealthcareService","ImplementationGuide","InsurancePlan","Library","Location","Measure","MedicinalProduct","MessageDefinition","NamingSystem","OperationDefinition","Organization","Patient","Person","PlanDefinition","Practitioner","Project","Questionnaire","RelatedPerson","ResearchDefinition","ResearchElementDefinition","ResearchStudy","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function sq(e){return{value:Lt(e)??"",label:Bi(e),resource:e}}function el(e){const t=De(),{resourceType:n,searchCriteria:r}=e,[a,o]=y.useState(),c=Yt(e.defaultValue,o),u=e.itemComponent??lq,f=e.onChange,p=y.useCallback(async(g,v)=>{const b=cq(n),S=new URLSearchParams({[b]:g??"",_count:"10",...r});return await t.searchResources(n,S,{signal:v})},[t,n,r]),m=y.useCallback(g=>{f&&f(g[0])},[f]);return En(e.defaultValue)&&!a&&!c?null:s.jsx(fb,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:u,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:sq,loadOptions:p,onChange:m,clearable:!0})}const lq=y.forwardRef(({label:e,resource:t,active:n,...r},a)=>s.jsx("div",{ref:a,...r,children:s.jsxs(Ce,{wrap:"nowrap",children:[s.jsx(Wo,{value:t}),s.jsxs("div",{children:[s.jsx(Ae,{children:e}),s.jsx(Ae,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function cq(e){return iq[e]??(oq.includes(e)?"name":"_id")}function Nd(e){const{onChange:t}=e,n=De(),[r,a]=y.useState(e.defaultValue),[o,c]=y.useState(()=>uq(e.targetTypes)),[u,f]=y.useState(()=>dq(e.defaultValue,o)),p=y.useRef(new QD),m=y.useMemo(()=>(u==null?void 0:u.type)==="profile"?{...e.searchCriteria,_profile:u.value}:e.searchCriteria,[e.searchCriteria,u]);y.useEffect(()=>{let b=!1;const S=o==null?void 0:o.map(j=>{if(!hq(j))return Promise.resolve(j);b=!0;const C=j.value,R=p.current.get(C);if(R)return R;const D=fq(n,j.value).then(T=>{const A={...j};return T?En(T.type)?(A.resourceType=T.type,A.name=T.name,A.title=T.title):(console.error(`StructureDefinition.type missing for ${j.value}`),A.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),A.error="StructureDefinition not found"),A}).catch(T=>(console.error(T),{...j,error:T})),E=new _a(D);return p.current.set(C,E),E});!S||!b||Promise.all(S).then(j=>{if(c(j),!u)return;const C=j.findIndex(R=>R.value===u.value||R.resourceType===u.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${u.resourceType}`);return}f(j[C])}).catch(console.error)},[n,u,o]);const g=y.useCallback(b=>{const S=b?fn(b):void 0;a(S),t&&t(S)},[t]),v=y.useMemo(()=>o?o.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[o]);return s.jsxs(s.Fragment,{children:[e.name&&s.jsx("input",{type:"hidden",name:e.name,value:(r==null?void 0:r.reference)??""}),s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[o&&o.length>1&&s.jsx(ln,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:u==null?void 0:u.resourceType,autoFocus:e.autoFocus,onChange:b=>{const S=b.currentTarget.value,j=o.find(C=>C.value===S);f(j)},data:v}),!o&&s.jsx(mb,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:u==null?void 0:u.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(el,{resourceType:u==null?void 0:u.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function uq(e){if(!e||e.length===0||e.length===1&&e[0]==="Resource")return;const t=[];for(const n of e)n.includes("/")?t.push({type:"profile",value:n}):t.push({type:"resourceType",value:n,resourceType:n});return t}function dq(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const a=t==null?void 0:t.find(o=>o.resourceType===n);return a||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function fq(e,t){const n=kc(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
526
- StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
527
- type,
528
- name,
529
- title,
530
- }
531
- }`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function hq(e){return e.type==="profile"&&!(e!=null&&e.error)&&Tn(e.resourceType)}function pq(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const mq="_indented_ldk1d_1",y_={indented:mq};function wb({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(Pe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(Fh,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(_n,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(Fh,{size:"1.25rem"})})}function x_({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(_n,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(Vh,{size:"1.25rem"})})}function gq(e){var b,S;const{slice:t,property:n}=e,[r,a]=y.useState(e.defaultValue),o=((b=t.typeSchema)==null?void 0:b.elements)??t.elements,c=y.useContext(cn),u=y.useMemo(()=>{var j;if(En(o))return gc({parentContext:c,elements:o,path:e.path,profileUrl:(j=t.typeSchema)==null?void 0:j.url})},[c,e.path,(S=t.typeSchema)==null?void 0:S.url,o]);function f(j){a(j),e.onChange&&e.onChange(j)}const p=t.min>0,m=Tn(t.elements),g=bA(t.name),v=e.property.readonly&&r.length===0;return Xp(cn.Provider,u,s.jsx(zt,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:v?s.jsx(Ae,{c:"dimmed",children:"(empty)"}):s.jsxs(We,{className:m?y_.indented:void 0,children:[r.map((j,C)=>s.jsxs(Ce,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${C}`,children:s.jsx(jb,{elementDefinitionType:t.type[0],name:t.name,defaultValue:j,onChange:R=>{const D=[...r];D[C]=R,f(D)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0,readOnly:e.property.readonly})}),!e.property.readonly&&r.length>t.min&&s.jsx(x_,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${C}`,onClick:R=>{hn(R);const D=[...r];D.splice(C,1),f(D)}})]},`${C}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(Ce,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(wb,{propertyDisplayName:g,onClick:j=>{hn(j);const C=[...r,void 0];f(C)},testId:e.testId&&`${e.testId}-add`})})]})}))}function vq(e){var D;const{property:t}=e,n=De(),[r,a]=y.useState(!0),[o,c]=y.useState([]),[u]=y.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=y.useState(()=>[u]),m=y.useContext(cn),g=(D=t.type[0])==null?void 0:D.code;y.useEffect(()=>{d_({medplum:n,property:t}).then(E=>{c(E);const T=u_(u,E,t.slicing,m.profileUrl);yq(T,E),p(T),a(!1)}).catch(E=>{console.error(E),a(!1)})},[n,t,u,m.profileUrl,p]);function v(E,T){const A=[...f];if(A[T]=E,p(A),e.onChange){const _=A.flat().filter(M=>M!==void 0);e.onChange(_)}}if(r)return s.jsx("div",{children:"Loading..."});const b=o.length,S=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&o.length>0)),C=Ls(t.path),R=e.property.readonly&&o.length===0&&u.length===0;return s.jsxs(We,{className:e.indent?y_.indented:void 0,children:[R&&s.jsx(Ae,{c:"dimmed",children:"(empty)"}),o.map((E,T)=>s.jsx(gq,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[T],onChange:A=>{v(A,T)},testId:`slice-${E.name}`},E.name)),j&&S.map((E,T)=>s.jsxs(Ce,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(Od,{arrayElement:!0,property:e.property,name:e.name+"."+T,path:e.path,valuePath:pq(e.path,e.valuePath,T),defaultValue:E,onChange:A=>{const _=[...S];_[T]=A,v(_,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(x_,{propertyDisplayName:C,testId:`nonsliced-remove-${T}`,onClick:A=>{hn(A);const _=[...S];_.splice(T,1),v(_,b)}})]},`${T}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&s.jsx(Ce,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(wb,{propertyDisplayName:C,onClick:E=>{hn(E);const T=[...S];T.push(void 0),v(T,b)},testId:"nonsliced-add"})})]})}function yq(e,t){for(let n=0;n<t.length;n++){const r=t[n],a=e[n];for(;a.length<r.min;)a.push(void 0)}}function xq(e){const[t,n]=y.useState(!1),r=rR(),a=y.useRef(null),o={...e.styles};return t||(o.input||(o.input={}),o.input.WebkitTextSecurity="disc"),s.jsxs($o,{gap:"xs",children:[s.jsx(Ws,{...e,styles:{...o,root:{...o.root??{},flexGrow:1}},ref:a,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(_n,{title:"Copy secret",onClick:()=>{var c;r.copy((c=a.current)==null?void 0:c.value),_e({color:"green",message:"Copied"})},children:s.jsx(FA,{})})]})}const bq=["sun","mon","tue","wed","thu","fri","sat"];function Sq(e){const[t,n]=y.useState(e.defaultValue),[r,a]=y.useState(!e.disabled&&(e.defaultModalOpen??!1)),o=y.useRef(t);return o.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:vA(o.current)||"No repeat"}),s.jsx(Pe,{disabled:e.disabled,onClick:()=>a(!0),children:"Edit"})]}),!e.disabled&&s.jsx(wq,{path:e.path,visible:r,defaultValue:o.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),a(!1)},onCancel:()=>a(!1)})]})}const ME={repeat:{period:1,periodUnit:"d"}};function wq(e){const[t,n]=y.useState(e.defaultValue||ME),{getExtendedProps:r}=y.useContext(cn),[a,o,c,u,f]=y.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(j=>r(e.path+"."+j)),[r,e.path]),p=y.useRef(t);p.current=t;function m(j){n({...p.current,event:[j]})}function g(j){n({...p.current,repeat:j})}function v(j){var C;g({...(C=p.current)==null?void 0:C.repeat,period:j})}function b(j){var C;g({...(C=p.current)==null?void 0:C.repeat,periodUnit:j})}function S(j){var C;g({...(C=p.current)==null?void 0:C.repeat,dayOfWeek:j})}return s.jsx(Un,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(We,{children:[s.jsx(zt,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(oi,{disabled:a==null?void 0:a.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),s.jsx(wd,{disabled:o==null?void 0:o.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?ME.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(zt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ze,{disabled:c==null?void 0:c.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:j=>v(parseInt(j.currentTarget.value,10)||1)}),s.jsx(ln,{disabled:u==null?void 0:u.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:j=>b(j.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&s.jsx(zt,{title:"Repeat on",children:s.jsx(Zu.Group,{multiple:!0,onChange:S,children:s.jsx(Ce,{justify:"space-between",mt:"md",gap:"xs",children:bq.map(j=>s.jsx(Zu,{value:j,size:"xs",radius:"xl",disabled:f==null?void 0:f.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Od(e){var u;const{property:t,name:n,onChange:r,defaultValue:a}=e,o=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(o===oe.Attachment)return s.jsx(iH,{name:n,defaultValue:a,onChange:r,disabled:t.readonly});const f=((u=c[0])==null?void 0:u.code)!==oe.Extension;return s.jsx(vq,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:a,indent:f,onChange:r,outcome:e.outcome})}else return c.length>1?s.jsx(jq,{elementDefinitionTypes:c,...e}):s.jsx(jb,{name:n,defaultValue:a,onChange:f=>{if(e.onChange){const p=e.name.replace("[x]",Fn(c[0].code));e.onChange(f,p)}},outcome:e.outcome,elementDefinitionType:c[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function jq(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(o=>o.code===e.defaultPropertyType)),n||(n=t[0]);const[r,a]=y.useState(n);return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ln,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:o=>{a(t.find(c=>c.code===o.currentTarget.value))},data:t.map(o=>({value:o.code,label:o.code}))}),s.jsx(jb,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:o=>{e.onChange&&e.onChange(o,e.name.replace("[x]",Fn(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath,readOnly:e.property.readonly})]})}function jb(e){const{name:t,onChange:n,outcome:r,binding:a,path:o,valuePath:c,readOnly:u}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=y.useContext(cn),g=y.useMemo(()=>{if(!q0(p)||!Tn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)bE(S,m.elements);else{const j=Ds(m.path,e.path);if(j===void 0)return e.defaultValue;bE(S,m.elements,j)}return En(S)?S:e.defaultValue},[p,m.path,m.elements,e.path,e.defaultValue]);if(!p)return s.jsx("div",{children:"Property type not specified "});function v(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:o,valuePath:c,disabled:u}}function b(){const S=Nt(e.outcome,c??o);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:u}}switch(p){case oe.SystemString:case oe.canonical:case oe.string:case oe.time:case oe.uri:case oe.url:return e.path==="Project.secret.value[x]"?s.jsx(xq,{...b(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):s.jsx(ze,{...b(),onChange:S=>{n&&n(S.currentTarget.value)}});case oe.date:return s.jsx(ze,{...b(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case oe.dateTime:case oe.instant:return s.jsx(oi,{...b(),onChange:n,outcome:r});case oe.decimal:case oe.integer:case oe.positiveInt:case oe.unsignedInt:return s.jsx(ze,{...b(),type:"number",step:p===oe.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case oe.code:return s.jsx(ZA,{...b(),error:void 0,onChange:n,binding:a==null?void 0:a.valueSet,creatable:!0,maxValues:1});case oe.boolean:return s.jsx(Qn,{...b(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case oe.base64Binary:case oe.markdown:return s.jsx(Ws,{...b(),spellCheck:p!==oe.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case oe.Address:return s.jsx(hV,{...v()});case oe.Annotation:return s.jsx(pV,{...v()});case oe.Attachment:return s.jsx(JA,{...v()});case oe.CodeableConcept:return s.jsx(FH,{binding:a==null?void 0:a.valueSet,...v()});case oe.Coding:return s.jsx(g_,{binding:a==null?void 0:a.valueSet,...v()});case oe.ContactDetail:return s.jsx(WH,{...v()});case oe.ContactPoint:return s.jsx(v_,{...v()});case oe.Extension:return s.jsx(XH,{...v(),propertyType:e.elementDefinitionType});case oe.HumanName:return s.jsx(ZH,{...v()});case oe.Identifier:return s.jsx(JH,{...v()});case oe.Money:return s.jsx(tq,{...v()});case oe.Period:return s.jsx(nq,{...v()});case oe.Duration:case oe.Quantity:return s.jsx(Us,{...v()});case oe.Range:return s.jsx(Sb,{...v()});case oe.Ratio:return s.jsx(aq,{...v()});case oe.Reference:return s.jsx(Nd,{...v(),targetTypes:Eq(e.elementDefinitionType)});case oe.Timing:return s.jsx(Sq,{...v()});case oe.Dosage:case oe.UsageContext:default:return s.jsx(Cb,{...v(),typeName:p})}}const Cq=[`${_c}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function Eq(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=Cq.find(a=>n.startsWith(a));return r?n.slice(r.length):n})}function Tq(e){const[t,n]=y.useState(e.defaultValue??{}),r=y.useContext(cn),a=y.useMemo(()=>fV(r.elements),[r.elements]);function o(u){n(u),e.onChange&&e.onChange(u)}const c={type:e.type,value:t};return s.jsx(We,{style:{flexGrow:1},"data-testid":e.testId,children:a.map(([u,f])=>{const[p,m]=kH(c,u,f),g=f.min!==void 0&&f.min>0,v=e.valuePath?e.valuePath+"."+u:void 0,b=s.jsx(Od,{property:f,name:u,path:e.path+"."+u,valuePath:v,defaultValue:p,defaultPropertyType:m,onChange:(S,j)=>{o(BH({...t},u,j??u,f,S))},outcome:e.outcome},u);return e.type==="Extension"||ib.includes(u)?b:f.type.length===1&&f.type[0].code==="boolean"?s.jsx(m_,{title:Ls(u),description:f.description,htmlFor:u,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},u):s.jsx(zt,{title:Ls(u),description:f.description,withAsterisk:g,htmlFor:u,outcome:e.outcome,fhirPath:f.path,errorExpression:v,readonly:f.readonly,children:b},u)})})}function Cb(e){const[t]=y.useState(()=>e.defaultValue??{}),n=y.useContext(cn),r=e.profileUrl??(n==null?void 0:n.profileUrl),a=y.useMemo(()=>Bp(e.typeName,r),[e.typeName,r]),o=(a==null?void 0:a.type)??e.typeName,c=y.useMemo(()=>{if(a)return gc({parentContext:n,elements:a.elements,path:e.path,profileUrl:a.url,accessPolicyResource:e.accessPolicyResource})},[a,n,e.path,e.accessPolicyResource]);return a?Xp(cn.Provider,c,s.jsx(Tq,{path:e.path,valuePath:e.valuePath,type:o,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[o," not implemented"]})}const Rq="_noteCite_10swh_5",Dq="_noteRoot_10swh_10",IE={noteCite:Rq,noteRoot:Dq};function b_({value:e}){return e?s.jsx(We,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(e0,{classNames:{cite:IE.noteCite,root:IE.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Mc(e){const{value:t,link:n,...r}=e,[a,o]=y.useState(),c=Yt(t,o);let u;if(a&&!KD(a))u=`[${Ke(a)}]`;else if(c)u=Bi(c);else return null;return n?s.jsx(bt,{to:t,...r,children:u}):s.jsx(Ae,{component:"span",...r,children:u})}function ic(e){return s.jsxs(Ce,{gap:"xs",children:[s.jsx(Wo,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Mc,{value:e.value,link:e.link})]})}const Aq={draft:"blue",active:"blue","on-hold":"yellow",revoked:"red",completed:"green","entered-in-error":"red",unknown:"gray",retired:"gray",registered:"blue",preliminary:"blue",final:"green",amended:"yellow",corrected:"yellow",cancelled:"red",requested:"blue",received:"blue",accepted:"blue",rejected:"red",ready:"blue","in-progress":"blue",failed:"red",proposed:"blue",pending:"blue",booked:"blue",arrived:"blue",fulfilled:"green",noshow:"red","checked-in":"blue",waitlist:"gray",routine:"gray",urgent:"red",asap:"red",stat:"red","not-done":"red",connected:"green",disconnected:"red",finished:"green",planned:"gray"};function Eb(e){return s.jsx(Sp,{color:Aq[e.status],children:e.status.replace(/-/g," ")})}const _q="_table_pe9td_1",kq="_criticalRow_pe9td_12",S_={table:_q,criticalRow:kq};Tb.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Tb(e){var c;const t=De(),n=Yt(e.value),[r,a]=y.useState();if(y.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(u=>t.readReference(u))).then(u=>u.filter(f=>f.status==="fulfilled").map(f=>f.value)).then(a).catch(console.error)},[t,n]),!n)return null;const o=(r==null?void 0:r.flatMap(u=>u.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const u=n.presentedForm[0];(c=u.contentType)!=null&&c.startsWith("text/plain")&&u.data&&o.push({text:window.atob(u.data)})}return s.jsxs(We,{children:[s.jsx(Ie,{children:"Diagnostic Report"}),s.jsx(Pq,{value:n}),r&&!e.hideSpecimenInfo&&Nq(r),n.result&&s.jsx(Oq,{hideObservationNotes:e.hideObservationNotes,value:n.result}),o.length>0&&s.jsx(b_,{value:o})]})}function Pq({value:e}){var t,n;return s.jsxs(Ce,{mt:"md",gap:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(ic,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>s.jsxs("div",{children:[s.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(ic,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>s.jsxs("div",{children:[s.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(ic,{value:r,link:!0})]},r.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(Ae,{children:gr(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(Ae,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(Ae,{children:Fn(e.status)})]})]})}function Nq(e){return s.jsxs(We,{gap:"xs",children:[s.jsx(Ie,{order:2,size:"h6",children:"Specimens"}),s.jsx(pr,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(pr.Item,{ml:"sm",children:s.jsxs(Ce,{gap:20,children:[s.jsxs(Ce,{gap:5,children:[s.jsx(Ae,{fw:500,children:"Collected:"})," ",gr((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(Ce,{gap:5,children:[s.jsx(Ae,{fw:500,children:"Received:"})," ",gr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function Oq(e){return s.jsxs("table",{className:S_.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(w_,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function w_(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(Mq,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Qo(n)?n.reference:n.id}`))})}function Mq(e){var a,o;const t=Yt(e.value);if(!t||(a=e.ancestorIds)!=null&&a.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=zq(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:$t({[S_.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(bt,{to:t,children:s.jsx(ii,{value:t.code})})}),s.jsx("td",{children:s.jsx(Iq,{value:t})}),s.jsx("td",{children:s.jsx(Lq,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(ii,{value:t.interpretation[0]})}),s.jsx("td",{children:t.category&&t.category.length>0&&s.jsx(s.Fragment,{children:t.category.map(c=>s.jsx("div",{children:s.jsx(ii,{value:c})},`category-${Bo(c)}`))})}),s.jsx("td",{children:(o=t.performer)==null?void 0:o.map(c=>s.jsx(My,{value:c},c.reference))}),s.jsx("td",{children:t.status&&s.jsx(Eb,{status:t.status})})]}),t.hasMember&&s.jsx(w_,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(b_,{value:t.note})})})]})}function Iq(e){const t=e.value;return s.jsx(s.Fragment,{children:yA(t)})}function Lq(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(xb,{value:t}):null}function zq(e){var n,r,a,o;const t=(o=(a=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:a[0])==null?void 0:o.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var Uv={},Pi={},LE;function j_(){if(LE)return Pi;LE=1,Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.Pointer=Pi.escapeToken=Pi.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}Pi.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}Pi.escapeToken=t;var n=function(){function r(a){a===void 0&&(a=[""]),this.tokens=a}return r.fromJSON=function(a){var o=a.split("/").map(e);if(o[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(a));return new r(o)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(a){for(var o=null,c="",u=a,f=1,p=this.tokens.length;f<p;f++)o=u,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(u=(o||{})[c]);return{parent:o,key:c,value:u}},r.prototype.get=function(a){return this.evaluate(a).value},r.prototype.set=function(a,o){var c=this.evaluate(a);c.parent&&(c.parent[c.key]=o)},r.prototype.push=function(a){this.tokens.push(a)},r.prototype.add=function(a){var o=this.tokens.concat(String(a));return new r(o)},r}();return Pi.Pointer=n,Pi}var gn={},Bv={},zE;function C_(){return zE||(zE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(a){return a===void 0?"undefined":a===null?"null":Array.isArray(a)?"array":typeof a}e.objectType=t;function n(a){return a!=null&&typeof a=="object"}function r(a){if(!n(a))return a;if(a.constructor==Array){for(var o=a.length,c=new Array(o),u=0;u<o;u++)c[u]=r(a[u]);return c}if(a.constructor==Date){var f=new Date(+a);return f}var p={};for(var m in a)e.hasOwnProperty.call(a,m)&&(p[m]=r(a[m]));return p}e.clone=r}(Bv)),Bv}var fr={},$E;function E_(){if($E)return fr;$E=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.diffAny=fr.diffObjects=fr.diffArrays=fr.intersection=fr.subtract=fr.isDestructive=void 0;var e=C_();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}fr.isDestructive=t;function n(m,g){var v={};for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&(v[b]=1);for(var S in g)e.hasOwnProperty.call(g,S)&&g[S]!==void 0&&delete v[S];return Object.keys(v)}fr.subtract=n;function r(m){for(var g=m.length,v={},b=0;b<g;b++){var S=m[b];for(var j in S)e.hasOwnProperty.call(S,j)&&S[j]!==void 0&&(v[j]=(v[j]||0)+1)}for(var j in v)v[j]<g&&delete v[j];return Object.keys(v)}fr.intersection=r;function a(m){return m.op==="add"}function o(m){return m.op==="remove"}function c(m,g){return{operations:m.operations.concat(g),cost:m.cost+1}}function u(m,g,v,b){b===void 0&&(b=p);var S={"0,0":{operations:[],cost:0}};function j(T,A){var _="".concat(T,",").concat(A),M=S[_];if(M===void 0){if(T>0&&A>0&&!b(m[T-1],g[A-1],v.add(String(T-1))).length)M=j(T-1,A-1);else{var L=[];if(T>0){var $=j(T-1,A),V={op:"remove",index:T-1};L.push(c($,V))}if(A>0){var Y=j(T,A-1),W={op:"add",index:T-1,value:g[A-1]};L.push(c(Y,W))}if(T>0&&A>0){var G=j(T-1,A-1),X={op:"replace",index:T-1,original:m[T-1],value:g[A-1]};L.push(c(G,X))}var Z=L.sort(function(P,I){return P.cost-I.cost})[0];M=Z}S[_]=M}return M}var C=isNaN(m.length)||m.length<=0?0:m.length,R=isNaN(g.length)||g.length<=0?0:g.length,D=j(C,R).operations,E=D.reduce(function(T,A){var _=T[0],M=T[1];if(a(A)){var L=A.index+1+M,$=L<C+M?String(L):"-",V={op:A.op,path:v.add($).toString(),value:A.value};return[_.concat(V),M+1]}else if(o(A)){var V={op:A.op,path:v.add(String(A.index+M)).toString()};return[_.concat(V),M-1]}else{var Y=v.add(String(A.index+M)),W=b(A.original,A.value,Y);return[_.concat.apply(_,W),M]}},[[],0])[0];return E}fr.diffArrays=u;function f(m,g,v,b){b===void 0&&(b=p);var S=[];return n(m,g).forEach(function(j){S.push({op:"remove",path:v.add(j).toString()})}),n(g,m).forEach(function(j){S.push({op:"add",path:v.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){S.push.apply(S,b(m[j],g[j],v.add(j)))}),S}fr.diffObjects=f;function p(m,g,v,b){if(b===void 0&&(b=p),m===g)return[];var S=(0,e.objectType)(m),j=(0,e.objectType)(g);return S=="array"&&j=="array"?u(m,g,v,b):S=="object"&&j=="object"?f(m,g,v,b):[{op:"replace",path:v.toString(),value:g}]}return fr.diffAny=p,fr}var UE;function $q(){if(UE)return gn;UE=1;var e=gn&&gn.__extends||function(){var C=function(R,D){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var A in T)Object.prototype.hasOwnProperty.call(T,A)&&(E[A]=T[A])},C(R,D)};return function(R,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");C(R,D);function E(){this.constructor=R}R.prototype=D===null?Object.create(D):(E.prototype=D.prototype,new E)}}();Object.defineProperty(gn,"__esModule",{value:!0}),gn.apply=gn.InvalidOperationError=gn.test=gn.copy=gn.move=gn.replace=gn.remove=gn.add=gn.TestError=gn.MissingError=void 0;var t=j_(),n=C_(),r=E_(),a=function(C){e(R,C);function R(D){var E=C.call(this,"Value required at path: ".concat(D))||this;return E.path=D,E.name="MissingError",E}return R}(Error);gn.MissingError=a;var o=function(C){e(R,C);function R(D,E){var T=C.call(this,"Test failed: ".concat(D," != ").concat(E))||this;return T.actual=D,T.expected=E,T.name="TestError",T}return R}(Error);gn.TestError=o;function c(C,R,D){if(Array.isArray(C))if(R=="-")C.push(D);else{var E=parseInt(R,10);C.splice(E,0,D)}else C[R]=D}function u(C,R){if(Array.isArray(C)){var D=parseInt(R,10);C.splice(D,1)}else delete C[R]}function f(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);return D.parent===void 0?new a(R.path):(c(D.parent,D.key,(0,n.clone)(R.value)),null)}gn.add=f;function p(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);return D.value===void 0?new a(R.path):(u(D.parent,D.key),null)}gn.remove=p;function m(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);if(D.parent===null)return new a(R.path);if(Array.isArray(D.parent)){if(parseInt(D.key,10)>=D.parent.length)return new a(R.path)}else if(D.value===void 0)return new a(R.path);return D.parent[D.key]=(0,n.clone)(R.value),null}gn.replace=m;function g(C,R){var D=t.Pointer.fromJSON(R.from).evaluate(C);if(D.value===void 0)return new a(R.from);var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.parent===void 0?new a(R.path):(u(D.parent,D.key),c(E.parent,E.key,D.value),null)}gn.move=g;function v(C,R){var D=t.Pointer.fromJSON(R.from).evaluate(C);if(D.value===void 0)return new a(R.from);var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.parent===void 0?new a(R.path):(c(E.parent,E.key,(0,n.clone)(D.value)),null)}gn.copy=v;function b(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);return(0,r.diffAny)(D.value,R.value,new t.Pointer).length?new o(D.value,R.value):null}gn.test=b;var S=function(C){e(R,C);function R(D){var E=C.call(this,"Invalid operation: ".concat(D.op))||this;return E.operation=D,E.name="InvalidOperationError",E}return R}(Error);gn.InvalidOperationError=S;function j(C,R){switch(R.op){case"add":return f(C,R);case"remove":return p(C,R);case"replace":return m(C,R);case"move":return g(C,R);case"copy":return v(C,R);case"test":return b(C,R)}return new S(R)}return gn.apply=j,gn}var BE;function Uq(){return BE||(BE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=j_();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=$q(),r=E_();function a(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=a;function o(p){function m(g,v,b){var S=p(g,v,b);return Array.isArray(S)?S:(0,r.diffAny)(g,v,b,m)}return m}function c(p,m,g){var v=new t.Pointer;return(g?o(g):r.diffAny)(p,m,v)}e.createPatch=c;function u(p,m){var g=t.Pointer.fromJSON(m).evaluate(p);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(p,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(v){var b=u(p,v.path);if(b&&g.push(b),"from"in v){var S=u(p,v.from);S&&g.push(S)}}),g}e.createTests=f}(Uv)),Uv}var T_=Uq();const Bq="_removed_el5zk_1",Vq="_added_el5zk_6",VE={removed:Bq,added:Vq};function Fq(e){var m;const{name:t,path:n,property:r,originalValue:a,revisedValue:o}=e,c=!!((m=r==null?void 0:r.type)!=null&&m.find(g=>g.code==="Attachment")),[u,f]=y.useState(c),p=()=>f(g=>!g);return s.jsx(s.Fragment,{children:c&&!u||!c?s.jsx(s.Fragment,{children:s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:t}),s.jsx(Oe.Td,{className:VE.removed,children:a&&s.jsx(ci,{path:n,property:r,propertyType:a.type,value:a.value,ignoreMissingValues:!0})}),s.jsx(Oe.Td,{className:VE.added,children:o&&s.jsx(ci,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})})]})}):s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:t}),s.jsx(Oe.Td,{colSpan:2,style:{textAlign:"right"},children:s.jsx(Pe,{onClick:p,variant:"light",children:"Expand"})})]})})}const Hq="_root_15xvr_1",qq={root:Hq};function Gq(e){const t=De(),{original:n,revised:r}=e,[a,o]=y.useState(!1);y.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[t,e.original.resourceType]);const c=y.useMemo(()=>{if(!a)return null;const u=[ha(n)],f=[ha(r)],p=[],m=Qq(T_.createPatch(n,r));for(const g of m){const v=g.path,b=Wq(v),S=Yq(n.resourceType,b),j=g.op==="add"?void 0:zs(b,u),C=g.op==="remove"?void 0:zs(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${Fn(g.op)} ${b}`,path:(S==null?void 0:S.path)??n.resourceType+"."+b,property:S,originalValue:FE(S,j),revisedValue:FE(S,C)})}return p},[a,n,r]);return c?s.jsxs(Oe,{className:qq.root,children:[s.jsx(Oe.Thead,{children:s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Th,{}),s.jsx(Oe.Th,{children:"Before"}),s.jsx(Oe.Th,{children:"After"})]})}),s.jsx(Oe.Tbody,{children:c.map(u=>{const{key:f,...p}=u;return s.jsx(Fq,{...p},f)})})]}):null}function Qq(e){const t=[];for(const n of e){const{op:r,path:a}=n;if(a.startsWith("/meta/author")||a.startsWith("/meta/compartment")||a.startsWith("/meta/lastUpdated")||a.startsWith("/meta/versionId"))continue;const o=e.filter(u=>u.op===r&&u.path===a).length,c={op:r,path:a};o>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(a)&&(c.op="replace",c.path=a.replace(/\/[^/]+$/,"")),t.some(u=>u.op===c.op&&u.path===c.path)||t.push(c)}return t}function Wq(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const a=t[r];a==="-"?n+=".last()":/^\d+$/.test(a)?n+=`[${a}]`:(r>0&&(n+="."),n+=a)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function Yq(e,t){var r;const n=Oc(e,{code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function FE(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:Kq(t,!!(e!=null&&e.isArray))}}function Kq(e,t){const n=N$(e).flatMap(r=>r.value);return t?n:n[0]}function Rb(e){const{profileUrl:t}=e,n=De(),r=n.getAccessPolicy(),a=Yt(e.value),[o,c]=y.useState(!1);y.useEffect(()=>{if(a)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{kc(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=a.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,a]);const u=y.useMemo(()=>a&&TA(a,ec.READ,r),[r,a]);return!o||!a?null:s.jsx(Hh,{path:a.resourceType,value:{type:a.resourceType,value:e.forceUseInput?e.value:a},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const Xq="_item_5q6yx_1",Zq="_itemPadding_5q6yx_5",HE={item:Xq,itemPadding:Zq};function Jq(e){return s.jsx(kd,{children:e.children})}function Bs(e){var f,p;const{resource:t,profile:n,padding:r,popupMenuItems:a,...o}=e,c=n??((f=t.meta)==null?void 0:f.author),u=e.dateTime??((p=t.meta)==null?void 0:p.lastUpdated);return s.jsxs(yb,{"data-testid":"timeline-item",fill:!0,...o,children:[s.jsxs(Ce,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Wo,{value:c,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Ae,{size:"sm",children:s.jsx(Mc,{c:"dark",fw:500,value:c,link:!0})}),s.jsxs(Ae,{size:"xs",children:[s.jsx(bt,{c:"dimmed",to:e.resource,children:gr(u)}),s.jsx(Ae,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(bt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),a&&s.jsxs(je,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(je.Target,{children:s.jsx(_n,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Lt(e.resource)}`,children:s.jsx(PV,{})})}),a]})]}),s.jsx(QA,{children:s.jsx("div",{className:$t(HE.item,{[HE.itemPadding]:r}),children:e.children})})]})}function R_(e,t){e.sort((n,r)=>{const a=qE(n,t),o=qE(r,t);return a>o?1:a<o?-1:GE(n,t)-GE(r,t)})}function qE(e,t){if(!D_(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function GE(e,t){var r;if(!D_(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const n=(r=e.meta)==null?void 0:r.lastUpdated;return n?new Date(n).getTime():0}function D_(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const eG="_pinnedComment_u08s5_1",tG={pinnedComment:eG};function Zp(e){const t=De(),n=t.getProfile(),r=y.useRef(null),a=Yt(e.value),[o,c]=y.useState(),[u,f]=y.useState([]),p=e.loadTimelineResources,m=y.useRef(u);m.current=u;const g=y.useCallback(T=>{R_(T,a),T.reverse(),f(T)},[a]),v=y.useCallback(T=>{const A=[];for(const _ of T){if(_.status!=="fulfilled")continue;const M=_.value;if(M.type==="history"&&c(M),M.entry)for(const L of M.entry)A.push(L.resource)}g(A)},[g]),b=y.useCallback(T=>g([...m.current,T]),[g]),S=y.useCallback(()=>{var _;let T,A;"resourceType"in e.value?(T=e.value.resourceType,A=e.value.id):[T,A]=(_=e.value.reference)==null?void 0:_.split("/"),p(t,T,A).then(v).catch(console.error)},[t,e.value,p,v]);y.useEffect(()=>S(),[S]);function j(T){!a||!e.createCommunication||t.createResource(e.createCommunication(a,n,T)).then(A=>b(A)).catch(console.error)}function C(T){!a||!e.createMedia||t.createResource(e.createMedia(a,n,T)).then(A=>b(A)).then(()=>Ts({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(eo,{size:16}),autoClose:2e3})).catch(A=>Ts({id:"upload-notification",color:"red",title:"Upload error",message:Ke(A),icon:s.jsx(TE,{size:16}),autoClose:2e3}))}function R(){_e({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function D(T){Ts({id:"upload-notification",loading:!0,title:"Uploading...",message:lG(T),autoClose:!1,withCloseButton:!1})}function E(T){Ts({id:"upload-notification",color:"red",title:"Upload error",message:Ke(T),icon:s.jsx(TE,{size:16}),autoClose:2e3})}return a?s.jsxs(Jq,{children:[e.createCommunication&&s.jsx(yb,{children:s.jsx(mt,{testid:"timeline-form",onSubmit:T=>{j(T.text);const A=r.current;A&&(A.value="",A.focus())},children:s.jsxs(Ce,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Wo,{value:n}),s.jsx(ze,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(_n,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(UV,{size:16})}),s.jsx(vb,{securityContext:fn(a),onUpload:C,onUploadStart:R,onUploadProgress:D,onUploadError:E,children:T=>s.jsx(_n,{...T,radius:"xl",color:"blue",variant:"filled",children:s.jsx(sb,{size:16})})})]})})}),u.map(T=>{var M;if(!T)return null;const A=`${T.resourceType}/${T.id}/${(M=T.meta)==null?void 0:M.versionId}`,_=e.getMenu?e.getMenu({primaryResource:a,currentResource:T,reloadTimeline:S}):void 0;if(T.resourceType===a.resourceType&&T.id===a.id)return s.jsx(nG,{history:o,resource:T,popupMenuItems:_},A);switch(T.resourceType){case"AuditEvent":return s.jsx(oG,{resource:T,popupMenuItems:_},A);case"Communication":return s.jsx(aG,{resource:T,popupMenuItems:_},A);case"DiagnosticReport":return s.jsx(sG,{resource:T,popupMenuItems:_},A);case"Media":return s.jsx(iG,{resource:T,popupMenuItems:_},A);default:return s.jsx(Bs,{resource:T,padding:!0,children:s.jsx(Rb,{value:T,ignoreMissingValues:!0})},A)}})]}):s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(_r,{})})}function nG(e){const{history:t,resource:n,...r}=e,a=rG(t,n);return a?s.jsx(Bs,{resource:n,padding:!0,...r,children:s.jsx(Gq,{original:a,revised:e.resource})}):s.jsxs(Bs,{resource:n,padding:!0,...r,children:[s.jsx("h3",{children:"Created"}),s.jsx(Rb,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function rG(e,t){const n=e.entry??[],r=n.findIndex(a=>{var o,c,u;return((c=(o=a.resource)==null?void 0:o.meta)==null?void 0:c.versionId)===((u=t.meta)==null?void 0:u.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function aG(e){var r,a;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:tG.pinnedComment;return s.jsx(Bs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:s.jsx("p",{children:(a=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:a.contentString})})}function iG(e){var r;const t=(r=e.resource.content)==null?void 0:r.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(Bs,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:s.jsx(_d,{value:e.resource.content})})}function oG(e){return s.jsx(Bs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Yr,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function sG(e){return s.jsx(Bs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Tb,{value:e.resource})})}function lG(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Vv(e.loaded)} / ${Vv(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Vv(e.loaded)}`}function Vv(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 cG(e){const{resource:t,...n}=e;return s.jsx(Zp,{value:t,loadTimelineResources:async(r,a,o)=>{const c=`${a}/${o}`;return Promise.allSettled([r.readHistory(a,o),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function uG(e){const{encounter:t,...n}=e;return s.jsx(Zp,{value:t,loadTimelineResources:async(r,a,o)=>Promise.allSettled([r.readHistory("Encounter",o),r.search("Communication","encounter=Encounter/"+o),r.search("Media","encounter=Encounter/"+o)]),createCommunication:(r,a,o)=>({resourceType:"Communication",status:"completed",encounter:fn(r),subject:r.subject,sender:fn(a),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,a,o)=>({resourceType:"Media",status:"completed",encounter:fn(r),subject:r.subject,operator:fn(a),issued:new Date().toISOString(),content:o}),...n})}function dG(e){let t;try{t=Nc(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return s.jsx(ci,{value:t[0]||"",propertyType:e.propertyType})}function fG(e){return s.jsxs(Un,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(QE,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(QE,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(Ae,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function QE(e){return s.jsx(Pe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const hG={string:[de.EQUALS,de.NOT,de.CONTAINS,de.EXACT],fulltext:[de.EQUALS,de.NOT,de.CONTAINS,de.EXACT],token:[de.EQUALS,de.NOT],reference:[de.EQUALS,de.NOT],numeric:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS],quantity:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS],date:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS,de.STARTS_AFTER,de.ENDS_BEFORE,de.APPROXIMATELY],datetime:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS,de.STARTS_AFTER,de.ENDS_BEFORE,de.APPROXIMATELY],uri:[de.EQUALS,de.NOT,de.ABOVE,de.BELOW]},pG={eq:"equals",ne:"not equals",gt:"greater than",lt:"less than",ge:"greater than or equals",le:"less than or equals",sa:"starts after",eb:"ends before",ap:"approximately",sw:"starts with",contains:"contains",exact:"exact",text:"text",not:"not",above:"above",below:"below",in:"in","not-in":"not in","of-type":"of type",missing:"missing",present:"present",identifier:"identifier",iterate:"iterate"};function Db(e,t){return{...e,filters:t,offset:0,name:void 0}}function A_(e,t){return Db(e,(e.filters??[]).filter(n=>n.code!==t))}function Jp(e,t,n,r,a){const o=[];return e.filters&&o.push(...e.filters),o.push({code:t,operator:n,value:r??""}),Db(e,o)}function mG(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function gG(e,t){return Ab(e,t,-1)}function vG(e,t){return Ab(e,t,0)}function yG(e,t){return Ab(e,t,1)}function Ab(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const a=new Date(r.getTime());return a.setDate(a.getDate()+1),a.setTime(a.getTime()-1),em(e,t,r,a)}function xG(e,t){const n=new Date,r=new Date(n.getTime()+24*60*60*1e3);return em(e,t,n,r)}function bG(e,t){return _b(e,t,-1)}function SG(e,t){return _b(e,t,0)}function wG(e,t){return _b(e,t,1)}function _b(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const a=new Date(r.getTime());return a.setMonth(a.getMonth()+1),a.setDate(1),a.setHours(0,0,0,0),a.setTime(a.getTime()-1),em(e,t,r,a)}function jG(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),em(e,t,n,new Date)}function em(e,t,n,r){return e=A_(e,t),e=WE(e,t,de.GREATER_THAN_OR_EQUALS,n),e=WE(e,t,de.LESS_THAN_OR_EQUALS,r),e}function WE(e,t,n,r){return Jp(e,t,n,r.toISOString())}function YE(e,t,n=!0){return Jp(e,t,de.MISSING,n.toString())}function CG(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function EG(e,t){const n=e.count??Hp,r=(t-1)*n;return CG(e,r)}function TG(e,t,n){return t===RG(e)&&n!==void 0&&n===DG(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function RG(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function DG(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function AG(e){return hG[e.type]}function __(e){return pG[e]??""}function Vs(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(Fn).join(" "))}function _G(e,t){var r,a;const n=t.name;return n==="id"?s.jsx(bt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?gr((a=e.meta)==null?void 0:a.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?kG(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?PG(e,t.searchParams[0]):null}function kG(e,t){var o,c,u;const n=((u=(c=(o=t.path)==null?void 0:o.split("."))==null?void 0:c.pop())==null?void 0:u.replaceAll("[x]",""))??"",[r,a]=Kp({type:e.resourceType,value:e},n);return r?s.jsx(ci,{path:t.path,property:t,propertyType:a,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function PG(e,t){const n=zs(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,a)=>s.jsx(ci,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${a}-${n.length}`))})}function NG(e){const t=y.useRef(!1),[n,r]=y.useState({search:JSON.parse(Ia(e.search))}),[a,o]=y.useState(!1);y.useEffect(()=>{r({search:e.search})},[e.search]);const c=y.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,p=nA(f),m=Q0(f);return nd(OG(p,m)).map(g=>({value:g,label:Vs(g)}))},[e.visible,e.search.resourceType]);function u(f){r({search:{...n.search,fields:f}})}return s.jsx(Un,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=a},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(We,{children:[s.jsx(yd,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>o(!0),onDropdownClose:()=>o(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function OG(e,t){const n=[],r=new Set,a=new Set;for(const o of Object.keys(e.elements))n.push(o),r.add(o.toLowerCase()),a.add(Vs(o));if(t)for(const o of Object.keys(t)){const c=Vs(o);!r.has(o)&&!a.has(c)&&(n.push(o),r.add(o),a.add(c))}return n}function k_(e){const t=Oc(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case Jn.REFERENCE:return s.jsx(Nd,{name:n,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(r.reference):e.onChange("")}});case Jn.BOOLEAN:return s.jsx(Qn,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.checked.toString())});case Jn.DATE:return s.jsx(ze,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case Jn.DATETIME:return s.jsx(oi,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Jn.NUMBER:return s.jsx(ze,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case Jn.QUANTITY:return s.jsx(Us,{name:n,path:"",defaultValue:MG(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx(ze,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value),placeholder:"Search value"})}}function MG(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function IG(e){const[t,n]=y.useState(Qr(e.search)),r=y.useRef(t);r.current=t,y.useEffect(()=>{n(Qr(e.search))},[e.search]);function a(f){n(Jp(r.current,f.code,f.operator,f.value))}const o=e.search.resourceType,c=Q0(o)??{},u=t.filters||[];return s.jsx(Un,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:s.jsxs(mt,{onSubmit:()=>e.onOk(r.current),children:[s.jsxs("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:40}})]}),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",{})]})}),s.jsx("tbody",{children:u.map((f,p)=>s.jsx(LG,{id:`filter-${p}-row`,resourceType:o,searchParams:c,value:f,onChange:m=>{const g=[...u];g[p]=m,n(Db(r.current,g))},onDelete:()=>n(mG(r.current,p))},`filter-${p}-row`))})]}),s.jsx(wb,{propertyDisplayName:"Filter",onClick:()=>a({})})]}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Or,{children:"OK"})})]})})}function LG(e){const t=e.value,n=y.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=de.EQUALS,n.current.value="",e.onChange(n.current)}function a(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function o(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],u=c&&AG(c);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ln,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:f=>r(f.currentTarget.value),data:["",...Object.keys(e.searchParams).map(f=>({value:f,label:Vs(f)}))]})}),s.jsx("td",{children:u&&s.jsx(ln,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>a(f.currentTarget.value),data:["",...u.map(f=>({value:f,label:__(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),s.jsx("td",{children:c&&t.operator&&s.jsx(k_,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:o},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),s.jsx("td",{children:e.onDelete&&s.jsx(_n,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:s.jsx($s,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function zG(e){const[t,n]=y.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return s.jsx(Un,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(mt,{onSubmit:r,children:s.jsxs(or,{children:[s.jsx(or.Col,{span:10,children:s.jsx(k_,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(or.Col,{span:2,children:s.jsx(Pe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function $G(e){var a;const{resourceType:t,filter:n}=e,r=(a=li.types[t].searchParams)==null?void 0:a[n.code];if(r){if(r.type==="reference"&&(n.operator===de.EQUALS||n.operator===de.NOT_EQUALS))return s.jsx(Mc,{value:{reference:n.value}});const o=Oc(t,r);if(n.code==="_lastUpdated"||o.type===Jn.DATETIME)return s.jsx(s.Fragment,{children:gr(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function UG(e){if(!e.searchParams)return null;function t(o,c){a(TG(e.search,o.code,c))}function n(o){a(A_(e.search,o.code))}function r(o,c){e.onPrompt(o,{code:o.code,operator:c,value:""})}function a(o){e.onChange(o)}return e.searchParams.length===1?s.jsx(BG,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:a,onClear:n}):s.jsx(je.Dropdown,{children:e.searchParams.map(o=>s.jsx(je.Item,{children:Vs(o.code)},o.code))})}function BG(e){switch(e.searchParam.type){case"date":return s.jsx(VG,{...e});case"number":case"quantity":return s.jsx(FG,{...e});case"reference":return s.jsx(HG,{...e});case"string":return s.jsx(qG,{...e});case"token":case"uri":return s.jsx(GG,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function VG(e){const{searchParam:t}=e,n=t.code;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(lb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(je.Item,{leftSection:s.jsx(cb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT_EQUALS),children:"Does not equal..."}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(GA,{size:14}),onClick:()=>e.onPrompt(t,de.ENDS_BEFORE),children:"Before..."}),s.jsx(je.Item,{leftSection:s.jsx(qA,{size:14}),onClick:()=>e.onPrompt(t,de.STARTS_AFTER),children:"After..."}),s.jsx(je.Item,{leftSection:s.jsx(wV,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Between..."}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(_o,{size:14}),onClick:()=>e.onChange(yG(e.search,n)),children:"Tomorrow"}),s.jsx(je.Item,{leftSection:s.jsx(_o,{size:14}),onClick:()=>e.onChange(vG(e.search,n)),children:"Today"}),s.jsx(je.Item,{leftSection:s.jsx(_o,{size:14}),onClick:()=>e.onChange(gG(e.search,n)),children:"Yesterday"}),s.jsx(je.Item,{leftSection:s.jsx(_o,{size:14}),onClick:()=>e.onChange(xG(e.search,n)),children:"Next 24 Hours"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(_o,{size:14}),onClick:()=>e.onChange(wG(e.search,n)),children:"Next Month"}),s.jsx(je.Item,{leftSection:s.jsx(_o,{size:14}),onClick:()=>e.onChange(SG(e.search,n)),children:"This Month"}),s.jsx(je.Item,{leftSection:s.jsx(_o,{size:14}),onClick:()=>e.onChange(bG(e.search,n)),children:"Last Month"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(_o,{size:14}),onClick:()=>e.onChange(jG(e.search,n)),children:"Year to date"}),s.jsx(Md,{...e})]})}function FG(e){const{searchParam:t}=e;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(lb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(je.Item,{leftSection:s.jsx(cb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT_EQUALS),children:"Does not equal..."}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(qA,{size:14}),onClick:()=>e.onPrompt(t,de.GREATER_THAN),children:"Greater than..."}),s.jsx(je.Item,{leftSection:s.jsx(Ny,{size:14}),onClick:()=>e.onPrompt(t,de.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(je.Item,{leftSection:s.jsx(GA,{size:14}),onClick:()=>e.onPrompt(t,de.LESS_THAN),children:"Less than..."}),s.jsx(je.Item,{leftSection:s.jsx(Ny,{size:14}),onClick:()=>e.onPrompt(t,de.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Md,{...e})]})}function HG(e){const{searchParam:t}=e;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),s.jsx(Md,{...e})]})}function qG(e){const{searchParam:t}=e;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(lb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(je.Item,{leftSection:s.jsx(cb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(EV,{size:14}),onClick:()=>e.onPrompt(t,de.CONTAINS),children:"Contains..."}),s.jsx(je.Item,{leftSection:s.jsx(CV,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Does not contain..."}),s.jsx(Md,{...e})]})}function GG(e){const{searchParam:t}=e;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),s.jsx(Md,{...e})]})}function Md(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(bV,{size:14}),onClick:()=>e.onChange(YE(e.search,n)),children:"Missing"}),s.jsx(je.Item,{leftSection:s.jsx(xV,{size:14}),onClick:()=>e.onChange(YE(e.search,n,!1)),children:"Not missing"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx($s,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const QG="_root_vlout_1",WG="_table_vlout_8",YG="_tr_vlout_12",KG="_control_vlout_22",XG="_icon_vlout_31",Mu={root:QG,table:WG,tr:YG,control:KG,icon:XG};function ZG(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(JG(t,r));return n}function JG(e,t){var a;if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const n=Zs(e,t),r=K$(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=Q0(e);let c;if(o){const u=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);c=Object.values(o).filter(f=>!!f.expression&&u.test(f==null?void 0:f.expression)),c.length===0&&(c=void 0)}return{name:t,elementDefinition:n,searchParams:c}}if(r){const o=Oc(e,r);return{name:t,elementDefinition:(a=o.elementDefinitions)==null?void 0:a[0],searchParams:[r]}}return{name:t}}class eQ extends Event{constructor(t){super("change"),this.definition=t}}class tQ extends Event{constructor(t){super("load"),this.response=t}}class qh extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function Id(e){var X,Z;const t=De(),[n,r]=y.useState(),{search:a,onLoad:o}=e,[c,u]=y.useState(a);Uo(a,c)||u(a);const[f,p]=y.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=y.useRef(f);m.current=f;const g=c.total??"accurate",v=y.useCallback(P=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,Jl({...c,total:g,fields:void 0}),P)).then(I=>{p({...m.current,searchResponse:I}),o&&o(new tQ(I))}).catch(I=>{p({...m.current,searchResponse:void 0}),r(Jt(I))})},[t,c,g,o]),b=y.useCallback(()=>{p({...m.current,searchResponse:void 0}),v({cache:"reload"})},[v]);y.useEffect(()=>{v()},[v]);function S(P,I){P.stopPropagation();const F=P.target.checked,O={...m.current.selected};F?O[I]=!0:delete O[I],p({...m.current,selected:O})}function j(P){P.stopPropagation();const z=P.target.checked,F={},O=m.current.searchResponse;z&&(O!=null&&O.entry)&&O.entry.forEach(U=>{var J;(J=U.resource)!=null&&J.id&&(F[U.resource.id]=!0)}),p({...m.current,selected:F})}function C(){var I,z;const P=m.current;if(!((I=P.searchResponse)!=null&&I.entry)||P.searchResponse.entry.length===0)return!1;for(const F of P.searchResponse.entry)if((z=F.resource)!=null&&z.id&&!P.selected[F.resource.id])return!1;return!0}function R(P){e.onChange&&e.onChange(new eQ(P))}function D(P,I){if(YA(P.target)||P.button===2)return;hn(P);const z=WA(P);!z&&e.onClick&&e.onClick(new qh(I,P)),z&&e.onAuxClick&&e.onAuxClick(new qh(I,P))}function E(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return s.jsx(xa,{outcome:n});if(!tA(c.resourceType))return s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(_r,{})});const T=e.checkboxesEnabled,A=ZG(c),_=c.resourceType,M=f.searchResponse,L=M==null?void 0:M.entry,$=L==null?void 0:L.map(P=>P.resource),V="subtle",Y="gray",W=16,G=window.innerWidth<768;return s.jsxs("div",{className:Mu.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(Ce,{justify:"space-between",mb:"xl",children:[s.jsxs(Ce,{gap:2,children:[s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(AV,{size:W}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(OV,{size:W}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(NV,{size:W}),onClick:e.onNew,children:"New..."}),!G&&E()&&s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(nF,{size:W}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!G&&e.onDelete&&s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(ub,{size:W}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!G&&e.onBulk&&s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(SV,{size:W}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),s.jsxs(Ce,{gap:2,children:[M&&s.jsxs(Ae,{size:"xs",c:"dimmed","data-testid":"count-display",children:[P_(c,M).toLocaleString(),"-",oQ(c,M).toLocaleString(),M.total!==void 0&&` of ${c.total==="estimate"?"~":""}${(X=M.total)==null?void 0:X.toLocaleString()}`]}),s.jsx(_n,{variant:V,color:Y,title:"Refresh",onClick:b,children:s.jsx(WV,{size:W})})]})]}),s.jsxs(Oe,{className:Mu.table,children:[s.jsxs(Oe.Thead,{children:[s.jsxs(Oe.Tr,{children:[T&&s.jsx(Oe.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:P=>j(P)})}),A.map(P=>s.jsx(Oe.Th,{children:s.jsxs(je,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(je.Target,{children:s.jsx(tr,{className:Mu.control,p:2,children:s.jsxs(Ce,{justify:"space-between",wrap:"nowrap",children:[s.jsx(Ae,{fw:500,children:Vs(P.name)}),s.jsx(er,{className:Mu.icon,children:s.jsx(gV,{size:14,stroke:1.5})})]})})}),s.jsx(UG,{search:c,searchParams:P.searchParams,onPrompt:(I,z)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:I,filterDialogFilter:z,dialogOpenTime:Date.now()})},onChange:I=>{R(I)}})]})},P.name))]}),!e.hideFilters&&s.jsxs(Oe.Tr,{children:[T&&s.jsx(Oe.Th,{}),A.map(P=>s.jsx(Oe.Th,{children:P.searchParams&&s.jsx(rQ,{resourceType:_,searchParams:P.searchParams,filters:c.filters})},P.name))]})]}),s.jsx(Oe.Tbody,{children:$==null?void 0:$.map(P=>P&&s.jsxs(Oe.Tr,{className:Mu.tr,"data-testid":"search-control-row",onClick:I=>D(I,P),onAuxClick:I=>D(I,P),children:[T&&s.jsx(Oe.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${P.id}`,checked:!!f.selected[P.id],onChange:I=>S(I,P.id)})}),A.map(I=>s.jsx(Oe.Td,{children:_G(P,I)},I.name))]},P.id))})]}),!($!=null&&$.length)&&s.jsx(kd,{children:s.jsx(er,{style:{height:150},children:s.jsx(Ae,{size:"xl",c:"dimmed",children:"No results"})})}),M&&s.jsx(er,{m:"md",p:"md",children:s.jsx(za,{value:aQ(c),total:iQ(c,M),onChange:P=>R(EG(c,P)),getControlProps:P=>{switch(P){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),s.jsx(NG,{search:c,visible:m.current.fieldEditorVisible,onOk:P=>{R(P),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),s.jsx(IG,{search:c,visible:m.current.filterEditorVisible,onOk:P=>{R(P),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),s.jsx(fG,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),s.jsx(zG,{visible:m.current.filterDialogVisible,title:(Z=f.filterDialogSearchParam)!=null&&Z.code?Vs(f.filterDialogSearchParam.code):"",resourceType:_,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:P=>{R(Jp(c,P.code,P.operator,P.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const nQ=Id;function rQ(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(n=>s.jsxs("div",{children:[__(n.operator)," ",s.jsx($G,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function aQ(e){return Math.floor((e.offset??0)/(e.count??Hp))+1}function iQ(e,t){const n=e.count??Hp,r=N_(e,t);return Math.ceil(r/n)}function P_(e,t){return Math.min(N_(e,t),(e.offset??0)+1)}function oQ(e,t){var n;return Math.max(P_(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function N_(e,t){var r,a;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((a=t.link)!=null&&a.some(o=>o.relation==="next")?1:0)),n}function sQ(e){const t=De(),[n,r]=y.useState(!1),[a,o]=y.useState(),{query:c,fields:u}=e,[f,p]=y.useState(),[m,g]=y.useState({}),v=y.useRef(f);v.current=f;const b=y.useRef({});b.current=m,y.useEffect(()=>{o(void 0),t.graphql(c).then(p).catch(E=>o(Jt(E)))},[t,c]);function S(E,T){E.stopPropagation();const _=E.target.checked,M={...b.current};_?M[T]=!0:delete M[T],g(M)}function j(E){var L;E.stopPropagation();const A=E.target.checked,_={},M=(L=v.current)==null?void 0:L.data.ResourceList;A&&M&&M.forEach($=>{$.id&&(_[$.id]=!0)}),g(_)}function C(){var T;const E=(T=v.current)==null?void 0:T.data.ResourceList;if(!E||E.length===0)return!1;for(const A of E)if(A.id&&!b.current[A.id])return!1;return!0}function R(E,T){YA(E.target)||(hn(E),E.button!==1&&e.onClick&&e.onClick(new qh(T,E)),E.button===1&&e.onAuxClick&&e.onAuxClick(new qh(T,E)))}if(y.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(_r,{});const D=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:E=>hn(E),"data-testid":"search-control",children:[s.jsxs(Oe,{children:[s.jsx(Oe.Thead,{children:s.jsxs(Oe.Tr,{children:[D&&s.jsx(Oe.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:E=>j(E)})}),u.map(E=>s.jsx(Oe.Th,{children:E.name},E.name))]})}),s.jsx(Oe.Tbody,{children:f==null?void 0:f.data.ResourceList.map(E=>E&&s.jsxs(Oe.Tr,{"data-testid":"search-control-row",onClick:T=>R(T,E),onAuxClick:T=>R(T,E),children:[D&&s.jsx(Oe.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${E.id}`,checked:!!m[E.id],onChange:T=>S(T,E.id)})}),u.map(T=>s.jsx(Oe.Td,{children:s.jsx(dG,{propertyType:T.propertyType,path:T.fhirPath,resource:E})},T.name))]},E.id))})]}),(f==null?void 0:f.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),a&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(a,void 0,2)})}),e.onBulk&&s.jsx(Pe,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const lQ=y.memo(sQ),cQ="_root_1fbwr_1",uQ="_entry_1fbwr_8",dQ="_key_1fbwr_13",fQ="_value_1fbwr_20",tm={root:cQ,entry:uQ,key:dQ,value:fQ};function pt(e){return s.jsx(Yr,{children:s.jsx("div",{className:tm.root,children:e.children})})}pt.Entry=function(t){return s.jsx("div",{className:tm.entry,children:t.children})};pt.Key=function(t){return s.jsx("div",{className:tm.key,children:t.children})};pt.Value=function(t){return s.jsx("div",{className:tm.value,children:t.children})};function hQ(e){const{group:t}=e;return s.jsx(mr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(Ce,{children:[t.measureScore&&s.jsx(gQ,{group:t}),!t.measureScore&&s.jsx(mQ,{group:t})]})})}function pQ(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(Ae,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(Ae,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function mQ(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(f=>Bo(f.code)==="numerator"),a=n==null?void 0:n.find(f=>Bo(f.code)==="denominator"),o=r==null?void 0:r.count,c=a==null?void 0:a.count;if(c===0)return s.jsxs(ce,{children:[s.jsx(Ie,{order:3,children:"Not Applicable"}),s.jsx(Ae,{children:`Denominator: ${c}`})]});if(o===void 0||c===void 0)return s.jsxs(ce,{children:[s.jsx(Ie,{order:3,children:"Insufficient Data"}),s.jsx(Ae,{children:`Numerator: ${o}`}),s.jsx(Ae,{children:`Denominator: ${c}`})]});const u=o/c*100;return s.jsx(Lp,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:O_(u)}],label:s.jsx($o,{justify:"center",children:s.jsxs(Ae,{fw:700,fz:18,children:[o," / ",c]})})})}function gQ(e){var r,a,o;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((a=t.measureScore)==null?void 0:a.code);return s.jsx(s.Fragment,{children:n==="%"?s.jsx(Lp,{size:120,thickness:12,roundCaps:!0,sections:[{value:vQ(t),color:O_(((o=t==null?void 0:t.measureScore)==null?void 0:o.value)??0)}],label:s.jsx($o,{justify:"center",children:s.jsx(Ae,{fw:700,fz:18,children:s.jsx(od,{value:t.measureScore})})})}):s.jsx($o,{h:120,align:"center",children:s.jsx(Ie,{order:3,children:s.jsx(od,{value:t.measureScore})})})})}function vQ(e){var r,a;const t=(r=e.measureScore)==null?void 0:r.value,n=(a=e.measureScore)==null?void 0:a.unit;return t?t<=1&&n==="%"?t*100:t:0}function O_(e){return e<=33?"red":e<=67?"yellow":"green"}function yQ(e){var r;const t=Yt(e.measureReport),[n]=cV("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(ce,{children:[n&&s.jsx(pQ,{measure:n}),s.jsx(D0,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((a,o)=>s.jsx(hQ,{group:a},a.id??o))})]}):null}const Fv="patient-export",Hv="Patient Export",xQ={everything:{operation:"$everything",extension:"json",contentType:dn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:dn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:dn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:dn.CDA_XML}};function bQ(e){const t=De(),{patient:n}=e,r=y.useCallback(async a=>{const o=Is(n),c=a.format,{operation:u,type:f,contentType:p,extension:m}=xQ[c],g=t.fhirUrl("Patient",o,u),v={};f&&(v.type=f),a.author&&(v.author={reference:a.author}),a.authoredOn&&(v.authoredOn=bb(a.authoredOn)),a.startDate&&(v.start=a.startDate),a.endDate&&(v.end=a.endDate),ca.show({id:Fv,title:Hv,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,v,void 0,{cache:"no-cache",headers:{Accept:p}}),S=`Patient-export-${o}-${new Date().toISOString().replaceAll(":","-")}.${m}`;SQ(b,S,p),ca.update({id:Fv,title:Hv,color:"green",message:"Done",icon:s.jsx(eo,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){ca.update({id:Fv,title:Hv,color:"red",message:Ke(b),icon:s.jsx($s,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return s.jsx(mt,{onSubmit:r,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Export Format",description:"Required",withAsterisk:!0,children:s.jsx(zp,{name:"format",data:[{label:"FHIR Everything",value:"everything"},{label:"Patient Summary",value:"summary"},{label:"C-CDA",value:"ccda"},{label:"C-CDA Referral",value:"ccdaReferral"}],fullWidth:!0})}),s.jsx(zt,{title:"Author",description:"Optional author for composition. Default value is current user.",children:s.jsx(Nd,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),s.jsx(zt,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:s.jsx(oi,{name:"authoredOn",placeholder:"Authored on"})}),s.jsx(zt,{title:"Start Date",description:"The start date of care. If no start date is provided, all records prior to the end date are in scope.",children:s.jsx(oi,{name:"startDate",placeholder:"Start date"})}),s.jsx(zt,{title:"End Date",description:"The end date of care. If no end date is provided, all records subsequent to the start date are in scope.",children:s.jsx(oi,{name:"endDate",placeholder:"End date"})}),s.jsx(Ce,{justify:"right",children:s.jsx(Or,{children:"Request Export"})})]})})}function SQ(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),a=new Blob([r],{type:n}),o=window.URL.createObjectURL(a),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=o,c.download=t,c.click(),window.URL.revokeObjectURL(o)}function wQ(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function M_(e){var n,r;const t=Yt(e.patient);return t?s.jsxs(pt,{children:[s.jsx(Wo,{value:t,size:"lg",color:wQ(t)}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Name"}),s.jsx(pt.Value,{children:s.jsx(bt,{to:t,fw:500,children:t.name?s.jsx(db,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"DoB"}),s.jsx(pt.Value,{children:t.birthDate})]}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Age"}),s.jsx(pt.Value,{children:w$(t.birthDate)})]})]}),t.gender&&s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Gender"}),s.jsx(pt.Value,{children:t.gender})]}),t.address&&s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"State"}),s.jsx(pt.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(a=>s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:a==null?void 0:a.system}),s.jsx(pt.Value,{children:a==null?void 0:a.value})]},`${a==null?void 0:a.system}-${a==null?void 0:a.value}`))]}):null}function jQ(e){const{patient:t,...n}=e,r=y.useCallback((a,o,c)=>{const u=`${o}/${c}`,f=100;return Promise.allSettled([a.readHistory("Patient",c),a.search("Communication",{subject:u,_count:f}),a.search("Device",{patient:u,_count:f}),a.search("DeviceRequest",{patient:u,_count:f}),a.search("DiagnosticReport",{subject:u,_count:f}),a.search("Media",{subject:u,_count:f}),a.search("ServiceRequest",{subject:u,_count:f}),a.search("Task",{subject:u,_count:f})])},[]);return s.jsx(Zp,{value:t,loadTimelineResources:r,createCommunication:(a,o,c)=>({resourceType:"Communication",status:"completed",subject:fn(a),sender:fn(o),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(a,o,c)=>({resourceType:"Media",status:"completed",subject:fn(a),operator:fn(o),issued:new Date().toISOString(),content:c}),...n})}const CQ="_section_pqpwm_1",EQ="_hovering_pqpwm_7",Ly={section:CQ,hovering:EQ};function TQ(e){const t=De(),n=Yt(e.value),[r,a]=y.useState(!1),[o,c]=y.useState(),[u,f]=y.useState(),[p,m]=y.useState();function g(){f(void 0)}function v(){c(void 0)}const b=y.useRef(p);if(b.current=p,y.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>a(!0)).catch(console.log)},[t]),y.useEffect(()=>(m(kQ(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",v)}),[n]),!r||!p)return null;function S(j,C){m({...b.current,[j]:C})}return s.jsx("div",{children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[s.jsx(ze,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>S("title",j.currentTarget.value)}),s.jsx(RQ,{actions:p.action||[],selectedKey:o,setSelectedKey:c,hoverKey:u,setHoverKey:f,onChange:j=>S("action",j)}),s.jsx(Or,{children:"Save"})]})})}function RQ(e){const t=y.useRef(e.actions);t.current=e.actions;function n(o){e.onChange(t.current.map(c=>c.id===o.id?o:c))}function r(o){e.onChange([...t.current,o]),e.setSelectedKey(o.id)}function a(o){e.onChange(t.current.filter(c=>c!==o))}return s.jsxs(We,{gap:"md",className:Ly.section,children:[e.actions.map(o=>s.jsx(DQ,{action:o,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>a(o)},o.id)),s.jsx("div",{children:s.jsx(Pe,{variant:"outline",onClick:o=>{hn(o),r({id:I_()})},children:"Add action"})})]})}function DQ(e){const{action:t}=e,n=_Q(t);function r(o){o.stopPropagation(),e.setSelectedKey(e.action.id)}function a(o){hn(o),e.setHoverKey(e.action.id)}return s.jsx("div",{onClick:r,onMouseOver:a,onFocus:a,children:s.jsx(AQ,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function AQ(e){const{action:t}=e,[n,r]=y.useState(e.actionType),a=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const u=$t(Ly.section,{[Ly.hovering]:o&&!a});return s.jsxs(mr,{"data-testid":t.id,className:u,p:0,radius:"sm",withBorder:!0,children:[s.jsxs($o,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[s.jsx(ze,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),s.jsx(qo,{"data-testid":"close-button",onClick:e.onRemove})]}),a&&s.jsxs(We,{gap:"xl",p:"md",children:[s.jsx(ce,{children:s.jsx(ze,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),s.jsx(ce,{children:s.jsx(ln,{label:"Type of Action",value:n,onChange:f=>{const p=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(p),e.onChange({...e.action,definitionCanonical:p==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&s.jsxs(We,{gap:0,children:[s.jsxs(Ce,{gap:0,mb:"xs",children:[s.jsx(Ae,{fw:600,children:"Select questionnaire"}),s.jsx(Ae,{c:"red",children:"*"})]}),s.jsxs(Ae,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Pt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),s.jsx(KE,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&s.jsxs(We,{gap:0,children:[s.jsxs(Ce,{gap:0,mb:"xs",children:[s.jsx(Ae,{fw:600,children:"Select activity definition"}),s.jsx(Ae,{c:"red",children:"*"})]}),s.jsxs(Ae,{size:"sm",c:"dimmed",mb:"sm",children:["ActivityDefinition.kind resource to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Pt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),s.jsx(KE,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function KE(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(el,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:a=>{a?e.onChange({...e.action,definitionCanonical:Lt(a)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function _Q(e){var t,n;return(t=e.definitionCanonical)!=null&&t.startsWith("Questionnaire")?"questionnaire":(n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let qv=1;function I_(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(qv=Math.max(qv,t+1))}return e}return"id-"+qv++}function kQ(e){return{...e,action:L_(e.action)}}function L_(e){if(e)return e.map(t=>({...t,id:I_(t.id),action:L_(t.action)}))}const Dt={group:"group",display:"display",boolean:"boolean",decimal:"decimal",integer:"integer",date:"date",dateTime:"dateTime",time:"time",string:"string",text:"text",url:"url",choice:"choice",openChoice:"open-choice",attachment:"attachment",reference:"reference",quantity:"quantity"};function PQ(e){return e.type==="choice"||e.type==="open-choice"}function NQ(e,t){var a;const n=Ji(e,_c+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression");if(t&&n){const o=(a=n.valueExpression)==null?void 0:a.expression;if(o){const c=ha(t),u=zs(o,[c],{"%resource":c});return ei(u)}}if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const o of e.enableWhen){const c=$_(t==null?void 0:t.item,o.question);if(o.operator==="exists"&&!o.answerBoolean&&!(c!=null&&c.length)){if(r==="any")return!0;continue}const{anyMatch:u,allMatch:f}=LQ(o,c,r);if(r==="any"&&u)return!0;if(r==="all"&&!f)return!1}return r!=="any"}function kb(e,t){return e.map(n=>{if(n.item)return{...n,item:kb(n.item,t)};try{const r=MQ(n,t);if(!r)return null;const a=OQ(n,r);return a?{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[a]}:null}catch(r){return{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[],extension:[{url:`${_c}/fhir/StructureDefinition/questionnaire-validationError`,valueString:`Expression evaluation failed: ${Ke(r)}`}]}}}).filter(n=>n!==null)}function OQ(e,t){if(e.type)switch(e.type){case Dt.boolean:return t.type===oe.boolean?{valueBoolean:t.value}:void 0;case Dt.date:return t.type===oe.date?{valueDate:t.value}:void 0;case Dt.dateTime:return t.type===oe.dateTime?{valueDateTime:t.value}:void 0;case Dt.time:return t.type===oe.time?{valueTime:t.value}:void 0;case Dt.url:return t.type===oe.url?{valueString:t.value}:void 0;case Dt.text:return t.type===oe.string?{valueString:t.value}:void 0;case Dt.attachment:return t.type===oe.Attachment?{valueAttachment:t.value}:void 0;case Dt.reference:return t.type===oe.Reference?{valueReference:t.value}:void 0;case Dt.quantity:return{valueQuantity:t.value};case Dt.decimal:return{valueDecimal:t.value};case Dt.integer:return{valueInteger:t.value};case Dt.string:return{valueString:t.value};default:return}}function MQ(e,t){var r;if(!t)return;const n=Ji(e,_c+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression");if(n){const a=(r=n.valueExpression)==null?void 0:r.expression;if(a){const o=ha(t),c=zs(a,[o],{"%resource":o});return c.length!==0?c[0]:void 0}}}function Pb(e,t){return e.map(n=>{const r=t.find(a=>a.linkId===n.linkId);return r?{...n,item:r.item?Pb(n.item||[],r.item):n.item,answer:r.answer||n.answer,extension:r.extension||n.extension}:n})}function z_(e,t,n){var a;const r=[];for(const o of e){const c=(a=n.answerOption)==null?void 0:a.find(u=>rd(Vi(u))===o);if(c){const u=Vi(c);u&&r.push({[t]:u.value})}}return r}function $_(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=$_(n.item,t);if(r)return r}}}function IQ(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:a}]=zs(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return a}else return!1}function LQ(e,t,n){const r=t||[],a=FQ(e);let o=!1,c=!0;for(const u of r){const f=HQ(u),{operator:p}=e;if(IQ(f,a,p)?o=!0:c=!1,n==="any"&&o)break}return{anyMatch:o,allMatch:c}}function U_(e){var n,r;const t=Ji(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(r=(n=t.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:r.map(a=>a.code)}}function Gv(e,t){var a;const n=Qr(e);let r=Ji(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(a=n.extension)==null?void 0:a.filter(o=>o!==r)),n):(r||(n.extension||(n.extension=[]),r={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(o=>({code:o}))},delete r.valueCode),n)}function zQ(e,t,n){const r=Ji(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(r!=null&&r.valueString))return;let a=r.valueString;t!=null&&t.reference&&(a=a.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(a=a.replaceAll("$encounter",n.reference));const o={},c=a.split("&");for(const u of c){const[f,p]=Ry(u,"=",2);o[f]=p}return o}function XE(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??Lt(e),item:B_(e.item,t==null?void 0:t.item),status:"in-progress"}}function B_(e,t){return(e==null?void 0:e.map(n=>V_(n,t)))??[]}function V_(e,t){var r;const n=t==null?void 0:t.find(a=>a.linkId===e.linkId);return{id:n?n.id:UQ(),linkId:e.linkId,text:e.text,item:B_(e.item,n==null?void 0:n.item),answer:n?n.answer:((r=e.initial)==null?void 0:r.map(BQ))??[]}}let $Q=1;function UQ(){return"id-"+$Q++}function BQ(e){return{...e}}function VQ(e){var n,r,a,o;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const c=Ji(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((o=(a=(r=c==null?void 0:c.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:a[0])==null?void 0:o.code)==="page")return e.item.length}return 1}function nm(e){return Td({value:e},"value")}function Vi(e){return Td({value:e},"value")}function FQ(e){return Td({value:e},"answer")}function HQ(e){return Td({value:e},"value")}const F_=y.createContext({});function zy(e){const t=y.useContext(F_),n=e.item,r=e.response;function a(g){var b,S,j,C;let v;Array.isArray(g)?v=g:e.index>=(((S=(b=e.response)==null?void 0:b.answer)==null?void 0:S.length)??0)?v=(((j=e.response)==null?void 0:j.answer)??[]).concat([g]):v=(((C=e.response)==null?void 0:C.answer)??[]).map((D,E)=>E===e.index?g:D)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:v})}const o=n.type;if(!o)return null;const c=n.linkId;if(!c)return null;const u=n.initial&&n.initial.length>0?n.initial[0]:void 0,f=Ob(r,e.index)??nm(u),p=Ji(r,`${_c}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(o){case Dt.display:m=s.jsx("p",{children:e.item.text},e.item.linkId);break;case Dt.boolean:m=s.jsx(m_,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Qn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:f==null?void 0:f.value,onChange:g=>a({valueBoolean:g.currentTarget.checked})})},e.item.linkId);break;case Dt.decimal:m=s.jsx(ze,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueDecimal:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber})});break;case Dt.integer:m=s.jsx(ze,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueInteger:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber})});break;case Dt.date:m=s.jsx(ze,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueDate:g.currentTarget.value})});break;case Dt.dateTime:m=s.jsx(oi,{name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueDateTime:g})});break;case Dt.time:m=s.jsx(ze,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueTime:g.currentTarget.value})});break;case Dt.string:case Dt.url:m=s.jsx(ze,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const v=g.currentTarget.value;a({valueString:v===""?void 0:v})}});break;case Dt.text:m=s.jsx(Ws,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const v=g.currentTarget.value;a({valueString:v===""?void 0:v})}});break;case Dt.attachment:m=s.jsx(Ce,{py:4,children:s.jsx(JA,{path:"",name:c,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueAttachment:g})})});break;case Dt.reference:m=s.jsx(Nd,{name:c,required:e.required??n.required,targetTypes:U_(n),searchCriteria:zQ(n,t.subject,t.encounter),defaultValue:f==null?void 0:f.value,onChange:g=>a({valueReference:g})});break;case Dt.quantity:m=s.jsx(Us,{path:"",name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueQuantity:g}),disableWheel:!0});break;case Dt.choice:case Dt.openChoice:KQ(n)&&!n.answerValueSet?m=s.jsx(qQ,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>a(g)}):XQ(n)&&!n.answerValueSet?m=s.jsx(GQ,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>a(g)}):m=s.jsx(QQ,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>a(g)});break;default:return null}return s.jsxs(s.Fragment,{children:[m,(p==null?void 0:p.valueString)&&s.jsx(Ae,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function qQ(e){var f;const{name:t,item:n,initial:r,response:a}=e;if(!((f=n.answerOption)!=null&&f.length))return s.jsx(Nb,{});const o=nm(r),c=[""];for(const p of n.answerOption){const m=Vi(p);c.push(rd(m))}const u=Ob(a)??o;if(n.repeats){const{propertyName:p,data:m}=q_(e.item),g=H_(a);return s.jsx(yd,{data:m,placeholder:"Select items",searchable:!0,defaultValue:g||[rd(o)],onChange:v=>{const b=z_(v,p,n);e.onChangeAnswer(b)}})}return s.jsx(ln,{id:t,name:t,onChange:p=>{const m=p.currentTarget.selectedIndex;if(m===0){e.onChangeAnswer({});return}const g=n.answerOption[m-1],v=Vi(g),b="value"+Fn(v.type);e.onChangeAnswer({[b]:v.value})},defaultValue:Rd(u==null?void 0:u.value)||(u==null?void 0:u.value),data:c})}function GQ(e){var f;const{item:t,initial:n,response:r}=e;if(!((f=t.answerOption)!=null&&f.length))return s.jsx(Nb,{});const a=nm(n),{propertyName:o,data:c}=q_(e.item),u=H_(r);return s.jsx(yd,{data:c,placeholder:"Select items",searchable:!0,defaultValue:u||[rd(a)],onChange:p=>{const m=z_(p,o,t);e.onChangeAnswer(m)}})}function QQ(e){var c;const{name:t,item:n,initial:r,onChangeAnswer:a,response:o}=e;return!((c=n.answerOption)!=null&&c.length)&&!n.answerValueSet?s.jsx(Nb,{}):n.answerValueSet?s.jsx(g_,{path:"",name:t,binding:n.answerValueSet,response:o,onChange:u=>a({valueCoding:u}),creatable:n.type===Dt.openChoice}):s.jsx(WQ,{name:(o==null?void 0:o.id)??t,item:n,initial:r,response:o,onChangeAnswer:a})}function WQ(e){const{name:t,item:n,initial:r,onChangeAnswer:a,response:o}=e,c=Zs("QuestionnaireItemAnswerOption","value[x]"),u=nm(r),f=[];let p;if(n.answerOption)for(let v=0;v<n.answerOption.length;v++){const b=n.answerOption[v],S=`${t}-option-${v}`,j=Vi(b);j!=null&&j.value&&(u&&Ia(j)===Ia(u)&&(p=S),f.push([S,j]))}const m=Ob(o),g=YQ(f,m);return s.jsx(Ms.Group,{name:t,value:g??p,onChange:v=>{const b=f.find(S=>S[0]===v);if(b){const S=b[1],j="value"+Fn(S.type);a({[j]:S.value})}},children:f.map(([v,b])=>s.jsx(Ms,{id:v,value:v,py:4,label:s.jsx(ci,{property:c,propertyType:b.type,value:b.value})},v))})}function Nb(){return s.jsx(ze,{disabled:!0,placeholder:"No Answers Defined"})}function Ob(e,t=0){const n=e.answer;return Vi((n==null?void 0:n[t])??{})}function H_(e){const t=e.answer;return t?t.map(r=>Vi(r)).map(r=>Rd(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function YQ(e,t){var n;return(n=e.find(r=>Uo(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function KQ(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,a,o;return n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((o=(a=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:a[0])==null?void 0:o.code)==="drop-down"}))}function XQ(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,a,o;return n.url===_c+"/fhir/StructureDefinition/questionnaire-itemControl"&&((o=(a=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:a[0])==null?void 0:o.code)==="multi-select"}))}function q_(e){var o;if(((o=e.answerOption)==null?void 0:o.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=Vi(t),r="value"+Fn(n.type),a=(e.answerOption??[]).map(c=>{const u=Vi(c),f=rd(u);return{value:f,label:f}});return{propertyName:r,data:a}}const ZQ="_section_my8o4_1",JQ="_hovering_my8o4_10",eW="_editing_my8o4_14",tW="_questionBody_my8o4_20",nW="_topActions_my8o4_24",rW="_bottomActions_my8o4_33",aW="_movementActions_my8o4_44",iW="_movementIcons_my8o4_56",oW="_columnAlignment_my8o4_60",sW="_linkIdInput_my8o4_65",lW="_typeSelect_my8o4_70",cW="_preserveBreaks_my8o4_74",Fr={section:ZQ,hovering:JQ,editing:eW,questionBody:tW,topActions:nW,bottomActions:rW,movementActions:aW,movementIcons:iW,columnAlignment:oW,linkIdInput:sW,typeSelect:lW,preserveBreaks:cW};function uW(e){const t=De(),n=Yt(e.questionnaire),[r,a]=y.useState(!1),[o,c]=y.useState(),[u,f]=y.useState(),[p,m]=y.useState();function g(){m(void 0)}function v(){f(void 0)}y.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>a(!0)).catch(console.log)},[t]),y.useEffect(()=>(c(pW(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",v)}),[n]);const b=(S,j)=>{c(S),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(S)};return!r||!o?null:s.jsx("div",{children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(o),children:[s.jsx(G_,{item:o,selectedKey:u,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),s.jsx(Or,{children:"Save"})]})})}function G_(e){var E;const t=e.item,n=e.item,r=fi(e.item),a=r||n.type===Dt.group,o=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,f=y.useRef(e.item);f.current=e.item;function p(T){hn(T),e.setSelectedKey(e.item.id)}function m(T){hn(T),e.setHoverKey(e.item.id)}function g(T){var _;const A=f.current;e.onChange({...A,item:(_=A.item)==null?void 0:_.map(M=>M.id===T.id?T:M)})}function v(T,A){e.onChange({...e.item,item:[...e.item.item??[],T]},A)}function b(T){var A;e.onChange({...e.item,item:(A=e.item.item)==null?void 0:A.filter(_=>_!==T)})}function S(T,A){e.onChange({...f.current,[T]:A})}function j(T){e.onChange({...e.item,...T})}function C(T){var A;e.onChange({...e.item,item:(A=e.item.item)==null?void 0:A.map(_=>_===T?{..._,repeats:!_.repeats}:_)})}function R(T,A){const _=vW(e.item.item,T,A);e.onChange({...e.item,item:_})}const D=$t(Fr.section,{[Fr.editing]:c,[Fr.hovering]:u&&!c});return s.jsxs("div",{"data-testid":n.linkId,className:D,onClick:p,onMouseOver:m,onFocus:m,children:[s.jsx("div",{className:Fr.questionBody,children:c?s.jsxs(s.Fragment,{children:[r&&s.jsx(ze,{size:"xl",defaultValue:t.title,onBlur:T=>S("title",T.currentTarget.value)}),!r&&s.jsx(Ws,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:T=>S("text",T.currentTarget.value)}),n.type==="reference"&&s.jsx(hW,{item:n,onChange:j}),PQ(n)&&s.jsx(dW,{item:n,onChange:T=>j(T)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(Ie,{children:t.title}),n.text&&s.jsx("div",{className:Fr.preserveBreaks,children:n.text}),!a&&s.jsx(zy,{item:n,index:0,required:!1,onChange:()=>{},response:{linkId:n.linkId}})]})}),(E=n.item)==null?void 0:E.map((T,A)=>s.jsx("div",{children:s.jsx(G_,{item:T,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:A===0,isLast:A===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(T),onRepeatable:C,onMoveUp:()=>R(A,-1),onMoveDown:()=>R(A,1)})},T.id)),!a&&s.jsx("div",{className:Fr.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx(ze,{size:"xs",className:Fr.linkIdInput,defaultValue:n.linkId,onBlur:T=>S("linkId",T.currentTarget.value)}),!a&&s.jsx(ln,{size:"xs",className:Fr.typeSelect,defaultValue:n.type,onChange:T=>S("type",T.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:o})}),!r&&s.jsx(ce,{className:Fr.movementActions,children:s.jsxs(ce,{className:Fr.columnAlignment,children:[!e.isFirst&&s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(yV,{"data-testid":"up-button",size:15,className:Fr.movementIcons})}),!e.isLast&&s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(vV,{"data-testid":"down-button",size:15,className:Fr.movementIcons})})]})}),s.jsxs("div",{className:Fr.bottomActions,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),v({id:Fs(),linkId:By("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),v({id:Fs(),linkId:By("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),v(gW(),!0)},children:"Add Page"}),c&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function dW(e){const t=Zs("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(ze,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(fW,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(ce,{display:"flex",children:[s.jsx(Pt,{href:"#",onClick:r=>{hn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Fs()}]})},children:"Add choice"}),s.jsx($p,{w:"lg"}),s.jsx(Pt,{href:"#",onClick:r=>{hn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function fW(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=Kp({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(Od,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(a,o)=>{const c=[...e.options],u=c.findIndex(f=>f.id===t.id);c[u]={id:t.id,[o]:a},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Pt,{href:"#",onClick:a=>{hn(a),e.onChange({...e.item,answerOption:e.options.filter(o=>o.id!==t.id)})},children:"Remove"})})]},t.id)})})}function hW(e){const t=U_(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(Ce,{children:[s.jsx(mb,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:a=>{e.onChange(Gv(e.item,t.map(o=>o===n?a:o)))}}),s.jsx(Pt,{href:"#",onClick:a=>{hn(a),e.onChange(Gv(e.item,t.filter(o=>o!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Pt,{href:"#",onClick:n=>{hn(n),e.onChange(Gv(e.item,[...t,""]))},children:"Add Resource Type"})]})}let $y=1,Uy=1;function By(e){return e+$y++}function Fs(){return"id-"+Uy++}function pW(e){return{...e,id:e.id||Fs(),item:Q_(e.item)}}function Q_(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Uy=Math.max(Uy,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&($y=Math.max($y,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Fs(),item:Q_(t.item),answerOption:mW(t.answerOption)}))}function mW(e){if(e)return e.map(t=>({...t,id:t.id||Fs()}))}function gW(){return{id:Fs(),linkId:By("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 vW(e,t,n){const r=e??[],a=t+n;if(a<0||a>=r.length)return r;const o=[...r];return[o[t],o[a]]=[o[a],o[t]],o}function W_(e){const{item:t,response:n,onChange:r}=e,[a,o]=y.useState(yW(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===Dt.display)return s.jsx("p",{children:t.text},t.linkId);const c=(t==null?void 0:t.repeats)&&t.type!==Dt.choice&&t.type!==Dt.openChoice;return t.type===Dt.boolean?s.jsx(zy,{item:t,response:n,onChange:u=>r([u]),index:0},t.linkId):s.jsxs(zt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(a)].map((u,f)=>s.jsx(zy,{item:t,response:n,onChange:p=>r([p]),index:f},`${t.linkId}-${f}`)),c&&s.jsx(Pt,{onClick:()=>o(u=>u+1),children:"Add Item"})]},e.item.linkId)}function yW(e,t){if(e.type===Dt.choice||e.type===Dt.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function Y_(e){const[t,n]=y.useState(e.response);if(y.useEffect(()=>{n(e.response)},[e.response]),t.length===0)return null;function r(o,c){const u=t.map((f,p)=>p===c?o[0]:f);n(u),e.onChange(u)}function a(){const o=V_(e.item,void 0);n([...t,o])}return s.jsxs(s.Fragment,{children:[t.map((o,c)=>s.jsx(K_,{item:e.item,response:o,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:u=>r(u,c)},o.id)),e.item.repeats&&s.jsx(Pt,{onClick:a,children:`Add Group: ${e.item.text}`})]})}function K_(e){var o;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function a(c){var m;const u=(m=t.item)==null?void 0:m.map(g=>c.find(b=>b.id===g.id)??g),f=u==null?void 0:u.concat(c.slice(1)),p={...t,item:f};r([p])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(Ie,{order:3,mb:"md",children:e.item.text}),s.jsx(We,{children:(o=e.item.item)==null?void 0:o.map(c=>{var u,f,p;return c.type===Dt.group?c.repeats?s.jsx(Y_,{item:c,response:((u=t.item)==null?void 0:u.filter(m=>m.linkId===c.linkId))??[],checkForQuestionEnabled:n,onChange:a},c.linkId):s.jsx(K_,{item:c,checkForQuestionEnabled:n,response:((f=t.item)==null?void 0:f.find(m=>m.linkId===c.linkId))??{linkId:c.linkId},onChange:a},c.linkId):s.jsx(W_,{item:c,response:(p=t.item)==null?void 0:p.find(m=>m.linkId===c.linkId),onChange:a,checkForQuestionEnabled:n},c.linkId)})})]},e.item.linkId):null}function xW(e){const{items:t,response:n,activePage:r,onChange:a,nextStep:o,prevStep:c,numberOfPages:u,renderPages:f,submitButtonText:p,excludeButtons:m,checkForQuestionEnabled:g}=e,v=t.map(b=>{var C;const S=((C=n==null?void 0:n.item)==null?void 0:C.filter(R=>R.linkId===b.linkId))??[],j=b.type===Dt.group?s.jsx(Y_,{item:b,response:S,onChange:a,checkForQuestionEnabled:g},b.linkId):s.jsx(W_,{item:b,response:S==null?void 0:S[0],onChange:a,checkForQuestionEnabled:g},b.linkId);return f?s.jsx(pc.Step,{label:b.text,children:j},b.linkId):j});return s.jsxs(s.Fragment,{children:[f&&s.jsx(pc,{active:r??0,allowNextStepsSelect:!1,p:6,children:v}),!f&&s.jsx(We,{children:v}),!m&&s.jsx(bW,{activePage:r??0,numberOfPages:u,nextStep:f?o:void 0,prevStep:f?c:void 0,renderPages:f,submitButtonText:p})]})}function bW(e){const t=e.renderPages&&e.activePage>0,n=e.renderPages&&e.activePage<e.numberOfPages-1,r=!e.renderPages||e.activePage===e.numberOfPages-1;return s.jsxs(Ce,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&s.jsx(Pe,{onClick:e.prevStep,children:"Back"}),n&&s.jsx(Pe,{onClick:a=>{const o=a.currentTarget.closest("form");e.nextStep&&o.reportValidity()&&e.nextStep()},children:"Next"}),r&&s.jsx(Or,{children:e.submitButtonText??"Submit"})]})}function X_(e){const t=De(),{subject:n,source:r}=e,a=Yt(e.questionnaire),o=oV(a),c=Yt(e.questionnaireResponse),[u,f]=y.useState(c),[p,m]=y.useState(0),g=y.useRef(e.onChange);g.current=e.onChange;const v=y.useRef(e.onSubmit);v.current=e.onSubmit,y.useEffect(()=>{if(c!=null&&c.item&&a){const E=XE(a,c),T=J_(E,a);f(T)}else{if(a&&ZE(o)===ZE(a))return;f(a?XE(a):void 0)}},[c,a,o]),y.useEffect(()=>{if(u&&g.current)try{g.current(u)}catch(E){console.error("Error invoking QuestionnaireForm.onChange callback",E)}},[u]);const b=y.useCallback(E=>{f(T=>wW(T,E,a))},[a]),S=y.useCallback(()=>{const E=v.current;if(E&&a&&u){let T=r;if(!T){const A=t.getProfile();A&&(T=fn(A))}E({...u,questionnaire:a.url??Lt(a),subject:n,source:T,authored:new Date().toISOString(),status:"completed"})}},[t,a,u,n,r]);function j(E){return NQ(E,u)}if(!a||!u)return null;const C=VQ(a),R=()=>m(E=>E+1),D=()=>m(E=>E-1);return s.jsx(F_.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:S,children:[a.title&&s.jsx(Ie,{children:a.title}),s.jsx(xW,{items:a.item??[],response:u,onChange:b,renderPages:!e.disablePagination&&C>1,activePage:p,numberOfPages:C,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:j,nextStep:R,prevStep:D})]})})}function SW(e,t){const n=Z_(e.item??[],t.item??[]);return{...t,item:n.length>0?n:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function Z_(e,t){const n=[],r=new Set;for(const a of e){const o=a.id,c=t.find(u=>u.id===o);c?(n.push(SW(a,c)),r.add(c.id)):n.push(a)}for(const a of t)r.has(a.id)||n.push(a);return n}function ZE(e){return(e==null?void 0:e.id)||e}function wW(e,t,n){if(!t)return{resourceType:"QuestionnaireResponse",status:"in-progress"};const r=(e==null?void 0:e.item)??[],a=Z_(r,Array.isArray(t)?t:[t]),o={resourceType:"QuestionnaireResponse",status:"in-progress",item:a},c=kb((n==null?void 0:n.item)??[],o);return o.item=Pb(a,c),J_(o,n)}function J_(e,t){const n=kb((t==null?void 0:t.item)??[],e);return{resourceType:"QuestionnaireResponse",status:"in-progress",item:Pb(e.item??[],n)}}const jW="_section_4m5it_1",CW={section:jW},EW=["gender","age","gestationalAge","context","appliesTo","category"],TW={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function RW(e){e=Object.assign(TW,e);const t=e.definition,[n,r]=y.useState([]),[a,o]=y.useState(1),[c,u]=y.useState(1);return y.useEffect(()=>{const S=_W(t,u);r(kW(S.qualifiedInterval||[],o))},[t]),s.jsxs(mt,{testid:"reference-range-editor",onSubmit:f,children:[s.jsx(We,{children:n.map(S=>{var j;return s.jsx(DW,{unit:NW((j=t.quantitativeDetails)==null?void 0:j.unit),onChange:g,onAdd:v,onRemove:b,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`)})}),s.jsx(_n,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{hn(S),p({id:`group-id-${a}`,filters:{},intervals:[]}),o(j=>j+1)},children:s.jsx(Fh,{})}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Or,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!OW(j));e.onSubmit({...t,qualifiedInterval:S})}function p(S){r(j=>[...j,S])}function m(S){r(j=>j.filter(C=>C.id!==S.id))}function g(S,j){r(C=>{C=[...C];const R=C.find(E=>E.id===S),D=R==null?void 0:R.intervals.findIndex(E=>E.id===j.id);return D!==void 0&&(R!=null&&R.intervals[D])&&(R.intervals[D]=j),C})}function v(S,j){j.id===void 0&&(j.id=`id-${c}`,u(C=>C+1)),r(C=>{C=[...C];const R=C.findIndex(D=>D.id===S);if(R!==-1){const D={...C[R]};j={...j,...D.filters},D.intervals=[...D.intervals,j],C[R]=D}return C})}function b(S,j){r(C=>{C=[...C];const R=C.find(D=>D.id===S);return R&&(R.intervals=R.intervals.filter(D=>D.id!==j.id)),C})}}function DW(e){const{intervalGroup:t,unit:n}=e;return s.jsx(kd,{"data-testid":t.id,className:CW.section,children:s.jsxs(We,{gap:"lg",children:[s.jsx(Ce,{justify:"flex-end",children:s.jsx(_n,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{hn(r),e.onRemoveGroup(t)},children:s.jsx(Vh,{})},`remove-group-button-${t.id}`)}),s.jsx(AW,{intervalGroup:t,onChange:e.onChange}),s.jsx(jn,{}),t.intervals.map(r=>s.jsxs(We,{gap:"xs",children:[s.jsxs(Ce,{children:[s.jsx(ze,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:a=>{hn(a),e.onChange(t.id,{...r,condition:a.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(_n,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:a=>{hn(a),e.onRemove(t.id,r)},children:s.jsx(Vh,{})},`remove-interval-${r.id}`)]}),s.jsx(Sb,{path:"",onChange:a=>{e.onChange(t.id,{...r,range:a})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(_n,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{hn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(Fh,{})})]})})}function AW(e){var r,a;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const o of["low","high"])(r=t.filters.age[o])!=null&&r.unit||(t.filters.age[o]={...t.filters.age[o],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(We,{style:{maxWidth:"50%"},children:[s.jsx(Ce,{children:s.jsx(ln,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""&&(u=void 0),n(t.id,{...c,gender:u})}}})}),s.jsxs(Ce,{gap:"xs",children:[s.jsx(Ae,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Sb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:o=>{for(const c of t.intervals)n(t.id,{...c,age:o})}},`age-${t.id}`)})]}),s.jsx(ln,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((a=t.filters.context)==null?void 0:a.text)||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""?(u=void 0,n(t.id,{...c,context:void 0})):n(t.id,{...c,context:{text:u,coding:[{code:u,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(ln,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:o=>{for(const c of t.intervals){const u=o.currentTarget.value;u===""?n(t.id,{...c,category:void 0}):n(t.id,{...c,category:u})}}})]})}function _W(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(a=>{var c;const o=parseInt(((c=a.id)==null?void 0:c.substring(3))||"",10);return isNaN(o)?Number.NEGATIVE_INFINITY:o}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(a=>({...a,id:a.id||`id-${r++}`}))},t(r),e}function kW(e,t){let n=1;const r={};for(const a of e){const o=PW(a);o in r||(r[o]={id:`group-id-${n++}`,filters:Object.fromEntries(EW.map(c=>[c,a[c]])),intervals:[]}),r[o].intervals.push(a)}return t(n),Object.values(r)}function PW(e){var n,r;return[`gender=${e.gender}`,`age=${ad(e.age)}`,`gestationalAge=${ad(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(a=>a.text).join("+")}`,`category=${e.category}`].join(":")}function NW(e){return e&&(P$(e,"http://unitsofmeasure.org")||e.text)}function OW(e){var t,n,r,a;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((a=(r=e.range)==null?void 0:r.high)==null?void 0:a.value)===void 0}function MW(e){var p;const t=De(),n=Yt(e.value),[r,a]=y.useState(!1),[o,c]=y.useState();if(y.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(c).catch(console.log),a(!0))},[t,n,r]),!n||!o)return null;return s.jsx(or,{children:(p=n.action)==null?void 0:p.map((m,g)=>{var j,C,R,D,E,T;const v=m.resource&&f(m.resource),b=(C=(j=v==null?void 0:v.input)==null?void 0:j[0])==null?void 0:C.valueReference,S=(D=(R=v==null?void 0:v.output)==null?void 0:R[0])==null?void 0:D.valueReference;return s.jsxs(y.Fragment,{children:[s.jsx(or.Col,{span:1,p:"md",children:(v==null?void 0:v.status)==="completed"?s.jsx(RV,{}):s.jsx(JV,{color:"gray"})}),s.jsxs(or.Col,{span:9,p:"xs",children:[s.jsx(Ae,{fw:500,children:m.title}),m.description&&s.jsx("div",{children:m.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Mc,{value:(E=v==null?void 0:v.meta)==null?void 0:E.author})," on ",gr((T=v==null?void 0:v.meta)==null?void 0:T.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(Eb,{status:(v==null?void 0:v.status)||"unknown"})]})]}),s.jsxs(or.Col,{span:2,p:"md",children:[b&&!S&&s.jsx(Pe,{onClick:()=>e.onStart(v,b),children:"Start"}),b&&S&&s.jsx(Pe,{onClick:()=>e.onEdit(v,b,S),children:"Edit"})]})]},`action-${g}`)})});function u(m){var v;const g=[];if(m.action)for(const b of m.action)(v=b.resource)!=null&&v.reference&&g.push({request:{method:"GET",url:b.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:g}}function f(m){for(const g of(o==null?void 0:o.entry)??[])if(g.resource&&m.reference===Lt(g.resource))return g.resource}}function ek(e,t){const n=IW(e,t);return LW(n,e,t)}function IW(e,t){const n=e.length,r=t.length,a=n+r+1,o=1+2*a,c=o/2|0,u=new Array(o);u[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<a;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,v=m-1,b=u[g],S=u[v];let j,C=0;p===-f||p!==f&&S.i<b.i?(C=b.i,j=b):(C=S.i+1,j=S),u[v]=void 0;let R=C-p,D={i:C,j:R,prev:zW(j),snake:!1};for(;C<n&&R<r&&e[C]===t[R];)C++,R++;if(C>D.i&&(D={i:C,j:R,prev:D,snake:!0}),u[m]=D,C>=n&&R>=r)return u[m]}u[c+f-1]=void 0}}function LW(e,t,n){const r=[];let a=e;for(a.snake&&(a=a.prev);a!=null&&a.prev&&a.prev.j>=0;){const o=a.i,c=a.j;a=a.prev;const u=a.i,f=a.j,p={position:u,lines:t.slice(u,o)},m={position:f,lines:n.slice(f,c)};let g;p.lines.length===0&&m.lines.length>0?g="insert":p.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:p,revised:m,type:g}),a.snake&&(a=a.prev)}return r}function zW(e){return e&&!e.snake&&e.prev?e.prev:e}function $W(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>{var a;return{meta:(a=r.resource)==null?void 0:a.meta,lines:Ia(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,a)=>r.meta.lastUpdated.localeCompare(a.meta.lastUpdated));if(!t.length)return[];const n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return UW(n,t),BW(n),n}function UW(e,t){for(let n=1;n<t.length;n++){const r=ek(t[n-1].lines,t[n].lines);for(const a of r){const o=a.original.position,c=a.original.lines,u=a.revised.lines;if((a.type==="delete"||a.type==="change")&&e.splice(o,c.length),a.type==="insert"||a.type==="change")for(let f=0;f<a.revised.lines.length;f++)e.splice(o+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:u[f],span:1})}}}function BW(e){let t=0;for(;t<e.length;){let n=t;for(;n<e.length&&e[n].id===e[t].id;)e[n].span=-1,n++;e[t].span=n-t,t=n}}const VW="_container_1oj0p_1",FW="_root_1oj0p_5",HW="_startRow_1oj0p_20",qW="_normalRow_1oj0p_24",GW="_author_1oj0p_28",QW="_dateTime_1oj0p_32",WW="_lineNumber_1oj0p_37",YW="_line_1oj0p_37",KW="_pre_1oj0p_52",Ni={container:VW,root:FW,startRow:HW,normalRow:qW,author:GW,dateTime:QW,lineNumber:WW,line:YW,pre:KW};function XW(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function ZW(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Yl(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Yl(r,"month");const a=Math.floor(t/86400);if(a>0)return Yl(a,"day");const o=Math.floor(t/3600);if(o>0)return Yl(o,"hour");const c=Math.floor(t/60);return c>0?Yl(c,"minute"):Yl(t,"second")}function Yl(e,t){return`${e} ${e===1?t:t+"s"} ago`}function JW(e){var c,u;const t=De(),[n,r]=y.useState(e.history);if(y.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const a=(u=(c=n.entry)==null?void 0:c[0])==null?void 0:u.resource;if(!a)return null;const o=$W(n);return s.jsx("div",{className:Ni.container,children:s.jsx("table",{className:Ni.root,children:s.jsx("tbody",{children:o.map((f,p)=>s.jsxs("tr",{className:f.span>0?Ni.startRow:Ni.normalRow,children:[f.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:Ni.author,rowSpan:f.span,children:s.jsx(ic,{value:f.meta.author,link:!0})}),s.jsx("td",{className:Ni.dateTime,rowSpan:f.span,children:s.jsx(bt,{to:XW(a,f.meta.versionId),children:ZW(f.meta.lastUpdated)})})]}),s.jsx("td",{className:Ni.lineNumber,children:p+1}),s.jsx("td",{className:Ni.line,children:s.jsx("pre",{className:Ni.pre,children:f.value})})]},"row-"+p))})})})}const eY="_removed_el5zk_1",tY="_added_el5zk_6",JE={removed:eY,added:tY};function nY(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Ia(t,!0).match(/[^\r\n]+/g),a=Ia(n,!0).match(/[^\r\n]+/g),o=ek(r,a);return s.jsx("pre",{style:{color:"gray"},children:o.map((c,u)=>s.jsx(rY,{delta:c},"delta"+u))})}function rY(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:JE.removed,children:e.delta.original.lines.join(`
532
- `)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:JE.added,children:e.delta.revised.lines.join(`
533
- `)}),"...",s.jsx("br",{})]})}const aY="_splitButton_1i0gi_1",iY="_menuControl_1i0gi_6",eT={splitButton:aY,menuControl:iY};function Gh(e){const{outcome:t}=e,n=De(),r=Yt(e.defaultValue),a=r==null?void 0:r.resourceType,[o,c]=y.useState(!1),[u,f]=y.useState(),p=n.getAccessPolicy(),m=Sn();y.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=kc(b);if(S){c(!0);const j=XB(r,S);f(j)}else console.error(`Schema not found for ${b}`)}).catch(S=>{console.error("Error in requestProfileSchema",S)})}else n.requestSchema(a).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,a,e.profileUrl]);const g=y.useMemo(()=>r&&TA(r,ec.READ,p),[p,r]),v=y.useMemo(()=>n.isSuperAdmin()||!p||!En(u==null?void 0:u.resourceType)?!0:nB(p,u==null?void 0:u.resourceType),[n,p,u==null?void 0:u.resourceType]);return!o||!u?s.jsx("div",{children:"Loading..."}):v?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[s.jsxs(We,{mb:"xl",children:[s.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(ze,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),s.jsx(zt,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(ze,{name:"id",defaultValue:u.id,disabled:!0})})]}),s.jsx(Cb,{path:u.resourceType,valuePath:u.resourceType,typeName:a,defaultValue:u,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),s.jsxs(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[s.jsx(Pe,{type:"submit",className:$t((e.onPatch||e.onDelete)&&eT.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&s.jsxs(je,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[s.jsx(je.Target,{children:s.jsx(_n,{variant:"filled",color:m.primaryColor,size:36,className:eT.menuControl,"aria-label":"More actions",children:s.jsx(ob,{size:14,stroke:1.5})})}),s.jsxs(je.Dropdown,{children:[e.onPatch&&s.jsx(je.Item,{leftSection:s.jsx(HA,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&s.jsx(je.Item,{color:"red",leftSection:s.jsx(ub,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):s.jsxs(Yi,{color:"red",title:"Permission denied",icon:s.jsx(Js,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function oY(e){var a;const t=De(),[n,r]=y.useState(e.history);return y.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?s.jsxs(Oe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(Oe.Thead,{children:s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Th,{children:"Author"}),s.jsx(Oe.Th,{children:"Date"}),s.jsx(Oe.Th,{children:"Version"})]})}),s.jsx(Oe.Tbody,{children:(a=n.entry)==null?void 0:a.map((o,c)=>s.jsx(sY,{entry:o},"entry-"+c))})]}):s.jsx("div",{children:"Loading..."})}function sY(e){var r,a,o;const{response:t,resource:n}=e.entry;return n?s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:s.jsx(ic,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(Oe.Td,{children:gr((a=n.meta)==null?void 0:a.lastUpdated)}),s.jsx(Oe.Td,{children:s.jsx(bt,{to:lY(n),children:(o=n.meta)==null?void 0:o.versionId})})]}):s.jsx(Oe.Tr,{children:s.jsx(Oe.Td,{colSpan:3,children:Ke(t==null?void 0:t.outcome)})})}function lY(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function cY(e){const{serviceRequest:t,...n}=e;return s.jsx(Zp,{value:t,loadTimelineResources:async(r,a,o)=>{const c=`${a}/${o}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",o),r.search("Communication",{"based-on":c,_count:u}),r.search("DiagnosticReport",{"based-on":c,_count:u}),r.search("Media",{"based-on":c,_count:u}),r.search("DocumentReference",{related:c,_count:u}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:u})])},createCommunication:(r,a,o)=>({resourceType:"Communication",status:"completed",basedOn:[fn(r)],subject:r.subject,sender:fn(a),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,a,o)=>({resourceType:"Media",status:"completed",basedOn:[fn(r)],subject:r.subject,operator:fn(a),issued:new Date().toISOString(),content:o}),...n})}function uY(e){const t=De(),{client:n,patient:r,encounter:a,children:o,...c}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:a}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",G0(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),window.location.assign(p.toString())}).catch(f=>_e({color:"red",message:Ke(f),autoClose:!1}))}return s.jsx(Pt,{onClick:()=>u(),...c,children:o})}var Qv={exports:{}},Iu={},Wv={exports:{}},Yv={};/**
534
- * @license React
535
- * scheduler.production.js
536
- *
537
- * Copyright (c) Meta Platforms, Inc. and affiliates.
538
- *
539
- * This source code is licensed under the MIT license found in the
540
- * LICENSE file in the root directory of this source tree.
541
- */var tT;function dY(){return tT||(tT=1,function(e){function t(P,I){var z=P.length;P.push(I);e:for(;0<z;){var F=z-1>>>1,O=P[F];if(0<a(O,I))P[F]=I,P[z]=O,z=F;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var I=P[0],z=P.pop();if(z!==I){P[0]=z;e:for(var F=0,O=P.length,U=O>>>1;F<U;){var J=2*(F+1)-1,te=P[J],ye=J+1,be=P[ye];if(0>a(te,z))ye<O&&0>a(be,te)?(P[F]=be,P[ye]=z,F=ye):(P[F]=te,P[J]=z,F=J);else if(ye<O&&0>a(be,z))P[F]=be,P[ye]=z,F=ye;else break e}}return I}function a(P,I){var z=P.sortIndex-I.sortIndex;return z!==0?z:P.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],p=[],m=1,g=null,v=3,b=!1,S=!1,j=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function T(P){for(var I=n(p);I!==null;){if(I.callback===null)r(p);else if(I.startTime<=P)r(p),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(p)}}function A(P){if(j=!1,T(P),!S)if(n(f)!==null)S=!0,_||(_=!0,W());else{var I=n(p);I!==null&&Z(A,I.startTime-P)}}var _=!1,M=-1,L=5,$=-1;function V(){return C?!0:!(e.unstable_now()-$<L)}function Y(){if(C=!1,_){var P=e.unstable_now();$=P;var I=!0;try{e:{S=!1,j&&(j=!1,D(M),M=-1),b=!0;var z=v;try{t:{for(T(P),g=n(f);g!==null&&!(g.expirationTime>P&&V());){var F=g.callback;if(typeof F=="function"){g.callback=null,v=g.priorityLevel;var O=F(g.expirationTime<=P);if(P=e.unstable_now(),typeof O=="function"){g.callback=O,T(P),I=!0;break t}g===n(f)&&r(f),T(P)}else r(f);g=n(f)}if(g!==null)I=!0;else{var U=n(p);U!==null&&Z(A,U.startTime-P),I=!1}}break e}finally{g=null,v=z,b=!1}I=void 0}}finally{I?W():_=!1}}}var W;if(typeof E=="function")W=function(){E(Y)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,X=G.port2;G.port1.onmessage=Y,W=function(){X.postMessage(null)}}else W=function(){R(Y,0)};function Z(P,I){M=R(function(){P(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(P){switch(v){case 1:case 2:case 3:var I=3;break;default:I=v}var z=v;v=I;try{return P()}finally{v=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(P,I){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var z=v;v=P;try{return I()}finally{v=z}},e.unstable_scheduleCallback=function(P,I,z){var F=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?F+z:F):z=F,P){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=z+O,P={id:m++,callback:I,priorityLevel:P,startTime:z,expirationTime:O,sortIndex:-1},z>F?(P.sortIndex=z,t(p,P),n(f)===null&&P===n(p)&&(j?(D(M),M=-1):j=!0,Z(A,z-F))):(P.sortIndex=O,t(f,P),S||b||(S=!0,_||(_=!0,W()))),P},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(P){var I=v;return function(){var z=v;v=I;try{return P.apply(this,arguments)}finally{v=z}}}}(Yv)),Yv}var nT;function fY(){return nT||(nT=1,Wv.exports=dY()),Wv.exports}/**
542
- * @license React
543
- * react-dom-client.production.js
544
- *
545
- * Copyright (c) Meta Platforms, Inc. and affiliates.
546
- *
547
- * This source code is licensed under the MIT license found in the
548
- * LICENSE file in the root directory of this source tree.
549
- */var rT;function hY(){if(rT)return Iu;rT=1;var e=fY(),t=ex(),n=jR();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var l=i,d=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(d=l.return),i=l.return;while(i)}return l.tag===3?d:null}function c(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function u(i){if(o(i)!==i)throw Error(r(188))}function f(i){var l=i.alternate;if(!l){if(l=o(i),l===null)throw Error(r(188));return l!==i?null:i}for(var d=i,h=l;;){var x=d.return;if(x===null)break;var w=x.alternate;if(w===null){if(h=x.return,h!==null){d=h;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===d)return u(x),i;if(w===h)return u(x),l;w=w.sibling}throw Error(r(188))}if(d.return!==h.return)d=x,h=w;else{for(var k=!1,N=x.child;N;){if(N===d){k=!0,d=x,h=w;break}if(N===h){k=!0,h=x,d=w;break}N=N.sibling}if(!k){for(N=w.child;N;){if(N===d){k=!0,d=w,h=x;break}if(N===h){k=!0,h=w,d=x;break}N=N.sibling}if(!k)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?i:l}function p(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=p(i),l!==null)return l;i=i.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),D=Symbol.for("react.consumer"),E=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function W(i){return i===null||typeof i!="object"?null:(i=Y&&i[Y]||i["@@iterator"],typeof i=="function"?i:null)}var G=Symbol.for("react.client.reference");function X(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===G?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case C:return"Profiler";case j:return"StrictMode";case A:return"Suspense";case _:return"SuspenseList";case $:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case E:return(i.displayName||"Context")+".Provider";case D:return(i._context.displayName||"Context")+".Consumer";case T:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case M:return l=i.displayName||null,l!==null?l:X(i.type)||"Memo";case L:l=i._payload,i=i._init;try{return X(i(l))}catch{}}return null}var Z=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},F=[],O=-1;function U(i){return{current:i}}function J(i){0>O||(i.current=F[O],F[O]=null,O--)}function te(i,l){O++,F[O]=i.current,i.current=l}var ye=U(null),be=U(null),ve=U(null),Ge=U(null);function ke(i,l){switch(te(ve,l),te(be,i),te(ye,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?rj(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=rj(l),i=aj(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}J(ye),te(ye,i)}function et(){J(ye),J(be),J(ve)}function Re(i){i.memoizedState!==null&&te(Ge,i);var l=ye.current,d=aj(l,i.type);l!==d&&(te(be,i),te(ye,d))}function ft(i){be.current===i&&(J(ye),J(be)),Ge.current===i&&(J(Ge),Eu._currentValue=z)}var Ut=Object.prototype.hasOwnProperty,Ot=e.unstable_scheduleCallback,xt=e.unstable_cancelCallback,Ht=e.unstable_shouldYield,Bt=e.unstable_requestPaint,Se=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,Ve=e.unstable_ImmediatePriority,Te=e.unstable_UserBlockingPriority,ge=e.unstable_NormalPriority,we=e.unstable_LowPriority,Le=e.unstable_IdlePriority,xe=e.log,$e=e.unstable_setDisableYieldValue,gt=null,ht=null;function Wt(i){if(typeof xe=="function"&&$e(i),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(gt,i)}catch{}}var _t=Math.clz32?Math.clz32:Ba,mn=Math.log,St=Math.LN2;function Ba(i){return i>>>=0,i===0?32:31-(mn(i)/St|0)|0}var ba=256,pi=4194304;function Sa(i){var l=i&42;if(l!==0)return l;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Yn(i,l,d){var h=i.pendingLanes;if(h===0)return 0;var x=0,w=i.suspendedLanes,k=i.pingedLanes;i=i.warmLanes;var N=h&134217727;return N!==0?(h=N&~w,h!==0?x=Sa(h):(k&=N,k!==0?x=Sa(k):d||(d=N&~i,d!==0&&(x=Sa(d))))):(N=h&~w,N!==0?x=Sa(N):k!==0?x=Sa(k):d||(d=h&~i,d!==0&&(x=Sa(d)))),x===0?0:l!==0&&l!==x&&(l&w)===0&&(w=x&-x,d=l&-l,w>=d||w===32&&(d&4194048)!==0)?l:x}function xr(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function al(i,l){switch(i){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function no(){var i=ba;return ba<<=1,(ba&4194048)===0&&(ba=256),i}function Xo(){var i=pi;return pi<<=1,(pi&62914560)===0&&(pi=4194304),i}function Va(i){for(var l=[],d=0;31>d;d++)l.push(i);return l}function wa(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ja(i,l,d,h,x,w){var k=i.pendingLanes;i.pendingLanes=d,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=d,i.entangledLanes&=d,i.errorRecoveryDisabledLanes&=d,i.shellSuspendCounter=0;var N=i.entanglements,B=i.expirationTimes,ne=i.hiddenUpdates;for(d=k&~d;0<d;){var ue=31-_t(d),pe=1<<ue;N[ue]=0,B[ue]=-1;var ae=ne[ue];if(ae!==null)for(ne[ue]=null,ue=0;ue<ae.length;ue++){var ie=ae[ue];ie!==null&&(ie.lane&=-536870913)}d&=~pe}h!==0&&kn(i,h,0),w!==0&&x===0&&i.tag!==0&&(i.suspendedLanes|=w&~(k&~l))}function kn(i,l,d){i.pendingLanes|=l,i.suspendedLanes&=~l;var h=31-_t(l);i.entangledLanes|=l,i.entanglements[h]=i.entanglements[h]|1073741824|d&4194090}function mi(i,l){var d=i.entangledLanes|=l;for(i=i.entanglements;d;){var h=31-_t(d),x=1<<h;x&l|i[h]&l&&(i[h]|=l),d&=~x}}function il(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Zo(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function H(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:jj(i.type))}function Q(i,l){var d=I.p;try{return I.p=i,l()}finally{I.p=d}}var re=Math.random().toString(36).slice(2),he="__reactFiber$"+re,Ee="__reactProps$"+re,Be="__reactContainer$"+re,tt="__reactEvents$"+re,Ue="__reactListeners$"+re,Xe="__reactHandles$"+re,Ze="__reactResources$"+re,rt="__reactMarker$"+re;function Ye(i){delete i[he],delete i[Ee],delete i[tt],delete i[Ue],delete i[Xe]}function lt(i){var l=i[he];if(l)return l;for(var d=i.parentNode;d;){if(l=d[Be]||d[he]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(i=lj(i);i!==null;){if(d=i[he])return d;i=lj(i)}return l}i=d,d=i.parentNode}return null}function At(i){if(i=i[he]||i[Be]){var l=i.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return i}return null}function at(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function rn(i){var l=i[Ze];return l||(l=i[Ze]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function kt(i){i[rt]=!0}var jt=new Set,Fa={};function cr(i,l){Kr(i,l),Kr(i+"Capture",l)}function Kr(i,l){for(Fa[i]=l,i=0;i<l.length;i++)jt.add(l[i])}var br=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ro={},ao={};function Ic(i){return Ut.call(ao,i)?!0:Ut.call(ro,i)?!1:br.test(i)?ao[i]=!0:(ro[i]=!0,!1)}function Xr(i,l,d){if(Ic(l))if(d===null)i.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+d)}}function gi(i,l,d){if(d===null)i.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+d)}}function Ct(i,l,d,h){if(h===null)i.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(d);return}i.setAttributeNS(l,d,""+h)}}var nr,Ca;function Ea(i){if(nr===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);nr=l&&l[1]||"",Ca=-1<d.stack.indexOf(`
550
- at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
551
- `+nr+i+Ca}var Jo=!1;function xn(i,l){if(!i||Jo)return"";Jo=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ie){var ae=ie}Reflect.construct(i,[],pe)}else{try{pe.call()}catch(ie){ae=ie}i.call(pe.prototype)}}else{try{throw Error()}catch(ie){ae=ie}(pe=i())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ie){if(ie&&ae&&typeof ie.stack=="string")return[ie.stack,ae.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),k=w[0],N=w[1];if(k&&N){var B=k.split(`
552
- `),ne=N.split(`
553
- `);for(x=h=0;h<B.length&&!B[h].includes("DetermineComponentFrameRoot");)h++;for(;x<ne.length&&!ne[x].includes("DetermineComponentFrameRoot");)x++;if(h===B.length||x===ne.length)for(h=B.length-1,x=ne.length-1;1<=h&&0<=x&&B[h]!==ne[x];)x--;for(;1<=h&&0<=x;h--,x--)if(B[h]!==ne[x]){if(h!==1||x!==1)do if(h--,x--,0>x||B[h]!==ne[x]){var ue=`
554
- `+B[h].replace(" at new "," at ");return i.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",i.displayName)),ue}while(1<=h&&0<=x);break}}}finally{Jo=!1,Error.prepareStackTrace=d}return(d=i?i.displayName||i.name:"")?Ea(d):""}function io(i){switch(i.tag){case 26:case 27:case 5:return Ea(i.type);case 16:return Ea("Lazy");case 13:return Ea("Suspense");case 19:return Ea("SuspenseList");case 0:case 15:return xn(i.type,!1);case 11:return xn(i.type.render,!1);case 1:return xn(i.type,!0);case 31:return Ea("Activity");default:return""}}function Lc(i){try{var l="";do l+=io(i),i=i.return;while(i);return l}catch(d){return`
555
- Error generating stack: `+d.message+`
556
- `+d.stack}}function Sr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Zb(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Gk(i){var l=Zb(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),h=""+i[l];if(!i.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,w=d.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return x.call(this)},set:function(k){h=""+k,w.call(this,k)}}),Object.defineProperty(i,l,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(k){h=""+k},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Vd(i){i._valueTracker||(i._valueTracker=Gk(i))}function Jb(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var d=l.getValue(),h="";return i&&(h=Zb(i)?i.checked?"true":"false":i.value),i=h,i!==d?(l.setValue(i),!0):!1}function Fd(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Qk=/[\n"\\]/g;function Zr(i){return i.replace(Qk,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function om(i,l,d,h,x,w,k,N){i.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?i.type=k:i.removeAttribute("type"),l!=null?k==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+Sr(l)):i.value!==""+Sr(l)&&(i.value=""+Sr(l)):k!=="submit"&&k!=="reset"||i.removeAttribute("value"),l!=null?sm(i,k,Sr(l)):d!=null?sm(i,k,Sr(d)):h!=null&&i.removeAttribute("value"),x==null&&w!=null&&(i.defaultChecked=!!w),x!=null&&(i.checked=x&&typeof x!="function"&&typeof x!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+Sr(N):i.removeAttribute("name")}function e1(i,l,d,h,x,w,k,N){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.type=w),l!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||l!=null))return;d=d!=null?""+Sr(d):"",l=l!=null?""+Sr(l):d,N||l===i.value||(i.value=l),i.defaultValue=l}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=N?i.checked:!!h,i.defaultChecked=!!h,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.name=k)}function sm(i,l,d){l==="number"&&Fd(i.ownerDocument)===i||i.defaultValue===""+d||(i.defaultValue=""+d)}function ol(i,l,d,h){if(i=i.options,l){l={};for(var x=0;x<d.length;x++)l["$"+d[x]]=!0;for(d=0;d<i.length;d++)x=l.hasOwnProperty("$"+i[d].value),i[d].selected!==x&&(i[d].selected=x),x&&h&&(i[d].defaultSelected=!0)}else{for(d=""+Sr(d),l=null,x=0;x<i.length;x++){if(i[x].value===d){i[x].selected=!0,h&&(i[x].defaultSelected=!0);return}l!==null||i[x].disabled||(l=i[x])}l!==null&&(l.selected=!0)}}function t1(i,l,d){if(l!=null&&(l=""+Sr(l),l!==i.value&&(i.value=l),d==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=d!=null?""+Sr(d):""}function n1(i,l,d,h){if(l==null){if(h!=null){if(d!=null)throw Error(r(92));if(Z(h)){if(1<h.length)throw Error(r(93));h=h[0]}d=h}d==null&&(d=""),l=d}d=Sr(l),i.defaultValue=d,h=i.textContent,h===d&&h!==""&&h!==null&&(i.value=h)}function sl(i,l){if(l){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=l;return}}i.textContent=l}var Wk=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function r1(i,l,d){var h=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?h?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":h?i.setProperty(l,d):typeof d!="number"||d===0||Wk.has(l)?l==="float"?i.cssFloat=d:i[l]=(""+d).trim():i[l]=d+"px"}function a1(i,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,d!=null){for(var h in d)!d.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var x in l)h=l[x],l.hasOwnProperty(x)&&d[x]!==h&&r1(i,x,h)}else for(var w in l)l.hasOwnProperty(w)&&r1(i,w,l[w])}function lm(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Yk=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Kk=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hd(i){return Kk.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var cm=null;function um(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ll=null,cl=null;function i1(i){var l=At(i);if(l&&(i=l.stateNode)){var d=i[Ee]||null;e:switch(i=l.stateNode,l.type){case"input":if(om(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),l=d.name,d.type==="radio"&&l!=null){for(d=i;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Zr(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var h=d[l];if(h!==i&&h.form===i.form){var x=h[Ee]||null;if(!x)throw Error(r(90));om(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<d.length;l++)h=d[l],h.form===i.form&&Jb(h)}break e;case"textarea":t1(i,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&ol(i,!!d.multiple,l,!1)}}}var dm=!1;function o1(i,l,d){if(dm)return i(l,d);dm=!0;try{var h=i(l);return h}finally{if(dm=!1,(ll!==null||cl!==null)&&(_f(),ll&&(l=ll,i=cl,cl=ll=null,i1(l),i)))for(l=0;l<i.length;l++)i1(i[l])}}function zc(i,l){var d=i.stateNode;if(d===null)return null;var h=d[Ee]||null;if(h===null)return null;d=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var vi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fm=!1;if(vi)try{var $c={};Object.defineProperty($c,"passive",{get:function(){fm=!0}}),window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{fm=!1}var oo=null,hm=null,qd=null;function s1(){if(qd)return qd;var i,l=hm,d=l.length,h,x="value"in oo?oo.value:oo.textContent,w=x.length;for(i=0;i<d&&l[i]===x[i];i++);var k=d-i;for(h=1;h<=k&&l[d-h]===x[w-h];h++);return qd=x.slice(i,1<h?1-h:void 0)}function Gd(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function Qd(){return!0}function l1(){return!1}function wr(i){function l(d,h,x,w,k){this._reactName=d,this._targetInst=x,this.type=h,this.nativeEvent=w,this.target=k,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(d=i[N],this[N]=d?d(w):w[N]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Qd:l1,this.isPropagationStopped=l1,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Qd)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Qd)},persist:function(){},isPersistent:Qd}),l}var es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wd=wr(es),Uc=m({},es,{view:0,detail:0}),Xk=wr(Uc),pm,mm,Bc,Yd=m({},Uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vm,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Bc&&(Bc&&i.type==="mousemove"?(pm=i.screenX-Bc.screenX,mm=i.screenY-Bc.screenY):mm=pm=0,Bc=i),pm)},movementY:function(i){return"movementY"in i?i.movementY:mm}}),c1=wr(Yd),Zk=m({},Yd,{dataTransfer:0}),Jk=wr(Zk),e4=m({},Uc,{relatedTarget:0}),gm=wr(e4),t4=m({},es,{animationName:0,elapsedTime:0,pseudoElement:0}),n4=wr(t4),r4=m({},es,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),a4=wr(r4),i4=m({},es,{data:0}),u1=wr(i4),o4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s4={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"},l4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function c4(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=l4[i])?!!l[i]:!1}function vm(){return c4}var u4=m({},Uc,{key:function(i){if(i.key){var l=o4[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Gd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?s4[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vm,charCode:function(i){return i.type==="keypress"?Gd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Gd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),d4=wr(u4),f4=m({},Yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),d1=wr(f4),h4=m({},Uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vm}),p4=wr(h4),m4=m({},es,{propertyName:0,elapsedTime:0,pseudoElement:0}),g4=wr(m4),v4=m({},Yd,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),y4=wr(v4),x4=m({},es,{newState:0,oldState:0}),b4=wr(x4),S4=[9,13,27,32],ym=vi&&"CompositionEvent"in window,Vc=null;vi&&"documentMode"in document&&(Vc=document.documentMode);var w4=vi&&"TextEvent"in window&&!Vc,f1=vi&&(!ym||Vc&&8<Vc&&11>=Vc),h1=" ",p1=!1;function m1(i,l){switch(i){case"keyup":return S4.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function g1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ul=!1;function j4(i,l){switch(i){case"compositionend":return g1(l);case"keypress":return l.which!==32?null:(p1=!0,h1);case"textInput":return i=l.data,i===h1&&p1?null:i;default:return null}}function C4(i,l){if(ul)return i==="compositionend"||!ym&&m1(i,l)?(i=s1(),qd=hm=oo=null,ul=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return f1&&l.locale!=="ko"?null:l.data;default:return null}}var E4={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 v1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!E4[i.type]:l==="textarea"}function y1(i,l,d,h){ll?cl?cl.push(h):cl=[h]:ll=h,l=If(l,"onChange"),0<l.length&&(d=new Wd("onChange","change",null,d,h),i.push({event:d,listeners:l}))}var Fc=null,Hc=null;function T4(i){Zw(i,0)}function Kd(i){var l=at(i);if(Jb(l))return i}function x1(i,l){if(i==="change")return l}var b1=!1;if(vi){var xm;if(vi){var bm="oninput"in document;if(!bm){var S1=document.createElement("div");S1.setAttribute("oninput","return;"),bm=typeof S1.oninput=="function"}xm=bm}else xm=!1;b1=xm&&(!document.documentMode||9<document.documentMode)}function w1(){Fc&&(Fc.detachEvent("onpropertychange",j1),Hc=Fc=null)}function j1(i){if(i.propertyName==="value"&&Kd(Hc)){var l=[];y1(l,Hc,i,um(i)),o1(T4,l)}}function R4(i,l,d){i==="focusin"?(w1(),Fc=l,Hc=d,Fc.attachEvent("onpropertychange",j1)):i==="focusout"&&w1()}function D4(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Kd(Hc)}function A4(i,l){if(i==="click")return Kd(l)}function _4(i,l){if(i==="input"||i==="change")return Kd(l)}function k4(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var Ir=typeof Object.is=="function"?Object.is:k4;function qc(i,l){if(Ir(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var d=Object.keys(i),h=Object.keys(l);if(d.length!==h.length)return!1;for(h=0;h<d.length;h++){var x=d[h];if(!Ut.call(l,x)||!Ir(i[x],l[x]))return!1}return!0}function C1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function E1(i,l){var d=C1(i);i=0;for(var h;d;){if(d.nodeType===3){if(h=i+d.textContent.length,i<=l&&h>=l)return{node:d,offset:l-i};i=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=C1(d)}}function T1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?T1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function R1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=Fd(i.document);l instanceof i.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)i=l.contentWindow;else break;l=Fd(i.document)}return l}function Sm(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}var P4=vi&&"documentMode"in document&&11>=document.documentMode,dl=null,wm=null,Gc=null,jm=!1;function D1(i,l,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;jm||dl==null||dl!==Fd(h)||(h=dl,"selectionStart"in h&&Sm(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Gc&&qc(Gc,h)||(Gc=h,h=If(wm,"onSelect"),0<h.length&&(l=new Wd("onSelect","select",null,l,d),i.push({event:l,listeners:h}),l.target=dl)))}function ts(i,l){var d={};return d[i.toLowerCase()]=l.toLowerCase(),d["Webkit"+i]="webkit"+l,d["Moz"+i]="moz"+l,d}var fl={animationend:ts("Animation","AnimationEnd"),animationiteration:ts("Animation","AnimationIteration"),animationstart:ts("Animation","AnimationStart"),transitionrun:ts("Transition","TransitionRun"),transitionstart:ts("Transition","TransitionStart"),transitioncancel:ts("Transition","TransitionCancel"),transitionend:ts("Transition","TransitionEnd")},Cm={},A1={};vi&&(A1=document.createElement("div").style,"AnimationEvent"in window||(delete fl.animationend.animation,delete fl.animationiteration.animation,delete fl.animationstart.animation),"TransitionEvent"in window||delete fl.transitionend.transition);function ns(i){if(Cm[i])return Cm[i];if(!fl[i])return i;var l=fl[i],d;for(d in l)if(l.hasOwnProperty(d)&&d in A1)return Cm[i]=l[d];return i}var _1=ns("animationend"),k1=ns("animationiteration"),P1=ns("animationstart"),N4=ns("transitionrun"),O4=ns("transitionstart"),M4=ns("transitioncancel"),N1=ns("transitionend"),O1=new Map,Em="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Em.push("scrollEnd");function Ta(i,l){O1.set(i,l),cr(l,[i])}var M1=new WeakMap;function Jr(i,l){if(typeof i=="object"&&i!==null){var d=M1.get(i);return d!==void 0?d:(l={value:i,source:l,stack:Lc(l)},M1.set(i,l),l)}return{value:i,source:l,stack:Lc(l)}}var ea=[],hl=0,Tm=0;function Xd(){for(var i=hl,l=Tm=hl=0;l<i;){var d=ea[l];ea[l++]=null;var h=ea[l];ea[l++]=null;var x=ea[l];ea[l++]=null;var w=ea[l];if(ea[l++]=null,h!==null&&x!==null){var k=h.pending;k===null?x.next=x:(x.next=k.next,k.next=x),h.pending=x}w!==0&&I1(d,x,w)}}function Zd(i,l,d,h){ea[hl++]=i,ea[hl++]=l,ea[hl++]=d,ea[hl++]=h,Tm|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function Rm(i,l,d,h){return Zd(i,l,d,h),Jd(i)}function pl(i,l){return Zd(i,null,null,l),Jd(i)}function I1(i,l,d){i.lanes|=d;var h=i.alternate;h!==null&&(h.lanes|=d);for(var x=!1,w=i.return;w!==null;)w.childLanes|=d,h=w.alternate,h!==null&&(h.childLanes|=d),w.tag===22&&(i=w.stateNode,i===null||i._visibility&1||(x=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,x&&l!==null&&(x=31-_t(d),i=w.hiddenUpdates,h=i[x],h===null?i[x]=[l]:h.push(l),l.lane=d|536870912),w):null}function Jd(i){if(50<vu)throw vu=0,Ng=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var ml={};function I4(i,l,d,h){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(i,l,d,h){return new I4(i,l,d,h)}function Dm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function yi(i,l){var d=i.alternate;return d===null?(d=Lr(i.tag,l,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=l,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&65011712,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,l=i.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d.refCleanup=i.refCleanup,d}function L1(i,l){i.flags&=65011714;var d=i.alternate;return d===null?(i.childLanes=0,i.lanes=l,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=d.childLanes,i.lanes=d.lanes,i.child=d.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=d.memoizedProps,i.memoizedState=d.memoizedState,i.updateQueue=d.updateQueue,i.type=d.type,l=d.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function ef(i,l,d,h,x,w){var k=0;if(h=i,typeof i=="function")Dm(i)&&(k=1);else if(typeof i=="string")k=zP(i,d,ye.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case $:return i=Lr(31,d,l,x),i.elementType=$,i.lanes=w,i;case S:return rs(d.children,x,w,l);case j:k=8,x|=24;break;case C:return i=Lr(12,d,l,x|2),i.elementType=C,i.lanes=w,i;case A:return i=Lr(13,d,l,x),i.elementType=A,i.lanes=w,i;case _:return i=Lr(19,d,l,x),i.elementType=_,i.lanes=w,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:case E:k=10;break e;case D:k=9;break e;case T:k=11;break e;case M:k=14;break e;case L:k=16,h=null;break e}k=29,d=Error(r(130,i===null?"null":typeof i,"")),h=null}return l=Lr(k,d,l,x),l.elementType=i,l.type=h,l.lanes=w,l}function rs(i,l,d,h){return i=Lr(7,i,h,l),i.lanes=d,i}function Am(i,l,d){return i=Lr(6,i,null,l),i.lanes=d,i}function _m(i,l,d){return l=Lr(4,i.children!==null?i.children:[],i.key,l),l.lanes=d,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var gl=[],vl=0,tf=null,nf=0,ta=[],na=0,as=null,xi=1,bi="";function is(i,l){gl[vl++]=nf,gl[vl++]=tf,tf=i,nf=l}function z1(i,l,d){ta[na++]=xi,ta[na++]=bi,ta[na++]=as,as=i;var h=xi;i=bi;var x=32-_t(h)-1;h&=~(1<<x),d+=1;var w=32-_t(l)+x;if(30<w){var k=x-x%5;w=(h&(1<<k)-1).toString(32),h>>=k,x-=k,xi=1<<32-_t(l)+x|d<<x|h,bi=w+i}else xi=1<<w|d<<x|h,bi=i}function km(i){i.return!==null&&(is(i,1),z1(i,1,0))}function Pm(i){for(;i===tf;)tf=gl[--vl],gl[vl]=null,nf=gl[--vl],gl[vl]=null;for(;i===as;)as=ta[--na],ta[na]=null,bi=ta[--na],ta[na]=null,xi=ta[--na],ta[na]=null}var ur=null,Dn=null,qt=!1,os=null,Ha=!1,Nm=Error(r(519));function ss(i){var l=Error(r(418,""));throw Yc(Jr(l,i)),Nm}function $1(i){var l=i.stateNode,d=i.type,h=i.memoizedProps;switch(l[he]=i,l[Ee]=h,d){case"dialog":Rt("cancel",l),Rt("close",l);break;case"iframe":case"object":case"embed":Rt("load",l);break;case"video":case"audio":for(d=0;d<xu.length;d++)Rt(xu[d],l);break;case"source":Rt("error",l);break;case"img":case"image":case"link":Rt("error",l),Rt("load",l);break;case"details":Rt("toggle",l);break;case"input":Rt("invalid",l),e1(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),Vd(l);break;case"select":Rt("invalid",l);break;case"textarea":Rt("invalid",l),n1(l,h.value,h.defaultValue,h.children),Vd(l)}d=h.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||h.suppressHydrationWarning===!0||nj(l.textContent,d)?(h.popover!=null&&(Rt("beforetoggle",l),Rt("toggle",l)),h.onScroll!=null&&Rt("scroll",l),h.onScrollEnd!=null&&Rt("scrollend",l),h.onClick!=null&&(l.onclick=Lf),l=!0):l=!1,l||ss(i)}function U1(i){for(ur=i.return;ur;)switch(ur.tag){case 5:case 13:Ha=!1;return;case 27:case 3:Ha=!0;return;default:ur=ur.return}}function Qc(i){if(i!==ur)return!1;if(!qt)return U1(i),qt=!0,!1;var l=i.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=i.type,d=!(d!=="form"&&d!=="button")||Yg(i.type,i.memoizedProps)),d=!d),d&&Dn&&ss(i),U1(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8)if(d=i.data,d==="/$"){if(l===0){Dn=Da(i.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++;i=i.nextSibling}Dn=null}}else l===27?(l=Dn,jo(i.type)?(i=Jg,Jg=null,Dn=i):Dn=l):Dn=ur?Da(i.stateNode.nextSibling):null;return!0}function Wc(){Dn=ur=null,qt=!1}function B1(){var i=os;return i!==null&&(Er===null?Er=i:Er.push.apply(Er,i),os=null),i}function Yc(i){os===null?os=[i]:os.push(i)}var Om=U(null),ls=null,Si=null;function so(i,l,d){te(Om,l._currentValue),l._currentValue=d}function wi(i){i._currentValue=Om.current,J(Om)}function Mm(i,l,d){for(;i!==null;){var h=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),i===d)break;i=i.return}}function Im(i,l,d,h){var x=i.child;for(x!==null&&(x.return=i);x!==null;){var w=x.dependencies;if(w!==null){var k=x.child;w=w.firstContext;e:for(;w!==null;){var N=w;w=x;for(var B=0;B<l.length;B++)if(N.context===l[B]){w.lanes|=d,N=w.alternate,N!==null&&(N.lanes|=d),Mm(w.return,d,i),h||(k=null);break e}w=N.next}}else if(x.tag===18){if(k=x.return,k===null)throw Error(r(341));k.lanes|=d,w=k.alternate,w!==null&&(w.lanes|=d),Mm(k,d,i),k=null}else k=x.child;if(k!==null)k.return=x;else for(k=x;k!==null;){if(k===i){k=null;break}if(x=k.sibling,x!==null){x.return=k.return,k=x;break}k=k.return}x=k}}function Kc(i,l,d,h){i=null;for(var x=l,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var k=x.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var N=x.type;Ir(x.pendingProps.value,k.value)||(i!==null?i.push(N):i=[N])}}else if(x===Ge.current){if(k=x.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(i!==null?i.push(Eu):i=[Eu])}x=x.return}i!==null&&Im(l,i,d,h),l.flags|=262144}function rf(i){for(i=i.firstContext;i!==null;){if(!Ir(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function cs(i){ls=i,Si=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function rr(i){return V1(ls,i)}function af(i,l){return ls===null&&cs(i),V1(i,l)}function V1(i,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},Si===null){if(i===null)throw Error(r(308));Si=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else Si=Si.next=l;return d}var L4=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(d,h){i.push(h)}};this.abort=function(){l.aborted=!0,i.forEach(function(d){return d()})}},z4=e.unstable_scheduleCallback,$4=e.unstable_NormalPriority,Bn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lm(){return{controller:new L4,data:new Map,refCount:0}}function Xc(i){i.refCount--,i.refCount===0&&z4($4,function(){i.controller.abort()})}var Zc=null,zm=0,yl=0,xl=null;function U4(i,l){if(Zc===null){var d=Zc=[];zm=0,yl=Ug(),xl={status:"pending",value:void 0,then:function(h){d.push(h)}}}return zm++,l.then(F1,F1),l}function F1(){if(--zm===0&&Zc!==null){xl!==null&&(xl.status="fulfilled");var i=Zc;Zc=null,yl=0,xl=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function B4(i,l){var d=[],h={status:"pending",value:null,reason:null,then:function(x){d.push(x)}};return i.then(function(){h.status="fulfilled",h.value=l;for(var x=0;x<d.length;x++)(0,d[x])(l)},function(x){for(h.status="rejected",h.reason=x,x=0;x<d.length;x++)(0,d[x])(void 0)}),h}var H1=P.S;P.S=function(i,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&U4(i,l),H1!==null&&H1(i,l)};var us=U(null);function $m(){var i=us.current;return i!==null?i:un.pooledCache}function of(i,l){l===null?te(us,us.current):te(us,l.pool)}function q1(){var i=$m();return i===null?null:{parent:Bn._currentValue,pool:i}}var Jc=Error(r(460)),G1=Error(r(474)),sf=Error(r(542)),Um={then:function(){}};function Q1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function lf(){}function W1(i,l,d){switch(d=i[d],d===void 0?i.push(l):d!==l&&(l.then(lf,lf),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,K1(i),i;default:if(typeof l.status=="string")l.then(lf,lf);else{if(i=un,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(h){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=h}},function(h){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,K1(i),i}throw eu=l,Jc}}var eu=null;function Y1(){if(eu===null)throw Error(r(459));var i=eu;return eu=null,i}function K1(i){if(i===Jc||i===sf)throw Error(r(483))}var lo=!1;function Bm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vm(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function co(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function uo(i,l,d){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(Kt&2)!==0){var x=h.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),h.pending=l,l=Jd(i),I1(i,null,d),l}return Zd(i,h,l,d),Jd(i)}function tu(i,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var h=l.lanes;h&=i.pendingLanes,d|=h,l.lanes=d,mi(i,d)}}function Fm(i,l){var d=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,d===h)){var x=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var k={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?x=w=k:w=w.next=k,d=d.next}while(d!==null);w===null?x=w=l:w=w.next=l}else x=w=l;d={baseState:h.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=l:i.next=l,d.lastBaseUpdate=l}var Hm=!1;function nu(){if(Hm){var i=xl;if(i!==null)throw i}}function ru(i,l,d,h){Hm=!1;var x=i.updateQueue;lo=!1;var w=x.firstBaseUpdate,k=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var B=N,ne=B.next;B.next=null,k===null?w=ne:k.next=ne,k=B;var ue=i.alternate;ue!==null&&(ue=ue.updateQueue,N=ue.lastBaseUpdate,N!==k&&(N===null?ue.firstBaseUpdate=ne:N.next=ne,ue.lastBaseUpdate=B))}if(w!==null){var pe=x.baseState;k=0,ue=ne=B=null,N=w;do{var ae=N.lane&-536870913,ie=ae!==N.lane;if(ie?(Mt&ae)===ae:(h&ae)===ae){ae!==0&&ae===yl&&(Hm=!0),ue!==null&&(ue=ue.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ut=i,it=N;ae=l;var nn=d;switch(it.tag){case 1:if(ut=it.payload,typeof ut=="function"){pe=ut.call(nn,pe,ae);break e}pe=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=it.payload,ae=typeof ut=="function"?ut.call(nn,pe,ae):ut,ae==null)break e;pe=m({},pe,ae);break e;case 2:lo=!0}}ae=N.callback,ae!==null&&(i.flags|=64,ie&&(i.flags|=8192),ie=x.callbacks,ie===null?x.callbacks=[ae]:ie.push(ae))}else ie={lane:ae,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ue===null?(ne=ue=ie,B=pe):ue=ue.next=ie,k|=ae;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;ie=N,N=ie.next,ie.next=null,x.lastBaseUpdate=ie,x.shared.pending=null}}while(!0);ue===null&&(B=pe),x.baseState=B,x.firstBaseUpdate=ne,x.lastBaseUpdate=ue,w===null&&(x.shared.lanes=0),xo|=k,i.lanes=k,i.memoizedState=pe}}function X1(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function Z1(i,l){var d=i.callbacks;if(d!==null)for(i.callbacks=null,i=0;i<d.length;i++)X1(d[i],l)}var bl=U(null),cf=U(0);function J1(i,l){i=Ai,te(cf,i),te(bl,l),Ai=i|l.baseLanes}function qm(){te(cf,Ai),te(bl,bl.current)}function Gm(){Ai=cf.current,J(bl),J(cf)}var fo=0,wt=null,en=null,Ln=null,uf=!1,Sl=!1,ds=!1,df=0,au=0,wl=null,V4=0;function Pn(){throw Error(r(321))}function Qm(i,l){if(l===null)return!1;for(var d=0;d<l.length&&d<i.length;d++)if(!Ir(i[d],l[d]))return!1;return!0}function Wm(i,l,d,h,x,w){return fo=w,wt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=i===null||i.memoizedState===null?IS:LS,ds=!1,w=d(h,x),ds=!1,Sl&&(w=tS(l,d,h,x)),eS(i),w}function eS(i){P.H=vf;var l=en!==null&&en.next!==null;if(fo=0,Ln=en=wt=null,uf=!1,au=0,wl=null,l)throw Error(r(300));i===null||Hn||(i=i.dependencies,i!==null&&rf(i)&&(Hn=!0))}function tS(i,l,d,h){wt=i;var x=0;do{if(Sl&&(wl=null),au=0,Sl=!1,25<=x)throw Error(r(301));if(x+=1,Ln=en=null,i.updateQueue!=null){var w=i.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}P.H=Y4,w=l(d,h)}while(Sl);return w}function F4(){var i=P.H,l=i.useState()[0];return l=typeof l.then=="function"?iu(l):l,i=i.useState()[0],(en!==null?en.memoizedState:null)!==i&&(wt.flags|=1024),l}function Ym(){var i=df!==0;return df=0,i}function Km(i,l,d){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~d}function Xm(i){if(uf){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}uf=!1}fo=0,Ln=en=wt=null,Sl=!1,au=df=0,wl=null}function jr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ln===null?wt.memoizedState=Ln=i:Ln=Ln.next=i,Ln}function zn(){if(en===null){var i=wt.alternate;i=i!==null?i.memoizedState:null}else i=en.next;var l=Ln===null?wt.memoizedState:Ln.next;if(l!==null)Ln=l,en=i;else{if(i===null)throw wt.alternate===null?Error(r(467)):Error(r(310));en=i,i={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},Ln===null?wt.memoizedState=Ln=i:Ln=Ln.next=i}return Ln}function Zm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function iu(i){var l=au;return au+=1,wl===null&&(wl=[]),i=W1(wl,i,l),l=wt,(Ln===null?l.memoizedState:Ln.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?IS:LS),i}function ff(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return iu(i);if(i.$$typeof===E)return rr(i)}throw Error(r(438,String(i)))}function Jm(i){var l=null,d=wt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var h=wt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=Zm(),wt.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(i),h=0;h<i;h++)d[h]=V;return l.index++,d}function ji(i,l){return typeof l=="function"?l(i):l}function hf(i){var l=zn();return eg(l,en,i)}function eg(i,l,d){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=d;var x=i.baseQueue,w=h.pending;if(w!==null){if(x!==null){var k=x.next;x.next=w.next,w.next=k}l.baseQueue=x=w,h.pending=null}if(w=i.baseState,x===null)i.memoizedState=w;else{l=x.next;var N=k=null,B=null,ne=l,ue=!1;do{var pe=ne.lane&-536870913;if(pe!==ne.lane?(Mt&pe)===pe:(fo&pe)===pe){var ae=ne.revertLane;if(ae===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),pe===yl&&(ue=!0);else if((fo&ae)===ae){ne=ne.next,ae===yl&&(ue=!0);continue}else pe={lane:0,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=pe,k=w):B=B.next=pe,wt.lanes|=ae,xo|=ae;pe=ne.action,ds&&d(w,pe),w=ne.hasEagerState?ne.eagerState:d(w,pe)}else ae={lane:pe,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=ae,k=w):B=B.next=ae,wt.lanes|=pe,xo|=pe;ne=ne.next}while(ne!==null&&ne!==l);if(B===null?k=w:B.next=N,!Ir(w,i.memoizedState)&&(Hn=!0,ue&&(d=xl,d!==null)))throw d;i.memoizedState=w,i.baseState=k,i.baseQueue=B,h.lastRenderedState=w}return x===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function tg(i){var l=zn(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=i;var h=d.dispatch,x=d.pending,w=l.memoizedState;if(x!==null){d.pending=null;var k=x=x.next;do w=i(w,k.action),k=k.next;while(k!==x);Ir(w,l.memoizedState)||(Hn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,h]}function nS(i,l,d){var h=wt,x=zn(),w=qt;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var k=!Ir((en||x).memoizedState,d);k&&(x.memoizedState=d,Hn=!0),x=x.queue;var N=iS.bind(null,h,x,i);if(ou(2048,8,N,[i]),x.getSnapshot!==l||k||Ln!==null&&Ln.memoizedState.tag&1){if(h.flags|=2048,jl(9,pf(),aS.bind(null,h,x,d,l),null),un===null)throw Error(r(349));w||(fo&124)!==0||rS(h,l,d)}return d}function rS(i,l,d){i.flags|=16384,i={getSnapshot:l,value:d},l=wt.updateQueue,l===null?(l=Zm(),wt.updateQueue=l,l.stores=[i]):(d=l.stores,d===null?l.stores=[i]:d.push(i))}function aS(i,l,d,h){l.value=d,l.getSnapshot=h,oS(l)&&sS(i)}function iS(i,l,d){return d(function(){oS(l)&&sS(i)})}function oS(i){var l=i.getSnapshot;i=i.value;try{var d=l();return!Ir(i,d)}catch{return!0}}function sS(i){var l=pl(i,2);l!==null&&Vr(l,i,2)}function ng(i){var l=jr();if(typeof i=="function"){var d=i;if(i=d(),ds){Wt(!0);try{d()}finally{Wt(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:i},l}function lS(i,l,d,h){return i.baseState=d,eg(i,en,typeof h=="function"?h:ji)}function H4(i,l,d,h,x){if(gf(i))throw Error(r(485));if(i=l.action,i!==null){var w={payload:x,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){w.listeners.push(k)}};P.T!==null?d(!0):w.isTransition=!1,h(w),d=l.pending,d===null?(w.next=l.pending=w,cS(l,w)):(w.next=d.next,l.pending=d.next=w)}}function cS(i,l){var d=l.action,h=l.payload,x=i.state;if(l.isTransition){var w=P.T,k={};P.T=k;try{var N=d(x,h),B=P.S;B!==null&&B(k,N),uS(i,l,N)}catch(ne){rg(i,l,ne)}finally{P.T=w}}else try{w=d(x,h),uS(i,l,w)}catch(ne){rg(i,l,ne)}}function uS(i,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(h){dS(i,l,h)},function(h){return rg(i,l,h)}):dS(i,l,d)}function dS(i,l,d){l.status="fulfilled",l.value=d,fS(l),i.state=d,l=i.pending,l!==null&&(d=l.next,d===l?i.pending=null:(d=d.next,l.next=d,cS(i,d)))}function rg(i,l,d){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=d,fS(l),l=l.next;while(l!==h)}i.action=null}function fS(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function hS(i,l){return l}function pS(i,l){if(qt){var d=un.formState;if(d!==null){e:{var h=wt;if(qt){if(Dn){t:{for(var x=Dn,w=Ha;x.nodeType!==8;){if(!w){x=null;break t}if(x=Da(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){Dn=Da(x.nextSibling),h=x.data==="F!";break e}}ss(h)}h=!1}h&&(l=d[0])}}return d=jr(),d.memoizedState=d.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hS,lastRenderedState:l},d.queue=h,d=NS.bind(null,wt,h),h.dispatch=d,h=ng(!1),w=lg.bind(null,wt,!1,h.queue),h=jr(),x={state:l,dispatch:null,action:i,pending:null},h.queue=x,d=H4.bind(null,wt,x,w,d),x.dispatch=d,h.memoizedState=i,[l,d,!1]}function mS(i){var l=zn();return gS(l,en,i)}function gS(i,l,d){if(l=eg(i,l,hS)[0],i=hf(ji)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=iu(l)}catch(k){throw k===Jc?sf:k}else h=l;l=zn();var x=l.queue,w=x.dispatch;return d!==l.memoizedState&&(wt.flags|=2048,jl(9,pf(),q4.bind(null,x,d),null)),[h,w,i]}function q4(i,l){i.action=l}function vS(i){var l=zn(),d=en;if(d!==null)return gS(l,d,i);zn(),l=l.memoizedState,d=zn();var h=d.queue.dispatch;return d.memoizedState=i,[l,h,!1]}function jl(i,l,d,h){return i={tag:i,create:d,deps:h,inst:l,next:null},l=wt.updateQueue,l===null&&(l=Zm(),wt.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=i.next=i:(h=d.next,d.next=i,i.next=h,l.lastEffect=i),i}function pf(){return{destroy:void 0,resource:void 0}}function yS(){return zn().memoizedState}function mf(i,l,d,h){var x=jr();h=h===void 0?null:h,wt.flags|=i,x.memoizedState=jl(1|l,pf(),d,h)}function ou(i,l,d,h){var x=zn();h=h===void 0?null:h;var w=x.memoizedState.inst;en!==null&&h!==null&&Qm(h,en.memoizedState.deps)?x.memoizedState=jl(l,w,d,h):(wt.flags|=i,x.memoizedState=jl(1|l,w,d,h))}function xS(i,l){mf(8390656,8,i,l)}function bS(i,l){ou(2048,8,i,l)}function SS(i,l){return ou(4,2,i,l)}function wS(i,l){return ou(4,4,i,l)}function jS(i,l){if(typeof l=="function"){i=i();var d=l(i);return function(){typeof d=="function"?d():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function CS(i,l,d){d=d!=null?d.concat([i]):null,ou(4,4,jS.bind(null,l,i),d)}function ag(){}function ES(i,l){var d=zn();l=l===void 0?null:l;var h=d.memoizedState;return l!==null&&Qm(l,h[1])?h[0]:(d.memoizedState=[i,l],i)}function TS(i,l){var d=zn();l=l===void 0?null:l;var h=d.memoizedState;if(l!==null&&Qm(l,h[1]))return h[0];if(h=i(),ds){Wt(!0);try{i()}finally{Wt(!1)}}return d.memoizedState=[h,l],h}function ig(i,l,d){return d===void 0||(fo&1073741824)!==0?i.memoizedState=l:(i.memoizedState=d,i=Aw(),wt.lanes|=i,xo|=i,d)}function RS(i,l,d,h){return Ir(d,l)?d:bl.current!==null?(i=ig(i,d,h),Ir(i,l)||(Hn=!0),i):(fo&42)===0?(Hn=!0,i.memoizedState=d):(i=Aw(),wt.lanes|=i,xo|=i,l)}function DS(i,l,d,h,x){var w=I.p;I.p=w!==0&&8>w?w:8;var k=P.T,N={};P.T=N,lg(i,!1,l,d);try{var B=x(),ne=P.S;if(ne!==null&&ne(N,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ue=B4(B,h);su(i,l,ue,Br(i))}else su(i,l,h,Br(i))}catch(pe){su(i,l,{then:function(){},status:"rejected",reason:pe},Br())}finally{I.p=w,P.T=k}}function G4(){}function og(i,l,d,h){if(i.tag!==5)throw Error(r(476));var x=AS(i).queue;DS(i,x,l,z,d===null?G4:function(){return _S(i),d(h)})}function AS(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:z},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:d},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function _S(i){var l=AS(i).next.queue;su(i,l,{},Br())}function sg(){return rr(Eu)}function kS(){return zn().memoizedState}function PS(){return zn().memoizedState}function Q4(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var d=Br();i=co(d);var h=uo(l,i,d);h!==null&&(Vr(h,l,d),tu(h,l,d)),l={cache:Lm()},i.payload=l;return}l=l.return}}function W4(i,l,d){var h=Br();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},gf(i)?OS(l,d):(d=Rm(i,l,d,h),d!==null&&(Vr(d,i,h),MS(d,l,h)))}function NS(i,l,d){var h=Br();su(i,l,d,h)}function su(i,l,d,h){var x={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(gf(i))OS(l,x);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var k=l.lastRenderedState,N=w(k,d);if(x.hasEagerState=!0,x.eagerState=N,Ir(N,k))return Zd(i,l,x,0),un===null&&Xd(),!1}catch{}finally{}if(d=Rm(i,l,x,h),d!==null)return Vr(d,i,h),MS(d,l,h),!0}return!1}function lg(i,l,d,h){if(h={lane:2,revertLane:Ug(),action:h,hasEagerState:!1,eagerState:null,next:null},gf(i)){if(l)throw Error(r(479))}else l=Rm(i,d,h,2),l!==null&&Vr(l,i,2)}function gf(i){var l=i.alternate;return i===wt||l!==null&&l===wt}function OS(i,l){Sl=uf=!0;var d=i.pending;d===null?l.next=l:(l.next=d.next,d.next=l),i.pending=l}function MS(i,l,d){if((d&4194048)!==0){var h=l.lanes;h&=i.pendingLanes,d|=h,l.lanes=d,mi(i,d)}}var vf={readContext:rr,use:ff,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useLayoutEffect:Pn,useInsertionEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useSyncExternalStore:Pn,useId:Pn,useHostTransitionStatus:Pn,useFormState:Pn,useActionState:Pn,useOptimistic:Pn,useMemoCache:Pn,useCacheRefresh:Pn},IS={readContext:rr,use:ff,useCallback:function(i,l){return jr().memoizedState=[i,l===void 0?null:l],i},useContext:rr,useEffect:xS,useImperativeHandle:function(i,l,d){d=d!=null?d.concat([i]):null,mf(4194308,4,jS.bind(null,l,i),d)},useLayoutEffect:function(i,l){return mf(4194308,4,i,l)},useInsertionEffect:function(i,l){mf(4,2,i,l)},useMemo:function(i,l){var d=jr();l=l===void 0?null:l;var h=i();if(ds){Wt(!0);try{i()}finally{Wt(!1)}}return d.memoizedState=[h,l],h},useReducer:function(i,l,d){var h=jr();if(d!==void 0){var x=d(l);if(ds){Wt(!0);try{d(l)}finally{Wt(!1)}}}else x=l;return h.memoizedState=h.baseState=x,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:x},h.queue=i,i=i.dispatch=W4.bind(null,wt,i),[h.memoizedState,i]},useRef:function(i){var l=jr();return i={current:i},l.memoizedState=i},useState:function(i){i=ng(i);var l=i.queue,d=NS.bind(null,wt,l);return l.dispatch=d,[i.memoizedState,d]},useDebugValue:ag,useDeferredValue:function(i,l){var d=jr();return ig(d,i,l)},useTransition:function(){var i=ng(!1);return i=DS.bind(null,wt,i.queue,!0,!1),jr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,d){var h=wt,x=jr();if(qt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),un===null)throw Error(r(349));(Mt&124)!==0||rS(h,l,d)}x.memoizedState=d;var w={value:d,getSnapshot:l};return x.queue=w,xS(iS.bind(null,h,w,i),[i]),h.flags|=2048,jl(9,pf(),aS.bind(null,h,w,d,l),null),d},useId:function(){var i=jr(),l=un.identifierPrefix;if(qt){var d=bi,h=xi;d=(h&~(1<<32-_t(h)-1)).toString(32)+d,l="«"+l+"R"+d,d=df++,0<d&&(l+="H"+d.toString(32)),l+="»"}else d=V4++,l="«"+l+"r"+d.toString(32)+"»";return i.memoizedState=l},useHostTransitionStatus:sg,useFormState:pS,useActionState:pS,useOptimistic:function(i){var l=jr();l.memoizedState=l.baseState=i;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=lg.bind(null,wt,!0,d),d.dispatch=l,[i,l]},useMemoCache:Jm,useCacheRefresh:function(){return jr().memoizedState=Q4.bind(null,wt)}},LS={readContext:rr,use:ff,useCallback:ES,useContext:rr,useEffect:bS,useImperativeHandle:CS,useInsertionEffect:SS,useLayoutEffect:wS,useMemo:TS,useReducer:hf,useRef:yS,useState:function(){return hf(ji)},useDebugValue:ag,useDeferredValue:function(i,l){var d=zn();return RS(d,en.memoizedState,i,l)},useTransition:function(){var i=hf(ji)[0],l=zn().memoizedState;return[typeof i=="boolean"?i:iu(i),l]},useSyncExternalStore:nS,useId:kS,useHostTransitionStatus:sg,useFormState:mS,useActionState:mS,useOptimistic:function(i,l){var d=zn();return lS(d,en,i,l)},useMemoCache:Jm,useCacheRefresh:PS},Y4={readContext:rr,use:ff,useCallback:ES,useContext:rr,useEffect:bS,useImperativeHandle:CS,useInsertionEffect:SS,useLayoutEffect:wS,useMemo:TS,useReducer:tg,useRef:yS,useState:function(){return tg(ji)},useDebugValue:ag,useDeferredValue:function(i,l){var d=zn();return en===null?ig(d,i,l):RS(d,en.memoizedState,i,l)},useTransition:function(){var i=tg(ji)[0],l=zn().memoizedState;return[typeof i=="boolean"?i:iu(i),l]},useSyncExternalStore:nS,useId:kS,useHostTransitionStatus:sg,useFormState:vS,useActionState:vS,useOptimistic:function(i,l){var d=zn();return en!==null?lS(d,en,i,l):(d.baseState=i,[i,d.queue.dispatch])},useMemoCache:Jm,useCacheRefresh:PS},Cl=null,lu=0;function yf(i){var l=lu;return lu+=1,Cl===null&&(Cl=[]),W1(Cl,i,l)}function cu(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function xf(i,l){throw l.$$typeof===g?Error(r(525)):(i=Object.prototype.toString.call(l),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function zS(i){var l=i._init;return l(i._payload)}function $S(i){function l(K,q){if(i){var ee=K.deletions;ee===null?(K.deletions=[q],K.flags|=16):ee.push(q)}}function d(K,q){if(!i)return null;for(;q!==null;)l(K,q),q=q.sibling;return null}function h(K){for(var q=new Map;K!==null;)K.key!==null?q.set(K.key,K):q.set(K.index,K),K=K.sibling;return q}function x(K,q){return K=yi(K,q),K.index=0,K.sibling=null,K}function w(K,q,ee){return K.index=ee,i?(ee=K.alternate,ee!==null?(ee=ee.index,ee<q?(K.flags|=67108866,q):ee):(K.flags|=67108866,q)):(K.flags|=1048576,q)}function k(K){return i&&K.alternate===null&&(K.flags|=67108866),K}function N(K,q,ee,fe){return q===null||q.tag!==6?(q=Am(ee,K.mode,fe),q.return=K,q):(q=x(q,ee),q.return=K,q)}function B(K,q,ee,fe){var He=ee.type;return He===S?ue(K,q,ee.props.children,fe,ee.key):q!==null&&(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===L&&zS(He)===q.type)?(q=x(q,ee.props),cu(q,ee),q.return=K,q):(q=ef(ee.type,ee.key,ee.props,null,K.mode,fe),cu(q,ee),q.return=K,q)}function ne(K,q,ee,fe){return q===null||q.tag!==4||q.stateNode.containerInfo!==ee.containerInfo||q.stateNode.implementation!==ee.implementation?(q=_m(ee,K.mode,fe),q.return=K,q):(q=x(q,ee.children||[]),q.return=K,q)}function ue(K,q,ee,fe,He){return q===null||q.tag!==7?(q=rs(ee,K.mode,fe,He),q.return=K,q):(q=x(q,ee),q.return=K,q)}function pe(K,q,ee){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Am(""+q,K.mode,ee),q.return=K,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return ee=ef(q.type,q.key,q.props,null,K.mode,ee),cu(ee,q),ee.return=K,ee;case b:return q=_m(q,K.mode,ee),q.return=K,q;case L:var fe=q._init;return q=fe(q._payload),pe(K,q,ee)}if(Z(q)||W(q))return q=rs(q,K.mode,ee,null),q.return=K,q;if(typeof q.then=="function")return pe(K,yf(q),ee);if(q.$$typeof===E)return pe(K,af(K,q),ee);xf(K,q)}return null}function ae(K,q,ee,fe){var He=q!==null?q.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return He!==null?null:N(K,q,""+ee,fe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case v:return ee.key===He?B(K,q,ee,fe):null;case b:return ee.key===He?ne(K,q,ee,fe):null;case L:return He=ee._init,ee=He(ee._payload),ae(K,q,ee,fe)}if(Z(ee)||W(ee))return He!==null?null:ue(K,q,ee,fe,null);if(typeof ee.then=="function")return ae(K,q,yf(ee),fe);if(ee.$$typeof===E)return ae(K,q,af(K,ee),fe);xf(K,ee)}return null}function ie(K,q,ee,fe,He){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return K=K.get(ee)||null,N(q,K,""+fe,He);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case v:return K=K.get(fe.key===null?ee:fe.key)||null,B(q,K,fe,He);case b:return K=K.get(fe.key===null?ee:fe.key)||null,ne(q,K,fe,He);case L:var Et=fe._init;return fe=Et(fe._payload),ie(K,q,ee,fe,He)}if(Z(fe)||W(fe))return K=K.get(ee)||null,ue(q,K,fe,He,null);if(typeof fe.then=="function")return ie(K,q,ee,yf(fe),He);if(fe.$$typeof===E)return ie(K,q,ee,af(q,fe),He);xf(q,fe)}return null}function ut(K,q,ee,fe){for(var He=null,Et=null,Je=q,st=q=0,Gn=null;Je!==null&&st<ee.length;st++){Je.index>st?(Gn=Je,Je=null):Gn=Je.sibling;var Vt=ae(K,Je,ee[st],fe);if(Vt===null){Je===null&&(Je=Gn);break}i&&Je&&Vt.alternate===null&&l(K,Je),q=w(Vt,q,st),Et===null?He=Vt:Et.sibling=Vt,Et=Vt,Je=Gn}if(st===ee.length)return d(K,Je),qt&&is(K,st),He;if(Je===null){for(;st<ee.length;st++)Je=pe(K,ee[st],fe),Je!==null&&(q=w(Je,q,st),Et===null?He=Je:Et.sibling=Je,Et=Je);return qt&&is(K,st),He}for(Je=h(Je);st<ee.length;st++)Gn=ie(Je,K,st,ee[st],fe),Gn!==null&&(i&&Gn.alternate!==null&&Je.delete(Gn.key===null?st:Gn.key),q=w(Gn,q,st),Et===null?He=Gn:Et.sibling=Gn,Et=Gn);return i&&Je.forEach(function(Do){return l(K,Do)}),qt&&is(K,st),He}function it(K,q,ee,fe){if(ee==null)throw Error(r(151));for(var He=null,Et=null,Je=q,st=q=0,Gn=null,Vt=ee.next();Je!==null&&!Vt.done;st++,Vt=ee.next()){Je.index>st?(Gn=Je,Je=null):Gn=Je.sibling;var Do=ae(K,Je,Vt.value,fe);if(Do===null){Je===null&&(Je=Gn);break}i&&Je&&Do.alternate===null&&l(K,Je),q=w(Do,q,st),Et===null?He=Do:Et.sibling=Do,Et=Do,Je=Gn}if(Vt.done)return d(K,Je),qt&&is(K,st),He;if(Je===null){for(;!Vt.done;st++,Vt=ee.next())Vt=pe(K,Vt.value,fe),Vt!==null&&(q=w(Vt,q,st),Et===null?He=Vt:Et.sibling=Vt,Et=Vt);return qt&&is(K,st),He}for(Je=h(Je);!Vt.done;st++,Vt=ee.next())Vt=ie(Je,K,st,Vt.value,fe),Vt!==null&&(i&&Vt.alternate!==null&&Je.delete(Vt.key===null?st:Vt.key),q=w(Vt,q,st),Et===null?He=Vt:Et.sibling=Vt,Et=Vt);return i&&Je.forEach(function(KP){return l(K,KP)}),qt&&is(K,st),He}function nn(K,q,ee,fe){if(typeof ee=="object"&&ee!==null&&ee.type===S&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case v:e:{for(var He=ee.key;q!==null;){if(q.key===He){if(He=ee.type,He===S){if(q.tag===7){d(K,q.sibling),fe=x(q,ee.props.children),fe.return=K,K=fe;break e}}else if(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===L&&zS(He)===q.type){d(K,q.sibling),fe=x(q,ee.props),cu(fe,ee),fe.return=K,K=fe;break e}d(K,q);break}else l(K,q);q=q.sibling}ee.type===S?(fe=rs(ee.props.children,K.mode,fe,ee.key),fe.return=K,K=fe):(fe=ef(ee.type,ee.key,ee.props,null,K.mode,fe),cu(fe,ee),fe.return=K,K=fe)}return k(K);case b:e:{for(He=ee.key;q!==null;){if(q.key===He)if(q.tag===4&&q.stateNode.containerInfo===ee.containerInfo&&q.stateNode.implementation===ee.implementation){d(K,q.sibling),fe=x(q,ee.children||[]),fe.return=K,K=fe;break e}else{d(K,q);break}else l(K,q);q=q.sibling}fe=_m(ee,K.mode,fe),fe.return=K,K=fe}return k(K);case L:return He=ee._init,ee=He(ee._payload),nn(K,q,ee,fe)}if(Z(ee))return ut(K,q,ee,fe);if(W(ee)){if(He=W(ee),typeof He!="function")throw Error(r(150));return ee=He.call(ee),it(K,q,ee,fe)}if(typeof ee.then=="function")return nn(K,q,yf(ee),fe);if(ee.$$typeof===E)return nn(K,q,af(K,ee),fe);xf(K,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,q!==null&&q.tag===6?(d(K,q.sibling),fe=x(q,ee),fe.return=K,K=fe):(d(K,q),fe=Am(ee,K.mode,fe),fe.return=K,K=fe),k(K)):d(K,q)}return function(K,q,ee,fe){try{lu=0;var He=nn(K,q,ee,fe);return Cl=null,He}catch(Je){if(Je===Jc||Je===sf)throw Je;var Et=Lr(29,Je,null,K.mode);return Et.lanes=fe,Et.return=K,Et}finally{}}}var El=$S(!0),US=$S(!1),ra=U(null),qa=null;function ho(i){var l=i.alternate;te(Vn,Vn.current&1),te(ra,i),qa===null&&(l===null||bl.current!==null||l.memoizedState!==null)&&(qa=i)}function BS(i){if(i.tag===22){if(te(Vn,Vn.current),te(ra,i),qa===null){var l=i.alternate;l!==null&&l.memoizedState!==null&&(qa=i)}}else po()}function po(){te(Vn,Vn.current),te(ra,ra.current)}function Ci(i){J(ra),qa===i&&(qa=null),J(Vn)}var Vn=U(0);function bf(i){for(var l=i;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||Zg(d)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function cg(i,l,d,h){l=i.memoizedState,d=d(h,l),d=d==null?l:m({},l,d),i.memoizedState=d,i.lanes===0&&(i.updateQueue.baseState=d)}var ug={enqueueSetState:function(i,l,d){i=i._reactInternals;var h=Br(),x=co(h);x.payload=l,d!=null&&(x.callback=d),l=uo(i,x,h),l!==null&&(Vr(l,i,h),tu(l,i,h))},enqueueReplaceState:function(i,l,d){i=i._reactInternals;var h=Br(),x=co(h);x.tag=1,x.payload=l,d!=null&&(x.callback=d),l=uo(i,x,h),l!==null&&(Vr(l,i,h),tu(l,i,h))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var d=Br(),h=co(d);h.tag=2,l!=null&&(h.callback=l),l=uo(i,h,d),l!==null&&(Vr(l,i,d),tu(l,i,d))}};function VS(i,l,d,h,x,w,k){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,w,k):l.prototype&&l.prototype.isPureReactComponent?!qc(d,h)||!qc(x,w):!0}function FS(i,l,d,h){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,h),l.state!==i&&ug.enqueueReplaceState(l,l.state,null)}function fs(i,l){var d=l;if("ref"in l){d={};for(var h in l)h!=="ref"&&(d[h]=l[h])}if(i=i.defaultProps){d===l&&(d=m({},d));for(var x in i)d[x]===void 0&&(d[x]=i[x])}return d}var Sf=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function HS(i){Sf(i)}function qS(i){console.error(i)}function GS(i){Sf(i)}function wf(i,l){try{var d=i.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function QS(i,l,d){try{var h=i.onCaughtError;h(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function dg(i,l,d){return d=co(d),d.tag=3,d.payload={element:null},d.callback=function(){wf(i,l)},d}function WS(i){return i=co(i),i.tag=3,i}function YS(i,l,d,h){var x=d.type.getDerivedStateFromError;if(typeof x=="function"){var w=h.value;i.payload=function(){return x(w)},i.callback=function(){QS(l,d,h)}}var k=d.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(i.callback=function(){QS(l,d,h),typeof x!="function"&&(bo===null?bo=new Set([this]):bo.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})})}function K4(i,l,d,h,x){if(d.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=d.alternate,l!==null&&Kc(l,d,x,!0),d=ra.current,d!==null){switch(d.tag){case 13:return qa===null?Mg():d.alternate===null&&An===0&&(An=3),d.flags&=-257,d.flags|=65536,d.lanes=x,h===Um?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([h]):l.add(h),Lg(i,h,x)),!1;case 22:return d.flags|=65536,h===Um?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([h]):d.add(h)),Lg(i,h,x)),!1}throw Error(r(435,d.tag))}return Lg(i,h,x),Mg(),!1}if(qt)return l=ra.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,h!==Nm&&(i=Error(r(422),{cause:h}),Yc(Jr(i,d)))):(h!==Nm&&(l=Error(r(423),{cause:h}),Yc(Jr(l,d))),i=i.current.alternate,i.flags|=65536,x&=-x,i.lanes|=x,h=Jr(h,d),x=dg(i.stateNode,h,x),Fm(i,x),An!==4&&(An=2)),!1;var w=Error(r(520),{cause:h});if(w=Jr(w,d),gu===null?gu=[w]:gu.push(w),An!==4&&(An=2),l===null)return!0;h=Jr(h,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,i=x&-x,d.lanes|=i,i=dg(d.stateNode,h,i),Fm(d,i),!1;case 1:if(l=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(bo===null||!bo.has(w))))return d.flags|=65536,x&=-x,d.lanes|=x,x=WS(x),YS(x,i,d,h),Fm(d,x),!1}d=d.return}while(d!==null);return!1}var KS=Error(r(461)),Hn=!1;function Kn(i,l,d,h){l.child=i===null?US(l,null,d,h):El(l,i.child,d,h)}function XS(i,l,d,h,x){d=d.render;var w=l.ref;if("ref"in h){var k={};for(var N in h)N!=="ref"&&(k[N]=h[N])}else k=h;return cs(l),h=Wm(i,l,d,k,w,x),N=Ym(),i!==null&&!Hn?(Km(i,l,x),Ei(i,l,x)):(qt&&N&&km(l),l.flags|=1,Kn(i,l,h,x),l.child)}function ZS(i,l,d,h,x){if(i===null){var w=d.type;return typeof w=="function"&&!Dm(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,JS(i,l,w,h,x)):(i=ef(d.type,null,h,l,l.mode,x),i.ref=l.ref,i.return=l,l.child=i)}if(w=i.child,!xg(i,x)){var k=w.memoizedProps;if(d=d.compare,d=d!==null?d:qc,d(k,h)&&i.ref===l.ref)return Ei(i,l,x)}return l.flags|=1,i=yi(w,h),i.ref=l.ref,i.return=l,l.child=i}function JS(i,l,d,h,x){if(i!==null){var w=i.memoizedProps;if(qc(w,h)&&i.ref===l.ref)if(Hn=!1,l.pendingProps=h=w,xg(i,x))(i.flags&131072)!==0&&(Hn=!0);else return l.lanes=i.lanes,Ei(i,l,x)}return fg(i,l,d,h,x)}function ew(i,l,d){var h=l.pendingProps,x=h.children,w=i!==null?i.memoizedState:null;if(h.mode==="hidden"){if((l.flags&128)!==0){if(h=w!==null?w.baseLanes|d:d,i!==null){for(x=l.child=i.child,w=0;x!==null;)w=w|x.lanes|x.childLanes,x=x.sibling;l.childLanes=w&~h}else l.childLanes=0,l.child=null;return tw(i,l,h,d)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&of(l,w!==null?w.cachePool:null),w!==null?J1(l,w):qm(),BS(l);else return l.lanes=l.childLanes=536870912,tw(i,l,w!==null?w.baseLanes|d:d,d)}else w!==null?(of(l,w.cachePool),J1(l,w),po(),l.memoizedState=null):(i!==null&&of(l,null),qm(),po());return Kn(i,l,x,d),l.child}function tw(i,l,d,h){var x=$m();return x=x===null?null:{parent:Bn._currentValue,pool:x},l.memoizedState={baseLanes:d,cachePool:x},i!==null&&of(l,null),qm(),BS(l),i!==null&&Kc(i,l,h,!0),null}function jf(i,l){var d=l.ref;if(d===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(i===null||i.ref!==d)&&(l.flags|=4194816)}}function fg(i,l,d,h,x){return cs(l),d=Wm(i,l,d,h,void 0,x),h=Ym(),i!==null&&!Hn?(Km(i,l,x),Ei(i,l,x)):(qt&&h&&km(l),l.flags|=1,Kn(i,l,d,x),l.child)}function nw(i,l,d,h,x,w){return cs(l),l.updateQueue=null,d=tS(l,h,d,x),eS(i),h=Ym(),i!==null&&!Hn?(Km(i,l,w),Ei(i,l,w)):(qt&&h&&km(l),l.flags|=1,Kn(i,l,d,w),l.child)}function rw(i,l,d,h,x){if(cs(l),l.stateNode===null){var w=ml,k=d.contextType;typeof k=="object"&&k!==null&&(w=rr(k)),w=new d(h,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=ug,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=h,w.state=l.memoizedState,w.refs={},Bm(l),k=d.contextType,w.context=typeof k=="object"&&k!==null?rr(k):ml,w.state=l.memoizedState,k=d.getDerivedStateFromProps,typeof k=="function"&&(cg(l,d,k,h),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(k=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),k!==w.state&&ug.enqueueReplaceState(w,w.state,null),ru(l,h,w,x),nu(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(i===null){w=l.stateNode;var N=l.memoizedProps,B=fs(d,N);w.props=B;var ne=w.context,ue=d.contextType;k=ml,typeof ue=="object"&&ue!==null&&(k=rr(ue));var pe=d.getDerivedStateFromProps;ue=typeof pe=="function"||typeof w.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N||ne!==k)&&FS(l,w,h,k),lo=!1;var ae=l.memoizedState;w.state=ae,ru(l,h,w,x),nu(),ne=l.memoizedState,N||ae!==ne||lo?(typeof pe=="function"&&(cg(l,d,pe,h),ne=l.memoizedState),(B=lo||VS(l,d,B,h,ae,ne,k))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=ne),w.props=h,w.state=ne,w.context=k,h=B):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{w=l.stateNode,Vm(i,l),k=l.memoizedProps,ue=fs(d,k),w.props=ue,pe=l.pendingProps,ae=w.context,ne=d.contextType,B=ml,typeof ne=="object"&&ne!==null&&(B=rr(ne)),N=d.getDerivedStateFromProps,(ne=typeof N=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(k!==pe||ae!==B)&&FS(l,w,h,B),lo=!1,ae=l.memoizedState,w.state=ae,ru(l,h,w,x),nu();var ie=l.memoizedState;k!==pe||ae!==ie||lo||i!==null&&i.dependencies!==null&&rf(i.dependencies)?(typeof N=="function"&&(cg(l,d,N,h),ie=l.memoizedState),(ue=lo||VS(l,d,ue,h,ae,ie,B)||i!==null&&i.dependencies!==null&&rf(i.dependencies))?(ne||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,ie,B),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,ie,B)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||k===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||k===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ie),w.props=h,w.state=ie,w.context=B,h=ue):(typeof w.componentDidUpdate!="function"||k===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||k===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),h=!1)}return w=h,jf(i,l),h=(l.flags&128)!==0,w||h?(w=l.stateNode,d=h&&typeof d.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,i!==null&&h?(l.child=El(l,i.child,null,x),l.child=El(l,null,d,x)):Kn(i,l,d,x),l.memoizedState=w.state,i=l.child):i=Ei(i,l,x),i}function aw(i,l,d,h){return Wc(),l.flags|=256,Kn(i,l,d,h),l.child}var hg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pg(i){return{baseLanes:i,cachePool:q1()}}function mg(i,l,d){return i=i!==null?i.childLanes&~d:0,l&&(i|=aa),i}function iw(i,l,d){var h=l.pendingProps,x=!1,w=(l.flags&128)!==0,k;if((k=w)||(k=i!==null&&i.memoizedState===null?!1:(Vn.current&2)!==0),k&&(x=!0,l.flags&=-129),k=(l.flags&32)!==0,l.flags&=-33,i===null){if(qt){if(x?ho(l):po(),qt){var N=Dn,B;if(B=N){e:{for(B=N,N=Ha;B.nodeType!==8;){if(!N){N=null;break e}if(B=Da(B.nextSibling),B===null){N=null;break e}}N=B}N!==null?(l.memoizedState={dehydrated:N,treeContext:as!==null?{id:xi,overflow:bi}:null,retryLane:536870912,hydrationErrors:null},B=Lr(18,null,null,0),B.stateNode=N,B.return=l,l.child=B,ur=l,Dn=null,B=!0):B=!1}B||ss(l)}if(N=l.memoizedState,N!==null&&(N=N.dehydrated,N!==null))return Zg(N)?l.lanes=32:l.lanes=536870912,null;Ci(l)}return N=h.children,h=h.fallback,x?(po(),x=l.mode,N=Cf({mode:"hidden",children:N},x),h=rs(h,x,d,null),N.return=l,h.return=l,N.sibling=h,l.child=N,x=l.child,x.memoizedState=pg(d),x.childLanes=mg(i,k,d),l.memoizedState=hg,h):(ho(l),gg(l,N))}if(B=i.memoizedState,B!==null&&(N=B.dehydrated,N!==null)){if(w)l.flags&256?(ho(l),l.flags&=-257,l=vg(i,l,d)):l.memoizedState!==null?(po(),l.child=i.child,l.flags|=128,l=null):(po(),x=h.fallback,N=l.mode,h=Cf({mode:"visible",children:h.children},N),x=rs(x,N,d,null),x.flags|=2,h.return=l,x.return=l,h.sibling=x,l.child=h,El(l,i.child,null,d),h=l.child,h.memoizedState=pg(d),h.childLanes=mg(i,k,d),l.memoizedState=hg,l=x);else if(ho(l),Zg(N)){if(k=N.nextSibling&&N.nextSibling.dataset,k)var ne=k.dgst;k=ne,h=Error(r(419)),h.stack="",h.digest=k,Yc({value:h,source:null,stack:null}),l=vg(i,l,d)}else if(Hn||Kc(i,l,d,!1),k=(d&i.childLanes)!==0,Hn||k){if(k=un,k!==null&&(h=d&-d,h=(h&42)!==0?1:il(h),h=(h&(k.suspendedLanes|d))!==0?0:h,h!==0&&h!==B.retryLane))throw B.retryLane=h,pl(i,h),Vr(k,i,h),KS;N.data==="$?"||Mg(),l=vg(i,l,d)}else N.data==="$?"?(l.flags|=192,l.child=i.child,l=null):(i=B.treeContext,Dn=Da(N.nextSibling),ur=l,qt=!0,os=null,Ha=!1,i!==null&&(ta[na++]=xi,ta[na++]=bi,ta[na++]=as,xi=i.id,bi=i.overflow,as=l),l=gg(l,h.children),l.flags|=4096);return l}return x?(po(),x=h.fallback,N=l.mode,B=i.child,ne=B.sibling,h=yi(B,{mode:"hidden",children:h.children}),h.subtreeFlags=B.subtreeFlags&65011712,ne!==null?x=yi(ne,x):(x=rs(x,N,d,null),x.flags|=2),x.return=l,h.return=l,h.sibling=x,l.child=h,h=x,x=l.child,N=i.child.memoizedState,N===null?N=pg(d):(B=N.cachePool,B!==null?(ne=Bn._currentValue,B=B.parent!==ne?{parent:ne,pool:ne}:B):B=q1(),N={baseLanes:N.baseLanes|d,cachePool:B}),x.memoizedState=N,x.childLanes=mg(i,k,d),l.memoizedState=hg,h):(ho(l),d=i.child,i=d.sibling,d=yi(d,{mode:"visible",children:h.children}),d.return=l,d.sibling=null,i!==null&&(k=l.deletions,k===null?(l.deletions=[i],l.flags|=16):k.push(i)),l.child=d,l.memoizedState=null,d)}function gg(i,l){return l=Cf({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function Cf(i,l){return i=Lr(22,i,null,l),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function vg(i,l,d){return El(l,i.child,null,d),i=gg(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function ow(i,l,d){i.lanes|=l;var h=i.alternate;h!==null&&(h.lanes|=l),Mm(i.return,l,d)}function yg(i,l,d,h,x){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:d,tailMode:x}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=d,w.tailMode=x)}function sw(i,l,d){var h=l.pendingProps,x=h.revealOrder,w=h.tail;if(Kn(i,l,h.children,d),h=Vn.current,(h&2)!==0)h=h&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&ow(i,d,l);else if(i.tag===19)ow(i,d,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}switch(te(Vn,h),x){case"forwards":for(d=l.child,x=null;d!==null;)i=d.alternate,i!==null&&bf(i)===null&&(x=d),d=d.sibling;d=x,d===null?(x=l.child,l.child=null):(x=d.sibling,d.sibling=null),yg(l,!1,x,d,w);break;case"backwards":for(d=null,x=l.child,l.child=null;x!==null;){if(i=x.alternate,i!==null&&bf(i)===null){l.child=x;break}i=x.sibling,x.sibling=d,d=x,x=i}yg(l,!0,d,null,w);break;case"together":yg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ei(i,l,d){if(i!==null&&(l.dependencies=i.dependencies),xo|=l.lanes,(d&l.childLanes)===0)if(i!==null){if(Kc(i,l,d,!1),(d&l.childLanes)===0)return null}else return null;if(i!==null&&l.child!==i.child)throw Error(r(153));if(l.child!==null){for(i=l.child,d=yi(i,i.pendingProps),l.child=d,d.return=l;i.sibling!==null;)i=i.sibling,d=d.sibling=yi(i,i.pendingProps),d.return=l;d.sibling=null}return l.child}function xg(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&rf(i)))}function X4(i,l,d){switch(l.tag){case 3:ke(l,l.stateNode.containerInfo),so(l,Bn,i.memoizedState.cache),Wc();break;case 27:case 5:Re(l);break;case 4:ke(l,l.stateNode.containerInfo);break;case 10:so(l,l.type,l.memoizedProps.value);break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(ho(l),l.flags|=128,null):(d&l.child.childLanes)!==0?iw(i,l,d):(ho(l),i=Ei(i,l,d),i!==null?i.sibling:null);ho(l);break;case 19:var x=(i.flags&128)!==0;if(h=(d&l.childLanes)!==0,h||(Kc(i,l,d,!1),h=(d&l.childLanes)!==0),x){if(h)return sw(i,l,d);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),te(Vn,Vn.current),h)break;return null;case 22:case 23:return l.lanes=0,ew(i,l,d);case 24:so(l,Bn,i.memoizedState.cache)}return Ei(i,l,d)}function lw(i,l,d){if(i!==null)if(i.memoizedProps!==l.pendingProps)Hn=!0;else{if(!xg(i,d)&&(l.flags&128)===0)return Hn=!1,X4(i,l,d);Hn=(i.flags&131072)!==0}else Hn=!1,qt&&(l.flags&1048576)!==0&&z1(l,nf,l.index);switch(l.lanes=0,l.tag){case 16:e:{i=l.pendingProps;var h=l.elementType,x=h._init;if(h=x(h._payload),l.type=h,typeof h=="function")Dm(h)?(i=fs(h,i),l.tag=1,l=rw(null,l,h,i,d)):(l.tag=0,l=fg(null,l,h,i,d));else{if(h!=null){if(x=h.$$typeof,x===T){l.tag=11,l=XS(null,l,h,i,d);break e}else if(x===M){l.tag=14,l=ZS(null,l,h,i,d);break e}}throw l=X(h)||h,Error(r(306,l,""))}}return l;case 0:return fg(i,l,l.type,l.pendingProps,d);case 1:return h=l.type,x=fs(h,l.pendingProps),rw(i,l,h,x,d);case 3:e:{if(ke(l,l.stateNode.containerInfo),i===null)throw Error(r(387));h=l.pendingProps;var w=l.memoizedState;x=w.element,Vm(i,l),ru(l,h,null,d);var k=l.memoizedState;if(h=k.cache,so(l,Bn,h),h!==w.cache&&Im(l,[Bn],d,!0),nu(),h=k.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:k.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=aw(i,l,h,d);break e}else if(h!==x){x=Jr(Error(r(424)),l),Yc(x),l=aw(i,l,h,d);break e}else{switch(i=l.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Dn=Da(i.firstChild),ur=l,qt=!0,os=null,Ha=!0,d=US(l,null,h,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Wc(),h===x){l=Ei(i,l,d);break e}Kn(i,l,h,d)}l=l.child}return l;case 26:return jf(i,l),i===null?(d=fj(l.type,null,l.pendingProps,null))?l.memoizedState=d:qt||(d=l.type,i=l.pendingProps,h=zf(ve.current).createElement(d),h[he]=l,h[Ee]=i,Zn(h,d,i),kt(h),l.stateNode=h):l.memoizedState=fj(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return Re(l),i===null&&qt&&(h=l.stateNode=cj(l.type,l.pendingProps,ve.current),ur=l,Ha=!0,x=Dn,jo(l.type)?(Jg=x,Dn=Da(h.firstChild)):Dn=x),Kn(i,l,l.pendingProps.children,d),jf(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&qt&&((x=h=Dn)&&(h=EP(h,l.type,l.pendingProps,Ha),h!==null?(l.stateNode=h,ur=l,Dn=Da(h.firstChild),Ha=!1,x=!0):x=!1),x||ss(l)),Re(l),x=l.type,w=l.pendingProps,k=i!==null?i.memoizedProps:null,h=w.children,Yg(x,w)?h=null:k!==null&&Yg(x,k)&&(l.flags|=32),l.memoizedState!==null&&(x=Wm(i,l,F4,null,null,d),Eu._currentValue=x),jf(i,l),Kn(i,l,h,d),l.child;case 6:return i===null&&qt&&((i=d=Dn)&&(d=TP(d,l.pendingProps,Ha),d!==null?(l.stateNode=d,ur=l,Dn=null,i=!0):i=!1),i||ss(l)),null;case 13:return iw(i,l,d);case 4:return ke(l,l.stateNode.containerInfo),h=l.pendingProps,i===null?l.child=El(l,null,h,d):Kn(i,l,h,d),l.child;case 11:return XS(i,l,l.type,l.pendingProps,d);case 7:return Kn(i,l,l.pendingProps,d),l.child;case 8:return Kn(i,l,l.pendingProps.children,d),l.child;case 12:return Kn(i,l,l.pendingProps.children,d),l.child;case 10:return h=l.pendingProps,so(l,l.type,h.value),Kn(i,l,h.children,d),l.child;case 9:return x=l.type._context,h=l.pendingProps.children,cs(l),x=rr(x),h=h(x),l.flags|=1,Kn(i,l,h,d),l.child;case 14:return ZS(i,l,l.type,l.pendingProps,d);case 15:return JS(i,l,l.type,l.pendingProps,d);case 19:return sw(i,l,d);case 31:return h=l.pendingProps,d=l.mode,h={mode:h.mode,children:h.children},i===null?(d=Cf(h,d),d.ref=l.ref,l.child=d,d.return=l,l=d):(d=yi(i.child,h),d.ref=l.ref,l.child=d,d.return=l,l=d),l;case 22:return ew(i,l,d);case 24:return cs(l),h=rr(Bn),i===null?(x=$m(),x===null&&(x=un,w=Lm(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=d),x=w),l.memoizedState={parent:h,cache:x},Bm(l),so(l,Bn,x)):((i.lanes&d)!==0&&(Vm(i,l),ru(l,null,null,d),nu()),x=i.memoizedState,w=l.memoizedState,x.parent!==h?(x={parent:h,cache:h},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),so(l,Bn,h)):(h=w.cache,so(l,Bn,h),h!==x.cache&&Im(l,[Bn],d,!0))),Kn(i,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Ti(i){i.flags|=4}function cw(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!vj(l)){if(l=ra.current,l!==null&&((Mt&4194048)===Mt?qa!==null:(Mt&62914560)!==Mt&&(Mt&536870912)===0||l!==qa))throw eu=Um,G1;i.flags|=8192}}function Ef(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?Xo():536870912,i.lanes|=l,Al|=l)}function uu(i,l){if(!qt)switch(i.tailMode){case"hidden":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i.tail=null:d.sibling=null;break;case"collapsed":d=i.tail;for(var h=null;d!==null;)d.alternate!==null&&(h=d),d=d.sibling;h===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function wn(i){var l=i.alternate!==null&&i.alternate.child===i.child,d=0,h=0;if(l)for(var x=i.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=h,i.childLanes=d,l}function Z4(i,l,d){var h=l.pendingProps;switch(Pm(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wn(l),null;case 1:return wn(l),null;case 3:return d=l.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),wi(Bn),et(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Qc(l)?Ti(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,B1())),wn(l),null;case 26:return d=l.memoizedState,i===null?(Ti(l),d!==null?(wn(l),cw(l,d)):(wn(l),l.flags&=-16777217)):d?d!==i.memoizedState?(Ti(l),wn(l),cw(l,d)):(wn(l),l.flags&=-16777217):(i.memoizedProps!==h&&Ti(l),wn(l),l.flags&=-16777217),null;case 27:ft(l),d=ve.current;var x=l.type;if(i!==null&&l.stateNode!=null)i.memoizedProps!==h&&Ti(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return wn(l),null}i=ye.current,Qc(l)?$1(l):(i=cj(x,h,d),l.stateNode=i,Ti(l))}return wn(l),null;case 5:if(ft(l),d=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&Ti(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return wn(l),null}if(i=ye.current,Qc(l))$1(l);else{switch(x=zf(ve.current),i){case 1:i=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:i=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":i=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":i=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":i=x.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof h.is=="string"?x.createElement("select",{is:h.is}):x.createElement("select"),h.multiple?i.multiple=!0:h.size&&(i.size=h.size);break;default:i=typeof h.is=="string"?x.createElement(d,{is:h.is}):x.createElement(d)}}i[he]=l,i[Ee]=h;e:for(x=l.child;x!==null;){if(x.tag===5||x.tag===6)i.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===l)break e;for(;x.sibling===null;){if(x.return===null||x.return===l)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}l.stateNode=i;e:switch(Zn(i,d,h),d){case"button":case"input":case"select":case"textarea":i=!!h.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ti(l)}}return wn(l),l.flags&=-16777217,null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==h&&Ti(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(i=ve.current,Qc(l)){if(i=l.stateNode,d=l.memoizedProps,h=null,x=ur,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}i[he]=l,i=!!(i.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||nj(i.nodeValue,d)),i||ss(l)}else i=zf(i).createTextNode(h),i[he]=l,l.stateNode=i}return wn(l),null;case 13:if(h=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(x=Qc(l),h!==null&&h.dehydrated!==null){if(i===null){if(!x)throw Error(r(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[he]=l}else Wc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;wn(l),x=!1}else x=B1(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(Ci(l),l):(Ci(l),null)}if(Ci(l),(l.flags&128)!==0)return l.lanes=d,l;if(d=h!==null,i=i!==null&&i.memoizedState!==null,d){h=l.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool);var w=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==x&&(h.flags|=2048)}return d!==i&&d&&(l.child.flags|=8192),Ef(l,l.updateQueue),wn(l),null;case 4:return et(),i===null&&Hg(l.stateNode.containerInfo),wn(l),null;case 10:return wi(l.type),wn(l),null;case 19:if(J(Vn),x=l.memoizedState,x===null)return wn(l),null;if(h=(l.flags&128)!==0,w=x.rendering,w===null)if(h)uu(x,!1);else{if(An!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(w=bf(i),w!==null){for(l.flags|=128,uu(x,!1),i=w.updateQueue,l.updateQueue=i,Ef(l,i),l.subtreeFlags=0,i=d,d=l.child;d!==null;)L1(d,i),d=d.sibling;return te(Vn,Vn.current&1|2),l.child}i=i.sibling}x.tail!==null&&Se()>Df&&(l.flags|=128,h=!0,uu(x,!1),l.lanes=4194304)}else{if(!h)if(i=bf(w),i!==null){if(l.flags|=128,h=!0,i=i.updateQueue,l.updateQueue=i,Ef(l,i),uu(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!qt)return wn(l),null}else 2*Se()-x.renderingStartTime>Df&&d!==536870912&&(l.flags|=128,h=!0,uu(x,!1),l.lanes=4194304);x.isBackwards?(w.sibling=l.child,l.child=w):(i=x.last,i!==null?i.sibling=w:l.child=w,x.last=w)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=Se(),l.sibling=null,i=Vn.current,te(Vn,h?i&1|2:i&1),l):(wn(l),null);case 22:case 23:return Ci(l),Gm(),h=l.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(d&536870912)!==0&&(l.flags&128)===0&&(wn(l),l.subtreeFlags&6&&(l.flags|=8192)):wn(l),d=l.updateQueue,d!==null&&Ef(l,d.retryQueue),d=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048),i!==null&&J(us),null;case 24:return d=null,i!==null&&(d=i.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),wi(Bn),wn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function J4(i,l){switch(Pm(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return wi(Bn),et(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return ft(l),null;case 13:if(Ci(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Wc()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return J(Vn),null;case 4:return et(),null;case 10:return wi(l.type),null;case 22:case 23:return Ci(l),Gm(),i!==null&&J(us),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return wi(Bn),null;case 25:return null;default:return null}}function uw(i,l){switch(Pm(l),l.tag){case 3:wi(Bn),et();break;case 26:case 27:case 5:ft(l);break;case 4:et();break;case 13:Ci(l);break;case 19:J(Vn);break;case 10:wi(l.type);break;case 22:case 23:Ci(l),Gm(),i!==null&&J(us);break;case 24:wi(Bn)}}function du(i,l){try{var d=l.updateQueue,h=d!==null?d.lastEffect:null;if(h!==null){var x=h.next;d=x;do{if((d.tag&i)===i){h=void 0;var w=d.create,k=d.inst;h=w(),k.destroy=h}d=d.next}while(d!==x)}}catch(N){an(l,l.return,N)}}function mo(i,l,d){try{var h=l.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var w=x.next;h=w;do{if((h.tag&i)===i){var k=h.inst,N=k.destroy;if(N!==void 0){k.destroy=void 0,x=l;var B=d,ne=N;try{ne()}catch(ue){an(x,B,ue)}}}h=h.next}while(h!==w)}}catch(ue){an(l,l.return,ue)}}function dw(i){var l=i.updateQueue;if(l!==null){var d=i.stateNode;try{Z1(l,d)}catch(h){an(i,i.return,h)}}}function fw(i,l,d){d.props=fs(i.type,i.memoizedProps),d.state=i.memoizedState;try{d.componentWillUnmount()}catch(h){an(i,l,h)}}function fu(i,l){try{var d=i.ref;if(d!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof d=="function"?i.refCleanup=d(h):d.current=h}}catch(x){an(i,l,x)}}function Ga(i,l){var d=i.ref,h=i.refCleanup;if(d!==null)if(typeof h=="function")try{h()}catch(x){an(i,l,x)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(x){an(i,l,x)}else d.current=null}function hw(i){var l=i.type,d=i.memoizedProps,h=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&h.focus();break e;case"img":d.src?h.src=d.src:d.srcSet&&(h.srcset=d.srcSet)}}catch(x){an(i,i.return,x)}}function bg(i,l,d){try{var h=i.stateNode;bP(h,i.type,d,l),h[Ee]=l}catch(x){an(i,i.return,x)}}function pw(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&jo(i.type)||i.tag===4}function Sg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||pw(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&jo(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function wg(i,l,d){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(i,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(i),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Lf));else if(h!==4&&(h===27&&jo(i.type)&&(d=i.stateNode,l=null),i=i.child,i!==null))for(wg(i,l,d),i=i.sibling;i!==null;)wg(i,l,d),i=i.sibling}function Tf(i,l,d){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?d.insertBefore(i,l):d.appendChild(i);else if(h!==4&&(h===27&&jo(i.type)&&(d=i.stateNode),i=i.child,i!==null))for(Tf(i,l,d),i=i.sibling;i!==null;)Tf(i,l,d),i=i.sibling}function mw(i){var l=i.stateNode,d=i.memoizedProps;try{for(var h=i.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);Zn(l,h,d),l[he]=i,l[Ee]=d}catch(w){an(i,i.return,w)}}var Ri=!1,Nn=!1,jg=!1,gw=typeof WeakSet=="function"?WeakSet:Set,qn=null;function eP(i,l){if(i=i.containerInfo,Qg=Hf,i=R1(i),Sm(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var h=d.getSelection&&d.getSelection();if(h&&h.rangeCount!==0){d=h.anchorNode;var x=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var k=0,N=-1,B=-1,ne=0,ue=0,pe=i,ae=null;t:for(;;){for(var ie;pe!==d||x!==0&&pe.nodeType!==3||(N=k+x),pe!==w||h!==0&&pe.nodeType!==3||(B=k+h),pe.nodeType===3&&(k+=pe.nodeValue.length),(ie=pe.firstChild)!==null;)ae=pe,pe=ie;for(;;){if(pe===i)break t;if(ae===d&&++ne===x&&(N=k),ae===w&&++ue===h&&(B=k),(ie=pe.nextSibling)!==null)break;pe=ae,ae=pe.parentNode}pe=ie}d=N===-1||B===-1?null:{start:N,end:B}}else d=null}d=d||{start:0,end:0}}else d=null;for(Wg={focusedElem:i,selectionRange:d},Hf=!1,qn=l;qn!==null;)if(l=qn,i=l.child,(l.subtreeFlags&1024)!==0&&i!==null)i.return=l,qn=i;else for(;qn!==null;){switch(l=qn,w=l.alternate,i=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&w!==null){i=void 0,d=l,x=w.memoizedProps,w=w.memoizedState,h=d.stateNode;try{var ut=fs(d.type,x,d.elementType===d.type);i=h.getSnapshotBeforeUpdate(ut,w),h.__reactInternalSnapshotBeforeUpdate=i}catch(it){an(d,d.return,it)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,d=i.nodeType,d===9)Xg(i);else if(d===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Xg(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=l.sibling,i!==null){i.return=l.return,qn=i;break}qn=l.return}}function vw(i,l,d){var h=d.flags;switch(d.tag){case 0:case 11:case 15:go(i,d),h&4&&du(5,d);break;case 1:if(go(i,d),h&4)if(i=d.stateNode,l===null)try{i.componentDidMount()}catch(k){an(d,d.return,k)}else{var x=fs(d.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(x,l,i.__reactInternalSnapshotBeforeUpdate)}catch(k){an(d,d.return,k)}}h&64&&dw(d),h&512&&fu(d,d.return);break;case 3:if(go(i,d),h&64&&(i=d.updateQueue,i!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=d.child.stateNode;break;case 1:l=d.child.stateNode}try{Z1(i,l)}catch(k){an(d,d.return,k)}}break;case 27:l===null&&h&4&&mw(d);case 26:case 5:go(i,d),l===null&&h&4&&hw(d),h&512&&fu(d,d.return);break;case 12:go(i,d);break;case 13:go(i,d),h&4&&bw(i,d),h&64&&(i=d.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(d=cP.bind(null,d),RP(i,d))));break;case 22:if(h=d.memoizedState!==null||Ri,!h){l=l!==null&&l.memoizedState!==null||Nn,x=Ri;var w=Nn;Ri=h,(Nn=l)&&!w?vo(i,d,(d.subtreeFlags&8772)!==0):go(i,d),Ri=x,Nn=w}break;case 30:break;default:go(i,d)}}function yw(i){var l=i.alternate;l!==null&&(i.alternate=null,yw(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&Ye(l)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var bn=null,Cr=!1;function Di(i,l,d){for(d=d.child;d!==null;)xw(i,l,d),d=d.sibling}function xw(i,l,d){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(gt,d)}catch{}switch(d.tag){case 26:Nn||Ga(d,l),Di(i,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Nn||Ga(d,l);var h=bn,x=Cr;jo(d.type)&&(bn=d.stateNode,Cr=!1),Di(i,l,d),Su(d.stateNode),bn=h,Cr=x;break;case 5:Nn||Ga(d,l);case 6:if(h=bn,x=Cr,bn=null,Di(i,l,d),bn=h,Cr=x,bn!==null)if(Cr)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(d.stateNode)}catch(w){an(d,l,w)}else try{bn.removeChild(d.stateNode)}catch(w){an(d,l,w)}break;case 18:bn!==null&&(Cr?(i=bn,sj(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,d.stateNode),Au(i)):sj(bn,d.stateNode));break;case 4:h=bn,x=Cr,bn=d.stateNode.containerInfo,Cr=!0,Di(i,l,d),bn=h,Cr=x;break;case 0:case 11:case 14:case 15:Nn||mo(2,d,l),Nn||mo(4,d,l),Di(i,l,d);break;case 1:Nn||(Ga(d,l),h=d.stateNode,typeof h.componentWillUnmount=="function"&&fw(d,l,h)),Di(i,l,d);break;case 21:Di(i,l,d);break;case 22:Nn=(h=Nn)||d.memoizedState!==null,Di(i,l,d),Nn=h;break;default:Di(i,l,d)}}function bw(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Au(i)}catch(d){an(l,l.return,d)}}function tP(i){switch(i.tag){case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new gw),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new gw),l;default:throw Error(r(435,i.tag))}}function Cg(i,l){var d=tP(i);l.forEach(function(h){var x=uP.bind(null,i,h);d.has(h)||(d.add(h),h.then(x,x))})}function zr(i,l){var d=l.deletions;if(d!==null)for(var h=0;h<d.length;h++){var x=d[h],w=i,k=l,N=k;e:for(;N!==null;){switch(N.tag){case 27:if(jo(N.type)){bn=N.stateNode,Cr=!1;break e}break;case 5:bn=N.stateNode,Cr=!1;break e;case 3:case 4:bn=N.stateNode.containerInfo,Cr=!0;break e}N=N.return}if(bn===null)throw Error(r(160));xw(w,k,x),bn=null,Cr=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)Sw(l,i),l=l.sibling}var Ra=null;function Sw(i,l){var d=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:zr(l,i),$r(i),h&4&&(mo(3,i,i.return),du(3,i),mo(5,i,i.return));break;case 1:zr(l,i),$r(i),h&512&&(Nn||d===null||Ga(d,d.return)),h&64&&Ri&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(d=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=d===null?h:d.concat(h))));break;case 26:var x=Ra;if(zr(l,i),$r(i),h&512&&(Nn||d===null||Ga(d,d.return)),h&4){var w=d!==null?d.memoizedState:null;if(h=i.memoizedState,d===null)if(h===null)if(i.stateNode===null){e:{h=i.type,d=i.memoizedProps,x=x.ownerDocument||x;t:switch(h){case"title":w=x.getElementsByTagName("title")[0],(!w||w[rt]||w[he]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(h),x.head.insertBefore(w,x.querySelector("head > title"))),Zn(w,h,d),w[he]=i,kt(w),h=w;break e;case"link":var k=mj("link","href",x).get(h+(d.href||""));if(k){for(var N=0;N<k.length;N++)if(w=k[N],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){k.splice(N,1);break t}}w=x.createElement(h),Zn(w,h,d),x.head.appendChild(w);break;case"meta":if(k=mj("meta","content",x).get(h+(d.content||""))){for(N=0;N<k.length;N++)if(w=k[N],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){k.splice(N,1);break t}}w=x.createElement(h),Zn(w,h,d),x.head.appendChild(w);break;default:throw Error(r(468,h))}w[he]=i,kt(w),h=w}i.stateNode=h}else gj(x,i.type,i.stateNode);else i.stateNode=pj(x,h,i.memoizedProps);else w!==h?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,h===null?gj(x,i.type,i.stateNode):pj(x,h,i.memoizedProps)):h===null&&i.stateNode!==null&&bg(i,i.memoizedProps,d.memoizedProps)}break;case 27:zr(l,i),$r(i),h&512&&(Nn||d===null||Ga(d,d.return)),d!==null&&h&4&&bg(i,i.memoizedProps,d.memoizedProps);break;case 5:if(zr(l,i),$r(i),h&512&&(Nn||d===null||Ga(d,d.return)),i.flags&32){x=i.stateNode;try{sl(x,"")}catch(ie){an(i,i.return,ie)}}h&4&&i.stateNode!=null&&(x=i.memoizedProps,bg(i,x,d!==null?d.memoizedProps:x)),h&1024&&(jg=!0);break;case 6:if(zr(l,i),$r(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,d=i.stateNode;try{d.nodeValue=h}catch(ie){an(i,i.return,ie)}}break;case 3:if(Bf=null,x=Ra,Ra=$f(l.containerInfo),zr(l,i),Ra=x,$r(i),h&4&&d!==null&&d.memoizedState.isDehydrated)try{Au(l.containerInfo)}catch(ie){an(i,i.return,ie)}jg&&(jg=!1,ww(i));break;case 4:h=Ra,Ra=$f(i.stateNode.containerInfo),zr(l,i),$r(i),Ra=h;break;case 12:zr(l,i),$r(i);break;case 13:zr(l,i),$r(i),i.child.flags&8192&&i.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(_g=Se()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Cg(i,h)));break;case 22:x=i.memoizedState!==null;var B=d!==null&&d.memoizedState!==null,ne=Ri,ue=Nn;if(Ri=ne||x,Nn=ue||B,zr(l,i),Nn=ue,Ri=ne,$r(i),h&8192)e:for(l=i.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(d===null||B||Ri||Nn||hs(i)),d=null,l=i;;){if(l.tag===5||l.tag===26){if(d===null){B=d=l;try{if(w=B.stateNode,x)k=w.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{N=B.stateNode;var pe=B.memoizedProps.style,ae=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;N.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(ie){an(B,B.return,ie)}}}else if(l.tag===6){if(d===null){B=l;try{B.stateNode.nodeValue=x?"":B.memoizedProps}catch(ie){an(B,B.return,ie)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===i)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break e;for(;l.sibling===null;){if(l.return===null||l.return===i)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=i.updateQueue,h!==null&&(d=h.retryQueue,d!==null&&(h.retryQueue=null,Cg(i,d))));break;case 19:zr(l,i),$r(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Cg(i,h)));break;case 30:break;case 21:break;default:zr(l,i),$r(i)}}function $r(i){var l=i.flags;if(l&2){try{for(var d,h=i.return;h!==null;){if(pw(h)){d=h;break}h=h.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var x=d.stateNode,w=Sg(i);Tf(i,w,x);break;case 5:var k=d.stateNode;d.flags&32&&(sl(k,""),d.flags&=-33);var N=Sg(i);Tf(i,N,k);break;case 3:case 4:var B=d.stateNode.containerInfo,ne=Sg(i);wg(i,ne,B);break;default:throw Error(r(161))}}catch(ue){an(i,i.return,ue)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function ww(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;ww(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function go(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)vw(i,l.alternate,l),l=l.sibling}function hs(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:mo(4,l,l.return),hs(l);break;case 1:Ga(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&fw(l,l.return,d),hs(l);break;case 27:Su(l.stateNode);case 26:case 5:Ga(l,l.return),hs(l);break;case 22:l.memoizedState===null&&hs(l);break;case 30:hs(l);break;default:hs(l)}i=i.sibling}}function vo(i,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,x=i,w=l,k=w.flags;switch(w.tag){case 0:case 11:case 15:vo(x,w,d),du(4,w);break;case 1:if(vo(x,w,d),h=w,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ne){an(h,h.return,ne)}if(h=w,x=h.updateQueue,x!==null){var N=h.stateNode;try{var B=x.shared.hiddenCallbacks;if(B!==null)for(x.shared.hiddenCallbacks=null,x=0;x<B.length;x++)X1(B[x],N)}catch(ne){an(h,h.return,ne)}}d&&k&64&&dw(w),fu(w,w.return);break;case 27:mw(w);case 26:case 5:vo(x,w,d),d&&h===null&&k&4&&hw(w),fu(w,w.return);break;case 12:vo(x,w,d);break;case 13:vo(x,w,d),d&&k&4&&bw(x,w);break;case 22:w.memoizedState===null&&vo(x,w,d),fu(w,w.return);break;case 30:break;default:vo(x,w,d)}l=l.sibling}}function Eg(i,l){var d=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==d&&(i!=null&&i.refCount++,d!=null&&Xc(d))}function Tg(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Xc(i))}function Qa(i,l,d,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)jw(i,l,d,h),l=l.sibling}function jw(i,l,d,h){var x=l.flags;switch(l.tag){case 0:case 11:case 15:Qa(i,l,d,h),x&2048&&du(9,l);break;case 1:Qa(i,l,d,h);break;case 3:Qa(i,l,d,h),x&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Xc(i)));break;case 12:if(x&2048){Qa(i,l,d,h),i=l.stateNode;try{var w=l.memoizedProps,k=w.id,N=w.onPostCommit;typeof N=="function"&&N(k,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(B){an(l,l.return,B)}}else Qa(i,l,d,h);break;case 13:Qa(i,l,d,h);break;case 23:break;case 22:w=l.stateNode,k=l.alternate,l.memoizedState!==null?w._visibility&2?Qa(i,l,d,h):hu(i,l):w._visibility&2?Qa(i,l,d,h):(w._visibility|=2,Tl(i,l,d,h,(l.subtreeFlags&10256)!==0)),x&2048&&Eg(k,l);break;case 24:Qa(i,l,d,h),x&2048&&Tg(l.alternate,l);break;default:Qa(i,l,d,h)}}function Tl(i,l,d,h,x){for(x=x&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var w=i,k=l,N=d,B=h,ne=k.flags;switch(k.tag){case 0:case 11:case 15:Tl(w,k,N,B,x),du(8,k);break;case 23:break;case 22:var ue=k.stateNode;k.memoizedState!==null?ue._visibility&2?Tl(w,k,N,B,x):hu(w,k):(ue._visibility|=2,Tl(w,k,N,B,x)),x&&ne&2048&&Eg(k.alternate,k);break;case 24:Tl(w,k,N,B,x),x&&ne&2048&&Tg(k.alternate,k);break;default:Tl(w,k,N,B,x)}l=l.sibling}}function hu(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=i,h=l,x=h.flags;switch(h.tag){case 22:hu(d,h),x&2048&&Eg(h.alternate,h);break;case 24:hu(d,h),x&2048&&Tg(h.alternate,h);break;default:hu(d,h)}l=l.sibling}}var pu=8192;function Rl(i){if(i.subtreeFlags&pu)for(i=i.child;i!==null;)Cw(i),i=i.sibling}function Cw(i){switch(i.tag){case 26:Rl(i),i.flags&pu&&i.memoizedState!==null&&UP(Ra,i.memoizedState,i.memoizedProps);break;case 5:Rl(i);break;case 3:case 4:var l=Ra;Ra=$f(i.stateNode.containerInfo),Rl(i),Ra=l;break;case 22:i.memoizedState===null&&(l=i.alternate,l!==null&&l.memoizedState!==null?(l=pu,pu=16777216,Rl(i),pu=l):Rl(i));break;default:Rl(i)}}function Ew(i){var l=i.alternate;if(l!==null&&(i=l.child,i!==null)){l.child=null;do l=i.sibling,i.sibling=null,i=l;while(i!==null)}}function mu(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var h=l[d];qn=h,Rw(h,i)}Ew(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Tw(i),i=i.sibling}function Tw(i){switch(i.tag){case 0:case 11:case 15:mu(i),i.flags&2048&&mo(9,i,i.return);break;case 3:mu(i);break;case 12:mu(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,Rf(i)):mu(i);break;default:mu(i)}}function Rf(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var h=l[d];qn=h,Rw(h,i)}Ew(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:mo(8,l,l.return),Rf(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Rf(l));break;default:Rf(l)}i=i.sibling}}function Rw(i,l){for(;qn!==null;){var d=qn;switch(d.tag){case 0:case 11:case 15:mo(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var h=d.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Xc(d.memoizedState.cache)}if(h=d.child,h!==null)h.return=d,qn=h;else e:for(d=i;qn!==null;){h=qn;var x=h.sibling,w=h.return;if(yw(h),h===d){qn=null;break e}if(x!==null){x.return=w,qn=x;break e}qn=w}}}var nP={getCacheForType:function(i){var l=rr(Bn),d=l.data.get(i);return d===void 0&&(d=i(),l.data.set(i,d)),d}},rP=typeof WeakMap=="function"?WeakMap:Map,Kt=0,un=null,Tt=null,Mt=0,Xt=0,Ur=null,yo=!1,Dl=!1,Rg=!1,Ai=0,An=0,xo=0,ps=0,Dg=0,aa=0,Al=0,gu=null,Er=null,Ag=!1,_g=0,Df=1/0,Af=null,bo=null,Xn=0,So=null,_l=null,kl=0,kg=0,Pg=null,Dw=null,vu=0,Ng=null;function Br(){if((Kt&2)!==0&&Mt!==0)return Mt&-Mt;if(P.T!==null){var i=yl;return i!==0?i:Ug()}return H()}function Aw(){aa===0&&(aa=(Mt&536870912)===0||qt?no():536870912);var i=ra.current;return i!==null&&(i.flags|=32),aa}function Vr(i,l,d){(i===un&&(Xt===2||Xt===9)||i.cancelPendingCommit!==null)&&(Pl(i,0),wo(i,Mt,aa,!1)),wa(i,d),((Kt&2)===0||i!==un)&&(i===un&&((Kt&2)===0&&(ps|=d),An===4&&wo(i,Mt,aa,!1)),Wa(i))}function _w(i,l,d){if((Kt&6)!==0)throw Error(r(327));var h=!d&&(l&124)===0&&(l&i.expiredLanes)===0||xr(i,l),x=h?oP(i,l):Ig(i,l,!0),w=h;do{if(x===0){Dl&&!h&&wo(i,l,0,!1);break}else{if(d=i.current.alternate,w&&!aP(d)){x=Ig(i,l,!1),w=!1;continue}if(x===2){if(w=l,i.errorRecoveryDisabledLanes&w)var k=0;else k=i.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){l=k;e:{var N=i;x=gu;var B=N.current.memoizedState.isDehydrated;if(B&&(Pl(N,k).flags|=256),k=Ig(N,k,!1),k!==2){if(Rg&&!B){N.errorRecoveryDisabledLanes|=w,ps|=w,x=4;break e}w=Er,Er=x,w!==null&&(Er===null?Er=w:Er.push.apply(Er,w))}x=k}if(w=!1,x!==2)continue}}if(x===1){Pl(i,0),wo(i,l,0,!0);break}e:{switch(h=i,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:wo(h,l,aa,!yo);break e;case 2:Er=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=_g+300-Se(),10<x)){if(wo(h,l,aa,!yo),Yn(h,0,!0)!==0)break e;h.timeoutHandle=ij(kw.bind(null,h,d,Er,Af,Ag,l,aa,ps,Al,yo,w,2,-0,0),x);break e}kw(h,d,Er,Af,Ag,l,aa,ps,Al,yo,w,0,-0,0)}}break}while(!0);Wa(i)}function kw(i,l,d,h,x,w,k,N,B,ne,ue,pe,ae,ie){if(i.timeoutHandle=-1,pe=l.subtreeFlags,(pe&8192||(pe&16785408)===16785408)&&(Cu={stylesheets:null,count:0,unsuspend:$P},Cw(l),pe=BP(),pe!==null)){i.cancelPendingCommit=pe(zw.bind(null,i,l,w,d,h,x,k,N,B,ue,1,ae,ie)),wo(i,w,k,!ne);return}zw(i,l,w,d,h,x,k,N,B)}function aP(i){for(var l=i;;){var d=l.tag;if((d===0||d===11||d===15)&&l.flags&16384&&(d=l.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var h=0;h<d.length;h++){var x=d[h],w=x.getSnapshot;x=x.value;try{if(!Ir(w(),x))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function wo(i,l,d,h){l&=~Dg,l&=~ps,i.suspendedLanes|=l,i.pingedLanes&=~l,h&&(i.warmLanes|=l),h=i.expirationTimes;for(var x=l;0<x;){var w=31-_t(x),k=1<<w;h[w]=-1,x&=~k}d!==0&&kn(i,d,l)}function _f(){return(Kt&6)===0?(yu(0),!1):!0}function Og(){if(Tt!==null){if(Xt===0)var i=Tt.return;else i=Tt,Si=ls=null,Xm(i),Cl=null,lu=0,i=Tt;for(;i!==null;)uw(i.alternate,i),i=i.return;Tt=null}}function Pl(i,l){var d=i.timeoutHandle;d!==-1&&(i.timeoutHandle=-1,wP(d)),d=i.cancelPendingCommit,d!==null&&(i.cancelPendingCommit=null,d()),Og(),un=i,Tt=d=yi(i.current,null),Mt=l,Xt=0,Ur=null,yo=!1,Dl=xr(i,l),Rg=!1,Al=aa=Dg=ps=xo=An=0,Er=gu=null,Ag=!1,(l&8)!==0&&(l|=l&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=l;0<h;){var x=31-_t(h),w=1<<x;l|=i[x],h&=~w}return Ai=l,Xd(),d}function Pw(i,l){wt=null,P.H=vf,l===Jc||l===sf?(l=Y1(),Xt=3):l===G1?(l=Y1(),Xt=4):Xt=l===KS?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ur=l,Tt===null&&(An=1,wf(i,Jr(l,i.current)))}function Nw(){var i=P.H;return P.H=vf,i===null?vf:i}function Ow(){var i=P.A;return P.A=nP,i}function Mg(){An=4,yo||(Mt&4194048)!==Mt&&ra.current!==null||(Dl=!0),(xo&134217727)===0&&(ps&134217727)===0||un===null||wo(un,Mt,aa,!1)}function Ig(i,l,d){var h=Kt;Kt|=2;var x=Nw(),w=Ow();(un!==i||Mt!==l)&&(Af=null,Pl(i,l)),l=!1;var k=An;e:do try{if(Xt!==0&&Tt!==null){var N=Tt,B=Ur;switch(Xt){case 8:Og(),k=6;break e;case 3:case 2:case 9:case 6:ra.current===null&&(l=!0);var ne=Xt;if(Xt=0,Ur=null,Nl(i,N,B,ne),d&&Dl){k=0;break e}break;default:ne=Xt,Xt=0,Ur=null,Nl(i,N,B,ne)}}iP(),k=An;break}catch(ue){Pw(i,ue)}while(!0);return l&&i.shellSuspendCounter++,Si=ls=null,Kt=h,P.H=x,P.A=w,Tt===null&&(un=null,Mt=0,Xd()),k}function iP(){for(;Tt!==null;)Mw(Tt)}function oP(i,l){var d=Kt;Kt|=2;var h=Nw(),x=Ow();un!==i||Mt!==l?(Af=null,Df=Se()+500,Pl(i,l)):Dl=xr(i,l);e:do try{if(Xt!==0&&Tt!==null){l=Tt;var w=Ur;t:switch(Xt){case 1:Xt=0,Ur=null,Nl(i,l,w,1);break;case 2:case 9:if(Q1(w)){Xt=0,Ur=null,Iw(l);break}l=function(){Xt!==2&&Xt!==9||un!==i||(Xt=7),Wa(i)},w.then(l,l);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:Q1(w)?(Xt=0,Ur=null,Iw(l)):(Xt=0,Ur=null,Nl(i,l,w,7));break;case 5:var k=null;switch(Tt.tag){case 26:k=Tt.memoizedState;case 5:case 27:var N=Tt;if(!k||vj(k)){Xt=0,Ur=null;var B=N.sibling;if(B!==null)Tt=B;else{var ne=N.return;ne!==null?(Tt=ne,kf(ne)):Tt=null}break t}}Xt=0,Ur=null,Nl(i,l,w,5);break;case 6:Xt=0,Ur=null,Nl(i,l,w,6);break;case 8:Og(),An=6;break e;default:throw Error(r(462))}}sP();break}catch(ue){Pw(i,ue)}while(!0);return Si=ls=null,P.H=h,P.A=x,Kt=d,Tt!==null?0:(un=null,Mt=0,Xd(),An)}function sP(){for(;Tt!==null&&!Ht();)Mw(Tt)}function Mw(i){var l=lw(i.alternate,i,Ai);i.memoizedProps=i.pendingProps,l===null?kf(i):Tt=l}function Iw(i){var l=i,d=l.alternate;switch(l.tag){case 15:case 0:l=nw(d,l,l.pendingProps,l.type,void 0,Mt);break;case 11:l=nw(d,l,l.pendingProps,l.type.render,l.ref,Mt);break;case 5:Xm(l);default:uw(d,l),l=Tt=L1(l,Ai),l=lw(d,l,Ai)}i.memoizedProps=i.pendingProps,l===null?kf(i):Tt=l}function Nl(i,l,d,h){Si=ls=null,Xm(l),Cl=null,lu=0;var x=l.return;try{if(K4(i,x,l,d,Mt)){An=1,wf(i,Jr(d,i.current)),Tt=null;return}}catch(w){if(x!==null)throw Tt=x,w;An=1,wf(i,Jr(d,i.current)),Tt=null;return}l.flags&32768?(qt||h===1?i=!0:Dl||(Mt&536870912)!==0?i=!1:(yo=i=!0,(h===2||h===9||h===3||h===6)&&(h=ra.current,h!==null&&h.tag===13&&(h.flags|=16384))),Lw(l,i)):kf(l)}function kf(i){var l=i;do{if((l.flags&32768)!==0){Lw(l,yo);return}i=l.return;var d=Z4(l.alternate,l,Ai);if(d!==null){Tt=d;return}if(l=l.sibling,l!==null){Tt=l;return}Tt=l=i}while(l!==null);An===0&&(An=5)}function Lw(i,l){do{var d=J4(i.alternate,i);if(d!==null){d.flags&=32767,Tt=d;return}if(d=i.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(i=i.sibling,i!==null)){Tt=i;return}Tt=i=d}while(i!==null);An=6,Tt=null}function zw(i,l,d,h,x,w,k,N,B){i.cancelPendingCommit=null;do Pf();while(Xn!==0);if((Kt&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=Tm,ja(i,d,w,k,N,B),i===un&&(Tt=un=null,Mt=0),_l=l,So=i,kl=d,kg=w,Pg=x,Dw=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,dP(ge,function(){return Fw(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=P.T,P.T=null,x=I.p,I.p=2,k=Kt,Kt|=4;try{eP(i,l,d)}finally{Kt=k,I.p=x,P.T=h}}Xn=1,$w(),Uw(),Bw()}}function $w(){if(Xn===1){Xn=0;var i=So,l=_l,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=P.T,P.T=null;var h=I.p;I.p=2;var x=Kt;Kt|=4;try{Sw(l,i);var w=Wg,k=R1(i.containerInfo),N=w.focusedElem,B=w.selectionRange;if(k!==N&&N&&N.ownerDocument&&T1(N.ownerDocument.documentElement,N)){if(B!==null&&Sm(N)){var ne=B.start,ue=B.end;if(ue===void 0&&(ue=ne),"selectionStart"in N)N.selectionStart=ne,N.selectionEnd=Math.min(ue,N.value.length);else{var pe=N.ownerDocument||document,ae=pe&&pe.defaultView||window;if(ae.getSelection){var ie=ae.getSelection(),ut=N.textContent.length,it=Math.min(B.start,ut),nn=B.end===void 0?it:Math.min(B.end,ut);!ie.extend&&it>nn&&(k=nn,nn=it,it=k);var K=E1(N,it),q=E1(N,nn);if(K&&q&&(ie.rangeCount!==1||ie.anchorNode!==K.node||ie.anchorOffset!==K.offset||ie.focusNode!==q.node||ie.focusOffset!==q.offset)){var ee=pe.createRange();ee.setStart(K.node,K.offset),ie.removeAllRanges(),it>nn?(ie.addRange(ee),ie.extend(q.node,q.offset)):(ee.setEnd(q.node,q.offset),ie.addRange(ee))}}}}for(pe=[],ie=N;ie=ie.parentNode;)ie.nodeType===1&&pe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<pe.length;N++){var fe=pe[N];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Hf=!!Qg,Wg=Qg=null}finally{Kt=x,I.p=h,P.T=d}}i.current=l,Xn=2}}function Uw(){if(Xn===2){Xn=0;var i=So,l=_l,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=P.T,P.T=null;var h=I.p;I.p=2;var x=Kt;Kt|=4;try{vw(i,l.alternate,l)}finally{Kt=x,I.p=h,P.T=d}}Xn=3}}function Bw(){if(Xn===4||Xn===3){Xn=0,Bt();var i=So,l=_l,d=kl,h=Dw;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Xn=5:(Xn=0,_l=So=null,Vw(i,i.pendingLanes));var x=i.pendingLanes;if(x===0&&(bo=null),Zo(d),l=l.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(gt,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=P.T,x=I.p,I.p=2,P.T=null;try{for(var w=i.onRecoverableError,k=0;k<h.length;k++){var N=h[k];w(N.value,{componentStack:N.stack})}}finally{P.T=l,I.p=x}}(kl&3)!==0&&Pf(),Wa(i),x=i.pendingLanes,(d&4194090)!==0&&(x&42)!==0?i===Ng?vu++:(vu=0,Ng=i):vu=0,yu(0)}}function Vw(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Xc(l)))}function Pf(i){return $w(),Uw(),Bw(),Fw()}function Fw(){if(Xn!==5)return!1;var i=So,l=kg;kg=0;var d=Zo(kl),h=P.T,x=I.p;try{I.p=32>d?32:d,P.T=null,d=Pg,Pg=null;var w=So,k=kl;if(Xn=0,_l=So=null,kl=0,(Kt&6)!==0)throw Error(r(331));var N=Kt;if(Kt|=4,Tw(w.current),jw(w,w.current,k,d),Kt=N,yu(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(gt,w)}catch{}return!0}finally{I.p=x,P.T=h,Vw(i,l)}}function Hw(i,l,d){l=Jr(d,l),l=dg(i.stateNode,l,2),i=uo(i,l,2),i!==null&&(wa(i,2),Wa(i))}function an(i,l,d){if(i.tag===3)Hw(i,i,d);else for(;l!==null;){if(l.tag===3){Hw(l,i,d);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(bo===null||!bo.has(h))){i=Jr(d,i),d=WS(2),h=uo(l,d,2),h!==null&&(YS(d,h,l,i),wa(h,2),Wa(h));break}}l=l.return}}function Lg(i,l,d){var h=i.pingCache;if(h===null){h=i.pingCache=new rP;var x=new Set;h.set(l,x)}else x=h.get(l),x===void 0&&(x=new Set,h.set(l,x));x.has(d)||(Rg=!0,x.add(d),i=lP.bind(null,i,l,d),l.then(i,i))}function lP(i,l,d){var h=i.pingCache;h!==null&&h.delete(l),i.pingedLanes|=i.suspendedLanes&d,i.warmLanes&=~d,un===i&&(Mt&d)===d&&(An===4||An===3&&(Mt&62914560)===Mt&&300>Se()-_g?(Kt&2)===0&&Pl(i,0):Dg|=d,Al===Mt&&(Al=0)),Wa(i)}function qw(i,l){l===0&&(l=Xo()),i=pl(i,l),i!==null&&(wa(i,l),Wa(i))}function cP(i){var l=i.memoizedState,d=0;l!==null&&(d=l.retryLane),qw(i,d)}function uP(i,l){var d=0;switch(i.tag){case 13:var h=i.stateNode,x=i.memoizedState;x!==null&&(d=x.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),qw(i,d)}function dP(i,l){return Ot(i,l)}var Nf=null,Ol=null,zg=!1,Of=!1,$g=!1,ms=0;function Wa(i){i!==Ol&&i.next===null&&(Ol===null?Nf=Ol=i:Ol=Ol.next=i),Of=!0,zg||(zg=!0,hP())}function yu(i,l){if(!$g&&Of){$g=!0;do for(var d=!1,h=Nf;h!==null;){if(i!==0){var x=h.pendingLanes;if(x===0)var w=0;else{var k=h.suspendedLanes,N=h.pingedLanes;w=(1<<31-_t(42|i)+1)-1,w&=x&~(k&~N),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,Yw(h,w))}else w=Mt,w=Yn(h,h===un?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||xr(h,w)||(d=!0,Yw(h,w));h=h.next}while(d);$g=!1}}function fP(){Gw()}function Gw(){Of=zg=!1;var i=0;ms!==0&&(SP()&&(i=ms),ms=0);for(var l=Se(),d=null,h=Nf;h!==null;){var x=h.next,w=Qw(h,l);w===0?(h.next=null,d===null?Nf=x:d.next=x,x===null&&(Ol=d)):(d=h,(i!==0||(w&3)!==0)&&(Of=!0)),h=x}yu(i)}function Qw(i,l){for(var d=i.suspendedLanes,h=i.pingedLanes,x=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var k=31-_t(w),N=1<<k,B=x[k];B===-1?((N&d)===0||(N&h)!==0)&&(x[k]=al(N,l)):B<=l&&(i.expiredLanes|=N),w&=~N}if(l=un,d=Mt,d=Yn(i,i===l?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,d===0||i===l&&(Xt===2||Xt===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&xt(h),i.callbackNode=null,i.callbackPriority=0;if((d&3)===0||xr(i,d)){if(l=d&-d,l===i.callbackPriority)return l;switch(h!==null&&xt(h),Zo(d)){case 2:case 8:d=Te;break;case 32:d=ge;break;case 268435456:d=Le;break;default:d=ge}return h=Ww.bind(null,i),d=Ot(d,h),i.callbackPriority=l,i.callbackNode=d,l}return h!==null&&h!==null&&xt(h),i.callbackPriority=2,i.callbackNode=null,2}function Ww(i,l){if(Xn!==0&&Xn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var d=i.callbackNode;if(Pf()&&i.callbackNode!==d)return null;var h=Mt;return h=Yn(i,i===un?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(_w(i,h,l),Qw(i,Se()),i.callbackNode!=null&&i.callbackNode===d?Ww.bind(null,i):null)}function Yw(i,l){if(Pf())return null;_w(i,l,!0)}function hP(){jP(function(){(Kt&6)!==0?Ot(Ve,fP):Gw()})}function Ug(){return ms===0&&(ms=no()),ms}function Kw(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Hd(""+i)}function Xw(i,l){var d=l.ownerDocument.createElement("input");return d.name=l.name,d.value=l.value,i.id&&d.setAttribute("form",i.id),l.parentNode.insertBefore(d,l),i=new FormData(i),d.parentNode.removeChild(d),i}function pP(i,l,d,h,x){if(l==="submit"&&d&&d.stateNode===x){var w=Kw((x[Ee]||null).action),k=h.submitter;k&&(l=(l=k[Ee]||null)?Kw(l.formAction):k.getAttribute("formAction"),l!==null&&(w=l,k=null));var N=new Wd("action","action",null,h,x);i.push({event:N,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(ms!==0){var B=k?Xw(x,k):new FormData(x);og(d,{pending:!0,data:B,method:x.method,action:w},null,B)}}else typeof w=="function"&&(N.preventDefault(),B=k?Xw(x,k):new FormData(x),og(d,{pending:!0,data:B,method:x.method,action:w},w,B))},currentTarget:x}]})}}for(var Bg=0;Bg<Em.length;Bg++){var Vg=Em[Bg],mP=Vg.toLowerCase(),gP=Vg[0].toUpperCase()+Vg.slice(1);Ta(mP,"on"+gP)}Ta(_1,"onAnimationEnd"),Ta(k1,"onAnimationIteration"),Ta(P1,"onAnimationStart"),Ta("dblclick","onDoubleClick"),Ta("focusin","onFocus"),Ta("focusout","onBlur"),Ta(N4,"onTransitionRun"),Ta(O4,"onTransitionStart"),Ta(M4,"onTransitionCancel"),Ta(N1,"onTransitionEnd"),Kr("onMouseEnter",["mouseout","mouseover"]),Kr("onMouseLeave",["mouseout","mouseover"]),Kr("onPointerEnter",["pointerout","pointerover"]),Kr("onPointerLeave",["pointerout","pointerover"]),cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xu="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(" "),vP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xu));function Zw(i,l){l=(l&4)!==0;for(var d=0;d<i.length;d++){var h=i[d],x=h.event;h=h.listeners;e:{var w=void 0;if(l)for(var k=h.length-1;0<=k;k--){var N=h[k],B=N.instance,ne=N.currentTarget;if(N=N.listener,B!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=ne;try{w(x)}catch(ue){Sf(ue)}x.currentTarget=null,w=B}else for(k=0;k<h.length;k++){if(N=h[k],B=N.instance,ne=N.currentTarget,N=N.listener,B!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=ne;try{w(x)}catch(ue){Sf(ue)}x.currentTarget=null,w=B}}}}function Rt(i,l){var d=l[tt];d===void 0&&(d=l[tt]=new Set);var h=i+"__bubble";d.has(h)||(Jw(l,i,2,!1),d.add(h))}function Fg(i,l,d){var h=0;l&&(h|=4),Jw(d,i,h,l)}var Mf="_reactListening"+Math.random().toString(36).slice(2);function Hg(i){if(!i[Mf]){i[Mf]=!0,jt.forEach(function(d){d!=="selectionchange"&&(vP.has(d)||Fg(d,!1,i),Fg(d,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Mf]||(l[Mf]=!0,Fg("selectionchange",!1,l))}}function Jw(i,l,d,h){switch(jj(l)){case 2:var x=HP;break;case 8:x=qP;break;default:x=av}d=x.bind(null,l,d,i),x=void 0,!fm||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),h?x!==void 0?i.addEventListener(l,d,{capture:!0,passive:x}):i.addEventListener(l,d,!0):x!==void 0?i.addEventListener(l,d,{passive:x}):i.addEventListener(l,d,!1)}function qg(i,l,d,h,x){var w=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var k=h.tag;if(k===3||k===4){var N=h.stateNode.containerInfo;if(N===x)break;if(k===4)for(k=h.return;k!==null;){var B=k.tag;if((B===3||B===4)&&k.stateNode.containerInfo===x)return;k=k.return}for(;N!==null;){if(k=lt(N),k===null)return;if(B=k.tag,B===5||B===6||B===26||B===27){h=w=k;continue e}N=N.parentNode}}h=h.return}o1(function(){var ne=w,ue=um(d),pe=[];e:{var ae=O1.get(i);if(ae!==void 0){var ie=Wd,ut=i;switch(i){case"keypress":if(Gd(d)===0)break e;case"keydown":case"keyup":ie=d4;break;case"focusin":ut="focus",ie=gm;break;case"focusout":ut="blur",ie=gm;break;case"beforeblur":case"afterblur":ie=gm;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=c1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=Jk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=p4;break;case _1:case k1:case P1:ie=n4;break;case N1:ie=g4;break;case"scroll":case"scrollend":ie=Xk;break;case"wheel":ie=y4;break;case"copy":case"cut":case"paste":ie=a4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=d1;break;case"toggle":case"beforetoggle":ie=b4}var it=(l&4)!==0,nn=!it&&(i==="scroll"||i==="scrollend"),K=it?ae!==null?ae+"Capture":null:ae;it=[];for(var q=ne,ee;q!==null;){var fe=q;if(ee=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||ee===null||K===null||(fe=zc(q,K),fe!=null&&it.push(bu(q,fe,ee))),nn)break;q=q.return}0<it.length&&(ae=new ie(ae,ut,null,d,ue),pe.push({event:ae,listeners:it}))}}if((l&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ie=i==="mouseout"||i==="pointerout",ae&&d!==cm&&(ut=d.relatedTarget||d.fromElement)&&(lt(ut)||ut[Be]))break e;if((ie||ae)&&(ae=ue.window===ue?ue:(ae=ue.ownerDocument)?ae.defaultView||ae.parentWindow:window,ie?(ut=d.relatedTarget||d.toElement,ie=ne,ut=ut?lt(ut):null,ut!==null&&(nn=o(ut),it=ut.tag,ut!==nn||it!==5&&it!==27&&it!==6)&&(ut=null)):(ie=null,ut=ne),ie!==ut)){if(it=c1,fe="onMouseLeave",K="onMouseEnter",q="mouse",(i==="pointerout"||i==="pointerover")&&(it=d1,fe="onPointerLeave",K="onPointerEnter",q="pointer"),nn=ie==null?ae:at(ie),ee=ut==null?ae:at(ut),ae=new it(fe,q+"leave",ie,d,ue),ae.target=nn,ae.relatedTarget=ee,fe=null,lt(ue)===ne&&(it=new it(K,q+"enter",ut,d,ue),it.target=ee,it.relatedTarget=nn,fe=it),nn=fe,ie&&ut)t:{for(it=ie,K=ut,q=0,ee=it;ee;ee=Ml(ee))q++;for(ee=0,fe=K;fe;fe=Ml(fe))ee++;for(;0<q-ee;)it=Ml(it),q--;for(;0<ee-q;)K=Ml(K),ee--;for(;q--;){if(it===K||K!==null&&it===K.alternate)break t;it=Ml(it),K=Ml(K)}it=null}else it=null;ie!==null&&ej(pe,ae,ie,it,!1),ut!==null&&nn!==null&&ej(pe,nn,ut,it,!0)}}e:{if(ae=ne?at(ne):window,ie=ae.nodeName&&ae.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ae.type==="file")var He=x1;else if(v1(ae))if(b1)He=_4;else{He=D4;var Et=R4}else ie=ae.nodeName,!ie||ie.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&lm(ne.elementType)&&(He=x1):He=A4;if(He&&(He=He(i,ne))){y1(pe,He,d,ue);break e}Et&&Et(i,ae,ne),i==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&sm(ae,"number",ae.value)}switch(Et=ne?at(ne):window,i){case"focusin":(v1(Et)||Et.contentEditable==="true")&&(dl=Et,wm=ne,Gc=null);break;case"focusout":Gc=wm=dl=null;break;case"mousedown":jm=!0;break;case"contextmenu":case"mouseup":case"dragend":jm=!1,D1(pe,d,ue);break;case"selectionchange":if(P4)break;case"keydown":case"keyup":D1(pe,d,ue)}var Je;if(ym)e:{switch(i){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else ul?m1(i,d)&&(st="onCompositionEnd"):i==="keydown"&&d.keyCode===229&&(st="onCompositionStart");st&&(f1&&d.locale!=="ko"&&(ul||st!=="onCompositionStart"?st==="onCompositionEnd"&&ul&&(Je=s1()):(oo=ue,hm="value"in oo?oo.value:oo.textContent,ul=!0)),Et=If(ne,st),0<Et.length&&(st=new u1(st,i,null,d,ue),pe.push({event:st,listeners:Et}),Je?st.data=Je:(Je=g1(d),Je!==null&&(st.data=Je)))),(Je=w4?j4(i,d):C4(i,d))&&(st=If(ne,"onBeforeInput"),0<st.length&&(Et=new u1("onBeforeInput","beforeinput",null,d,ue),pe.push({event:Et,listeners:st}),Et.data=Je)),pP(pe,i,ne,d,ue)}Zw(pe,l)})}function bu(i,l,d){return{instance:i,listener:l,currentTarget:d}}function If(i,l){for(var d=l+"Capture",h=[];i!==null;){var x=i,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=zc(i,d),x!=null&&h.unshift(bu(i,x,w)),x=zc(i,l),x!=null&&h.push(bu(i,x,w))),i.tag===3)return h;i=i.return}return[]}function Ml(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function ej(i,l,d,h,x){for(var w=l._reactName,k=[];d!==null&&d!==h;){var N=d,B=N.alternate,ne=N.stateNode;if(N=N.tag,B!==null&&B===h)break;N!==5&&N!==26&&N!==27||ne===null||(B=ne,x?(ne=zc(d,w),ne!=null&&k.unshift(bu(d,ne,B))):x||(ne=zc(d,w),ne!=null&&k.push(bu(d,ne,B)))),d=d.return}k.length!==0&&i.push({event:l,listeners:k})}var yP=/\r\n?/g,xP=/\u0000|\uFFFD/g;function tj(i){return(typeof i=="string"?i:""+i).replace(yP,`
557
- `).replace(xP,"")}function nj(i,l){return l=tj(l),tj(i)===l}function Lf(){}function tn(i,l,d,h,x,w){switch(d){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||sl(i,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&sl(i,""+h);break;case"className":gi(i,"class",h);break;case"tabIndex":gi(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":gi(i,d,h);break;case"style":a1(i,h,w);break;case"data":if(l!=="object"){gi(i,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||d!=="href")){i.removeAttribute(d);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(d);break}h=Hd(""+h),i.setAttribute(d,h);break;case"action":case"formAction":if(typeof h=="function"){i.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(d==="formAction"?(l!=="input"&&tn(i,l,"name",x.name,x,null),tn(i,l,"formEncType",x.formEncType,x,null),tn(i,l,"formMethod",x.formMethod,x,null),tn(i,l,"formTarget",x.formTarget,x,null)):(tn(i,l,"encType",x.encType,x,null),tn(i,l,"method",x.method,x,null),tn(i,l,"target",x.target,x,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(d);break}h=Hd(""+h),i.setAttribute(d,h);break;case"onClick":h!=null&&(i.onclick=Lf);break;case"onScroll":h!=null&&Rt("scroll",i);break;case"onScrollEnd":h!=null&&Rt("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=d}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}d=Hd(""+h),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(d,""+h):i.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(d,""):i.removeAttribute(d);break;case"capture":case"download":h===!0?i.setAttribute(d,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(d,h):i.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(d,h):i.removeAttribute(d);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(d):i.setAttribute(d,h);break;case"popover":Rt("beforetoggle",i),Rt("toggle",i),Xr(i,"popover",h);break;case"xlinkActuate":Ct(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Ct(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Ct(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Ct(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Ct(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Ct(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Ct(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Ct(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Ct(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Xr(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=Yk.get(d)||d,Xr(i,d,h))}}function Gg(i,l,d,h,x,w){switch(d){case"style":a1(i,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=d}}break;case"children":typeof h=="string"?sl(i,h):(typeof h=="number"||typeof h=="bigint")&&sl(i,""+h);break;case"onScroll":h!=null&&Rt("scroll",i);break;case"onScrollEnd":h!=null&&Rt("scrollend",i);break;case"onClick":h!=null&&(i.onclick=Lf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fa.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(x=d.endsWith("Capture"),l=d.slice(2,x?d.length-7:void 0),w=i[Ee]||null,w=w!=null?w[d]:null,typeof w=="function"&&i.removeEventListener(l,w,x),typeof h=="function")){typeof w!="function"&&w!==null&&(d in i?i[d]=null:i.hasAttribute(d)&&i.removeAttribute(d)),i.addEventListener(l,h,x);break e}d in i?i[d]=h:h===!0?i.setAttribute(d,""):Xr(i,d,h)}}}function Zn(i,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",i),Rt("load",i);var h=!1,x=!1,w;for(w in d)if(d.hasOwnProperty(w)){var k=d[w];if(k!=null)switch(w){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:tn(i,l,w,k,d,null)}}x&&tn(i,l,"srcSet",d.srcSet,d,null),h&&tn(i,l,"src",d.src,d,null);return;case"input":Rt("invalid",i);var N=w=k=x=null,B=null,ne=null;for(h in d)if(d.hasOwnProperty(h)){var ue=d[h];if(ue!=null)switch(h){case"name":x=ue;break;case"type":k=ue;break;case"checked":B=ue;break;case"defaultChecked":ne=ue;break;case"value":w=ue;break;case"defaultValue":N=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,l));break;default:tn(i,l,h,ue,d,null)}}e1(i,w,N,B,ne,k,x,!1),Vd(i);return;case"select":Rt("invalid",i),h=k=w=null;for(x in d)if(d.hasOwnProperty(x)&&(N=d[x],N!=null))switch(x){case"value":w=N;break;case"defaultValue":k=N;break;case"multiple":h=N;default:tn(i,l,x,N,d,null)}l=w,d=k,i.multiple=!!h,l!=null?ol(i,!!h,l,!1):d!=null&&ol(i,!!h,d,!0);return;case"textarea":Rt("invalid",i),w=x=h=null;for(k in d)if(d.hasOwnProperty(k)&&(N=d[k],N!=null))switch(k){case"value":h=N;break;case"defaultValue":x=N;break;case"children":w=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:tn(i,l,k,N,d,null)}n1(i,h,x,w),Vd(i);return;case"option":for(B in d)if(d.hasOwnProperty(B)&&(h=d[B],h!=null))switch(B){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:tn(i,l,B,h,d,null)}return;case"dialog":Rt("beforetoggle",i),Rt("toggle",i),Rt("cancel",i),Rt("close",i);break;case"iframe":case"object":Rt("load",i);break;case"video":case"audio":for(h=0;h<xu.length;h++)Rt(xu[h],i);break;case"image":Rt("error",i),Rt("load",i);break;case"details":Rt("toggle",i);break;case"embed":case"source":case"link":Rt("error",i),Rt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in d)if(d.hasOwnProperty(ne)&&(h=d[ne],h!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:tn(i,l,ne,h,d,null)}return;default:if(lm(l)){for(ue in d)d.hasOwnProperty(ue)&&(h=d[ue],h!==void 0&&Gg(i,l,ue,h,d,void 0));return}}for(N in d)d.hasOwnProperty(N)&&(h=d[N],h!=null&&tn(i,l,N,h,d,null))}function bP(i,l,d,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,w=null,k=null,N=null,B=null,ne=null,ue=null;for(ie in d){var pe=d[ie];if(d.hasOwnProperty(ie)&&pe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":B=pe;default:h.hasOwnProperty(ie)||tn(i,l,ie,null,h,pe)}}for(var ae in h){var ie=h[ae];if(pe=d[ae],h.hasOwnProperty(ae)&&(ie!=null||pe!=null))switch(ae){case"type":w=ie;break;case"name":x=ie;break;case"checked":ne=ie;break;case"defaultChecked":ue=ie;break;case"value":k=ie;break;case"defaultValue":N=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,l));break;default:ie!==pe&&tn(i,l,ae,ie,h,pe)}}om(i,k,N,B,ne,ue,w,x);return;case"select":ie=k=N=ae=null;for(w in d)if(B=d[w],d.hasOwnProperty(w)&&B!=null)switch(w){case"value":break;case"multiple":ie=B;default:h.hasOwnProperty(w)||tn(i,l,w,null,h,B)}for(x in h)if(w=h[x],B=d[x],h.hasOwnProperty(x)&&(w!=null||B!=null))switch(x){case"value":ae=w;break;case"defaultValue":N=w;break;case"multiple":k=w;default:w!==B&&tn(i,l,x,w,h,B)}l=N,d=k,h=ie,ae!=null?ol(i,!!d,ae,!1):!!h!=!!d&&(l!=null?ol(i,!!d,l,!0):ol(i,!!d,d?[]:"",!1));return;case"textarea":ie=ae=null;for(N in d)if(x=d[N],d.hasOwnProperty(N)&&x!=null&&!h.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:tn(i,l,N,null,h,x)}for(k in h)if(x=h[k],w=d[k],h.hasOwnProperty(k)&&(x!=null||w!=null))switch(k){case"value":ae=x;break;case"defaultValue":ie=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&tn(i,l,k,x,h,w)}t1(i,ae,ie);return;case"option":for(var ut in d)if(ae=d[ut],d.hasOwnProperty(ut)&&ae!=null&&!h.hasOwnProperty(ut))switch(ut){case"selected":i.selected=!1;break;default:tn(i,l,ut,null,h,ae)}for(B in h)if(ae=h[B],ie=d[B],h.hasOwnProperty(B)&&ae!==ie&&(ae!=null||ie!=null))switch(B){case"selected":i.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:tn(i,l,B,ae,h,ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var it in d)ae=d[it],d.hasOwnProperty(it)&&ae!=null&&!h.hasOwnProperty(it)&&tn(i,l,it,null,h,ae);for(ne in h)if(ae=h[ne],ie=d[ne],h.hasOwnProperty(ne)&&ae!==ie&&(ae!=null||ie!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,l));break;default:tn(i,l,ne,ae,h,ie)}return;default:if(lm(l)){for(var nn in d)ae=d[nn],d.hasOwnProperty(nn)&&ae!==void 0&&!h.hasOwnProperty(nn)&&Gg(i,l,nn,void 0,h,ae);for(ue in h)ae=h[ue],ie=d[ue],!h.hasOwnProperty(ue)||ae===ie||ae===void 0&&ie===void 0||Gg(i,l,ue,ae,h,ie);return}}for(var K in d)ae=d[K],d.hasOwnProperty(K)&&ae!=null&&!h.hasOwnProperty(K)&&tn(i,l,K,null,h,ae);for(pe in h)ae=h[pe],ie=d[pe],!h.hasOwnProperty(pe)||ae===ie||ae==null&&ie==null||tn(i,l,pe,ae,h,ie)}var Qg=null,Wg=null;function zf(i){return i.nodeType===9?i:i.ownerDocument}function rj(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function aj(i,l){if(i===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&l==="foreignObject"?0:i}function Yg(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Kg=null;function SP(){var i=window.event;return i&&i.type==="popstate"?i===Kg?!1:(Kg=i,!0):(Kg=null,!1)}var ij=typeof setTimeout=="function"?setTimeout:void 0,wP=typeof clearTimeout=="function"?clearTimeout:void 0,oj=typeof Promise=="function"?Promise:void 0,jP=typeof queueMicrotask=="function"?queueMicrotask:typeof oj<"u"?function(i){return oj.resolve(null).then(i).catch(CP)}:ij;function CP(i){setTimeout(function(){throw i})}function jo(i){return i==="head"}function sj(i,l){var d=l,h=0,x=0;do{var w=d.nextSibling;if(i.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(0<h&&8>h){d=h;var k=i.ownerDocument;if(d&1&&Su(k.documentElement),d&2&&Su(k.body),d&4)for(d=k.head,Su(d),k=d.firstChild;k;){var N=k.nextSibling,B=k.nodeName;k[rt]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&k.rel.toLowerCase()==="stylesheet"||d.removeChild(k),k=N}}if(x===0){i.removeChild(w),Au(l);return}x--}else d==="$"||d==="$?"||d==="$!"?x++:h=d.charCodeAt(0)-48;else h=0;d=w}while(d);Au(l)}function Xg(i){var l=i.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var d=l;switch(l=l.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":Xg(d),Ye(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}i.removeChild(d)}}function EP(i,l,d,h){for(;i.nodeType===1;){var x=d;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[rt])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(w=i.getAttribute("rel"),w==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(w!==x.rel||i.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||i.getAttribute("title")!==(x.title==null?null:x.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(x.src==null?null:x.src)||i.getAttribute("type")!==(x.type==null?null:x.type)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=Da(i.nextSibling),i===null)break}return null}function TP(i,l,d){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!d||(i=Da(i.nextSibling),i===null))return null;return i}function Zg(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function RP(i,l){var d=i.ownerDocument;if(i.data!=="$?"||d.readyState==="complete")l();else{var h=function(){l(),d.removeEventListener("DOMContentLoaded",h)};d.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function Da(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?"||l==="F!"||l==="F")break;if(l==="/$")return null}}return i}var Jg=null;function lj(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var d=i.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return i;l--}else d==="/$"&&l++}i=i.previousSibling}return null}function cj(i,l,d){switch(l=zf(d),i){case"html":if(i=l.documentElement,!i)throw Error(r(452));return i;case"head":if(i=l.head,!i)throw Error(r(453));return i;case"body":if(i=l.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Su(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);Ye(i)}var ia=new Map,uj=new Set;function $f(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var _i=I.d;I.d={f:DP,r:AP,D:_P,C:kP,L:PP,m:NP,X:MP,S:OP,M:IP};function DP(){var i=_i.f(),l=_f();return i||l}function AP(i){var l=At(i);l!==null&&l.tag===5&&l.type==="form"?_S(l):_i.r(i)}var Il=typeof document>"u"?null:document;function dj(i,l,d){var h=Il;if(h&&typeof l=="string"&&l){var x=Zr(l);x='link[rel="'+i+'"][href="'+x+'"]',typeof d=="string"&&(x+='[crossorigin="'+d+'"]'),uj.has(x)||(uj.add(x),i={rel:i,crossOrigin:d,href:l},h.querySelector(x)===null&&(l=h.createElement("link"),Zn(l,"link",i),kt(l),h.head.appendChild(l)))}}function _P(i){_i.D(i),dj("dns-prefetch",i,null)}function kP(i,l){_i.C(i,l),dj("preconnect",i,l)}function PP(i,l,d){_i.L(i,l,d);var h=Il;if(h&&i&&l){var x='link[rel="preload"][as="'+Zr(l)+'"]';l==="image"&&d&&d.imageSrcSet?(x+='[imagesrcset="'+Zr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(x+='[imagesizes="'+Zr(d.imageSizes)+'"]')):x+='[href="'+Zr(i)+'"]';var w=x;switch(l){case"style":w=Ll(i);break;case"script":w=zl(i)}ia.has(w)||(i=m({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:i,as:l},d),ia.set(w,i),h.querySelector(x)!==null||l==="style"&&h.querySelector(wu(w))||l==="script"&&h.querySelector(ju(w))||(l=h.createElement("link"),Zn(l,"link",i),kt(l),h.head.appendChild(l)))}}function NP(i,l){_i.m(i,l);var d=Il;if(d&&i){var h=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+Zr(h)+'"][href="'+Zr(i)+'"]',w=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=zl(i)}if(!ia.has(w)&&(i=m({rel:"modulepreload",href:i},l),ia.set(w,i),d.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(ju(w)))return}h=d.createElement("link"),Zn(h,"link",i),kt(h),d.head.appendChild(h)}}}function OP(i,l,d){_i.S(i,l,d);var h=Il;if(h&&i){var x=rn(h).hoistableStyles,w=Ll(i);l=l||"default";var k=x.get(w);if(!k){var N={loading:0,preload:null};if(k=h.querySelector(wu(w)))N.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":l},d),(d=ia.get(w))&&ev(i,d);var B=k=h.createElement("link");kt(B),Zn(B,"link",i),B._p=new Promise(function(ne,ue){B.onload=ne,B.onerror=ue}),B.addEventListener("load",function(){N.loading|=1}),B.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Uf(k,l,h)}k={type:"stylesheet",instance:k,count:1,state:N},x.set(w,k)}}}function MP(i,l){_i.X(i,l);var d=Il;if(d&&i){var h=rn(d).hoistableScripts,x=zl(i),w=h.get(x);w||(w=d.querySelector(ju(x)),w||(i=m({src:i,async:!0},l),(l=ia.get(x))&&tv(i,l),w=d.createElement("script"),kt(w),Zn(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function IP(i,l){_i.M(i,l);var d=Il;if(d&&i){var h=rn(d).hoistableScripts,x=zl(i),w=h.get(x);w||(w=d.querySelector(ju(x)),w||(i=m({src:i,async:!0,type:"module"},l),(l=ia.get(x))&&tv(i,l),w=d.createElement("script"),kt(w),Zn(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function fj(i,l,d,h){var x=(x=ve.current)?$f(x):null;if(!x)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=Ll(d.href),d=rn(x).hoistableStyles,h=d.get(l),h||(h={type:"style",instance:null,count:0,state:null},d.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){i=Ll(d.href);var w=rn(x).hoistableStyles,k=w.get(i);if(k||(x=x.ownerDocument||x,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,k),(w=x.querySelector(wu(i)))&&!w._p&&(k.instance=w,k.state.loading=5),ia.has(i)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},ia.set(i,d),w||LP(x,i,d,k.state))),l&&h===null)throw Error(r(528,""));return k}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=zl(d),d=rn(x).hoistableScripts,h=d.get(l),h||(h={type:"script",instance:null,count:0,state:null},d.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ll(i){return'href="'+Zr(i)+'"'}function wu(i){return'link[rel="stylesheet"]['+i+"]"}function hj(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function LP(i,l,d,h){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=i.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),Zn(l,"link",d),kt(l),i.head.appendChild(l))}function zl(i){return'[src="'+Zr(i)+'"]'}function ju(i){return"script[async]"+i}function pj(i,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var h=i.querySelector('style[data-href~="'+Zr(d.href)+'"]');if(h)return l.instance=h,kt(h),h;var x=m({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),kt(h),Zn(h,"style",x),Uf(h,d.precedence,i),l.instance=h;case"stylesheet":x=Ll(d.href);var w=i.querySelector(wu(x));if(w)return l.state.loading|=4,l.instance=w,kt(w),w;h=hj(d),(x=ia.get(x))&&ev(h,x),w=(i.ownerDocument||i).createElement("link"),kt(w);var k=w;return k._p=new Promise(function(N,B){k.onload=N,k.onerror=B}),Zn(w,"link",h),l.state.loading|=4,Uf(w,d.precedence,i),l.instance=w;case"script":return w=zl(d.src),(x=i.querySelector(ju(w)))?(l.instance=x,kt(x),x):(h=d,(x=ia.get(w))&&(h=m({},d),tv(h,x)),i=i.ownerDocument||i,x=i.createElement("script"),kt(x),Zn(x,"link",h),i.head.appendChild(x),l.instance=x);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,Uf(h,d.precedence,i));return l.instance}function Uf(i,l,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,w=x,k=0;k<h.length;k++){var N=h[k];if(N.dataset.precedence===l)w=N;else if(w!==x)break}w?w.parentNode.insertBefore(i,w.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(i,l.firstChild))}function ev(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function tv(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Bf=null;function mj(i,l,d){if(Bf===null){var h=new Map,x=Bf=new Map;x.set(d,h)}else x=Bf,h=x.get(d),h||(h=new Map,x.set(d,h));if(h.has(i))return h;for(h.set(i,null),d=d.getElementsByTagName(i),x=0;x<d.length;x++){var w=d[x];if(!(w[rt]||w[he]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var k=w.getAttribute(l)||"";k=i+k;var N=h.get(k);N?N.push(w):h.set(k,[w])}}return h}function gj(i,l,d){i=i.ownerDocument||i,i.head.insertBefore(d,l==="title"?i.querySelector("head > title"):null)}function zP(i,l,d){if(d===1||l.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return i=l.disabled,typeof l.precedence=="string"&&i==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function vj(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Cu=null;function $P(){}function UP(i,l,d){if(Cu===null)throw Error(r(475));var h=Cu;if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var x=Ll(d.href),w=i.querySelector(wu(x));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(h.count++,h=Vf.bind(h),i.then(h,h)),l.state.loading|=4,l.instance=w,kt(w);return}w=i.ownerDocument||i,d=hj(d),(x=ia.get(x))&&ev(d,x),w=w.createElement("link"),kt(w);var k=w;k._p=new Promise(function(N,B){k.onload=N,k.onerror=B}),Zn(w,"link",d),l.instance=w}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(h.count++,l=Vf.bind(h),i.addEventListener("load",l),i.addEventListener("error",l))}}function BP(){if(Cu===null)throw Error(r(475));var i=Cu;return i.stylesheets&&i.count===0&&nv(i,i.stylesheets),0<i.count?function(l){var d=setTimeout(function(){if(i.stylesheets&&nv(i,i.stylesheets),i.unsuspend){var h=i.unsuspend;i.unsuspend=null,h()}},6e4);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(d)}}:null}function Vf(){if(this.count--,this.count===0){if(this.stylesheets)nv(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Ff=null;function nv(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Ff=new Map,l.forEach(VP,i),Ff=null,Vf.call(i))}function VP(i,l){if(!(l.state.loading&4)){var d=Ff.get(i);if(d)var h=d.get(null);else{d=new Map,Ff.set(i,d);for(var x=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var k=x[w];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(d.set(k.dataset.precedence,k),h=k)}h&&d.set(null,h)}x=l.instance,k=x.getAttribute("data-precedence"),w=d.get(k)||h,w===h&&d.set(null,x),d.set(k,x),this.count++,h=Vf.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),w?w.parentNode.insertBefore(x,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(x,i.firstChild)),l.state.loading|=4}}var Eu={$$typeof:E,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function FP(i,l,d,h,x,w,k,N){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Va(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Va(0),this.hiddenUpdates=Va(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function yj(i,l,d,h,x,w,k,N,B,ne,ue,pe){return i=new FP(i,l,d,k,N,B,ne,pe),l=1,w===!0&&(l|=24),w=Lr(3,null,null,l),i.current=w,w.stateNode=i,l=Lm(),l.refCount++,i.pooledCache=l,l.refCount++,w.memoizedState={element:h,isDehydrated:d,cache:l},Bm(w),i}function xj(i){return i?(i=ml,i):ml}function bj(i,l,d,h,x,w){x=xj(x),h.context===null?h.context=x:h.pendingContext=x,h=co(l),h.payload={element:d},w=w===void 0?null:w,w!==null&&(h.callback=w),d=uo(i,h,l),d!==null&&(Vr(d,i,l),tu(d,i,l))}function Sj(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var d=i.retryLane;i.retryLane=d!==0&&d<l?d:l}}function rv(i,l){Sj(i,l),(i=i.alternate)&&Sj(i,l)}function wj(i){if(i.tag===13){var l=pl(i,67108864);l!==null&&Vr(l,i,67108864),rv(i,67108864)}}var Hf=!0;function HP(i,l,d,h){var x=P.T;P.T=null;var w=I.p;try{I.p=2,av(i,l,d,h)}finally{I.p=w,P.T=x}}function qP(i,l,d,h){var x=P.T;P.T=null;var w=I.p;try{I.p=8,av(i,l,d,h)}finally{I.p=w,P.T=x}}function av(i,l,d,h){if(Hf){var x=iv(h);if(x===null)qg(i,l,h,qf,d),Cj(i,h);else if(QP(x,i,l,d,h))h.stopPropagation();else if(Cj(i,h),l&4&&-1<GP.indexOf(i)){for(;x!==null;){var w=At(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var k=Sa(w.pendingLanes);if(k!==0){var N=w;for(N.pendingLanes|=2,N.entangledLanes|=2;k;){var B=1<<31-_t(k);N.entanglements[1]|=B,k&=~B}Wa(w),(Kt&6)===0&&(Df=Se()+500,yu(0))}}break;case 13:N=pl(w,2),N!==null&&Vr(N,w,2),_f(),rv(w,2)}if(w=iv(h),w===null&&qg(i,l,h,qf,d),w===x)break;x=w}x!==null&&h.stopPropagation()}else qg(i,l,h,null,d)}}function iv(i){return i=um(i),ov(i)}var qf=null;function ov(i){if(qf=null,i=lt(i),i!==null){var l=o(i);if(l===null)i=null;else{var d=l.tag;if(d===13){if(i=c(l),i!==null)return i;i=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return qf=i,null}function jj(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ne()){case Ve:return 2;case Te:return 8;case ge:case we:return 32;case Le:return 268435456;default:return 32}default:return 32}}var sv=!1,Co=null,Eo=null,To=null,Tu=new Map,Ru=new Map,Ro=[],GP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Cj(i,l){switch(i){case"focusin":case"focusout":Co=null;break;case"dragenter":case"dragleave":Eo=null;break;case"mouseover":case"mouseout":To=null;break;case"pointerover":case"pointerout":Tu.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ru.delete(l.pointerId)}}function Du(i,l,d,h,x,w){return i===null||i.nativeEvent!==w?(i={blockedOn:l,domEventName:d,eventSystemFlags:h,nativeEvent:w,targetContainers:[x]},l!==null&&(l=At(l),l!==null&&wj(l)),i):(i.eventSystemFlags|=h,l=i.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),i)}function QP(i,l,d,h,x){switch(l){case"focusin":return Co=Du(Co,i,l,d,h,x),!0;case"dragenter":return Eo=Du(Eo,i,l,d,h,x),!0;case"mouseover":return To=Du(To,i,l,d,h,x),!0;case"pointerover":var w=x.pointerId;return Tu.set(w,Du(Tu.get(w)||null,i,l,d,h,x)),!0;case"gotpointercapture":return w=x.pointerId,Ru.set(w,Du(Ru.get(w)||null,i,l,d,h,x)),!0}return!1}function Ej(i){var l=lt(i.target);if(l!==null){var d=o(l);if(d!==null){if(l=d.tag,l===13){if(l=c(d),l!==null){i.blockedOn=l,Q(i.priority,function(){if(d.tag===13){var h=Br();h=il(h);var x=pl(d,h);x!==null&&Vr(x,d,h),rv(d,h)}});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){i.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Gf(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var d=iv(i.nativeEvent);if(d===null){d=i.nativeEvent;var h=new d.constructor(d.type,d);cm=h,d.target.dispatchEvent(h),cm=null}else return l=At(d),l!==null&&wj(l),i.blockedOn=d,!1;l.shift()}return!0}function Tj(i,l,d){Gf(i)&&d.delete(l)}function WP(){sv=!1,Co!==null&&Gf(Co)&&(Co=null),Eo!==null&&Gf(Eo)&&(Eo=null),To!==null&&Gf(To)&&(To=null),Tu.forEach(Tj),Ru.forEach(Tj)}function Qf(i,l){i.blockedOn===l&&(i.blockedOn=null,sv||(sv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,WP)))}var Wf=null;function Rj(i){Wf!==i&&(Wf=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wf===i&&(Wf=null);for(var l=0;l<i.length;l+=3){var d=i[l],h=i[l+1],x=i[l+2];if(typeof h!="function"){if(ov(h||d)===null)continue;break}var w=At(d);w!==null&&(i.splice(l,3),l-=3,og(w,{pending:!0,data:x,method:d.method,action:h},h,x))}}))}function Au(i){function l(B){return Qf(B,i)}Co!==null&&Qf(Co,i),Eo!==null&&Qf(Eo,i),To!==null&&Qf(To,i),Tu.forEach(l),Ru.forEach(l);for(var d=0;d<Ro.length;d++){var h=Ro[d];h.blockedOn===i&&(h.blockedOn=null)}for(;0<Ro.length&&(d=Ro[0],d.blockedOn===null);)Ej(d),d.blockedOn===null&&Ro.shift();if(d=(i.ownerDocument||i).$$reactFormReplay,d!=null)for(h=0;h<d.length;h+=3){var x=d[h],w=d[h+1],k=x[Ee]||null;if(typeof w=="function")k||Rj(d);else if(k){var N=null;if(w&&w.hasAttribute("formAction")){if(x=w,k=w[Ee]||null)N=k.formAction;else if(ov(x)!==null)continue}else N=k.action;typeof N=="function"?d[h+1]=N:(d.splice(h,3),h-=3),Rj(d)}}}function lv(i){this._internalRoot=i}Yf.prototype.render=lv.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,h=Br();bj(d,h,i,l,null,null)},Yf.prototype.unmount=lv.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;bj(i.current,2,null,i,null,null),_f(),l[Be]=null}};function Yf(i){this._internalRoot=i}Yf.prototype.unstable_scheduleHydration=function(i){if(i){var l=H();i={blockedOn:null,target:i,priority:l};for(var d=0;d<Ro.length&&l!==0&&l<Ro[d].priority;d++);Ro.splice(d,0,i),d===0&&Ej(i)}};var Dj=t.version;if(Dj!=="19.1.0")throw Error(r(527,Dj,"19.1.0"));I.findDOMNode=function(i){var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(l),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var YP={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kf.isDisabled&&Kf.supportsFiber)try{gt=Kf.inject(YP),ht=Kf}catch{}}return Iu.createRoot=function(i,l){if(!a(i))throw Error(r(299));var d=!1,h="",x=HS,w=qS,k=GS,N=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(k=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(N=l.unstable_transitionCallbacks)),l=yj(i,1,!1,null,null,d,h,x,w,k,N,null),i[Be]=l.current,Hg(i),new lv(l)},Iu.hydrateRoot=function(i,l,d){if(!a(i))throw Error(r(299));var h=!1,x="",w=HS,k=qS,N=GS,B=null,ne=null;return d!=null&&(d.unstable_strictMode===!0&&(h=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(k=d.onCaughtError),d.onRecoverableError!==void 0&&(N=d.onRecoverableError),d.unstable_transitionCallbacks!==void 0&&(B=d.unstable_transitionCallbacks),d.formState!==void 0&&(ne=d.formState)),l=yj(i,1,!0,l,d??null,h,x,w,k,N,B,ne),l.context=xj(null),d=l.current,h=Br(),h=il(h),x=co(h),x.callback=null,uo(d,x,h),d=h,l.current.lanes=d,wa(l,d),Wa(l),i[Be]=l.current,Hg(i),new Yf(l)},Iu.version="19.1.0",Iu}var aT;function pY(){if(aT)return Qv.exports;aT=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qv.exports=hY(),Qv.exports}var mY=pY(),Lu={},iT;function gY(){if(iT)return Lu;iT=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.parse=c,Lu.serialize=p;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,o=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function c(v,b){const S=new o,j=v.length;if(j<2)return S;const C=(b==null?void 0:b.decode)||m;let R=0;do{const D=v.indexOf("=",R);if(D===-1)break;const E=v.indexOf(";",R),T=E===-1?j:E;if(D>T){R=v.lastIndexOf(";",D-1)+1;continue}const A=u(v,R,D),_=f(v,D,A),M=v.slice(A,_);if(S[M]===void 0){let L=u(v,D+1,T),$=f(v,T,L);const V=C(v.slice(L,$));S[M]=V}R=T+1}while(R<j);return S}function u(v,b,S){do{const j=v.charCodeAt(b);if(j!==32&&j!==9)return b}while(++b<S);return S}function f(v,b,S){for(;b>S;){const j=v.charCodeAt(--b);if(j!==32&&j!==9)return b+1}return S}function p(v,b,S){const j=(S==null?void 0:S.encode)||encodeURIComponent;if(!e.test(v))throw new TypeError(`argument name is invalid: ${v}`);const C=j(b);if(!t.test(C))throw new TypeError(`argument val is invalid: ${b}`);let R=v+"="+C;if(!S)return R;if(S.maxAge!==void 0){if(!Number.isInteger(S.maxAge))throw new TypeError(`option maxAge is invalid: ${S.maxAge}`);R+="; Max-Age="+S.maxAge}if(S.domain){if(!n.test(S.domain))throw new TypeError(`option domain is invalid: ${S.domain}`);R+="; Domain="+S.domain}if(S.path){if(!r.test(S.path))throw new TypeError(`option path is invalid: ${S.path}`);R+="; Path="+S.path}if(S.expires){if(!g(S.expires)||!Number.isFinite(S.expires.valueOf()))throw new TypeError(`option expires is invalid: ${S.expires}`);R+="; Expires="+S.expires.toUTCString()}if(S.httpOnly&&(R+="; HttpOnly"),S.secure&&(R+="; Secure"),S.partitioned&&(R+="; Partitioned"),S.priority)switch(typeof S.priority=="string"?S.priority.toLowerCase():void 0){case"low":R+="; Priority=Low";break;case"medium":R+="; Priority=Medium";break;case"high":R+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${S.priority}`)}if(S.sameSite)switch(typeof S.sameSite=="string"?S.sameSite.toLowerCase():S.sameSite){case!0:case"strict":R+="; SameSite=Strict";break;case"lax":R+="; SameSite=Lax";break;case"none":R+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${S.sameSite}`)}return R}function m(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function g(v){return a.call(v)==="[object Date]"}return Lu}gY();/**
558
- * react-router v7.6.0
559
- *
560
- * Copyright (c) Remix Software Inc.
561
- *
562
- * This source code is licensed under the MIT license found in the
563
- * LICENSE.md file in the root directory of this source tree.
564
- *
565
- * @license MIT
566
- */var tk=e=>{throw TypeError(e)},vY=(e,t,n)=>t.has(e)||tk("Cannot "+n),Kv=(e,t,n)=>(vY(e,t,"read from private field"),n?n.call(e):t.get(e)),yY=(e,t,n)=>t.has(e)?tk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),oT="popstate";function xY(e={}){function t(r,a){let{pathname:o,search:c,hash:u}=r.location;return sd("",{pathname:o,search:c,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Vo(a)}return SY(t,n,null,e)}function yt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function In(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function bY(){return Math.random().toString(36).substring(2,10)}function sT(e,t){return{usr:e.state,key:e.key,idx:t}}function sd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?to(t):t,state:n,key:t&&t.key||r||bY()}}function Vo({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function to(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function SY(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,c=a.history,u="POP",f=null,p=m();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function m(){return(c.state||{idx:null}).idx}function g(){u="POP";let C=m(),R=C==null?null:C-p;p=C,f&&f({action:u,location:j.location,delta:R})}function v(C,R){u="PUSH";let D=sd(j.location,C,R);p=m()+1;let E=sT(D,p),T=j.createHref(D);try{c.pushState(E,"",T)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(T)}o&&f&&f({action:u,location:j.location,delta:1})}function b(C,R){u="REPLACE";let D=sd(j.location,C,R);p=m();let E=sT(D,p),T=j.createHref(D);c.replaceState(E,"",T),o&&f&&f({action:u,location:j.location,delta:0})}function S(C){return nk(C)}let j={get action(){return u},get location(){return e(a,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(oT,g),f=C,()=>{a.removeEventListener(oT,g),f=null}},createHref(C){return t(a,C)},createURL:S,encodeLocation(C){let R=S(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:v,replace:b,go(C){return c.go(C)}};return j}function nk(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),yt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Vo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Fu,lT=class{constructor(e){if(yY(this,Fu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Kv(this,Fu).has(e))return Kv(this,Fu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Kv(this,Fu).set(e,t)}};Fu=new WeakMap;var wY=new Set(["lazy","caseSensitive","path","id","index","children"]);function jY(e){return wY.has(e)}var CY=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function EY(e){return CY.has(e)}function TY(e){return e.index===!0}function Qh(e,t,n=[],r={}){return e.map((a,o)=>{let c=[...n,String(o)],u=typeof a.id=="string"?a.id:c.join("-");if(yt(a.index!==!0||!a.children,"Cannot specify children on an index route"),yt(!r[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),TY(a)){let f={...a,...t(a),id:u};return r[u]=f,f}else{let f={...a,...t(a),id:u,children:void 0};return r[u]=f,a.children&&(f.children=Qh(a.children,t,c,r)),f}})}function Io(e,t,n="/"){return bh(e,t,n,!1)}function bh(e,t,n,r){let a=typeof t=="string"?to(t):t,o=ma(a.pathname||"/",n);if(o==null)return null;let c=rk(e);DY(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let p=$Y(o);u=LY(c[f],p,r)}return u}function RY(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],handle:n.handle}}function rk(e,t=[],n=[],r=""){let a=(o,c,u)=>{let f={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};f.relativePath.startsWith("/")&&(yt(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length));let p=si([r,f.relativePath]),m=n.concat(f);o.children&&o.children.length>0&&(yt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),rk(o.children,t,m,p)),!(o.path==null&&!o.index)&&t.push({path:p,score:MY(p,o.index),routesMeta:m})};return e.forEach((o,c)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,c);else for(let f of ak(o.path))a(o,c,f)}),t}function ak(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let c=ak(r.join("/")),u=[];return u.push(...c.map(f=>f===""?o:[o,f].join("/"))),a&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function DY(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:IY(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var AY=/^:[\w-]+$/,_Y=3,kY=2,PY=1,NY=10,OY=-2,cT=e=>e==="*";function MY(e,t){let n=e.split("/"),r=n.length;return n.some(cT)&&(r+=OY),t&&(r+=kY),n.filter(a=>!cT(a)).reduce((a,o)=>a+(AY.test(o)?_Y:o===""?PY:NY),r)}function IY(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function LY(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],p=u===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",g=Wh({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),v=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=Wh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(a,g.params),c.push({params:a,pathname:si([o,g.pathname]),pathnameBase:VY(si([o,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(o=si([o,g.pathnameBase]))}return c}function Wh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=zY(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],c=o.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},v)=>{if(m==="*"){let S=u[v]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const b=u[v];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:o,pathnameBase:c,pattern:e}}function zY(e,t=!1,n=!0){In(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function $Y(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return In(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ma(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function UY(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?to(e):e;return{pathname:n?n.startsWith("/")?n:BY(n,t):t,search:FY(r),hash:HY(a)}}function BY(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Xv(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ik(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Mb(e){let t=ik(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Ib(e,t,n,r=!1){let a;typeof e=="string"?a=to(e):(a={...e},yt(!a.pathname||!a.pathname.includes("?"),Xv("?","pathname","search",a)),yt(!a.pathname||!a.pathname.includes("#"),Xv("#","pathname","hash",a)),yt(!a.search||!a.search.includes("#"),Xv("#","search","hash",a)));let o=e===""||a.pathname==="",c=o?"/":a.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),g-=1;a.pathname=v.join("/")}u=g>=0?t[g]:"/"}let f=UY(a,u),p=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var si=e=>e.join("/").replace(/\/\/+/g,"/"),VY=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),FY=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,HY=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Yh=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ld(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var ok=["POST","PUT","PATCH","DELETE"],qY=new Set(ok),GY=["GET",...ok],QY=new Set(GY),WY=new Set([301,302,303,307,308]),YY=new Set([307,308]),Zv={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},KY={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Lb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,XY=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),sk="remix-router-transitions",lk=Symbol("ResetLoaderData");function ZY(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";yt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||XY,o={},c=Qh(e.routes,a,void 0,o),u,f=e.basename||"/",p=e.dataStrategy||rK,m={unstable_middleware:!1,...e.future},g=null,v=new Set,b=null,S=null,j=null,C=e.hydrationData!=null,R=Io(c,e.history.location,f),D=!1,E=null,T;if(R==null&&!e.patchRoutesOnNavigation){let H=la(404,{pathname:e.history.location.pathname}),{matches:Q,route:re}=ST(c);T=!0,R=Q,E={[re.id]:H}}else if(R&&!e.hydrationData&&kn(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(H=>H.route.lazy))T=!1;else if(!R.some(H=>H.route.loader))T=!0;else{let H=e.hydrationData?e.hydrationData.loaderData:null,Q=e.hydrationData?e.hydrationData.errors:null;if(Q){let re=R.findIndex(he=>Q[he.route.id]!==void 0);T=R.slice(0,re+1).every(he=>!Fy(he.route,H,Q))}else T=R.every(re=>!Fy(re.route,H,Q))}else{T=!1,R=[];let H=kn(null,c,e.history.location.pathname);H.active&&H.matches&&(D=!0,R=H.matches)}let A,_={historyAction:e.history.action,location:e.history.location,matches:R,initialized:T,navigation:Zv,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||E,fetchers:new Map,blockers:new Map},M="POP",L=!1,$,V=!1,Y=new Map,W=null,G=!1,X=!1,Z=new Set,P=new Map,I=0,z=-1,F=new Map,O=new Set,U=new Map,J=new Map,te=new Set,ye=new Map,be,ve=null;function Ge(){if(g=e.history.listen(({action:H,location:Q,delta:re})=>{if(be){be(),be=void 0;return}In(ye.size===0||re!=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 he=al({currentLocation:_.location,nextLocation:Q,historyAction:H});if(he&&re!=null){let Ee=new Promise(Be=>{be=Be});e.history.go(re*-1),xr(he,{state:"blocked",location:Q,proceed(){xr(he,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),Ee.then(()=>e.history.go(re))},reset(){let Be=new Map(_.blockers);Be.set(he,zu),Re({blockers:Be})}});return}return xt(H,Q)}),n){pK(t,Y);let H=()=>mK(t,Y);t.addEventListener("pagehide",H),W=()=>t.removeEventListener("pagehide",H)}return _.initialized||xt("POP",_.location,{initialHydration:!0}),A}function ke(){g&&g(),W&&W(),v.clear(),$&&$.abort(),_.fetchers.forEach((H,Q)=>_t(Q)),_.blockers.forEach((H,Q)=>Yn(Q))}function et(H){return v.add(H),()=>v.delete(H)}function Re(H,Q={}){_={..._,...H};let re=[],he=[];_.fetchers.forEach((Ee,Be)=>{Ee.state==="idle"&&(te.has(Be)?re.push(Be):he.push(Be))}),te.forEach(Ee=>{!_.fetchers.has(Ee)&&!P.has(Ee)&&re.push(Ee)}),[...v].forEach(Ee=>Ee(_,{deletedFetchers:re,viewTransitionOpts:Q.viewTransitionOpts,flushSync:Q.flushSync===!0})),re.forEach(Ee=>_t(Ee)),he.forEach(Ee=>_.fetchers.delete(Ee))}function ft(H,Q,{flushSync:re}={}){var Ze,rt;let he=_.actionData!=null&&_.navigation.formMethod!=null&&qr(_.navigation.formMethod)&&_.navigation.state==="loading"&&((Ze=H.state)==null?void 0:Ze._isRedirect)!==!0,Ee;Q.actionData?Object.keys(Q.actionData).length>0?Ee=Q.actionData:Ee=null:he?Ee=_.actionData:Ee=null;let Be=Q.loaderData?xT(_.loaderData,Q.loaderData,Q.matches||[],Q.errors):_.loaderData,tt=_.blockers;tt.size>0&&(tt=new Map(tt),tt.forEach((Ye,lt)=>tt.set(lt,zu)));let Ue=L===!0||_.navigation.formMethod!=null&&qr(_.navigation.formMethod)&&((rt=H.state)==null?void 0:rt._isRedirect)!==!0;u&&(c=u,u=void 0),G||M==="POP"||(M==="PUSH"?e.history.push(H,H.state):M==="REPLACE"&&e.history.replace(H,H.state));let Xe;if(M==="POP"){let Ye=Y.get(_.location.pathname);Ye&&Ye.has(H.pathname)?Xe={currentLocation:_.location,nextLocation:H}:Y.has(H.pathname)&&(Xe={currentLocation:H,nextLocation:_.location})}else if(V){let Ye=Y.get(_.location.pathname);Ye?Ye.add(H.pathname):(Ye=new Set([H.pathname]),Y.set(_.location.pathname,Ye)),Xe={currentLocation:_.location,nextLocation:H}}Re({...Q,actionData:Ee,loaderData:Be,historyAction:M,location:H,initialized:!0,navigation:Zv,revalidation:"idle",restoreScrollPosition:ja(H,Q.matches||_.matches),preventScrollReset:Ue,blockers:tt},{viewTransitionOpts:Xe,flushSync:re===!0}),M="POP",L=!1,V=!1,G=!1,X=!1,ve==null||ve.resolve(),ve=null}async function Ut(H,Q){if(typeof H=="number"){e.history.go(H);return}let re=Vy(_.location,_.matches,f,H,Q==null?void 0:Q.fromRouteId,Q==null?void 0:Q.relative),{path:he,submission:Ee,error:Be}=uT(!1,re,Q),tt=_.location,Ue=sd(_.location,he,Q&&Q.state);Ue={...Ue,...e.history.encodeLocation(Ue)};let Xe=Q&&Q.replace!=null?Q.replace:void 0,Ze="PUSH";Xe===!0?Ze="REPLACE":Xe===!1||Ee!=null&&qr(Ee.formMethod)&&Ee.formAction===_.location.pathname+_.location.search&&(Ze="REPLACE");let rt=Q&&"preventScrollReset"in Q?Q.preventScrollReset===!0:void 0,Ye=(Q&&Q.flushSync)===!0,lt=al({currentLocation:tt,nextLocation:Ue,historyAction:Ze});if(lt){xr(lt,{state:"blocked",location:Ue,proceed(){xr(lt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),Ut(H,Q)},reset(){let At=new Map(_.blockers);At.set(lt,zu),Re({blockers:At})}});return}await xt(Ze,Ue,{submission:Ee,pendingError:Be,preventScrollReset:rt,replace:Q&&Q.replace,enableViewTransition:Q&&Q.viewTransition,flushSync:Ye})}function Ot(){ve||(ve=gK()),$e(),Re({revalidation:"loading"});let H=ve.promise;return _.navigation.state==="submitting"?H:_.navigation.state==="idle"?(xt(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),H):(xt(M||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:V===!0}),H)}async function xt(H,Q,re){$&&$.abort(),$=null,M=H,G=(re&&re.startUninterruptedRevalidation)===!0,wa(_.location,_.matches),L=(re&&re.preventScrollReset)===!0,V=(re&&re.enableViewTransition)===!0;let he=u||c,Ee=re&&re.overrideNavigation,Be=re!=null&&re.initialHydration&&_.matches&&_.matches.length>0&&!D?_.matches:Io(he,Q,f),tt=(re&&re.flushSync)===!0;if(Be&&_.initialized&&!X&&cK(_.location,Q)&&!(re&&re.submission&&qr(re.submission.formMethod))){ft(Q,{matches:Be},{flushSync:tt});return}let Ue=kn(Be,he,Q.pathname);if(Ue.active&&Ue.matches&&(Be=Ue.matches),!Be){let{error:rn,notFoundMatches:kt,route:jt}=no(Q.pathname);ft(Q,{matches:kt,loaderData:{},errors:{[jt.id]:rn}},{flushSync:tt});return}$=new AbortController;let Xe=Zl(e.history,Q,$.signal,re&&re.submission),Ze=new lT(e.unstable_getContext?await e.unstable_getContext():void 0),rt;if(re&&re.pendingError)rt=[js(Be).route.id,{type:"error",error:re.pendingError}];else if(re&&re.submission&&qr(re.submission.formMethod)){let rn=await Ht(Xe,Q,re.submission,Be,Ze,Ue.active,re&&re.initialHydration===!0,{replace:re.replace,flushSync:tt});if(rn.shortCircuited)return;if(rn.pendingActionResult){let[kt,jt]=rn.pendingActionResult;if(Hr(jt)&&ld(jt.error)&&jt.error.status===404){$=null,ft(Q,{matches:rn.matches,loaderData:{},errors:{[kt]:jt.error}});return}}Be=rn.matches||Be,rt=rn.pendingActionResult,Ee=Jv(Q,re.submission),tt=!1,Ue.active=!1,Xe=Zl(e.history,Xe.url,Xe.signal)}let{shortCircuited:Ye,matches:lt,loaderData:At,errors:at}=await Bt(Xe,Q,Be,Ze,Ue.active,Ee,re&&re.submission,re&&re.fetcherSubmission,re&&re.replace,re&&re.initialHydration===!0,tt,rt);Ye||($=null,ft(Q,{matches:lt||Be,...bT(rt),loaderData:At,errors:at}))}async function Ht(H,Q,re,he,Ee,Be,tt,Ue={}){$e();let Xe=fK(Q,re);if(Re({navigation:Xe},{flushSync:Ue.flushSync===!0}),Be){let Ye=await mi(he,Q.pathname,H.signal);if(Ye.type==="aborted")return{shortCircuited:!0};if(Ye.type==="error"){let lt=js(Ye.partialMatches).route.id;return{matches:Ye.partialMatches,pendingActionResult:[lt,{type:"error",error:Ye.error}]}}else if(Ye.matches)he=Ye.matches;else{let{notFoundMatches:lt,error:At,route:at}=no(Q.pathname);return{matches:lt,pendingActionResult:[at.id,{type:"error",error:At}]}}}let Ze,rt=Hu(he,Q);if(!rt.route.action&&!rt.route.lazy)Ze={type:"error",error:la(405,{method:H.method,pathname:Q.pathname,routeId:rt.route.id})};else{let Ye=oc(a,o,H,he,rt,tt?[]:r,Ee),lt=await Le(H,Ye,Ee,null);if(Ze=lt[rt.route.id],!Ze){for(let At of he)if(lt[At.route.id]){Ze=lt[At.route.id];break}}if(H.signal.aborted)return{shortCircuited:!0}}if(_s(Ze)){let Ye;return Ue&&Ue.replace!=null?Ye=Ue.replace:Ye=gT(Ze.response.headers.get("Location"),new URL(H.url),f)===_.location.pathname+_.location.search,await we(H,Ze,!0,{submission:re,replace:Ye}),{shortCircuited:!0}}if(Hr(Ze)){let Ye=js(he,rt.route.id);return(Ue&&Ue.replace)!==!0&&(M="PUSH"),{matches:he,pendingActionResult:[Ye.route.id,Ze,rt.route.id]}}return{matches:he,pendingActionResult:[rt.route.id,Ze]}}async function Bt(H,Q,re,he,Ee,Be,tt,Ue,Xe,Ze,rt,Ye){let lt=Be||Jv(Q,tt),At=tt||Ue||jT(lt),at=!G&&!Ze;if(Ee){if(at){let nr=Se(Ye);Re({navigation:lt,...nr!==void 0?{actionData:nr}:{}},{flushSync:rt})}let Ct=await mi(re,Q.pathname,H.signal);if(Ct.type==="aborted")return{shortCircuited:!0};if(Ct.type==="error"){let nr=js(Ct.partialMatches).route.id;return{matches:Ct.partialMatches,loaderData:{},errors:{[nr]:Ct.error}}}else if(Ct.matches)re=Ct.matches;else{let{error:nr,notFoundMatches:Ca,route:Ea}=no(Q.pathname);return{matches:Ca,loaderData:{},errors:{[Ea.id]:nr}}}}let rn=u||c,{dsMatches:kt,revalidatingFetchers:jt}=dT(H,he,a,o,e.history,_,re,At,Q,Ze?[]:r,Ze===!0,X,Z,te,U,O,rn,f,Ye);if(z=++I,!e.dataStrategy&&!kt.some(Ct=>Ct.shouldLoad)&&jt.length===0){let Ct=ba();return ft(Q,{matches:re,loaderData:{},errors:Ye&&Hr(Ye[1])?{[Ye[0]]:Ye[1].error}:null,...bT(Ye),...Ct?{fetchers:new Map(_.fetchers)}:{}},{flushSync:rt}),{shortCircuited:!0}}if(at){let Ct={};if(!Ee){Ct.navigation=lt;let nr=Se(Ye);nr!==void 0&&(Ct.actionData=nr)}jt.length>0&&(Ct.fetchers=Ne(jt)),Re(Ct,{flushSync:rt})}jt.forEach(Ct=>{St(Ct.key),Ct.controller&&P.set(Ct.key,Ct.controller)});let Fa=()=>jt.forEach(Ct=>St(Ct.key));$&&$.signal.addEventListener("abort",Fa);let{loaderResults:cr,fetcherResults:Kr}=await xe(kt,jt,H,he);if(H.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",Fa),jt.forEach(Ct=>P.delete(Ct.key));let br=lh(cr);if(br)return await we(H,br.result,!0,{replace:Xe}),{shortCircuited:!0};if(br=lh(Kr),br)return O.add(br.key),await we(H,br.result,!0,{replace:Xe}),{shortCircuited:!0};let{loaderData:ro,errors:ao}=yT(_,re,cr,Ye,jt,Kr);Ze&&_.errors&&(ao={..._.errors,...ao});let Ic=ba(),Xr=pi(z),gi=Ic||Xr||jt.length>0;return{matches:re,loaderData:ro,errors:ao,...gi?{fetchers:new Map(_.fetchers)}:{}}}function Se(H){if(H&&!Hr(H[1]))return{[H[0]]:H[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function Ne(H){return H.forEach(Q=>{let re=_.fetchers.get(Q.key),he=$u(void 0,re?re.data:void 0);_.fetchers.set(Q.key,he)}),new Map(_.fetchers)}async function Ve(H,Q,re,he){St(H);let Ee=(he&&he.flushSync)===!0,Be=u||c,tt=Vy(_.location,_.matches,f,re,Q,he==null?void 0:he.relative),Ue=Io(Be,tt,f),Xe=kn(Ue,Be,tt);if(Xe.active&&Xe.matches&&(Ue=Xe.matches),!Ue){ht(H,Q,la(404,{pathname:tt}),{flushSync:Ee});return}let{path:Ze,submission:rt,error:Ye}=uT(!0,tt,he);if(Ye){ht(H,Q,Ye,{flushSync:Ee});return}let lt=Hu(Ue,Ze),At=new lT(e.unstable_getContext?await e.unstable_getContext():void 0),at=(he&&he.preventScrollReset)===!0;if(rt&&qr(rt.formMethod)){await Te(H,Q,Ze,lt,Ue,At,Xe.active,Ee,at,rt);return}U.set(H,{routeId:Q,path:Ze}),await ge(H,Q,Ze,lt,Ue,At,Xe.active,Ee,at,rt)}async function Te(H,Q,re,he,Ee,Be,tt,Ue,Xe,Ze){$e(),U.delete(H);function rt(xn){if(!xn.route.action&&!xn.route.lazy){let io=la(405,{method:Ze.formMethod,pathname:re,routeId:Q});return ht(H,Q,io,{flushSync:Ue}),!0}return!1}if(!tt&&rt(he))return;let Ye=_.fetchers.get(H);gt(H,hK(Ze,Ye),{flushSync:Ue});let lt=new AbortController,At=Zl(e.history,re,lt.signal,Ze);if(tt){let xn=await mi(Ee,re,At.signal,H);if(xn.type==="aborted")return;if(xn.type==="error"){ht(H,Q,xn.error,{flushSync:Ue});return}else if(xn.matches){if(Ee=xn.matches,he=Hu(Ee,re),rt(he))return}else{ht(H,Q,la(404,{pathname:re}),{flushSync:Ue});return}}P.set(H,lt);let at=I,rn=oc(a,o,At,Ee,he,r,Be),jt=(await Le(At,rn,Be,H))[he.route.id];if(At.signal.aborted){P.get(H)===lt&&P.delete(H);return}if(te.has(H)){if(_s(jt)||Hr(jt)){gt(H,ko(void 0));return}}else{if(_s(jt))if(P.delete(H),z>at){gt(H,ko(void 0));return}else return O.add(H),gt(H,$u(Ze)),we(At,jt,!1,{fetcherSubmission:Ze,preventScrollReset:Xe});if(Hr(jt)){ht(H,Q,jt.error);return}}let Fa=_.navigation.location||_.location,cr=Zl(e.history,Fa,lt.signal),Kr=u||c,br=_.navigation.state!=="idle"?Io(Kr,_.navigation.location,f):_.matches;yt(br,"Didn't find any matches after fetcher action");let ro=++I;F.set(H,ro);let ao=$u(Ze,jt.data);_.fetchers.set(H,ao);let{dsMatches:Ic,revalidatingFetchers:Xr}=dT(cr,Be,a,o,e.history,_,br,Ze,Fa,r,!1,X,Z,te,U,O,Kr,f,[he.route.id,jt]);Xr.filter(xn=>xn.key!==H).forEach(xn=>{let io=xn.key,Lc=_.fetchers.get(io),Sr=$u(void 0,Lc?Lc.data:void 0);_.fetchers.set(io,Sr),St(io),xn.controller&&P.set(io,xn.controller)}),Re({fetchers:new Map(_.fetchers)});let gi=()=>Xr.forEach(xn=>St(xn.key));lt.signal.addEventListener("abort",gi);let{loaderResults:Ct,fetcherResults:nr}=await xe(Ic,Xr,cr,Be);if(lt.signal.aborted)return;if(lt.signal.removeEventListener("abort",gi),F.delete(H),P.delete(H),Xr.forEach(xn=>P.delete(xn.key)),_.fetchers.has(H)){let xn=ko(jt.data);_.fetchers.set(H,xn)}let Ca=lh(Ct);if(Ca)return we(cr,Ca.result,!1,{preventScrollReset:Xe});if(Ca=lh(nr),Ca)return O.add(Ca.key),we(cr,Ca.result,!1,{preventScrollReset:Xe});let{loaderData:Ea,errors:Jo}=yT(_,br,Ct,void 0,Xr,nr);pi(ro),_.navigation.state==="loading"&&ro>z?(yt(M,"Expected pending action"),$&&$.abort(),ft(_.navigation.location,{matches:br,loaderData:Ea,errors:Jo,fetchers:new Map(_.fetchers)})):(Re({errors:Jo,loaderData:xT(_.loaderData,Ea,br,Jo),fetchers:new Map(_.fetchers)}),X=!1)}async function ge(H,Q,re,he,Ee,Be,tt,Ue,Xe,Ze){let rt=_.fetchers.get(H);gt(H,$u(Ze,rt?rt.data:void 0),{flushSync:Ue});let Ye=new AbortController,lt=Zl(e.history,re,Ye.signal);if(tt){let jt=await mi(Ee,re,lt.signal,H);if(jt.type==="aborted")return;if(jt.type==="error"){ht(H,Q,jt.error,{flushSync:Ue});return}else if(jt.matches)Ee=jt.matches,he=Hu(Ee,re);else{ht(H,Q,la(404,{pathname:re}),{flushSync:Ue});return}}P.set(H,Ye);let At=I,at=oc(a,o,lt,Ee,he,r,Be),kt=(await Le(lt,at,Be,H))[he.route.id];if(P.get(H)===Ye&&P.delete(H),!lt.signal.aborted){if(te.has(H)){gt(H,ko(void 0));return}if(_s(kt))if(z>At){gt(H,ko(void 0));return}else{O.add(H),await we(lt,kt,!1,{preventScrollReset:Xe});return}if(Hr(kt)){ht(H,Q,kt.error);return}gt(H,ko(kt.data))}}async function we(H,Q,re,{submission:he,fetcherSubmission:Ee,preventScrollReset:Be,replace:tt}={}){Q.response.headers.has("X-Remix-Revalidate")&&(X=!0);let Ue=Q.response.headers.get("Location");yt(Ue,"Expected a Location header on the redirect Response"),Ue=gT(Ue,new URL(H.url),f);let Xe=sd(_.location,Ue,{_isRedirect:!0});if(n){let at=!1;if(Q.response.headers.has("X-Remix-Reload-Document"))at=!0;else if(Lb.test(Ue)){const rn=nk(Ue,!0);at=rn.origin!==t.location.origin||ma(rn.pathname,f)==null}if(at){tt?t.location.replace(Ue):t.location.assign(Ue);return}}$=null;let Ze=tt===!0||Q.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:rt,formAction:Ye,formEncType:lt}=_.navigation;!he&&!Ee&&rt&&Ye&&lt&&(he=jT(_.navigation));let At=he||Ee;if(YY.has(Q.response.status)&&At&&qr(At.formMethod))await xt(Ze,Xe,{submission:{...At,formAction:Ue},preventScrollReset:Be||L,enableViewTransition:re?V:void 0});else{let at=Jv(Xe,he);await xt(Ze,Xe,{overrideNavigation:at,fetcherSubmission:Ee,preventScrollReset:Be||L,enableViewTransition:re?V:void 0})}}async function Le(H,Q,re,he){let Ee,Be={};try{Ee=await aK(p,H,Q,he,re,!1)}catch(tt){return Q.filter(Ue=>Ue.shouldLoad).forEach(Ue=>{Be[Ue.route.id]={type:"error",error:tt}}),Be}if(H.signal.aborted)return Be;for(let[tt,Ue]of Object.entries(Ee))if(uK(Ue)){let Xe=Ue.result;Be[tt]={type:"redirect",response:sK(Xe,H,tt,Q,f)}}else Be[tt]=await oK(Ue);return Be}async function xe(H,Q,re,he){let Ee=Le(re,H,he,null),Be=Promise.all(Q.map(async Xe=>{if(Xe.matches&&Xe.match&&Xe.request&&Xe.controller){let rt=(await Le(Xe.request,Xe.matches,he,Xe.key))[Xe.match.route.id];return{[Xe.key]:rt}}else return Promise.resolve({[Xe.key]:{type:"error",error:la(404,{pathname:Xe.path})}})})),tt=await Ee,Ue=(await Be).reduce((Xe,Ze)=>Object.assign(Xe,Ze),{});return{loaderResults:tt,fetcherResults:Ue}}function $e(){X=!0,U.forEach((H,Q)=>{P.has(Q)&&Z.add(Q),St(Q)})}function gt(H,Q,re={}){_.fetchers.set(H,Q),Re({fetchers:new Map(_.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function ht(H,Q,re,he={}){let Ee=js(_.matches,Q);_t(H),Re({errors:{[Ee.route.id]:re},fetchers:new Map(_.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function Wt(H){return J.set(H,(J.get(H)||0)+1),te.has(H)&&te.delete(H),_.fetchers.get(H)||KY}function _t(H){let Q=_.fetchers.get(H);P.has(H)&&!(Q&&Q.state==="loading"&&F.has(H))&&St(H),U.delete(H),F.delete(H),O.delete(H),te.delete(H),Z.delete(H),_.fetchers.delete(H)}function mn(H){let Q=(J.get(H)||0)-1;Q<=0?(J.delete(H),te.add(H)):J.set(H,Q),Re({fetchers:new Map(_.fetchers)})}function St(H){let Q=P.get(H);Q&&(Q.abort(),P.delete(H))}function Ba(H){for(let Q of H){let re=Wt(Q),he=ko(re.data);_.fetchers.set(Q,he)}}function ba(){let H=[],Q=!1;for(let re of O){let he=_.fetchers.get(re);yt(he,`Expected fetcher: ${re}`),he.state==="loading"&&(O.delete(re),H.push(re),Q=!0)}return Ba(H),Q}function pi(H){let Q=[];for(let[re,he]of F)if(he<H){let Ee=_.fetchers.get(re);yt(Ee,`Expected fetcher: ${re}`),Ee.state==="loading"&&(St(re),F.delete(re),Q.push(re))}return Ba(Q),Q.length>0}function Sa(H,Q){let re=_.blockers.get(H)||zu;return ye.get(H)!==Q&&ye.set(H,Q),re}function Yn(H){_.blockers.delete(H),ye.delete(H)}function xr(H,Q){let re=_.blockers.get(H)||zu;yt(re.state==="unblocked"&&Q.state==="blocked"||re.state==="blocked"&&Q.state==="blocked"||re.state==="blocked"&&Q.state==="proceeding"||re.state==="blocked"&&Q.state==="unblocked"||re.state==="proceeding"&&Q.state==="unblocked",`Invalid blocker state transition: ${re.state} -> ${Q.state}`);let he=new Map(_.blockers);he.set(H,Q),Re({blockers:he})}function al({currentLocation:H,nextLocation:Q,historyAction:re}){if(ye.size===0)return;ye.size>1&&In(!1,"A router only supports one blocker at a time");let he=Array.from(ye.entries()),[Ee,Be]=he[he.length-1],tt=_.blockers.get(Ee);if(!(tt&&tt.state==="proceeding")&&Be({currentLocation:H,nextLocation:Q,historyAction:re}))return Ee}function no(H){let Q=la(404,{pathname:H}),re=u||c,{matches:he,route:Ee}=ST(re);return{notFoundMatches:he,route:Ee,error:Q}}function Xo(H,Q,re){if(b=H,j=Q,S=re||null,!C&&_.navigation===Zv){C=!0;let he=ja(_.location,_.matches);he!=null&&Re({restoreScrollPosition:he})}return()=>{b=null,j=null,S=null}}function Va(H,Q){return S&&S(H,Q.map(he=>RY(he,_.loaderData)))||H.key}function wa(H,Q){if(b&&j){let re=Va(H,Q);b[re]=j()}}function ja(H,Q){if(b){let re=Va(H,Q),he=b[re];if(typeof he=="number")return he}return null}function kn(H,Q,re){if(e.patchRoutesOnNavigation)if(H){if(Object.keys(H[0].params).length>0)return{active:!0,matches:bh(Q,re,f,!0)}}else return{active:!0,matches:bh(Q,re,f,!0)||[]};return{active:!1,matches:null}}async function mi(H,Q,re,he){if(!e.patchRoutesOnNavigation)return{type:"success",matches:H};let Ee=H;for(;;){let Be=u==null,tt=u||c,Ue=o;try{await e.patchRoutesOnNavigation({signal:re,path:Q,matches:Ee,fetcherKey:he,patch:(rt,Ye)=>{re.aborted||fT(rt,Ye,tt,Ue,a)}})}catch(rt){return{type:"error",error:rt,partialMatches:Ee}}finally{Be&&!re.aborted&&(c=[...c])}if(re.aborted)return{type:"aborted"};let Xe=Io(tt,Q,f);if(Xe)return{type:"success",matches:Xe};let Ze=bh(tt,Q,f,!0);if(!Ze||Ee.length===Ze.length&&Ee.every((rt,Ye)=>rt.route.id===Ze[Ye].route.id))return{type:"success",matches:null};Ee=Ze}}function il(H){o={},u=Qh(H,a,void 0,o)}function Zo(H,Q){let re=u==null;fT(H,Q,u||c,o,a),re&&(c=[...c],Re({}))}return A={get basename(){return f},get future(){return m},get state(){return _},get routes(){return c},get window(){return t},initialize:Ge,subscribe:et,enableScrollRestoration:Xo,navigate:Ut,fetch:Ve,revalidate:Ot,createHref:H=>e.history.createHref(H),encodeLocation:H=>e.history.encodeLocation(H),getFetcher:Wt,deleteFetcher:mn,dispose:ke,getBlocker:Sa,deleteBlocker:Yn,patchRoutes:Zo,_internalFetchControllers:P,_internalSetRoutes:il},A}function JY(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Vy(e,t,n,r,a,o){let c,u;if(a){c=[];for(let p of t)if(c.push(p),p.route.id===a){u=p;break}}else c=t,u=t[t.length-1];let f=Ib(r||".",Mb(c),ma(e.pathname,n)||e.pathname,o==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let p=zb(f.search);if(u.route.index&&!p)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&p){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let v=m.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=f.pathname==="/"?n:si([n,f.pathname])),Vo(f)}function uT(e,t,n){if(!n||!JY(n))return{path:t};if(n.formMethod&&!dK(n.formMethod))return{path:t,error:la(405,{method:n.formMethod})};let r=()=>({path:t,error:la(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),c=pk(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!qr(o))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[b,S])=>`${v}${b}=${S}
567
- `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!qr(o))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}yt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=qy(n.formData),f=n.formData;else if(n.body instanceof FormData)u=qy(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=vT(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=vT(u)}catch{return r()}let p={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(qr(p.formMethod))return{path:t,submission:p};let m=to(t);return e&&m.search&&zb(m.search)&&u.append("index",""),m.search=`?${u}`,{path:Vo(m),submission:p}}function dT(e,t,n,r,a,o,c,u,f,p,m,g,v,b,S,j,C,R,D){var W;let E=D?Hr(D[1])?D[1].error:D[1].data:void 0,T=a.createURL(o.location),A=a.createURL(f),_;if(m&&o.errors){let G=Object.keys(o.errors)[0];_=c.findIndex(X=>X.route.id===G)}else if(D&&Hr(D[1])){let G=D[0];_=c.findIndex(X=>X.route.id===G)-1}let M=D?D[1].statusCode:void 0,L=M&&M>=400,$={currentUrl:T,currentParams:((W=o.matches[0])==null?void 0:W.params)||{},nextUrl:A,nextParams:c[0].params,...u,actionResult:E,actionStatus:M},V=c.map((G,X)=>{let{route:Z}=G,P=null;if(_!=null&&X>_?P=!1:Z.lazy?P=!0:Z.loader==null?P=!1:m?P=Fy(Z,o.loaderData,o.errors):eK(o.loaderData,o.matches[X],G)&&(P=!0),P!==null)return Hy(n,r,e,G,p,t,P);let I=L?!1:g||T.pathname+T.search===A.pathname+A.search||T.search!==A.search||tK(o.matches[X],G),z={...$,defaultShouldRevalidate:I},F=Kh(G,z);return Hy(n,r,e,G,p,t,F,z)}),Y=[];return S.forEach((G,X)=>{if(m||!c.some(U=>U.route.id===G.routeId)||b.has(X))return;let Z=Io(C,G.path,R);if(!Z){Y.push({key:X,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(j.has(X))return;let P=o.fetchers.get(X),I=Hu(Z,G.path),z=new AbortController,F=Zl(a,G.path,z.signal),O=null;if(v.has(X))v.delete(X),O=oc(n,r,F,Z,I,p,t);else if(P&&P.state!=="idle"&&P.data===void 0)g&&(O=oc(n,r,F,Z,I,p,t));else{let U={...$,defaultShouldRevalidate:L?!1:g};Kh(I,U)&&(O=oc(n,r,F,Z,I,p,t,U))}O&&Y.push({key:X,routeId:G.routeId,path:G.path,matches:O,match:I,request:F,controller:z})}),{dsMatches:V,revalidatingFetchers:Y}}function Fy(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;return!r&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!a}function eK(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function tK(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Kh(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function fT(e,t,n,r,a){let o;if(e){let f=r[e];yt(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),o=f.children}else o=n;let c=t.filter(f=>!o.some(p=>ck(f,p))),u=Qh(c,a,[e||"_","patch",String((o==null?void 0:o.length)||"0")],r);o.push(...u)}function ck(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var a;return(a=t.children)==null?void 0:a.some(o=>ck(n,o))}):!1}var hT=new WeakMap,uk=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(yt(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let c=hT.get(a);c||(c={},hT.set(a,c));let u=c[e];if(u)return u;let f=(async()=>{let p=jY(e),g=a[e]!==void 0&&e!=="hasErrorBoundary";if(p)In(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)In(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await o();v!=null&&(Object.assign(a,{[e]:v}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(v=>v===void 0)&&(a.lazy=void 0))})();return c[e]=f,f},pT=new WeakMap;function nK(e,t,n,r,a){let o=n[e.id];if(yt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=pT.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{yt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let S in v){let j=v[S];if(j===void 0)continue;let C=EY(S),D=o[S]!==void 0&&S!=="hasErrorBoundary";C?In(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):D?In(!D,`Route "${o.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):b[S]=j}Object.assign(o,b),Object.assign(o,{...r(o),lazy:void 0})})();return pT.set(o,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let m of c){if(a&&a.includes(m))continue;let g=uk({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),m===t&&(f=g))}let p=u.length>0?Promise.all(u).then(()=>{}):void 0;return p==null||p.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:f}}async function mT(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{n[t[o].route.id]=a}),n}async function rK(e){return e.matches.some(t=>t.route.unstable_middleware)?dk(e,!1,()=>mT(e),(t,n)=>({[n]:{type:"error",result:t}})):mT(e)}async function dk(e,t,n,r){let{matches:a,request:o,params:c,context:u}=e,f={handlerResult:void 0};try{let p=a.flatMap(g=>g.route.unstable_middleware?g.route.unstable_middleware.map(v=>[g.route.id,v]):[]),m=await fk({request:o,params:c,context:u},p,t,f,n);return t?m:f.handlerResult}catch(p){if(!f.middlewareError)throw p;let m=await r(f.middlewareError.error,f.middlewareError.routeId);return f.handlerResult?Object.assign(f.handlerResult,m):m}}async function fk(e,t,n,r,a,o=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason?c.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${c.method} ${c.url}`);let u=t[o];if(!u)return r.handlerResult=await a(),r.handlerResult;let[f,p]=u,m=!1,g,v=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");m=!0,await fk(e,t,n,r,a,o+1)};try{let b=await p({request:e.request,params:e.params,context:e.context},v);return m?b===void 0?g:b:v()}catch(b){throw r.middlewareError?r.middlewareError.error!==b&&(r.middlewareError={routeId:f,error:b}):r.middlewareError={routeId:f,error:b},b}}function hk(e,t,n,r,a){let o=uk({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=nK(r.route,qr(n.method)?"action":"loader",t,e,a);return{middleware:o,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Hy(e,t,n,r,a,o,c,u=null){let f=!1,p=hk(e,t,n,r,a);return{...r,_lazyPromises:p,shouldLoad:c,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler(m){return f=!0,u?typeof m=="boolean"?Kh(r,{...u,defaultShouldRevalidate:m}):Kh(r,u):c},resolve(m){return f||c||m&&n.method==="GET"&&(r.route.lazy||r.route.loader)?iK({request:n,match:r,lazyHandlerPromise:p==null?void 0:p.handler,lazyRoutePromise:p==null?void 0:p.route,handlerOverride:m,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function oc(e,t,n,r,a,o,c,u=null){return r.map(f=>f.route.id!==a.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:hk(e,t,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Hy(e,t,n,f,o,c,!0,u))}async function aK(e,t,n,r,a,o){n.some(p=>{var m;return(m=p._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(p=>{var m;return(m=p._lazyPromises)==null?void 0:m.middleware}));let c={request:t,params:n[0].params,context:a,matches:n},f=await e({...c,fetcherKey:r,unstable_runClientMiddleware:p=>{let m=c;return dk(m,!1,()=>p({...m,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(g,v)=>({[v]:{type:"error",result:g}}))}});try{await Promise.all(n.flatMap(p=>{var m,g;return[(m=p._lazyPromises)==null?void 0:m.handler,(g=p._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function iK({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:a,scopedContext:o}){let c,u,f=qr(e.method),p=f?"action":"loader",m=g=>{let v,b=new Promise((C,R)=>v=R);u=()=>v(),e.signal.addEventListener("abort",u);let S=C=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${p}" [routeId: ${t.route.id}]`)):g({request:e,params:t.params,context:o},...C!==void 0?[C]:[]),j=(async()=>{try{return{type:"data",result:await(a?a(R=>S(R)):S())}}catch(C){return{type:"error",result:C}}})();return Promise.race([j,b])};try{let g=f?t.route.action:t.route.loader;if(n||r)if(g){let v,[b]=await Promise.all([m(g).catch(S=>{v=S}),n,r]);if(v!==void 0)throw v;c=b}else{await n;let v=f?t.route.action:t.route.loader;if(v)[c]=await Promise.all([m(v),r]);else if(p==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw la(405,{method:e.method,pathname:S,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(g)c=await m(g);else{let v=new URL(e.url),b=v.pathname+v.search;throw la(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{u&&e.signal.removeEventListener("abort",u)}return c}async function oK(e){var r,a,o,c,u,f;let{result:t,type:n}=e;if(mk(t)){let p;try{let m=t.headers.get("Content-Type");m&&/\bapplication\/json\b/.test(m)?t.body==null?p=null:p=await t.json():p=await t.text()}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new Yh(t.status,t.statusText,p),statusCode:t.status,headers:t.headers}:{type:"data",data:p,statusCode:t.status,headers:t.headers}}return n==="error"?wT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Yh(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:ld(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ld(t)?t.status:void 0}:wT(t)?{type:"data",data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function sK(e,t,n,r,a){let o=e.headers.get("Location");if(yt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Lb.test(o)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);o=Vy(new URL(t.url),c,a,o),e.headers.set("Location",o)}return e}function gT(e,t,n){if(Lb.test(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=ma(a.pathname,n)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Zl(e,t,n,r){let a=e.createURL(pk(t)).toString(),o={signal:n};if(r&&qr(r.formMethod)){let{formMethod:c,formEncType:u}=r;o.method=c.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(r.json)):u==="text/plain"?o.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?o.body=qy(r.formData):o.body=r.formData}return new Request(a,o)}function qy(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function vT(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function lK(e,t,n,r=!1,a=!1){let o={},c=null,u,f=!1,p={},m=n&&Hr(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let v=g.route.id,b=t[v];if(yt(!_s(b),"Cannot handle redirect results in processLoaderData"),Hr(b)){let S=b.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},a)c[v]=S;else{let j=js(e,v);c[j.route.id]==null&&(c[j.route.id]=S)}r||(o[v]=lk),f||(f=!0,u=ld(b.error)?b.error.status:500),b.headers&&(p[v]=b.headers)}else o[v]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(u=b.statusCode),b.headers&&(p[v]=b.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:c,statusCode:u||200,loaderHeaders:p}}function yT(e,t,n,r,a,o){let{loaderData:c,errors:u}=lK(t,n,r);return a.filter(f=>!f.matches||f.matches.some(p=>p.shouldLoad)).forEach(f=>{let{key:p,match:m,controller:g}=f,v=o[p];if(yt(v,"Did not find corresponding fetcher result"),!(g&&g.signal.aborted))if(Hr(v)){let b=js(e.matches,m==null?void 0:m.route.id);u&&u[b.route.id]||(u={...u,[b.route.id]:v.error}),e.fetchers.delete(p)}else if(_s(v))yt(!1,"Unhandled fetcher revalidation redirect");else{let b=ko(v.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:u}}function xT(e,t,n,r){let a=Object.entries(t).filter(([,o])=>o!==lk).reduce((o,[c,u])=>(o[c]=u,o),{});for(let o of n){let c=o.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&o.route.loader&&(a[c]=e[c]),r&&r.hasOwnProperty(c))break}return a}function bT(e){return e?Hr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function js(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function ST(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function la(e,{pathname:t,routeId:n,method:r,type:a,message:o}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new Yh(e||500,c,new Error(u),!0)}function lh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(_s(a))return{key:r,result:a}}}function pk(e){let t=typeof e=="string"?to(e):e;return Vo({...t,hash:""})}function cK(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function uK(e){return mk(e.result)&&WY.has(e.result.status)}function Hr(e){return e.type==="error"}function _s(e){return(e&&e.type)==="redirect"}function wT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function mk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function dK(e){return QY.has(e.toUpperCase())}function qr(e){return qY.has(e.toUpperCase())}function zb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Hu(e,t){let n=typeof t=="string"?to(t).search:t.search;if(e[e.length-1].route.index&&zb(n||""))return e[e.length-1];let r=ik(e);return r[r.length-1]}function jT(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:c}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function Jv(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 fK(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 $u(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 hK(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 ko(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 pK(e,t){try{let n=e.sessionStorage.getItem(sk);if(n){let r=JSON.parse(n);for(let[a,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function mK(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(sk,JSON.stringify(n))}catch(r){In(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function gK(){let e,t,n=new Promise((r,a)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{a(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var tl=y.createContext(null);tl.displayName="DataRouter";var Ld=y.createContext(null);Ld.displayName="DataRouterState";var $b=y.createContext({isTransitioning:!1});$b.displayName="ViewTransition";var gk=y.createContext(new Map);gk.displayName="Fetchers";var vK=y.createContext(null);vK.displayName="Await";var hi=y.createContext(null);hi.displayName="Navigation";var zd=y.createContext(null);zd.displayName="Location";var Ua=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ua.displayName="Route";var Ub=y.createContext(null);Ub.displayName="RouteError";function yK(e,{relative:t}={}){yt($d(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(hi),{hash:a,pathname:o,search:c}=Ud(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:si([n,o])),r.createHref({pathname:u,search:c,hash:a})}function $d(){return y.useContext(zd)!=null}function Mr(){return yt($d(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(zd).location}var vk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function yk(e){y.useContext(hi).static||y.useLayoutEffect(e)}function Rn(){let{isDataRoute:e}=y.useContext(Ua);return e?NK():xK()}function xK(){yt($d(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(tl),{basename:t,navigator:n}=y.useContext(hi),{matches:r}=y.useContext(Ua),{pathname:a}=Mr(),o=JSON.stringify(Mb(r)),c=y.useRef(!1);return yk(()=>{c.current=!0}),y.useCallback((f,p={})=>{if(In(c.current,vk),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Ib(f,JSON.parse(o),a,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:si([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,o,a,e])}var bK=y.createContext(null);function SK(e){let t=y.useContext(Ua).outlet;return t&&y.createElement(bK.Provider,{value:e},t)}function Qt(){let{matches:e}=y.useContext(Ua),t=e[e.length-1];return t?t.params:{}}function Ud(e,{relative:t}={}){let{matches:n}=y.useContext(Ua),{pathname:r}=Mr(),a=JSON.stringify(Mb(n));return y.useMemo(()=>Ib(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function wK(e,t){return xk(e,t)}function xk(e,t,n,r){var D;yt($d(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a,static:o}=y.useContext(hi),{matches:c}=y.useContext(Ua),u=c[c.length-1],f=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",g=u&&u.route;{let E=g&&g.path||"";bk(p,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
568
-
569
- Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let v=Mr(),b;if(t){let E=typeof t=="string"?to(t):t;yt(m==="/"||((D=E.pathname)==null?void 0:D.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${E.pathname}" was given in the \`location\` prop.`),b=E}else b=v;let S=b.pathname||"/",j=S;if(m!=="/"){let E=m.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(E.length).join("/")}let C=!o&&n&&n.matches&&n.matches.length>0?n.matches:Io(e,{pathname:j});In(g||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),In(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let R=RK(C&&C.map(E=>Object.assign({},E,{params:Object.assign({},f,E.params),pathname:si([m,a.encodeLocation?a.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:si([m,a.encodeLocation?a.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),c,n,r);return t&&R?y.createElement(zd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},R):R}function jK(){let e=PK(),t=ld(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:o},"ErrorBoundary")," or"," ",y.createElement("code",{style:o},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:a},n):null,c)}var CK=y.createElement(jK,null),EK=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?y.createElement(Ua.Provider,{value:this.props.routeContext},y.createElement(Ub.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function TK({routeContext:e,match:t,children:n}){let r=y.useContext(tl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Ua.Provider,{value:e},n)}function RK(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let f=a.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);yt(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,u=-1;if(n)for(let f=0;f<a.length;f++){let p=a[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=f),p.route.id){let{loaderData:m,errors:g}=n,v=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!g||g[p.route.id]===void 0);if(p.route.lazy||v){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((f,p,m)=>{let g,v=!1,b=null,S=null;n&&(g=o&&p.route.id?o[p.route.id]:void 0,b=p.route.errorElement||CK,c&&(u<0&&m===0?(bk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,S=null):u===m&&(v=!0,S=p.route.hydrateFallbackElement||null)));let j=t.concat(a.slice(0,m+1)),C=()=>{let R;return g?R=b:v?R=S:p.route.Component?R=y.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=f,y.createElement(TK,{match:p,routeContext:{outlet:f,matches:j,isDataRoute:n!=null},children:R})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?y.createElement(EK,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):C()},null)}function Bb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function DK(e){let t=y.useContext(tl);return yt(t,Bb(e)),t}function AK(e){let t=y.useContext(Ld);return yt(t,Bb(e)),t}function _K(e){let t=y.useContext(Ua);return yt(t,Bb(e)),t}function Vb(e){let t=_K(e),n=t.matches[t.matches.length-1];return yt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kK(){return Vb("useRouteId")}function PK(){var r;let e=y.useContext(Ub),t=AK("useRouteError"),n=Vb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function NK(){let{router:e}=DK("useNavigate"),t=Vb("useNavigate"),n=y.useRef(!1);return yk(()=>{n.current=!0}),y.useCallback(async(a,o={})=>{In(n.current,vk),n.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var CT={};function bk(e,t,n){!t&&!CT[e]&&(CT[e]=!0,In(!1,n))}var ET={};function TT(e,t){!e&&!ET[t]&&(ET[t]=!0,console.warn(t))}function OK(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&In(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&In(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&In(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var MK=["HydrateFallback","hydrateFallbackElement"],IK=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function LK({router:e,flushSync:t}){let[n,r]=y.useState(e.state),[a,o]=y.useState(),[c,u]=y.useState({isTransitioning:!1}),[f,p]=y.useState(),[m,g]=y.useState(),[v,b]=y.useState(),S=y.useRef(new Map),j=y.useCallback((E,{deletedFetchers:T,flushSync:A,viewTransitionOpts:_})=>{E.fetchers.forEach((L,$)=>{L.data!==void 0&&S.current.set($,L.data)}),T.forEach(L=>S.current.delete(L)),TT(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let M=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(TT(_==null||M,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!M){t&&A?t(()=>r(E)):y.startTransition(()=>r(E));return}if(t&&A){t(()=>{m&&(f&&f.resolve(),m.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let L=e.window.document.startViewTransition(()=>{t(()=>r(E))});L.finished.finally(()=>{t(()=>{p(void 0),g(void 0),o(void 0),u({isTransitioning:!1})})}),t(()=>g(L));return}m?(f&&f.resolve(),m.skipTransition(),b({state:E,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(o(E),u({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,m,f]);y.useLayoutEffect(()=>e.subscribe(j),[e,j]),y.useEffect(()=>{c.isTransitioning&&!c.flushSync&&p(new IK)},[c]),y.useEffect(()=>{if(f&&a&&e.window){let E=a,T=f.promise,A=e.window.document.startViewTransition(async()=>{y.startTransition(()=>r(E)),await T});A.finished.finally(()=>{p(void 0),g(void 0),o(void 0),u({isTransitioning:!1})}),g(A)}},[a,f,e.window]),y.useEffect(()=>{f&&a&&n.location.key===a.location.key&&f.resolve()},[f,m,n.location,a]),y.useEffect(()=>{!c.isTransitioning&&v&&(o(v.state),u({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[c.isTransitioning,v]);let C=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:E=>e.navigate(E),push:(E,T,A)=>e.navigate(E,{state:T,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(E,T,A)=>e.navigate(E,{replace:!0,state:T,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[e]),R=e.basename||"/",D=y.useMemo(()=>({router:e,navigator:C,static:!1,basename:R}),[e,C,R]);return y.createElement(y.Fragment,null,y.createElement(tl.Provider,{value:D},y.createElement(Ld.Provider,{value:n},y.createElement(gk.Provider,{value:S.current},y.createElement($b.Provider,{value:c},y.createElement(UK,{basename:R,location:n.location,navigationType:n.historyAction,navigator:C},y.createElement(zK,{routes:e.routes,future:e.future,state:n})))))),null)}var zK=y.memo($K);function $K({routes:e,future:t,state:n}){return xk(e,void 0,n,t)}function Fb(e){return SK(e.context)}function qe(e){yt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function UK({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1}){yt(!$d(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:c,navigator:a,static:o,future:{}}),[c,a,o]);typeof n=="string"&&(n=to(n));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:v="default"}=n,b=y.useMemo(()=>{let S=ma(f,c);return S==null?null:{location:{pathname:S,search:p,hash:m,state:g,key:v},navigationType:r}},[c,f,p,m,g,v,r]);return In(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:y.createElement(hi.Provider,{value:u},y.createElement(zd.Provider,{children:t,value:b}))}function BK({children:e,location:t}){return wK(Gy(e),t)}function Gy(e,t=[]){let n=[];return y.Children.forEach(e,(r,a)=>{if(!y.isValidElement(r))return;let o=[...t,a];if(r.type===y.Fragment){n.push.apply(n,Gy(r.props.children,o));return}yt(r.type===qe,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=Gy(r.props.children,o)),n.push(c)}),n}var Sh="get",wh="application/x-www-form-urlencoded";function rm(e){return e!=null&&typeof e.tagName=="string"}function VK(e){return rm(e)&&e.tagName.toLowerCase()==="button"}function FK(e){return rm(e)&&e.tagName.toLowerCase()==="form"}function HK(e){return rm(e)&&e.tagName.toLowerCase()==="input"}function qK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function GK(e,t){return e.button===0&&(!t||t==="_self")&&!qK(e)}function Qy(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function QK(e,t){let n=Qy(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}var ch=null;function WK(){if(ch===null)try{new FormData(document.createElement("form"),0),ch=!1}catch{ch=!0}return ch}var YK=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ey(e){return e!=null&&!YK.has(e)?(In(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wh}"`),null):e}function KK(e,t){let n,r,a,o,c;if(FK(e)){let u=e.getAttribute("action");r=u?ma(u,t):null,n=e.getAttribute("method")||Sh,a=ey(e.getAttribute("enctype"))||wh,o=new FormData(e)}else if(VK(e)||HK(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?ma(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Sh,a=ey(e.getAttribute("formenctype"))||ey(u.getAttribute("enctype"))||wh,o=new FormData(u,e),!WK()){let{name:p,type:m,value:g}=e;if(m==="image"){let v=p?`${p}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else p&&o.append(p,g)}}else{if(rm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Sh,r=null,a=wh,c=e}return o&&a==="text/plain"&&(c=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:c}}function Hb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function XK(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ZK(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function JK(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let c=await XK(o,n);return c.links?c.links():[]}return[]}));return rX(r.flat(1).filter(ZK).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function RT(e,t,n,r,a,o){let c=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,u=(f,p)=>{var m;return n[p].pathname!==f.pathname||((m=n[p].route.path)==null?void 0:m.endsWith("*"))&&n[p].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,p)=>c(f,p)||u(f,p)):o==="data"?t.filter((f,p)=>{var g;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,p)||u(f,p))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function eX(e,t,{includeHydrateFallback:n}={}){return tX(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function tX(e){return[...new Set(e)]}function nX(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function rX(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(nX(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var aX=new Set([100,101,204,205]);function iX(e,t){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&ma(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function Sk(){let e=y.useContext(tl);return Hb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function oX(){let e=y.useContext(Ld);return Hb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var qb=y.createContext(void 0);qb.displayName="FrameworkContext";function wk(){let e=y.useContext(qb);return Hb(e,"You must render this element inside a <HydratedRouter> element"),e}function sX(e,t){let n=y.useContext(qb),[r,a]=y.useState(!1),[o,c]=y.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,v=y.useRef(null);y.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=R=>{R.forEach(D=>{c(D.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[e]),y.useEffect(()=>{if(r){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[r]);let b=()=>{a(!0)},S=()=>{a(!1),c(!1)};return n?e!=="intent"?[o,v,{}]:[o,v,{onFocus:Uu(u,b),onBlur:Uu(f,S),onMouseEnter:Uu(p,b),onMouseLeave:Uu(m,S),onTouchStart:Uu(g,b)}]:[!1,v,{}]}function Uu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function lX({page:e,...t}){let{router:n}=Sk(),r=y.useMemo(()=>Io(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(uX,{page:e,matches:r,...t}):null}function cX(e){let{manifest:t,routeModules:n}=wk(),[r,a]=y.useState([]);return y.useEffect(()=>{let o=!1;return JK(e,t,n).then(c=>{o||a(c)}),()=>{o=!0}},[e,t,n]),r}function uX({page:e,matches:t,...n}){let r=Mr(),{manifest:a,routeModules:o}=wk(),{basename:c}=Sk(),{loaderData:u,matches:f}=oX(),p=y.useMemo(()=>RT(e,t,f,a,r,"data"),[e,t,f,a,r]),m=y.useMemo(()=>RT(e,t,f,a,r,"assets"),[e,t,f,a,r]),g=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,j=!1;if(t.forEach(R=>{var E;let D=a.routes[R.route.id];!D||!D.hasLoader||(!p.some(T=>T.route.id===R.route.id)&&R.route.id in u&&((E=o[R.route.id])!=null&&E.shouldRevalidate)||D.hasClientLoader?j=!0:S.add(R.route.id))}),S.size===0)return[];let C=iX(e,c);return j&&S.size>0&&C.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[c,u,r,a,p,t,e,o]),v=y.useMemo(()=>eX(m,a),[m,a]),b=cX(m);return y.createElement(y.Fragment,null,g.map(S=>y.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),v.map(S=>y.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),b.map(({key:S,link:j})=>y.createElement("link",{key:S,...j})))}function dX(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var jk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{jk&&(window.__reactRouterVersion="7.6.0")}catch{}function fX(e,t){return ZY({basename:t==null?void 0:t.basename,unstable_getContext:t==null?void 0:t.unstable_getContext,future:t==null?void 0:t.future,history:xY({window:t==null?void 0:t.window}),hydrationData:hX(),routes:e,mapRouteProperties:OK,hydrationRouteProperties:MK,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function hX(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:pX(e.errors)}),e}function pX(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new Yh(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let c=new o(a.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}var Ck=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ek=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:c,state:u,target:f,to:p,preventScrollReset:m,viewTransition:g,...v},b){let{basename:S}=y.useContext(hi),j=typeof p=="string"&&Ck.test(p),C,R=!1;if(typeof p=="string"&&j&&(C=p,jk))try{let $=new URL(window.location.href),V=p.startsWith("//")?new URL($.protocol+p):new URL(p),Y=ma(V.pathname,S);V.origin===$.origin&&Y!=null?p=Y+V.search+V.hash:R=!0}catch{In(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let D=yK(p,{relative:a}),[E,T,A]=sX(r,v),_=yX(p,{replace:c,state:u,target:f,preventScrollReset:m,relative:a,viewTransition:g});function M($){t&&t($),$.defaultPrevented||_($)}let L=y.createElement("a",{...v,...A,href:C||D,onClick:R||o?t:M,ref:dX(b,T),target:f,"data-discover":!j&&n==="render"?"true":void 0});return E&&!j?y.createElement(y.Fragment,null,L,y.createElement(lX,{page:D})):L});Ek.displayName="Link";var mX=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:c,viewTransition:u,children:f,...p},m){let g=Ud(c,{relative:p.relative}),v=Mr(),b=y.useContext(Ld),{navigator:S,basename:j}=y.useContext(hi),C=b!=null&&jX(g)&&u===!0,R=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,D=v.pathname,E=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(D=D.toLowerCase(),E=E?E.toLowerCase():null,R=R.toLowerCase()),E&&j&&(E=ma(E,j)||E);const T=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=D===R||!a&&D.startsWith(R)&&D.charAt(T)==="/",_=E!=null&&(E===R||!a&&E.startsWith(R)&&E.charAt(R.length)==="/"),M={isActive:A,isPending:_,isTransitioning:C},L=A?t:void 0,$;typeof r=="function"?$=r(M):$=[r,A?"active":null,_?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let V=typeof o=="function"?o(M):o;return y.createElement(Ek,{...p,"aria-current":L,className:$,ref:m,style:V,to:c,viewTransition:u},typeof f=="function"?f(M):f)});mX.displayName="NavLink";var gX=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:c=Sh,action:u,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...v},b)=>{let S=SX(),j=wX(u,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&Ck.test(u),D=E=>{if(f&&f(E),E.defaultPrevented)return;E.preventDefault();let T=E.nativeEvent.submitter,A=(T==null?void 0:T.getAttribute("formmethod"))||c;S(T||E.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:a,state:o,relative:p,preventScrollReset:m,viewTransition:g})};return y.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:D,...v,"data-discover":!R&&e==="render"?"true":void 0})});gX.displayName="Form";function vX(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tk(e){let t=y.useContext(tl);return yt(t,vX(e)),t}function yX(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:o,viewTransition:c}={}){let u=Rn(),f=Mr(),p=Ud(e,{relative:o});return y.useCallback(m=>{if(GK(m,t)){m.preventDefault();let g=n!==void 0?n:Vo(f)===Vo(p);u(e,{replace:g,state:r,preventScrollReset:a,relative:o,viewTransition:c})}},[f,u,p,n,r,t,e,a,o,c])}function Gb(e){In(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(Qy(e)),n=y.useRef(!1),r=Mr(),a=y.useMemo(()=>QK(r.search,n.current?null:t.current),[r.search]),o=Rn(),c=y.useCallback((u,f)=>{const p=Qy(typeof u=="function"?u(a):u);n.current=!0,o("?"+p,f)},[o,a]);return[a,c]}var xX=0,bX=()=>`__${String(++xX)}__`;function SX(){let{router:e}=Tk("useSubmit"),{basename:t}=y.useContext(hi),n=kK();return y.useCallback(async(r,a={})=>{let{action:o,method:c,encType:u,formData:f,body:p}=KK(r,t);if(a.navigate===!1){let m=a.fetcherKey||bX();await e.fetch(m,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||c,formEncType:a.encType||u,flushSync:a.flushSync})}else await e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||c,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function wX(e,{relative:t}={}){let{basename:n}=y.useContext(hi),r=y.useContext(Ua);yt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...Ud(e||".",{relative:t})},c=Mr();if(e==null){o.search=c.search;let u=new URLSearchParams(o.search),f=u.getAll("index");if(f.some(m=>m==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let m=u.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:si([n,o.pathname])),Vo(o)}function jX(e,t={}){let n=y.useContext($b);yt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Tk("useViewTransitionState"),a=Ud(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=ma(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ma(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Wh(a.pathname,c)!=null||Wh(a.pathname,o)!=null}[...aX];const CX=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function yc(e,t,n){const r=EX(e),{webkitRelativePath:a}=e,o=typeof t=="string"?t:typeof a=="string"&&a.length>0?a:`./${e.name}`;return typeof r.path!="string"&&DT(r,"path",o),DT(r,"relativePath",o),r}function EX(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),a=CX.get(r);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}function DT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var nl=(e,t,n)=>new Promise((r,a)=>{var o=f=>{try{u(n.next(f))}catch(p){a(p)}},c=f=>{try{u(n.throw(f))}catch(p){a(p)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,c);u((n=n.apply(e,t)).next())});const TX=[".DS_Store","Thumbs.db"];function RX(e){return nl(this,null,function*(){return Xh(e)&&DX(e.dataTransfer)?PX(e.dataTransfer,e.type):AX(e)?_X(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?kX(e):[]})}function DX(e){return Xh(e)}function AX(e){return Xh(e)&&Xh(e.target)}function Xh(e){return typeof e=="object"&&e!==null}function _X(e){return Wy(e.target.files).map(t=>yc(t))}function kX(e){return nl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>yc(n))})}function PX(e,t){return nl(this,null,function*(){if(e.items){const n=Wy(e.items).filter(a=>a.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(NX));return AT(Rk(r))}return AT(Wy(e.files).map(n=>yc(n)))})}function AT(e){return e.filter(t=>TX.indexOf(t.name)===-1)}function Wy(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function NX(e){if(typeof e.webkitGetAsEntry!="function")return _T(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Dk(t):_T(e,t)}function Rk(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?Rk(n):[n]],[])}function _T(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(o=>nl(this,null,function*(){const c=yield o.getFile();return c.handle=o,yc(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const a=yc(r,(n=t==null?void 0:t.fullPath)!=null?n:void 0);return Promise.resolve(a)}function OX(e){return nl(this,null,function*(){return e.isDirectory?Dk(e):MX(e)})}function Dk(e){const t=e.createReader();return new Promise((n,r)=>{const a=[];function o(){t.readEntries(c=>nl(this,null,function*(){if(c.length){const u=Promise.all(c.map(OX));a.push(u),o()}else try{const u=yield Promise.all(a);n(u)}catch(u){r(u)}}),c=>{r(c)})}o()})}function MX(e){return nl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const a=yc(r,e.fullPath);t(a)},r=>{n(r)})})})}function ty(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",a=(e.type||"").toLowerCase(),o=a.replace(/\/.*$/,"");return n.some(c=>{const u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):a===u})}return!0}var IX=Object.defineProperty,LX=Object.defineProperties,zX=Object.getOwnPropertyDescriptors,kT=Object.getOwnPropertySymbols,$X=Object.prototype.hasOwnProperty,UX=Object.prototype.propertyIsEnumerable,PT=(e,t,n)=>t in e?IX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BX=(e,t)=>{for(var n in t||(t={}))$X.call(t,n)&&PT(e,n,t[n]);if(kT)for(var n of kT(t))UX.call(t,n)&&PT(e,n,t[n]);return e},VX=(e,t)=>LX(e,zX(t));const FX=typeof ty=="function"?ty:ty.default,HX="file-invalid-type",qX="file-too-large",GX="file-too-small",QX="too-many-files",WX=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:HX,message:`File type must be ${n}`}},NT=e=>({code:qX,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),OT=e=>({code:GX,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),YX={code:QX,message:"Too many files"};function Ak(e,t){const n=e.type==="application/x-moz-file"||FX(e,t);return[n,n?null:WX(t)]}function _k(e,t,n){if(Cs(e.size))if(Cs(t)&&Cs(n)){if(e.size>n)return[!1,NT(n)];if(e.size<t)return[!1,OT(t)]}else{if(Cs(t)&&e.size<t)return[!1,OT(t)];if(Cs(n)&&e.size>n)return[!1,NT(n)]}return[!0,null]}function Cs(e){return e!=null}function KX({files:e,accept:t,minSize:n,maxSize:r,multiple:a,maxFiles:o,validator:c}){return!a&&e.length>1||a&&o>=1&&e.length>o?!1:e.every(u=>{const[f]=Ak(u,t),[p]=_k(u,n,r),m=c?c(u):null;return f&&p&&!m})}function Zh(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function uh(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,t=>t==="Files"||t==="application/x-moz-file"):!!e.target&&!!e.target.files}function MT(e){e.preventDefault()}function XX(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function ZX(e){return e.indexOf("Edge/")!==-1}function JX(e=window.navigator.userAgent){return XX(e)||ZX(e)}function Ka(...e){return(t,...n)=>e.some(r=>(!Zh(t)&&r&&r(t,...n),Zh(t)))}function eZ(){return"showOpenFilePicker"in window}function tZ(e){return Cs(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let a=!0;return kk(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),a=!1),(!Array.isArray(r)||!r.every(Pk))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),a=!1),a}).reduce((n,[r,a])=>VX(BX({},n),{[r]:a}),{})}]:e}function nZ(e){if(Cs(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>kk(t)||Pk(t)).join(",")}function rZ(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function aZ(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function kk(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function Pk(e){return/^.*\.[\w]+$/.test(e)}var iZ=Object.defineProperty,oZ=Object.defineProperties,sZ=Object.getOwnPropertyDescriptors,Jh=Object.getOwnPropertySymbols,Nk=Object.prototype.hasOwnProperty,Ok=Object.prototype.propertyIsEnumerable,IT=(e,t,n)=>t in e?iZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t)=>{for(var n in t||(t={}))Nk.call(t,n)&&IT(e,n,t[n]);if(Jh)for(var n of Jh(t))Ok.call(t,n)&&IT(e,n,t[n]);return e},Oo=(e,t)=>oZ(e,sZ(t)),ep=(e,t)=>{var n={};for(var r in e)Nk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jh)for(var r of Jh(e))t.indexOf(r)<0&&Ok.call(e,r)&&(n[r]=e[r]);return n};const Qb=y.forwardRef((e,t)=>{var n=e,{children:r}=n,a=ep(n,["children"]);const o=Ik(a),{open:c}=o,u=ep(o,["open"]);return y.useImperativeHandle(t,()=>({open:c}),[c]),Cn.createElement(y.Fragment,null,r(Oo(hr({},u),{open:c})))});Qb.displayName="Dropzone";const Mk={disabled:!1,getFilesFromEvent:RX,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Qb.defaultProps=Mk;Qb.propTypes={children:on.func,accept:on.objectOf(on.arrayOf(on.string)),multiple:on.bool,preventDropOnDocument:on.bool,noClick:on.bool,noKeyboard:on.bool,noDrag:on.bool,noDragEventsBubbling:on.bool,minSize:on.number,maxSize:on.number,maxFiles:on.number,disabled:on.bool,getFilesFromEvent:on.func,onFileDialogCancel:on.func,onFileDialogOpen:on.func,useFsAccessApi:on.bool,autoFocus:on.bool,onDragEnter:on.func,onDragLeave:on.func,onDragOver:on.func,onDrop:on.func,onDropAccepted:on.func,onDropRejected:on.func,onError:on.func,validator:on.func};const Yy={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Ik(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:a,minSize:o,multiple:c,maxFiles:u,onDragEnter:f,onDragLeave:p,onDragOver:m,onDrop:g,onDropAccepted:v,onDropRejected:b,onFileDialogCancel:S,onFileDialogOpen:j,useFsAccessApi:C,autoFocus:R,preventDropOnDocument:D,noClick:E,noKeyboard:T,noDrag:A,noDragEventsBubbling:_,onError:M,validator:L}=hr(hr({},Mk),e),$=y.useMemo(()=>nZ(t),[t]),V=y.useMemo(()=>tZ(t),[t]),Y=y.useMemo(()=>typeof j=="function"?j:LT,[j]),W=y.useMemo(()=>typeof S=="function"?S:LT,[S]),G=y.useRef(null),X=y.useRef(null),[Z,P]=y.useReducer(lZ,Yy),{isFocused:I,isFileDialogActive:z}=Z,F=y.useRef(typeof window<"u"&&window.isSecureContext&&C&&eZ()),O=()=>{!F.current&&z&&setTimeout(()=>{if(X.current){const{files:ge}=X.current;ge.length||(P({type:"closeDialog"}),W())}},300)};y.useEffect(()=>(window.addEventListener("focus",O,!1),()=>{window.removeEventListener("focus",O,!1)}),[X,z,W,F]);const U=y.useRef([]),J=ge=>{G.current&&G.current.contains(ge.target)||(ge.preventDefault(),U.current=[])};y.useEffect(()=>(D&&(document.addEventListener("dragover",MT,!1),document.addEventListener("drop",J,!1)),()=>{D&&(document.removeEventListener("dragover",MT),document.removeEventListener("drop",J))}),[G,D]),y.useEffect(()=>(!n&&R&&G.current&&G.current.focus(),()=>{}),[G,R,n]);const te=y.useCallback(ge=>{M?M(ge):console.error(ge)},[M]),ye=y.useCallback(ge=>{ge.preventDefault(),ge.persist(),Se(ge),U.current=[...U.current,ge.target],uh(ge)&&Promise.resolve(r(ge)).then(we=>{if(Zh(ge)&&!_)return;const Le=we.length,xe=Le>0&&KX({files:we,accept:$,minSize:o,maxSize:a,multiple:c,maxFiles:u,validator:L}),$e=Le>0&&!xe;P({isDragAccept:xe,isDragReject:$e,isDragActive:!0,type:"setDraggedFiles"}),f&&f(ge)}).catch(we=>te(we))},[r,f,te,_,$,o,a,c,u,L]),be=y.useCallback(ge=>{ge.preventDefault(),ge.persist(),Se(ge);const we=uh(ge);if(we&&ge.dataTransfer)try{ge.dataTransfer.dropEffect="copy"}catch{}return we&&m&&m(ge),!1},[m,_]),ve=y.useCallback(ge=>{ge.preventDefault(),ge.persist(),Se(ge);const we=U.current.filter(xe=>G.current&&G.current.contains(xe)),Le=we.indexOf(ge.target);Le!==-1&&we.splice(Le,1),U.current=we,!(we.length>0)&&(P({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(ge)&&p&&p(ge))},[G,p,_]),Ge=y.useCallback((ge,we)=>{const Le=[],xe=[];ge.forEach($e=>{const[gt,ht]=Ak($e,$),[Wt,_t]=_k($e,o,a),mn=L?L($e):null;if(gt&&Wt&&!mn)Le.push($e);else{let St=[ht,_t];mn&&(St=St.concat(mn)),xe.push({file:$e,errors:St.filter(Ba=>Ba)})}}),(!c&&Le.length>1||c&&u>=1&&Le.length>u)&&(Le.forEach($e=>{xe.push({file:$e,errors:[YX]})}),Le.splice(0)),P({acceptedFiles:Le,fileRejections:xe,isDragReject:xe.length>0,type:"setFiles"}),g&&g(Le,xe,we),xe.length>0&&b&&b(xe,we),Le.length>0&&v&&v(Le,we)},[P,c,$,o,a,u,g,v,b,L]),ke=y.useCallback(ge=>{ge.preventDefault(),ge.persist(),Se(ge),U.current=[],uh(ge)&&Promise.resolve(r(ge)).then(we=>{Zh(ge)&&!_||Ge(we,ge)}).catch(we=>te(we)),P({type:"reset"})},[r,Ge,te,_]),et=y.useCallback(()=>{if(F.current){P({type:"openDialog"}),Y();const ge={multiple:c,types:V};window.showOpenFilePicker(ge).then(we=>r(we)).then(we=>{Ge(we,null),P({type:"closeDialog"})}).catch(we=>{rZ(we)?(W(we),P({type:"closeDialog"})):aZ(we)?(F.current=!1,X.current?(X.current.value=null,X.current.click()):te(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."))):te(we)});return}X.current&&(P({type:"openDialog"}),Y(),X.current.value=null,X.current.click())},[P,Y,W,C,Ge,te,V,c]),Re=y.useCallback(ge=>{!G.current||!G.current.isEqualNode(ge.target)||(ge.key===" "||ge.key==="Enter"||ge.keyCode===32||ge.keyCode===13)&&(ge.preventDefault(),et())},[G,et]),ft=y.useCallback(()=>{P({type:"focus"})},[]),Ut=y.useCallback(()=>{P({type:"blur"})},[]),Ot=y.useCallback(()=>{E||(JX()?setTimeout(et,0):et())},[E,et]),xt=ge=>n?null:ge,Ht=ge=>T?null:xt(ge),Bt=ge=>A?null:xt(ge),Se=ge=>{_&&ge.stopPropagation()},Ne=y.useMemo(()=>(ge={})=>{var we=ge,{refKey:Le="ref",role:xe,onKeyDown:$e,onFocus:gt,onBlur:ht,onClick:Wt,onDragEnter:_t,onDragOver:mn,onDragLeave:St,onDrop:Ba}=we,ba=ep(we,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return hr(hr({onKeyDown:Ht(Ka($e,Re)),onFocus:Ht(Ka(gt,ft)),onBlur:Ht(Ka(ht,Ut)),onClick:xt(Ka(Wt,Ot)),onDragEnter:Bt(Ka(_t,ye)),onDragOver:Bt(Ka(mn,be)),onDragLeave:Bt(Ka(St,ve)),onDrop:Bt(Ka(Ba,ke)),role:typeof xe=="string"&&xe!==""?xe:"presentation",[Le]:G},!n&&!T?{tabIndex:0}:{}),ba)},[G,Re,ft,Ut,Ot,ye,be,ve,ke,T,A,n]),Ve=y.useCallback(ge=>{ge.stopPropagation()},[]),Te=y.useMemo(()=>(ge={})=>{var we=ge,{refKey:Le="ref",onChange:xe,onClick:$e}=we,gt=ep(we,["refKey","onChange","onClick"]);const ht={accept:$,multiple:c,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:xt(Ka(xe,ke)),onClick:xt(Ka($e,Ve)),tabIndex:-1,[Le]:X};return hr(hr({},ht),gt)},[X,t,c,ke,n]);return Oo(hr({},Z),{isFocused:I&&!n,getRootProps:Ne,getInputProps:Te,rootRef:G,inputRef:X,open:xt(et)})}function lZ(e,t){switch(t.type){case"focus":return Oo(hr({},e),{isFocused:!0});case"blur":return Oo(hr({},e),{isFocused:!1});case"openDialog":return Oo(hr({},Yy),{isFileDialogActive:!0});case"closeDialog":return Oo(hr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Oo(hr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Oo(hr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return hr({},Yy);default:return e}}function LT(){}const[cZ,uZ]=vr("Dropzone component was not found in tree");function Wb(e){const t=n=>{const{children:r,...a}=se(`Dropzone${$j(e)}`,{},n),o=uZ(),c=Fi(r)?r:s.jsx("span",{children:r});return o[e]?y.cloneElement(c,a):null};return t.displayName=`@mantine/dropzone/${$j(e)}`,t}const dZ=Wb("accept"),fZ=Wb("reject"),hZ=Wb("idle");var cd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const pZ={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},mZ=(e,{radius:t,variant:n,acceptColor:r,rejectColor:a})=>{const o=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:a||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Ft(t),"--dropzone-accept-color":o.color,"--dropzone-accept-bg":o.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},Yo=me((e,t)=>{const n=se("Dropzone",pZ,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,radius:p,disabled:m,loading:g,multiple:v,maxSize:b,accept:S,children:j,onDropAny:C,onDrop:R,onReject:D,openRef:E,name:T,maxFiles:A,autoFocus:_,activateOnClick:M,activateOnDrag:L,dragEventsBubbling:$,activateOnKeyboard:V,onDragEnter:Y,onDragLeave:W,onDragOver:G,onFileDialogCancel:X,onFileDialogOpen:Z,preventDropOnDocument:P,useFsAccessApi:I,getFilesFromEvent:z,validator:F,rejectColor:O,acceptColor:U,enablePointerEvents:J,loaderProps:te,inputProps:ye,mod:be,...ve}=n,Ge=Me({name:"Dropzone",classes:cd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:mZ}),{getRootProps:ke,getInputProps:et,isDragAccept:Re,isDragReject:ft,open:Ut}=Ik({onDrop:C,onDropAccepted:R,onDropRejected:D,disabled:m||g,accept:Array.isArray(S)?S.reduce((xt,Ht)=>({...xt,[Ht]:[]}),{}):S,multiple:v,maxSize:b,maxFiles:A,autoFocus:_,noClick:!M,noDrag:!L,noDragEventsBubbling:!$,noKeyboard:!V,onDragEnter:Y,onDragLeave:W,onDragOver:G,onFileDialogCancel:X,onFileDialogOpen:Z,preventDropOnDocument:P,useFsAccessApi:I,validator:F,...z?{getFilesFromEvent:z}:null});Yu(E,Ut);const Ot=!Re&&!ft;return s.jsx(cZ,{value:{accept:Re,reject:ft,idle:Ot},children:s.jsxs(ce,{...ke(),...Ge("root",{focusable:!0}),...ve,mod:[{accept:Re,reject:ft,idle:Ot,disabled:m,loading:g,"activate-on-click":M},be],children:[s.jsx(d0,{visible:g,overlayProps:{radius:p},unstyled:u,loaderProps:te}),s.jsx("input",{...et(ye),name:T}),s.jsx("div",{...Ge("inner"),ref:t,"data-enable-pointer-events":J||void 0,children:j})]})})});Yo.classes=cd;Yo.displayName="@mantine/dropzone/Dropzone";Yo.Accept=dZ;Yo.Idle=hZ;Yo.Reject=fZ;const gZ={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Wr("max"),withinPortal:!0},Yb=me((e,t)=>{const n=se("DropzoneFullScreen",gZ,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,active:p,onDrop:m,onReject:g,zIndex:v,withinPortal:b,portalProps:S,...j}=n,C=Me({name:"DropzoneFullScreen",classes:cd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"fullScreen"}),{resolvedClassNames:R,resolvedStyles:D}=Hs({classNames:r,styles:c,props:n}),[E,T]=y.useState(0),[A,{open:_,close:M}]=rp(!1),L=V=>{var Y;(Y=V.dataTransfer)!=null&&Y.types.includes("Files")&&(T(W=>W+1),_())},$=()=>{T(V=>V-1)};return y.useEffect(()=>{E===0&&M()},[E]),y.useEffect(()=>{if(p)return document.addEventListener("dragenter",L,!1),document.addEventListener("dragleave",$,!1),()=>{document.removeEventListener("dragenter",L,!1),document.removeEventListener("dragleave",$,!1)}},[p]),s.jsx(Ho,{...S,withinPortal:b,children:s.jsx(ce,{...C("fullScreen",{style:{opacity:A?1:0,pointerEvents:A?"all":"none",zIndex:v}}),ref:t,children:s.jsx(Yo,{...j,classNames:R,styles:D,unstyled:u,className:cd.dropzone,onDrop:V=>{m==null||m(V),M(),T(0)},onReject:V=>{g==null||g(V),M(),T(0)}})})})});Yb.classes=cd;Yb.displayName="@mantine/dropzone/DropzoneFullScreen";Yo.FullScreen=Yb;const dh=Yo,vZ='{"resourceType": "Bundle"}';function ny({id:e,title:t,message:n,color:r,icon:a,withCloseButton:o=!1,method:c="show",loading:u}){ca[c]({id:e,loading:u,title:t,message:n,color:r,icon:a,withCloseButton:o,autoClose:!1})}function yZ(){const e=Sn(),t=De(),[n,r]=y.useState({}),a=y.useCallback(async(u,f)=>{const p="batch-upload";ny({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(u);m.type!=="batch"&&m.type!=="transaction"&&(m=AA(m));const g=await t.executeBatch(m);r(v=>({...v,[f]:g})),ny({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(eo,{size:"1rem"}),withCloseButton:!0})}catch(m){ny({id:p,title:"Batch Upload Failed",color:"red",message:Ke(m),method:"update",icon:s.jsx($s,{size:"1rem"}),withCloseButton:!0})}},[t]),o=y.useCallback(async u=>{for(const f of u){const p=new FileReader;p.onload=m=>{var g;return a((g=m.target)==null?void 0:g.result,f.name)},p.readAsText(f)}},[a]),c=y.useCallback(async u=>{await a(u.input,"JSON Data")},[a]);return s.jsxs(ot,{children:[s.jsx(Ie,{children:"Batch Create"}),s.jsxs(Ae,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",s.jsx(Pt,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(It,{defaultValue:"upload",children:[s.jsxs(It.List,{children:[s.jsx(It.Tab,{value:"upload",children:"File Upload"}),s.jsx(It.Tab,{value:"json",children:"JSON"})]}),s.jsx(It.Panel,{value:"upload",pt:"xs",children:s.jsx(dh,{onDrop:o,accept:["application/json"],children:s.jsxs(Ce,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(dh.Accept,{children:s.jsx(DE,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(dh.Reject,{children:s.jsx($s,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(dh.Idle,{children:s.jsx(DE,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(Ae,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(Ae,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(It.Panel,{value:"json",pt:"xs",children:s.jsxs(mt,{onSubmit:c,children:[s.jsx(Tc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:vZ,deserialize:JSON.parse}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(It,{defaultValue:Object.keys(n)[0],children:[s.jsx(It.List,{children:Object.keys(n).map(u=>s.jsx(It.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>s.jsx(It.Panel,{value:u,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{onClick:()=>r({}),children:"Start over"})})]})]})}function xZ(){const{resourceType:e}=Qt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(a=>!!a),[r]=vc("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(ot,{children:[s.jsxs(Ie,{children:["No apps for ",e]}),s.jsx(bt,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(ot,{children:s.jsx("div",{children:r.map(a=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(bt,{to:`/forms/${a.id}?subject=`+n.map(o=>`${e}/${o}`).join(","),children:a.name})}),s.jsx("p",{children:a.description})]},a.id))})}):s.jsx(pa,{})}function bZ(){const e=De(),[t,n]=y.useState(),[r,a]=y.useState(!1);return s.jsx(ot,{width:450,children:s.jsxs(mt,{onSubmit:o=>{n(void 0),e.post("auth/changepassword",o).then(()=>a(!0)).catch(c=>n(Jt(c)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx($a,{size:32}),s.jsx(Ie,{children:"Change password"})]}),!r&&s.jsxs(We,{gap:"xl",mt:"xl",children:[s.jsx(Na,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Nt(t,"oldPassword")}),s.jsx(Na,{name:"newPassword",label:"New password",required:!0,error:Nt(t,"newPassword")}),s.jsx(Na,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Nt(t,"confirmPassword")}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const Ky=["Form","JSON","Profiles"],SZ=["Profiles"],ry=Ky[0].toLowerCase();function wZ(){const e=Rn(),t=Sn(),{resourceType:n}=Qt(),[r,a]=y.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&Ky.map(u=>u.toLowerCase()).includes(c)?c:ry});function o(c){var u;c||(c=ry),a(c),(u=e(`/${n}/new/${c}`))==null||u.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(mr,{children:[s.jsxs(Ae,{p:"md",fw:500,children:["New ",n]}),s.jsx(Yr,{children:s.jsx(It,{defaultValue:ry,value:r,onChange:o,children:s.jsx(It.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Ky.map(c=>s.jsx(It.Tab,{value:c.toLowerCase(),px:"md",children:SZ.includes(c)?s.jsxs(Ce,{gap:"xs",wrap:"nowrap",children:[c,s.jsx(Sp,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),s.jsx(Fb,{})]})}function jZ(){return s.jsx(ot,{children:s.jsxs(We,{children:[s.jsx(Ie,{order:1,children:"Unexpected Error"}),s.jsx(Ae,{children:"We're sorry, something went wrong."}),s.jsxs(Ae,{children:["Please contact ",s.jsx(Pt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function Lk(e){const t=Yt(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(bt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,u){c&&u&&n.push({key:c,value:u})}function a(c){c&&r(c.system,c.value)}function o(c,u){Array.isArray(u)?u.forEach(f=>o(c,f)):typeof u=="string"?r(c,u):u&&(Array.isArray(u.coding)?r(c,u.coding.map(f=>f.display||f.code).join(", ")):r(c,u.text))}if("name"in t){const c=Bi(t);c!==Lt(t)&&r("Name",c)}return"category"in t&&o("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&o("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(a):a(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),s.jsx(pt,{children:n.map((c,u)=>s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:c.key}),s.jsx(pt.Value,{children:c.value})]},`${c.key}-${u}`))})}function Kb(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function CZ(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 Ko(e){var t;return Is((t=e.getActiveLogin())==null?void 0:t.project)}function EZ(){const{id:e}=Qt(),t=Mr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,a=De(),[o,c]=y.useState(!0),[u,f]=y.useState(),[p,m]=y.useState(),[g,v]=y.useState(),[b,S]=y.useState(),[j,C]=y.useState();if(y.useEffect(()=>{const E={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const T=r.split(",").filter(A=>!!A);T.length===1&&E.entry.push({request:{method:"GET",url:T[0]}}),m(T)}a.executeBatch(E).then(T=>{var A,_,M,L,$,V,Y,W;((M=(_=(A=T.entry)==null?void 0:A[0])==null?void 0:_.response)==null?void 0:M.status)!=="200"?S((V=($=(L=T.entry)==null?void 0:L[0])==null?void 0:$.response)==null?void 0:V.outcome):(f((Y=T.entry[0])==null?void 0:Y.resource),v((W=T.entry[1])==null?void 0:W.resource)),c(!1)}).catch(T=>{S(T),c(!1)})},[a,e,r]),b)return s.jsx(ot,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return s.jsxs(ot,{children:[s.jsx(Ie,{children:u==null?void 0:u.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[j.length===1&&s.jsx("li",{children:s.jsx(bt,{to:j[0],children:"Review your answers"})}),j.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:j.map(E=>s.jsx("li",{children:s.jsx(bt,{to:E,children:Lt(E)})},E.id))})]}),g&&s.jsx("li",{children:s.jsxs(bt,{to:g,children:["Back to ",Bi(g)]})}),s.jsx("li",{children:s.jsx(bt,{to:"/",children:"Go back home"})})]})]});if(o||!u)return s.jsx(pa,{});const R=g&&Kb(g);return s.jsxs(s.Fragment,{children:[s.jsxs(mr,{shadow:"xs",radius:0,children:[R&&s.jsx(M_,{patient:R}),g&&g.resourceType!=="Patient"&&s.jsx(Lk,{resource:g}),s.jsx(ce,{px:"xl",py:"md",children:s.jsxs(Ae,{children:[Bi(u),p&&p.length>1&&s.jsxs(s.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),s.jsx(ot,{children:s.jsx(X_,{questionnaire:u,subject:g&&fn(g),onSubmit:D})})]});async function D(E){const T=[];if(!p||p.length===0)T.push(await a.createResource(E));else for(const A of p)T.push(await a.createResource({...E,subject:{reference:A}}));C(T)}}const TZ="_paper_unw9o_1",RZ={paper:TZ},DZ={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function zk(e,t){const n=e.resourceType||AZ(t),r=e.fields??_Z(n),a=e.filters??(e.resourceType?void 0:kZ(n)),o=e.sortRules??PZ(n),c=e.offset??0,u=e.count??Hp;return{...e,resourceType:n,fields:r,filters:a,sortRules:o,offset:c,count:u}}function AZ(e){var t,n;return localStorage.getItem("defaultResourceType")??((n=(t=e==null?void 0:e.option)==null?void 0:t.find(r=>r.id==="defaultResourceType"))==null?void 0:n.valueString)??"Patient"}function _Z(e){const t=Xb(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AsyncJob":n.push("status","dataVersion");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function kZ(e){var t;return(t=Xb(e))==null?void 0:t.filters}function PZ(e){const t=Xb(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function Xb(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function NZ(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function OZ(e,t){const n={...e,count:1e3,offset:0},r=zk(n,t.getUserConfiguration()),a=await t.search(r.resourceType,Jl({...r,total:"accurate",fields:void 0}));return AA(a)}function zT(){const e=De(),t=Rn(),n=Mr(),[r,a]=y.useState();return y.useEffect(()=>{var u;const o=CA(n.pathname+n.search),c=zk(o,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===Jl(c)?(NZ(c),a(c)):(u=t(`/${c.resourceType}${Jl(c)}`))==null||u.catch(console.error)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(pa,{}):s.jsx(mr,{shadow:"xs",m:"md",p:"xs",className:RZ.paper,children:s.jsx(Id,{checkboxesEnabled:!0,search:r,onClick:o=>{var c;return(c=t(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onAuxClick:o=>window.open(`/${o.resource.resourceType}/${o.resource.id}`,"_blank"),onChange:o=>{var c;(c=t(`/${r.resourceType}${Jl(o.definition)}`))==null||c.catch(console.error)},onNew:()=>{var o;(o=t(DZ[r.resourceType]??`/${r.resourceType}/new`))==null||o.catch(console.error)},onExportCsv:()=>{const o=e.fhirUrl(r.resourceType,"$csv")+Jl(r);e.download(o).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>_e({color:"red",message:Ke(c),autoClose:!1}))},onExportTransactionBundle:async()=>{OZ(r,e).then(o=>KA(JSON.stringify(o,void 0,2))).catch(o=>_e({color:"red",message:Ke(o),autoClose:!1}))},onDelete:o=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:o.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>a({...r})).catch(c=>_e({color:"red",message:Ke(c),autoClose:!1})))},onBulk:o=>{var c;(c=t(`/bulk/${r.resourceType}?ids=${o.join(",")}`))==null||c.catch(console.error)}})})}function MZ(){const e=De(),[t,n]=y.useState(),[r,a]=y.useState(void 0),[o,c]=y.useState(!1),u=y.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),a(m.enrolled)}).catch(m=>_e({color:"red",message:Ke(m),autoClose:!1}))},[e]);y.useEffect(()=>{u()},[u]);const f=y.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{a(!0),_e({color:"green",message:"Success"})}).catch(g=>_e({color:"red",message:Ke(g),autoClose:!1}))},[e]),p=y.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?s.jsxs(ot,{children:[s.jsx(Un,{title:"Disable MFA",opened:o,onClose:()=>c(!1),children:s.jsx(s_,{onSubmit:async m=>{await p(m),c(!1),a(!1),_e({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:s.jsx(DV,{})}),u()}})}),s.jsxs(Ce,{children:[s.jsx(Ie,{children:"MFA is enabled"}),s.jsx(Pe,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):s.jsx(ot,{width:400,children:s.jsxs(mt,{onSubmit:f,children:[s.jsx(Ie,{children:"Multi Factor Auth Setup"}),s.jsx(er,{children:s.jsx("img",{src:t,alt:"Multi Factor Auth QR Code"})}),s.jsx(ze,{name:"token",label:"Code"}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Enroll"})})]})})}const ay={},Xy={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:ay==null?void 0:ay.MEDPLUM_AWS_TEXTRACT_ENABLED};function Bd(){return Xy}function $k(){return Uk("registerEnabled")}function IZ(){return Uk("awsTextractEnabled")}function Uk(e){try{return Xy[e]!==!1&&Xy[e]!=="false"}catch{return!0}}function LZ(){var g,v;const e=Rn(),[t]=Gb(),n=De(),r=t.get("scope")||"openid",[a,o]=y.useState(),[c,u]=y.useState(!0),f=t.get("client_id"),p=t.get("login");if(y.useEffect(()=>{if(!f||f==="medplum-cli")return;async function b(){try{const S=await n.get(`/auth/clientinfo/${f}`);o(S)}catch(S){_e({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ke(S),withCloseButton:!0})}finally{u(!1)}}b().catch(console.error)},[n,f]),!f)return null;function m(b){const S=new URL(t.get("redirect_uri"));for(const j of["scope","state","nonce"])t.has(j)&&S.searchParams.set(j,t.get(j));S.searchParams.set("code",b),window.location.assign(S.toString())}return s.jsx(l_,{onCode:m,onForgotPassword:()=>{var b;return(b=e("/resetpassword"))==null?void 0:b.catch(console.error)},onRegister:()=>{var b;return(b=e("/register"))==null?void 0:b.catch(console.error)},googleClientId:Bd().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:p||void 0,children:!c&&s.jsxs(s.Fragment,{children:[(g=a==null?void 0:a.logo)!=null&&g.url?s.jsx("img",{src:(v=a==null?void 0:a.logo)==null?void 0:v.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):s.jsx($a,{size:32}),s.jsx(Ie,{children:(a==null?void 0:a.welcomeString)??"Sign in to Medplum"})]})})}function zZ(){const e=De(),t=Rn(),n=Bd();return y.useEffect(()=>{var r;e.getProfile()&&((r=t("/signin?project=new"))==null||r.catch(console.error))},[e,t]),$k()?s.jsxs(dH,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx($a,{size:32}),s.jsx(Ie,{children:"Create a new account"})]}):s.jsx(ot,{width:450,children:s.jsx(Yi,{icon:s.jsx(Js,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function $Z(){const e=Rn(),t=De(),[n,r]=y.useState(),[a,o]=y.useState(!1),c=Bd().recaptchaSiteKey;return y.useEffect(()=>{i_(c)},[c]),s.jsx(ot,{width:450,children:s.jsxs(mt,{onSubmit:async u=>{let f="";f=await o_(c),t.post("auth/resetpassword",{...u,recaptchaToken:f}).then(()=>o(!0)).catch(p=>r(Jt(p)))},children:[s.jsxs(We,{gap:"lg",mb:"xl",align:"center",children:[s.jsx($a,{size:32}),s.jsx(Ie,{children:"Medplum Password Reset"})]}),s.jsxs(We,{gap:"xl",children:[s.jsx(xa,{issues:Pd(n,void 0)}),!a&&s.jsxs(s.Fragment,{children:[s.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Nt(n,"email")}),s.jsxs(Ce,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Pt,{component:"button",type:"button",color:"dimmed",onClick:()=>{var u;return(u=e("/register"))==null?void 0:u.catch(console.error)},size:"xs",children:"Register"}),s.jsx(Pe,{type:"submit",children:"Reset password"})]})]}),a&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function UZ(){var o;const e=Rn(),t=De(),[n,r]=y.useState();y.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(c=>_e({color:"red",message:Ke(c),autoClose:!1}))},[t]);function a(c){t.post("auth/revoke",{loginId:c}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>_e({color:"green",message:"Login revoked"})).catch(u=>_e({color:"red",message:Ke(u),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(ot,{children:[s.jsx(Ie,{children:"Security"}),s.jsxs(gb,{children:[s.jsx(Ii,{term:"ID",children:s.jsx(Pt,{href:`/${Lt(n.profile)}`,children:n.profile.id})}),s.jsx(Ii,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(Ii,{term:"Name",children:Pc((o=n.profile.name)==null?void 0:o[0])})]})]}),s.jsxs(ot,{children:[s.jsx(Ie,{children:"Sessions"}),s.jsxs(Oe,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:n.security.sessions.map(c=>s.jsxs("tr",{children:[s.jsx("td",{children:c.os}),s.jsx("td",{children:c.browser}),s.jsx("td",{children:c.remoteAddress}),s.jsx("td",{children:c.authMethod}),s.jsx("td",{children:gr(c.lastUpdated)}),s.jsx("td",{children:s.jsx(Pt,{href:"#",onClick:()=>a(c.id),children:"Revoke"})})]},c.id))})]})]}),s.jsxs(ot,{children:[s.jsx(Ie,{children:"Password"}),s.jsx(Pe,{onClick:()=>{var c;return(c=e("/changepassword"))==null?void 0:c.catch(console.error)},children:"Change password"})]}),s.jsxs(ot,{children:[s.jsx(Ie,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(Pe,{onClick:()=>{var c;return(c=e("/mfa"))==null?void 0:c.catch(console.error)},children:"Enroll"})]})]}):null}function BZ(){const{id:e,secret:t}=Qt(),n=De(),[r,a]=y.useState(),[o,c]=y.useState(!1),u=Pd(r,void 0);return s.jsxs(ot,{width:450,children:[s.jsx(xa,{issues:u}),s.jsxs(mt,{onSubmit:f=>{if(f.password!==f.confirmPassword){a(ai("Passwords do not match","confirmPassword"));return}a(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>a(Jt(m)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx($a,{size:32}),s.jsx(Ie,{children:"Set password"})]}),!o&&s.jsxs(We,{children:[s.jsx(Na,{name:"password",label:"New password",required:!0,error:Nt(r,"password")}),s.jsx(Na,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Nt(r,"confirmPassword")}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Set password"})})]}),o&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(bt,{to:"/signin",children:"sign in"}),"."]})]})]})}function VZ(){const e=Yp(),t=Rn(),[n]=Gb(),r=Bd(),a=y.useCallback(()=>{var c;const o=n.get("next");(c=t(o!=null&&o.startsWith("/")?o:"/"))==null||c.catch(console.error)},[n,t]);return y.useEffect(()=>{e&&n.has("next")&&a()},[e,n,a]),s.jsxs(l_,{onSuccess:()=>a(),onForgotPassword:()=>{var o;return(o=t("/resetpassword"))==null?void 0:o.catch(console.error)},onRegister:$k()?()=>{var o;return(o=t("/register"))==null?void 0:o.catch(console.error)}:void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx($a,{size:32}),s.jsx(Ie,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function FZ(){const e=Rn(),t=Mr(),[n,r]=y.useState(),[a,o]=y.useState(),[c,u]=y.useState();return y.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),o(f.query),u(JSON.parse(f.fields))},[t]),!n||!a||!c?null:s.jsx(lQ,{resourceType:n,checkboxesEnabled:!0,query:a,fields:c,onClick:f=>{var p;return(p=e(`/${n}/${f.resource.id}`))==null?void 0:p.catch(console.error)},onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{var p;(p=e(`/bulk/${n}?ids=${f.join(",")}`))==null||p.catch(console.error)}})}function am(e){const t=De(),n=Ko(t),r=Rn(),[a,o]=y.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:de.EQUALS,value:"Project/"+n},{code:"profile-type",operator:de.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(Id,{search:a,onClick:c=>{var u;return(u=r(`/admin/members/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})}function HZ(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Bots"}),s.jsx(am,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function qZ(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Clients"}),s.jsx(am,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/clients/new",children:"Create new client"})})]})}function im(e){return s.jsx(el,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{fi(t)?e.onChange(fn(t)):e.onChange(void 0)}})}function GZ(){const e=De(),t=Ko(e),[n,r]=y.useState(""),[a,o]=y.useState(""),[c,u]=y.useState(),[f,p]=y.useState(),[m,g]=y.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Create new Bot"}),s.jsxs(mt,{onSubmit:()=>{const v={name:n,description:a,accessPolicy:c};e.post("admin/projects/"+t+"/bot",v).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),_e({color:"green",message:"Bot created"})}).catch(b=>{_e({color:"red",message:Ke(b),autoClose:!1}),p(Jt(b))})},children:[!m&&s.jsxs(We,{children:[s.jsx(zt,{title:"Name",htmlFor:"name",outcome:f,children:s.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:v=>r(v.currentTarget.value),error:Nt(f,"name")})}),s.jsx(zt,{title:"Description",htmlFor:"description",outcome:f,children:s.jsx(ze,{id:"description",name:"description",onChange:v=>o(v.currentTarget.value),error:Nt(f,"description")})}),s.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(im,{name:"accessPolicy",onChange:u})}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Create Bot"})})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(Ae,{children:"Bot created"}),s.jsxs(pr,{children:[s.jsx(pr.Item,{children:s.jsx(bt,{to:m,children:"Go to new bot"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function QZ(){const e=De(),t=Ko(e),[n,r]=y.useState(""),[a,o]=y.useState(""),[c,u]=y.useState(""),[f,p]=y.useState(),[m,g]=y.useState(),[v,b]=y.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Create new Client"}),s.jsxs(mt,{onSubmit:()=>{const S={name:n,description:a,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",S).then(j=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),b(j),_e({color:"green",message:"Client created"})}).catch(j=>{_e({color:"red",message:Ke(j),autoClose:!1}),g(Jt(j))})},children:[!v&&s.jsxs(We,{children:[s.jsx(zt,{title:"Name",htmlFor:"name",outcome:m,children:s.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:S=>r(S.currentTarget.value),error:Nt(m,"name")})}),s.jsx(zt,{title:"Description",htmlFor:"description",outcome:m,children:s.jsx(ze,{id:"description",name:"description",onChange:S=>o(S.currentTarget.value),error:Nt(m,"description")})}),s.jsx(zt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:s.jsx(ze,{id:"redirectUri",name:"redirectUri",onChange:S=>u(S.currentTarget.value),error:Nt(m,"redirectUri")})}),s.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:s.jsx(im,{name:"accessPolicy",onChange:p})}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Create Client"})})]}),v&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(Ae,{children:"Client created"}),s.jsxs(pr,{children:[s.jsx(pr.Item,{children:s.jsx(bt,{to:v,children:"Go to new client"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function WZ(e){return s.jsx(el,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{fi(t)?e.onChange(fn(t)):e.onChange(void 0)}})}function YZ(){const{membershipId:e}=Qt(),t=De(),n=Ko(t),r=Rn(),a=t.get(`admin/projects/${n}/members/${e}`).read(),[o,c]=y.useState(a.accessPolicy),[u,f]=y.useState(a.userConfiguration),[p,m]=y.useState(a.admin),[g,v]=y.useState(),[b,S]=y.useState(!1);function j(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${n}/members/${e}`).then(()=>t.get(`admin/projects/${n}`,{cache:"no-cache"})).then(()=>r("/admin/project")).catch(C=>v(Jt(C)))}return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(ic,{value:a.profile,link:!0})}),s.jsxs(mt,{onSubmit:()=>{const C={...a,accessPolicy:o,userConfiguration:u,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(R=>v(Jt(R)))},children:[!b&&s.jsxs(We,{children:[s.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:s.jsx(im,{name:"accessPolicy",defaultValue:o,onChange:c})}),s.jsx(zt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:s.jsx(WZ,{name:"userConfiguration",defaultValue:u,onChange:f})}),s.jsx(zt,{title:"Admin",htmlFor:"admin",outcome:g,children:s.jsx(Qn,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),s.jsxs(Ce,{justify:"flex-end",mt:"xl",children:[s.jsx(Pe,{type:"submit",children:"Save"}),s.jsx(Pe,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(bt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function KZ(){const e=De(),[t,n]=y.useState(e.getProject()),[r,a]=y.useState(),[o,c]=y.useState(),[u,f]=y.useState(!1),[p,m]=y.useState(void 0),g=y.useCallback(v=>{const b={resourceType:v.resourceType,firstName:v.firstName,lastName:v.lastName,email:v.email,sendEmail:v.sendEmail==="on",accessPolicy:r,admin:v.isAdmin==="on",scope:v.isProjectScoped==="on"?"project":"server"};return e.invite(t==null?void 0:t.id,b).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Up(S)?c(S):m(S),f(b.sendEmail??!1),_e({color:"green",message:"Invite success"})}).catch(S=>{_e({color:"red",message:Ke(S),autoClose:!1}),c(Jt(S))})},[e,t,r]);return s.jsxs(mt,{onSubmit:g,children:[!p&&!o&&s.jsxs(We,{children:[s.jsx(Ie,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(zt,{title:"Project",htmlFor:"project",outcome:o,children:s.jsx(el,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(ln,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Nt(o,"resourceType")}),s.jsx(ze,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Nt(o,"firstName")}),s.jsx(ze,{name:"lastName",label:"Last Name",required:!0,error:Nt(o,"lastName")}),s.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,error:Nt(o,"email")}),s.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:o,children:s.jsx(im,{name:"accessPolicy",onChange:a})}),s.jsx(Qn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Qn,{name:"isAdmin",label:"Admin"}),s.jsx(Qn,{name:"isProjectScoped",label:"Project scoped"}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Or,{children:"Invite"})})]}),o&&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(bt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(Ae,{children:"User created"}),u&&s.jsx(Ae,{children:"Email sent"}),s.jsxs(pr,{children:[s.jsx(pr.Item,{children:s.jsx(bt,{to:p,children:"Go to new membership"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:p.profile,children:"Go to new profile"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function XZ(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Patients"}),s.jsx(am,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/invite",children:"Invite new patient"})})]})}function ZZ(){const e=De();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(xa,{outcome:YD});function t(n){e.post("admin/projects/setpassword",n).then(()=>_e({color:"green",message:"Done"})).catch(r=>_e({color:"red",message:Ke(r),autoClose:!1}))}return s.jsxs(ot,{width:600,children:[s.jsx(Ie,{order:1,children:"Project Admin"}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Force Set Password"}),s.jsx(Ae,{children:"Sets the password for the specified user in this project."}),s.jsx(Ae,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),s.jsx(mt,{onSubmit:t,children:s.jsxs(We,{children:[s.jsx(ze,{name:"email",label:"Email",required:!0}),s.jsx(Na,{name:"password",label:"Password",required:!0}),s.jsx(Pe,{type:"submit",children:"Force Set Password"})]})})]})}function $T(){const e=De(),t=Ko(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Details"}),s.jsxs(gb,{children:[s.jsx(Ii,{term:"ID",children:n.project.id}),s.jsx(Ii,{term:"Name",children:n.project.name})]})]})}const UT=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function JZ(){const e=Rn(),n=Mr().pathname.replace("/admin/","")||UT[0],r=De(),a=Ko(r),o=y.useMemo(()=>r.get("admin/projects/"+a).read(),[r,a]);function c(u){var f;(f=e(`/admin/${u}`))==null||f.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(mr,{children:[s.jsx(pt,{children:s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Project"}),s.jsx(pt.Value,{children:o.project.name})]})}),s.jsx(Yr,{children:s.jsx(It,{value:n.toLowerCase(),onChange:c,children:s.jsx(It.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:UT.map(u=>s.jsx(It.Tab,{value:u.toLowerCase(),children:u},u))})})})]}),s.jsx(ot,{children:s.jsx(Fb,{})})]})}function eJ(){const e=De(),t=Ko(e),n=e.get(`admin/projects/${t}`).read(),[r,a]=y.useState(!1),[o,c]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>a(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&c(Qr(n.project.secret||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>_e({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(Ie,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(Od,{property:Zs("Project","secret"),name:"secret",path:"Project.secret",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Pe,{type:"submit",children:"Save"})]})}function tJ(){const e=De(),t=Ko(e),n=e.get(`admin/projects/${t}`).read(),[r,a]=y.useState(!1),[o,c]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>a(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&c(Qr(n.project.site||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>_e({color:"green",message:"Saved"})).catch(f=>{var m,g,v,b;const p=Jt(f);_e({color:"red",message:`Error ${(g=(m=p.issue)==null?void 0:m[0].details)==null?void 0:g.text} ${(b=(v=p.issue)==null?void 0:v[0].expression)==null?void 0:b[0]}`,autoClose:!1})})},children:[s.jsx(Ie,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(Od,{property:Zs("Project","site"),name:"site",path:"Project.site",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Pe,{type:"submit",children:"Save"})]})}function nJ(){const e=De(),[t,{open:n,close:r}]=rp(!1),[a,o]=y.useState(""),[c,u]=y.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(xa,{outcome:YD});function f(){ys(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){ys(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){ys(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(A){ys(e,"Reindexing Resources","admin/super/reindex",A)}function v(){ys(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){ys(e,"Run Pending Data Migration","admin/super/migrate")}function S(A){e.post("admin/super/removebotidjobsfromqueue",A).then(()=>_e({color:"green",message:"Done"})).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))}function j(A){e.post("admin/super/purge",{...A,before:bb(A.before)}).then(()=>_e({color:"green",message:"Done"})).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))}function C(A){e.post("admin/super/setpassword",A).then(()=>_e({color:"green",message:"Done"})).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))}function R(A){e.post("fhir/R4/$db-stats",A.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:A.tableNames}]}:void 0).then(_=>{var M,L;o("Database Stats"),u(s.jsx("pre",{children:(L=(M=_.parameter)==null?void 0:M.find($=>$.name==="tableString"))==null?void 0:L.valueString})),n()}).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))}function D(){e.post("fhir/R4/$db-invalid-indexes").then(A=>{var _;o("Database Invalid Indexes"),u(s.jsx("pre",{children:(_=A.parameter)==null?void 0:_.filter(M=>M.name==="invalidIndex").map(M=>M.valueString).join(`
570
- `)})),n()}).catch(A=>_e({color:"red",message:Ke(A),autoClose:!1}))}function E(){e.post("fhir/R4/$db-schema-diff").then(A=>{var _,M;o("Schema Diff"),u(s.jsx("pre",{children:(M=(_=A.parameter)==null?void 0:_.find(L=>L.name==="migrationString"))==null?void 0:M.valueString})),n()}).catch(A=>_e({color:"red",message:Ke(A),autoClose:!1}))}function T(){ys(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return s.jsxs(ot,{width:600,children:[s.jsx(Ie,{order:1,children:"Super Admin"}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{children:s.jsx(Pe,{onClick:f,children:"Rebuild StructureDefinitions"})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{children:s.jsx(Pe,{onClick:p,children:"Rebuild SearchParameters"})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{children:s.jsx(Pe,{onClick:m,children:"Rebuild ValueSets"})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Run Pending Data Migration"}),s.jsx("p",{children:"When a Medplum version releases with data migrations to apply, you can run them here. Press this button to kick off the background data migration process."}),s.jsx(mt,{onSubmit:b,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Start Migration"})})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{onSubmit:g,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",children:s.jsx(ze,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(zt,{title:"Search Filter",htmlFor:"filter",children:s.jsx(ze,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),s.jsx(zt,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:s.jsx(rJ,{})}),s.jsx(Pe,{type:"submit",children:"Reindex"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{onSubmit:j,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(ln,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(zt,{title:"Purge Before",htmlFor:"before",children:s.jsx(oi,{name:"before",placeholder:"Before Date"})}),s.jsx(Pe,{type:"submit",children:"Purge"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(mt,{onSubmit:S,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Bot ID",children:s.jsx(ze,{name:"botId",placeholder:"Bot Id"})}),s.jsx(Pe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{onSubmit:C,children:s.jsxs(We,{children:[s.jsx(ze,{name:"email",label:"Email",required:!0}),s.jsx(Na,{name:"password",label:"Password",required:!0}),s.jsx(ze,{name:"projectId",label:"Project ID"}),s.jsx(Pe,{type:"submit",children:"Force Set Password"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(mt,{onSubmit:R,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:s.jsx(ze,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),s.jsx(Pe,{type:"submit",children:"Get Database Stats"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Database Invalid Indexes"}),s.jsx("p",{children:"Query invalid indexes from the database."}),s.jsx(mt,{onSubmit:D,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Get Database Invalid Indexes"})})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Database Schema Drift"}),s.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),s.jsxs(or,{children:[s.jsx(or.Col,{span:6,children:s.jsx(mt,{onSubmit:E,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Get Schema Drift"})})})}),s.jsx(or.Col,{span:6,children:s.jsx(mt,{onSubmit:T,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Reload Cron Resources"}),s.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),s.jsx(mt,{onSubmit:v,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Reload Cron Resources"})})}),s.jsx(Un,{opened:t,onClose:r,title:a,centered:!0,size:"auto",children:c})]})}function rJ(){const[e,t]=y.useState("outdated");return s.jsxs(s.Fragment,{children:[s.jsx(ln,{id:"reindexType",name:"reindexType",value:e,onChange:n=>t(n.target.value),data:[{label:"Outdated resources",value:"outdated"},{label:"All resources",value:"all"},{label:"Less than or equal to a specific version",value:"specific"}]}),e==="specific"&&s.jsx(kp,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function ys(e,t,n,r){const a=Date.now().toString();_e({id:a,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST",pollStatusOnAccepted:!0};r&&(o.body=JSON.stringify(r)),e.startAsyncRequest(n,o).then(c=>{var f,p,m;let u="Done";c.resourceType==="AsyncJob"?u=s.jsx(bt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&((m=(p=(f=c.issue)==null?void 0:f[0])==null?void 0:p.details)!=null&&m.text)&&(u=s.jsx(Ae,{children:c.issue[0].details.text})),ca.update({id:a,color:"green",title:t,message:u,icon:s.jsx(eo,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(c=>{ca.update({id:a,color:"red",title:t,message:Ke(c),icon:s.jsx($s,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function aJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Users"}),s.jsx(am,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/invite",children:"Invite new user"})})]})}function iJ(){const[e]=vc("ObservationDefinition","_count=100");return e?s.jsxs(Oe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var n,r,a,o;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ii,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(ii,{value:t.code})}),s.jsx("td",{children:s.jsx(ii,{value:t.method})}),s.jsx("td",{children:(a=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:a.text}),s.jsx("td",{children:(o=t.quantitativeDetails)==null?void 0:o.decimalPrecision}),s.jsx("td",{children:s.jsx(Zy,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(pa,{})}function Zy(e){const{ranges:t}=e;if(!t)return null;const n=BT(t.map(a=>a.gender));if(n.length>1)return nd(n),s.jsx(s.Fragment,{children:n.map(a=>{var o;return s.jsxs(y.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Fn(a)})}),s.jsx(Zy,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>c.gender===a)})]},a)})});const r=BT(t.map(a=>a.age&&ad(a.age)));return r.length>1?(nd(r),s.jsx(s.Fragment,{children:r.map(a=>{var o;return s.jsxs(y.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Fn(a)})}),s.jsx(Zy,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>ad(c.age)===a)})]},a)})})):s.jsx(s.Fragment,{children:t.map(a=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:a.condition}),s.jsx("td",{children:s.jsx(xb,{value:a.range})})]})})},`range-${a.condition}`))})}function BT(e){return[...new Set(e.filter(t=>!!t))]}function oJ(){const[e]=vc("ActivityDefinition","_count=100"),[t]=vc("ObservationDefinition","_count=100");return!e||!t?s.jsx(pa,{}):s.jsxs(Oe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(n=>s.jsx("th",{children:n.name},n.id))]})}),s.jsx("tbody",{children:t.map(n=>{var r;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ii,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(ii,{value:n.code})}),e.map(a=>{var o;return s.jsx("td",{children:(o=a.observationResultRequirement)!=null&&o.find(c=>{var u;return(u=c.reference)==null?void 0:u.includes(n.id)})?"✅":""},a.id)})]},n.id)})})]})}function sJ(e){var c;const t=De(),[n,r]=y.useState(),[a,o]=y.useState();return a?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(bt,{to:a,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(bt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(mt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(o).catch(console.log)},children:s.jsxs(We,{children:[s.jsxs(Ie,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(Ae,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(Ae,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(c=e.planDefinition.action)==null?void 0:c.map((u,f)=>{var p;return s.jsxs("li",{children:[((p=u.definitionCanonical)==null?void 0:p.startsWith("Questionnaire/"))&&"Questionnaire request: ",u.title&&s.jsx(s.Fragment,{children:u.title}),u.code&&s.jsx(ii,{value:u.code[0]})]},`action-${f}`)})}),s.jsx(zt,{title:"Subject",children:s.jsx(Nd,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Go"})})]})})}function lJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t});return n?s.jsx(ot,{children:s.jsx(sJ,{planDefinition:n})}):null}function cJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t}),[r,a]=vc("Questionnaire","subject-type="+e),[o,c]=vc("ClientApplication",{_count:1e3});if(!n||a||c)return s.jsx(pa,{});const u=o==null?void 0:o.filter(m=>uJ(e)&&!!m.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return s.jsxs(ot,{children:[s.jsx(Ie,{children:"Apps"}),s.jsxs("p",{children:["No apps found. Contact your administrator or ",s.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,p;return n.resourceType==="Patient"?f=fn(n):n.resourceType==="Encounter"&&(f=n.subject,p=fn(n)),s.jsxs(ot,{children:[r==null?void 0:r.map(m=>s.jsxs("div",{children:[s.jsx(Ie,{order:3,children:s.jsx(bt,{to:`/forms/${m.id}?subject=${Lt(n)}`,children:m.title||m.name})}),s.jsx(Ae,{children:m.description})]},m.id)),u==null?void 0:u.map(m=>s.jsxs("div",{children:[s.jsx(Ie,{order:3,children:s.jsx(uY,{client:m,patient:f,encounter:p,children:m.name})}),s.jsx(Ae,{children:m.description})]},m.id))]})}function uJ(e){return e==="Patient"||e==="Encounter"}function dJ(){const{resourceType:e,id:t}=Qt(),n=Rn(),[r,a]=y.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:de.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(ot,{children:s.jsx(Id,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>a(o.definition),hideFilters:!0})})}function fJ(){const e=De(),{resourceType:t,id:n}=Qt(),r=e.readHistory(t,n).read();return s.jsx(ot,{children:s.jsx(JW,{history:r})})}const hJ="_hl7Input_k5xm3_1",pJ={hl7Input:hJ};function mJ(e){return s.jsx("iframe",{title:"Bot Runner",frameBorder:"0",src:"https://codeeditor.medplum.com/bot-runner.html",className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function gJ(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),s.jsx("iframe",{title:"Code Editor",frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Gu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const vJ=`{
571
- "resourceType": "Patient",
572
- "name": [
573
- {
574
- "given": [
575
- "Alice"
576
- ],
577
- "family": "Smith"
578
- }
579
- ]
580
- }`,yJ="MSH|^~\\&|ADT1|MCM|LABADT|MCM|198808181126|SECURITY|ADT|MSG00001|P|2.1\rPID|||PATID1234^5^M11||JONES^WILLIAM^A^III||19610615|M-||C|1200 N ELM STREET^^GREENSBORO^NC^27401-1020|GL|(919)379-1212|(919)271-3434||S||PATID12345001^2^M10|123456789|987654^NC\rNK1|1|JONES^BARBARA^K|SPO|||||20011105\rPV1|1|I|2000^2012^01||||004777^LEBAUER^SIDNEY^J.|||SUR||-||1|A0-";function xJ(){const e=De(),{id:t}=Qt(),[n,r]=y.useState(),[a,o]=y.useState(),[c,u]=y.useState(vJ),[f,p]=y.useState(yJ),[m,g]=y.useState(dn.FHIR_JSON),v=y.useRef(null),b=y.useRef(null),[S,j]=y.useState(!1);y.useEffect(()=>{e.readResource("Bot",t).then(async _=>{r(_),o(await bJ(e,_))}).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))},[e,t]);const C=y.useCallback(async()=>Gu(v.current,{command:"getValue"}),[]),R=y.useCallback(async()=>Gu(v.current,{command:"getOutput"}),[]),D=y.useCallback(async()=>m===dn.FHIR_JSON?JSON.parse(c):f,[m,c,f]),E=y.useCallback(async _=>{_.preventDefault(),_.stopPropagation(),j(!0);try{const M=await C(),L=await R(),$=await e.createAttachment({data:M,filename:"index.ts",contentType:"text/typescript"}),V=await e.createAttachment({data:L,filename:"index.js",contentType:"text/typescript"}),Y=[{op:"add",path:"/sourceCode",value:$},{op:"add",path:"/executableCode",value:V}];await e.patchResource("Bot",t,Y),_e({color:"green",message:"Saved"})}catch(M){_e({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t,C,R]),T=y.useCallback(async _=>{_.preventDefault(),_.stopPropagation(),j(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),_e({color:"green",message:"Deployed"})}catch(M){_e({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t]),A=y.useCallback(async _=>{_.preventDefault(),_.stopPropagation(),j(!0);try{const M=await D(),L=await e.post(e.fhirUrl("Bot",t,"$execute"),M,m);await Gu(b.current,{command:"setValue",value:L}),_e({color:"green",message:"Success"})}catch(M){_e({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t,D,m]);return!n||a===void 0?null:s.jsxs(or,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(or.Col,{span:8,children:s.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(gJ,{iframeRef:v,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:a,minHeight:"528px"}),s.jsxs(Ce,{justify:"flex-end",gap:"xs",children:[s.jsx(Pe,{type:"button",onClick:E,loading:S,leftSection:s.jsx(kV,{size:"1rem"}),children:"Save"}),s.jsx(Pe,{type:"button",onClick:T,loading:S,leftSection:s.jsx(sb,{size:"1rem"}),children:"Deploy"}),s.jsx(Pe,{type:"button",onClick:A,loading:S,leftSection:s.jsx(qV,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(or.Col,{span:4,children:[s.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(ln,{data:[{label:"FHIR",value:dn.FHIR_JSON},{label:"HL7",value:dn.HL7_V2}],onChange:_=>g(_.currentTarget.value)}),m===dn.FHIR_JSON?s.jsx(Tc,{value:c,onChange:_=>u(_),autosize:!0,minRows:15}):s.jsx("textarea",{className:pJ.hl7Input,value:f,onChange:_=>p(_.currentTarget.value),rows:15})]}),s.jsx(mr,{m:2,p:"xs",shadow:"md",children:s.jsx(mJ,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function bJ(e,t){var n,r,a;if((n=t.sourceCode)!=null&&n.url){const o=(a=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:a.find(uA);return(await e.download(e.fhirUrl("Binary",o))).text()}return t.code??""}function rl(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function SJ(){const e=De(),{resourceType:t,id:n}=Qt(),r={reference:t+"/"+n},a=y.useCallback(o=>{e.updateResource(rl(o)).then(()=>{_e({color:"green",message:"Success"})}).catch(c=>{_e({color:"red",message:Ke(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(ot,{children:s.jsx(TQ,{value:r,onSubmit:a})});case"Questionnaire":return s.jsx(ot,{children:s.jsx(uW,{questionnaire:r,onSubmit:a})});default:return null}}function wJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t}),r=Rn();return n?s.jsx(ot,{children:s.jsx(MW,{value:n,onStart:(a,o)=>{var c;return(c=r(`/forms/${Is(o)}`))==null?void 0:c.catch(console.error)},onEdit:(a,o,c)=>{var u;return(u=r(`/${c.reference}}`))==null?void 0:u.catch(console.error)}})}):null}function jJ(){const e=De(),{resourceType:t,id:n}=Qt(),r=Rn();return s.jsxs(ot,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(Pe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>{var a;return(a=r(`/${t}`))==null?void 0:a.catch(console.error)}).catch(a=>_e({color:"red",message:Ke(a),autoClose:!1}))},children:"Delete"})]})}const CJ="_selectProfileBtn_tbaz6_1",EJ="_chevron_tbaz6_13",VT={selectProfileBtn:CJ,chevron:EJ};function TJ(){var f,p;const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t}),[r,a]=y.useState(),o=gd({onDropdownClose:()=>o.resetSelectedOption()}),c=y.useMemo(()=>{var m;if(En((m=n==null?void 0:n.meta)==null?void 0:m.profile))return[s.jsx(ct.Option,{value:"",children:"None"},""),...n.meta.profile.map(g=>s.jsx(ct.Option,{value:g,children:g},g))]},[(f=n==null?void 0:n.meta)==null?void 0:f.profile]);if(y.useEffect(()=>{var m,g;((g=(m=n==null?void 0:n.meta)==null?void 0:m.profile)==null?void 0:g.length)===1&&a(n.meta.profile[0])},[(p=n==null?void 0:n.meta)==null?void 0:p.profile]),!n)return null;let u;return En(c)&&(u=s.jsx(Ce,{justify:"flex-end",children:s.jsxs(We,{align:"flex-end",gap:"xs",children:[s.jsxs(ct,{store:o,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:m=>{a(m),o.closeDropdown()},children:[s.jsx(ct.Target,{children:s.jsx(tr,{onClick:()=>o.toggleDropdown(),children:s.jsxs(r0,{fw:"bold",fs:"sm",className:VT.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(ob,{stroke:1.5,className:VT.chevron})]})})}),s.jsx(ct.Dropdown,{w:"max-content",children:s.jsx(ct.Options,{children:c})})]}),s.jsx(ce,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(Ae,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(Ae,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(Ae,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(ot,{children:s.jsxs(We,{gap:"xl",children:[u,s.jsx(Rb,{value:n,profileUrl:r})]})})}function RJ(){const e=De(),{resourceType:t,id:n}=Qt(),[r,a]=y.useState(),[o,c]=y.useState(),u=Rn(),[f,p]=y.useState();y.useEffect(()=>{e.readResource(t,n).then(b=>{a(Qr(b)),c(Qr(b))}).catch(b=>{p(Jt(b)),_e({color:"red",message:Ke(b),autoClose:!1})})},[e,t,n]);const m=y.useCallback(b=>{p(void 0),e.updateResource(rl(b)).then(()=>{var S;(S=u(`/${t}/${n}/details`))==null||S.catch(console.error),_e({id:"succes",color:"green",message:"Success"})}).catch(S=>{p(Jt(S)),_e({color:"red",message:Ke(S),autoClose:!1})})},[e,t,n,u]),g=y.useCallback(b=>{p(void 0);const S=T_.createPatch(r,b);e.patchResource(t,n,S).then(()=>{var j;(j=u(`/${t}/${n}/details`))==null||j.catch(console.error),_e({id:"succes",color:"green",message:"Success"})}).catch(j=>{p(Jt(j)),_e({color:"red",message:Ke(j),autoClose:!1})})},[e,t,n,r,u]),v=y.useCallback(()=>{var b;return(b=u(`/${t}/${n}/delete`))==null?void 0:b.catch(console.error)},[u,t,n]);return o?s.jsx(ot,{children:s.jsx(Gh,{defaultValue:o,onSubmit:m,onPatch:g,onDelete:v,outcome:f})}):null}function DJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t});return n?s.jsx(ot,{maw:700,children:n.resourceType==="Patient"?s.jsx(bQ,{patient:n}):s.jsx(Yi,{icon:s.jsx(Js,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function Bk({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,a=De(),[o,c]=y.useState();return y.useEffect(()=>{a.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(u=>{c(u.filter(VH))}).catch(console.error)},[a,n,r]),s.jsx(It,{value:t==null?void 0:t.url,onChange:u=>{const f=o==null?void 0:o.find(p=>p.url===u);f&&n(f)},children:s.jsx(It.List,{children:o==null?void 0:o.map(u=>{var m,g;const f=(g=(m=e.meta)==null?void 0:m.profile)==null?void 0:g.includes(u.url),p=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return s.jsx(It.Tab,{value:u.url,title:p,rightSection:f&&s.jsx(z0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(iF,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function Vk(e,t){const n=De(),r=Rn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Jt(u)),_e({color:"red",message:Ke(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function iy(){const{resourceType:e}=Qt(),t=Mr(),[n,r]=y.useState(),{defaultValue:a,handleSubmit:o}=Vk(e,r),[c,u]=y.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=y.useCallback(m=>{const g=rl(m);c&&mA(g,c.url),o(g)},[c,o]);return f?s.jsx(ot,{children:s.jsxs(We,{children:[s.jsx(Bk,{resource:a,currentProfile:c,onChange:u}),c?s.jsx(Gh,{defaultValue:a,onSubmit:p,outcome:n,profileUrl:c.url},c.url):s.jsx(Ae,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(ot,{children:s.jsx(Gh,{defaultValue:a,onSubmit:o,outcome:n})})}function AJ(){const e=De(),{resourceType:t,id:n}=Qt(),r=e.readHistory(t,n).read();return s.jsx(ot,{children:s.jsx(oY,{history:r})})}function _J(){const{resourceType:e}=Qt(),[t,n]=y.useState(),{defaultValue:r,handleSubmit:a}=Vk(e,n),o=y.useCallback(c=>{a(JSON.parse(c["new-resource"]))},[a]);return s.jsxs(ot,{children:[t&&s.jsx(xa,{outcome:t}),s.jsxs(mt,{onSubmit:o,children:[s.jsx(Tc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Ia(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"OK"})})]})]})}function kJ(){const e=De(),{resourceType:t,id:n}=Qt(),r=Yt({reference:t+"/"+n}),a=Rn(),[o,c]=y.useState(),u=y.useCallback(f=>{e.updateResource(rl(JSON.parse(f.resource))).then(()=>{var p;c(void 0),(p=a(`/${t}/${n}/details`))==null||p.catch(console.error),_e({color:"green",message:"Success"})}).catch(p=>{_e({color:"red",message:Ke(p),autoClose:!1})})},[e,t,n,a]);return r?s.jsxs(ot,{children:[o&&s.jsx(xa,{outcome:o}),s.jsxs(mt,{onSubmit:u,children:[s.jsx(Tc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Ia(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"OK"})})]})]}):null}function PJ(){const{resourceType:e,id:t}=Qt();return Yt({reference:e+"/"+t})?s.jsxs(ot,{children:[s.jsxs(Yi,{icon:s.jsx(Js,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Pt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(X_,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function NJ(){const e=De(),{resourceType:t,id:n}=Qt(),[r,a]=y.useState(),[o,c]=y.useState();return y.useEffect(()=>{e.readResource(t,n).then(u=>a(Qr(u))).catch(u=>{_e({color:"red",message:Ke(u)})})},[e,t,n]),r?s.jsxs(ot,{children:[s.jsxs(Ie,{order:2,children:["Available ",t," profiles"]}),s.jsx(We,{children:s.jsxs(s.Fragment,{children:[s.jsx(Bk,{resource:r,currentProfile:o,onChange:c}),o?s.jsx(OJ,{profile:o,resource:r,onResourceUpdated:u=>a(u)},o.url):s.jsx(Ae,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const OJ=({profile:e,resource:t,onResourceUpdated:n})=>{const r=De(),[a,o]=y.useState(),[c,u]=y.useState(()=>{var p,m;return(m=(p=t.meta)==null?void 0:p.profile)==null?void 0:m.includes(e.url)}),f=y.useCallback(p=>{o(void 0);const m=rl(p);c?mA(m,e.url):z$(m,e.url),r.updateResource(m).then(g=>{n(g),_e({color:"green",message:"Success"})}).catch(g=>{o(Jt(g)),_e({color:"red",message:Ke(g),autoClose:!1})})},[r,e.url,n,c]);return s.jsxs(We,{children:[s.jsx(wd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>u(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?s.jsx(Gh,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:a}):s.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"OK"})})})]})},Fk={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},MJ=Object.keys(Fk);function IJ(){const e=De(),{id:t}=Qt(),n=Yt({reference:`Questionnaire/${t}`}),[r,a]=y.useState(),[o,c]=y.useState("create"),[u,f]=y.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>LJ(g,n));function m(){r&&n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${r.name} to questionnaire responses`,criteria:`QuestionnaireResponse?questionnaire=${n.url?`${n.url},${Lt(n)}`:Lt(n)}`,channel:{type:"rest-hook",endpoint:Lt(r)},...o?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:o}]}:void 0}).then(()=>{a(void 0),f(Date.now()),e.invalidateSearches("Subscription"),_e({color:"green",message:"Success"})}).catch(g=>_e({color:"red",message:Ke(g),autoClose:!1}))}return s.jsxs(ot,{children:[s.jsx(Ie,{children:"Bots"}),s.jsxs(We,{children:[p.length===0&&s.jsx("p",{children:"No bots found."}),p.map(g=>{var v;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Mc,{value:{reference:(v=g.channel)==null?void 0:v.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id)})]}),s.jsx(jn,{}),s.jsxs(We,{mt:10,children:[s.jsx(fd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),s.jsxs(Ce,{children:[s.jsx(el,{name:"bot",resourceType:"Bot",onChange:g=>a(g)}),s.jsx(Pe,{onClick:m,children:"Connect"})]}),s.jsx(Ce,{children:s.jsx(ln,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:MJ,onChange:g=>c(Fk[g.target.value])})})]}),s.jsx("div",{style:{display:"none"},children:u})]})}function LJ(e,t){var a;if(!t)return!1;const n=e.criteria||"",r=((a=e.channel)==null?void 0:a.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(Lt(t))||(t.url?n.includes(t.url):!1))}function zJ(){const{id:e}=Qt(),t=Rn(),r=De().readReference({reference:`Questionnaire/${e}`}).read(),[a,o]=y.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:de.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return s.jsx(ot,{children:s.jsx(Id,{search:a,onClick:c=>{var u;return(u=t(`/${c.resource.resourceType}/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})})}function $J(){const e=De(),{resourceType:t,id:n}=Qt(),r=Yt({reference:t+"/"+n}),a=y.useCallback(o=>{e.updateResource(rl(o)).then(()=>{_e({color:"green",message:"Success"})}).catch(c=>{_e({color:"red",message:Ke(c),autoClose:!1})})},[e]);return r?s.jsx(ot,{children:s.jsx(RW,{onSubmit:a,definition:r})}):null}function UJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t});return n?s.jsx(ot,{children:e==="MeasureReport"?s.jsx(yQ,{measureReport:n}):s.jsx(Tb,{value:n})}):null}const BJ="_container_1ue98_1",VJ="_entry_1ue98_14",FJ="_active_1ue98_21",oy={container:BJ,entry:VJ,active:FJ};function HJ(e){const t=De(),n=Yt(e.value),[r,a]=y.useState();return y.useEffect(()=>{if(!n)return;const o=Kb(n);if(!o)return;const c="reference"in o?o.reference:Lt(o);t.search("ServiceRequest","subject="+c).then(u=>{const p=(u.entry??[]).map(m=>m.resource);R_(p),p.reverse(),a(p)}).catch(u=>_e({color:"red",message:Ke(u),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:oy.container,children:r.map(o=>{var c,u,f,p,m,g,v;return s.jsxs("div",{className:$t(oy.entry,{[oy.active]:o.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(bt,{to:o,children:qJ(o)})}),((u=(c=o.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(f=o.category[0])==null?void 0:f.text}),((g=(m=(p=o.code)==null?void 0:p.coding)==null?void 0:m[0])==null?void 0:g.code)&&s.jsx("p",{children:(v=o.code.coding[0])==null?void 0:v.code}),s.jsx("p",{children:GJ(o)})]},o.id)})}):null}function qJ(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function GJ(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const QJ="_container_1l2dh_1",WJ={container:QJ};function YJ(e){var a,o,c,u;const t=Yt(e.valueSet);if(!t)return null;const n=[""],r=(u=(c=(o=(a=t.compose)==null?void 0:a.include)==null?void 0:o[0])==null?void 0:c.concept)==null?void 0:u.map(f=>f.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:WJ.container,children:s.jsx(ln,{defaultValue:e.defaultValue,onChange:f=>e.onChange(f.currentTarget.value),data:n})})}function KJ(e){var n,r;const t=Yt(e.specimen);return t?s.jsxs(pt,{children:[s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Type"}),s.jsx(pt.Value,{children:"Specimen"})]}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Collected"}),s.jsx(pt.Value,{children:gr((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Specimen Age"}),s.jsx(pt.Value,{children:XJ(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Specimen Stability"}),s.jsx(pt.Value,{children:ZJ(t)})]}):s.jsx(s.Fragment,{})]}):null}function XJ(e){var a;const t=(a=e.collection)==null?void 0:a.collectedDateTime;if(!t)return;const n=new Date(t);return Hk(qk(n,new Date))}function ZJ(e){var r;if(!((r=e.collection)!=null&&r.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return Hk(qk(t,n))}function Hk(e){return e.toString().padStart(3,"0")+"D"}function qk(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function JJ(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),e==="Agent"&&t.push("Tools"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),e==="Patient"&&t.push("Export"),t}function eee(){var D,E,T,A,_,M,L;const e=De(),{resourceType:t,id:n}=Qt(),r={reference:t+"/"+n},a=Rn(),[o,c]=y.useState(),u=Yt(r,c),f=JJ(t),[p,m]=y.useState(()=>{const $=window.location.pathname.split("/").pop();return $&&f.map(V=>V.toLowerCase()).includes($)?$:f[0].toLowerCase()});async function g(){var Y,W;const V=(W=(Y=(await e.readHistory(t,n)).entry)==null?void 0:Y.find(G=>!!G.resource))==null?void 0:W.resource;V?v(V):_e({color:"red",message:"No history to restore",autoClose:!1})}function v($){e.updateResource(rl($)).then(()=>{c(void 0),_e({color:"green",message:"Success"})}).catch(V=>{_e({color:"red",message:Ke(V),autoClose:!1})})}if(o)return Gz(o)?s.jsxs(ot,{children:[s.jsx(Ie,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(Pe,{color:"red",onClick:g,children:"Restore"})]}):s.jsx(xa,{outcome:o});function b($){var V;$||($=f[0].toLowerCase()),m($),(V=a(`/${t}/${n}/${$}`))==null||V.catch(console.error)}function S($){const V=u,Y=V.orderDetail||[];Y.length===0&&Y.push({}),Y[0].text!==$&&(Y[0].text=$,v({...V,orderDetail:Y}))}const j=u&&Kb(u),C=u&&CZ(u),R=(T=(E=(D=e.getUserConfiguration())==null?void 0:D.option)==null?void 0:E.find($=>$.id==="statusValueSet"))==null?void 0:T.valueString;return s.jsxs(s.Fragment,{children:[(u==null?void 0:u.resourceType)==="ServiceRequest"&&R&&s.jsx(YJ,{valueSet:{reference:R},defaultValue:(_=(A=u.orderDetail)==null?void 0:A[0])==null?void 0:_.text,onChange:S},Lt(u)+"-"+((L=(M=u.orderDetail)==null?void 0:M[0])==null?void 0:L.text)),u&&s.jsx(HJ,{value:u}),u&&s.jsxs(mr,{children:[j&&s.jsx(M_,{patient:j}),C&&s.jsx(KJ,{specimen:C}),t!=="Patient"&&s.jsx(Lk,{resource:r}),s.jsx(Yr,{children:s.jsx(It,{value:p.toLowerCase(),onChange:b,children:s.jsx(It.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map($=>s.jsx(It.Tab,{value:$.toLowerCase(),children:$},$))})})})]}),s.jsx(Fb,{})]})}function FT(){var R,D,E,T;const e=Rn(),{resourceType:t,id:n,versionId:r,tab:a}=Qt(),o=De(),[c,u]=y.useState(!0),[f,p]=y.useState(),[m,g]=y.useState();if(y.useEffect(()=>{g(void 0),u(!0),o.readHistory(t,n).then(A=>p(A)).then(()=>u(!1)).catch(A=>{g(A),u(!1)})},[o,t,n]),c)return s.jsx(pa,{});if(!f)return s.jsxs(ot,{children:[s.jsx(Ie,{children:"Resource not found"}),s.jsx(bt,{to:`/${t}`,children:"Return to search page"})]});const v=f.entry??[],b=v.findIndex(A=>{var _,M;return((M=(_=A.resource)==null?void 0:_.meta)==null?void 0:M.versionId)===r});if(b===-1)return s.jsxs(ot,{children:[s.jsx(Ie,{children:"Version not found"}),s.jsx(bt,{to:`/${t}/${n}`,children:"Return to resource"})]});const S=v[b].resource,j=b<v.length-1?v[b+1].resource:void 0,C="diff";return s.jsxs(It,{value:a||C,onChange:A=>{var _;return(_=e(`/${t}/${n}/_history/${r}/${A||C}`))==null?void 0:_.catch(console.error)},children:[s.jsxs(mr,{children:[s.jsx(kd,{fluid:!0,p:"md",children:s.jsx(Ae,{children:`${t} ${n}`})}),s.jsxs(It.List,{children:[s.jsx(It.Tab,{value:"diff",children:"Diff"}),s.jsx(It.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(ot,{children:[m&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),s.jsx(It.Panel,{value:"diff",children:j?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(R=S.meta)==null?void 0:R.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(bt,{to:`/${t}/${n}/_history/${(D=j.meta)==null?void 0:D.versionId}`,children:(E=j.meta)==null?void 0:E.versionId})]})]}),s.jsx(nY,{original:j,revised:S})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(T=S.meta)==null?void 0:T.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(S,void 0,2)})]})}),s.jsx(It.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(S,void 0,2)})})]})]})}function tee(){const{resourceType:e,id:t}=Qt(),n=Rn(),[r,a]=y.useState({resourceType:"Subscription",filters:[{code:"url",operator:de.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(ot,{children:s.jsx(nQ,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>a(o.definition),hideFilters:!0})})}function nee(e){const t=De(),{resource:n,opened:r,onClose:a}=e,[o,c]=y.useState(!1),[u,f]=y.useState(),[p,m]=y.useState(!1),g=y.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:o&&u?Lt(u):void 0,verbose:p}),_e({color:"green",message:"Done"}),a()}catch(v){_e({color:"red",message:Ke(v),autoClose:!1})}},[t,n,a,o,u,p]);return s.jsx(Un,{opened:r,onClose:a,title:"Resend Subscriptions",children:s.jsx(mt,{onSubmit:g,children:s.jsxs(We,{children:[s.jsx(Qn,{label:"Choose subscription (all subscriptions by default)",onChange:v=>c(v.currentTarget.checked)}),o&&s.jsx(el,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),s.jsx(Qn,{label:"Verbose mode",onChange:v=>m(v.currentTarget.checked)}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Resend"})})]})})})}function HT(){const e=De(),t=Wp(),{resourceType:n,id:r}=Qt(),a={reference:n+"/"+r},[o,c]=y.useState(),u=rp(!1);function f(D,E){return e.updateResource({...D,priority:E})}function p(D,E){f(D,"stat").then(E).catch(console.error)}function m(D,E){f(D,"routine").then(E).catch(console.error)}function g(D){t(`/${D.resourceType}/${D.id}`)}function v(D){t(`/${D.resourceType}/${D.id}/edit`)}function b(D){t(`/${D.resourceType}/${D.id}/delete`)}function S(D){c(D),u[1].open()}function j(D){var E;t(`/${D.resourceType}/${D.id}/_history/${(E=D.meta)==null?void 0:E.versionId}`)}function C(D,E){const T="aws-textract";_e({id:T,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(D.resourceType,D.id,"$aws-textract"),{}).then(()=>{E(),Ts({id:T,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:s.jsx(eo,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(A=>Ts({id:T,title:"AWS Textract Error",color:"red",message:Ke(A),icon:s.jsx($s,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function R(D){var P;const{primaryResource:E,currentResource:T,reloadTimeline:A}=D,_=T.resourceType===E.resourceType&&T.id===E.id,M=T.resourceType==="Communication"&&T.priority!=="stat",L=T.resourceType==="Communication"&&T.priority==="stat",$=_,V=!_,Y=!_,W=!_,G=(P=e.getProjectMembership())==null?void 0:P.admin,X=G,Z=IZ()&&(T.resourceType==="DocumentReference"||T.resourceType==="Media");return s.jsxs(je.Dropdown,{children:[s.jsx(je.Label,{children:"Resource"}),M&&s.jsx(je.Item,{leftSection:s.jsx(FV,{size:14}),onClick:()=>p(T,A),"aria-label":`Pin ${Lt(T)}`,children:"Pin"}),L&&s.jsx(je.Item,{leftSection:s.jsx(HV,{size:14}),onClick:()=>m(T,A),"aria-label":`Unpin ${Lt(T)}`,children:"Unpin"}),V&&s.jsx(je.Item,{leftSection:s.jsx(RE,{size:14}),onClick:()=>g(T),"aria-label":`Details ${Lt(T)}`,children:"Details"}),$&&s.jsx(je.Item,{leftSection:s.jsx(RE,{size:14}),onClick:()=>j(T),"aria-label":`Details ${Lt(T)}`,children:"Details"}),Y&&s.jsx(je.Item,{leftSection:s.jsx(HA,{size:14}),onClick:()=>v(T),"aria-label":`Edit ${Lt(T)}`,children:"Edit"}),G&&s.jsxs(s.Fragment,{children:[s.jsx(je.Divider,{}),s.jsx(je.Label,{children:"Admin"}),X&&s.jsx(je.Item,{leftSection:s.jsx(YV,{size:14}),onClick:()=>S(T),"aria-label":`Resend Subscriptions ${Lt(T)}`,children:"Resend Subscriptions"})]}),Z&&s.jsxs(s.Fragment,{children:[s.jsx(je.Divider,{}),s.jsx(je.Label,{children:"AWS AI"}),s.jsx(je.Item,{leftSection:s.jsx(rF,{size:14}),onClick:()=>C(T,A),"aria-label":`AWS Textract ${Lt(T)}`,children:"AWS Textract"})]}),W&&s.jsxs(s.Fragment,{children:[s.jsx(je.Divider,{}),s.jsx(je.Label,{children:"Danger zone"}),s.jsx(je.Item,{color:"red",leftSection:s.jsx(ub,{size:14}),onClick:()=>b(T),"aria-label":`Delete ${Lt(T)}`,children:"Delete"})]})]})}return s.jsxs(s.Fragment,{children:[n==="Encounter"&&s.jsx(uG,{encounter:a,getMenu:R}),n==="Patient"&&s.jsx(jQ,{patient:a,getMenu:R}),n==="ServiceRequest"&&s.jsx(cY,{serviceRequest:a,getMenu:R}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&s.jsx(cG,{resource:a,getMenu:R}),s.jsx(nee,{resource:o,opened:u[0],onClose:u[1].close},`resend-subscriptions-${o==null?void 0:o.id}`)]})}function ree(e){const{opened:t,close:n,version:r,loadingStatus:a,handleStatus:o,handleUpgrade:c}=e,[u,f]=y.useState();return y.useEffect(()=>{t&&(u||rV("app-tools-page").then(f).catch(console.error),o())},[t,u,o]),u&&r&&!a?r==="unknown"?s.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(u)?s.jsxs("p",{children:["This agent is already on the latest version (",u,")."]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",u,"?"]}),s.jsx(Pe,{onClick:()=>{c(),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"})]}):s.jsx(pa,{})}function aee(){const e=De(),{id:t}=Qt(),n=y.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,a]=y.useState(!1),[o,c]=y.useState(!1),[u,f]=y.useState(!1),[p,m]=y.useState(),[g,v]=y.useState(),[b,S]=y.useState(),[j,C]=y.useState(),[R,D]=y.useState(!1),[E,T]=y.useState(!1),[A,{open:_,close:M}]=rp(!1);y.useEffect(()=>{if(r||o||u||R){T(!0);return}T(!1)},[r,o,u,R]);const L=y.useCallback(()=>{a(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(X=>{var Z,P,I,z,F,O;m((P=(Z=X.parameter)==null?void 0:Z.find(U=>U.name==="status"))==null?void 0:P.valueCode),v((z=(I=X.parameter)==null?void 0:I.find(U=>U.name==="version"))==null?void 0:z.valueString),S((O=(F=X.parameter)==null?void 0:F.find(U=>U.name==="lastUpdated"))==null?void 0:O.valueInstant)}).catch(X=>G(Ke(X))).finally(()=>a(!1))},[e,t]),$=y.useCallback(X=>{const Z=X.host,P=X.pingCount||1;Z&&(D(!0),e.pushToAgent(n,Z,`PING ${P}`,dn.PING,!0).then(I=>C(I)).catch(I=>G(Ke(I))).finally(()=>D(!1)))},[e,n]),V=y.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(X=>{W("Agent config reloaded successfully.")}).catch(X=>G(Ke(X))).finally(()=>c(!1))},[e,t]),Y=y.useCallback(()=>{f(!0),e.get(e.fhirUrl("Agent",t,"$upgrade"),{cache:"reload"}).then(X=>{W("Agent upgraded successfully.")}).catch(X=>G(Ke(X))).finally(()=>f(!1))},[e,t]);function W(X){_e({color:"green",title:"Success",icon:s.jsx(eo,{size:"1rem"}),message:X})}function G(X){_e({color:"red",title:"Error",message:X,autoClose:!1})}return s.jsxs(ot,{children:[s.jsx(Un,{opened:A,onClose:M,title:"Upgrade Agent",centered:!0,children:s.jsx(ree,{opened:A,close:M,version:g,loadingStatus:r,handleStatus:L,handleUpgrade:Y})}),s.jsx(Ie,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(Mc,{value:n,link:!0})]}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Agent Status"}),s.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),s.jsx(Pe,{onClick:L,loading:r,disabled:E&&!r,children:"Get Status"}),!r&&p&&s.jsx(Oe,{children:s.jsxs(Oe.Tbody,{children:[s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:"Status"}),s.jsx(Oe.Td,{children:s.jsx(Eb,{status:p})})]}),s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:"Version"}),s.jsx(Oe.Td,{children:g})]}),s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:"Last Updated"}),s.jsx(Oe.Td,{children:gr(b,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Reload Config"}),s.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),s.jsx(Pe,{onClick:V,loading:o,disabled:E&&!o,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Upgrade Agent"}),s.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),s.jsx(Pe,{onClick:_,loading:u,disabled:E&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Ping from Agent"}),s.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),s.jsx(mt,{onSubmit:$,children:s.jsxs(Ce,{children:[s.jsx(ze,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(_n,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:R,disabled:E&&!R,children:s.jsx(XV,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(kp,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!R&&j&&s.jsxs(s.Fragment,{children:[s.jsx(Ie,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:j})]})]})}function iee(){return s.jsx(BK,{children:s.jsxs(qe,{errorElement:s.jsx(jZ,{}),children:[s.jsx(qe,{path:"/signin",element:s.jsx(VZ,{})}),s.jsx(qe,{path:"/oauth",element:s.jsx(LZ,{})}),s.jsx(qe,{path:"/resetpassword",element:s.jsx($Z,{})}),s.jsx(qe,{path:"/setpassword/:id/:secret",element:s.jsx(BZ,{})}),s.jsx(qe,{path:"/register",element:s.jsx(zZ,{})}),s.jsx(qe,{path:"/changepassword",element:s.jsx(bZ,{})}),s.jsx(qe,{path:"/security",element:s.jsx(UZ,{})}),s.jsx(qe,{path:"/mfa",element:s.jsx(MZ,{})}),s.jsx(qe,{path:"/batch",element:s.jsx(yZ,{})}),s.jsx(qe,{path:"/bulk/:resourceType",element:s.jsx(xZ,{})}),s.jsx(qe,{path:"/smart",element:s.jsx(FZ,{})}),s.jsx(qe,{path:"/forms/:id",element:s.jsx(EZ,{})}),s.jsx(qe,{path:"/admin/super",element:s.jsx(nJ,{})}),s.jsx(qe,{path:"/admin/config",element:s.jsx(ZZ,{})}),s.jsxs(qe,{path:"/admin",element:s.jsx(JZ,{}),children:[s.jsx(qe,{path:"patients",element:s.jsx(XZ,{})}),s.jsx(qe,{path:"bots/new",element:s.jsx(GZ,{})}),s.jsx(qe,{path:"bots",element:s.jsx(HZ,{})}),s.jsx(qe,{path:"clients/new",element:s.jsx(QZ,{})}),s.jsx(qe,{path:"clients",element:s.jsx(qZ,{})}),s.jsx(qe,{path:"details",element:s.jsx($T,{})}),s.jsx(qe,{path:"invite",element:s.jsx(KZ,{})}),s.jsx(qe,{path:"users",element:s.jsx(aJ,{})}),s.jsx(qe,{path:"project",element:s.jsx($T,{})}),s.jsx(qe,{path:"secrets",element:s.jsx(eJ,{})}),s.jsx(qe,{path:"sites",element:s.jsx(tJ,{})}),s.jsx(qe,{path:"members/:membershipId",element:s.jsx(YZ,{})})]}),s.jsx(qe,{path:"/lab/assays",element:s.jsx(iJ,{})}),s.jsx(qe,{path:"/lab/panels",element:s.jsx(oJ,{})}),s.jsx(qe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(FT,{})}),s.jsx(qe,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(FT,{})}),s.jsxs(qe,{path:"/:resourceType/new",element:s.jsx(wZ,{}),children:[s.jsx(qe,{index:!0,element:s.jsx(iy,{})}),s.jsx(qe,{path:"form",element:s.jsx(iy,{})}),s.jsx(qe,{path:"json",element:s.jsx(_J,{})}),s.jsx(qe,{path:"profiles",element:s.jsx(iy,{})})]}),s.jsxs(qe,{path:"/:resourceType/:id",element:s.jsx(eee,{}),children:[s.jsx(qe,{index:!0,element:s.jsx(HT,{})}),s.jsx(qe,{path:"apply",element:s.jsx(lJ,{})}),s.jsx(qe,{path:"apps",element:s.jsx(cJ,{})}),s.jsx(qe,{path:"event",element:s.jsx(dJ,{})}),s.jsx(qe,{path:"blame",element:s.jsx(fJ,{})}),s.jsx(qe,{path:"bots",element:s.jsx(IJ,{})}),s.jsx(qe,{path:"builder",element:s.jsx(SJ,{})}),s.jsx(qe,{path:"checklist",element:s.jsx(wJ,{})}),s.jsx(qe,{path:"delete",element:s.jsx(jJ,{})}),s.jsx(qe,{path:"details",element:s.jsx(TJ,{})}),s.jsx(qe,{path:"edit",element:s.jsx(RJ,{})}),s.jsx(qe,{path:"editor",element:s.jsx(xJ,{})}),s.jsx(qe,{path:"history",element:s.jsx(AJ,{})}),s.jsx(qe,{path:"json",element:s.jsx(kJ,{})}),s.jsx(qe,{path:"preview",element:s.jsx(PJ,{})}),s.jsx(qe,{path:"responses",element:s.jsx(zJ,{})}),s.jsx(qe,{path:"report",element:s.jsx(UJ,{})}),s.jsx(qe,{path:"ranges",element:s.jsx($J,{})}),s.jsx(qe,{path:"subscriptions",element:s.jsx(tee,{})}),s.jsx(qe,{path:"timeline",element:s.jsx(HT,{})}),s.jsx(qe,{path:"tools",element:s.jsx(aee,{})}),s.jsx(qe,{path:"profiles",element:s.jsx(NJ,{})}),s.jsx(qe,{path:"export",element:s.jsx(DJ,{})})]}),s.jsx(qe,{path:"/:resourceType",element:s.jsx(zT,{})}),s.jsx(qe,{path:"/",element:s.jsx(zT,{})})]})})}function oee(){const e=De(),t=e.getUserConfiguration(),n=Mr(),[r]=Gb();return e.isLoading()?s.jsx(pa,{}):s.jsx(XF,{logo:s.jsx($a,{size:24}),pathname:n.pathname,searchParams:r,version:NA,menus:see(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(y.Suspense,{fallback:s.jsx(pa,{}),children:s.jsx(iee,{})})})}function see(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var a;return{title:r.title,links:((a=r.link)==null?void 0:a.map(o=>({label:o.name,href:o.target,icon:lee(o.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(zV,{})}]}),t}const qT={Patient:eF,Practitioner:IV,Organization:TV,ServiceRequest:QV,DiagnosticReport:KV,Questionnaire:MV,admin:jV,AccessPolicy:LV,Subscription:aF,batch:VV,Observation:BV};function lee(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in qT){const n=qT[t];return s.jsx(n,{})}}catch{}return s.jsx($p,{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 cee(){const e=Bd(),t=new OA({baseUrl:e.baseUrl,clientId:e.clientId,cacheTime:6e4,autoBatchTime:100,onUnauthenticated:()=>{window.location.pathname!=="/signin"&&window.location.pathname!=="/oauth"&&(window.location.href="/signin?next="+encodeURIComponent(window.location.pathname+window.location.search))}}),n={headings:{sizes:{h1:{fontSize:"1.125rem",fontWeight:"500",lineHeight:"2.0"}}},fontSizes:{xs:"0.6875rem",sm:"0.875rem",md:"0.875rem",lg:"1.0rem",xl:"1.125rem"}},r=fX([{path:"*",element:s.jsx(oee,{})}]),a=c=>r.navigate(c);mY.createRoot(document.getElementById("root")).render(s.jsx(y.StrictMode,{children:s.jsx(aV,{medplum:t,navigate:a,children:s.jsxs(gR,{theme:n,children:[s.jsx(Zi,{position:"bottom-right"}),s.jsx(LK,{router:r})]})})}))}cee().catch(console.error);
581
- //# sourceMappingURL=index-CKRWAkpk.js.map