@medplum/app 5.0.11 → 5.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-B3We4KxC.css +1 -0
- package/dist/assets/index-uNAsZ1OJ.js +235 -0
- package/dist/assets/index-uNAsZ1OJ.js.map +1 -0
- package/dist/index.html +3 -3
- package/package.json +13 -13
- package/dist/assets/index-DLigV7Xl.css +0 -1
- package/dist/assets/index-YtQHiULj.js +0 -235
- package/dist/assets/index-YtQHiULj.js.map +0 -1
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
function b3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function om(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _y={exports:{}},dd={};var lE;function S3(){if(lE)return dd;lE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:s}}return dd.Fragment=t,dd.jsx=n,dd.jsxs=n,dd}var cE;function w3(){return cE||(cE=1,_y.exports=S3()),_y.exports}var a=w3(),Co=function(){return Co=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Co.apply(this,arguments)};function B_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Al(e,t,n,r){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function d(m){try{p(r.next(m))}catch(g){c(g)}}function f(m){try{p(r.throw(m))}catch(g){c(g)}}function p(m){m.done?s(m.value):o(m.value).then(d,f)}p((r=r.apply(e,t||[])).next())})}function j3(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Dy={exports:{}},gt={};var uE;function C3(){if(uE)return gt;uE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function x(O){return O===null||typeof O!="object"?null:(O=y&&O[y]||O["@@iterator"],typeof O=="function"?O:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function T(O,H,se){this.props=O,this.context=H,this.refs=C,this.updater=se||S}T.prototype.isReactComponent={},T.prototype.setState=function(O,H){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,H,"setState")},T.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=T.prototype;function E(O,H,se){this.props=O,this.context=H,this.refs=C,this.updater=se||S}var _=E.prototype=new R;_.constructor=E,j(_,T.prototype),_.isPureReactComponent=!0;var k=Array.isArray;function I(){}var D={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(O,H,se){var de=se.ref;return{$$typeof:e,type:O,key:H,ref:de!==void 0?de:null,props:se}}function B(O,H){return $(O.type,H,O.props)}function Q(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function K(O){var H={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(se){return H[se]})}var Z=/\/+/g;function U(O,H){return typeof O=="object"&&O!==null&&O.key!=null?K(""+O.key):H.toString(36)}function G(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(I,I):(O.status="pending",O.then(function(H){O.status==="pending"&&(O.status="fulfilled",O.value=H)},function(H){O.status==="pending"&&(O.status="rejected",O.reason=H)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function M(O,H,se,de,ye){var we=typeof O;(we==="undefined"||we==="boolean")&&(O=null);var Ee=!1;if(O===null)Ee=!0;else switch(we){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(O.$$typeof){case e:case t:Ee=!0;break;case m:return Ee=O._init,M(Ee(O._payload),H,se,de,ye)}}if(Ee)return ye=ye(O),Ee=de===""?"."+U(O,0):de,k(ye)?(se="",Ee!=null&&(se=Ee.replace(Z,"$&/")+"/"),M(ye,H,se,"",function(dt){return dt})):ye!=null&&(Q(ye)&&(ye=B(ye,se+(ye.key==null||O&&O.key===ye.key?"":(""+ye.key).replace(Z,"$&/")+"/")+Ee)),H.push(ye)),1;Ee=0;var Xe=de===""?".":de+":";if(k(O))for(var Ae=0;Ae<O.length;Ae++)de=O[Ae],we=Xe+U(de,Ae),Ee+=M(de,H,se,we,ye);else if(Ae=x(O),typeof Ae=="function")for(O=Ae.call(O),Ae=0;!(de=O.next()).done;)de=de.value,we=Xe+U(de,Ae++),Ee+=M(de,H,se,we,ye);else if(we==="object"){if(typeof O.then=="function")return M(G(O),H,se,de,ye);throw H=String(O),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function L(O,H,se){if(O==null)return O;var de=[],ye=0;return M(O,de,"","",function(we){return H.call(se,we,ye++)}),de}function z(O){if(O._status===-1){var H=O._result;H=H(),H.then(function(se){(O._status===0||O._status===-1)&&(O._status=1,O._result=se)},function(se){(O._status===0||O._status===-1)&&(O._status=2,O._result=se)}),O._status===-1&&(O._status=0,O._result=H)}if(O._status===1)return O._result.default;throw O._result}var F=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=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(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},Y={map:L,forEach:function(O,H,se){L(O,function(){H.apply(this,arguments)},se)},count:function(O){var H=0;return L(O,function(){H++}),H},toArray:function(O){return L(O,function(H){return H})||[]},only:function(O){if(!Q(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return gt.Activity=g,gt.Children=Y,gt.Component=T,gt.Fragment=n,gt.Profiler=o,gt.PureComponent=E,gt.StrictMode=r,gt.Suspense=f,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,gt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},gt.cache=function(O){return function(){return O.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(O,H,se){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var de=j({},O.props),ye=O.key;if(H!=null)for(we in H.key!==void 0&&(ye=""+H.key),H)!P.call(H,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&H.ref===void 0||(de[we]=H[we]);var we=arguments.length-2;if(we===1)de.children=se;else if(1<we){for(var Ee=Array(we),Xe=0;Xe<we;Xe++)Ee[Xe]=arguments[Xe+2];de.children=Ee}return $(O.type,ye,de)},gt.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:s,_context:O},O},gt.createElement=function(O,H,se){var de,ye={},we=null;if(H!=null)for(de in H.key!==void 0&&(we=""+H.key),H)P.call(H,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(ye[de]=H[de]);var Ee=arguments.length-2;if(Ee===1)ye.children=se;else if(1<Ee){for(var Xe=Array(Ee),Ae=0;Ae<Ee;Ae++)Xe[Ae]=arguments[Ae+2];ye.children=Xe}if(O&&O.defaultProps)for(de in Ee=O.defaultProps,Ee)ye[de]===void 0&&(ye[de]=Ee[de]);return $(O,we,ye)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(O){return{$$typeof:d,render:O}},gt.isValidElement=Q,gt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:z}},gt.memo=function(O,H){return{$$typeof:p,type:O,compare:H===void 0?null:H}},gt.startTransition=function(O){var H=D.T,se={};D.T=se;try{var de=O(),ye=D.S;ye!==null&&ye(se,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(I,F)}catch(we){F(we)}finally{H!==null&&se.types!==null&&(H.types=se.types),D.T=H}},gt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},gt.use=function(O){return D.H.use(O)},gt.useActionState=function(O,H,se){return D.H.useActionState(O,H,se)},gt.useCallback=function(O,H){return D.H.useCallback(O,H)},gt.useContext=function(O){return D.H.useContext(O)},gt.useDebugValue=function(){},gt.useDeferredValue=function(O,H){return D.H.useDeferredValue(O,H)},gt.useEffect=function(O,H){return D.H.useEffect(O,H)},gt.useEffectEvent=function(O){return D.H.useEffectEvent(O)},gt.useId=function(){return D.H.useId()},gt.useImperativeHandle=function(O,H,se){return D.H.useImperativeHandle(O,H,se)},gt.useInsertionEffect=function(O,H){return D.H.useInsertionEffect(O,H)},gt.useLayoutEffect=function(O,H){return D.H.useLayoutEffect(O,H)},gt.useMemo=function(O,H){return D.H.useMemo(O,H)},gt.useOptimistic=function(O,H){return D.H.useOptimistic(O,H)},gt.useReducer=function(O,H,se){return D.H.useReducer(O,H,se)},gt.useRef=function(O){return D.H.useRef(O)},gt.useState=function(O){return D.H.useState(O)},gt.useSyncExternalStore=function(O,H,se){return D.H.useSyncExternalStore(O,H,se)},gt.useTransition=function(){return D.H.useTransition()},gt.version="19.2.3",gt}var dE;function wb(){return dE||(dE=1,Dy.exports=C3()),Dy.exports}var v=wb();const On=om(v),jb=b3({__proto__:null,default:On},[v]);var mp="right-scroll-bar-position",gp="width-before-scroll-bar",E3="with-scroll-bars-hidden",T3="--removed-body-scroll-bar-size";function Ay(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function R3(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var _3=typeof window<"u"?v.useLayoutEffect:v.useEffect,fE=new WeakMap;function D3(e,t){var n=R3(null,function(r){return e.forEach(function(o){return Ay(o,r)})});return _3(function(){var r=fE.get(n);if(r){var o=new Set(r),s=new Set(e),c=n.current;o.forEach(function(d){s.has(d)||Ay(d,null)}),s.forEach(function(d){o.has(d)||Ay(d,c)})}fE.set(n,e)},[e]),n}function A3(e){return e}function k3(e,t){t===void 0&&(t=A3);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var c=t(s,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(s){for(r=!0;n.length;){var c=n;n=[],c.forEach(s)}n={push:function(d){return s(d)},filter:function(){return n}}},assignMedium:function(s){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(s),c=n}var f=function(){var m=c;c=[],m.forEach(s)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(m){c.push(m),p()},filter:function(m){return c=c.filter(m),n}}}};return o}function P3(e){e===void 0&&(e={});var t=k3(null);return t.options=Co({async:!0,ssr:!1},e),t}var V_=function(e){var t=e.sideCar,n=B_(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Co({},n))};V_.isSideCarExport=!0;function N3(e,t){return e.useMedium(t),V_}var F_=P3(),ky=function(){},am=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ky,onWheelCapture:ky,onTouchMoveCapture:ky}),o=r[0],s=r[1],c=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,m=e.enabled,g=e.shards,y=e.sideCar,x=e.noRelative,S=e.noIsolation,j=e.inert,C=e.allowPinchZoom,T=e.as,R=T===void 0?"div":T,E=e.gapMode,_=B_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=y,I=D3([n,t]),D=Co(Co({},_),o);return v.createElement(v.Fragment,null,m&&v.createElement(k,{sideCar:F_,removeScrollBar:p,shards:g,noRelative:x,noIsolation:S,inert:j,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:E}),c?v.cloneElement(v.Children.only(d),Co(Co({},D),{ref:I})):v.createElement(R,Co({},D,{className:f,ref:I}),d))});am.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};am.classNames={fullWidth:gp,zeroRight:mp};var O3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function M3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=O3();return t&&e.setAttribute("nonce",t),e}function L3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function I3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var z3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=M3())&&(L3(t,n),I3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$3=function(){var e=z3();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},H_=function(){var e=$3(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},U3={left:0,top:0,right:0,gap:0},Py=function(e){return parseInt(e||"",10)||0},B3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Py(n),Py(r),Py(o)]},V3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return U3;var t=B3(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])}},F3=H_(),Vc="data-scroll-locked",H3=function(e,t,n,r){var o=e.left,s=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
2
|
-
.`.concat(E3,` {
|
|
3
|
-
overflow: hidden `).concat(r,`;
|
|
4
|
-
padding-right: `).concat(d,"px ").concat(r,`;
|
|
5
|
-
}
|
|
6
|
-
body[`).concat(Vc,`] {
|
|
7
|
-
overflow: hidden `).concat(r,`;
|
|
8
|
-
overscroll-behavior: contain;
|
|
9
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
10
|
-
padding-left: `.concat(o,`px;
|
|
11
|
-
padding-top: `).concat(s,`px;
|
|
12
|
-
padding-right: `).concat(c,`px;
|
|
13
|
-
margin-left:0;
|
|
14
|
-
margin-top:0;
|
|
15
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
16
|
-
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.`).concat(mp,` {
|
|
20
|
-
right: `).concat(d,"px ").concat(r,`;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.`).concat(gp,` {
|
|
24
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.`).concat(mp," .").concat(mp,` {
|
|
28
|
-
right: 0 `).concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(gp," .").concat(gp,` {
|
|
32
|
-
margin-right: 0 `).concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[`).concat(Vc,`] {
|
|
36
|
-
`).concat(T3,": ").concat(d,`px;
|
|
37
|
-
}
|
|
38
|
-
`)},hE=function(){var e=parseInt(document.body.getAttribute(Vc)||"0",10);return isFinite(e)?e:0},q3=function(){v.useEffect(function(){return document.body.setAttribute(Vc,(hE()+1).toString()),function(){var e=hE()-1;e<=0?document.body.removeAttribute(Vc):document.body.setAttribute(Vc,e.toString())}},[])},G3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;q3();var s=v.useMemo(function(){return V3(o)},[o]);return v.createElement(F3,{styles:H3(s,!t,o,n?"":"!important")})},_x=!1;if(typeof window<"u")try{var Wh=Object.defineProperty({},"passive",{get:function(){return _x=!0,!0}});window.addEventListener("test",Wh,Wh),window.removeEventListener("test",Wh,Wh)}catch{_x=!1}var Ec=_x?{passive:!1}:!1,Q3=function(e){return e.tagName==="TEXTAREA"},q_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Q3(e)&&n[t]==="visible")},W3=function(e){return q_(e,"overflowY")},Y3=function(e){return q_(e,"overflowX")},pE=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=G_(e,r);if(o){var s=Q_(e,r),c=s[1],d=s[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},K3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},X3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},G_=function(e,t){return e==="v"?W3(t):Y3(t)},Q_=function(e,t){return e==="v"?K3(t):X3(t)},J3=function(e,t){return e==="h"&&t==="rtl"?-1:1},Z3=function(e,t,n,r,o){var s=J3(e,window.getComputedStyle(t).direction),c=s*r,d=n.target,f=t.contains(d),p=!1,m=c>0,g=0,y=0;do{if(!d)break;var x=Q_(e,d),S=x[0],j=x[1],C=x[2],T=j-C-s*S;(S||T)&&G_(e,d)&&(g+=T,y+=S);var R=d.parentNode;d=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(p=!0),p},Yh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mE=function(e){return[e.deltaX,e.deltaY]},gE=function(e){return e&&"current"in e?e.current:e},eM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tM=function(e){return`
|
|
39
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},nM=0,Tc=[];function rM(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(nM++)[0],s=v.useState(H_)[0],c=v.useRef(e);v.useEffect(function(){c.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var j=j3([e.lockRef.current],(e.shards||[]).map(gE),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=v.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var T=Yh(j),R=n.current,E="deltaX"in j?j.deltaX:R[0]-T[0],_="deltaY"in j?j.deltaY:R[1]-T[1],k,I=j.target,D=Math.abs(E)>Math.abs(_)?"h":"v";if("touches"in j&&D==="h"&&I.type==="range")return!1;var P=window.getSelection(),$=P&&P.anchorNode,B=$?$===I||$.contains(I):!1;if(B)return!1;var Q=pE(D,I);if(!Q)return!0;if(Q?k=D:(k=D==="v"?"h":"v",Q=pE(D,I)),!Q)return!1;if(!r.current&&"changedTouches"in j&&(E||_)&&(r.current=k),!k)return!0;var K=r.current||k;return Z3(K,C,j,K==="h"?E:_)},[]),f=v.useCallback(function(j){var C=j;if(!(!Tc.length||Tc[Tc.length-1]!==s)){var T="deltaY"in C?mE(C):Yh(C),R=t.current.filter(function(k){return k.name===C.type&&(k.target===C.target||C.target===k.shadowParent)&&eM(k.delta,T)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var E=(c.current.shards||[]).map(gE).filter(Boolean).filter(function(k){return k.contains(C.target)}),_=E.length>0?d(C,E[0]):!c.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),p=v.useCallback(function(j,C,T,R){var E={name:j,delta:C,target:T,should:R,shadowParent:iM(T)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(_){return _!==E})},1)},[]),m=v.useCallback(function(j){n.current=Yh(j),r.current=void 0},[]),g=v.useCallback(function(j){p(j.type,mE(j),j.target,d(j,e.lockRef.current))},[]),y=v.useCallback(function(j){p(j.type,Yh(j),j.target,d(j,e.lockRef.current))},[]);v.useEffect(function(){return Tc.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Ec),document.addEventListener("touchmove",f,Ec),document.addEventListener("touchstart",m,Ec),function(){Tc=Tc.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,Ec),document.removeEventListener("touchmove",f,Ec),document.removeEventListener("touchstart",m,Ec)}},[]);var x=e.removeScrollBar,S=e.inert;return v.createElement(v.Fragment,null,S?v.createElement(s,{styles:tM(o)}):null,x?v.createElement(G3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oM=N3(F_,rM);var vl=v.forwardRef(function(e,t){return v.createElement(am,Co({},e,{ref:t,sideCar:oM}))});vl.classNames=am.classNames;function dn(e){return Object.keys(e)}function Ny(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Cb(e,t){const n={...e},r=t;return Ny(e)&&Ny(t)&&Object.keys(t).forEach(o=>{Ny(r[o])&&o in e?n[o]=Cb(n[o],r[o]):n[o]=r[o]}),n}function aM(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function sM(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function Rd(e){const t=sM(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 vE(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function W_(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const o=`${r/16}${e}`;return t?vE(o):o}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(s=>n(s)).join(",");if(r.includes(" "))return r.split(" ").map(s=>n(s)).join(" ");const o=r.replace("px","");if(!Number.isNaN(Number(o))){const s=`${Number(o)/16}${e}`;return t?vE(s):s}}return r}return n}const ue=W_("rem",{shouldScale:!0}),_p=W_("em");function js(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function Y_(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 sm(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function Ar(e){const t=v.createContext(null);return[({children:o,value:s})=>a.jsx(t.Provider,{value:s,children:o}),()=>{const o=v.useContext(t);if(o===null)throw new Error(e);return o}]}function Bo(e=null){const t=v.createContext(e);return[({children:o,value:s})=>a.jsx(t.Provider,{value:s,children:o}),()=>v.useContext(t)]}function yE(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Dp(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function lM(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 cM(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 uM(e,t,n){return Dp(e,n)===Dp(t,n)}function Eb({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:s="rtl",orientation:c}){return d=>{n?.(d);const f=Array.from(Dp(d.currentTarget,e)?.querySelectorAll(t)||[]).filter(S=>uM(d.currentTarget,S,e)),p=f.findIndex(S=>d.currentTarget===S),m=cM(p,f,r),g=lM(p,f,r),y=s==="rtl"?g:m,x=s==="rtl"?m:g;switch(d.key){case"ArrowRight":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[y].focus(),o&&f[y].click());break}case"ArrowLeft":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[x].focus(),o&&f[x].click());break}case"ArrowUp":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[g].focus(),o&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[m].focus(),o&&f[m].click());break}case"Home":{d.stopPropagation(),d.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{d.stopPropagation(),d.preventDefault();const S=f.length-1;!f[S].disabled&&f[S].focus();break}}}}const dM={app:100,modal:200,popover:300,overlay:400,max:9999};function zr(e){return dM[e]}const Ap=()=>{};function fM(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Ap:n=>{n.key==="Escape"&&(e(n),t.onTrigger?.())}}function at(e,t="size",n=!0){if(e!==void 0)return Y_(e)?n?ue(e):e:`var(--${t}-${e})`}function Gn(e){return at(e,"mantine-spacing")}function Bt(e){return e===void 0?"var(--mantine-radius-default)":at(e,"mantine-radius")}function Qn(e){return at(e,"mantine-font-size")}function K_(e){return at(e,"mantine-line-height",!1)}function Tb(e){if(e)return at(e,"mantine-shadow",!1)}function sr(e,t){return n=>{e?.(n),t?.(n)}}function Rb(e,t){return e in t?Rd(t[e]):Rd(e)}function _d(e,t){const n=e.map(r=>({value:r,px:Rb(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Zi(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function hM(e,t,n){return n?Array.from(Dp(n,t)?.querySelectorAll(e)||[]).findIndex(r=>r===n):null}function jd(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 kp(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function pM(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;const n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let o=0;o<r;o+=1){const s=n[o];if(!(s in t)||e[s]!==t[s]&&!(Number.isNaN(e[s])&&Number.isNaN(t[s])))return!1}return!0}function xE(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function il(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...n)=>t.current?.(...n)),[])}function Xd(e,t){const{delay:n,flushOnUnmount:r,leading:o}=typeof t=="number"?{delay:t,flushOnUnmount:!1,leading:!1}:t,s=il(e),c=v.useRef(0),d=v.useMemo(()=>{const f=Object.assign((...p)=>{window.clearTimeout(c.current);const m=f._isFirstCall;f._isFirstCall=!1;function g(){window.clearTimeout(c.current),c.current=0,f._isFirstCall=!0}if(o&&m){s(...p);const S=()=>{g()},j=()=>{c.current!==0&&(g(),s(...p))},C=()=>{g()};f.flush=j,f.cancel=C,c.current=window.setTimeout(S,n);return}if(o&&!m){const S=()=>{c.current!==0&&(g(),s(...p))},j=()=>{g()};f.flush=S,f.cancel=j;const C=()=>{g()};c.current=window.setTimeout(C,n);return}const y=()=>{c.current!==0&&(g(),s(...p))},x=()=>{g()};f.flush=y,f.cancel=x,c.current=window.setTimeout(y,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return f},[s,n,o]);return v.useEffect(()=>()=>{r?d.flush():d.cancel()},[d,r]),d}const mM=["mousedown","touchstart"];function gM(e,t,n){const r=v.useRef(null),o=t||mM;return v.useEffect(()=>{const s=c=>{const{target:d}=c??{};if(Array.isArray(n)){const f=!document.body.contains(d)&&d?.tagName!=="HTML";n.every(m=>!!m&&!c.composedPath().includes(m))&&!f&&e(c)}else r.current&&!r.current.contains(d)&&e(c)};return o.forEach(c=>document.addEventListener(c,s)),()=>{o.forEach(c=>document.removeEventListener(c,s))}},[r,e,n]),r}function X_(e={timeout:2e3}){const[t,n]=v.useState(null),[r,o]=v.useState(!1),[s,c]=v.useState(null),d=m=>{window.clearTimeout(s),c(window.setTimeout(()=>o(!1),e.timeout)),o(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>d(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(s)},error:t,copied:r}}function vM(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function yM(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function J_(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=v.useState(n?t:yM(e));return v.useEffect(()=>{try{const s=window.matchMedia(e);return o(s.matches),vM(s,c=>o(c.matches))}catch{return}},[e]),r||!1}function xM(e,t){return J_("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const kl=typeof document<"u"?v.useLayoutEffect:v.useEffect;function yl(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function Z_({opened:e,shouldReturnFocus:t=!0}){const n=v.useRef(null),r=()=>{n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&n.current?.focus({preventScroll:!0})};return yl(()=>{let o=-1;const s=c=>{c.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const bM=/input|select|textarea|button|object/,e2="a, input, select, textarea, button, object, [tabindex]";function SM(e){return e.style.display==="none"}function wM(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(SM(n))return!1;n=n.parentNode}return!0}function t2(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Dx(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(t2(e));return(bM.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&wM(e)}function n2(e){const t=t2(e);return(Number.isNaN(t)||t>=0)&&Dx(e)}function jM(e){return Array.from(e.querySelectorAll(e2)).filter(n2)}function CM(e,t){const n=jM(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let s=r===o.activeElement||e===o.activeElement;const c=o.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(s=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!s)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function EM(e=!0){const t=v.useRef(null),n=o=>{let s=o.querySelector("[data-autofocus]");if(!s){const c=Array.from(o.querySelectorAll(e2));s=c.find(n2)||c.find(Dx)||null,!s&&Dx(o)&&(s=o)}s&&s.focus({preventScroll:!0})},r=v.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&n(o)}),t.current=o):t.current=null)},[e]);return v.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const o=s=>{s.key==="Tab"&&t.current&&CM(t.current,s)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}const TM=e=>(e+1)%1e6;function RM(){const[,e]=v.useReducer(TM,0);return e}const _M=On.useId||(()=>{});function DM(){const e=_M();return e?`mantine-${e.replace(/:/g,"")}`:""}function xr(e){const t=DM(),[n,r]=v.useState(t);return kl(()=>{r(kp())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function r2(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Dd(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function AM(...e){const t=new Map;return n=>{if(e.forEach(r=>{const o=Dd(r,n);o&&t.set(r,o)}),t.size>0)return()=>{e.forEach(r=>{const o=t.get(r);o&&typeof o=="function"?o():Dd(r,null)}),t.clear()}}}function Un(...e){return v.useCallback(AM(...e),e)}function nr({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=v.useState(t!==void 0?t:n),c=(d,...f)=>{s(d),r?.(d,...f)};return e!==void 0?[e,r,!0]:[o,c,!1]}function os(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Kh="dots";function kM({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:s}){const c=Math.max(Math.trunc(e),0),[d,f]=nr({value:r,onChange:s,defaultValue:o,finalValue:o}),p=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>p(d+1),g=()=>p(d-1),y=()=>p(1),x=()=>p(c);return{range:v.useMemo(()=>{if(t*2+3+n*2>=c)return os(1,c);const C=Math.max(d-t,n),T=Math.min(d+t,c-n),R=C>n+2,E=T<c-(n+1);if(!R&&E){const _=t*2+n+2;return[...os(1,_),Kh,...os(c-(n-1),c)]}if(R&&!E){const _=n+1+2*t;return[...os(1,n),Kh,...os(c-_,c)]}return[...os(1,n),Kh,...os(C,T),Kh,...os(c-n+1,c)]},[c,t,d]),active:d,setPage:p,next:m,previous:g,first:y,last:x}}function _b(e,t){return J_("(prefers-reduced-motion: reduce)",e,t)}function PM(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(!pM(e[n],t[n]))return!1;return!0}function NM(e){const t=v.useRef([]),n=v.useRef(0);return PM(t.current,e)||(t.current=e,n.current+=1),[n.current]}function OM(e,t){v.useEffect(e,NM(t))}const MM={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"escape",Esc:"escape",esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function Xh(e){const t=e.replace("Key","").toLowerCase();return MM[e]||t}function LM(e){const t=e.toLowerCase().split("+").map(s=>s.trim()),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift"),plus:t.includes("[plus]")},r=["alt","ctrl","meta","shift","mod"],o=t.find(s=>!r.includes(s));return{...n,key:o==="[plus]"?"+":o}}function IM(e,t,n){const{alt:r,ctrl:o,meta:s,mod:c,shift:d,key:f}=e,{altKey:p,ctrlKey:m,metaKey:g,shiftKey:y,key:x,code:S}=t;if(r!==p)return!1;if(c){if(!m&&!g)return!1}else if(o!==m||s!==g)return!1;return d!==y?!1:!!(f&&(n?Xh(S)===Xh(f):Xh(x??S)===Xh(f)))}function zM(e,t){return n=>IM(LM(e),n,t)}function $M(e,t,n=!1){return e.target instanceof HTMLElement?(n||!e.target.isContentEditable)&&!t.includes(e.target.tagName):!0}function UM(e,t=["INPUT","TEXTAREA","SELECT"],n=!1){v.useEffect(()=>{const r=o=>{e.forEach(([s,c,d={preventDefault:!0,usePhysicalKeys:!1}])=>{zM(s,d.usePhysicalKeys)(o)&&$M(o,t,n)&&(d.preventDefault&&o.preventDefault(),c(o))})};return document.documentElement.addEventListener("keydown",r),()=>document.documentElement.removeEventListener("keydown",r)},[e])}function Pl(e=!1,t={}){const[n,r]=v.useState(e),o=v.useCallback(()=>{r(d=>d||(t.onOpen?.(),!0))},[t.onOpen]),s=v.useCallback(()=>{r(d=>d&&(t.onClose?.(),!1))},[t.onClose]),c=v.useCallback(()=>{n?s():o()},[s,o,n]);return[n,{open:o,close:s,toggle:c}]}function BM(e,t,n={autoInvoke:!1}){const r=v.useRef(null),o=v.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),s=v.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return v.useEffect(()=>(n.autoInvoke&&o(),s),[s,o]),{start:o,clear:s}}function VM(e,t,n){const r=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{const s=typeof n=="function"?n():n;return(s||o.current)&&(r.current=new MutationObserver(e),r.current.observe(s||o.current,t)),()=>{r.current?.disconnect()}},[e,t]),o}function FM(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var HM={};function i2(){return typeof process<"u"&&HM?"production":"development"}function lm(e){const t=On.version;return typeof On.version!="string"||t.startsWith("18.")?e?.ref:e?.props?.ref}function vp(e,t=document){const n=t.querySelector(e);if(n)return n;const r=t.querySelectorAll("*");for(let o=0;o<r.length;o+=1){const s=r[o];if(s.shadowRoot){const c=vp(e,s.shadowRoot);if(c)return c}}return null}function cs(e,t=document){const n=[],r=t.querySelectorAll(e);n.push(...Array.from(r));const o=t.querySelectorAll("*");for(let s=0;s<o.length;s+=1){const c=o[s];if(c.shadowRoot){const d=cs(e,c.shadowRoot);n.push(...d)}}return n}function as(e){if(!e)return document;const t=e.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t:document}function Nl(e){const t=v.Children.toArray(e);return t.length!==1||!sm(t[0])?null:t[0]}function o2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=o2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ut(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=o2(e))&&(r&&(r+=" "),r+=t);return r}const qM={};function GM(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=Ut(t[r],o):t[r]=o})}),t}function Jd({theme:e,classNames:t,props:n,stylesCtx:r}){const s=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||qM);return GM(s)}function Ad({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((s,c)=>typeof c=="function"?{...s,...c(e,n,r)}:{...s,...c},{})}const Db=v.createContext(null);function Ea(){const e=v.useContext(Db);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function QM(){return Ea().cssVariablesResolver}function WM(){return Ea().classNamesPrefix}function cm(){return Ea().getStyleNonce}function YM(){return Ea().withStaticClasses}function KM(){return Ea().headless}function XM(){return Ea().stylesTransform?.sx}function JM(){return Ea().stylesTransform?.styles}function um(){return Ea().env||"default"}function ZM(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function e5(e){let t=e.replace("#","");if(t.length===3){const c=t.split("");t=[c[0],c[0],c[1],c[1],c[2],c[2]].join("")}if(t.length===8){const c=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:c}}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,s=n&255;return{r,g:o,b:s,a:1}}function t5(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o===void 0?1:o}}function n5(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),o=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,d=(1-Math.abs(2*s-1))*o,f=r/60,p=d*(1-Math.abs(f%2-1)),m=s-d/2;let g,y,x;return f>=0&&f<1?(g=d,y=p,x=0):f>=1&&f<2?(g=p,y=d,x=0):f>=2&&f<3?(g=0,y=d,x=p):f>=3&&f<4?(g=0,y=p,x=d):f>=4&&f<5?(g=p,y=0,x=d):(g=d,y=0,x=p),{r:Math.round((g+m)*255),g:Math.round((y+m)*255),b:Math.round((x+m)*255),a:c||1}}function Ab(e){return ZM(e)?e5(e):e.startsWith("rgb")?t5(e):e.startsWith("hsl")?n5(e):{r:0,g:0,b:0,a:1}}function Jh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:s}=Ab(e),c=1-t,d=f=>Math.round(f*c);return`rgba(${d(n)}, ${d(r)}, ${d(o)}, ${s})`}function kd(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Oy(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function r5(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function i5(e){if(e.startsWith("oklch("))return(r5(e)||0)/100;const{r:t,g:n,b:r}=Ab(e),o=t/255,s=n/255,c=r/255,d=Oy(o),f=Oy(s),p=Oy(c);return .2126*d+.7152*f+.0722*p}function fd(e,t=.179){return e.startsWith("var(")?!1:i5(e)>t}function Xr({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:fd(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:fd(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:fd(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),s=o?Number(o):void 0,c=r in t.colors;if(c){const d=s!==void 0?t.colors[r][s]:t.colors[r][kd(t,n||"light")];return{color:r,value:d,shade:s,isThemeColor:c,isLight:fd(d,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:fd(e,t.luminanceThreshold),shade:s,variable:void 0}}function Kt(e,t){const n=Xr({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Ax(e,t){const n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=Kt(n.from,t),o=Kt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function Ai(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const s=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${s}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=Ab(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Rc=Ai,o5=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const s=Xr({color:e,theme:t}),c=typeof o=="boolean"?o:t.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const d=c&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:d,border:`${ue(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:d,border:`${ue(1)} solid transparent`}:{background:e,hover:Jh(e,.1),color:d,border:`${ue(1)} solid transparent`}}if(n==="light"){if(s.isThemeColor){if(s.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${ue(1)} solid transparent`};const d=t.colors[s.color][s.shade];return{background:Ai(d,.1),hover:Ai(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${ue(1)} solid transparent`}}return{background:Ai(e,.1),hover:Ai(e,.12),color:e,border:`${ue(1)} solid transparent`}}if(n==="outline")return s.isThemeColor?s.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${ue(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Ai(t.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${ue(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:Ai(e,.05),color:e,border:`${ue(1)} solid ${e}`};if(n==="subtle"){if(s.isThemeColor){if(s.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${ue(1)} solid transparent`};const d=t.colors[s.color][s.shade];return{background:"transparent",hover:Ai(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${ue(1)} solid transparent`}}return{background:"transparent",hover:Ai(e,.12),color:e,border:`${ue(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${ue(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${ue(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${ue(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:Jh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${ue(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Jh(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${ue(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Jh(t.white,.01),color:e,border:`${ue(1)} solid transparent`}:n==="gradient"?{background:Ax(r,t),hover:Ax(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:`${ue(1)} solid var(--mantine-color-default-border)`}:{}},a5={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"]},bE="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",kb={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:a5,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:o5,autoContrast:!1,luminanceThreshold:.3,fontFamily:bE,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:bE,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:ue(34),lineHeight:"1.3"},h2:{fontSize:ue(26),lineHeight:"1.35"},h3:{fontSize:ue(22),lineHeight:"1.4"},h4:{fontSize:ue(18),lineHeight:"1.45"},h5:{fontSize:ue(16),lineHeight:"1.5"},h6:{fontSize:ue(14),lineHeight:"1.5"}}},fontSizes:{xs:ue(12),sm:ue(14),md:ue(16),lg:ue(18),xl:ue(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:ue(2),sm:ue(4),md:ue(8),lg:ue(16),xl:ue(32)},spacing:{xs:ue(10),sm:ue(12),md:ue(16),lg:ue(20),xl:ue(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${ue(1)} ${ue(3)} rgba(0, 0, 0, 0.05), 0 ${ue(1)} ${ue(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${ue(1)} ${ue(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ue(10)} ${ue(15)} ${ue(-5)}, rgba(0, 0, 0, 0.04) 0 ${ue(7)} ${ue(7)} ${ue(-5)}`,md:`0 ${ue(1)} ${ue(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ue(20)} ${ue(25)} ${ue(-5)}, rgba(0, 0, 0, 0.04) 0 ${ue(10)} ${ue(10)} ${ue(-5)}`,lg:`0 ${ue(1)} ${ue(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ue(28)} ${ue(23)} ${ue(-7)}, rgba(0, 0, 0, 0.04) 0 ${ue(12)} ${ue(12)} ${ue(-7)}`,xl:`0 ${ue(1)} ${ue(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ue(36)} ${ue(28)} ${ue(-7)}, rgba(0, 0, 0, 0.04) 0 ${ue(17)} ${ue(17)} ${ue(-7)}`},other:{},components:{}};function SE(e){return e==="auto"||e==="dark"||e==="light"}function s5({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 SE(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&&SE(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const l5="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",wE="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function My(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function jE(e){if(!(e.primaryColor in e.colors))throw new Error(l5);if(typeof e.primaryShade=="object"&&(!My(e.primaryShade.dark)||!My(e.primaryShade.light)))throw new Error(wE);if(typeof e.primaryShade=="number"&&!My(e.primaryShade))throw new Error(wE)}function c5(e,t){if(!t)return jE(e),e;const n=Cb(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),jE(n),n}const Pb=v.createContext(null),u5=()=>v.useContext(Pb)||kb;function Tn(){const e=v.useContext(Pb);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 a2({theme:e,children:t,inherit:n=!0}){const r=u5(),o=v.useMemo(()=>c5(n?r:kb,e),[e,r,n]);return a.jsx(Pb.Provider,{value:o,children:t})}a2.displayName="@mantine/core/MantineThemeProvider";function d5(){const e=Tn(),t=cm(),n=dn(e.breakpoints).reduce((r,o)=>{const s=e.breakpoints[o].includes("px"),c=Rd(e.breakpoints[o]),d=s?`${c-.1}px`:_p(c-.1),f=s?`${c}px`:_p(c);return`${r}@media (max-width: ${d}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return a.jsx("style",{"data-mantine-styles":"classes",nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function Ly(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function s2(e,t){const n=t?[t]:[":root",":host"],r=Ly(e.variables),o=r?`${n.join(", ")}{${r}}`:"",s=Ly(e.dark),c=Ly(e.light),d=m=>n.map(g=>g===":host"?`${g}([data-mantine-color-scheme="${m}"])`:`${g}[data-mantine-color-scheme="${m}"]`).join(", "),f=s?`${d("dark")}{${s}}`:"",p=c?`${d("light")}{${c}}`:"";return`${o}
|
|
42
|
-
|
|
43
|
-
${f}
|
|
44
|
-
|
|
45
|
-
${p}`}function Ta({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&Xr({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function CE(e,t){return Ta({color:e.colors[e.primaryColor][kd(e,t)],theme:e,autoContrast:null})}function Zh({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const d=kd(e,"light"),f={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${d===9?8:d+1})`,[`--mantine-color-${r}-light`]:Rc(e.colors[t][d],.1),[`--mantine-color-${r}-light-hover`]:Rc(e.colors[t][d],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline-hover`]:Rc(e.colors[t][d],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const s=kd(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${s})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${s===9?8:s+1})`,[`--mantine-color-${r}-light`]:Rc(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:Rc(e.colors[t][Math.max(0,s-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(s-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Rc(e.colors[t][Math.max(s-4,0)],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...c}:c}function f5(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function _c(e,t,n){dn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const l2=e=>{const t=kd(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:ue(e.defaultRadius),r={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--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-color-scheme":"light","--mantine-primary-color-contrast":CE(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)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":CE(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)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};_c(r.variables,e.breakpoints,"breakpoint"),_c(r.variables,e.spacing,"spacing"),_c(r.variables,e.fontSizes,"font-size"),_c(r.variables,e.lineHeights,"line-height"),_c(r.variables,e.shadows,"shadow"),_c(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((s,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),dn(e.colors).forEach(s=>{const c=e.colors[s];if(f5(c)){Object.assign(r.light,Zh({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Zh({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((d,f)=>{r.variables[`--mantine-color-${s}-${f}`]=d}),Object.assign(r.light,Zh({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Zh({theme:e,color:s,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return dn(o).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=o[s].fontSize,r.variables[`--mantine-${s}-line-height`]=o[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=o[s].fontWeight||e.headings.fontWeight}),r};function h5({theme:e,generator:t}){const n=l2(e),r=t?.(e);return r?Cb(n,r):n}const Iy=l2(kb);function p5(e){const t={variables:{},light:{},dark:{}};return dn(e.variables).forEach(n=>{Iy.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),dn(e.light).forEach(n=>{Iy.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),dn(e.dark).forEach(n=>{Iy.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function m5(e){return s2({variables:{},dark:{"--mantine-color-scheme":"dark"},light:{"--mantine-color-scheme":"light"}},e)}function c2({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Tn(),r=cm(),o=QM(),s=h5({theme:n,generator:o}),c=(e===void 0||e===":root"||e===":host")&&t,d=c?p5(s):s,f=s2(d,e);return f?a.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${f}${c?"":m5(e)}`}}):null}c2.displayName="@mantine/CssVariables";function Dc(e,t){const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,r=e!=="auto"?e:n?"dark":"light";t()?.setAttribute("data-mantine-color-scheme",r)}function g5({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=v.useRef(null),[s,c]=v.useState(()=>e.get(t)),d=r||s,f=v.useCallback(m=>{r||(Dc(m,n),c(m),e.set(m))},[e.set,d,r]),p=v.useCallback(()=>{c(t),Dc(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),kl(()=>{Dc(e.get(t),n)},[]),v.useEffect(()=>{if(r)return Dc(r,n),()=>{};r===void 0&&Dc(s,n),typeof window<"u"&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=g=>{s==="auto"&&Dc(g.matches?"dark":"light",n)};return o.current?.addEventListener("change",m),()=>o.current?.removeEventListener("change",m)},[s,r]),{colorScheme:d,setColorScheme:f,clearColorScheme:p}}function v5({respectReducedMotion:e,getRootElement:t}){kl(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}function u2({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:s=!0,withCssVariables:c=!0,cssVariablesSelector:d,classNamesPrefix:f="mantine",colorSchemeManager:p=s5(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:x,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:T,clearColorScheme:R}=g5({defaultColorScheme:m,forceColorScheme:x,manager:p,getRootElement:g});return v5({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:g}),a.jsx(Db.Provider,{value:{colorScheme:C,setColorScheme:T,clearColorScheme:R,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:d??":root",withStaticClasses:r,stylesTransform:S,env:j},children:a.jsxs(a2,{theme:e,children:[c&&a.jsx(c2,{cssVariablesSelector:d,deduplicateCssVariables:s}),o&&a.jsx(d5,{}),t]})})}u2.displayName="@mantine/core/MantineProvider";function Ol({classNames:e,styles:t,props:n,stylesCtx:r}){const o=Tn();return{resolvedClassNames:Jd({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Ad({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const y5={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function x5({theme:e,options:t,unstyled:n}){return Ut(t?.focusable&&!n&&(e.focusClassName||y5[e.focusRing]),t?.active&&!n&&e.activeClassName)}function b5({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Jd({theme:o,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function EE({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Jd({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function S5({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function w5({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function j5({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function C5({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(s=>Jd({theme:t,classNames:t.components[s]?.classNames,props:r,stylesCtx:o})?.[n])}function E5({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function T5({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:s,classes:c,unstyled:d,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:y,headless:x,transformedStyles:S}){return Ut(x5({theme:e,options:t,unstyled:d||x}),C5({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),E5({options:t,classes:c,selector:r,unstyled:d}),EE({selector:r,stylesCtx:g,theme:e,classNames:s,props:m}),EE({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),b5({selector:r,stylesCtx:g,options:t,props:m,theme:e}),S5({rootSelector:p,selector:r,className:f}),w5({selector:r,classes:c,unstyled:d||x}),y&&!x&&j5({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function R5({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(s=>Ad({theme:e,styles:e.components[s]?.styles,props:n,stylesCtx:r})[o]).reduce((s,c)=>({...s,...c}),{})}function kx({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...kx({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function _5(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...js(n[r])}}),t),{})}function D5({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:s,themeName:c,headless:d}){return _5([d?{}:t?.(n,r,o),...c.map(f=>n.components?.[f]?.vars?.(n,r,o)),e?.(n,r,o)])?.[s]}function A5({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:s,rootSelector:c,styles:d,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:y}){return{...!y&&R5({theme:e,themeName:t,props:o,stylesCtx:s,selector:n}),...!y&&Ad({theme:e,styles:d,props:o,stylesCtx:s})[n],...!y&&Ad({theme:e,styles:r?.styles,props:r?.props||o,stylesCtx:s})[n],...D5({theme:e,props:o,stylesCtx:s,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?kx({style:f,theme:e}):null,...kx({style:r?.style,theme:e})}}function k5({props:e,stylesCtx:t,themeName:n}){const r=Tn(),o=JM()?.();return{getTransformedStyles:c=>o?[...c.map(f=>o(f,{props:e,theme:r,ctx:t})),...n.map(f=>o(r.components[f]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!o}}function Ie({name:e,classes:t,props:n,stylesCtx:r,className:o,style:s,rootSelector:c="root",unstyled:d,classNames:f,styles:p,vars:m,varsResolver:g,attributes:y}){const x=Tn(),S=WM(),j=YM(),C=KM(),T=(Array.isArray(e)?e:[e]).filter(_=>_),{withStylesTransform:R,getTransformedStyles:E}=k5({props:n,stylesCtx:r,themeName:T});return(_,k)=>({className:T5({theme:x,options:k,themeName:T,selector:_,classNamesPrefix:S,classNames:f,classes:t,unstyled:d,className:o,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:j,headless:C,transformedStyles:E([k?.styles,p])}),style:A5({theme:x,themeName:T,selector:_,options:k,props:n,stylesCtx:r,rootSelector:c,styles:p,style:s,vars:m,varsResolver:g,headless:C,withStylesTransform:R}),...y?.[_]})}function Ml(e,t){return typeof e=="boolean"?e:t.autoContrast}function TE(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 P5({keepTransitions:e}={}){const t=v.useRef(Ap),n=v.useRef(-1),r=v.useContext(Db),o=cm(),s=v.useRef(o?.());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:TE(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},d=()=>{r.clearColorScheme(),t.current=e?()=>{}:TE(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},f=xM("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?f:r.colorScheme,m=v.useCallback(()=>c(p==="light"?"dark":"light"),[c,p]);return v.useEffect(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:d,toggleColorScheme:m}}function oe(e,t,n){const r=Tn(),o=r.components[e]?.defaultProps,s=typeof o=="function"?o(r):o;return{...t,...s,...js(n)}}function zy(e){return dn(e).reduce((t,n)=>e[n]!==void 0?`${t}${aM(n)}:${e[n]};`:t,"").trim()}function N5({selector:e,styles:t,media:n,container:r}){const o=t?zy(t):"",s=Array.isArray(n)?n.map(d=>`@media${d.query}{${e}{${zy(d.styles)}}}`):[],c=Array.isArray(r)?r.map(d=>`@container ${d.query}{${e}{${zy(d.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${s.join("")}${c.join("")}`.trim()}function Ll(e){const t=cm();return a.jsx("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:N5(e)}})}function Ra(e){const{m:t,mx:n,my:r,mt:o,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:y,pt:x,pb:S,pl:j,pr:C,pe:T,ps:R,bd:E,bdrs:_,bg:k,c:I,opacity:D,ff:P,fz:$,fw:B,lts:Q,ta:K,lh:Z,fs:U,tt:G,td:M,w:L,miw:z,maw:F,h:Y,mih:O,mah:H,bgsz:se,bgp:de,bgr:ye,bga:we,pos:Ee,top:Xe,left:Ae,bottom:dt,right:Et,inset:it,display:rt,flex:mt,hiddenFrom:Ct,visibleFrom:jt,lightHidden:Te,darkHidden:_e,sx:$e,...Le}=e;return{styleProps:js({m:t,mx:n,my:r,mt:o,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:y,pt:x,pb:S,pl:j,pr:C,pe:T,ps:R,bd:E,bg:k,c:I,opacity:D,ff:P,fz:$,fw:B,lts:Q,ta:K,lh:Z,fs:U,tt:G,td:M,w:L,miw:z,maw:F,h:Y,mih:O,mah:H,bgsz:se,bgp:de,bgr:ye,bga:we,pos:Ee,top:Xe,left:Ae,bottom:dt,right:Et,inset:it,display:rt,flex:mt,bdrs:_,hiddenFrom:Ct,visibleFrom:jt,lightHidden:Te,darkHidden:_e,sx:$e}),rest:Le}}const O5={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"},bdrs:{type:"radius",property:"borderRadius"},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 Nb(e,t){const n=Xr({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 M5(e,t){const n=Xr({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Nb(e,t)}function L5(e,t){if(typeof e=="number")return ue(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(c=>c.trim()!=="");let s=`${ue(n)}`;return r&&(s+=` ${r}`),o.length>0&&(s+=` ${Nb(o.join(" "),t)}`),s.trim()}return e}const RE={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 I5(e){return typeof e=="string"&&e in RE?RE[e]:e}const z5=["h1","h2","h3","h4","h5","h6"];function $5(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&z5.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?ue(e):e}function U5(e){return e}const B5=["h1","h2","h3","h4","h5","h6"];function V5(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&B5.includes(e)?`var(--mantine-${e}-line-height)`:e}function F5(e,t){return typeof e=="string"&&e in t.radius?`var(--mantine-radius-${e})`:typeof e=="number"||typeof e=="string"?ue(e):e}function H5(e){return typeof e=="number"?ue(e):e}function q5(e,t){if(typeof e=="number")return ue(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return ue(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const $y={color:Nb,textColor:M5,fontSize:$5,spacing:q5,radius:F5,identity:U5,size:H5,lineHeight:V5,fontFamily:I5,border:L5};function _E(e){return e.replace("(min-width: ","").replace("em)","")}function G5({media:e,...t}){const r=Object.keys(e).sort((o,s)=>Number(_E(o))-Number(_E(s))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function Q5(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function W5(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function Y5(e){return typeof e=="object"&&e!==null?dn(e).filter(t=>t!=="base"):[]}function K5(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function d2({styleProps:e,data:t,theme:n}){return G5(dn(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const s=t[o],c=Array.isArray(s.property)?s.property:[s.property],d=W5(e[o]);if(!Q5(e[o]))return c.forEach(p=>{r.inlineStyles[p]=$y[s.type](d,n)}),r;r.hasResponsiveStyles=!0;const f=Y5(e[o]);return c.forEach(p=>{d!=null&&(r.styles[p]=$y[s.type](d,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:$y[s.type](K5(e[o],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Zd(){return`__m__-${v.useId().replace(/[:«»]/g,"")}`}function f2(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...f2(r,t)}),{}):typeof e=="function"?e(t):e??{}}function h2(e){return e.startsWith("data-")?e:`data-${e}`}function X5(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[h2(n)]=e[n]),t},{})}function p2(e){return e?typeof e=="string"?{[h2(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...p2(n)}),{}):X5(e):null}function Px(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Px(r,t)}),{}):typeof e=="function"?e(t):e??{}}function J5({theme:e,style:t,vars:n,styleProps:r}){const o=Px(t,e),s=Px(n,e);return{...o,...s,...r}}const m2=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:s,size:c,hiddenFrom:d,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:y,...x},S)=>{const j=Tn(),C=e||"div",{styleProps:T,rest:R}=Ra(x),_=XM()?.()?.(T.sx),k=Zd(),I=d2({styleProps:T,theme:j,data:O5}),D={ref:S,style:J5({theme:j,style:t,vars:n,styleProps:I.inlineStyles}),className:Ut(r,_,{[k]:I.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${d}`]:d,[`mantine-visible-from-${f}`]:f}),"data-variant":o,"data-size":Y_(c)?void 0:c||void 0,size:y,...p2(s),...R};return a.jsxs(a.Fragment,{children:[I.hasResponsiveStyles&&a.jsx(Ll,{selector:`.${k}`,styles:I.styles,media:I.media}),typeof g=="function"?g(D):a.jsx(C,{...D})]})});m2.displayName="@mantine/core/Box";const le=m2;function g2(e){return e}function Z5(e){const t=e;return n=>{const r=v.forwardRef((o,s)=>a.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ge(e){const t=v.forwardRef(e);return t.extend=g2,t.withProps=n=>{const r=v.forwardRef((o,s)=>a.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function ir(e){const t=v.forwardRef(e);return t.withProps=n=>{const r=v.forwardRef((o,s)=>a.jsx(t,{...n,...o,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=g2,t}const e9=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Cs(){return v.useContext(e9)}var Uy={exports:{}},Sr={};var DE;function t9(){if(DE)return Sr;DE=1;var e=wb();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:f,containerInfo:p,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Sr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Sr.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return s(f,p,null,m)},Sr.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()}},Sr.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))},Sr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Sr.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,x=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:y,fetchPriority:x}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Sr.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=d(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(f)},Sr.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Sr.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=d(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},Sr.requestFormReset=function(f){r.d.r(f)},Sr.unstable_batchedUpdates=function(f,p){return f(p)},Sr.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},Sr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Sr.version="19.2.3",Sr}var AE;function v2(){if(AE)return Uy.exports;AE=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(),Uy.exports=t9(),Uy.exports}var Ob=v2();const xd=om(Ob);function dm(){return typeof window<"u"}function su(e){return y2(e)?(e.nodeName||"").toLowerCase():"#document"}function Kr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vo(e){var t;return(t=(y2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function y2(e){return dm()?e instanceof Node||e instanceof Kr(e).Node:!1}function wn(e){return dm()?e instanceof Element||e instanceof Kr(e).Element:!1}function hi(e){return dm()?e instanceof HTMLElement||e instanceof Kr(e).HTMLElement:!1}function Nx(e){return!dm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Kr(e).ShadowRoot}const n9=new Set(["inline","contents"]);function ef(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!n9.has(o)}const r9=new Set(["table","td","th"]);function i9(e){return r9.has(su(e))}const o9=[":popover-open",":modal"];function fm(e){return o9.some(t=>{try{return e.matches(t)}catch{return!1}})}const a9=["transform","translate","scale","rotate","perspective"],s9=["transform","translate","scale","rotate","perspective","filter"],l9=["paint","layout","strict","content"];function Mb(e){const t=hm(),n=wn(e)?Oi(e):e;return a9.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)||s9.some(r=>(n.willChange||"").includes(r))||l9.some(r=>(n.contain||"").includes(r))}function c9(e){let t=ba(e);for(;hi(t)&&!ya(t);){if(Mb(t))return t;if(fm(t))return null;t=ba(t)}return null}function hm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const u9=new Set(["html","body","#document"]);function ya(e){return u9.has(su(e))}function Oi(e){return Kr(e).getComputedStyle(e)}function pm(e){return wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ba(e){if(su(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nx(e)&&e.host||Vo(e);return Nx(t)?t.host:t}function x2(e){const t=ba(e);return ya(t)?e.ownerDocument?e.ownerDocument.body:e.body:hi(t)&&ef(t)?t:x2(t)}function xa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=x2(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),c=Kr(o);if(s){const d=Ox(c);return t.concat(c,c.visualViewport||[],ef(o)?o:[],d&&n?xa(d):[])}return t.concat(o,xa(o,[],n))}function Ox(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const d9=["top","right","bottom","left"],ro=Math.min,Er=Math.max,Pp=Math.round,ep=Math.floor,_o=e=>({x:e,y:e}),f9={left:"right",right:"left",bottom:"top",top:"bottom"},h9={start:"end",end:"start"};function Mx(e,t,n){return Er(e,ro(t,n))}function Mo(e,t){return typeof e=="function"?e(t):e}function io(e){return e.split("-")[0]}function lu(e){return e.split("-")[1]}function Lb(e){return e==="x"?"y":"x"}function Ib(e){return e==="y"?"height":"width"}const p9=new Set(["top","bottom"]);function eo(e){return p9.has(io(e))?"y":"x"}function zb(e){return Lb(eo(e))}function m9(e,t,n){n===void 0&&(n=!1);const r=lu(e),o=zb(e),s=Ib(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Np(c)),[c,Np(c)]}function g9(e){const t=Np(e);return[Lx(e),t,Lx(t)]}function Lx(e){return e.replace(/start|end/g,t=>h9[t])}const kE=["left","right"],PE=["right","left"],v9=["top","bottom"],y9=["bottom","top"];function x9(e,t,n){switch(e){case"top":case"bottom":return n?t?PE:kE:t?kE:PE;case"left":case"right":return t?v9:y9;default:return[]}}function b9(e,t,n,r){const o=lu(e);let s=x9(io(e),n==="start",r);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(Lx)))),s}function Np(e){return e.replace(/left|right|bottom|top/g,t=>f9[t])}function S9(e){return{top:0,right:0,bottom:0,left:0,...e}}function $b(e){return typeof e!="number"?S9(e):{top:e,right:e,bottom:e,left:e}}function Wc(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function w9(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function j9(){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 C9(){return/apple/i.test(navigator.vendor)}function E9(){return w9().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function T9(){return j9().includes("jsdom/")}const NE="data-floating-ui-focusable",R9="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function OE(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 Pd(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Nx(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ic(e){return"composedPath"in e?e.composedPath()[0]:e.target}function By(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 _9(e){return e.matches("html,body")}function ll(e){return e?.ownerDocument||document}function D9(e){return hi(e)&&e.matches(R9)}function A9(e){if(!e||T9())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function k9(e){return e?e.hasAttribute(NE)?e:e.querySelector("["+NE+"]")||e:null}function yp(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...yp(e,o.id,n)])}function P9(e){return"nativeEvent"in e}function Ix(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var N9=typeof document<"u",O9=function(){},Do=N9?v.useLayoutEffect:O9;const M9={...jb};function tp(e){const t=v.useRef(e);return Do(()=>{t.current=e}),t}const L9=M9.useInsertionEffect,I9=L9||(e=>e());function Eo(e){const t=v.useRef(()=>{});return I9(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function ME(e,t,n){let{reference:r,floating:o}=e;const s=eo(t),c=zb(t),d=Ib(c),f=io(t),p=s==="y",m=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,y=r[d]/2-o[d]/2;let x;switch(f){case"top":x={x:m,y:r.y-o.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:g};break;case"left":x={x:r.x-o.width,y:g};break;default:x={x:r.x,y:r.y}}switch(lu(t)){case"start":x[c]-=y*(n&&p?-1:1);break;case"end":x[c]+=y*(n&&p?-1:1);break}return x}const z9=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,d=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=ME(p,r,f),y=r,x={},S=0;for(let j=0;j<d.length;j++){const{name:C,fn:T}=d[j],{x:R,y:E,data:_,reset:k}=await T({x:m,y:g,initialPlacement:r,placement:y,strategy:o,middlewareData:x,rects:p,platform:c,elements:{reference:e,floating:t}});m=R??m,g=E??g,x={...x,[C]:{...x[C],..._}},k&&S<=50&&(S++,typeof k=="object"&&(k.placement&&(y=k.placement),k.rects&&(p=k.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:m,y:g}=ME(p,y,f)),j=-1)}return{x:m,y:g,placement:y,strategy:o,middlewareData:x}};async function Nd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:c,elements:d,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:y=!1,padding:x=0}=Mo(t,e),S=$b(x),C=d[y?g==="floating"?"reference":"floating":g],T=Wc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(C)))==null||n?C:C.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(d.floating)),boundary:p,rootBoundary:m,strategy:f})),R=g==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d.floating)),_=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},k=Wc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:R,offsetParent:E,strategy:f}):R);return{top:(T.top-k.top+S.top)/_.y,bottom:(k.bottom-T.bottom+S.bottom)/_.y,left:(T.left-k.left+S.left)/_.x,right:(k.right-T.right+S.right)/_.x}}const $9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:c,elements:d,middlewareData:f}=t,{element:p,padding:m=0}=Mo(e,t)||{};if(p==null)return{};const g=$b(m),y={x:n,y:r},x=zb(o),S=Ib(x),j=await c.getDimensions(p),C=x==="y",T=C?"top":"left",R=C?"bottom":"right",E=C?"clientHeight":"clientWidth",_=s.reference[S]+s.reference[x]-y[x]-s.floating[S],k=y[x]-s.reference[x],I=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let D=I?I[E]:0;(!D||!await(c.isElement==null?void 0:c.isElement(I)))&&(D=d.floating[E]||s.floating[S]);const P=_/2-k/2,$=D/2-j[S]/2-1,B=ro(g[T],$),Q=ro(g[R],$),K=B,Z=D-j[S]-Q,U=D/2-j[S]/2+P,G=Mx(K,U,Z),M=!f.arrow&&lu(o)!=null&&U!==G&&s.reference[S]/2-(U<K?B:Q)-j[S]/2<0,L=M?U<K?U-K:U-Z:0;return{[x]:y[x]+L,data:{[x]:G,centerOffset:U-G-L,...M&&{alignmentOffset:L}},reset:M}}}),U9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:c,initialPlacement:d,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=Mo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=io(o),R=eo(d),E=io(d)===d,_=await(f.isRTL==null?void 0:f.isRTL(p.floating)),k=y||(E||!j?[Np(d)]:g9(d)),I=S!=="none";!y&&I&&k.push(...b9(d,j,S,_));const D=[d,...k],P=await Nd(t,C),$=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&$.push(P[T]),g){const U=m9(o,c,_);$.push(P[U[0]],P[U[1]])}if(B=[...B,{placement:o,overflows:$}],!$.every(U=>U<=0)){var Q,K;const U=(((Q=s.flip)==null?void 0:Q.index)||0)+1,G=D[U];if(G&&(!(g==="alignment"?R!==eo(G):!1)||B.every(z=>eo(z.placement)===R?z.overflows[0]>0:!0)))return{data:{index:U,overflows:B},reset:{placement:G}};let M=(K=B.filter(L=>L.overflows[0]<=0).sort((L,z)=>L.overflows[1]-z.overflows[1])[0])==null?void 0:K.placement;if(!M)switch(x){case"bestFit":{var Z;const L=(Z=B.filter(z=>{if(I){const F=eo(z.placement);return F===R||F==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(F=>F>0).reduce((F,Y)=>F+Y,0)]).sort((z,F)=>z[1]-F[1])[0])==null?void 0:Z[0];L&&(M=L);break}case"initialPlacement":M=d;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function LE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function IE(e){return d9.some(t=>e[t]>=0)}const B9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Mo(e,t);switch(r){case"referenceHidden":{const s=await Nd(t,{...o,elementContext:"reference"}),c=LE(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:IE(c)}}}case"escaped":{const s=await Nd(t,{...o,altBoundary:!0}),c=LE(s,n.floating);return{data:{escapedOffsets:c,escaped:IE(c)}}}default:return{}}}}};function b2(e){const t=ro(...e.map(s=>s.left)),n=ro(...e.map(s=>s.top)),r=Er(...e.map(s=>s.right)),o=Er(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:o-n}}function V9(e){const t=e.slice().sort((o,s)=>o.y-s.y),n=[];let r=null;for(let o=0;o<t.length;o++){const s=t[o];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(o=>Wc(b2(o)))}const F9=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:c}=t,{padding:d=2,x:f,y:p}=Mo(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),g=V9(m),y=Wc(b2(m)),x=$b(d);function S(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&p!=null)return g.find(C=>f>C.left-x.left&&f<C.right+x.right&&p>C.top-x.top&&p<C.bottom+x.bottom)||y;if(g.length>=2){if(eo(n)==="y"){const B=g[0],Q=g[g.length-1],K=io(n)==="top",Z=B.top,U=Q.bottom,G=K?B.left:Q.left,M=K?B.right:Q.right,L=M-G,z=U-Z;return{top:Z,bottom:U,left:G,right:M,width:L,height:z,x:G,y:Z}}const C=io(n)==="left",T=Er(...g.map(B=>B.right)),R=ro(...g.map(B=>B.left)),E=g.filter(B=>C?B.left===R:B.right===T),_=E[0].top,k=E[E.length-1].bottom,I=R,D=T,P=D-I,$=k-_;return{top:_,bottom:k,left:I,right:D,width:P,height:$,x:I,y:_}}return y}const j=await s.getElementRects({reference:{getBoundingClientRect:S},floating:r.floating,strategy:c});return o.reference.x!==j.reference.x||o.reference.y!==j.reference.y||o.reference.width!==j.reference.width||o.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}},S2=new Set(["left","top"]);async function H9(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=io(n),d=lu(n),f=eo(n)==="y",p=S2.has(c)?-1:1,m=s&&f?-1:1,g=Mo(t,e);let{mainAxis:y,crossAxis:x,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof S=="number"&&(x=d==="end"?S*-1:S),f?{x:x*m,y:y*p}:{x:y*p,y:x*m}}const q9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:c,middlewareData:d}=t,f=await H9(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:{...f,placement:c}}}}},G9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:T,y:R}=C;return{x:T,y:R}}},...f}=Mo(e,t),p={x:n,y:r},m=await Nd(t,f),g=eo(io(o)),y=Lb(g);let x=p[y],S=p[g];if(s){const C=y==="y"?"top":"left",T=y==="y"?"bottom":"right",R=x+m[C],E=x-m[T];x=Mx(R,x,E)}if(c){const C=g==="y"?"top":"left",T=g==="y"?"bottom":"right",R=S+m[C],E=S-m[T];S=Mx(R,S,E)}const j=d.fn({...t,[y]:x,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[y]:s,[g]:c}}}}}},Q9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=Mo(e,t),m={x:n,y:r},g=eo(o),y=Lb(g);let x=m[y],S=m[g];const j=Mo(d,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const E=y==="y"?"height":"width",_=s.reference[y]-s.floating[E]+C.mainAxis,k=s.reference[y]+s.reference[E]-C.mainAxis;x<_?x=_:x>k&&(x=k)}if(p){var T,R;const E=y==="y"?"width":"height",_=S2.has(io(o)),k=s.reference[g]-s.floating[E]+(_&&((T=c.offset)==null?void 0:T[g])||0)+(_?0:C.crossAxis),I=s.reference[g]+s.reference[E]+(_?0:((R=c.offset)==null?void 0:R[g])||0)-(_?C.crossAxis:0);S<k?S=k:S>I&&(S=I)}return{[y]:x,[g]:S}}}},W9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:c,elements:d}=t,{apply:f=()=>{},...p}=Mo(e,t),m=await Nd(t,p),g=io(o),y=lu(o),x=eo(o)==="y",{width:S,height:j}=s.floating;let C,T;g==="top"||g==="bottom"?(C=g,T=y===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(T=g,C=y==="end"?"top":"bottom");const R=j-m.top-m.bottom,E=S-m.left-m.right,_=ro(j-m[C],R),k=ro(S-m[T],E),I=!t.middlewareData.shift;let D=_,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=R),I&&!y){const B=Er(m.left,0),Q=Er(m.right,0),K=Er(m.top,0),Z=Er(m.bottom,0);x?P=S-2*(B!==0||Q!==0?B+Q:Er(m.left,m.right)):D=j-2*(K!==0||Z!==0?K+Z:Er(m.top,m.bottom))}await f({...t,availableWidth:P,availableHeight:D});const $=await c.getDimensions(d.floating);return S!==$.width||j!==$.height?{reset:{rects:!0}}:{}}}};function w2(e){const t=Oi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=hi(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r,d=Pp(n)!==s||Pp(r)!==c;return d&&(n=s,r=c),{width:n,height:r,$:d}}function Ub(e){return wn(e)?e:e.contextElement}function Fc(e){const t=Ub(e);if(!hi(t))return _o(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=w2(t);let c=(s?Pp(n.width):n.width)/r,d=(s?Pp(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const Y9=_o(0);function j2(e){const t=Kr(e);return!hm()||!t.visualViewport?Y9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function K9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Kr(e)?!1:t}function xl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ub(e);let c=_o(1);t&&(r?wn(r)&&(c=Fc(r)):c=Fc(e));const d=K9(s,n,r)?j2(s):_o(0);let f=(o.left+d.x)/c.x,p=(o.top+d.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(s){const y=Kr(s),x=r&&wn(r)?Kr(r):r;let S=y,j=Ox(S);for(;j&&r&&x!==S;){const C=Fc(j),T=j.getBoundingClientRect(),R=Oi(j),E=T.left+(j.clientLeft+parseFloat(R.paddingLeft))*C.x,_=T.top+(j.clientTop+parseFloat(R.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=E,p+=_,S=Kr(j),j=Ox(S)}}return Wc({width:m,height:g,x:f,y:p})}function mm(e,t){const n=pm(e).scrollLeft;return t?t.left+n:xl(Vo(e)).left+n}function C2(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mm(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function X9(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",c=Vo(r),d=t?fm(t.floating):!1;if(r===c||d&&s)return n;let f={scrollLeft:0,scrollTop:0},p=_o(1);const m=_o(0),g=hi(r);if((g||!g&&!s)&&((su(r)!=="body"||ef(c))&&(f=pm(r)),hi(r))){const x=xl(r);p=Fc(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const y=c&&!g&&!s?C2(c,f):_o(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-f.scrollLeft*p.x+m.x+y.x,y:n.y*p.y-f.scrollTop*p.y+m.y+y.y}}function J9(e){return Array.from(e.getClientRects())}function Z9(e){const t=Vo(e),n=pm(e),r=e.ownerDocument.body,o=Er(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Er(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+mm(e);const d=-n.scrollTop;return Oi(r).direction==="rtl"&&(c+=Er(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:c,y:d}}const zE=25;function eL(e,t){const n=Kr(e),r=Vo(e),o=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,d=0,f=0;if(o){s=o.width,c=o.height;const m=hm();(!m||m&&t==="fixed")&&(d=o.offsetLeft,f=o.offsetTop)}const p=mm(r);if(p<=0){const m=r.ownerDocument,g=m.body,y=getComputedStyle(g),x=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(r.clientWidth-g.clientWidth-x);S<=zE&&(s-=S)}else p<=zE&&(s+=p);return{width:s,height:c,x:d,y:f}}const tL=new Set(["absolute","fixed"]);function nL(e,t){const n=xl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=hi(e)?Fc(e):_o(1),c=e.clientWidth*s.x,d=e.clientHeight*s.y,f=o*s.x,p=r*s.y;return{width:c,height:d,x:f,y:p}}function $E(e,t,n){let r;if(t==="viewport")r=eL(e,n);else if(t==="document")r=Z9(Vo(e));else if(wn(t))r=nL(t,n);else{const o=j2(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Wc(r)}function E2(e,t){const n=ba(e);return n===t||!wn(n)||ya(n)?!1:Oi(n).position==="fixed"||E2(n,t)}function rL(e,t){const n=t.get(e);if(n)return n;let r=xa(e,[],!1).filter(d=>wn(d)&&su(d)!=="body"),o=null;const s=Oi(e).position==="fixed";let c=s?ba(e):e;for(;wn(c)&&!ya(c);){const d=Oi(c),f=Mb(c);!f&&d.position==="fixed"&&(o=null),(s?!f&&!o:!f&&d.position==="static"&&!!o&&tL.has(o.position)||ef(c)&&!f&&E2(e,c))?r=r.filter(m=>m!==c):o=d,c=ba(c)}return t.set(e,r),r}function iL(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?fm(t)?[]:rL(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((p,m)=>{const g=$E(t,m,o);return p.top=Er(g.top,p.top),p.right=ro(g.right,p.right),p.bottom=ro(g.bottom,p.bottom),p.left=Er(g.left,p.left),p},$E(t,d,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function oL(e){const{width:t,height:n}=w2(e);return{width:t,height:n}}function aL(e,t,n){const r=hi(t),o=Vo(t),s=n==="fixed",c=xl(e,!0,s,t);let d={scrollLeft:0,scrollTop:0};const f=_o(0);function p(){f.x=mm(o)}if(r||!r&&!s)if((su(t)!=="body"||ef(o))&&(d=pm(t)),r){const x=xl(t,!0,s,t);f.x=x.x+t.clientLeft,f.y=x.y+t.clientTop}else o&&p();s&&!r&&o&&p();const m=o&&!r&&!s?C2(o,d):_o(0),g=c.left+d.scrollLeft-f.x-m.x,y=c.top+d.scrollTop-f.y-m.y;return{x:g,y,width:c.width,height:c.height}}function Vy(e){return Oi(e).position==="static"}function UE(e,t){if(!hi(e)||Oi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Vo(e)===n&&(n=n.ownerDocument.body),n}function T2(e,t){const n=Kr(e);if(fm(e))return n;if(!hi(e)){let o=ba(e);for(;o&&!ya(o);){if(wn(o)&&!Vy(o))return o;o=ba(o)}return n}let r=UE(e,t);for(;r&&i9(r)&&Vy(r);)r=UE(r,t);return r&&ya(r)&&Vy(r)&&!Mb(r)?n:r||c9(e)||n}const sL=async function(e){const t=this.getOffsetParent||T2,n=this.getDimensions,r=await n(e.floating);return{reference:aL(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lL(e){return Oi(e).direction==="rtl"}const cL={convertOffsetParentRelativeRectToViewportRelativeRect:X9,getDocumentElement:Vo,getClippingRect:iL,getOffsetParent:T2,getElementRects:sL,getClientRects:J9,getDimensions:oL,getScale:Fc,isElement:wn,isRTL:lL};function R2(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uL(e,t){let n=null,r;const o=Vo(e);function s(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),s();const p=e.getBoundingClientRect(),{left:m,top:g,width:y,height:x}=p;if(d||t(),!y||!x)return;const S=ep(g),j=ep(o.clientWidth-(m+y)),C=ep(o.clientHeight-(g+x)),T=ep(m),E={rootMargin:-S+"px "+-j+"px "+-C+"px "+-T+"px",threshold:Er(0,ro(1,f))||1};let _=!0;function k(I){const D=I[0].intersectionRatio;if(D!==f){if(!_)return c();D?c(!1,D):r=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!R2(p,e.getBoundingClientRect())&&c(),_=!1}try{n=new IntersectionObserver(k,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,E)}n.observe(e)}return c(!0),s}function zx(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=Ub(e),m=o||s?[...p?xa(p):[],...xa(t)]:[];m.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const g=p&&d?uL(p,n):null;let y=-1,x=null;c&&(x=new ResizeObserver(T=>{let[R]=T;R&&R.target===p&&x&&(x.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var E;(E=x)==null||E.observe(t)})),n()}),p&&!f&&x.observe(p),x.observe(t));let S,j=f?xl(e):null;f&&C();function C(){const T=xl(e);j&&!R2(j,T)&&n(),j=T,S=requestAnimationFrame(C)}return n(),()=>{var T;m.forEach(R=>{o&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),g?.(),(T=x)==null||T.disconnect(),x=null,f&&cancelAnimationFrame(S)}}const dL=q9,fL=G9,hL=U9,pL=W9,mL=B9,BE=$9,gL=F9,vL=Q9,yL=(e,t,n)=>{const r=new Map,o={platform:cL,...n},s={...o.platform,_c:r};return z9(e,t,{...o,platform:s})};var xL=typeof document<"u",bL=function(){},xp=xL?v.useLayoutEffect:bL;function Op(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Op(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Op(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VE(e,t){const n=_2(e);return Math.round(t*n)/n}function Fy(e){const t=v.useRef(e);return xp(()=>{t.current=e}),t}function SL(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:c}={},transform:d=!0,whileElementsMounted:f,open:p}=e,[m,g]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,x]=v.useState(r);Op(y,r)||x(r);const[S,j]=v.useState(null),[C,T]=v.useState(null),R=v.useCallback(z=>{z!==I.current&&(I.current=z,j(z))},[]),E=v.useCallback(z=>{z!==D.current&&(D.current=z,T(z))},[]),_=s||S,k=c||C,I=v.useRef(null),D=v.useRef(null),P=v.useRef(m),$=f!=null,B=Fy(f),Q=Fy(o),K=Fy(p),Z=v.useCallback(()=>{if(!I.current||!D.current)return;const z={placement:t,strategy:n,middleware:y};Q.current&&(z.platform=Q.current),yL(I.current,D.current,z).then(F=>{const Y={...F,isPositioned:K.current!==!1};U.current&&!Op(P.current,Y)&&(P.current=Y,Ob.flushSync(()=>{g(Y)}))})},[y,t,n,Q,K]);xp(()=>{p===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(z=>({...z,isPositioned:!1})))},[p]);const U=v.useRef(!1);xp(()=>(U.current=!0,()=>{U.current=!1}),[]),xp(()=>{if(_&&(I.current=_),k&&(D.current=k),_&&k){if(B.current)return B.current(_,k,Z);Z()}},[_,k,Z,B,$]);const G=v.useMemo(()=>({reference:I,floating:D,setReference:R,setFloating:E}),[R,E]),M=v.useMemo(()=>({reference:_,floating:k}),[_,k]),L=v.useMemo(()=>{const z={position:n,left:0,top:0};if(!M.floating)return z;const F=VE(M.floating,m.x),Y=VE(M.floating,m.y);return d?{...z,transform:"translate("+F+"px, "+Y+"px)",..._2(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Y}},[n,d,M.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:Z,refs:G,elements:M,floatingStyles:L}),[m,Z,G,M,L])}const wL=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?BE({element:r.current,padding:o}).fn(n):{}:r?BE({element:r,padding:o}).fn(n):{}}}},D2=(e,t)=>({...dL(e),options:[e,t]}),Bb=(e,t)=>({...fL(e),options:[e,t]}),FE=(e,t)=>({...vL(e),options:[e,t]}),Mp=(e,t)=>({...hL(e),options:[e,t]}),jL=(e,t)=>({...pL(e),options:[e,t]}),CL=(e,t)=>({...mL(e),options:[e,t]}),Cd=(e,t)=>({...gL(e),options:[e,t]}),A2=(e,t)=>({...wL(e),options:[e,t]});function k2(e){const t=v.useRef(void 0),n=v.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const c=s,d=c(r);return typeof d=="function"?d:()=>{c(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s?.())}},e);return v.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const EL="data-floating-ui-focusable",HE="active",qE="selected",TL={...jb};let GE=!1,RL=0;const QE=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+RL++;function _L(){const[e,t]=v.useState(()=>GE?QE():void 0);return Do(()=>{e==null&&t(QE())},[]),v.useEffect(()=>{GE=!0},[]),e}const DL=TL.useId,P2=DL||_L;function AL(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const kL=v.createContext(null),PL=v.createContext(null),Vb=()=>{var e;return((e=v.useContext(kL))==null?void 0:e.id)||null},Fb=()=>v.useContext(PL);function Hb(e){return"data-floating-ui-"+e}function Di(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const WE=Hb("safe-polygon");function bp(e,t,n){if(n&&!Ix(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Hy(e){return typeof e=="function"?e():e}function NL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:c}=e,{enabled:d=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:y=!0}=t,x=Fb(),S=Vb(),j=tp(p),C=tp(f),T=tp(n),R=tp(g),E=v.useRef(),_=v.useRef(-1),k=v.useRef(),I=v.useRef(-1),D=v.useRef(!0),P=v.useRef(!1),$=v.useRef(()=>{}),B=v.useRef(!1),Q=Eo(()=>{var L;const z=(L=o.current.openEvent)==null?void 0:L.type;return z?.includes("mouse")&&z!=="mousedown"});v.useEffect(()=>{if(!d)return;function L(z){let{open:F}=z;F||(Di(_),Di(I),D.current=!0,B.current=!1)}return s.on("openchange",L),()=>{s.off("openchange",L)}},[d,s]),v.useEffect(()=>{if(!d||!j.current||!n)return;function L(F){Q()&&r(!1,F,"hover")}const z=ll(c.floating).documentElement;return z.addEventListener("mouseleave",L),()=>{z.removeEventListener("mouseleave",L)}},[c.floating,n,r,d,j,Q]);const K=v.useCallback(function(L,z,F){z===void 0&&(z=!0),F===void 0&&(F="hover");const Y=bp(C.current,"close",E.current);Y&&!k.current?(Di(_),_.current=window.setTimeout(()=>r(!1,L,F),Y)):z&&(Di(_),r(!1,L,F))},[C,r]),Z=Eo(()=>{$.current(),k.current=void 0}),U=Eo(()=>{if(P.current){const L=ll(c.floating).body;L.style.pointerEvents="",L.removeAttribute(WE),P.current=!1}}),G=Eo(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);v.useEffect(()=>{if(!d)return;function L(H){if(Di(_),D.current=!1,m&&!Ix(E.current)||Hy(R.current)>0&&!bp(C.current,"open"))return;const se=bp(C.current,"open",E.current);se?_.current=window.setTimeout(()=>{T.current||r(!0,H,"hover")},se):n||r(!0,H,"hover")}function z(H){if(G()){U();return}$.current();const se=ll(c.floating);if(Di(I),B.current=!1,j.current&&o.current.floatingContext){n||Di(_),k.current=j.current({...o.current.floatingContext,tree:x,x:H.clientX,y:H.clientY,onClose(){U(),Z(),G()||K(H,!0,"safe-polygon")}});const ye=k.current;se.addEventListener("mousemove",ye),$.current=()=>{se.removeEventListener("mousemove",ye)};return}(E.current!=="touch"||!Pd(c.floating,H.relatedTarget))&&K(H)}function F(H){G()||o.current.floatingContext&&(j.current==null||j.current({...o.current.floatingContext,tree:x,x:H.clientX,y:H.clientY,onClose(){U(),Z(),G()||K(H)}})(H))}function Y(){Di(_)}function O(H){G()||K(H,!1)}if(wn(c.domReference)){const H=c.domReference,se=c.floating;return n&&H.addEventListener("mouseleave",F),y&&H.addEventListener("mousemove",L,{once:!0}),H.addEventListener("mouseenter",L),H.addEventListener("mouseleave",z),se&&(se.addEventListener("mouseleave",F),se.addEventListener("mouseenter",Y),se.addEventListener("mouseleave",O)),()=>{n&&H.removeEventListener("mouseleave",F),y&&H.removeEventListener("mousemove",L),H.removeEventListener("mouseenter",L),H.removeEventListener("mouseleave",z),se&&(se.removeEventListener("mouseleave",F),se.removeEventListener("mouseenter",Y),se.removeEventListener("mouseleave",O))}}},[c,d,e,m,y,K,Z,U,r,n,T,x,C,j,o,G,R]),Do(()=>{var L;if(d&&n&&(L=j.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&Q()){P.current=!0;const F=c.floating;if(wn(c.domReference)&&F){var z;const Y=ll(c.floating).body;Y.setAttribute(WE,"");const O=c.domReference,H=x==null||(z=x.nodesRef.current.find(se=>se.id===S))==null||(z=z.context)==null?void 0:z.elements.floating;return H&&(H.style.pointerEvents=""),Y.style.pointerEvents="none",O.style.pointerEvents="auto",F.style.pointerEvents="auto",()=>{Y.style.pointerEvents="",O.style.pointerEvents="",F.style.pointerEvents=""}}}},[d,n,S,c,x,j,Q]),Do(()=>{n||(E.current=void 0,B.current=!1,Z(),U())},[n,Z,U]),v.useEffect(()=>()=>{Z(),Di(_),Di(I),U()},[d,c.domReference,Z,U]);const M=v.useMemo(()=>{function L(z){E.current=z.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(z){const{nativeEvent:F}=z;function Y(){!D.current&&!T.current&&r(!0,F,"hover")}m&&!Ix(E.current)||n||Hy(R.current)===0||B.current&&z.movementX**2+z.movementY**2<2||(Di(I),E.current==="touch"?Y():(B.current=!0,I.current=window.setTimeout(Y,Hy(R.current))))}}},[m,r,n,T,R]);return v.useMemo(()=>d?{reference:M}:{},[d,M])}const $x=()=>{},N2=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:$x,setState:$x,isInstantPhase:!1}),OL=()=>v.useContext(N2);function ML(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,s]=v.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=v.useRef(null),d=v.useCallback(f=>{s({currentId:f})},[]);return Do(()=>{o.currentId?c.current===null?c.current=o.currentId:o.isInstantPhase||s({isInstantPhase:!0}):(o.isInstantPhase&&s({isInstantPhase:!1}),c.current=null)},[o.currentId,o.isInstantPhase]),a.jsx(N2.Provider,{value:v.useMemo(()=>({...o,setState:s,setCurrentId:d}),[o,d]),children:t})}function LL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:s,enabled:c=!0}=t,d=s??o,f=OL(),{currentId:p,setCurrentId:m,initialDelay:g,setState:y,timeoutMs:x}=f;return Do(()=>{c&&p&&(y({delay:{open:1,close:bp(g,"close")}}),p!==d&&r(!1))},[c,d,r,y,p,g]),Do(()=>{function S(){r(!1),y({delay:g,currentId:null})}if(c&&p&&!n&&p===d){if(x){const j=window.setTimeout(S,x);return()=>{clearTimeout(j)}}S()}},[c,n,y,p,d,r,g,x]),Do(()=>{c&&(m===$x||!n||m(d))},[c,n,m,d]),f}const IL={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zL={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},YE=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function $L(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:y=!1,bubbles:x,capture:S}=t,j=Fb(),C=Eo(typeof f=="function"?f:()=>!1),T=typeof f=="function"?C:f,R=v.useRef(!1),{escapeKey:E,outsidePress:_}=YE(x),{escapeKey:k,outsidePress:I}=YE(S),D=v.useRef(!1),P=Eo(U=>{var G;if(!n||!c||!d||U.key!=="Escape"||D.current)return;const M=(G=s.current.floatingContext)==null?void 0:G.nodeId,L=j?yp(j.nodesRef.current,M):[];if(!E&&(U.stopPropagation(),L.length>0)){let z=!0;if(L.forEach(F=>{var Y;if((Y=F.context)!=null&&Y.open&&!F.context.dataRef.current.__escapeKeyBubbles){z=!1;return}}),!z)return}r(!1,P9(U)?U.nativeEvent:U,"escape-key")}),$=Eo(U=>{var G;const M=()=>{var L;P(U),(L=Ic(U))==null||L.removeEventListener("keydown",M)};(G=Ic(U))==null||G.addEventListener("keydown",M)}),B=Eo(U=>{var G;const M=s.current.insideReactTree;s.current.insideReactTree=!1;const L=R.current;if(R.current=!1,p==="click"&&L||M||typeof T=="function"&&!T(U))return;const z=Ic(U),F="["+Hb("inert")+"]",Y=ll(o.floating).querySelectorAll(F);let O=wn(z)?z:null;for(;O&&!ya(O);){const ye=ba(O);if(ya(ye)||!wn(ye))break;O=ye}if(Y.length&&wn(z)&&!_9(z)&&!Pd(z,o.floating)&&Array.from(Y).every(ye=>!Pd(O,ye)))return;if(hi(z)&&Z){const ye=ya(z),we=Oi(z),Ee=/auto|scroll/,Xe=ye||Ee.test(we.overflowX),Ae=ye||Ee.test(we.overflowY),dt=Xe&&z.clientWidth>0&&z.scrollWidth>z.clientWidth,Et=Ae&&z.clientHeight>0&&z.scrollHeight>z.clientHeight,it=we.direction==="rtl",rt=Et&&(it?U.offsetX<=z.offsetWidth-z.clientWidth:U.offsetX>z.clientWidth),mt=dt&&U.offsetY>z.clientHeight;if(rt||mt)return}const H=(G=s.current.floatingContext)==null?void 0:G.nodeId,se=j&&yp(j.nodesRef.current,H).some(ye=>{var we;return By(U,(we=ye.context)==null?void 0:we.elements.floating)});if(By(U,o.floating)||By(U,o.domReference)||se)return;const de=j?yp(j.nodesRef.current,H):[];if(de.length>0){let ye=!0;if(de.forEach(we=>{var Ee;if((Ee=we.context)!=null&&Ee.open&&!we.context.dataRef.current.__outsidePressBubbles){ye=!1;return}}),!ye)return}r(!1,U,"outside-press")}),Q=Eo(U=>{var G;const M=()=>{var L;B(U),(L=Ic(U))==null||L.removeEventListener(p,M)};(G=Ic(U))==null||G.addEventListener(p,M)});v.useEffect(()=>{if(!n||!c)return;s.current.__escapeKeyBubbles=E,s.current.__outsidePressBubbles=_;let U=-1;function G(Y){r(!1,Y,"ancestor-scroll")}function M(){window.clearTimeout(U),D.current=!0}function L(){U=window.setTimeout(()=>{D.current=!1},hm()?5:0)}const z=ll(o.floating);d&&(z.addEventListener("keydown",k?$:P,k),z.addEventListener("compositionstart",M),z.addEventListener("compositionend",L)),T&&z.addEventListener(p,I?Q:B,I);let F=[];return y&&(wn(o.domReference)&&(F=xa(o.domReference)),wn(o.floating)&&(F=F.concat(xa(o.floating))),!wn(o.reference)&&o.reference&&o.reference.contextElement&&(F=F.concat(xa(o.reference.contextElement)))),F=F.filter(Y=>{var O;return Y!==((O=z.defaultView)==null?void 0:O.visualViewport)}),F.forEach(Y=>{Y.addEventListener("scroll",G,{passive:!0})}),()=>{d&&(z.removeEventListener("keydown",k?$:P,k),z.removeEventListener("compositionstart",M),z.removeEventListener("compositionend",L)),T&&z.removeEventListener(p,I?Q:B,I),F.forEach(Y=>{Y.removeEventListener("scroll",G)}),window.clearTimeout(U)}},[s,o,d,T,p,n,r,y,c,E,_,P,k,$,B,I,Q]),v.useEffect(()=>{s.current.insideReactTree=!1},[s,T,p]);const K=v.useMemo(()=>({onKeyDown:P,...m&&{[IL[g]]:U=>{r(!1,U.nativeEvent,"reference-press")},...g!=="click"&&{onClick(U){r(!1,U.nativeEvent,"reference-press")}}}}),[P,r,m,g]),Z=v.useMemo(()=>({onKeyDown:P,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[zL[p]]:()=>{s.current.insideReactTree=!0}}),[P,p,s]);return v.useMemo(()=>c?{reference:K,floating:Z}:{},[c,K,Z])}function UL(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=P2(),s=v.useRef({}),[c]=v.useState(()=>AL()),d=Vb()!=null,[f,p]=v.useState(r.reference),m=Eo((x,S,j)=>{s.current.openEvent=x?S:void 0,c.emit("openchange",{open:x,event:S,reason:j,nested:d}),n?.(x,S,j)}),g=v.useMemo(()=>({setPositionReference:p}),[]),y=v.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return v.useMemo(()=>({dataRef:s,open:t,onOpenChange:m,elements:y,events:c,floatingId:o,refs:g}),[t,m,y,c,o,g])}function qb(e){e===void 0&&(e={});const{nodeId:t}=e,n=UL({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,c]=v.useState(null),[d,f]=v.useState(null),m=o?.domReference||s,g=v.useRef(null),y=Fb();Do(()=>{m&&(g.current=m)},[m]);const x=SL({...e,elements:{...o,...d&&{reference:d}}}),S=v.useCallback(E=>{const _=wn(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),getClientRects:()=>E.getClientRects(),contextElement:E}:E;f(_),x.refs.setReference(_)},[x.refs]),j=v.useCallback(E=>{(wn(E)||E===null)&&(g.current=E,c(E)),(wn(x.refs.reference.current)||x.refs.reference.current===null||E!==null&&!wn(E))&&x.refs.setReference(E)},[x.refs]),C=v.useMemo(()=>({...x.refs,setReference:j,setPositionReference:S,domReference:g}),[x.refs,j,S]),T=v.useMemo(()=>({...x.elements,domReference:m}),[x.elements,m]),R=v.useMemo(()=>({...x,...r,refs:C,elements:T,nodeId:t}),[x,C,T,t,r]);return Do(()=>{r.dataRef.current.floatingContext=R;const E=y?.nodesRef.current.find(_=>_.id===t);E&&(E.context=R)}),v.useMemo(()=>({...x,context:R,refs:C,elements:T}),[x,C,T,R])}function qy(){return E9()&&C9()}function BL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:c}=e,{enabled:d=!0,visibleOnly:f=!0}=t,p=v.useRef(!1),m=v.useRef(-1),g=v.useRef(!0);v.useEffect(()=>{if(!d)return;const x=Kr(c.domReference);function S(){!n&&hi(c.domReference)&&c.domReference===OE(ll(c.domReference))&&(p.current=!0)}function j(){g.current=!0}function C(){g.current=!1}return x.addEventListener("blur",S),qy()&&(x.addEventListener("keydown",j,!0),x.addEventListener("pointerdown",C,!0)),()=>{x.removeEventListener("blur",S),qy()&&(x.removeEventListener("keydown",j,!0),x.removeEventListener("pointerdown",C,!0))}},[c.domReference,n,d]),v.useEffect(()=>{if(!d)return;function x(S){let{reason:j}=S;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return o.on("openchange",x),()=>{o.off("openchange",x)}},[o,d]),v.useEffect(()=>()=>{Di(m)},[]);const y=v.useMemo(()=>({onMouseLeave(){p.current=!1},onFocus(x){if(p.current)return;const S=Ic(x.nativeEvent);if(f&&wn(S)){if(qy()&&!x.relatedTarget){if(!g.current&&!D9(S))return}else if(!A9(S))return}r(!0,x.nativeEvent,"focus")},onBlur(x){p.current=!1;const S=x.relatedTarget,j=x.nativeEvent,C=wn(S)&&S.hasAttribute(Hb("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var T;const R=OE(c.domReference?c.domReference.ownerDocument:document);!S&&R===c.domReference||Pd((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,R)||Pd(c.domReference,R)||C||r(!1,j,"focus")})}}),[s,c.domReference,r,f]);return v.useMemo(()=>d?{reference:y}:{},[d,y])}function Gy(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[HE]:c,[qE]:d,...f}=e;s=f}return{...n==="floating"&&{tabIndex:-1,[EL]:""},...s,...t.map(c=>{const d=c?c[n]:null;return typeof d=="function"?e?d(e):null:d}).concat(e).reduce((c,d)=>(d&&Object.entries(d).forEach(f=>{let[p,m]=f;if(!(o&&[HE,qE].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 y,x=arguments.length,S=new Array(x),j=0;j<x;j++)S[j]=arguments[j];return(y=r.get(p))==null?void 0:y.map(C=>C(...S)).find(C=>C!==void 0)}}}else c[p]=m}),c),{})}}function VL(e){e===void 0&&(e=[]);const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),r=e.map(d=>d?.item),o=v.useCallback(d=>Gy(d,e,"reference"),t),s=v.useCallback(d=>Gy(d,e,"floating"),n),c=v.useCallback(d=>Gy(d,e,"item"),r);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c}),[o,s,c])}const FL=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function HL(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:c}=e,{enabled:d=!0,role:f="dialog"}=t,p=P2(),m=((n=s.domReference)==null?void 0:n.id)||p,g=v.useMemo(()=>{var R;return((R=k9(s.floating))==null?void 0:R.id)||c},[s.floating,c]),y=(r=FL.get(f))!=null?r:f,S=Vb()!=null,j=v.useMemo(()=>y==="tooltip"||f==="label"?{["aria-"+(f==="label"?"labelledby":"describedby")]:o?g:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":y==="alertdialog"?"dialog":y,"aria-controls":o?g:void 0,...y==="listbox"&&{role:"combobox"},...y==="menu"&&{id:m},...y==="menu"&&S&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[y,g,S,o,m,f]),C=v.useMemo(()=>{const R={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?R:{...R,...y==="menu"&&{"aria-labelledby":m}}},[y,g,m,f]),T=v.useCallback(R=>{let{active:E,selected:_}=R;const k={role:"option",...E&&{id:g+"-fui-option"}};switch(f){case"select":case"combobox":return{...k,"aria-selected":_}}return{}},[g,f]);return v.useMemo(()=>d?{reference:j,floating:C,item:T}:{},[d,j,C,T])}const[qL,Ii]=Ar("ScrollArea.Root component was not found in tree");function Yc(e,t){const n=il(t);kl(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const GL=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Ii(),[s,c]=v.useState(0),[d,f]=v.useState(0),p=!!(s&&d);return Yc(o.scrollbarX,()=>{const m=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(m),f(m)}),Yc(o.scrollbarY,()=>{const m=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(m),c(m)}),p?a.jsx("div",{...r,ref:t,style:{...n,width:s,height:d}}):null}),QL=v.forwardRef((e,t)=>{const n=Ii(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(GL,{...e,ref:t}):null}),WL={scrollHideDelay:1e3,type:"hover"},O2=v.forwardRef((e,t)=>{const{type:n,scrollHideDelay:r,scrollbars:o,getStyles:s,...c}=oe("ScrollAreaRoot",WL,e),[d,f]=v.useState(null),[p,m]=v.useState(null),[g,y]=v.useState(null),[x,S]=v.useState(null),[j,C]=v.useState(null),[T,R]=v.useState(0),[E,_]=v.useState(0),[k,I]=v.useState(!1),[D,P]=v.useState(!1),$=Un(t,B=>f(B));return a.jsx(qL,{value:{type:n,scrollHideDelay:r,scrollArea:d,viewport:p,onViewportChange:m,content:g,onContentChange:y,scrollbarX:x,onScrollbarXChange:S,scrollbarXEnabled:k,onScrollbarXEnabledChange:I,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:D,onScrollbarYEnabledChange:P,onCornerWidthChange:R,onCornerHeightChange:_,getStyles:s},children:a.jsx(le,{...c,ref:$,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${T}px`,"--sa-corner-height":o!=="xy"?"0px":`${E}px`}})})});O2.displayName="@mantine/core/ScrollAreaRoot";function M2(e,t){const n=e/t;return Number.isNaN(n)?0:n}function gm(e){const t=M2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function L2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function YL(e,[t,n]){return Math.min(n,Math.max(t,e))}function KE(e,t,n="ltr"){const r=gm(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,c=t.content-t.viewport,d=s-r,f=n==="ltr"?[0,c]:[c*-1,0],p=YL(e,f);return L2([0,c],[0,d])(p)}function KL(e,t,n,r="ltr"){const o=gm(n),s=o/2,c=t||s,d=o-c,f=n.scrollbar.paddingStart+c,p=n.scrollbar.size-n.scrollbar.paddingEnd-d,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return L2([f,p],g)(e)}function I2(e,t){return e>0&&e<t}function ms(e){return e?parseInt(e,10):0}function ml(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}const[XL,z2]=Ar("ScrollAreaScrollbar was not found in tree"),$2=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,y=Ii(),[x,S]=v.useState(null),j=Un(t,P=>S(P)),C=v.useRef(null),T=v.useRef(""),{viewport:R}=y,E=n.content-n.viewport,_=il(p),k=il(d),I=Xd(m,10),D=P=>{if(C.current){const $=P.clientX-C.current.left,B=P.clientY-C.current.top;f({x:$,y:B})}};return v.useEffect(()=>{const P=$=>{const B=$.target;x?.contains(B)&&_($,E)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[R,x,E,_]),v.useEffect(k,[n,k]),Yc(x,I),Yc(y.content,I),a.jsx(XL,{value:{scrollbar:x,hasThumb:r,onThumbChange:il(o),onThumbPointerUp:il(s),onThumbPositionChange:k,onThumbPointerDown:il(c)},children:a.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:ml(e.onPointerDown,P=>{P.preventDefault(),P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=x.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",D(P))}),onPointerMove:ml(e.onPointerMove,D),onPointerUp:ml(e.onPointerUp,P=>{const $=P.target;$.hasPointerCapture(P.pointerId)&&(P.preventDefault(),$.releasePointerCapture(P.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,C.current=null}})})}),U2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=Ii(),[d,f]=v.useState(),p=v.useRef(null),m=Un(t,p,c.onScrollbarXChange);return v.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),a.jsx($2,{"data-orientation":"horizontal",...s,ref:m,sizes:n,style:{...o,"--sa-thumb-width":`${gm(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,y)=>{if(c.viewport){const x=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(x),I2(x,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:ms(d.paddingLeft),paddingEnd:ms(d.paddingRight)}})}})});U2.displayName="@mantine/core/ScrollAreaScrollbarX";const B2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=Ii(),[d,f]=v.useState(),p=v.useRef(null),m=Un(t,p,c.onScrollbarYChange);return v.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),a.jsx($2,{...s,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${gm(n)}px`,...o},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,y)=>{if(c.viewport){const x=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(x),I2(x,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:ms(d.paddingTop),paddingEnd:ms(d.paddingBottom)}})}})});B2.displayName="@mantine/core/ScrollAreaScrollbarY";const vm=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=Cs(),s=Ii(),c=v.useRef(null),d=v.useRef(0),[f,p]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=M2(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:x=>{c.current=x},onThumbPointerUp:()=>{d.current=0},onThumbPointerDown:x=>{d.current=x}},y=(x,S)=>KL(x,d.current,f,S);return n==="horizontal"?a.jsx(U2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const x=s.viewport.scrollLeft,S=KE(x,f,o);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=y(x,o))}}):n==="vertical"?a.jsx(B2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const x=s.viewport.scrollTop,S=KE(x,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:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=y(x))}}):null});vm.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Gb=v.forwardRef((e,t)=>{const n=Ii(),{forceMount:r,...o}=e,[s,c]=v.useState(!1),d=e.orientation==="horizontal",f=Xd(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?p:m)}},10);return Yc(n.viewport,f),Yc(n.content,f),r||s?a.jsx(vm,{"data-state":s?"visible":"hidden",...o,ref:t}):null});Gb.displayName="@mantine/core/ScrollAreaScrollbarAuto";const V2=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ii(),[s,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:d}=o;let f=0;if(d){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return d.addEventListener("pointerenter",p),d.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),d.removeEventListener("pointerenter",p),d.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),n||s?a.jsx(Gb,{"data-state":s?"visible":"hidden",...r,ref:t}):null});V2.displayName="@mantine/core/ScrollAreaScrollbarHover";const JL=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ii(),s=e.orientation==="horizontal",[c,d]=v.useState("hidden"),f=Xd(()=>d("idle"),100);return v.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>d("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,o.scrollHideDelay]),v.useEffect(()=>{const{viewport:p}=o,m=s?"scrollLeft":"scrollTop";if(p){let g=p[m];const y=()=>{const x=p[m];g!==x&&(d("scrolling"),f()),g=x};return p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[o.viewport,s,f]),n||c!=="hidden"?a.jsx(vm,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ml(e.onPointerEnter,()=>d("interacting")),onPointerLeave:ml(e.onPointerLeave,()=>d("idle"))}):null}),Ux=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ii(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,d=e.orientation==="horizontal";return v.useEffect(()=>(d?s(!0):c(!0),()=>{d?s(!1):c(!1)}),[d,s,c]),o.type==="hover"?a.jsx(V2,{...r,ref:t,forceMount:n}):o.type==="scroll"?a.jsx(JL,{...r,ref:t,forceMount:n}):o.type==="auto"?a.jsx(Gb,{...r,ref:t,forceMount:n}):o.type==="always"?a.jsx(vm,{...r,ref:t}):null});Ux.displayName="@mantine/core/ScrollAreaScrollbar";function ZL(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const s={left:e.scrollLeft,top:e.scrollTop},c=n.left!==s.left,d=n.top!==s.top;(c||d)&&t(),n=s,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)}const F2=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Ii(),s=z2(),{onThumbPositionChange:c}=s,d=Un(t,m=>s.onThumbChange(m)),f=v.useRef(void 0),p=Xd(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=o;if(m){const g=()=>{if(p(),!f.current){const y=ZL(m,c);f.current=y,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[o.viewport,p,c]),a.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...r,ref:d,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:ml(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),x=m.clientX-y.left,S=m.clientY-y.top;s.onThumbPointerDown({x,y:S})}),onPointerUp:ml(e.onPointerUp,s.onThumbPointerUp)})});F2.displayName="@mantine/core/ScrollAreaThumb";const Bx=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=z2();return n||o.hasThumb?a.jsx(F2,{ref:t,...r}):null});Bx.displayName="@mantine/core/ScrollAreaThumb";const H2=v.forwardRef(({children:e,style:t,...n},r)=>{const o=Ii(),s=Un(r,o.onViewportChange);return a.jsx(le,{...n,ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:a.jsx("div",{...o.getStyles("content"),ref:o.onContentChange,children:e})})});H2.displayName="@mantine/core/ScrollAreaViewport";var Qb={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const q2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},eI=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":ue(t),"--scrollarea-over-scroll-behavior":n}}),Jr=ge((e,t)=>{const n=oe("ScrollArea",q2,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:y,viewportRef:x,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:T,onBottomReached:R,onTopReached:E,overscrollBehavior:_,attributes:k,...I}=n,[D,P]=v.useState(!1),[$,B]=v.useState(!1),[Q,K]=v.useState(!1),Z=Ie({name:"ScrollArea",props:n,classes:Qb,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:k,vars:p,varsResolver:eI}),U=v.useRef(null),G=k2([x,U]);return v.useEffect(()=>{if(!U.current||C!=="present")return;const M=U.current,L=new ResizeObserver(()=>{const{scrollHeight:z,clientHeight:F,scrollWidth:Y,clientWidth:O}=M;B(z>F),K(Y>O)});return L.observe(M),()=>L.disconnect()},[U,C]),a.jsxs(O2,{getStyles:Z,type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:T,...Z("root"),...I,children:[a.jsx(H2,{...y,...Z("viewport",{style:y?.style}),ref:G,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":T||void 0,"data-horizontal-hidden":C==="present"&&!Q?"true":void 0,"data-vertical-hidden":C==="present"&&!$?"true":void 0,onScroll:M=>{y?.onScroll?.(M),S?.({x:M.currentTarget.scrollLeft,y:M.currentTarget.scrollTop});const{scrollTop:L,scrollHeight:z,clientHeight:F}=M.currentTarget;L-(z-F)>=-.6&&R?.(),L===0&&E?.()},children:j}),(T==="xy"||T==="x")&&a.jsx(Ux,{...Z("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!Q?!0:void 0,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:a.jsx(Bx,{...Z("thumb")})}),(T==="xy"||T==="y")&&a.jsx(Ux,{...Z("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!$?!0:void 0,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:a.jsx(Bx,{...Z("thumb")})}),a.jsx(QL,{...Z("corner"),"data-hovered":D||void 0,"data-hidden":m==="never"||void 0})]})});Jr.displayName="@mantine/core/ScrollArea";const ym=ge((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:s,scrollHideDelay:c,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:y,variant:x,viewportProps:S,scrollbars:j,style:C,vars:T,onBottomReached:R,onTopReached:E,onOverflowChange:_,...k}=oe("ScrollAreaAutosize",q2,e),I=v.useRef(null),D=k2([m,I]),[P,$]=v.useState(!1),B=v.useRef(!1);return v.useEffect(()=>{if(!_)return;const Q=I.current;if(!Q)return;const K=()=>{const U=Q.scrollHeight>Q.clientHeight;U!==P&&(B.current?_?.(U):(B.current=!0,U&&_?.(!0)),$(U))};K();const Z=new ResizeObserver(K);return Z.observe(Q),()=>Z.disconnect()},[_,P]),a.jsx(le,{...k,ref:t,style:[{display:"flex",overflow:"hidden"},C],children:a.jsx(le,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...j==="y"&&{minWidth:0},...j==="x"&&{minHeight:0},...j==="xy"&&{minWidth:0,minHeight:0},...j===!1&&{minWidth:0,minHeight:0}},children:a.jsx(Jr,{classNames:r,styles:o,scrollHideDelay:c,scrollbarSize:s,type:d,dir:f,offsetScrollbars:p,viewportRef:D,onScrollPositionChange:g,unstyled:y,variant:x,viewportProps:S,vars:T,scrollbars:j,onBottomReached:R,onTopReached:E,"data-autosize":"true",children:n})})})});Jr.classes=Qb;ym.displayName="@mantine/core/ScrollAreaAutosize";ym.classes=Qb;Jr.Autosize=ym;var G2={root:"m_87cf2631"};const tI={__staticSelector:"UnstyledButton"},Pn=ir((e,t)=>{const n=oe("UnstyledButton",tI,e),{className:r,component:o="button",__staticSelector:s,unstyled:c,classNames:d,styles:f,style:p,attributes:m,...g}=n,y=Ie({name:s,props:n,classes:G2,className:r,style:p,classNames:d,styles:f,unstyled:c,attributes:m});return a.jsx(le,{...y("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...g})});Pn.classes=G2;Pn.displayName="@mantine/core/UnstyledButton";var Q2={root:"m_515a97f8"};const Wb=ge((e,t)=>{const n=oe("VisuallyHidden",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,attributes:p,...m}=n,g=Ie({name:"VisuallyHidden",classes:Q2,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:p});return a.jsx(le,{component:"span",ref:t,...g("root"),...m})});Wb.classes=Q2;Wb.displayName="@mantine/core/VisuallyHidden";var W2={root:"m_1b7284a3"};const nI=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Bt(t),"--paper-shadow":Tb(n)}}),Mr=ir((e,t)=>{const n=oe("Paper",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,withBorder:f,vars:p,radius:m,shadow:g,variant:y,mod:x,attributes:S,...j}=n,C=Ie({name:"Paper",props:n,classes:W2,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:p,varsResolver:nI});return a.jsx(le,{ref:t,mod:[{"data-with-border":f},x],...C("root"),variant:y,...j})});Mr.classes=W2;Mr.displayName="@mantine/core/Paper";function XE(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function JE(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const rI={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function iI({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:c,dir:d}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[rI[f]]:r},g=-t/2;return f==="left"?{...m,...XE(p,c,n,o),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...XE(p,c,n,o),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...JE(p,s,n,o,d),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...JE(p,s,n,o,d),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Lp=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:s,arrowX:c,arrowY:d,style:f,...p},m)=>{const{dir:g}=Cs();return s?a.jsx("div",{...p,ref:m,style:{...f,...iI({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:g,arrowX:c,arrowY:d})}}):null});Lp.displayName="@mantine/core/FloatingArrow";function Y2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var K2={root:"m_9814e45f"};const oI={zIndex:zr("modal")},aI=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&Ai(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${ue(o)})`:void 0,"--overlay-radius":s===void 0?void 0:Bt(s),"--overlay-z-index":c?.toString()}}),Kc=ir((e,t)=>{const n=oe("Overlay",oI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,fixed:p,center:m,children:g,radius:y,zIndex:x,gradient:S,blur:j,color:C,backgroundOpacity:T,mod:R,attributes:E,..._}=n,k=Ie({name:"Overlay",props:n,classes:K2,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:E,vars:f,varsResolver:aI});return a.jsx(le,{ref:t,...k("root"),mod:[{center:m,fixed:p},R],..._,children:g})});Kc.classes=K2;Kc.displayName="@mantine/core/Overlay";function Qy(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 sI({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Qy(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const o=Qy(n);return o.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(o),o}return Qy(n)}const lI={reuseTargetNode:!0},X2=ge((e,t)=>{const{children:n,target:r,reuseTargetNode:o,...s}=oe("Portal",lI,e),[c,d]=v.useState(!1),f=v.useRef(null);return kl(()=>(d(!0),f.current=sI({target:r,reuseTargetNode:o,...s}),Dd(t,f.current),!r&&!o&&f.current&&document.body.appendChild(f.current),()=>{!r&&!o&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:Ob.createPortal(a.jsx(a.Fragment,{children:n}),f.current)});X2.displayName="@mantine/core/Portal";const Sa=ge(({withinPortal:e=!0,children:t,...n},r)=>um()==="test"||!e?a.jsx(a.Fragment,{children:t}):a.jsx(X2,{ref:r,...n,children:t}));Sa.displayName="@mantine/core/OptionalPortal";const hd=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),np={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:{...hd("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...hd("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...hd("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...hd("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...hd("top"),common:{transformOrigin:"top right"}}},ZE={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function cI({transition:e,state:t,duration:n,timingFunction:r}){const o={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in np?{transitionProperty:np[e].transitionProperty,...o,...np[e].common,...np[e][ZE[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[ZE[t]]}}function uI({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:c,onExited:d,enterDelay:f,exitDelay:p}){const m=Tn(),g=_b(),y=m.respectReducedMotion?g:!1,[x,S]=v.useState(y?0:e),[j,C]=v.useState(r?"entered":"exited"),T=v.useRef(-1),R=v.useRef(-1),E=v.useRef(-1);function _(){window.clearTimeout(T.current),window.clearTimeout(R.current),cancelAnimationFrame(E.current)}const k=D=>{_();const P=D?o:s,$=D?c:d,B=y?0:D?e:t;S(B),B===0?(typeof P=="function"&&P(),typeof $=="function"&&$(),C(D?"entered":"exited")):E.current=requestAnimationFrame(()=>{xd.flushSync(()=>{C(D?"pre-entering":"pre-exiting")}),E.current=requestAnimationFrame(()=>{typeof P=="function"&&P(),C(D?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof $=="function"&&$(),C(D?"entered":"exited")},B)})})},I=D=>{if(_(),typeof(D?f:p)!="number"){k(D);return}R.current=window.setTimeout(()=>{k(D)},D?f:p)};return yl(()=>{I(r)},[r]),v.useEffect(()=>()=>{_()},[]),{transitionDuration:x,transitionStatus:j,transitionTimingFunction:n||"ease"}}function oo({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:c="ease",onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:y}){const x=um(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=uI({mounted:o,exitDuration:r,duration:n,timingFunction:c,onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:y});return S===0||x==="test"?o?a.jsx(a.Fragment,{children:s({})}):e?s({display:"none"}):null:j==="exited"?e?s({display:"none"}):null:a.jsx(a.Fragment,{children:s(cI({transition:t,duration:S,state:j,timingFunction:C}))})}oo.displayName="@mantine/core/Transition";const[dI,J2]=Ar("Popover component was not found in the tree");function xm({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=EM(t),s=Un(o,r),c=Nl(e);return c?v.cloneElement(c,{[n]:s}):e}function Z2(e){return a.jsx(Wb,{tabIndex:-1,"data-autofocus":!0,...e})}xm.displayName="@mantine/core/FocusTrap";Z2.displayName="@mantine/core/FocusTrapInitialFocus";xm.InitialFocus=Z2;var eD={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const Yb=ge((e,t)=>{const n=oe("PopoverDropdown",null,e),{className:r,style:o,vars:s,children:c,onKeyDownCapture:d,variant:f,classNames:p,styles:m,...g}=n,y=J2(),x=Z_({opened:y.opened,shouldReturnFocus:y.returnFocus}),S=y.withRoles?{"aria-labelledby":y.getTargetId(),id:y.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=Un(t,y.floating);return y.disabled?null:a.jsx(Sa,{...y.portalProps,withinPortal:y.withinPortal,children:a.jsx(oo,{mounted:y.opened,...y.transitionProps,transition:y.transitionProps?.transition||"fade",duration:y.transitionProps?.duration??150,keepMounted:y.keepMounted,exitDuration:typeof y.transitionProps?.exitDuration=="number"?y.transitionProps.exitDuration:y.transitionProps?.duration,children:C=>a.jsx(xm,{active:y.trapFocus&&y.opened,innerRef:j,children:a.jsxs(le,{...S,...g,variant:f,onKeyDownCapture:fM(()=>{y.onClose?.(),y.onDismiss?.()},{active:y.closeOnEscape,onTrigger:x,onKeyDown:d}),"data-position":y.placement,"data-fixed":y.floatingStrategy==="fixed"||void 0,...y.getStyles("dropdown",{className:r,props:n,classNames:p,styles:m,style:[{...C,zIndex:y.zIndex,top:y.y??0,left:y.x??0,width:y.width==="target"?void 0:ue(y.width),...y.referenceHidden?{display:"none"}:null},y.resolvedStyles.dropdown,m?.dropdown,o]}),children:[c,a.jsx(Lp,{ref:y.arrowRef,arrowX:y.arrowX,arrowY:y.arrowY,visible:y.withArrow,position:y.placement,arrowSize:y.arrowSize,arrowRadius:y.arrowRadius,arrowOffset:y.arrowOffset,arrowPosition:y.arrowPosition,...y.getStyles("arrow",{props:n,classNames:p,styles:m})})]})})})})});Yb.classes=eD;Yb.displayName="@mantine/core/PopoverDropdown";const fI={refProp:"ref",popupType:"dialog"},tD=ge((e,t)=>{const{children:n,refProp:r,popupType:o,...s}=oe("PopoverTarget",fI,e),c=Nl(n);if(!c)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 d=s,f=J2(),p=Un(f.reference,lm(c),t),m=f.withRoles?{"aria-haspopup":o,"aria-expanded":f.opened,"aria-controls":f.getDropdownId(),id:f.getTargetId()}:{},g=c.props;return v.cloneElement(c,{...d,...m,...f.targetProps,className:Ut(f.targetProps.className,d.className,g.className),[r]:p,...f.controlled?null:{onClick:()=>{f.onToggle(),g.onClick?.()}}})});tD.displayName="@mantine/core/PopoverTarget";function hI(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 pI(e,t,n){const r=hI(e.middlewares),o=[D2(e.offset),CL()];return e.dropdownVisible&&n!=="test"&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.shift&&o.push(Bb(typeof r.shift=="boolean"?{limiter:FE(),padding:5}:{limiter:FE(),padding:5,...r.shift})),r.flip&&o.push(typeof r.flip=="boolean"?Mp():Mp(r.flip)),r.inline&&o.push(typeof r.inline=="boolean"?Cd():Cd(r.inline)),o.push(A2({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width==="target")&&o.push(jL({...typeof r.size=="boolean"?{}:r.size,apply({rects:s,availableWidth:c,availableHeight:d,...f}){const m=t().refs.floating.current?.style??{};r.size&&(typeof r.size=="object"&&r.size.apply?r.size.apply({rects:s,availableWidth:c,availableHeight:d,...f}):Object.assign(m,{maxWidth:`${c}px`,maxHeight:`${d}px`})),e.width==="target"&&Object.assign(m,{width:`${s.reference.width}px`})}})),o}function mI(e){const t=um(),[n,r]=nr({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),o=v.useRef(n),s=()=>{n&&!e.disabled&&r(!1)},c=()=>{e.disabled||r(!n)},d=qb({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:pI(e,()=>d,t),whileElementsMounted:e.keepMounted?void 0:zx});return v.useEffect(()=>{if(!(!d.refs.reference.current||!d.refs.floating.current)&&n)return zx(d.refs.reference.current,d.refs.floating.current,d.update)},[n,d.update]),yl(()=>{e.onPositionChange?.(d.placement),e.positionRef.current=d.placement},[d.placement,e.preventPositionChangeWhenVisible]),yl(()=>{n!==o.current&&(n?e.onOpen?.():e.onClose?.()),o.current=n},[n,e.onClose,e.onOpen]),kl(()=>{let f=-1;return n&&(f=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(f)}},[n,e.position]),{floating:d,controlled:typeof e.opened=="boolean",opened:n,onClose:s,onToggle:c}}const gI={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,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:zr("popover"),__staticSelector:"Popover",width:"max-content"},vI=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Bt(t),"--popover-shadow":Tb(n)}});function Zr(e){const t=oe("Popover",gI,e),{children:n,position:r,offset:o,onPositionChange:s,positionDependencies:c,opened:d,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:y,withArrow:x,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:T,unstyled:R,classNames:E,styles:_,closeOnClickOutside:k,withinPortal:I,portalProps:D,closeOnEscape:P,clickOutsideEvents:$,trapFocus:B,onClose:Q,onDismiss:K,onOpen:Z,onChange:U,zIndex:G,radius:M,shadow:L,id:z,defaultOpened:F,__staticSelector:Y,withRoles:O,disabled:H,returnFocus:se,variant:de,keepMounted:ye,vars:we,floatingStrategy:Ee,withOverlay:Xe,overlayProps:Ae,hideDetached:dt,attributes:Et,preventPositionChangeWhenVisible:it,...rt}=t,mt=Ie({name:Y,props:t,classes:eD,classNames:E,styles:_,unstyled:R,attributes:Et,rootSelector:"dropdown",vars:we,varsResolver:vI}),{resolvedStyles:Ct}=Ol({classNames:E,styles:_,props:t}),[jt,Te]=v.useState(d??F??!1),_e=v.useRef(r),$e=v.useRef(null),[Le,lt]=v.useState(null),[tt,ft]=v.useState(null),{dir:pe}=Cs(),qe=um(),Ce=xr(z),Pe=mI({middlewares:y,width:g,position:Y2(pe,r),offset:typeof o=="number"?o+(x?S/2:0):o,arrowRef:$e,arrowOffset:j,onPositionChange:s,positionDependencies:c,opened:d,defaultOpened:F,onChange:U,onOpen:Z,onClose:Q,onDismiss:K,strategy:Ee,dropdownVisible:jt,setDropdownVisible:Te,positionRef:_e,disabled:H,preventPositionChangeWhenVisible:it,keepMounted:ye});gM(()=>{k&&(Pe.onClose(),K?.())},$,[Le,tt]);const At=v.useCallback(an=>{lt(an),Pe.floating.refs.setReference(an)},[Pe.floating.refs.setReference]),mn=v.useCallback(an=>{ft(an),Pe.floating.refs.setFloating(an)},[Pe.floating.refs.setFloating]),gn=v.useCallback(()=>{f?.onExited?.(),p?.(),Te(!1),it||(_e.current=r)},[f?.onExited,p,it,r]),Bn=v.useCallback(()=>{f?.onEntered?.(),m?.()},[f?.onEntered,m]);return a.jsxs(dI,{value:{returnFocus:se,disabled:H,controlled:Pe.controlled,reference:At,floating:mn,x:Pe.floating.x,y:Pe.floating.y,arrowX:Pe.floating?.middlewareData?.arrow?.x,arrowY:Pe.floating?.middlewareData?.arrow?.y,opened:Pe.opened,arrowRef:$e,transitionProps:{...f,onExited:gn,onEntered:Bn},width:g,withArrow:x,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:T,placement:Pe.floating.placement,trapFocus:B,withinPortal:I,portalProps:D,zIndex:G,radius:M,shadow:L,closeOnEscape:P,onDismiss:K,onClose:Pe.onClose,onToggle:Pe.onToggle,getTargetId:()=>`${Ce}-target`,getDropdownId:()=>`${Ce}-dropdown`,withRoles:O,targetProps:rt,__staticSelector:Y,classNames:E,styles:_,unstyled:R,variant:de,keepMounted:ye,getStyles:mt,resolvedStyles:Ct,floatingStrategy:Ee,referenceHidden:dt&&qe!=="test"?Pe.floating.middlewareData.hide?.referenceHidden:!1},children:[n,Xe&&a.jsx(oo,{transition:"fade",mounted:Pe.opened,duration:f?.duration||250,exitDuration:f?.exitDuration||250,children:an=>a.jsx(Sa,{withinPortal:I,children:a.jsx(Kc,{...Ae,...mt("overlay",{className:Ae?.className,style:[an,Ae?.style]})})})})]})}Zr.Target=tD;Zr.Dropdown=Yb;Zr.displayName="@mantine/core/Popover";Zr.extend=e=>e;var to={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 nD=v.forwardRef(({className:e,...t},n)=>a.jsxs(le,{component:"span",className:Ut(to.barsLoader,e),...t,ref:n,children:[a.jsx("span",{className:to.bar}),a.jsx("span",{className:to.bar}),a.jsx("span",{className:to.bar})]}));nD.displayName="@mantine/core/Bars";const rD=v.forwardRef(({className:e,...t},n)=>a.jsxs(le,{component:"span",className:Ut(to.dotsLoader,e),...t,ref:n,children:[a.jsx("span",{className:to.dot}),a.jsx("span",{className:to.dot}),a.jsx("span",{className:to.dot})]}));rD.displayName="@mantine/core/Dots";const iD=v.forwardRef(({className:e,...t},n)=>a.jsx(le,{component:"span",className:Ut(to.ovalLoader,e),...t,ref:n}));iD.displayName="@mantine/core/Oval";const oD={bars:nD,oval:iD,dots:rD},yI={loaders:oD,type:"oval"},xI=(e,{size:t,color:n})=>({root:{"--loader-size":at(t,"loader-size"),"--loader-color":n?Kt(n,e):void 0}}),_r=ge((e,t)=>{const n=oe("Loader",yI,e),{size:r,color:o,type:s,vars:c,className:d,style:f,classNames:p,styles:m,unstyled:g,loaders:y,variant:x,children:S,attributes:j,...C}=n,T=Ie({name:"Loader",props:n,classes:to,className:d,style:f,classNames:p,styles:m,unstyled:g,attributes:j,vars:c,varsResolver:xI});return S?a.jsx(le,{...T("root"),ref:t,...C,children:S}):a.jsx(le,{...T("root"),ref:t,component:y[s],variant:x,size:r,...C})});_r.defaultLoaders=oD;_r.classes=to;_r.displayName="@mantine/core/Loader";var cu={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const eT={orientation:"horizontal"},bI=(e,{borderWidth:t})=>({group:{"--ai-border-width":ue(t)}}),Kb=ge((e,t)=>{const n=oe("ActionIconGroup",eT,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,attributes:x,...S}=oe("ActionIconGroup",eT,e),j=Ie({name:"ActionIconGroup",props:n,classes:cu,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:x,vars:p,varsResolver:bI,rootSelector:"group"});return a.jsx(le,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...S})});Kb.classes=cu;Kb.displayName="@mantine/core/ActionIconGroup";const SI=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":at(c,"section-height"),"--section-padding-x":at(c,"section-padding-x"),"--section-fz":Qn(c),"--section-radius":t===void 0?void 0:Bt(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},Xb=ge((e,t)=>{const n=oe("ActionIconGroupSection",null,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,attributes:x,...S}=n,j=Ie({name:"ActionIconGroupSection",props:n,classes:cu,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:x,vars:f,varsResolver:SI,rootSelector:"groupSection"});return a.jsx(le,{...j("groupSection"),ref:t,variant:p,...S})});Xb.classes=cu;Xb.displayName="@mantine/core/ActionIconGroupSection";const wI=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":at(t,"ai-size"),"--ai-radius":n===void 0?void 0:Bt(n),"--ai-bg":s||r?d.background:void 0,"--ai-hover":s||r?d.hover:void 0,"--ai-hover-color":s||r?d.hoverColor:void 0,"--ai-color":d.color,"--ai-bd":s||r?d.border:void 0}}},En=ir((e,t)=>{const n=oe("ActionIcon",null,e),{className:r,unstyled:o,variant:s,classNames:c,styles:d,style:f,loading:p,loaderProps:m,size:g,color:y,radius:x,__staticSelector:S,gradient:j,vars:C,children:T,disabled:R,"data-disabled":E,autoContrast:_,mod:k,attributes:I,...D}=n,P=Ie({name:["ActionIcon",S],props:n,className:r,style:f,classes:cu,classNames:c,styles:d,unstyled:o,attributes:I,vars:C,varsResolver:wI});return a.jsxs(Pn,{...P("root",{active:!R&&!p&&!E}),...D,unstyled:o,variant:s,size:g,disabled:R||p,ref:t,mod:[{loading:p,disabled:R||E},k],children:[typeof p=="boolean"&&a.jsx(oo,{mounted:p,transition:"slide-down",duration:150,children:$=>a.jsx(le,{component:"span",...P("loader",{style:$}),"aria-hidden":!0,children:a.jsx(_r,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),a.jsx(le,{component:"span",mod:{loading:p},...P("icon"),children:T})]})});En.classes=cu;En.displayName="@mantine/core/ActionIcon";En.Group=Kb;En.GroupSection=Xb;const aD=v.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:a.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));aD.displayName="@mantine/core/CloseIcon";var sD={root:"m_86a44da5","root--subtle":"m_220c80f2"};const jI={variant:"subtle"},CI=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":at(t,"cb-size"),"--cb-radius":n===void 0?void 0:Bt(n),"--cb-icon-size":ue(r)}}),Es=ir((e,t)=>{const n=oe("CloseButton",jI,e),{iconSize:r,children:o,vars:s,radius:c,className:d,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":y,disabled:x,variant:S,icon:j,mod:C,attributes:T,__staticSelector:R,...E}=n,_=Ie({name:R||"CloseButton",props:n,className:d,style:p,classes:sD,classNames:f,styles:m,unstyled:g,attributes:T,vars:s,varsResolver:CI});return a.jsxs(Pn,{ref:t,...E,unstyled:g,variant:S,disabled:x,mod:[{disabled:x||y},C],..._("root",{variant:S,active:!x&&!y}),children:[j||a.jsx(aD,{}),o]})});Es.classes=sD;Es.displayName="@mantine/core/CloseButton";function EI(e){return v.Children.toArray(e).filter(Boolean)}var lD={root:"m_4081bf90"};const TI={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},RI=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:s,wrap:c},{childWidth:d})=>({root:{"--group-child-width":t&&n?d:void 0,"--group-gap":Gn(r),"--group-align":o,"--group-justify":s,"--group-wrap":c}}),xe=ge((e,t)=>{const n=oe("Group",TI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,children:f,gap:p,align:m,justify:g,wrap:y,grow:x,preventGrowOverflow:S,vars:j,variant:C,__size:T,mod:R,attributes:E,..._}=n,k=EI(f),I=k.length,D=Gn(p??"md"),$={childWidth:`calc(${100/I}% - (${D} - ${D} / ${I}))`},B=Ie({name:"Group",props:n,stylesCtx:$,className:o,style:s,classes:lD,classNames:r,styles:c,unstyled:d,attributes:E,vars:j,varsResolver:RI});return a.jsx(le,{...B("root"),ref:t,variant:C,mod:[{grow:x},R],size:T,..._,children:k})});xe.classes=lD;xe.displayName="@mantine/core/Group";const[_I,_a]=Ar("ModalBase component was not found in tree");function DI({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),o=v.useRef(-1),c=_b()?0:t;return v.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):c===0?r(!1):o.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(o.current)),[e,c]),n}function AI({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:s,returnFocus:c}){const d=xr(e),[f,p]=v.useState(!1),[m,g]=v.useState(!1),y=typeof t?.duration=="number"?t?.duration:200,x=DI({opened:n,transitionDuration:y});return r2("keydown",S=>{S.key==="Escape"&&o&&!S.isComposing&&n&&S.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&s()},{capture:!0}),Z_({opened:n,shouldReturnFocus:r&&c}),{_id:d,titleMounted:f,bodyMounted:m,shouldLockScroll:x,setTitleMounted:p,setBodyMounted:g}}const cD=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,onExitTransitionEnd:s,onEnterTransitionEnd:c,trapFocus:d,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:y,lockScroll:x,children:S,zIndex:j,shadow:C,padding:T,__vars:R,unstyled:E,removeScrollProps:_,...k},I)=>{const{_id:D,titleMounted:P,bodyMounted:$,shouldLockScroll:B,setTitleMounted:Q,setBodyMounted:K}=AI({id:r,transitionProps:o,opened:t,trapFocus:d,closeOnEscape:f,onClose:n,returnFocus:p}),{key:Z,...U}=_||{};return a.jsx(Sa,{...y,withinPortal:g,children:a.jsx(_I,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:s,onEnterTransitionEnd:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${D}-title`,getBodyId:()=>`${D}-body`,titleMounted:P,bodyMounted:$,setTitleMounted:Q,setBodyMounted:K,trapFocus:d,closeOnEscape:f,zIndex:j,unstyled:E},children:a.jsx(vl,{enabled:B&&x,...U,children:a.jsx(le,{ref:I,...k,__vars:{...R,"--mb-z-index":(j||zr("modal")).toString(),"--mb-shadow":Tb(C),"--mb-padding":Gn(T)},children:S})},Z)})})});cD.displayName="@mantine/core/ModalBase";function kI(){const e=_a();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Xc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const uD=v.forwardRef(({className:e,...t},n)=>{const r=kI(),o=_a();return a.jsx(le,{ref:n,...t,id:r,className:Ut({[Xc.body]:!o.unstyled},e)})});uD.displayName="@mantine/core/ModalBaseBody";const dD=v.forwardRef(({className:e,onClick:t,...n},r)=>{const o=_a();return a.jsx(Es,{ref:r,...n,onClick:s=>{o.onClose(),t?.(s)},className:Ut({[Xc.close]:!o.unstyled},e),unstyled:o.unstyled})});dD.displayName="@mantine/core/ModalBaseCloseButton";const fD=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...s},c)=>{const d=_a();return a.jsx(oo,{mounted:d.opened,transition:"pop",...d.transitionProps,onExited:()=>{d.onExitTransitionEnd?.(),d.transitionProps?.onExited?.()},onEntered:()=>{d.onEnterTransitionEnd?.(),d.transitionProps?.onEntered?.()},...e,children:f=>a.jsx("div",{...n,className:Ut({[Xc.inner]:!d.unstyled},n.className),children:a.jsx(xm,{active:d.opened&&d.trapFocus,innerRef:c,children:a.jsx(Mr,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":d.bodyMounted?d.getBodyId():void 0,"aria-labelledby":d.titleMounted?d.getTitleId():void 0,style:[o,f],className:Ut({[Xc.content]:!d.unstyled},t),unstyled:d.unstyled,children:s.children})})})})});fD.displayName="@mantine/core/ModalBaseContent";const hD=v.forwardRef(({className:e,...t},n)=>{const r=_a();return a.jsx(le,{component:"header",ref:n,className:Ut({[Xc.header]:!r.unstyled},e),...t})});hD.displayName="@mantine/core/ModalBaseHeader";const PI={duration:200,timingFunction:"ease",transition:"fade"};function NI(e){const t=_a();return{...PI,...t.transitionProps,...e}}const pD=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...o},s)=>{const c=_a(),d=NI(t);return a.jsx(oo,{mounted:r!==void 0?r:c.opened,...d,transition:"fade",children:f=>a.jsx(Kc,{ref:s,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e?.(p),c.closeOnClickOutside&&c.onClose()},...o})})});pD.displayName="@mantine/core/ModalBaseOverlay";function OI(){const e=_a();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const mD=v.forwardRef(({className:e,...t},n)=>{const r=OI(),o=_a();return a.jsx(le,{component:"h2",ref:n,className:Ut({[Xc.title]:!o.unstyled},e),...t,id:r})});mD.displayName="@mantine/core/ModalBaseTitle";function MI({children:e}){return a.jsx(a.Fragment,{children:e})}const[LI,II]=Bo({size:"sm"}),gD=ge((e,t)=>{const n=oe("InputClearButton",null,e),{size:r,variant:o,vars:s,classNames:c,styles:d,...f}=n,p=II(),{resolvedClassNames:m,resolvedStyles:g}=Ol({classNames:c,styles:d,props:n});return a.jsx(Es,{variant:o||"transparent",ref:t,size:r||p?.size||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...f.style},...f})});gD.displayName="@mantine/core/InputClearButton";const zI={xs:7,sm:8,md:10,lg:12,xl:15};function $I({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:o="sm"}){const s=e&&t;return s&&(n||r)?a.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:zI[o]},children:[s,n||r]}):n===null?null:n||s||r}const[UI,uu]=Bo({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var zi={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 BI=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Qn(t)} - ${ue(2)})`}}),bm=ge((e,t)=>{const n=oe("InputDescription",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,attributes:y,variant:x,...S}=oe("InputDescription",null,n),j=uu(),C=Ie({name:["InputWrapper",m],props:n,classes:zi,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:y,rootSelector:"description",vars:f,varsResolver:BI}),T=g&&j?.getStyles||C;return a.jsx(le,{component:"p",ref:t,variant:x,size:p,...T("description",j?.getStyles?{className:o,style:s}:void 0),...S})});bm.classes=zi;bm.displayName="@mantine/core/InputDescription";const VI=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Qn(t)} - ${ue(2)})`}}),Sm=ge((e,t)=>{const n=oe("InputError",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,attributes:m,__staticSelector:g,__inheritStyles:y=!0,variant:x,...S}=n,j=Ie({name:["InputWrapper",g],props:n,classes:zi,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:m,rootSelector:"error",vars:f,varsResolver:VI}),C=uu(),T=y&&C?.getStyles||j;return a.jsx(le,{component:"p",ref:t,variant:x,size:p,...T("error",C?.getStyles?{className:o,style:s}:void 0),...S})});Sm.classes=zi;Sm.displayName="@mantine/core/InputError";const tT={labelElement:"label"},FI=(e,{size:t})=>({label:{"--input-label-size":Qn(t),"--input-asterisk-color":void 0}}),tf=ge((e,t)=>{const n=oe("InputLabel",tT,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,labelElement:p,size:m,required:g,htmlFor:y,onMouseDown:x,children:S,__staticSelector:j,variant:C,mod:T,attributes:R,...E}=oe("InputLabel",tT,n),_=Ie({name:["InputWrapper",j],props:n,classes:zi,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:R,rootSelector:"label",vars:f,varsResolver:FI}),k=uu(),I=k?.getStyles||_;return a.jsxs(le,{...I("label",k?.getStyles?{className:o,style:s}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?y:void 0,mod:[{required:g},T],onMouseDown:D=>{x?.(D),!D.defaultPrevented&&D.detail>1&&D.preventDefault()},...E,children:[S,g&&a.jsx("span",{...I("required"),"aria-hidden":!0,children:" *"})]})});tf.classes=zi;tf.displayName="@mantine/core/InputLabel";const Jb=ge((e,t)=>{const n=oe("InputPlaceholder",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,__staticSelector:p,variant:m,error:g,mod:y,attributes:x,...S}=n,j=Ie({name:["InputPlaceholder",p],props:n,classes:zi,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:x,rootSelector:"placeholder"});return a.jsx(le,{...j("placeholder"),mod:[{error:!!g},y],component:"span",variant:m,ref:t,...S})});Jb.classes=zi;Jb.displayName="@mantine/core/InputPlaceholder";function HI(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),o=e.slice(0,r),s=e.slice(r+1),c=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&s.includes("description")||n&&s.includes("error"),offsetTop:c}}const qI={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},GI=(e,{size:t})=>({label:{"--input-label-size":Qn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Qn(t)} - ${ue(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Qn(t)} - ${ue(2)})`}}),nf=ge((e,t)=>{const n=oe("InputWrapper",qI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:y,inputWrapperOrder:x,label:S,error:j,description:C,labelProps:T,descriptionProps:R,errorProps:E,labelElement:_,children:k,withAsterisk:I,id:D,required:P,__stylesApiProps:$,mod:B,attributes:Q,...K}=n,Z=Ie({name:["InputWrapper",g],props:$||n,classes:zi,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:Q,vars:f,varsResolver:GI}),U={size:p,variant:m,__staticSelector:g},G=xr(D),M=typeof I=="boolean"?I:P,L=E?.id||`${G}-error`,z=R?.id||`${G}-description`,F=G,Y=!!j&&typeof j!="boolean",O=!!C,H=`${Y?L:""} ${O?z:""}`,se=H.trim().length>0?H.trim():void 0,de=T?.id||`${G}-label`,ye=S&&a.jsx(tf,{labelElement:_,id:de,htmlFor:F,required:M,...U,...T,children:S},"label"),we=O&&a.jsx(bm,{...R,...U,size:R?.size||U.size,id:R?.id||z,children:C},"description"),Ee=a.jsx(v.Fragment,{children:y(k)},"input"),Xe=Y&&v.createElement(Sm,{...E,...U,size:E?.size||U.size,key:"error",id:E?.id||L},j),Ae=x.map(dt=>{switch(dt){case"label":return ye;case"input":return Ee;case"description":return we;case"error":return Xe;default:return null}});return a.jsx(UI,{value:{getStyles:Z,describedBy:se,inputId:F,labelId:de,...HI(x,{hasDescription:O,hasError:Y})},children:a.jsx(le,{ref:t,variant:m,size:p,mod:[{error:!!j},B],...Z("root"),...K,children:Ae})})});nf.classes=zi;nf.displayName="@mantine/core/InputWrapper";const QI={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},WI=(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":at(t.size,"input-height"),"--input-fz":Qn(t.size),"--input-radius":t.radius===void 0?void 0:Bt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?ue(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?ue(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?at(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),hn=ir((e,t)=>{const n=oe("Input",QI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:y,error:x,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:T,rightSection:R,rightSectionProps:E,rightSectionWidth:_,rightSectionPointerEvents:k,leftSectionPointerEvents:I,variant:D,vars:P,pointer:$,multiline:B,radius:Q,id:K,withAria:Z,withErrorStyles:U,mod:G,inputSize:M,attributes:L,__clearSection:z,__clearable:F,__defaultRightSection:Y,...O}=n,{styleProps:H,rest:se}=Ra(O),de=uu(),ye={offsetBottom:de?.offsetBottom,offsetTop:de?.offsetTop},we=Ie({name:["Input",p],props:m||n,classes:zi,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:L,stylesCtx:ye,rootSelector:"wrapper",vars:P,varsResolver:WI}),Ee=Z?{required:f,disabled:S,"aria-invalid":!!x,"aria-describedby":de?.describedBy,id:de?.inputId||K}:{},Xe=$I({__clearable:F,__clearSection:z,rightSection:R,__defaultRightSection:Y,size:g});return a.jsx(LI,{value:{size:g||"sm"},children:a.jsxs(le,{...we("wrapper"),...H,...y,mod:[{error:!!x&&U,pointer:$,disabled:S,multiline:B,"data-with-right-section":!!Xe,"data-with-left-section":!!j},G],variant:D,size:g,children:[j&&a.jsx("div",{...C,"data-position":"left",...we("section",{className:C?.className,style:C?.style}),children:j}),a.jsx(le,{component:"input",...se,...Ee,ref:t,required:f,mod:{disabled:S,error:!!x&&U},variant:D,__size:M,...we("input")}),Xe&&a.jsx("div",{...E,"data-position":"right",...we("section",{className:E?.className,style:E?.style}),children:Xe})]})})});hn.classes=zi;hn.Wrapper=nf;hn.Label=tf;hn.Error=Sm;hn.Description=bm;hn.Placeholder=Jb;hn.ClearButton=gD;hn.displayName="@mantine/core/Input";function YI(e,t,n){const r=oe(e,t,n),{label:o,description:s,error:c,required:d,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:y,__stylesApiProps:x,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:T,id:R,size:E,style:_,inputContainer:k,inputWrapperOrder:I,withAsterisk:D,variant:P,vars:$,mod:B,attributes:Q,...K}=r,{styleProps:Z,rest:U}=Ra(K),G={label:o,description:s,error:c,required:d,classNames:f,className:m,__staticSelector:y,__stylesApiProps:x||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:E,style:_,inputContainer:k,inputWrapperOrder:I,withAsterisk:D,variant:P,id:R,mod:B,attributes:Q,...T};return{...U,classNames:f,styles:p,unstyled:g,wrapperProps:{...G,...Z},inputProps:{required:d,classNames:f,styles:p,unstyled:g,size:E,__staticSelector:y,__stylesApiProps:x||r,error:c,variant:P,id:R,attributes:Q}}}const KI={__staticSelector:"InputBase",withAria:!0,size:"sm"},$r=ir((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=YI("InputBase",KI,e);return a.jsx(hn.Wrapper,{...r,children:a.jsx(hn,{...n,...o,ref:t})})});$r.classes={...hn.classes,...hn.Wrapper.classes};$r.displayName="@mantine/core/InputBase";const XI={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 vD={root:"m_8bffd616"};const rr=ir((e,t)=>{const n=oe("Flex",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,gap:p,rowGap:m,columnGap:g,align:y,justify:x,wrap:S,direction:j,attributes:C,...T}=n,R=Ie({name:"Flex",classes:vD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f}),E=Tn(),_=Zd(),k=d2({styleProps:{gap:p,rowGap:m,columnGap:g,align:y,justify:x,wrap:S,direction:j},theme:E,data:XI});return a.jsxs(a.Fragment,{children:[k.hasResponsiveStyles&&a.jsx(Ll,{selector:`.${_}`,styles:k.styles,media:k.media}),a.jsx(le,{ref:t,...R("root",{className:_,style:js(k.inlineStyles)}),...T})]})});rr.classes=vD;rr.displayName="@mantine/core/Flex";function JI(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 ZI({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=v.useRef(-1),[s,c]=v.useState(!1),[d,f]=v.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const x=e.getBoundingClientRect(),S=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),T=ms(j.borderTopWidth)+ms(C.borderTopWidth),R=ms(j.borderLeftWidth)+ms(C.borderLeftWidth),E={top:x.top-S.top-T,left:x.left-S.left-R,width:x.width,height:x.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(o.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=v.useRef(null),y=v.useRef(null);return v.useEffect(()=>{if(p(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(y.current=new ResizeObserver(m),y.current.observe(t)),()=>{g.current?.disconnect(),y.current?.disconnect()}},[t,e]),v.useEffect(()=>{if(t){const x=S=>{JI(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",x),()=>{t.removeEventListener("transitionend",x)}}},[t]),BM(()=>{i2()!=="test"&&c(!0)},20,{autoInvoke:!0}),VM(x=>{x.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:d}}var yD={root:"m_96b553a6"};const e7=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Zb=ge((e,t)=>{const n=oe("FloatingIndicator",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,target:p,parent:m,transitionDuration:g,mod:y,displayAfterTransitionEnd:x,attributes:S,...j}=n,C=Ie({name:"FloatingIndicator",classes:yD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:e7}),T=v.useRef(null),{initialized:R,hidden:E}=ZI({target:p,parent:m,ref:T,displayAfterTransitionEnd:x}),_=Un(t,T);return!p||!m?null:a.jsx(le,{ref:_,mod:[{initialized:R,hidden:E},y],...C("root"),...j})});Zb.displayName="@mantine/core/FloatingIndicator";Zb.classes=yD;function xD({open:e,close:t,openDelay:n,closeDelay:r}){const o=v.useRef(-1),s=v.useRef(-1),c=()=>{window.clearTimeout(o.current),window.clearTimeout(s.current)},d=()=>{c(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():s.current=window.setTimeout(t,r)};return v.useEffect(()=>c,[]),{openDropdown:d,closeDropdown:f}}function bD({style:e,size:t=16,...n}){return a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:ue(t),height:ue(t),display:"block"},...n,children:a.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}bD.displayName="@mantine/core/AccordionChevron";var SD={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 t7=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const s=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:Bt(t),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},Fo=ge((e,t)=>{const n=oe("Alert",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,title:g,children:y,id:x,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:T,variant:R,autoContrast:E,role:_,attributes:k,...I}=n,D=Ie({name:"Alert",classes:SD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:k,vars:f,varsResolver:t7}),P=xr(x),$=g&&`${P}-title`||void 0,B=`${P}-body`;return a.jsx(le,{id:P,...D("root",{variant:R}),variant:R,ref:t,role:_||"alert",...I,"aria-describedby":y?B:void 0,"aria-labelledby":g?$:void 0,children:a.jsxs("div",{...D("wrapper"),children:[S&&a.jsx("div",{...D("icon"),children:S}),a.jsxs("div",{...D("body"),children:[g&&a.jsx("div",{...D("title"),"data-with-close-button":j||void 0,children:a.jsx("span",{id:$,...D("label"),children:g})}),y&&a.jsx("div",{id:B,...D("message"),"data-variant":R,children:y})]}),j&&a.jsx(Es,{...D("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:d})]})})});Fo.classes=SD;Fo.displayName="@mantine/core/Alert";var wD={root:"m_b6d8b162"};function n7(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const r7={inherit:!1},i7=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:s})=>({root:{"--text-fz":Qn(o),"--text-lh":K_(o),"--text-gradient":t==="gradient"?Ax(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Kt(s,e):void 0}}),be=ir((e,t)=>{const n=oe("Text",r7,e),{lineClamp:r,truncate:o,inline:s,inherit:c,gradient:d,span:f,__staticSelector:p,vars:m,className:g,style:y,classNames:x,styles:S,unstyled:j,variant:C,mod:T,size:R,attributes:E,..._}=n,k=Ie({name:["Text",p],props:n,classes:wD,className:g,style:y,classNames:x,styles:S,unstyled:j,attributes:E,vars:m,varsResolver:i7});return a.jsx(le,{...k("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":n7(o),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":c},T],size:R,..._})});be.classes=wD;be.displayName="@mantine/core/Text";var jD={root:"m_849cf0da"};const o7={underline:"hover"},Tt=ir((e,t)=>{const{underline:n,className:r,unstyled:o,mod:s,...c}=oe("Anchor",o7,e);return a.jsx(be,{component:"a",ref:t,className:Ut({[jD.root]:!o},r),...c,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:o})});Tt.classes=jD;Tt.displayName="@mantine/core/Anchor";const[a7,du]=Ar("AppShell was not found in tree");var Ts={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const e0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=oe("AppShellAside",null,e),y=du();return y.disabled?null:a.jsx(le,{component:"aside",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("aside",{className:Ut({[vl.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-aside-z-index":`calc(${p??y.zIndex} + 1)`}})});e0.classes=Ts;e0.displayName="@mantine/core/AppShellAside";const t0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=oe("AppShellFooter",null,e),y=du();return y.disabled?null:a.jsx(le,{component:"footer",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("footer",{className:Ut({[vl.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-footer-z-index":(p??y.zIndex)?.toString()}})});t0.classes=Ts;t0.displayName="@mantine/core/AppShellFooter";const n0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=oe("AppShellHeader",null,e),y=du();return y.disabled?null:a.jsx(le,{component:"header",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("header",{className:Ut({[vl.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-header-z-index":(p??y.zIndex)?.toString()}})});n0.classes=Ts;n0.displayName="@mantine/core/AppShellHeader";const r0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("AppShellMain",null,e),f=du();return a.jsx(le,{component:"main",ref:t,...f.getStyles("main",{className:r,style:o,classNames:n,styles:s}),...d})});r0.classes=Ts;r0.displayName="@mantine/core/AppShellMain";function rf(e){return typeof e=="object"?e.base:e}function of(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 af(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function s7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){const s=r?.width,c="translateX(var(--app-shell-aside-width))",d="translateX(calc(var(--app-shell-aside-width) * -1))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-aside-width"]="100%",n[r?.breakpoint]["--app-shell-aside-offset"]="0px"),of(s)){const f=ue(rf(s));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(af(s)&&(typeof s.base<"u"&&(e["--app-shell-aside-width"]=ue(s.base),e["--app-shell-aside-offset"]=ue(s.base)),dn(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=ue(s[f]),t[f]["--app-shell-aside-offset"]=ue(s[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=c,t[f]["--app-shell-aside-transform-rtl"]=d,t[f]["--app-shell-aside-offset"]="0px !important",t[f]["--app-shell-aside-scroll-locked-visibility"]="hidden"}if(r?.collapsed?.mobile){const f=Rb(r.breakpoint,o.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-aside-width"]="100%",n[f]["--app-shell-aside-offset"]="0px",n[f]["--app-shell-aside-transform"]=c,n[f]["--app-shell-aside-transform-rtl"]=d,n[f]["--app-shell-aside-scroll-locked-visibility"]="hidden"}}function l7({baseStyles:e,minMediaStyles:t,footer:n}){const r=n?.height,o="translateY(var(--app-shell-footer-height))",s=n?.offset??!0;if(of(r)){const c=ue(rf(r));e["--app-shell-footer-height"]=c,s&&(e["--app-shell-footer-offset"]=c)}af(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=ue(r.base),s&&(e["--app-shell-footer-offset"]=ue(r.base))),dn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=ue(r[c]),s&&(t[c]["--app-shell-footer-offset"]=ue(r[c])))})),n?.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function c7({baseStyles:e,minMediaStyles:t,header:n}){const r=n?.height,o="translateY(calc(var(--app-shell-header-height) * -1))",s=n?.offset??!0;if(of(r)){const c=ue(rf(r));e["--app-shell-header-height"]=c,s&&(e["--app-shell-header-offset"]=c)}af(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=ue(r.base),s&&(e["--app-shell-header-offset"]=ue(r.base))),dn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=ue(r[c]),s&&(t[c]["--app-shell-header-offset"]=ue(r[c])))})),n?.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function u7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){const s=r?.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",d="translateX(var(--app-shell-navbar-width))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-navbar-width"]="100%",n[r?.breakpoint]["--app-shell-navbar-offset"]="0px"),of(s)){const f=ue(rf(s));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(af(s)&&(typeof s.base<"u"&&(e["--app-shell-navbar-width"]=ue(s.base),e["--app-shell-navbar-offset"]=ue(s.base)),dn(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=ue(s[f]),t[f]["--app-shell-navbar-offset"]=ue(s[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=c,t[f]["--app-shell-navbar-transform-rtl"]=d,t[f]["--app-shell-navbar-offset"]="0px !important"}if(r?.collapsed?.mobile){const f=Rb(r.breakpoint,o.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-navbar-width"]="100%",n[f]["--app-shell-navbar-offset"]="0px",n[f]["--app-shell-navbar-transform"]=c,n[f]["--app-shell-navbar-transform-rtl"]=d}}function Wy(e){return Number(e)===0?"0px":Gn(e)}function d7({padding:e,baseStyles:t,minMediaStyles:n}){of(e)&&(t["--app-shell-padding"]=Wy(rf(e))),af(e)&&(e.base&&(t["--app-shell-padding"]=Wy(e.base)),dn(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Wy(e[r]))}))}function f7({navbar:e,header:t,footer:n,aside:r,padding:o,theme:s}){const c={},d={},f={};u7({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,navbar:e,theme:s}),s7({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,aside:r,theme:s}),c7({baseStyles:f,minMediaStyles:c,header:t}),l7({baseStyles:f,minMediaStyles:c,footer:n}),d7({baseStyles:f,minMediaStyles:c,padding:o});const p=_d(dn(c),s.breakpoints).map(y=>({query:`(min-width: ${_p(y.px)})`,styles:c[y.value]})),m=_d(dn(d),s.breakpoints).map(y=>({query:`(max-width: ${_p(y.px)})`,styles:d[y.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function h7({navbar:e,header:t,aside:n,footer:r,padding:o}){const s=Tn(),c=Ea(),{media:d,baseStyles:f}=f7({navbar:e,header:t,footer:r,aside:n,padding:o,theme:s});return a.jsx(Ll,{media:d,styles:f,selector:c.cssVariablesSelector})}const i0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=oe("AppShellNavbar",null,e),y=du();return y.disabled?null:a.jsx(le,{component:"nav",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("navbar",{className:r,classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-navbar-z-index":`calc(${p??y.zIndex} + 1)`}})});i0.classes=Ts;i0.displayName="@mantine/core/AppShellNavbar";const o0=ir((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,grow:d,mod:f,...p}=oe("AppShellSection",null,e),m=du();return a.jsx(le,{ref:t,mod:[{grow:d},f],...m.getStyles("section",{className:r,style:o,classNames:n,styles:s}),...p})});o0.classes=Ts;o0.displayName="@mantine/core/AppShellSection";function p7({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),o=v.useRef(-1),s=v.useRef(-1);return r2("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),kl(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const m7={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:zr("app")},g7=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Tr=ge((e,t)=>{const n=oe("AppShell",m7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:y,transitionTimingFunction:x,header:S,zIndex:j,layout:C,disabled:T,aside:R,footer:E,offsetScrollbars:_=!0,mod:k,attributes:I,...D}=n,P=Ie({name:"AppShell",classes:Ts,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:I,vars:f,varsResolver:g7}),$=p7({disabled:T,transitionDuration:y});return a.jsxs(a7,{value:{getStyles:P,withBorder:m,zIndex:j,disabled:T,offsetScrollbars:_},children:[a.jsx(h7,{navbar:p,header:S,aside:R,footer:E,padding:g}),a.jsx(le,{ref:t,...P("root"),mod:[{resizing:$,layout:C,disabled:T},k],...D})]})});Tr.classes=Ts;Tr.displayName="@mantine/core/AppShell";Tr.Navbar=i0;Tr.Header=n0;Tr.Main=r0;Tr.Aside=e0;Tr.Footer=t0;Tr.Section=o0;function CD(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=>CD(t))}:e}function ED(e){return e?e.map(t=>CD(t)):[]}function TD(e){return e.reduce((t,n)=>"group"in n?{...t,...TD(n.items)}:(t[n.value]=n,t),{})}var Lr={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",optionsDropdownCheckPlaceholder:"m_a530ee0a"};const v7={error:null},y7=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":at(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Kt(n,e):void 0}}),wm=ge((e,t)=>{const n=oe("ComboboxChevron",v7,e),{size:r,error:o,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,mod:g,...y}=n,x=Ie({name:"ComboboxChevron",classes:Lr,props:n,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,varsResolver:y7,rootSelector:"chevron"});return a.jsx(le,{component:"svg",...y,...x("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},g],ref:t,children:a.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});wm.classes=Lr;wm.displayName="@mantine/core/ComboboxChevron";const[x7,$i]=Ar("Combobox component was not found in tree"),RD=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},s)=>a.jsx(hn.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:c=>{c.preventDefault(),t?.(c)},onClick:c=>{r(),n?.(c)}}));RD.displayName="@mantine/core/ComboboxClearButton";const a0=ge((e,t)=>{const{classNames:n,styles:r,className:o,style:s,hidden:c,...d}=oe("ComboboxDropdown",null,e),f=$i();return a.jsx(Zr.Dropdown,{...d,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:o,style:s,classNames:n,styles:r})})});a0.classes=Lr;a0.displayName="@mantine/core/ComboboxDropdown";const b7={refProp:"ref"},_D=ge((e,t)=>{const{children:n,refProp:r}=oe("ComboboxDropdownTarget",b7,e);if($i(),!sm(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return a.jsx(Zr.Target,{ref:t,refProp:r,children:n})});_D.displayName="@mantine/core/ComboboxDropdownTarget";const s0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("ComboboxEmpty",null,e),f=$i();return a.jsx(le,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:s,style:o}),...d})});s0.classes=Lr;s0.displayName="@mantine/core/ComboboxEmpty";function l0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:s}){const c=$i(),[d,f]=v.useState(null),p=g=>{if(e?.(g),!c.readOnly&&t){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectNextOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectPreviousOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const y=c.store.getSelectedOptionIndex();c.store.dropdownOpened&&y!==-1?(g.preventDefault(),c.store.clickSelectedOption()):o==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&o==="button"&&(g.preventDefault(),c.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r?!!(c.store.listId&&c.store.dropdownOpened):void 0,"aria-controls":c.store.dropdownOpened&&c.store.listId?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&d||void 0,autoComplete:s,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const S7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},DD=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=oe("ComboboxEventsTarget",S7,e),m=Nl(n);if(!m)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 g=$i(),y=l0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:m.props.onKeyDown,autoComplete:f});return v.cloneElement(m,{...y,...p,[r]:Un(t,g.store.targetRef,lm(m))})});DD.displayName="@mantine/core/ComboboxEventsTarget";const c0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("ComboboxFooter",null,e),f=$i();return a.jsx(le,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:o,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});c0.classes=Lr;c0.displayName="@mantine/core/ComboboxFooter";const u0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,children:d,label:f,id:p,...m}=oe("ComboboxGroup",null,e),g=$i(),y=xr(p);return a.jsxs(le,{ref:t,role:"group","aria-labelledby":f?y:void 0,...g.getStyles("group",{className:r,classNames:n,style:o,styles:s}),...m,children:[f&&a.jsx("div",{id:y,...g.getStyles("groupLabel",{classNames:n,styles:s}),children:f}),d]})});u0.classes=Lr;u0.displayName="@mantine/core/ComboboxGroup";const d0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("ComboboxHeader",null,e),f=$i();return a.jsx(le,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:o,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});d0.classes=Lr;d0.displayName="@mantine/core/ComboboxHeader";function AD({value:e,valuesDivider:t=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}AD.displayName="@mantine/core/ComboboxHiddenInput";const f0=ge((e,t)=>{const n=oe("ComboboxOption",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:y,disabled:x,selected:S,mod:j,...C}=n,T=$i(),R=v.useId(),E=p||R;return a.jsx(le,{...T.getStyles("option",{className:o,classNames:r,styles:c,style:s}),...C,ref:t,id:E,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":x,"combobox-selected":S},j],role:"option",onClick:_=>{x?_.preventDefault():(T.onOptionSubmit?.(n.value,n),f?.(_))},onMouseDown:_=>{_.preventDefault(),g?.(_)},onMouseOver:_=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),y?.(_)}})});f0.classes=Lr;f0.displayName="@mantine/core/ComboboxOption";const h0=ge((e,t)=>{const n=oe("ComboboxOptions",null,e),{classNames:r,className:o,style:s,styles:c,id:d,onMouseDown:f,labelledBy:p,...m}=n,g=$i(),y=xr(d);return v.useEffect(()=>{g.store.setListId(y)},[y]),a.jsx(le,{ref:t,...g.getStyles("options",{className:o,style:s,classNames:r,styles:c}),...m,id:y,role:"listbox","aria-labelledby":p,onMouseDown:x=>{x.preventDefault(),f?.(x)}})});h0.classes=Lr;h0.displayName="@mantine/core/ComboboxOptions";const w7={withAriaAttributes:!0,withKeyboardNavigation:!0},p0=ge((e,t)=>{const n=oe("ComboboxSearch",w7,e),{classNames:r,styles:o,unstyled:s,vars:c,withAriaAttributes:d,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,y=$i(),x=y.getStyles("search"),S=l0({targetType:"input",withAriaAttributes:d,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return a.jsx(hn,{ref:Un(t,y.store.searchRef),classNames:[{input:x.className},r],styles:[{input:x.style},o],size:m||y.size,...S,...g,__staticSelector:"Combobox"})});p0.classes=Lr;p0.displayName="@mantine/core/ComboboxSearch";const j7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},kD=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=oe("ComboboxTarget",j7,e),m=Nl(n);if(!m)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 g=$i(),y=l0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:m.props.onKeyDown,autoComplete:f}),x=v.cloneElement(m,{...y,...p});return a.jsx(Zr.Target,{ref:Un(t,g.store.targetRef),children:x})});kD.displayName="@mantine/core/ComboboxTarget";function C7(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 E7(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 T7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Il({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:s=!0,scrollBehavior:c="instant"}={}){const[d,f]=nr({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=v.useRef(null),m=v.useRef(-1),g=v.useRef(null),y=v.useRef(null),x=v.useRef(-1),S=v.useRef(-1),j=v.useRef(-1),C=v.useCallback((M="unknown")=>{d||(f(!0),o?.(M))},[f,o,d]),T=v.useCallback((M="unknown")=>{d&&(f(!1),r?.(M))},[f,r,d]),R=v.useCallback((M="unknown")=>{d?T(M):C(M)},[T,C,d]),E=v.useCallback(()=>{const M=as(y.current),L=vp(`#${p.current} [data-combobox-selected]`,M);L?.removeAttribute("data-combobox-selected"),L?.removeAttribute("aria-selected")},[]),_=v.useCallback(M=>{const L=as(y.current),z=vp(`#${p.current}`,L),F=z?cs("[data-combobox-option]",z):null;if(!F)return null;const Y=M>=F.length?0:M<0?F.length-1:M;return m.current=Y,F?.[Y]&&!F[Y].hasAttribute("data-combobox-disabled")?(E(),F[Y].setAttribute("data-combobox-selected","true"),F[Y].setAttribute("aria-selected","true"),F[Y].scrollIntoView({block:"nearest",behavior:c}),F[Y].id):null},[c,E]),k=v.useCallback(()=>{const M=as(y.current),L=vp(`#${p.current} [data-combobox-active]`,M);if(L){const F=cs(`#${p.current} [data-combobox-option]`,M).findIndex(Y=>Y===L);return _(F)}return _(0)},[_]),I=v.useCallback(()=>{const M=as(y.current),L=cs(`#${p.current} [data-combobox-option]`,M);return _(E7(m.current,L,s))},[_,s]),D=v.useCallback(()=>{const M=as(y.current),L=cs(`#${p.current} [data-combobox-option]`,M);return _(C7(m.current,L,s))},[_,s]),P=v.useCallback(()=>{const M=as(y.current),L=cs(`#${p.current} [data-combobox-option]`,M);return _(T7(L))},[_]),$=v.useCallback((M="selected",L)=>{j.current=window.setTimeout(()=>{const z=as(y.current),F=cs(`#${p.current} [data-combobox-option]`,z),Y=F.findIndex(O=>O.hasAttribute(`data-combobox-${M}`));m.current=Y,L?.scrollIntoView&&F[Y]?.scrollIntoView({block:"nearest",behavior:c})},0)},[]),B=v.useCallback(()=>{m.current=-1,E()},[E]),Q=v.useCallback(()=>{const M=as(y.current);cs(`#${p.current} [data-combobox-option]`,M)?.[m.current]?.click()},[]),K=v.useCallback(M=>{p.current=M},[]),Z=v.useCallback(()=>{x.current=window.setTimeout(()=>g.current?.focus(),0)},[]),U=v.useCallback(()=>{S.current=window.setTimeout(()=>y.current?.focus(),0)},[]),G=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(x.current),window.clearTimeout(S.current),window.clearTimeout(j.current)},[]),{dropdownOpened:d,openDropdown:C,closeDropdown:T,toggleDropdown:R,selectedOptionIndex:m.current,getSelectedOptionIndex:G,selectOption:_,selectFirstOption:P,selectActiveOption:k,selectNextOption:I,selectPreviousOption:D,resetSelectedOption:B,updateSelectedOptionIndex:$,listId:p.current,setListId:K,clickSelectedOption:Q,searchRef:g,focusSearchInput:Z,targetRef:y,focusTarget:U}}const R7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},_7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Qn(t),"--combobox-option-padding":at(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:ue(n),"--combobox-option-fz":Qn(t),"--combobox-option-padding":at(t,"combobox-option-padding")}});function Ke(e){const t=oe("Combobox",R7,e),{classNames:n,styles:r,unstyled:o,children:s,store:c,vars:d,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:y,__staticSelector:x,readOnly:S,attributes:j,...C}=t,T=Il(),R=c||T,E=Ie({name:x||"Combobox",classes:Lr,props:t,classNames:n,styles:r,unstyled:o,attributes:j,vars:d,varsResolver:_7}),_=()=>{p?.(),R.closeDropdown()};return a.jsx(x7,{value:{getStyles:E,store:R,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:y,readOnly:S},children:a.jsx(Zr,{opened:R.dropdownOpened,preventPositionChangeWhenVisible:!1,...C,onChange:k=>!k&&_(),withRoles:!1,unstyled:o,children:s})})}const D7=e=>e;Ke.extend=D7;Ke.classes=Lr;Ke.displayName="@mantine/core/Combobox";Ke.Target=kD;Ke.Dropdown=a0;Ke.Options=h0;Ke.Option=f0;Ke.Search=p0;Ke.Empty=s0;Ke.Chevron=wm;Ke.Footer=c0;Ke.Header=d0;Ke.EventsTarget=DD;Ke.DropdownTarget=_D;Ke.Group=u0;Ke.ClearButton=RD;Ke.HiddenInput=AD;var PD={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const ND=PD,jm=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:s,children:c,label:d,description:f,id:p,disabled:m,error:g,size:y,labelPosition:x="left",bodyElement:S="div",labelElement:j="label",variant:C,style:T,vars:R,mod:E,attributes:_,...k},I)=>{const D=Ie({name:e,props:t,className:n,style:T,classes:PD,classNames:r,styles:o,unstyled:s,attributes:_});return a.jsx(le,{...D("root"),ref:I,__vars:{"--label-fz":Qn(y),"--label-lh":at(y,"label-lh")},mod:[{"label-position":x},E],variant:C,size:y,...k,children:a.jsxs(le,{component:S,htmlFor:S==="label"?p:void 0,...D("body"),children:[c,a.jsxs("div",{...D("labelWrapper"),"data-disabled":m||void 0,children:[d&&a.jsx(le,{component:j,htmlFor:j==="label"?p:void 0,...D("label"),"data-disabled":m||void 0,children:d}),f&&a.jsx(hn.Description,{size:y,__inheritStyles:!1,...D("description"),children:f}),g&&typeof g!="boolean"&&a.jsx(hn.Error,{size:y,__inheritStyles:!1,...D("error"),children:g})]})]})})});jm.displayName="@mantine/core/InlineInput";const OD=v.createContext(null),A7=OD.Provider,MD=()=>v.useContext(OD),[k7,P7]=Bo();var LD={card:"m_26775b0a"};const N7={withBorder:!0},O7=(e,{radius:t})=>({card:{"--card-radius":Bt(t)}}),m0=ge((e,t)=>{const n=oe("CheckboxCard",N7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:x,defaultChecked:S,onChange:j,attributes:C,...T}=n,R=Ie({name:"CheckboxCard",classes:LD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:O7,rootSelector:"card"}),E=MD(),_=typeof p=="boolean"?p:E?E.value.includes(y||""):void 0,[k,I]=nr({value:_,defaultValue:S,finalValue:!1,onChange:j});return a.jsx(k7,{value:{checked:k},children:a.jsx(Pn,{ref:t,mod:[{"with-border":g,checked:k},m],...R("card"),...T,role:"checkbox","aria-checked":k,onClick:D=>{x?.(D),E?.onChange(y||""),I(!k)}})})});m0.displayName="@mantine/core/CheckboxCard";m0.classes=LD;function g0({children:e,role:t}){const n=uu();return n?a.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):a.jsx(a.Fragment,{children:e})}const v0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,readOnly:f,disabled:p,...m}=oe("CheckboxGroup",null,e),[g,y]=nr({value:n,defaultValue:r,finalValue:[],onChange:o}),x=S=>{const j=typeof S=="string"?S:S.currentTarget.value;!f&&y(g.includes(j)?g.filter(C=>C!==j):[...g,j])};return a.jsx(A7,{value:{value:g,onChange:x,size:s,disabled:p},children:a.jsx(hn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"CheckboxGroup",children:a.jsx(g0,{role:"group",children:d})})})});v0.classes=hn.Wrapper.classes;v0.displayName="@mantine/core/CheckboxGroup";function sf({size:e,style:t,...n}){const r=e!==void 0?{width:ue(e),height:ue(e),...t}:t;return a.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:a.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function ID({indeterminate:e,...t}){return e?a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:a.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):a.jsx(sf,{...t})}var zD={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const M7={icon:ID,variant:"filled"},L7=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const d=Xr({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--checkbox-size":at(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Bt(t),"--checkbox-color":s==="outline"?f:Kt(n,e),"--checkbox-icon-color":o?Kt(o,e):Ml(c,e)?Ta({color:n,theme:e,autoContrast:c}):void 0}}},y0=ge((e,t)=>{const n=oe("CheckboxIndicator",M7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,icon:p,indeterminate:m,radius:g,color:y,iconColor:x,autoContrast:S,checked:j,mod:C,variant:T,disabled:R,attributes:E,..._}=n,k=Ie({name:"CheckboxIndicator",classes:zD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:E,vars:f,varsResolver:L7,rootSelector:"indicator"}),I=P7(),D=typeof j=="boolean"||typeof m=="boolean"?j||m:I?.checked||!1;return a.jsx(le,{ref:t,...k("indicator",{variant:T}),variant:T,mod:[{checked:D,disabled:R},C],..._,children:a.jsx(p,{indeterminate:m,...k("icon")})})});y0.displayName="@mantine/core/CheckboxIndicator";y0.classes=zD;var $D={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const I7={labelPosition:"right",icon:ID,variant:"filled"},z7=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const d=Xr({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--checkbox-size":at(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Bt(t),"--checkbox-color":s==="outline"?f:Kt(n,e),"--checkbox-icon-color":o?Kt(o,e):Ml(c,e)?Ta({color:n,theme:e,autoContrast:c}):void 0}}},un=ge((e,t)=>{const n=oe("Checkbox",I7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,id:g,size:y,radius:x,wrapperProps:S,checked:j,labelPosition:C,description:T,error:R,disabled:E,variant:_,indeterminate:k,icon:I,rootRef:D,iconColor:P,onChange:$,autoContrast:B,mod:Q,attributes:K,...Z}=n,U=MD(),G=y||U?.size,M=Ie({name:"Checkbox",props:n,classes:$D,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:K,vars:f,varsResolver:z7}),{styleProps:L,rest:z}=Ra(Z),F=xr(g),Y={checked:U?.value.includes(z.value)??j,onChange:se=>{U?.onChange(se),$?.(se)},disabled:U?.disabled??E},O=v.useRef(null),H=t||O;return v.useEffect(()=>{H&&"current"in H&&H.current&&(H.current.indeterminate=k||!1,k?H.current.setAttribute("data-indeterminate","true"):H.current.removeAttribute("data-indeterminate"))},[k,H]),a.jsx(jm,{...M("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:F,size:G,labelPosition:C,label:m,description:T,error:R,disabled:Y.disabled,classNames:r,styles:c,unstyled:d,"data-checked":Y.checked||j||void 0,variant:_,ref:D,mod:Q,...L,...S,children:a.jsxs(le,{...M("inner"),mod:{"data-label-position":C},children:[a.jsx(le,{component:"input",id:F,ref:H,mod:{error:!!R},...M("input",{focusable:!0,variant:_}),...z,...Y,type:"checkbox"}),a.jsx(I,{indeterminate:k,...M("icon")})]})})});un.classes={...$D,...ND};un.displayName="@mantine/core/Checkbox";un.Group=v0;un.Indicator=y0;un.Card=m0;function Jc(e){return"group"in e}function UD({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let s=0;s<e.length;s+=1){const c=e[s];if(o.length===n)return o;Jc(c)&&o.push({group:c.group,items:UD({options:c.items,search:t,limit:n-o.length})}),Jc(c)||c.label.toLowerCase().includes(r)&&o.push(c)}return o}function $7(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 BD(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Jc(n))BD(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 U7(e,t){return Array.isArray(e)?e.includes(t):e===t}function VD({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:o,unstyled:s,renderOption:c}){if(!Jc(e)){const f=U7(r,e.value),p=t&&(f?a.jsx(sf,{className:Lr.optionsDropdownCheckIcon}):n?a.jsx("div",{className:Lr.optionsDropdownCheckPlaceholder}):null),m=a.jsxs(a.Fragment,{children:[o==="left"&&p,a.jsx("span",{children:e.label}),o==="right"&&p]});return a.jsx(Ke.Option,{value:e.value,disabled:e.disabled,className:Ut({[Lr.optionsDropdownOption]:!s}),"data-reverse":o==="right"||void 0,"data-checked":f||void 0,"aria-selected":f,active:f,children:typeof c=="function"?c({option:e,checked:f}):m})}const d=e.items.map(f=>a.jsx(VD,{data:f,value:r,unstyled:s,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:o,renderOption:c},f.value));return a.jsx(Ke.Group,{label:e.group,children:d})}function B7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:s,maxDropdownHeight:c,withScrollArea:d=!0,filterOptions:f=!0,withCheckIcon:p=!1,withAlignedLabels:m=!1,value:g,checkIconPosition:y,nothingFoundMessage:x,unstyled:S,labelId:j,renderOption:C,scrollAreaProps:T,"aria-label":R}){BD(e);const _=typeof o=="string"?(r||UD)({options:e,search:f?o:"",limit:s??1/0}):e,k=$7(_),I=_.map(D=>a.jsx(VD,{data:D,withCheckIcon:p,withAlignedLabels:m,value:g,checkIconPosition:y,unstyled:S,renderOption:C},Jc(D)?D.group:D.value));return a.jsx(Ke.Dropdown,{hidden:t||n&&k,"data-composed":!0,children:a.jsxs(Ke.Options,{labelledBy:j,"aria-label":R,children:[d?a.jsx(Jr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...T,children:I}):I,k&&x&&a.jsx(Ke.Empty,{children:x})]})})}const FD=v.createContext(null),V7=FD.Provider;function F7(){return{withinGroup:!!v.useContext(FD)}}var Cm={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const H7=(e,{spacing:t})=>({group:{"--ag-spacing":Gn(t)}}),x0=ge((e,t)=>{const n=oe("AvatarGroup",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,spacing:p,attributes:m,...g}=n,y=Ie({name:"AvatarGroup",classes:Cm,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:m,vars:f,varsResolver:H7,rootSelector:"group"});return a.jsx(V7,{value:!0,children:a.jsx(le,{ref:t,...y("group"),...g})})});x0.classes=Cm;x0.displayName="@mantine/core/AvatarGroup";function q7(e){return a.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function G7(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 Q7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function W7(e,t=Q7){const n=G7(e),r=Math.abs(n)%t.length;return t[r]}function Y7(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 K7=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c,name:d,allowedInitialsColors:f})=>{const p=s==="initials"&&typeof d=="string"?W7(d,f):s,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":at(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Bt(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}}},Zc=ir((e,t)=>{const n=oe("Avatar",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,src:p,alt:m,radius:g,color:y,gradient:x,imageProps:S,children:j,autoContrast:C,mod:T,name:R,allowedInitialsColors:E,attributes:_,...k}=n,I=F7(),[D,P]=v.useState(!p),$=Ie({name:"Avatar",props:n,classes:Cm,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:_,vars:f,varsResolver:K7});return v.useEffect(()=>P(!p),[p]),a.jsx(le,{...$("root"),mod:[{"within-group":I.withinGroup},T],ref:t,...k,children:D||!p?a.jsx("span",{...$("placeholder"),title:m,children:j||typeof R=="string"&&Y7(R)||a.jsx(q7,{})}):a.jsx("img",{...S,...$("image"),src:p,alt:m,onError:B=>{P(!0),S?.onError?.(B)}})})});Zc.classes=Cm;Zc.displayName="@mantine/core/Avatar";Zc.Group=x0;var HD={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const X7=(e,{radius:t,color:n,gradient:r,variant:o,size:s,autoContrast:c,circle:d})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:c});return{root:{"--badge-height":at(s,"badge-height"),"--badge-padding-x":at(s,"badge-padding-x"),"--badge-fz":at(s,"badge-fz"),"--badge-radius":d||t===void 0?void 0:Bt(t),"--badge-bg":n||o?f.background:void 0,"--badge-color":n||o?f.color:void 0,"--badge-bd":n||o?f.border:void 0,"--badge-dot-color":o==="dot"?Kt(n,e):void 0}}},b0=ir((e,t)=>{const n=oe("Badge",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,gradient:g,leftSection:y,rightSection:x,children:S,variant:j,fullWidth:C,autoContrast:T,circle:R,mod:E,attributes:_,...k}=n,I=Ie({name:"Badge",props:n,classes:HD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:_,vars:f,varsResolver:X7});return a.jsxs(le,{variant:j,mod:[{block:C,circle:R,"with-right-section":!!x,"with-left-section":!!y},E],...I("root",{variant:j}),ref:t,...k,children:[y&&a.jsx("span",{...I("section"),"data-position":"left",children:y}),a.jsx("span",{...I("label"),children:S}),x&&a.jsx("span",{...I("section"),"data-position":"right",children:x})]})});b0.classes=HD;b0.displayName="@mantine/core/Badge";var qD={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const J7={iconSize:48},Z7=(e,{color:t,iconSize:n,radius:r})=>{const o=Xr({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),s=Xr({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":Ai(s.value,.07),"--bq-bg-dark":Ai(o.value,.06),"--bq-bd":Kt(t,e),"--bq-icon-size":ue(n),"--bq-radius":Bt(r)}}},S0=ge((e,t)=>{const n=oe("Blockquote",J7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,icon:m,iconSize:g,cite:y,attributes:x,...S}=n,j=Ie({name:"Blockquote",classes:qD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:x,vars:f,varsResolver:Z7});return a.jsxs(le,{component:"blockquote",ref:t,...j("root"),...S,children:[m&&a.jsx("span",{...j("icon"),children:m}),p,y&&a.jsx("cite",{...j("cite"),children:y})]})});S0.classes=qD;S0.displayName="@mantine/core/Blockquote";var fu={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const nT={orientation:"horizontal"},e6=(e,{borderWidth:t})=>({group:{"--button-border-width":ue(t)}}),w0=ge((e,t)=>{const n=oe("ButtonGroup",nT,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,attributes:x,...S}=oe("ButtonGroup",nT,e),j=Ie({name:"ButtonGroup",props:n,classes:fu,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:x,vars:p,varsResolver:e6,rootSelector:"group"});return a.jsx(le,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...S})});w0.classes=fu;w0.displayName="@mantine/core/ButtonGroup";const t6=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{groupSection:{"--section-height":at(c,"section-height"),"--section-padding-x":at(c,"section-padding-x"),"--section-fz":c?.includes("compact")?Qn(c.replace("compact-","")):Qn(c),"--section-radius":t===void 0?void 0:Bt(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},j0=ge((e,t)=>{const n=oe("ButtonGroupSection",null,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,attributes:x,...S}=n,j=Ie({name:"ButtonGroupSection",props:n,classes:fu,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:x,vars:f,varsResolver:t6,rootSelector:"groupSection"});return a.jsx(le,{...j("groupSection"),ref:t,variant:p,...S})});j0.classes=fu;j0.displayName="@mantine/core/ButtonGroupSection";const n6={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${ue(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},r6=(e,{radius:t,color:n,gradient:r,variant:o,size:s,justify:c,autoContrast:d})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:d});return{root:{"--button-justify":c,"--button-height":at(s,"button-height"),"--button-padding-x":at(s,"button-padding-x"),"--button-fz":s?.includes("compact")?Qn(s.replace("compact-","")):Qn(s),"--button-radius":t===void 0?void 0:Bt(t),"--button-bg":n||o?f.background:void 0,"--button-hover":n||o?f.hover:void 0,"--button-color":f.color,"--button-bd":n||o?f.border:void 0,"--button-hover-color":n||o?f.hoverColor:void 0}}},Ne=ir((e,t)=>{const n=oe("Button",null,e),{style:r,vars:o,className:s,color:c,disabled:d,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:y,radius:x,loading:S,loaderProps:j,gradient:C,classNames:T,styles:R,unstyled:E,"data-disabled":_,autoContrast:k,mod:I,attributes:D,...P}=n,$=Ie({name:"Button",props:n,classes:fu,className:s,style:r,classNames:T,styles:R,unstyled:E,attributes:D,vars:o,varsResolver:r6}),B=!!p,Q=!!m;return a.jsxs(Pn,{ref:t,...$("root",{active:!d&&!S&&!_}),unstyled:E,variant:y,disabled:d||S,mod:[{disabled:d||_,loading:S,block:g,"with-left-section":B,"with-right-section":Q},I],...P,children:[typeof S=="boolean"&&a.jsx(oo,{mounted:S,transition:n6,duration:150,children:K=>a.jsx(le,{component:"span",...$("loader",{style:K}),"aria-hidden":!0,children:a.jsx(_r,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),a.jsxs("span",{...$("inner"),children:[p&&a.jsx(le,{component:"span",...$("section"),mod:{position:"left"},children:p}),a.jsx(le,{component:"span",mod:{loading:S},...$("label"),children:f}),m&&a.jsx(le,{component:"span",...$("section"),mod:{position:"right"},children:m})]})]})});Ne.classes=fu;Ne.displayName="@mantine/core/Button";Ne.Group=w0;Ne.GroupSection=j0;var GD={root:"m_4451eb3a"};const To=ir((e,t)=>{const n=oe("Center",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,inline:p,mod:m,attributes:g,...y}=n,x=Ie({name:"Center",props:n,classes:GD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:g,vars:f});return a.jsx(le,{ref:t,mod:[{inline:p},m],...x("root"),...y})});To.classes=GD;To.displayName="@mantine/core/Center";const[i6,o6]=Bo();function QD(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:s}=oe("ChipGroup",null,e),[c,d]=nr({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,p=m=>{const g=m.currentTarget.value;Array.isArray(c)?d(c.includes(g)?c.filter(y=>y!==g):[...c,g]):d(g)};return a.jsx(i6,{value:{isChipSelected:f,onChange:p,multiple:o},children:s})}QD.displayName="@mantine/core/ChipGroup";var WD={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 a6={type:"checkbox"},s6=(e,{size:t,radius:n,variant:r,color:o,autoContrast:s})=>{const c=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:s});return{root:{"--chip-fz":Qn(t),"--chip-size":at(t,"chip-size"),"--chip-radius":n===void 0?void 0:Bt(n),"--chip-checked-padding":at(t,"chip-checked-padding"),"--chip-padding":at(t,"chip-padding"),"--chip-icon-size":at(t,"chip-icon-size"),"--chip-bg":o||r?c.background:void 0,"--chip-hover":o||r?c.hover:void 0,"--chip-color":o||r?c.color:void 0,"--chip-bd":o||r?c.border:void 0,"--chip-spacing":at(t,"chip-spacing")}}},Od=ge((e,t)=>{const n=oe("Chip",a6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,id:p,checked:m,defaultChecked:g,onChange:y,value:x,wrapperProps:S,type:j,disabled:C,children:T,size:R,variant:E,icon:_,rootRef:k,autoContrast:I,mod:D,attributes:P,...$}=n,B=Ie({name:"Chip",classes:WD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:P,vars:f,varsResolver:s6}),Q=o6(),K=xr(p),{styleProps:Z,rest:U}=Ra($),[G,M]=nr({value:m,defaultValue:g,finalValue:!1,onChange:y}),L=Q?{checked:Q.isChipSelected(x),onChange:F=>{Q.onChange(F),y?.(F.currentTarget.checked)},type:Q.multiple?"checkbox":"radio"}:{},z=L.checked||G;return a.jsxs(le,{size:R,variant:E,ref:k,mod:D,...B("root"),...Z,...S,children:[a.jsx("input",{type:j,...B("input"),checked:z,onChange:F=>M(F.currentTarget.checked),id:K,disabled:C,ref:t,value:x,...L,...U}),a.jsxs("label",{htmlFor:K,"data-checked":z||void 0,"data-disabled":C||void 0,...B("label",{variant:E||"filled"}),children:[z&&_!==null&&_!==!1&&a.jsx("span",{...B("iconWrapper"),children:_===void 0?a.jsx(sf,{...B("checkIcon")}):_}),a.jsx("span",{children:T})]})]})});Od.classes=WD;Od.displayName="@mantine/core/Chip";Od.Group=QD;var YD={root:"m_b183c0a2"};const l6=(e,{color:t})=>({root:{"--code-bg":t?Kt(t,e):void 0}}),lf=ge((e,t)=>{const n=oe("Code",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,block:m,variant:g,mod:y,attributes:x,...S}=n,j=Ie({name:"Code",props:n,classes:YD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:x,vars:f,varsResolver:l6});return a.jsx(le,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},y],...j("root"),...S,dir:"ltr"})});lf.classes=YD;lf.displayName="@mantine/core/Code";var KD={root:"m_7485cace"};const c6=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:at(t,"container-size")}}),cf=ge((e,t)=>{const n=oe("Container",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,fluid:p,mod:m,attributes:g,strategy:y,...x}=n,S=Ie({name:"Container",classes:KD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:c6});return a.jsx(le,{ref:t,mod:[{fluid:p,strategy:y||"block"},m],...S("root"),...x})});cf.classes=KD;cf.displayName="@mantine/core/Container";const u6={timeout:1e3};function C0(e){const{children:t,timeout:n,value:r,...o}=oe("CopyButton",u6,e),s=X_({timeout:n}),c=()=>s.copy(r);return a.jsx(a.Fragment,{children:t({copy:c,copied:s.copied,...o})})}C0.displayName="@mantine/core/CopyButton";var XD={root:"m_3eebeb36",label:"m_9e365f20"};const d6={orientation:"horizontal"},f6=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Kt(t,e):void 0,"--divider-border-style":n,"--divider-size":at(r,"divider-size")}}),Sn=ge((e,t)=>{const n=oe("Divider",d6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,orientation:m,label:g,labelPosition:y,mod:x,attributes:S,...j}=n,C=Ie({name:"Divider",classes:XD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:f6});return a.jsx(le,{ref:t,mod:[{orientation:m,"with-label":!!g},x],...C("root"),...j,role:"separator",children:g&&a.jsx(le,{component:"span",mod:{position:y},...C("label"),children:g})})});Sn.classes=XD;Sn.displayName="@mantine/core/Divider";const[rT,JD]=Ar("Grid component was not found in tree"),Vx=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,iT=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Vx(e,t),oT=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},aT=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function h6({span:e,order:t,offset:n,selector:r}){const o=Tn(),s=JD(),c=s.breakpoints||o.breakpoints,f=Zi(e)===void 0?12:Zi(e),p=js({"--col-order":Zi(t)?.toString(),"--col-flex-grow":oT(f,s.grow),"--col-flex-basis":Vx(f,s.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":iT(f,s.columns,s.grow),"--col-offset":aT(Zi(n),s.columns)}),m=dn(c).reduce((x,S)=>(x[S]||(x[S]={}),typeof t=="object"&&t[S]!==void 0&&(x[S]["--col-order"]=t[S]?.toString()),typeof e=="object"&&e[S]!==void 0&&(x[S]["--col-flex-grow"]=oT(e[S],s.grow),x[S]["--col-flex-basis"]=Vx(e[S],s.columns),x[S]["--col-width"]=e[S]==="content"?"auto":void 0,x[S]["--col-max-width"]=iT(e[S],s.columns,s.grow)),typeof n=="object"&&n[S]!==void 0&&(x[S]["--col-offset"]=aT(n[S],s.columns)),x),{}),y=_d(dn(m),c).filter(x=>dn(m[x.value]).length>0).map(x=>({query:s.type==="container"?`mantine-grid (min-width: ${c[x.value]})`:`(min-width: ${c[x.value]})`,styles:m[x.value]}));return a.jsx(Ll,{styles:p,media:s.type==="container"?void 0:y,container:s.type==="container"?y:void 0,selector:r})}var E0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const p6={span:12},T0=ge((e,t)=>{const n=oe("GridCol",p6,e),{classNames:r,className:o,style:s,styles:c,vars:d,span:f,order:p,offset:m,...g}=n,y=JD(),x=Zd();return a.jsxs(a.Fragment,{children:[a.jsx(h6,{selector:`.${x}`,span:f,order:p,offset:m}),a.jsx(le,{ref:t,...y.getStyles("col",{className:Ut(o,x),style:s,classNames:r,styles:c}),...g})]})});T0.classes=E0;T0.displayName="@mantine/core/GridCol";function sT({gutter:e,selector:t,breakpoints:n,type:r}){const o=Tn(),s=n||o.breakpoints,c=js({"--grid-gutter":Gn(Zi(e))}),d=dn(s).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=Gn(e[g])),m),{}),p=_d(dn(d),s).filter(m=>dn(d[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${s[m.value]})`:`(min-width: ${s[m.value]})`,styles:d[m.value]}));return a.jsx(Ll,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const m6={gutter:"md",grow:!1,columns:12},g6=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),Rr=ge((e,t)=>{const n=oe("Grid",m6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,grow:p,gutter:m,columns:g,align:y,justify:x,children:S,breakpoints:j,type:C,attributes:T,...R}=n,E=Ie({name:"Grid",classes:E0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:T,vars:f,varsResolver:g6}),_=Zd();return C==="container"&&j?a.jsxs(rT,{value:{getStyles:E,grow:p,columns:g,breakpoints:j,type:C},children:[a.jsx(sT,{selector:`.${_}`,...n}),a.jsx("div",{...E("container"),children:a.jsx(le,{ref:t,...E("root",{className:_}),...R,children:a.jsx("div",{...E("inner"),children:S})})})]}):a.jsxs(rT,{value:{getStyles:E,grow:p,columns:g,breakpoints:j,type:C},children:[a.jsx(sT,{selector:`.${_}`,...n}),a.jsx(le,{ref:t,...E("root",{className:_}),...R,children:a.jsx("div",{...E("inner"),children:S})})]})});Rr.classes=E0;Rr.displayName="@mantine/core/Grid";Rr.Col=T0;function lT({color:e,theme:t,defaultShade:n}){const r=Xr({color:e,theme:t});return r.isThemeColor?r.shade===void 0?`var(--mantine-color-${r.color}-${n})`:`var(${r.variable})`:e}var ZD={root:"m_bcb3f3c2"};const v6={color:"yellow"},y6=(e,{color:t})=>({root:{"--mark-bg-dark":lT({color:t,theme:e,defaultShade:5}),"--mark-bg-light":lT({color:t,theme:e,defaultShade:2})}}),R0=ge((e,t)=>{const n=oe("Mark",v6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,variant:m,attributes:g,...y}=n,x=Ie({name:"Mark",props:n,className:o,style:s,classes:ZD,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:y6});return a.jsx(le,{component:"mark",ref:t,variant:m,...x("root"),...y})});R0.classes=ZD;R0.displayName="@mantine/core/Mark";function cT(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")}function x6(e,t){if(t==null)return[{chunk:e,highlighted:!1}];const n=Array.isArray(t)?t.map(cT):cT(t);if(!(Array.isArray(n)?n.filter(d=>d.trim().length>0).length>0:n.trim()!==""))return[{chunk:e,highlighted:!1}];const o=typeof n=="string"?n.trim():n.filter(d=>d.trim().length!==0).map(d=>d.trim()).sort((d,f)=>f.length-d.length).join("|"),s=new RegExp(`(${o})`,"gi");return e.split(s).map(d=>({chunk:d,highlighted:s.test(d)})).filter(({chunk:d})=>d)}const _0=ir((e,t)=>{const{unstyled:n,children:r,highlight:o,highlightStyles:s,color:c,...d}=oe("Highlight",null,e),f=x6(r,o);return a.jsx(be,{unstyled:n,ref:t,...d,__staticSelector:"Highlight",children:f.map(({chunk:p,highlighted:m},g)=>m?a.jsx(R0,{unstyled:n,color:c,style:s,"data-highlight":p,children:p},g):a.jsx("span",{children:p},g))})});_0.classes=be.classes;_0.displayName="@mantine/core/Highlight";var eA={root:"m_9e117634"};const b6=(e,{radius:t,fit:n})=>({root:{"--image-radius":t===void 0?void 0:Bt(t),"--image-object-fit":n}}),D0=ir((e,t)=>{const n=oe("Image",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,onError:p,src:m,radius:g,fit:y,fallbackSrc:x,mod:S,attributes:j,...C}=n,[T,R]=v.useState(!m);v.useEffect(()=>R(!m),[m]);const E=Ie({name:"Image",classes:eA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:j,vars:f,varsResolver:b6});return T&&x?a.jsx(le,{component:"img",ref:t,src:x,...E("root"),onError:p,mod:["fallback",S],...C}):a.jsx(le,{component:"img",ref:t,...E("root"),src:m,onError:_=>{p?.(_),R(!0)},mod:S,...C})});D0.classes=eA;D0.displayName="@mantine/core/Image";function Ip(){return Ip=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},Ip.apply(null,arguments)}function A0(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 S6=v.useLayoutEffect,w6=function(t){var n=On.useRef(t);return S6(function(){n.current=t}),n},uT=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},j6=function(t,n){var r=On.useRef();return On.useCallback(function(o){t.current=o,r.current&&uT(r.current,null),r.current=n,n&&uT(n,o)},[n])},dT={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},C6=function(t){Object.keys(dT).forEach(function(n){t.style.setProperty(n,dT[n],"important")})},fT=C6,Pr=null,hT=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function E6(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Pr||(Pr=document.createElement("textarea"),Pr.setAttribute("tabindex","-1"),Pr.setAttribute("aria-hidden","true"),fT(Pr)),Pr.parentNode===null&&document.body.appendChild(Pr);var o=e.paddingSize,s=e.borderSize,c=e.sizingStyle,d=c.boxSizing;Object.keys(c).forEach(function(y){var x=y;Pr.style[x]=c[x]}),fT(Pr),Pr.value=t;var f=hT(Pr,e);Pr.value=t,f=hT(Pr,e),Pr.value="x";var p=Pr.scrollHeight-o,m=p*n;d==="border-box"&&(m=m+o+s),f=Math.max(m,f);var g=p*r;return d==="border-box"&&(g=g+o+s),f=Math.min(g,f),[f,p]}var pT=function(){},T6=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},R6=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],_6=!!document.documentElement.currentStyle,D6=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=T6(R6,n),o=r.boxSizing;if(o==="")return null;_6&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:c}},A6=D6;function k0(e,t,n){var r=w6(n);v.useLayoutEffect(function(){var o=function(c){return r.current(c)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var k6=function(t,n){k0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},P6=function(t){k0(window,"resize",t)},N6=function(t){k0(document.fonts,"loadingdone",t)},O6=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],M6=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,s=t.minRows,c=t.onChange,d=c===void 0?pT:c,f=t.onHeightChange,p=f===void 0?pT:f,m=A0(t,O6),g=m.value!==void 0,y=v.useRef(null),x=j6(y,n),S=v.useRef(0),j=v.useRef(),C=function(){var E=y.current,_=r&&j.current?j.current:A6(E);if(_){j.current=_;var k=E6(_,E.value||E.placeholder||"x",s,o),I=k[0],D=k[1];S.current!==I&&(S.current=I,E.style.setProperty("height",I+"px","important"),p(I,{rowHeight:D}))}},T=function(E){g||C(),d(E)};return v.useLayoutEffect(C),k6(y,function(){if(!g){var R=y.current.value;requestAnimationFrame(function(){var E=y.current;E&&R!==E.value&&C()})}}),P6(C),N6(C),v.createElement("textarea",Ip({},m,{onChange:T,ref:x}))},L6=v.forwardRef(M6);const I6={size:"sm"},zl=ge((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:s,resize:c,...d}=oe("Textarea",I6,e),f=n&&i2()!=="test",p=f?{maxRows:r,minRows:o}:{};return a.jsx($r,{component:f?L6:"textarea",ref:t,...d,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});zl.classes=$r.classes;zl.displayName="@mantine/core/Textarea";function mT(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const z6={serialize:JSON.stringify,deserialize:JSON.parse,size:"sm"},hu=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:s,validationError:c,serialize:d,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:y,...x}=oe("JsonInput",z6,e),[S,j]=nr({value:n,defaultValue:r,finalValue:"",onChange:o}),[C,T]=v.useState(mT(S,f)),R=_=>{p?.(_),T(!0)},E=_=>{typeof m=="function"&&m(_);const k=mT(_.currentTarget.value,f);s&&!g&&k&&_.currentTarget.value.trim()!==""&&j(d(f(_.currentTarget.value),null,2)),T(k)};return a.jsx(zl,{value:S,onChange:_=>j(_.currentTarget.value),onFocus:R,onBlur:E,ref:t,readOnly:g,...x,autoComplete:"off",__staticSelector:"JsonInput",error:C?y:c||!0,"data-monospace":!0})});hu.classes=$r.classes;hu.displayName="@mantine/core/JsonInput";var tA={root:"m_dc6f14e2"};const $6=(e,{size:t})=>({root:{"--kbd-fz":at(t,"kbd-fz")}}),Uc=ge((e,t)=>{const n=oe("Kbd",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,attributes:p,...m}=n,g=Ie({name:"Kbd",classes:tA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:p,vars:f,varsResolver:$6});return a.jsx(le,{component:"kbd",ref:t,...g("root"),...m})});Uc.classes=tA;Uc.displayName="@mantine/core/Kbd";const[U6,B6]=Ar("List component was not found in tree");var P0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const N0=ge((e,t)=>{const n=oe("ListItem",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,icon:f,children:p,mod:m,...g}=n,y=B6(),x=f||y.icon,S={classNames:r,styles:c};return a.jsx(le,{...y.getStyles("item",{...S,className:o,style:s}),component:"li",mod:[{"with-icon":!!x,centered:y.center},m],ref:t,...g,children:a.jsxs("div",{...y.getStyles("itemWrapper",S),children:[x&&a.jsx("span",{...y.getStyles("itemIcon",S),children:x}),a.jsx("span",{...y.getStyles("itemLabel",S),children:p})]})})});N0.classes=P0;N0.displayName="@mantine/core/ListItem";const V6={type:"unordered"},F6=(e,{size:t,spacing:n})=>({root:{"--list-fz":Qn(t),"--list-lh":K_(t),"--list-spacing":Gn(n)}}),Or=ge((e,t)=>{const n=oe("List",V6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,type:m,withPadding:g,icon:y,spacing:x,center:S,listStyleType:j,mod:C,attributes:T,...R}=n,E=Ie({name:"List",classes:P0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:T,vars:f,varsResolver:F6});return a.jsx(U6,{value:{center:S,icon:y,getStyles:E},children:a.jsx(le,{...E("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g,type:y?"none":j},C],ref:t,...R,children:p})})});Or.classes=P0;Or.displayName="@mantine/core/List";Or.Item=N0;var nA={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const gT={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:zr("overlay")},H6=(e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}}),Em=ge((e,t)=>{const n=oe("LoadingOverlay",gT,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:y,zIndex:x,attributes:S,...j}=n,C=Tn(),T=Ie({name:"LoadingOverlay",classes:nA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:H6}),R={...gT.overlayProps,...g};return a.jsx(oo,{transition:"fade",...p,mounted:!!y,children:E=>a.jsxs(le,{...T("root",{style:E}),ref:t,...j,children:[a.jsx(_r,{...T("loader"),unstyled:d,...m}),a.jsx(Kc,{...R,...T("overlay"),darkHidden:!0,unstyled:d,color:g?.color||C.white}),a.jsx(Kc,{...R,...T("overlay"),lightHidden:!0,unstyled:d,color:g?.color||C.colors.dark[5]})]})})});Em.classes=nA;Em.displayName="@mantine/core/LoadingOverlay";const[q6,Rs]=Ar("Menu component was not found in the tree");var _s={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const O0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("MenuDivider",null,e),f=Rs();return a.jsx(le,{ref:t,...f.getStyles("divider",{className:r,style:o,styles:s,classNames:n}),...d})});O0.classes=_s;O0.displayName="@mantine/core/MenuDivider";const M0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=oe("MenuDropdown",null,e),y=v.useRef(null),x=Rs(),S=sr(p,T=>{(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),y.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),j=sr(d,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.openDropdown()),C=sr(f,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.closeDropdown());return a.jsxs(Zr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Un(t,y),...x.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[x.withInitialFocusPlaceholder&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});M0.classes=_s;M0.displayName="@mantine/core/MenuDropdown";const[G6,Tm]=Bo(),L0=ir((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,color:d,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:y,"data-disabled":x,...S}=oe("MenuItem",null,e),j=Rs(),C=Tm(),T=Tn(),{dir:R}=Cs(),E=v.useRef(null),_=S,k=sr(_.onClick,()=>{x||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),I=d?T.variantColorResolver({color:d,theme:T,variant:"light"}):void 0,D=d?Xr({color:d,theme:T}):null,P=sr(_.onKeyDown,$=>{$.key==="ArrowLeft"&&C&&(C.close(),C.focusParentItem())});return a.jsxs(Pn,{onMouseDown:$=>$.preventDefault(),...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:Un(E,t),role:"menuitem",disabled:y,"data-menu-item":!0,"data-disabled":y||x||void 0,"data-mantine-stop-propagation":!0,onClick:k,onKeyDown:Eb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:P}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:I?.color,"--menu-item-hover":I?.hover},children:[p&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:p}),g&&a.jsx("div",{...j.getStyles("itemLabel",{styles:s,classNames:n}),children:g}),m&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:m})]})});L0.classes=_s;L0.displayName="@mantine/core/MenuItem";const I0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=oe("MenuLabel",null,e),f=Rs();return a.jsx(le,{ref:t,...f.getStyles("label",{className:r,style:o,styles:s,classNames:n}),...d})});I0.classes=_s;I0.displayName="@mantine/core/MenuLabel";const z0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=oe("MenuSubDropdown",null,e),y=v.useRef(null),x=Rs(),S=Tm(),j=sr(d,S?.open),C=sr(f,S?.close);return a.jsx(Zr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Un(t,y),...x.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:m})});z0.classes=_s;z0.displayName="@mantine/core/MenuSubDropdown";const $0=ir((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,color:d,leftSection:f,rightSection:p,children:m,disabled:g,"data-disabled":y,closeMenuOnClick:x,...S}=oe("MenuSubItem",null,e),j=Rs(),C=Tm(),T=Tn(),{dir:R}=Cs(),E=v.useRef(null),_=S,k=d?T.variantColorResolver({color:d,theme:T,variant:"light"}):void 0,I=d?Xr({color:d,theme:T}):null,D=sr(_.onKeyDown,Q=>{Q.key==="ArrowRight"&&(C?.open(),C?.focusFirstItem()),Q.key==="ArrowLeft"&&C?.parentContext&&(C.parentContext.close(),C.parentContext.focusParentItem())}),P=sr(_.onClick,()=>{!y&&x&&j.closeDropdownImmediately()}),$=sr(_.onMouseEnter,C?.open),B=sr(_.onMouseLeave,C?.close);return a.jsxs(Pn,{onMouseDown:Q=>Q.preventDefault(),...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:Un(E,t),role:"menuitem",disabled:g,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":g||y||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:$,onMouseLeave:B,onClick:P,onKeyDown:Eb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:D}),__vars:{"--menu-item-color":I?.isThemeColor&&I?.shade===void 0?`var(--mantine-color-${I.color}-6)`:k?.color,"--menu-item-hover":k?.hover},children:[f&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:f}),m&&a.jsx("div",{...j.getStyles("itemLabel",{styles:s,classNames:n}),children:m}),a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:p||a.jsx(bD,{...j.getStyles("chevron"),size:14})})]})});$0.classes=_s;$0.displayName="@mantine/core/MenuSubItem";function rA({children:e,refProp:t}){if(!sm(e))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return Rs(),a.jsx(Zr.Target,{refProp:t,popupType:"menu",children:e})}rA.displayName="@mantine/core/MenuSubTarget";const Q6={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function pu(e){const{children:t,closeDelay:n,openDelay:r,...o}=oe("MenuSub",Q6,e),s=xr(),[c,{open:d,close:f}]=Pl(!1),p=Tm(),{openDropdown:m,closeDropdown:g}=xD({open:d,close:f,closeDelay:n,openDelay:r}),y=()=>window.setTimeout(()=>{document.getElementById(`${s}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),x=()=>window.setTimeout(()=>{document.getElementById(`${s}-target`)?.focus()},16);return a.jsx(G6,{value:{opened:c,close:g,open:m,focusFirstItem:y,focusParentItem:x,parentContext:p},children:a.jsx(Zr,{opened:c,withinPortal:!1,withArrow:!1,id:s,...o,children:t})})}pu.extend=e=>e;pu.displayName="@mantine/core/MenuSub";pu.Target=rA;pu.Dropdown=z0;pu.Item=$0;const W6={refProp:"ref"},iA=v.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=oe("MenuTarget",W6,e),s=Nl(n);if(!s)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 c=Rs(),d=s.props,f=sr(d.onClick,()=>{c.trigger==="click"?c.toggleDropdown():c.trigger==="click-hover"&&(c.setOpenedViaClick(!0),c.opened||c.openDropdown())}),p=sr(d.onMouseEnter,()=>(c.trigger==="hover"||c.trigger==="click-hover")&&c.openDropdown()),m=sr(d.onMouseLeave,()=>{(c.trigger==="hover"||c.trigger==="click-hover"&&!c.openedViaClick)&&c.closeDropdown()});return a.jsx(Zr.Target,{refProp:r,popupType:"menu",ref:t,...o,children:v.cloneElement(s,{onClick:f,onMouseEnter:p,onMouseLeave:m,"data-expanded":c.opened?!0:void 0})})});iA.displayName="@mantine/core/MenuTarget";const Y6={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Se(e){const t=oe("Menu",Y6,e),{children:n,onOpen:r,onClose:o,opened:s,defaultOpened:c,trapFocus:d,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:y,openDelay:x,closeDelay:S,classNames:j,styles:C,unstyled:T,variant:R,vars:E,menuItemTabIndex:_,keepMounted:k,withInitialFocusPlaceholder:I,attributes:D,...P}=t,$=Ie({name:"Menu",classes:_s,props:t,classNames:j,styles:C,unstyled:T,attributes:D}),[B,Q]=nr({value:s,defaultValue:c,finalValue:!1,onChange:f}),[K,Z]=v.useState(!1),U=()=>{Q(!1),Z(!1),B&&o?.()},G=()=>{Q(!0),!B&&r?.()},M=()=>{B?U():G()},{openDropdown:L,closeDropdown:z}=xD({open:G,close:U,closeDelay:S,openDelay:x}),F=H=>hM("[data-menu-item]","[data-menu-dropdown]",H),{resolvedClassNames:Y,resolvedStyles:O}=Ol({classNames:j,styles:C,props:t});return a.jsx(q6,{value:{getStyles:$,opened:B,toggleDropdown:M,getItemIndex:F,openedViaClick:K,setOpenedViaClick:Z,closeOnItemClick:p,closeDropdown:y==="click"?U:z,openDropdown:y==="click"?G:L,closeDropdownImmediately:U,loop:m,trigger:y,unstyled:T,menuItemTabIndex:_,withInitialFocusPlaceholder:I},children:a.jsx(Zr,{returnFocus:!0,...P,opened:B,onChange:M,defaultOpened:c,trapFocus:k?!1:d,closeOnEscape:g,__staticSelector:"Menu",classNames:Y,styles:O,unstyled:T,variant:R,keepMounted:k,children:n})})}Se.extend=e=>e;Se.withProps=Z5(Se);Se.classes=_s;Se.displayName="@mantine/core/Menu";Se.Item=L0;Se.Label=I0;Se.Dropdown=M0;Se.Target=iA;Se.Divider=O0;Se.Sub=pu;const[K6,mu]=Ar("Modal component was not found in tree");var Da={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const Rm=ge((e,t)=>{const n=oe("ModalBody",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=mu();return a.jsx(uD,{ref:t,...p.getStyles("body",{classNames:r,style:s,styles:c,className:o}),...f})});Rm.classes=Da;Rm.displayName="@mantine/core/ModalBody";const _m=ge((e,t)=>{const n=oe("ModalCloseButton",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=mu();return a.jsx(dD,{ref:t,...p.getStyles("close",{classNames:r,style:s,styles:c,className:o}),...f})});_m.classes=Da;_m.displayName="@mantine/core/ModalCloseButton";const Dm=ge((e,t)=>{const n=oe("ModalContent",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,children:f,__hidden:p,...m}=n,g=mu(),y=g.scrollAreaComponent||MI;return a.jsx(fD,{...g.getStyles("content",{className:o,style:s,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:o,style:s,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...m,children:a.jsx(y,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${ue(g.yOffset)} * 2))`},children:f})})});Dm.classes=Da;Dm.displayName="@mantine/core/ModalContent";const Am=ge((e,t)=>{const n=oe("ModalHeader",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=mu();return a.jsx(hD,{ref:t,...p.getStyles("header",{classNames:r,style:s,styles:c,className:o}),...f})});Am.classes=Da;Am.displayName="@mantine/core/ModalHeader";const km=ge((e,t)=>{const n=oe("ModalOverlay",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=mu();return a.jsx(pD,{ref:t,...p.getStyles("overlay",{classNames:r,style:s,styles:c,className:o}),...f})});km.classes=Da;km.displayName="@mantine/core/ModalOverlay";const X6={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:zr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},J6=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:Bt(t),"--modal-size":at(n,"modal-size"),"--modal-y-offset":ue(r),"--modal-x-offset":ue(o)}}),Pm=ge((e,t)=>{const n=oe("ModalRoot",X6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:y,centered:x,xOffset:S,__staticSelector:j,attributes:C,...T}=n,R=Ie({name:j,classes:Da,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:J6});return a.jsx(K6,{value:{yOffset:p,scrollAreaComponent:m,getStyles:R,fullScreen:y},children:a.jsx(cD,{ref:t,...R("root"),"data-full-screen":y||void 0,"data-centered":x||void 0,"data-offset-scrollbars":m===Jr.Autosize||void 0,unstyled:d,...T})})});Pm.classes=Da;Pm.displayName="@mantine/core/ModalRoot";const[Z6,ez]=Bo();function oA({children:e}){const[t,n]=v.useState([]),[r,o]=v.useState(zr("modal"));return a.jsx(Z6,{value:{stack:t,addModal:(s,c)=>{n(d=>[...new Set([...d,s])]),o(d=>typeof c=="number"&&typeof d=="number"?Math.max(d,c):d)},removeModal:s=>n(c=>c.filter(d=>d!==s)),getZIndex:s=>`calc(${r} + ${t.indexOf(s)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}oA.displayName="@mantine/core/ModalStack";const Nm=ge((e,t)=>{const n=oe("ModalTitle",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=mu();return a.jsx(mD,{ref:t,...p.getStyles("title",{classNames:r,style:s,styles:c,className:o}),...f})});Nm.classes=Da;Nm.displayName="@mantine/core/ModalTitle";const tz={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:zr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Ln=ge((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:s,closeButtonProps:c,children:d,radius:f,opened:p,stackId:m,zIndex:g,...y}=oe("Modal",tz,e),x=ez(),S=!!n||s,j=x&&m?{closeOnEscape:x.currentId===m,trapFocus:x.currentId===m,zIndex:x.getZIndex(m)}:{},C=r===!1?!1:m&&x?x.currentId===m:p;return v.useEffect(()=>{x&&m&&(p?x.addModal(m,g||zr("modal")):x.removeModal(m))},[p,m,g]),a.jsxs(Pm,{ref:t,radius:f,opened:p,zIndex:x&&m?x.getZIndex(m):g,...y,...j,children:[r&&a.jsx(km,{visible:C,transitionProps:x&&m?{duration:0}:void 0,...o}),a.jsxs(Dm,{radius:f,__hidden:x&&m&&p?m!==x.currentId:!1,children:[S&&a.jsxs(Am,{children:[n&&a.jsx(Nm,{children:n}),s&&a.jsx(_m,{...c})]}),a.jsx(Rm,{children:d})]})]})});Ln.classes=Da;Ln.displayName="@mantine/core/Modal";Ln.Root=Pm;Ln.Overlay=km;Ln.Content=Dm;Ln.Body=Rm;Ln.Header=Am;Ln.Title=Nm;Ln.CloseButton=_m;Ln.Stack=oA;const[nz,U0]=Bo(),[rz,iz]=Bo();var Om={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const oz=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?at(t):at(n,"pg-gap")}}),B0=ge((e,t)=>{const n=oe("PillGroup",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,disabled:m,attributes:g,...y}=n,S=U0()?.size||p||void 0,j=Ie({name:"PillGroup",classes:Om,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:oz,stylesCtx:{size:S},rootSelector:"group"});return a.jsx(rz,{value:{size:S,disabled:m},children:a.jsx(le,{ref:t,size:S,...j("group"),...y})})});B0.classes=Om;B0.displayName="@mantine/core/PillGroup";const az={variant:"default"},sz=(e,{radius:t},{size:n})=>({root:{"--pill-fz":at(n,"pill-fz"),"--pill-height":at(n,"pill-height"),"--pill-radius":t===void 0?void 0:Bt(t)}}),wa=ge((e,t)=>{const n=oe("Pill",az,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:y,removeButtonProps:x,radius:S,size:j,disabled:C,mod:T,attributes:R,...E}=n,_=iz(),k=U0(),I=j||_?.size||void 0,D=k?.variant==="filled"?"contrast":p||"default",P=Ie({name:"Pill",classes:Om,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:R,vars:f,varsResolver:sz,stylesCtx:{size:I}});return a.jsxs(le,{component:"span",ref:t,variant:D,size:I,...P("root",{variant:D}),mod:[{"with-remove":g&&!C,disabled:C||_?.disabled},T],...E,children:[a.jsx("span",{...P("label"),children:m}),g&&a.jsx(Es,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:d,...x,...P("remove",{className:x?.className,style:x?.style}),onMouseDown:$=>{$.preventDefault(),$.stopPropagation(),x?.onMouseDown?.($)},onClick:$=>{$.stopPropagation(),y?.(),x?.onClick?.($)}})]})});wa.classes=Om;wa.displayName="@mantine/core/Pill";wa.Group=B0;var aA={field:"m_45c4369d"};const lz={type:"visible"},V0=ge((e,t)=>{const n=oe("PillsInputField",lz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,type:p,disabled:m,id:g,pointer:y,mod:x,attributes:S,...j}=n,C=U0(),T=uu(),R=Ie({name:"PillsInputField",classes:aA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,rootSelector:"field"}),E=m||C?.disabled;return a.jsx(le,{component:"input",ref:Un(t,C?.fieldRef),"data-type":p,disabled:E,mod:[{disabled:E,pointer:y},x],...R("field"),...j,id:T?.inputId||g,"aria-invalid":C?.hasError,"aria-describedby":T?.describedBy,type:"text",onMouseDown:_=>!y&&_.stopPropagation()})});V0.classes=aA;V0.displayName="@mantine/core/PillsInputField";const cz={size:"sm"},xs=ge((e,t)=>{const n=oe("PillsInput",cz,e),{children:r,onMouseDown:o,onClick:s,size:c,disabled:d,__staticSelector:f,error:p,variant:m,...g}=n,y=v.useRef(null);return a.jsx(nz,{value:{fieldRef:y,size:c,disabled:d,hasError:!!p,variant:m},children:a.jsx($r,{size:c,error:p,variant:m,component:"div",ref:t,"data-no-overflow":!0,onMouseDown:x=>{x.preventDefault(),o?.(x),y.current?.focus()},onClick:x=>{x.preventDefault(),x.currentTarget.closest("fieldset")?.disabled||(y.current?.focus(),s?.(x))},...g,multiline:!0,disabled:d,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});xs.displayName="@mantine/core/PillsInput";xs.Field=V0;function uz({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,s)=>(Jc(s)?o.push({group:s.group,items:s.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(s.value.toLowerCase().trim())===-1&&o.push(s),o),[])}const dz={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:",",clearSearchOnChange:!0,size:"sm"},Mm=ge((e,t)=>{const n=oe("MultiSelect",dz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,value:m,defaultValue:g,onChange:y,onKeyDown:x,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:T,onDropdownOpen:R,onDropdownClose:E,selectFirstOptionOnChange:_,onOptionSubmit:k,comboboxProps:I,filter:D,limit:P,withScrollArea:$,maxDropdownHeight:B,searchValue:Q,defaultSearchValue:K,onSearchChange:Z,readOnly:U,disabled:G,onFocus:M,onBlur:L,radius:z,rightSection:F,rightSectionWidth:Y,rightSectionPointerEvents:O,rightSectionProps:H,leftSection:se,leftSectionWidth:de,leftSectionPointerEvents:ye,leftSectionProps:we,inputContainer:Ee,inputWrapperOrder:Xe,withAsterisk:Ae,labelProps:dt,descriptionProps:Et,errorProps:it,wrapperProps:rt,description:mt,label:Ct,error:jt,maxValues:Te,searchable:_e,nothingFoundMessage:$e,withCheckIcon:Le,withAlignedLabels:lt,checkIconPosition:tt,hidePickedOptions:ft,withErrorStyles:pe,name:qe,form:Ce,id:Pe,clearable:At,clearButtonProps:mn,hiddenInputProps:gn,placeholder:Bn,hiddenInputValuesDivider:an,required:br,mod:Wt,renderOption:dr,onRemove:Rn,onClear:fo,scrollAreaProps:Qo,chevronColor:Ma,attributes:Ur,clearSearchOnChange:Wo,...Fi}=n,ti=xr(Pe),Hi=ED(j),fr=TD(Hi),Os=v.useRef({}),Vn=Il({opened:C,defaultOpened:T,onDropdownOpen:R,onDropdownClose:()=>{E?.(),Vn.resetSelectedOption()}}),{styleProps:ho,rest:{type:Yo,autoComplete:wu,...ql}}=Ra(Fi),[V,X]=nr({value:m,defaultValue:g,finalValue:[],onChange:y}),[ie,je]=nr({value:Q,defaultValue:K,finalValue:"",onChange:Z}),De=Ge=>{je(Ge),Vn.resetSelectedOption()},Ye=Ie({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:d,attributes:Ur}),{resolvedClassNames:ze,resolvedStyles:Oe}=Ol({props:n,styles:c,classNames:r}),Ve=Ge=>{x?.(Ge),Ge.key===" "&&!_e&&(Ge.preventDefault(),Vn.toggleDropdown()),Ge.key==="Backspace"&&ie.length===0&&V.length>0&&(Rn?.(V[V.length-1]),X(V.slice(0,V.length-1)))},Je=V.map((Ge,sn)=>{const _n=fr[Ge]||Os.current[Ge];return a.jsx(wa,{withRemoveButton:!U&&!fr[Ge]?.disabled,onRemove:()=>{X(V.filter(Dn=>Ge!==Dn)),Rn?.(Ge)},unstyled:d,disabled:G,...Ye("pill"),children:_n?.label||Ge},`${Ge}-${sn}`)});v.useEffect(()=>{_&&Vn.selectFirstOption()},[_,ie]),v.useEffect(()=>{V.forEach(Ge=>{Ge in fr&&(Os.current[Ge]=fr[Ge])})},[fr,V]);const st=a.jsx(Ke.ClearButton,{...mn,onClear:()=>{fo?.(),X([]),De("")}}),nt=uz({data:Hi,value:V}),Rt=At&&V.length>0&&!G&&!U;return a.jsxs(a.Fragment,{children:[a.jsxs(Ke,{store:Vn,classNames:ze,styles:Oe,unstyled:d,size:p,readOnly:U,__staticSelector:"MultiSelect",attributes:Ur,onOptionSubmit:Ge=>{k?.(Ge),Wo&&De(""),Vn.updateSelectedOptionIndex("selected"),V.includes(fr[Ge].value)?(X(V.filter(sn=>sn!==fr[Ge].value)),Rn?.(fr[Ge].value)):V.length<Te&&X([...V,fr[Ge].value])},...I,children:[a.jsx(Ke.DropdownTarget,{children:a.jsx(xs,{...ho,__staticSelector:"MultiSelect",classNames:ze,styles:Oe,unstyled:d,size:p,className:o,style:s,variant:S,disabled:G,radius:z,__defaultRightSection:a.jsx(Ke.Chevron,{size:p,error:jt,unstyled:d,color:Ma}),__clearSection:st,__clearable:Rt,rightSection:F,rightSectionPointerEvents:O||"none",rightSectionWidth:Y,rightSectionProps:H,leftSection:se,leftSectionWidth:de,leftSectionPointerEvents:ye,leftSectionProps:we,inputContainer:Ee,inputWrapperOrder:Xe,withAsterisk:Ae,labelProps:dt,descriptionProps:Et,errorProps:it,wrapperProps:rt,description:mt,label:Ct,error:jt,withErrorStyles:pe,__stylesApiProps:{...n,rightSectionPointerEvents:O||(Rt?"all":"none"),multiline:!0},pointer:!_e,onClick:()=>_e?Vn.openDropdown():Vn.toggleDropdown(),"data-expanded":Vn.dropdownOpened||void 0,id:ti,required:br,mod:Wt,attributes:Ur,children:a.jsxs(wa.Group,{attributes:Ur,disabled:G,unstyled:d,...Ye("pillsList"),children:[Je,a.jsx(Ke.EventsTarget,{autoComplete:wu,children:a.jsx(xs.Field,{...ql,ref:t,id:ti,placeholder:Bn,type:!_e&&!Bn?"hidden":"visible",...Ye("inputField"),unstyled:d,onFocus:Ge=>{M?.(Ge),_e&&Vn.openDropdown()},onBlur:Ge=>{L?.(Ge),Vn.closeDropdown(),De("")},onKeyDown:Ve,value:ie,onChange:Ge=>{De(Ge.currentTarget.value),_e&&Vn.openDropdown(),_&&Vn.selectFirstOption()},disabled:G,readOnly:U||!_e,pointer:!_e})})]})})}),a.jsx(B7,{data:ft?nt:Hi,hidden:U||G,filter:D,search:ie,limit:P,hiddenWhenEmpty:!$e,withScrollArea:$,maxDropdownHeight:B,filterOptions:_e,value:V,checkIconPosition:tt,withCheckIcon:Le,withAlignedLabels:lt,nothingFoundMessage:$e,unstyled:d,labelId:Ct?`${ti}-label`:void 0,"aria-label":Ct?void 0:Fi["aria-label"],renderOption:dr,scrollAreaProps:Qo})]}),a.jsx(Ke.HiddenInput,{name:qe,valuesDivider:an,value:V,form:Ce,disabled:G,...gn})]})});Mm.classes={...$r.classes,...Ke.classes};Mm.displayName="@mantine/core/MultiSelect";function fz(e){return"group"in e}function F0({data:e}){if(fz(e)){const o=e.items.map(s=>a.jsx(F0,{data:s},s.value));return a.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return a.jsx("option",{value:e.value,...r,children:e.label},e.value)}F0.displayName="@mantine/core/NativeSelectOption";const hz={rightSectionPointerEvents:"none"},fn=ge((e,t)=>{const{data:n,children:r,size:o,error:s,rightSection:c,unstyled:d,...f}=oe("NativeSelect",hz,e),p=ED(n).map((m,g)=>a.jsx(F0,{data:m},g));return a.jsx($r,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:o,pointer:!0,error:s,unstyled:d,rightSection:c||a.jsx(wm,{size:o,error:s,unstyled:d}),children:r||p})});fn.classes=$r.classes;fn.displayName="@mantine/core/NativeSelect";var sA={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const pz={withCloseButton:!0},mz=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Bt(t),"--notification-color":n?Kt(n,e):void 0}}),H0=ge((e,t)=>{const n=oe("Notification",pz,e),{className:r,color:o,radius:s,loading:c,withCloseButton:d,withBorder:f,title:p,icon:m,children:g,onClose:y,closeButtonProps:x,classNames:S,style:j,styles:C,unstyled:T,vars:R,mod:E,loaderProps:_,role:k,attributes:I,...D}=n,P=Ie({name:"Notification",classes:sA,props:n,className:r,style:j,classNames:S,styles:C,unstyled:T,attributes:I,vars:R,varsResolver:mz});return a.jsxs(le,{...P("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},E],ref:t,role:k||"alert",...D,children:[m&&!c&&a.jsx("div",{...P("icon"),children:m}),c&&a.jsx(_r,{size:28,color:o,..._,...P("loader")}),a.jsxs("div",{...P("body"),children:[p&&a.jsx("div",{...P("title"),children:p}),a.jsx(le,{...P("description"),mod:{"data-with-title":!!p},children:g})]}),d&&a.jsx(Es,{iconSize:16,color:"gray",...x,unstyled:T,onClick:y,...P("closeButton")})]})});H0.classes=sA;H0.displayName="@mantine/core/Notification";function lA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}var Md;(function(e){e.event="event",e.props="prop"})(Md||(Md={}));function fs(){}function gz(e){var t,n=void 0;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t&&r.length===t.length&&r.every(function(s,c){return s===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function Ld(e){return!!(e||"").match(/\d/)}function Hc(e){return e==null}function vz(e){return typeof e=="number"&&isNaN(e)}function cA(e){return Hc(e)||vz(e)||typeof e=="number"&&!isFinite(e)}function uA(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function yz(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}function xz(e,t,n){var r=yz(n),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}function bz(e){var t=v.useRef(e);t.current=e;var n=v.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function q0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),s=o[0],c=o[1]||"";return{beforeDecimal:s,afterDecimal:c,hasNegation:n,addNegation:r}}function Sz(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}function dA(e,t,n){for(var r="",o=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||o;return r}function vT(e,t){return Array(t+1).join(e)}function fA(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],s=r[1];if(s=Number(s),!s)return n+o;o=o.replace(".","");var c=1+s,d=o.length;return c<0?o="0."+vT("0",Math.abs(c))+o:c>=d?o=o+vT("0",c-d):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function yT(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=q0(e),s=o.beforeDecimal,c=o.afterDecimal,d=o.hasNegation,f=parseFloat("0."+(c||"0")),p=c.length<=t?"0."+c:f.toFixed(t),m=p.split("."),g=s;s&&Number(m[0])&&(g=s.split("").reverse().reduce(function(j,C,T){return j.length>T?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var y=dA(m[1]||"",t,n),x=d?"-":"",S=r?".":"";return""+x+g+S+y}function ol(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 hA=gz(function(e,t){for(var n=0,r=0,o=e.length,s=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[s-1-r]&&s-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:s-r}}}),wz=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function jz(e,t,n){return Math.min(Math.max(e,t),n)}function Yy(e){return Math.max(e.selectionStart,e.selectionEnd)}function Cz(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Ez(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function Tz(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function Rz(e,t,n,r,o,s,c){c===void 0&&(c=Tz);var d=o.findIndex(function(_){return _}),f=e.slice(0,d);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var p=n.length,m=e.length,g={},y=new Array(p),x=0;x<p;x++){y[x]=-1;for(var S=0,j=m;S<j;S++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:x,formattedValueIndex:S});if(C&&g[S]!==!0){y[x]=S,g[S]=!0;break}}}for(var T=r;T<p&&(y[T]===-1||!s(n[T]));)T++;var R=T===p||y[T]===-1?m:y[T];for(T=r-1;T>0&&y[T]===-1;)T--;var E=T===-1||y[T]===-1?0:y[T]+1;return E>R?R:r-E<R-r?E:R}function xT(e,t,n,r){var o=e.length;if(t=jz(t,0,o),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function _z(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(Ld(e[n])||Ld(e[n-1]));return t}function pA(e,t,n,r,o,s){s===void 0&&(s=fs);var c=bz(function(S,j){var C,T;return cA(S)?(T="",C=""):typeof S=="number"||j?(T=typeof S=="number"?fA(S):S,C=r(T)):(T=o(S,void 0),C=r(T)),{formattedValue:C,numAsString:T}}),d=v.useState(function(){return c(Hc(e)?t:e,n)}),f=d[0],p=d[1],m=function(S,j){S.formattedValue!==f.formattedValue&&p({formattedValue:S.formattedValue,numAsString:S.value}),s(S,j)},g=e,y=n;Hc(e)&&(g=f.numAsString,y=!0);var x=c(g,y);return v.useMemo(function(){p(x)},[x.formattedValue]),[f,m]}function Dz(e){return e.replace(/[^0-9]/g,"")}function Az(e){return e}function kz(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,o=e.renderText,s=e.getInputRef,c=e.format;c===void 0&&(c=Az);var d=e.removeFormatting;d===void 0&&(d=Dz);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,y=e.onChange;y===void 0&&(y=fs);var x=e.onKeyDown;x===void 0&&(x=fs);var S=e.onMouseUp;S===void 0&&(S=fs);var j=e.onFocus;j===void 0&&(j=fs);var C=e.onBlur;C===void 0&&(C=fs);var T=e.value,R=e.getCaretBoundary;R===void 0&&(R=_z);var E=e.isValidInputCharacter;E===void 0&&(E=Ld);var _=e.isCharacterSame,k=lA(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),I=pA(T,f,!!p,c,d,m),D=I[0],P=D.formattedValue,$=D.numAsString,B=I[1],Q=v.useRef(),K=v.useRef({formattedValue:P,numAsString:$}),Z=function(Te,_e){K.current={formattedValue:Te.formattedValue,numAsString:Te.value},B(Te,_e)},U=v.useState(!1),G=U[0],M=U[1],L=v.useRef(null),z=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return M(!0),function(){clearTimeout(z.current.setCaretTimeout),clearTimeout(z.current.focusTimeout)}},[]);var F=c,Y=function(Te,_e){var $e=parseFloat(_e);return{formattedValue:Te,value:_e,floatValue:isNaN($e)?void 0:$e}},O=function(Te,_e,$e){Te.selectionStart===0&&Te.selectionEnd===Te.value.length||(ol(Te,_e),z.current.setCaretTimeout=setTimeout(function(){Te.value===$e&&Te.selectionStart!==_e&&ol(Te,_e)},0))},H=function(Te,_e,$e){return xT(Te,_e,R(Te),$e)},se=function(Te,_e,$e){var Le=R(_e),lt=Rz(_e,P,Te,$e,Le,E,_);return lt=xT(_e,lt,Le),lt},de=function(Te){var _e=Te.formattedValue;_e===void 0&&(_e="");var $e=Te.input,Le=Te.source,lt=Te.event,tt=Te.numAsString,ft;if($e){var pe=Te.inputValue||$e.value,qe=Yy($e);$e.value=_e,ft=se(pe,_e,qe),ft!==void 0&&O($e,ft,_e)}_e!==P&&Z(Y(_e,tt),{event:lt,source:Le})};v.useEffect(function(){var Te=K.current,_e=Te.formattedValue,$e=Te.numAsString;(P!==_e||$!==$e)&&Z(Y(P,$),{event:void 0,source:Md.props})},[P,$]);var ye=L.current?Yy(L.current):void 0,we=typeof window<"u"?v.useLayoutEffect:v.useEffect;we(function(){var Te=L.current;if(P!==K.current.formattedValue&&Te){var _e=se(K.current.formattedValue,P,ye);Te.value=P,O(Te,_e,P)}},[P]);var Ee=function(Te,_e,$e){var Le=_e.target,lt=Q.current?wz(Q.current,Le.selectionEnd):hA(P,Te),tt=Object.assign(Object.assign({},lt),{lastValue:P}),ft=d(Te,tt),pe=F(ft);if(ft=d(pe,void 0),g&&!g(Y(pe,ft))){var qe=_e.target,Ce=Yy(qe),Pe=se(Te,P,Ce);return qe.value=P,O(qe,Pe,P),!1}return de({formattedValue:pe,numAsString:ft,inputValue:Te,event:_e,source:$e,input:_e.target}),!0},Xe=function(Te,_e){_e===void 0&&(_e=0);var $e=Te.selectionStart,Le=Te.selectionEnd;Q.current={selectionStart:$e,selectionEnd:Le+_e}},Ae=function(Te){var _e=Te.target,$e=_e.value,Le=Ee($e,Te,Md.event);Le&&y(Te),Q.current=void 0},dt=function(Te){var _e=Te.target,$e=Te.key,Le=_e.selectionStart,lt=_e.selectionEnd,tt=_e.value;tt===void 0&&(tt="");var ft;$e==="ArrowLeft"||$e==="Backspace"?ft=Math.max(Le-1,0):$e==="ArrowRight"?ft=Math.min(Le+1,tt.length):$e==="Delete"&&(ft=Le);var pe=0;$e==="Delete"&&Le===lt&&(pe=1);var qe=$e==="ArrowLeft"||$e==="ArrowRight";if(ft===void 0||Le!==lt&&!qe){x(Te),Xe(_e,pe);return}var Ce=ft;if(qe){var Pe=$e==="ArrowLeft"?"left":"right";Ce=H(tt,ft,Pe),Ce!==ft&&Te.preventDefault()}else $e==="Delete"&&!E(tt[ft])?Ce=H(tt,ft,"right"):$e==="Backspace"&&!E(tt[ft])&&(Ce=H(tt,ft,"left"));Ce!==ft&&O(_e,Ce,tt),x(Te),Xe(_e,pe)},Et=function(Te){var _e=Te.target,$e=function(){var Le=_e.selectionStart,lt=_e.selectionEnd,tt=_e.value;if(tt===void 0&&(tt=""),Le===lt){var ft=H(tt,Le);ft!==Le&&O(_e,ft,tt)}};$e(),requestAnimationFrame(function(){$e()}),S(Te),Xe(_e)},it=function(Te){Te.persist&&Te.persist();var _e=Te.target,$e=Te.currentTarget;L.current=_e,z.current.focusTimeout=setTimeout(function(){var Le=_e.selectionStart,lt=_e.selectionEnd,tt=_e.value;tt===void 0&&(tt="");var ft=H(tt,Le);ft!==Le&&!(Le===0&<===tt.length)&&O(_e,ft,tt),j(Object.assign(Object.assign({},Te),{currentTarget:$e}))},0)},rt=function(Te){L.current=null,clearTimeout(z.current.focusTimeout),clearTimeout(z.current.setCaretTimeout),C(Te)},mt=G&&Cz()?"numeric":void 0,Ct=Object.assign({inputMode:mt},k,{type:t,value:P,onChange:Ae,onKeyDown:dt,onMouseUp:Et,onFocus:it,onBlur:rt});if(n==="text")return o?On.createElement(On.Fragment,null,o(P,k)||null):On.createElement("span",Object.assign({},k,{ref:s}),P);if(r){var jt=r;return On.createElement(jt,Object.assign({},Ct,{ref:s}))}return On.createElement("input",Object.assign({},Ct,{ref:s}))}function bT(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var s=t.suffix;s===void 0&&(s="");var c=t.allowNegative,d=t.thousandsGroupStyle;if(d===void 0&&(d="thousand"),e===""||e==="-")return e;var f=Lm(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,y=q0(e,c),x=y.beforeDecimal,S=y.afterDecimal,j=y.addNegation;return n!==void 0&&(S=dA(S,n,!!r)),p&&(x=xz(x,p,d)),o&&(x=o+x),s&&(S=S+s),j&&(x="-"+x),e=x+(g&&m||"")+S,e}function Lm(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 Pz(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),s=r.test(e);return e=e.replace(/-/g,""),o&&!s&&t&&(e="-"+e),e}function Nz(e,t){return new RegExp("(^-)|[0-9]|"+uA(e),"g")}function Oz(e,t,n){return e===""?!0:!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function Mz(e,t,n){var r;t===void 0&&(t=Ez(e));var o=n.allowNegative,s=n.prefix;s===void 0&&(s="");var c=n.suffix;c===void 0&&(c="");var d=n.decimalScale,f=t.from,p=t.to,m=p.start,g=p.end,y=Lm(n),x=y.allowedDecimalSeparators,S=y.decimalSeparator,j=e[g]===S;if(Ld(e)&&(e===s||e===c)&&t.lastValue==="")return e;if(g-m===1&&x.indexOf(e[m])!==-1){var C=d===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var T=function(L,z,F){var Y=!1,O=!1;s.startsWith("-")?Y=!1:L.startsWith("--")?(Y=!1,O=!0):c.startsWith("-")&&L.length===c.length?Y=!1:L[0]==="-"&&(Y=!0);var H=Y?1:0;return O&&(H=2),H&&(L=L.substring(H),z-=H,F-=H),{value:L,start:z,end:F,hasNegation:Y}},R=T(e,m,g),E=R.hasNegation;r=R,e=r.value,m=r.start,g=r.end;var _=T(t.lastValue,f.start,f.end),k=_.start,I=_.end,D=_.value,P=e.substring(m,g);e.length&&D.length&&(k>D.length-c.length||I<s.length)&&!(P&&c.startsWith(P))&&(e=D);var $=0;e.startsWith(s)?$+=s.length:m<s.length&&($=m),e=e.substring($),g-=$;var B=e.length,Q=e.length-c.length;e.endsWith(c)?B=Q:(g>Q||g>e.length-c.length)&&(B=g),e=e.substring(0,B),e=Pz(E?"-"+e:e,o),e=(e.match(Nz(S))||[]).join("");var K=e.indexOf(S);e=e.replace(new RegExp(uA(S),"g"),function(L,z){return z===K?".":""});var Z=q0(e,o),U=Z.beforeDecimal,G=Z.afterDecimal,M=Z.addNegation;return p.end-p.start<f.end-f.start&&U===""&&j&&!parseFloat(G)&&(e=M?"-":""),e}function Lz(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),s=e[0]==="-";o.fill(!1,0,n.length+(s?1:0));var c=e.length;return o.fill(!1,c-r.length+1,c+1),o}function Iz(e){var t=Lm(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var s=e.allowNegative;if(s===void 0&&(s=!0),n===r)throw new Error(`
|
|
46
|
-
Decimal separator can't be same as thousand separator.
|
|
47
|
-
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
48
|
-
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
49
|
-
`);return o.startsWith("-")&&s&&(console.error(`
|
|
50
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
51
|
-
prefix: `+o+`
|
|
52
|
-
allowNegative: `+s+`
|
|
53
|
-
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function zz(e){e=Iz(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=fs);var s=e.onBlur;s===void 0&&(s=fs);var c=e.thousandSeparator,d=e.decimalScale,f=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var m=e.defaultValue,g=e.value,y=e.valueIsNumericString,x=e.onValueChange,S=lA(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Lm(e),C=j.decimalSeparator,T=j.allowedDecimalSeparators,R=function(M){return bT(M,e)},E=function(M,L){return Mz(M,L,e)},_=Hc(g)?m:g,k=y??Oz(_,p,t);Hc(g)?Hc(m)||(k=k||typeof m=="number"):k=k||typeof g=="number";var I=function(M){return cA(M)?M:(typeof M=="number"&&(M=fA(M)),k&&typeof d=="number"?yT(M,d,!!f):M)},D=pA(I(g),I(m),!!k,R,E,x),P=D[0],$=P.numAsString,B=P.formattedValue,Q=D[1],K=function(M){var L=M.target,z=M.key,F=L.selectionStart,Y=L.selectionEnd,O=L.value;if(O===void 0&&(O=""),(z==="Backspace"||z==="Delete")&&Y<p.length){M.preventDefault();return}if(F!==Y){o(M);return}z==="Backspace"&&O[0]==="-"&&F===p.length+1&&n&&ol(L,1),d&&f&&(z==="Backspace"&&O[F-1]===C?(ol(L,F-1),M.preventDefault()):z==="Delete"&&O[F]===C&&M.preventDefault()),T?.includes(z)&&O[F]===C&&ol(L,F+1);var H=c===!0?",":c;z==="Backspace"&&O[F-1]===H&&ol(L,F-1),z==="Delete"&&O[F]===H&&ol(L,F+1),o(M)},Z=function(M){var L=$;if(L.match(/\d/g)||(L=""),r||(L=Sz(L)),f&&d&&(L=yT(L,d,f)),L!==$){var z=bT(L,e);Q({formattedValue:z,value:L,floatValue:parseFloat(L)},{event:M,source:Md.event})}s(M)},U=function(M){return M===C?!0:Ld(M)},G=function(M){var L=M.currentValue,z=M.lastValue,F=M.formattedValue,Y=M.currentValueIndex,O=M.formattedValueIndex,H=L[Y],se=F[O],de=hA(z,L),ye=de.to,we=function(Ee){return E(Ee).indexOf(".")+p.length};return g===0&&f&&d&&L[ye.start]===C&&we(L)<Y&&we(F)>O?!1:Y>=ye.start&&Y<ye.end&&T&&T.includes(H)&&se===C?!0:H===se};return Object.assign(Object.assign({},S),{value:B,valueIsNumericString:!1,isValidInputCharacter:U,isCharacterSame:G,onValueChange:Q,format:R,removeFormatting:E,getCaretBoundary:function(M){return Lz(M,e)},onKeyDown:K,onBlur:Z})}function $z(e){var t=zz(e);return On.createElement(kz,Object.assign({},t))}function ST({direction:e,style:t,...n}){return a.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:e==="up"?"rotate(180deg)":void 0,...t},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:a.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var Fx={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const Uz=/^(0\.0*|-0(\.0*)?)$/,Bz=/^-?0\d+(\.\d+)?\.?$/,Vz=/\.\d*0$/,mA=/^-?\d+\.$/;function Hx(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function Ky(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Hx(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function Fz(e){return e.toString().replace(".","").length}function Hz(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&Fz(t)<14&&t!==""}function wT(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,o=n===void 0||e<=n;return r&&o}const qz={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[".",","]},Gz=(e,{size:t})=>({controls:{"--ni-chevron-size":at(t,"ni-chevron-size")}});function Qz(e,t,n){const r=e.toString(),o=mA.test(r),s=r.replace(/^0+(?=\d)/,""),c=parseFloat(s);if(Number.isNaN(c))return s;if(c>Number.MAX_SAFE_INTEGER)return t!==void 0?t:s;const d=jd(c,n,t);return o?`${d.toString().replace(/^0+(?=\d)/,"")}.`:d}const bl=ge((e,t)=>{const n=oe("NumberInput",qz,e),{className:r,classNames:o,styles:s,unstyled:c,vars:d,onChange:f,onValueChange:p,value:m,defaultValue:g,max:y,min:x,step:S,hideControls:j,rightSection:C,isAllowed:T,clampBehavior:R,onBlur:E,allowDecimal:_,decimalScale:k,onKeyDown:I,onKeyDownCapture:D,handlersRef:P,startValue:$,disabled:B,rightSectionPointerEvents:Q,allowNegative:K,readOnly:Z,size:U,rightSectionWidth:G,stepHoldInterval:M,stepHoldDelay:L,allowLeadingZeros:z,withKeyboardEvents:F,trimLeadingZeroesOnBlur:Y,allowedDecimalSeparators:O,attributes:H,...se}=n,de=Ie({name:"NumberInput",classes:Fx,props:n,classNames:o,styles:s,unstyled:c,attributes:H,vars:d,varsResolver:Gz}),{resolvedClassNames:ye,resolvedStyles:we}=Ol({classNames:o,styles:s,props:n}),[Ee,Xe]=nr({value:m,defaultValue:g,finalValue:"",onChange:f}),Ae=L!==void 0&&M!==void 0,dt=v.useRef(null),Et=v.useRef(null),it=v.useRef(0),rt=(Ce,Pe)=>{Pe.source==="event"&&Xe(Hz(Ce.floatValue,Ce.value)&&!Uz.test(Ce.value)&&!(z&&Bz.test(Ce.value))&&!Vz.test(Ce.value)&&!mA.test(Ce.value)?Ce.floatValue:Ce.value),p?.(Ce,Pe)},mt=Ce=>{const Pe=String(Ce).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Pe?Math.max(0,(Pe[1]?Pe[1].length:0)-(Pe[2]?+Pe[2]:0)):0},Ct=Ce=>{dt.current&&typeof Ce<"u"&&dt.current.setSelectionRange(Ce,Ce)},jt=v.useRef(Ap);jt.current=()=>{if(!Ky(Ee))return;let Ce;const Pe=mt(Ee),At=mt(S),mn=Math.max(Pe,At),gn=10**mn;if(!Hx(Ee)&&(typeof Ee!="number"||Number.isNaN(Ee)))Ce=jd($,x,y);else if(y!==void 0){const an=(Math.round(Number(Ee)*gn)+Math.round(S*gn))/gn;Ce=an<=y?an:y}else Ce=(Math.round(Number(Ee)*gn)+Math.round(S*gn))/gn;const Bn=Ce.toFixed(mn);Xe(parseFloat(Bn)),p?.({floatValue:parseFloat(Bn),formattedValue:Bn,value:Bn},{source:"increment"}),setTimeout(()=>Ct(dt.current?.value.length),0)};const Te=v.useRef(Ap);Te.current=()=>{if(!Ky(Ee))return;let Ce;const Pe=x!==void 0?x:K?Number.MIN_SAFE_INTEGER:0,At=mt(Ee),mn=mt(S),gn=Math.max(At,mn),Bn=10**gn;if(!Hx(Ee)&&typeof Ee!="number"||Number.isNaN(Ee))Ce=jd($,Pe,y);else{const br=(Math.round(Number(Ee)*Bn)-Math.round(S*Bn))/Bn;Ce=Pe!==void 0&&br<Pe?Pe:br}const an=Ce.toFixed(gn);Xe(parseFloat(an)),p?.({floatValue:parseFloat(an),formattedValue:an,value:an},{source:"decrement"}),setTimeout(()=>Ct(dt.current?.value.length),0)};const _e=Ce=>{I?.(Ce),!(Z||!F)&&(Ce.key==="ArrowUp"&&(Ce.preventDefault(),jt.current?.()),Ce.key==="ArrowDown"&&(Ce.preventDefault(),Te.current?.()))},$e=Ce=>{if(D?.(Ce),Ce.key==="Backspace"){const Pe=dt.current;Pe&&Pe.selectionStart===0&&Pe.selectionStart===Pe.selectionEnd&&(Ce.preventDefault(),window.setTimeout(()=>Ct(0),0))}},Le=Ce=>{let Pe=Ee;R==="blur"&&typeof Pe=="number"&&(Pe=jd(Pe,x,y)),Y&&typeof Pe=="string"&&mt(Pe)<15&&(Pe=Qz(Pe,y,x)),Ee!==Pe&&Xe(Pe),E?.(Ce)};Dd(P,{increment:jt.current,decrement:Te.current});const lt=Ce=>{Ce?jt.current?.():Te.current?.(),it.current+=1},tt=Ce=>{if(lt(Ce),Ae){const Pe=typeof M=="number"?M:M(it.current);Et.current=window.setTimeout(()=>tt(Ce),Pe)}},ft=(Ce,Pe)=>{Ce.preventDefault(),dt.current?.focus(),lt(Pe),Ae&&(Et.current=window.setTimeout(()=>tt(Pe),L))},pe=()=>{Et.current&&window.clearTimeout(Et.current),Et.current=null,it.current=0},qe=a.jsxs("div",{...de("controls"),children:[a.jsx(Pn,{...de("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof Ee=="number"&&y!==void 0&&Ee>=y,mod:{direction:"up"},onMouseDown:Ce=>Ce.preventDefault(),onPointerDown:Ce=>{ft(Ce,!0)},onPointerUp:pe,onPointerLeave:pe,children:a.jsx(ST,{direction:"up"})}),a.jsx(Pn,{...de("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof Ee=="number"&&x!==void 0&&Ee<=x,mod:{direction:"down"},onMouseDown:Ce=>Ce.preventDefault(),onPointerDown:Ce=>{ft(Ce,!1)},onPointerUp:pe,onPointerLeave:pe,children:a.jsx(ST,{direction:"down"})})]});return a.jsx($r,{component:$z,allowNegative:K,className:Ut(Fx.root,r),size:U,inputMode:"decimal",...se,readOnly:Z,disabled:B,value:Ee,getInputRef:Un(t,dt),onValueChange:rt,rightSection:j||Z||!Ky(Ee)?C:C||qe,classNames:ye,styles:we,unstyled:c,__staticSelector:"NumberInput",decimalScale:_?k:0,onKeyDown:_e,onKeyDownCapture:$e,rightSectionPointerEvents:Q??(B?"none":void 0),rightSectionWidth:G??`var(--ni-right-section-width-${U||"sm"})`,allowLeadingZeros:z,allowedDecimalSeparators:O,onBlur:Le,attributes:H,isAllowed:Ce=>R==="strict"?T?T(Ce)&&wT(Ce.floatValue,x,y):wT(Ce.floatValue,x,y):T?T(Ce):!0})});bl.classes={...$r.classes,...Fx};bl.displayName="@mantine/core/NumberInput";const[Wz,Im]=Ar("Pagination.Root component was not found in tree");var uf={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const Yz={withPadding:!0},df=ge((e,t)=>{const n=oe("PaginationControl",Yz,e),{classNames:r,className:o,style:s,styles:c,vars:d,active:f,disabled:p,withPadding:m,mod:g,...y}=n,x=Im(),S=p||x.disabled;return a.jsx(Pn,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...x.getStyles("control",{className:o,style:s,classNames:r,styles:c,active:!S}),...y})});df.classes=uf;df.displayName="@mantine/core/PaginationControl";function ff({style:e,children:t,path:n,...r}){return a.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...e},...r,children:a.jsx("path",{d:n,fill:"currentColor"})})}const Kz=e=>a.jsx(ff,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),Xz=e=>a.jsx(ff,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),Jz=e=>a.jsx(ff,{...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"}),Zz=e=>a.jsx(ff,{...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"}),e$=e=>a.jsx(ff,{...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"}),t$={icon:e$},zm=ge((e,t)=>{const n=oe("PaginationDots",t$,e),{classNames:r,className:o,style:s,styles:c,vars:d,icon:f,...p}=n,m=Im();return a.jsx(le,{ref:t,...m.getStyles("dots",{className:o,style:s,styles:c,classNames:r}),...p,children:a.jsx(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});zm.classes=uf;zm.displayName="@mantine/core/PaginationDots";function $m({icon:e,name:t,action:n,type:r}){const o={icon:e},s=v.forwardRef((c,d)=>{const{icon:f,...p}=oe(t,o,c),m=Im(),g=r==="next"?m.active===m.total:m.active===1;return a.jsx(df,{disabled:m.disabled||g,ref:d,onClick:m[n],withPadding:!1,...p,children:a.jsx(f,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return s.displayName=`@mantine/core/${t}`,s}const gA=$m({icon:Kz,name:"PaginationNext",action:"onNext",type:"next"}),vA=$m({icon:Xz,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),yA=$m({icon:Jz,name:"PaginationFirst",action:"onFirst",type:"previous"}),xA=$m({icon:Zz,name:"PaginationLast",action:"onLast",type:"next"});function G0({dotsIcon:e}){const t=Im(),n=t.range.map((r,o)=>r==="dots"?a.jsx(zm,{icon:e},o):a.jsx(df,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...t.getItemProps?.(r),children:t.getItemProps?.(r)?.children??r},o));return a.jsx(a.Fragment,{children:n})}G0.displayName="@mantine/core/PaginationItems";const n$={siblings:1,boundaries:1},r$=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:Bt(n),"--pagination-control-size":at(t,"pagination-control-size"),"--pagination-control-fz":Qn(t),"--pagination-active-bg":r?Kt(r,e):void 0,"--pagination-active-color":Ml(o,e)?Ta({color:r,theme:e,autoContrast:o}):void 0}}),Um=ge((e,t)=>{const n=oe("PaginationRoot",n$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,total:p,value:m,defaultValue:g,onChange:y,disabled:x,siblings:S,boundaries:j,color:C,radius:T,onNextPage:R,onPreviousPage:E,onFirstPage:_,onLastPage:k,getItemProps:I,autoContrast:D,attributes:P,...$}=n,B=Ie({name:"Pagination",classes:uf,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:P,vars:f,varsResolver:r$}),{range:Q,setPage:K,next:Z,previous:U,active:G,first:M,last:L}=kM({page:m,initialPage:g,onChange:y,total:p,siblings:S,boundaries:j}),z=sr(R,Z),F=sr(E,U),Y=sr(_,M),O=sr(k,L);return a.jsx(Wz,{value:{total:p,range:Q,active:G,disabled:x,getItemProps:I,onChange:K,onNext:z,onPrevious:F,onFirst:Y,onLast:O,getStyles:B},children:a.jsx(le,{ref:t,...B("root"),...$})})});Um.classes=uf;Um.displayName="@mantine/core/PaginationRoot";const i$={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},Ui=ge((e,t)=>{const n=oe("Pagination",i$,e),{withEdges:r,withControls:o,getControlProps:s,nextIcon:c,previousIcon:d,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:y,hideWithOnePage:x,withPages:S,...j}=n;return g<=0||x&&g===1?null:a.jsx(Um,{ref:t,total:g,...j,children:a.jsxs(xe,{gap:y,children:[r&&a.jsx(yA,{icon:p,...s?.("first")}),o&&a.jsx(vA,{icon:d,...s?.("previous")}),S&&a.jsx(G0,{dotsIcon:m}),o&&a.jsx(gA,{icon:c,...s?.("next")}),r&&a.jsx(xA,{icon:f,...s?.("last")})]})})});Ui.classes=uf;Ui.displayName="@mantine/core/Pagination";Ui.Root=Um;Ui.Control=df;Ui.Dots=zm;Ui.First=yA;Ui.Last=xA;Ui.Next=gA;Ui.Previous=vA;Ui.Items=G0;const o$=({reveal:e})=>a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:a.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var qx={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const a$={visibilityToggleIcon:o$},s$=(e,{size:t})=>({root:{"--psi-icon-size":at(t,"psi-icon-size"),"--psi-button-size":at(t,"psi-button-size")}}),no=ge((e,t)=>{const n=oe("PasswordInput",a$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,required:p,error:m,leftSection:g,disabled:y,id:x,variant:S,inputContainer:j,description:C,label:T,size:R,errorProps:E,descriptionProps:_,labelProps:k,withAsterisk:I,inputWrapperOrder:D,wrapperProps:P,radius:$,rightSection:B,rightSectionWidth:Q,rightSectionPointerEvents:K,leftSectionWidth:Z,visible:U,defaultVisible:G,onVisibilityChange:M,visibilityToggleIcon:L,visibilityToggleButtonProps:z,rightSectionProps:F,leftSectionProps:Y,leftSectionPointerEvents:O,withErrorStyles:H,mod:se,attributes:de,...ye}=n,we=xr(x),[Ee,Xe]=nr({value:U,defaultValue:G,finalValue:!1,onChange:M}),Ae=()=>Xe(!Ee),dt=Ie({name:"PasswordInput",classes:qx,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:de,vars:f,varsResolver:s$}),{resolvedClassNames:Et,resolvedStyles:it}=Ol({classNames:r,styles:c,props:n}),{styleProps:rt,rest:mt}=Ra(ye),Ct=E?.id||`${we}-error`,jt=_?.id||`${we}-description`,$e=`${!!m&&typeof m!="boolean"?Ct:""} ${!!C?jt:""}`,Le=$e.trim().length>0?$e.trim():void 0,lt=a.jsx(En,{...dt("visibilityToggle"),disabled:y,radius:$,"aria-hidden":!z,"aria-pressed":Ee,tabIndex:-1,...z,variant:z?.variant??"subtle",color:"gray",unstyled:d,onTouchEnd:tt=>{tt.preventDefault(),z?.onTouchEnd?.(tt),Ae()},onMouseDown:tt=>{tt.preventDefault(),z?.onMouseDown?.(tt),Ae()},onKeyDown:tt=>{z?.onKeyDown?.(tt),tt.key===" "&&(tt.preventDefault(),Ae())},children:a.jsx(L,{reveal:Ee})});return a.jsx(hn.Wrapper,{required:p,id:we,label:T,error:m,description:C,size:R,classNames:Et,styles:it,__staticSelector:"PasswordInput",unstyled:d,withAsterisk:I,inputWrapperOrder:D,inputContainer:j,variant:S,labelProps:{...k,htmlFor:we},descriptionProps:{..._,id:jt},errorProps:{...E,id:Ct},mod:se,attributes:de,...dt("root"),...rt,...P,children:a.jsx(hn,{component:"div",error:m,leftSection:g,size:R,classNames:{...Et,input:Ut(qx.input,Et.input)},styles:it,radius:$,disabled:y,__staticSelector:"PasswordInput",rightSectionWidth:Q,rightSection:B??lt,variant:S,unstyled:d,leftSectionWidth:Z,rightSectionPointerEvents:K||"all",rightSectionProps:F,leftSectionProps:Y,leftSectionPointerEvents:O,withAria:!1,withErrorStyles:H,attributes:de,children:a.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...dt("innerInput"),disabled:y,id:we,ref:t,...mt,"aria-describedby":Le,autoComplete:mt.autoComplete||"off",type:Ee?"text":"password"})})})});no.classes={...$r.classes,...qx};no.displayName="@mantine/core/PasswordInput";const[l$,bA]=Bo(),[c$,u$]=Bo();var SA={card:"m_9dc8ae12"};const d$={withBorder:!0},f$=(e,{radius:t})=>({card:{"--card-radius":Bt(t)}}),Q0=ge((e,t)=>{const n=oe("RadioCard",d$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:x,name:S,onKeyDown:j,attributes:C,...T}=n,R=Ie({name:"RadioCard",classes:SA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:f$,rootSelector:"card"}),{dir:E}=Cs(),_=bA(),k=typeof p=="boolean"?p:_?.value===y||!1,I=S||_?.name,D=P=>{if(j?.(P),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(P.nativeEvent.code)){P.preventDefault();const $=Array.from(document.querySelectorAll(`[role="radio"][name="${I||"__mantine"}"]`)),B=$.findIndex(Z=>Z===P.target),Q=B+1>=$.length?0:B+1,K=B-1<0?$.length-1:B-1;P.nativeEvent.code==="ArrowDown"&&($[Q].focus(),$[Q].click()),P.nativeEvent.code==="ArrowUp"&&($[K].focus(),$[K].click()),P.nativeEvent.code==="ArrowLeft"&&($[E==="ltr"?K:Q].focus(),$[E==="ltr"?K:Q].click()),P.nativeEvent.code==="ArrowRight"&&($[E==="ltr"?Q:K].focus(),$[E==="ltr"?Q:K].click())}};return a.jsx(c$,{value:{checked:k},children:a.jsx(Pn,{ref:t,mod:[{"with-border":g,checked:k},m],...R("card"),...T,role:"radio","aria-checked":k,name:I,onClick:P=>{x?.(P),_?.onChange(y||"")},onKeyDown:D})})});Q0.displayName="@mantine/core/RadioCard";Q0.classes=SA;const W0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,name:f,readOnly:p,disabled:m,...g}=oe("RadioGroup",null,e),y=xr(f),[x,S]=nr({value:n,defaultValue:r,finalValue:"",onChange:o}),j=C=>!p&&S(typeof C=="string"?C:C.currentTarget.value);return a.jsx(l$,{value:{value:x,onChange:j,size:s,name:y,disabled:m},children:a.jsx(hn.Wrapper,{size:s,ref:t,...c,...g,labelElement:"div",__staticSelector:"RadioGroup",children:a.jsx(g0,{role:"radiogroup",children:d})})})});W0.classes=hn.Wrapper.classes;W0.displayName="@mantine/core/RadioGroup";function wA({size:e,style:t,...n}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:ue(e),height:ue(e),...t},"aria-hidden":!0,...n,children:a.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var jA={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const h$={icon:wA},p$=(e,{radius:t,color:n,size:r,iconColor:o,variant:s,autoContrast:c})=>{const d=Xr({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--radio-size":at(r,"radio-size"),"--radio-radius":t===void 0?void 0:Bt(t),"--radio-color":s==="outline"?f:Kt(n,e),"--radio-icon-size":at(r,"radio-icon-size"),"--radio-icon-color":o?Kt(o,e):Ml(c,e)?Ta({color:n,theme:e,autoContrast:c}):void 0}}},Y0=ge((e,t)=>{const n=oe("RadioIndicator",h$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,icon:p,radius:m,color:g,iconColor:y,autoContrast:x,checked:S,mod:j,variant:C,disabled:T,attributes:R,...E}=n,_=Ie({name:"RadioIndicator",classes:jA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:R,vars:f,varsResolver:p$,rootSelector:"indicator"}),k=u$(),I=typeof S=="boolean"?S:k?.checked||!1;return a.jsx(le,{ref:t,..._("indicator",{variant:C}),variant:C,mod:[{checked:I,disabled:T},j],...E,children:a.jsx(p,{..._("icon")})})});Y0.displayName="@mantine/core/RadioIndicator";Y0.classes=jA;var CA={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const m$={labelPosition:"right"},g$=(e,{size:t,radius:n,color:r,iconColor:o,variant:s,autoContrast:c})=>{const d=Xr({color:r||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--radio-size":at(t,"radio-size"),"--radio-radius":n===void 0?void 0:Bt(n),"--radio-color":s==="outline"?f:Kt(r,e),"--radio-icon-color":o?Kt(o,e):Ml(c,e)?Ta({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":at(t,"radio-icon-size")}}},wr=ge((e,t)=>{const n=oe("Radio",m$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,id:p,size:m,label:g,labelPosition:y,description:x,error:S,radius:j,color:C,variant:T,disabled:R,wrapperProps:E,icon:_=wA,rootRef:k,iconColor:I,onChange:D,mod:P,attributes:$,checked:B,...Q}=n,K=Ie({name:"Radio",classes:CA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:$,vars:f,varsResolver:g$}),Z=bA(),U=Z?.size??m,G=n.size?m:U,{styleProps:M,rest:L}=Ra(Q),z=xr(p),F=Z?Z.value===L.value:void 0,Y={checked:F??B,name:Z?.name??L.name,onChange:O=>{Z?.onChange(O),D?.(O)},disabled:Z?.disabled??R};return a.jsx(jm,{...K("root"),__staticSelector:"Radio",__stylesApiProps:n,id:z,size:G,labelPosition:y,label:g,description:x,error:S,disabled:Y.disabled,classNames:r,styles:c,unstyled:d,"data-checked":(F??B)||void 0,variant:T,ref:k,mod:P,...M,...E,children:a.jsxs(le,{...K("inner"),mod:{"label-position":y},children:[a.jsx(le,{...K("radio",{focusable:!0,variant:T}),...L,...Y,component:"input",mod:{error:!!S},ref:t,id:z,type:"radio"}),a.jsx(_,{...K("icon"),"aria-hidden":!0})]})})});wr.classes=CA;wr.displayName="@mantine/core/Radio";wr.Group=W0;wr.Card=Q0;wr.Indicator=Y0;const v$={duration:100,transition:"fade"};function jT(e,t){return{...v$,...t,...e}}function y$({offset:e,position:t,defaultOpened:n}){const[r,o]=v.useState(n),s=v.useRef(null),{x:c,y:d,elements:f,refs:p,update:m,placement:g}=qb({placement:t,middleware:[Bb({crossAxis:!0,padding:5,rootBoundary:"document"})]}),y=g.includes("right")?e:t.includes("left")?e*-1:0,x=g.includes("bottom")?e:t.includes("top")?e*-1:0,S=v.useCallback(({clientX:j,clientY:C})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+y,top:C+x,right:j,bottom:C}}})},[f.reference]);return v.useEffect(()=>{if(p.floating.current){const j=s.current;j.addEventListener("mousemove",S);const C=xa(p.floating.current);return C.forEach(T=>{T.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(T=>{T.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:d,opened:r,setOpened:o,boundaryRef:s,floating:p.setFloating}}var Bm={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const x$={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:zr("popover")},b$=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Bt(t),"--tooltip-bg":n?Kt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),K0=ge((e,t)=>{const n=oe("TooltipFloating",x$,e),{children:r,refProp:o,withinPortal:s,style:c,className:d,classNames:f,styles:p,unstyled:m,radius:g,color:y,label:x,offset:S,position:j,multiline:C,zIndex:T,disabled:R,defaultOpened:E,variant:_,vars:k,portalProps:I,attributes:D,...P}=n,$=Tn(),B=Ie({name:"TooltipFloating",props:n,classes:Bm,className:d,style:c,classNames:f,styles:p,unstyled:m,attributes:D,rootSelector:"tooltip",vars:k,varsResolver:b$}),{handleMouseMove:Q,x:K,y:Z,opened:U,boundaryRef:G,floating:M,setOpened:L}=y$({offset:S,position:j,defaultOpened:E}),z=Nl(r);if(!z)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 F=Un(G,lm(z),t),Y=z.props,O=se=>{Y.onMouseEnter?.(se),Q(se),L(!0)},H=se=>{Y.onMouseLeave?.(se),L(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(Sa,{...I,withinPortal:s,children:a.jsx(le,{...P,...B("tooltip",{style:{...f2(c,$),zIndex:T,display:!R&&U?"block":"none",top:(Z&&Math.round(Z))??"",left:(K&&Math.round(K))??""}}),variant:_,ref:M,mod:{multiline:C},children:x})}),v.cloneElement(z,{...Y,[o]:F,onMouseEnter:O,onMouseLeave:H})]})});K0.classes=Bm;K0.displayName="@mantine/core/TooltipFloating";const EA=v.createContext(!1),S$=EA.Provider,w$=()=>v.useContext(EA),j$={openDelay:0,closeDelay:0};function X0(e){const{openDelay:t,closeDelay:n,children:r}=oe("TooltipGroup",j$,e);return a.jsx(S$,{value:!0,children:a.jsx(ML,{delay:{open:t,close:n},children:r})})}X0.displayName="@mantine/core/TooltipGroup";X0.extend=e=>e;function C$(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 E$(e){const t=C$(e.middlewares),n=[D2(e.offset)];return t.shift&&n.push(Bb(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Mp():Mp(t.flip)),n.push(A2({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Cd():Cd(t.inline)):e.inline&&n.push(Cd()),n}function T$(e){const[t,n]=v.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,s=w$(),c=xr(),d=v.useCallback(k=>{n(k),k&&T(c)},[c]),{x:f,y:p,context:m,refs:g,placement:y,middlewareData:{arrow:{x,y:S}={}}}=qb({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:E$(e),whileElementsMounted:zx}),{delay:j,currentId:C,setCurrentId:T}=LL(m,{id:c}),{getReferenceProps:R,getFloatingProps:E}=VL([NL(m,{enabled:e.events?.hover,delay:s?j:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),BL(m,{enabled:e.events?.focus,visibleOnly:!0}),HL(m,{role:"tooltip"}),$L(m,{enabled:typeof e.opened>"u"})]);yl(()=>{e.onPositionChange?.(y)},[y]);const _=o&&C&&C!==c;return{x:f,y:p,arrowX:x,arrowY:S,reference:g.setReference,floating:g.setFloating,getFloatingProps:E,getReferenceProps:R,isGroupPhase:_,opened:o,placement:y}}const CT={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:zr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},R$=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const s=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:o,variant:r||"filled"});return{tooltip:{"--tooltip-radius":t===void 0?void 0:Bt(t),"--tooltip-bg":n?s.background:void 0,"--tooltip-color":n?s.color:void 0}}},fi=ge((e,t)=>{const n=oe("Tooltip",CT,e),{children:r,position:o,refProp:s,label:c,openDelay:d,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:y,radius:x,color:S,classNames:j,styles:C,unstyled:T,style:R,className:E,withArrow:_,arrowSize:k,arrowOffset:I,arrowRadius:D,arrowPosition:P,offset:$,transitionProps:B,multiline:Q,events:K,zIndex:Z,disabled:U,positionDependencies:G,onClick:M,onMouseEnter:L,onMouseLeave:z,inline:F,variant:Y,keepMounted:O,vars:H,portalProps:se,mod:de,floatingStrategy:ye,middlewares:we,autoContrast:Ee,attributes:Xe,target:Ae,...dt}=oe("Tooltip",CT,n),{dir:Et}=Cs(),it=v.useRef(null),rt=T$({position:Y2(Et,o),closeDelay:f,openDelay:d,onPositionChange:p,opened:m,defaultOpened:g,events:K,arrowRef:it,arrowOffset:I,offset:typeof $=="number"?$+(_?k/2:0):$,positionDependencies:[...G,Ae??r],inline:F,strategy:ye,middlewares:we});v.useEffect(()=>{const $e=Ae instanceof HTMLElement?Ae:typeof Ae=="string"?document.querySelector(Ae):Ae?.current||null;$e&&rt.reference($e)},[Ae,rt]);const mt=Ie({name:"Tooltip",props:n,classes:Bm,className:E,style:R,classNames:j,styles:C,unstyled:T,attributes:Xe,rootSelector:"tooltip",vars:H,varsResolver:R$}),Ct=Nl(r);if(!Ae&&!Ct)return null;if(Ae){const $e=jT(B,{duration:100,transition:"fade"});return a.jsx(a.Fragment,{children:a.jsx(Sa,{...se,withinPortal:y,children:a.jsx(oo,{...$e,keepMounted:O,mounted:!U&&!!rt.opened,duration:rt.isGroupPhase?10:$e.duration,children:Le=>a.jsxs(le,{...dt,"data-fixed":ye==="fixed"||void 0,variant:Y,mod:[{multiline:Q},de],...rt.getFloatingProps({ref:rt.floating,className:mt("tooltip").className,style:{...mt("tooltip").style,...Le,zIndex:Z,top:rt.y??0,left:rt.x??0}}),children:[c,a.jsx(Lp,{ref:it,arrowX:rt.arrowX,arrowY:rt.arrowY,visible:_,position:rt.placement,arrowSize:k,arrowOffset:I,arrowRadius:D,arrowPosition:P,...mt("arrow")})]})})})})}const jt=Ct.props,Te=Un(rt.reference,lm(Ct),t),_e=jT(B,{duration:100,transition:"fade"});return a.jsxs(a.Fragment,{children:[a.jsx(Sa,{...se,withinPortal:y,children:a.jsx(oo,{..._e,keepMounted:O,mounted:!U&&!!rt.opened,duration:rt.isGroupPhase?10:_e.duration,children:$e=>a.jsxs(le,{...dt,"data-fixed":ye==="fixed"||void 0,variant:Y,mod:[{multiline:Q},de],...rt.getFloatingProps({ref:rt.floating,className:mt("tooltip").className,style:{...mt("tooltip").style,...$e,zIndex:Z,top:rt.y??0,left:rt.x??0}}),children:[c,a.jsx(Lp,{ref:it,arrowX:rt.arrowX,arrowY:rt.arrowY,visible:_,position:rt.placement,arrowSize:k,arrowOffset:I,arrowRadius:D,arrowPosition:P,...mt("arrow")})]})})}),v.cloneElement(Ct,rt.getReferenceProps({onClick:M,onMouseEnter:L,onMouseLeave:z,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...jt,className:Ut(E,jt.className),[s]:Te}))]})});fi.classes=Bm;fi.displayName="@mantine/core/Tooltip";fi.Floating=K0;fi.Group=X0;function _$({size:e,thickness:t,sum:n,value:r,root:o,offset:s}){const c=(e*.9-t*2)/2,d=Math.PI*c*2/100,f=o||r===void 0?`${(100-n)*d}, ${n*d}`:`${r*d}, ${(100-r)*d}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:c||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:o?0:s||0}}function TA({size:e,value:t,offset:n,sum:r,thickness:o,root:s,color:c,lineRoundCaps:d,tooltip:f,getStyles:p,display:m,...g}){const y=Tn();return a.jsx(fi.Floating,{disabled:!f,label:f,children:a.jsx(le,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Kt(c,y):void 0},fill:"none",strokeLinecap:d?"round":"butt",..._$({sum:r,size:e,thickness:o,value:t,offset:n,root:s})})})}TA.displayName="@mantine/core/Curve";function D$({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const s=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let d=c;const f=[],p=[];for(let m=0;m<n.length;m+=1)f.push({sum:s,offset:d,data:n[m],root:!1}),d-=n[m].value/100*c;if(f.push({sum:s,offset:d,data:{color:o},root:!0}),p.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){p.push({...f[0],lineRoundCaps:r}),p.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)p.push({...f[m],lineRoundCaps:!1})}else p.push({...f[0],lineRoundCaps:r});return p}var RA={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function A$(e,t){return Math.min(e||12,(t||120)/4)}const k$={size:120,thickness:12},P$=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":ue(t),"--rp-label-offset":ue(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Vm=ge((e,t)=>{const n=oe("RingProgress",k$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,label:p,sections:m,size:g,thickness:y,roundCaps:x,rootColor:S,transitionDuration:j,attributes:C,...T}=n,R=Ie({name:"RingProgress",classes:RA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:P$}),E=A$(y,g),_=D$({size:g,thickness:E,sections:m,renderRoundedLineCaps:x,rootColor:S}).map(({data:k,sum:I,root:D,lineRoundCaps:P,offset:$},B)=>v.createElement(TA,{...k,key:B,size:g,thickness:E,sum:I,offset:$,color:k?.color,root:D,lineRoundCaps:P,getStyles:R}));return a.jsxs(le,{...R("root"),size:g,ref:t,...T,children:[a.jsx("svg",{...R("svg"),children:_}),p&&a.jsx("div",{...R("label"),children:p})]})});Vm.classes=RA;Vm.displayName="@mantine/core/RingProgress";var _A={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const N$={withItemsBorders:!0},O$=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:s})=>({root:{"--sc-radius":t===void 0?void 0:Bt(t),"--sc-color":n?Kt(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":s,"--sc-padding":at(o,"sc-padding"),"--sc-font-size":Qn(o)}}),eu=ge((e,t)=>{const n=oe("SegmentedControl",N$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,data:p,value:m,defaultValue:g,onChange:y,size:x,name:S,disabled:j,readOnly:C,fullWidth:T,orientation:R,radius:E,color:_,transitionDuration:k,transitionTimingFunction:I,variant:D,autoContrast:P,withItemsBorders:$,mod:B,attributes:Q,...K}=n,Z=Ie({name:"SegmentedControl",props:n,classes:_A,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:Q,vars:f,varsResolver:O$}),U=Tn(),G=p.map(Ae=>typeof Ae=="string"?{label:Ae,value:Ae}:Ae),M=FM(),[L,z]=v.useState(kp()),[F,Y]=v.useState(null),[O,H]=v.useState({}),se=(Ae,dt)=>{O[dt]=Ae,H(O)},[de,ye]=nr({value:m,defaultValue:g,finalValue:Array.isArray(p)?G.find(Ae=>!Ae.disabled)?.value??p[0]?.value??null:null,onChange:y}),we=xr(S),Ee=G.map(Ae=>v.createElement(le,{...Z("control"),mod:{active:de===Ae.value,orientation:R},key:Ae.value},v.createElement("input",{...Z("input"),disabled:j||Ae.disabled,type:"radio",name:we,value:Ae.value,id:`${we}-${Ae.value}`,checked:de===Ae.value,onChange:()=>!C&&ye(Ae.value),"data-focus-ring":U.focusRing,key:`${Ae.value}-input`}),v.createElement(le,{component:"label",...Z("label"),mod:{active:de===Ae.value&&!(j||Ae.disabled),disabled:j||Ae.disabled,"read-only":C},htmlFor:`${we}-${Ae.value}`,ref:dt=>se(dt,Ae.value),__vars:{"--sc-label-color":_!==void 0?Ta({color:_,theme:U,autoContrast:P}):void 0},key:`${Ae.value}-label`},a.jsx("span",{...Z("innerLabel"),children:Ae.label})))),Xe=Un(t,Ae=>Y(Ae));return OM(()=>{z(kp())},[p.length]),p.length===0?null:a.jsxs(le,{...Z("root"),variant:D,size:x,ref:Xe,mod:[{"full-width":T,orientation:R,initialized:M,"with-items-borders":$},B],...K,role:"radiogroup","data-disabled":j,children:[typeof de=="string"&&a.jsx(Zb,{target:O[de],parent:F,component:"span",transitionDuration:"var(--sc-transition-duration)",...Z("indicator")},L),Ee]})});eu.classes=_A;eu.displayName="@mantine/core/SegmentedControl";function M$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=Tn(),s=t===void 0?e:t,c=js({"--sg-spacing-x":Gn(Zi(e)),"--sg-spacing-y":Gn(Zi(s)),"--sg-cols":Zi(n)?.toString()}),d=dn(o.breakpoints).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=Gn(e[g])),typeof s=="object"&&s[g]!==void 0&&(m[g]["--sg-spacing-y"]=Gn(s[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),p=_d(dn(d),o.breakpoints).filter(m=>dn(d[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:d[m.value]}));return a.jsx(Ll,{styles:c,media:p,selector:r})}function Xy(e){return typeof e=="object"&&e!==null?dn(e):[]}function L$(e){return e.sort((t,n)=>Rd(t)-Rd(n))}function I$({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Xy(e),...Xy(t),...Xy(n)]));return L$(r)}function z$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=t===void 0?e:t,s=js({"--sg-spacing-x":Gn(Zi(e)),"--sg-spacing-y":Gn(Zi(o)),"--sg-cols":Zi(n)?.toString()}),c=I$({spacing:e,verticalSpacing:t,cols:n}),d=c.reduce((p,m)=>(p[m]||(p[m]={}),typeof e=="object"&&e[m]!==void 0&&(p[m]["--sg-spacing-x"]=Gn(e[m])),typeof o=="object"&&o[m]!==void 0&&(p[m]["--sg-spacing-y"]=Gn(o[m])),typeof n=="object"&&n[m]!==void 0&&(p[m]["--sg-cols"]=n[m]),p),{}),f=c.map(p=>({query:`simple-grid (min-width: ${p})`,styles:d[p]}));return a.jsx(Ll,{styles:s,container:f,selector:r})}var DA={container:"m_925c2d2c",root:"m_2415a157"};const $$={cols:1,spacing:"md",type:"media"},Fm=ge((e,t)=>{const n=oe("SimpleGrid",$$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,cols:p,verticalSpacing:m,spacing:g,type:y,attributes:x,...S}=n,j=Ie({name:"SimpleGrid",classes:DA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:x,vars:f}),C=Zd();return y==="container"?a.jsxs(a.Fragment,{children:[a.jsx(z$,{...n,selector:`.${C}`}),a.jsx("div",{...j("container"),children:a.jsx(le,{ref:t,...j("root",{className:C}),...S})})]}):a.jsxs(a.Fragment,{children:[a.jsx(M$,{...n,selector:`.${C}`}),a.jsx(le,{ref:t,...j("root",{className:C}),...S})]})});Fm.classes=DA;Fm.displayName="@mantine/core/SimpleGrid";const AA=ge((e,t)=>{const{w:n,h:r,miw:o,mih:s,...c}=oe("Space",null,e);return a.jsx(le,{ref:t,...c,w:n,miw:o??n,h:r,mih:s??r})});AA.displayName="@mantine/core/Space";var kA={root:"m_6d731127"};const U$={gap:"md",align:"stretch",justify:"flex-start"},B$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Gn(t),"--stack-align":n,"--stack-justify":r}}),Me=ge((e,t)=>{const n=oe("Stack",U$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,align:p,justify:m,gap:g,variant:y,attributes:x,...S}=n,j=Ie({name:"Stack",props:n,classes:kA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:x,vars:f,varsResolver:B$});return a.jsx(le,{ref:t,...j("root"),variant:y,...S})});Me.classes=kA;Me.displayName="@mantine/core/Stack";const[V$,F$]=Ar("Stepper component was not found in tree"),zp=()=>null;zp.displayName="@mantine/core/StepperCompleted";var J0={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 rp=(e,t)=>typeof e=="function"?a.jsx(e,{step:t||0}):e,H$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},Z0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,step:d,state:f,color:p,icon:m,completedIcon:g,progressIcon:y,label:x,description:S,withIcon:j,iconSize:C,loading:T,allowStepClick:R,allowStepSelect:E,iconPosition:_,orientation:k,mod:I,...D}=oe("StepperStep",H$,e),P=F$(),$=Tn(),B={classNames:n,styles:s},Q=f==="stepCompleted"?null:f==="stepProgress"?y:m,K={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return a.jsxs(Pn,{...P.getStyles("step",{className:r,style:o,variant:P.orientation,...B}),mod:[{"icon-position":_||P.iconPosition,"allow-click":R},I],ref:t,...K,...D,__vars:{"--step-color":p?Kt(p,$):void 0},tabIndex:R?0:-1,children:[j&&a.jsxs("span",{...P.getStyles("stepWrapper",B),children:[a.jsxs("span",{...P.getStyles("stepIcon",B),...K,children:[a.jsx(oo,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:Z=>a.jsx("span",{...P.getStyles("stepCompletedIcon",{style:Z,...B}),children:T?a.jsx(_r,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...P.getStyles("stepLoader",B)}):rp(g,d)||a.jsx(sf,{size:"60%"})})}),f!=="stepCompleted"?T?a.jsx(_r,{...P.getStyles("stepLoader",B),size:"calc(var(--stepper-icon-size) / 2)",color:p}):rp(Q||m,d):null]}),k==="vertical"&&a.jsx("span",{...P.getStyles("verticalSeparator",B),"data-active":f==="stepCompleted"||void 0})]}),(x||S)&&a.jsxs("span",{...P.getStyles("stepBody",B),"data-orientation":P.orientation,"data-icon-position":_||P.iconPosition,children:[x&&a.jsx("span",{...P.getStyles("stepLabel",B),children:rp(x,d)}),S&&a.jsx("span",{...P.getStyles("stepDescription",B),children:rp(S,d)})]})]})});Z0.classes=J0;Z0.displayName="@mantine/core/StepperStep";const q$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},G$=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:s,autoContrast:c})=>({root:{"--stepper-color":t?Kt(t,e):void 0,"--stepper-icon-color":Ml(c,e)?Ta({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?at(r,"stepper-icon-size"):ue(n),"--stepper-content-padding":Gn(o),"--stepper-radius":s===void 0?void 0:Bt(s),"--stepper-fz":Qn(r),"--stepper-spacing":Gn(r)}}),tu=ge((e,t)=>{const n=oe("Stepper",q$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,onStepClick:m,active:g,icon:y,completedIcon:x,progressIcon:S,color:j,iconSize:C,contentPadding:T,orientation:R,iconPosition:E,size:_,radius:k,allowNextStepsSelect:I,wrap:D,autoContrast:P,attributes:$,...B}=n,Q=Ie({name:"Stepper",classes:J0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:$,vars:f,varsResolver:G$}),K=v.Children.toArray(p),Z=K.filter(F=>F.type!==zp),U=K.find(F=>F.type===zp),G=Z.reduce((F,Y,O)=>{const H=g===O?"stepProgress":g>O?"stepCompleted":"stepInactive",de=typeof m!="function"?!1:typeof Y.props.allowStepSelect=="boolean"?Y.props.allowStepSelect:H==="stepCompleted"||I;return F.push(v.cloneElement(Y,{icon:Y.props.icon||y||O+1,key:O,step:O,state:H,onClick:()=>de&&m?.(O),allowStepClick:de,completedIcon:Y.props.completedIcon||x,progressIcon:Y.props.progressIcon||S,color:Y.props.color||j,iconSize:C,iconPosition:Y.props.iconPosition||E,orientation:R})),R==="horizontal"&&O!==Z.length-1&&F.push(v.createElement("div",{...Q("separator"),"data-active":O<g||void 0,"data-orientation":R,key:`separator-${O}`})),F},[]),M=Z[g]?.props?.children,L=U?.props?.children,z=g>Z.length-1?L:M;return a.jsx(V$,{value:{getStyles:Q,orientation:R,iconPosition:E},children:a.jsxs(le,{...Q("root"),ref:t,size:_,...B,children:[a.jsx(le,{...Q("steps"),mod:{orientation:R,"icon-position":E,wrap:D&&R!=="vertical"},children:G}),z&&a.jsx("div",{...Q("content"),children:z})]})})});tu.classes=J0;tu.displayName="@mantine/core/Stepper";tu.Completed=zp;tu.Step=Z0;const PA=v.createContext(null),Q$=PA.Provider,W$=()=>v.useContext(PA),eS=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,readOnly:f,disabled:p,...m}=oe("SwitchGroup",null,e),[g,y]=nr({value:n,defaultValue:r,finalValue:[],onChange:o}),x=S=>{const j=S.currentTarget.value;!f&&y(g.includes(j)?g.filter(C=>C!==j):[...g,j])};return a.jsx(Q$,{value:{value:g,onChange:x,size:s,disabled:p},children:a.jsx(hn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"SwitchGroup",children:a.jsx(g0,{role:"group",children:d})})})});eS.classes=hn.Wrapper.classes;eS.displayName="@mantine/core/SwitchGroup";var NA={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const Y$={labelPosition:"right",withThumbIndicator:!0},K$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Bt(t),"--switch-height":at(r,"switch-height"),"--switch-width":at(r,"switch-width"),"--switch-thumb-size":at(r,"switch-thumb-size"),"--switch-label-font-size":at(r,"switch-label-font-size"),"--switch-track-label-padding":at(r,"switch-track-label-padding"),"--switch-color":n?Kt(n,e):void 0}}),hf=ge((e,t)=>{const n=oe("Switch",Y$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,offLabel:g,onLabel:y,id:x,size:S,radius:j,wrapperProps:C,thumbIcon:T,checked:R,defaultChecked:E,onChange:_,labelPosition:k,description:I,error:D,disabled:P,variant:$,rootRef:B,mod:Q,withThumbIndicator:K,attributes:Z,...U}=n,G=W$(),M=S||G?.size,L=Ie({name:"Switch",props:n,classes:NA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:Z,vars:f,varsResolver:K$}),{styleProps:z,rest:F}=Ra(U),Y=xr(x),O={checked:G?.value.includes(F.value)??R,onChange:de=>{G?.onChange(de),_?.(de)},disabled:G?.disabled??P},[H,se]=nr({value:O.checked??R,defaultValue:E,finalValue:!1});return a.jsxs(jm,{...L("root"),__staticSelector:"Switch",__stylesApiProps:n,id:Y,size:M,labelPosition:k,label:m,description:I,error:D,disabled:O.disabled,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:d,"data-checked":O.checked,variant:$,ref:B,mod:Q,...z,...C,children:[a.jsx("input",{...F,...O,checked:H,"data-checked":O.checked,onChange:de=>{O.onChange?.(de),se(de.currentTarget.checked)},id:Y,ref:t,type:"checkbox",role:"switch",...L("input")}),a.jsxs(le,{"aria-hidden":"true",component:"span",mod:{error:D,"label-position":k,"without-labels":!y&&!g},...L("track"),children:[a.jsx(le,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":K&&!T},...L("thumb"),children:T}),a.jsx("span",{...L("trackLabel"),children:H?y:g})]})]})});hf.classes={...NA,...ND};hf.displayName="@mantine/core/Switch";hf.Group=eS;const[X$,J$]=Ar("Table component was not found in the tree");var pf={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 Z$(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 $l(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ge((o,s)=>{const c=oe(n,{},o),{classNames:d,className:f,style:p,styles:m,...g}=c,y=J$();return a.jsx(le,{component:e,ref:s,...Z$(y,t),...y.getStyles(e,{className:f,classNames:d,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=pf,r}const Gx=$l("th",{columnBorder:!0}),OA=$l("td",{columnBorder:!0}),Sp=$l("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),MA=$l("thead",{stickyHeader:!0}),LA=$l("tbody"),IA=$l("tfoot"),zA=$l("caption",{captionSide:!0});function tS({data:e}){return a.jsxs(a.Fragment,{children:[e.caption&&a.jsx(zA,{children:e.caption}),e.head&&a.jsx(MA,{children:a.jsx(Sp,{children:e.head.map((t,n)=>a.jsx(Gx,{children:t},n))})}),e.body&&a.jsx(LA,{children:e.body.map((t,n)=>a.jsx(Sp,{children:t.map((r,o)=>a.jsx(OA,{children:r},o))},n))}),e.foot&&a.jsx(IA,{children:a.jsx(Sp,{children:e.foot.map((t,n)=>a.jsx(Gx,{children:t},n))})})]})}tS.displayName="@mantine/core/TableDataRenderer";const e8={type:"scrollarea"},t8=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":ue(t),"--table-max-height":ue(n),"--table-overflow":r==="native"?"auto":void 0}}),nS=ge((e,t)=>{const n=oe("TableScrollContainer",e8,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,minWidth:m,maxHeight:g,type:y,scrollAreaProps:x,attributes:S,...j}=n,C=Ie({name:"TableScrollContainer",classes:pf,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:t8,rootSelector:"scrollContainer"});return a.jsx(le,{component:y==="scrollarea"?Jr:"div",...y==="scrollarea"?g?{offsetScrollbars:"xy",...x}:{offsetScrollbars:"x",...x}:{},ref:t,...C("scrollContainer"),...j,children:a.jsx("div",{...C("scrollContainerInner"),children:p})})});nS.classes=pf;nS.displayName="@mantine/core/TableScrollContainer";const n8={withRowBorders:!0,verticalSpacing:7},r8=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:s,stripedColor:c,highlightOnHoverColor:d,striped:f,highlightOnHover:p,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Gn(r),"--table-vertical-spacing":Gn(o),"--table-border-color":s?Kt(s,e):void 0,"--table-striped-color":f&&c?Kt(c,e):void 0,"--table-highlight-on-hover-color":p&&d?Kt(d,e):void 0,"--table-sticky-header-offset":g?ue(m):void 0}}),ee=ge((e,t)=>{const n=oe("Table",n8,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:y,highlightOnHoverColor:x,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,withTableBorder:R,borderColor:E,layout:_,variant:k,data:I,children:D,stickyHeader:P,stickyHeaderOffset:$,mod:B,tabularNums:Q,attributes:K,...Z}=n,U=Ie({name:"Table",props:n,className:o,style:s,classes:pf,classNames:r,styles:c,unstyled:d,attributes:K,rootSelector:"table",vars:f,varsResolver:r8});return a.jsx(X$,{value:{getStyles:U,stickyHeader:P,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,captionSide:g||"bottom"},children:a.jsx(le,{component:"table",variant:k,ref:t,mod:[{"data-with-table-border":R,"data-tabular-nums":Q},B],...U("table"),...Z,children:D||!!I&&a.jsx(tS,{data:I})})})});ee.classes=pf;ee.displayName="@mantine/core/Table";ee.Td=OA;ee.Th=Gx;ee.Tr=Sp;ee.Thead=MA;ee.Tbody=LA;ee.Tfoot=IA;ee.Caption=zA;ee.ScrollContainer=nS;ee.DataRenderer=tS;const[i8,rS]=Ar("Tabs component was not found in the tree");var mf={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const iS=ge((e,t)=>{const n=oe("TabsList",null,e),{children:r,className:o,grow:s,justify:c,classNames:d,styles:f,style:p,mod:m,...g}=n,y=rS();return a.jsx(le,{...g,...y.getStyles("list",{className:o,style:p,classNames:d,styles:f,props:n,variant:y.variant}),ref:t,role:"tablist",variant:y.variant,mod:[{grow:s,orientation:y.orientation,placement:y.orientation==="vertical"&&y.placement,inverted:y.inverted},m],"aria-orientation":y.orientation,__vars:{"--tabs-justify":c},children:r})});iS.classes=mf;iS.displayName="@mantine/core/TabsList";const oS=ge((e,t)=>{const n=oe("TabsPanel",null,e),{children:r,className:o,value:s,classNames:c,styles:d,style:f,mod:p,keepMounted:m,...g}=n,y=rS(),x=y.value===s,S=y.keepMounted||m||x?r:null;return a.jsx(le,{...y.getStyles("panel",{className:o,classNames:c,styles:d,style:[f,x?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:y.orientation},p],role:"tabpanel",id:y.getPanelId(s),"aria-labelledby":y.getTabId(s),...g,children:S})});oS.classes=mf;oS.displayName="@mantine/core/TabsPanel";const aS=ge((e,t)=>{const n=oe("TabsTab",null,e),{className:r,children:o,rightSection:s,leftSection:c,value:d,onClick:f,onKeyDown:p,disabled:m,color:g,style:y,classNames:x,styles:S,vars:j,mod:C,tabIndex:T,...R}=n,E=Tn(),{dir:_}=Cs(),k=rS(),I=d===k.value,D=$=>{k.onChange(k.allowTabDeactivation&&d===k.value?null:d),f?.($)},P={classNames:x,styles:S,props:n};return a.jsxs(Pn,{...k.getStyles("tab",{className:r,style:y,variant:k.variant,...P}),disabled:m,unstyled:k.unstyled,variant:k.variant,mod:[{active:I,disabled:m,orientation:k.orientation,inverted:k.inverted,placement:k.orientation==="vertical"&&k.placement},C],ref:t,role:"tab",id:k.getTabId(d),"aria-selected":I,tabIndex:T!==void 0?T:I||k.value===null?0:-1,"aria-controls":k.getPanelId(d),onClick:D,__vars:{"--tabs-color":g?Kt(g,E):void 0},onKeyDown:Eb({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:k.activateTabWithKeyboard,loop:k.loop,orientation:k.orientation||"horizontal",dir:_,onKeyDown:p}),...R,children:[c&&a.jsx("span",{...k.getStyles("tabSection",P),"data-position":"left",children:c}),o&&a.jsx("span",{...k.getStyles("tabLabel",P),children:o}),s&&a.jsx("span",{...k.getStyles("tabSection",P),"data-position":"right",children:s})]})});aS.classes=mf;aS.displayName="@mantine/core/TabsTab";const ET="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",o8={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},a8=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Bt(t),"--tabs-color":Kt(n,e),"--tabs-text-color":Ml(r,e)?Ta({color:n,theme:e,autoContrast:r}):void 0}}),Gt=ge((e,t)=>{const n=oe("Tabs",o8,e),{defaultValue:r,value:o,onChange:s,orientation:c,children:d,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:y,color:x,radius:S,inverted:j,placement:C,keepMounted:T,classNames:R,styles:E,unstyled:_,className:k,style:I,vars:D,autoContrast:P,mod:$,attributes:B,...Q}=n,K=xr(p),[Z,U]=nr({value:o,defaultValue:r,finalValue:null,onChange:s}),G=Ie({name:"Tabs",props:n,classes:mf,className:k,style:I,classNames:R,styles:E,unstyled:_,attributes:B,vars:D,varsResolver:a8});return a.jsx(i8,{value:{placement:C,value:Z,orientation:c,id:K,loop:f,activateTabWithKeyboard:m,getTabId:yE(`${K}-tab`,ET),getPanelId:yE(`${K}-panel`,ET),onChange:U,allowTabDeactivation:g,variant:y,color:x,radius:S,inverted:j,keepMounted:T,unstyled:_,getStyles:G},children:a.jsx(le,{ref:t,id:K,variant:y,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},$],...G("root"),...Q,children:d})})});Gt.classes=mf;Gt.displayName="@mantine/core/Tabs";Gt.Tab=aS;Gt.Panel=oS;Gt.List=iS;const He=ge((e,t)=>{const n=oe("TextInput",null,e);return a.jsx($r,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});He.classes=$r.classes;He.displayName="@mantine/core/TextInput";var $A={root:"m_7341320d"};const s8=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":at(t,"ti-size"),"--ti-radius":n===void 0?void 0:Bt(n),"--ti-bg":s||r?d.background:void 0,"--ti-color":s||r?d.color:void 0,"--ti-bd":s||r?d.border:void 0}}},sS=ge((e,t)=>{const n=oe("ThemeIcon",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,autoContrast:p,attributes:m,...g}=n,y=Ie({name:"ThemeIcon",classes:$A,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:m,vars:f,varsResolver:s8});return a.jsx(le,{ref:t,...y("root"),...g})});sS.classes=$A;sS.displayName="@mantine/core/ThemeIcon";const l8=["h1","h2","h3","h4","h5","h6"],c8=["xs","sm","md","lg","xl"];function u8(e,t){const n=t!==void 0?t:`h${e}`;return l8.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:c8.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:ue(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var UA={root:"m_8a5d1357"};const d8={order:1},f8=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const s=u8(t||1,n);return{root:{"--title-fw":s.fontWeight,"--title-lh":s.lineHeight,"--title-fz":s.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},Ue=ge((e,t)=>{const n=oe("Title",d8,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,order:f,vars:p,size:m,variant:g,lineClamp:y,textWrap:x,mod:S,attributes:j,...C}=n,T=Ie({name:"Title",props:n,classes:UA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:j,vars:p,varsResolver:f8});return[1,2,3,4,5,6].includes(f)?a.jsx(le,{...T("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof y=="number"},S],size:m,...C}):null});Ue.classes=UA;Ue.displayName="@mantine/core/Title";function BA(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(o){t=typeof o=="function"?o(t):o},setState(o){this.updateState(o),r.forEach(s=>s(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function VA(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function h8(e,t,n){const r=[],o=[],s={};for(const c of e){const d=c.position||t;s[d]=s[d]||0,s[d]+=1,s[d]<=n?o.push(c):r.push(c)}return{notifications:o,queue:r}}const p8=()=>BA({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Ul=p8(),m8=(e=Ul)=>VA(e);function gu(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=h8(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function ke(e,t=Ul){const n=e.id||kp();return gu(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function FA(e,t=Ul){return gu(t,n=>n.filter(r=>r.id===e?(r.onClose?.(r),!1):!0)),e}function cl(e,t=Ul){return gu(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function g8(e=Ul){gu(e,()=>[])}function v8(e=Ul){gu(e,t=>t.slice(0,e.getState().limit))}const Pi={show:ke,hide:FA,update:cl,clean:g8,cleanQueue:v8,updateState:gu};function Qx(e,t){return Qx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Qx(e,t)}function HA(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Qx(e,t)}var Jy={exports:{}},Zy,TT;function y8(){if(TT)return Zy;TT=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Zy=e,Zy}var ex,RT;function x8(){if(RT)return ex;RT=1;var e=y8();function t(){}function n(){}return n.resetWarningCache=t,ex=function(){function r(c,d,f,p,m,g){if(g!==e){var y=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 y.name="Invariant Violation",y}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},ex}var _T;function b8(){return _T||(_T=1,Jy.exports=x8()()),Jy.exports}var S8=b8();const cn=om(S8),DT={disabled:!1},$p=On.createContext(null);var w8=function(t){return t.scrollTop},bd="unmounted",nl="exited",rl="entering",zc="entered",Wx="exiting",Aa=(function(e){HA(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var c=o,d=c&&!c.isMounting?r.enter:r.appear,f;return s.appearStatus=null,r.in?d?(f=nl,s.appearStatus=rl):f=zc:r.unmountOnExit||r.mountOnEnter?f=bd:f=nl,s.state={status:f},s.nextCallback=null,s}t.getDerivedStateFromProps=function(o,s){var c=o.in;return c&&s.status===bd?{status:nl}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var s=null;if(o!==this.props){var c=this.state.status;this.props.in?c!==rl&&c!==zc&&(s=rl):(c===rl||c===zc)&&(s=Wx)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,s,c,d;return s=c=d=o,o!=null&&typeof o!="number"&&(s=o.exit,c=o.enter,d=o.appear!==void 0?o.appear:c),{exit:s,enter:c,appear:d}},n.updateStatus=function(o,s){if(o===void 0&&(o=!1),s!==null)if(this.cancelNextCallback(),s===rl){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:xd.findDOMNode(this);c&&w8(c)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===nl&&this.setState({status:bd})},n.performEnter=function(o){var s=this,c=this.props.enter,d=this.context?this.context.isMounting:o,f=this.props.nodeRef?[d]:[xd.findDOMNode(this),d],p=f[0],m=f[1],g=this.getTimeouts(),y=d?g.appear:g.enter;if(!o&&!c||DT.disabled){this.safeSetState({status:zc},function(){s.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:rl},function(){s.props.onEntering(p,m),s.onTransitionEnd(y,function(){s.safeSetState({status:zc},function(){s.props.onEntered(p,m)})})})},n.performExit=function(){var o=this,s=this.props.exit,c=this.getTimeouts(),d=this.props.nodeRef?void 0:xd.findDOMNode(this);if(!s||DT.disabled){this.safeSetState({status:nl},function(){o.props.onExited(d)});return}this.props.onExit(d),this.safeSetState({status:Wx},function(){o.props.onExiting(d),o.onTransitionEnd(c.exit,function(){o.safeSetState({status:nl},function(){o.props.onExited(d)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,s){s=this.setNextCallback(s),this.setState(o,s)},n.setNextCallback=function(o){var s=this,c=!0;return this.nextCallback=function(d){c&&(c=!1,s.nextCallback=null,o(d))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(o,s){this.setNextCallback(s);var c=this.props.nodeRef?this.props.nodeRef.current:xd.findDOMNode(this),d=o==null&&!this.props.addEndListener;if(!c||d){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],p=f[0],m=f[1];this.props.addEndListener(p,m)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===bd)return null;var s=this.props,c=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var d=A0(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return On.createElement($p.Provider,{value:null},typeof c=="function"?c(o,d):On.cloneElement(On.Children.only(c),d))},t})(On.Component);Aa.contextType=$p;Aa.propTypes={};function Ac(){}Aa.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ac,onEntering:Ac,onEntered:Ac,onExit:Ac,onExiting:Ac,onExited:Ac};Aa.UNMOUNTED=bd;Aa.EXITED=nl;Aa.ENTERING=rl;Aa.ENTERED=zc;Aa.EXITING=Wx;function j8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lS(e,t){var n=function(s){return t&&v.isValidElement(s)?t(s):s},r=Object.create(null);return e&&v.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function C8(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),o=[];for(var s in e)s in t?o.length&&(r[s]=o,o=[]):o.push(s);var c,d={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var p=r[f][c];d[r[f][c]]=n(p)}d[f]=n(f)}for(c=0;c<o.length;c++)d[o[c]]=n(o[c]);return d}function ul(e,t,n){return n[t]!=null?n[t]:e.props[t]}function E8(e,t){return lS(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ul(n,"appear",e),enter:ul(n,"enter",e),exit:ul(n,"exit",e)})})}function T8(e,t,n){var r=lS(e.children),o=C8(t,r);return Object.keys(o).forEach(function(s){var c=o[s];if(v.isValidElement(c)){var d=s in t,f=s in r,p=t[s],m=v.isValidElement(p)&&!p.props.in;f&&(!d||m)?o[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:ul(c,"exit",e),enter:ul(c,"enter",e)}):!f&&d&&!m?o[s]=v.cloneElement(c,{in:!1}):f&&d&&v.isValidElement(p)&&(o[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:ul(c,"exit",e),enter:ul(c,"enter",e)}))}}),o}var R8=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},_8={component:"div",childFactory:function(t){return t}},us=(function(e){HA(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var c=s.handleExited.bind(j8(s));return s.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},s}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,s){var c=s.children,d=s.handleExited,f=s.firstRender;return{children:f?E8(o,d):T8(o,c,d),firstRender:!1}},n.handleExited=function(o,s){var c=lS(this.props.children);o.key in c||(o.props.onExited&&o.props.onExited(s),this.mounted&&this.setState(function(d){var f=Ip({},d.children);return delete f[o.key],{children:f}}))},n.render=function(){var o=this.props,s=o.component,c=o.childFactory,d=A0(o,["component","childFactory"]),f=this.state.contextValue,p=R8(this.state.children).map(c);return delete d.appear,delete d.enter,delete d.exit,s===null?On.createElement($p.Provider,{value:f},p):On.createElement($p.Provider,{value:f},On.createElement(s,d,p))},t})(On.Component);us.propTypes={};us.defaultProps=_8;const qA=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function D8(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),qA.reduce((n,r)=>(n[r]=[],n),{}))}const AT={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},A8={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function k8({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,s]=n.split("-"),c=s==="center"?`${o}-center`:s,d={opacity:0,maxHeight:t,transform:AT[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:A8[c]},p={opacity:0,maxHeight:0,transform:AT[c]};return{...d,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function P8(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const GA=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:s,message:c,...d}=e,f=P8(n,e.autoClose),p=v.useRef(-1),m=()=>window.clearTimeout(p.current),g=()=>{t(e.id),m()},y=()=>{typeof f=="number"&&(p.current=window.setTimeout(g,f))};return v.useEffect(()=>{e.onOpen?.(e)},[]),v.useEffect(()=>(y(),m),[f]),a.jsx(H0,{...r,...d,onClose:g,ref:o,onMouseEnter:m,onMouseLeave:y,children:c})});GA.displayName="@mantine/notifications/NotificationContainer";var QA={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const N8=Aa,O8={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:zr("overlay"),store:Ul,withinPortal:!0},M8=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":ue(n)}}),ka=ge((e,t)=>{const n=oe("Notifications",O8,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:y,notificationMaxHeight:x,limit:S,zIndex:j,store:C,portalProps:T,withinPortal:R,...E}=n,_=Tn(),k=m8(C),I=RM(),D=_b(),P=v.useRef({}),$=v.useRef(0),Q=(_.respectReducedMotion?D:!1)?1:g,K=Ie({name:"Notifications",classes:QA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:M8});v.useEffect(()=>{C?.updateState(G=>({...G,limit:S||5,defaultPosition:p}))},[S,p]),yl(()=>{k.notifications.length>$.current&&setTimeout(()=>I(),0),$.current=k.notifications.length},[k.notifications]);const Z=D8(k.notifications,p),U=qA.reduce((G,M)=>(G[M]=Z[M].map(({style:L,...z})=>a.jsx(N8,{timeout:Q,onEnter:()=>P.current[z.id].offsetHeight,nodeRef:{current:P.current[z.id]},children:F=>a.jsx(GA,{ref:Y=>{Y&&(P.current[z.id]=Y)},data:z,onHide:Y=>FA(Y,C),autoClose:m,...K("notification",{style:{...k8({state:F,position:M,transitionDuration:Q,maxHeight:x}),...L}})})},z.id)),G),{});return a.jsxs(Sa,{withinPortal:R,...T,children:[a.jsx(le,{...K("root"),"data-position":"top-center",ref:t,...E,children:a.jsx(us,{children:U["top-center"]})}),a.jsx(le,{...K("root"),"data-position":"top-left",...E,children:a.jsx(us,{children:U["top-left"]})}),a.jsx(le,{...K("root",{className:vl.classNames.fullWidth}),"data-position":"top-right",...E,children:a.jsx(us,{children:U["top-right"]})}),a.jsx(le,{...K("root",{className:vl.classNames.fullWidth}),"data-position":"bottom-right",...E,children:a.jsx(us,{children:U["bottom-right"]})}),a.jsx(le,{...K("root"),"data-position":"bottom-left",...E,children:a.jsx(us,{children:U["bottom-left"]})}),a.jsx(le,{...K("root"),"data-position":"bottom-center",...E,children:a.jsx(us,{children:U["bottom-center"]})})]})});ka.classes=QA;ka.displayName="@mantine/notifications/Notifications";ka.show=Pi.show;ka.hide=Pi.hide;ka.update=Pi.update;ka.clean=Pi.clean;ka.cleanQueue=Pi.cleanQueue;ka.updateState=Pi.updateState;class L8{operator;child;constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class gf{operator;left;right;constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class I8{prefixParselets={};infixParselets={};registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(o,s){const c=o.consumeAndParse(n);return r(s,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,s,c){const d=o.consumeAndParse(n);return r(s,c,d)},precedence:n})}construct(t){return new z8(t,this.prefixParselets,this.infixParselets)}}class z8{tokens;prefixParselets;infixParselets;constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){return this.peek()?.id!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw new Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let o=r.parse(this,n);for(;t>this.getPrecedence();){const s=this.consume();o=this.getInfixParselet(s).parse(this,o,s)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){if(!this.tokens.length)throw new Error("Cant consume unknown more tokens.");if(t&&this.peek()?.id!==t){const r=this.peek();throw new Error(`Expected ${t} but got "${r.id}" (${r.value}) at line ${r.line} column ${r.column}.`)}if(n&&this.peek()?.value!==n){const r=this.peek();throw new Error(`Expected "${n}" but got "${r.value}" at line ${r.line} column ${r.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}class WA{max;cache;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 lo="http://hl7.org",YA="ok",$8="created",U8="gone",B8="not-modified",V8="not-found",F8="unauthorized",H8="forbidden",q8="accepted",G8={resourceType:"OperationOutcome",id:YA,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Q8={resourceType:"OperationOutcome",id:V8,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},Id={resourceType:"OperationOutcome",id:F8,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},W8={...Id,issue:[...Id.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},kT={...Id,issue:[...Id.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},vf={resourceType:"OperationOutcome",id:H8,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Ao(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function jn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function Y8(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function K8(e){return!e||typeof e!="object"?!1:e instanceof Error||typeof DOMException<"u"&&e instanceof DOMException?!0:Object.prototype.toString.call(e)==="[object Error]"}function yf(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function KA(e){return e.id===YA||e.id===$8||e.id===B8||e.id===q8}function X8(e){return e.id===U8}class ht extends Error{outcome;constructor(t,n){super(XA(t),n),this.name="OperationOutcomeError",this.outcome=t}}function Qt(e){return e instanceof ht?e.outcome:yf(e)?e:Ao(Qe(e))}function Qe(e){return e?typeof e=="string"?e:K8(e)?e.message:yf(e)?XA(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function XA(e){const t=e.issue?.map(JA)??[];return t.length>0?t.join("; "):"Unknown error"}function JA(e){let t;return e.details?.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",e.expression?.length&&(t+=` (${e.expression.join(", ")})`),t}function J8(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 Z8(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,type:n,path:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,s])=>[o,J8(o,s)])),constraints:[],innerTypes:[]};return t}const eU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},tU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},nU={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"}]}}},rU={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"}]}}},iU={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"}]}}},oU={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"}]}}},aU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},sU={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"}]}}},lU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},cU={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"}]}}},uU={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"}]}}},dU={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"}]}}},fU={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"}]}}},hU={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"}]}}},pU={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"}]}}},mU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},gU={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"}]}}},vU={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"]}]}}},yU={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"]}]}}},xU={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"}]}}},bU={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"}]}}},SU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},wU={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"}]}}},jU={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"}]}}},CU={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"}]}}},EU={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"}]}}},TU={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"]}]}}},RU={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"]}]}}},_U={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"}]}}},DU={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"}]}}},AU={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"}]}}},kU={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"}]}}},PU={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"]}]}}},NU={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"}]}}},OU={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"}]}}},MU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},LU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},IU={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"]}]}}},zU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},$U={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"}]}}},UU={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"}]}}},BU={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"}]}}},VU={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"}]}}},FU={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"]}]}}},HU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},qU={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"}]}}},GU={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"]}]}}},QU={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"}]}}},WU={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"}]}}},YU={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"}]}}},KU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},XU={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"}]}}},JU={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"}]}}},ZU={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"}]}}},eB={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"]}]}}},tB={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"}]}}},nB={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"}]}}},rB={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"}]}}},iB={Element:eU,BackboneElement:tU,Address:nU,Age:rU,Annotation:iU,Attachment:oU,CodeableConcept:aU,Coding:sU,ContactDetail:lU,ContactPoint:cU,Contributor:uU,Count:dU,DataRequirement:fU,DataRequirementCodeFilter:hU,DataRequirementDateFilter:pU,DataRequirementSort:mU,Distance:gU,Dosage:vU,DosageDoseAndRate:yU,Duration:xU,ElementDefinition:bU,ElementDefinitionSlicingDiscriminator:SU,ElementDefinitionSlicing:wU,ElementDefinitionBase:jU,ElementDefinitionType:CU,ElementDefinitionExample:EU,ElementDefinitionConstraint:TU,ElementDefinitionBinding:RU,ElementDefinitionMapping:_U,Expression:DU,Extension:AU,HumanName:kU,Identifier:PU,MarketingStatus:NU,Meta:OU,Money:MU,Narrative:LU,ParameterDefinition:IU,Period:zU,Population:$U,ProdCharacteristic:UU,ProductShelfLife:BU,Quantity:VU,Range:FU,Ratio:HU,Reference:qU,RelatedArtifact:GU,SampledData:QU,Signature:WU,SubstanceAmount:YU,SubstanceAmountReferenceRange:KU,Timing:XU,TimingRepeat:JU,TriggerDefinition:ZU,UsageContext:eB,MoneyQuantity:tB,SimpleQuantity:nB,IdentityProvider:rB};function oB(e){return new sB(e).parse()}const Up=Z8(iB),cS=Object.create(null),PT=Object.create(null),aB={"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 ZA(e){let t;return t=PT[e],t||(t=PT[e]=Object.create(null)),t}function NT(e){const n=(Array.isArray(e)?e:e.entry?.map(r=>r.resource)??[]).filter(r=>r?.resourceType==="StructureDefinition");WB(n);for(const r of n)ek(r)}function ek(e){if(!e?.name)throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=oB(e),n=aB[e.url];let r,o;n?(r=Up,o=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||e.type?.startsWith("http://")||e.type?.startsWith("https://")?(r=Up,o=e.type):(r=ZA(e.url),o=e.type),r[o]=t;for(const s of t.innerTypes)s.parentType=t,r[s.name]=s;cS[e.url]=t}function tk(e){return!!Up[e]}function Hm(e,t){if(t){const n=ZA(t)[e];if(n)return n}return Up[e]}function nk(e,t){const n=Hm(e,t);if(!n)throw new ht(Ao("Unknown data type: "+e));return n}function uS(e){return!!cS[e]}function vu(e){return cS[e]}class sB{root;elements;elementIndex;index;resourceSchema;slicingContext;innerTypes;backboneContext;constructor(t){if(!t.snapshot?.element||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,path:this.root.path,title:t.title,type:t.type,url:t.url,version:t.version,kind:t.kind,description:uB(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if(t.id?.includes(":")){if(this.slicingContext?.current){const n=tx(t,this.slicingContext.path);this.slicingContext.current.elements[n]=this.parseElementDefinition(t)}}else{const n=this.parseElementDefinition(t);this.checkFieldEnter(t,n);let r=this.backboneContext;for(;r;){if(t.path?.startsWith(r.path+".")){r.type.elements[tx(t,r.path)]=n;break}r=r.parent}if(!r){const o=tx(t,this.root.path);t.isSummary&&this.resourceSchema.summaryProperties?.add(o.replace("[x]","")),n.min>0&&this.resourceSchema.mandatoryProperties?.add(o.replace("[x]","")),this.resourceSchema.elements[o]=n}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),this.slicingContext&&!kc(this.slicingContext.path,t?.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){for(;this.backboneContext&&!kc(this.backboneContext?.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=BT(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:kc(this.backboneContext?.path,t.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(t,n){cB(t)&&!this.peek()?.sliceName||(n.slicing={discriminator:(t.slicing?.discriminator??[]).map(r=>{if(r.type!=="value"&&r.type!=="pattern"&&r.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${r.type}`);return{path:r.path,type:r.type}}),slices:[],ordered:t.slicing?.ordered??!1,rule:t.slicing?.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!kc(this.backboneContext.path,t?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!kc(this.backboneContext.path,t?.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){const t=this.peek();if(t)return this.index++,t}peek(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const n=t.contentReference.slice(t.contentReference.indexOf("#")+1),r=this.elementIndex[n];return r?{...r,id:t.id,path:t.path,min:t.min??r.min,max:t.max??r.max,base:{path:r.base?.path??n,min:t.base?.min??r.base?.min??r.min,max:t.base?.max??r.base?.max??r.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){const n=this.peek();return!!(kc(t?.path,n?.path)&&t.type?.some(r=>["BackboneElement","Element"].includes(r.code)))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(t){return(t.type??[]).map(n=>{let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=BT(t)),r||(r=Ho(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){const n=OT(t.max),r=t.base?.max?OT(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||t.base?.path||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(s=>({key:s.key??"",severity:s.severity??"error",expression:s.expression??"",description:s.human??""})),type:this.parseElementDefinitionType(t),fixed:MT(zd(o,"fixed[x]")),pattern:MT(zd(o,"pattern[x]")),binding:t.binding}}}function OT(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function tx(e,t=""){return lB(e.path,t)}function lB(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function kc(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function MT(e){return Array.isArray(e)&&e.length>0?e[0]:Cn(e)?void 0:e}function cB(e){const t=e.slicing?.discriminator;return!!(e.type?.some(n=>n.code==="Extension")&&t?.length===1&&t[0].type==="value"&&t[0].path==="url")}function uB(e){let t=e.description;return t?.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function dB(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n?.withPath?rk:zd,[o,...s]=t.split(".");let c=[r(e,o,n)];for(const d of s){const f=[];for(const p of c)if(Array.isArray(p))for(const m of p)f.push(r(m,d,n));else(n?.withPath&&p?.value!==void 0||!n?.withPath&&p!==void 0)&&f.push(r(p,d,n));c=f}return c}function rk(e,t,n){const r=e.path;return fB(zd(e,t,n),r,t)}function fB(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((o,s)=>({...o,path:`${r}${n}[${s}]`})):{...e,path:`${r}${n}`}}const ik={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 hB(e,t,n,r){if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const s=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return hS(e,o.pattern);if(o.fixed)return Lo(e,o.fixed);if(o.binding?.strength==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!s?.length?!1:s.some(c=>c.code===e.type)}return!1}function et(e){return[{type:re.boolean,value:e}]}function pi(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:re.integer,value:e}:typeof e=="number"?{type:re.decimal,value:e}:typeof e=="boolean"?{type:re.boolean,value:e}:typeof e=="string"?{type:re.string,value:e}:Ni(e)?{type:re.Quantity,value:e}:qo(e)?{type:e.resourceType,value:e}:vk(e)?{type:re.CodeableConcept,value:e}:gk(e)?{type:re.Coding,value:e}:{type:re.BackboneElement,value:e}}function Ro(e){return e.length===0?!1:!!e[0].value}function ja(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 zd(e,t,n){if(!e.value)return;const r=Ds(e.type,t,n?.profileUrl);return r?ok(e,t,r):xf(e,t)}function ok(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let s,c="undefined",d;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of o){const g=p.replace("[x]",Wn(m.code));if(s=r[g],d=r["_"+g],s!==void 0||d!==void 0){c=m.code;break}}if(d)if(Array.isArray(s)){s=s.slice();for(let m=0;m<Math.max(s.length,d.length);m++)s[m]=nx(s[m],d[m])}else if(!s&&Array.isArray(d)){s=d.slice();for(let m=0;m<d.length;m++)s[m]=nx(void 0,d[m])}else s=nx(s,d);if(!Cn(s))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(s)?s.map(m=>LT(m,c)):LT(s,c)}function LT(e,t){return t==="Resource"&&qo(e)&&(t=e.resourceType),{type:t,value:e}}function xf(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const o=n[t];Array.isArray(o)?r=o.map(pi):r=pi(o)}else{const o=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(re)){const c=o+Wn(s);if(c in n){const d=n[c];Array.isArray(d)?r=d.map(f=>({type:s,value:f})):r={type:s,value:d};break}}}if(Array.isArray(r)){if(r.length===0||Cn(r[0]))return}else if(Cn(r))return;return r}function ak(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(Ro(qm(n,o))){r=!0;break}r||t.push(n)}return t}function pB(e){return et(!Ro(e))}function mB(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?et(!1):et(e.every((n,r)=>Ro(qm(n,t[r]))))}function gB(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?et(!0):et(e.some((n,r)=>!Ro(qm(n,t[r]))))}function qm(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?et(Math.abs(n-r)<1e-8):Ni(n)&&Ni(r)?et(fk(n,r)):et(typeof n=="object"&&typeof r=="object"?dS(e,t):n===r)}function sk(e,t){return e.length===0&&t.length===0?et(!0):e.length!==t.length?et(!1):(e.sort(IT),t.sort(IT),et(e.every((n,r)=>Ro(vB(n,t[r])))))}function vB(e,t){const{type:n,value:r}=e,{type:o,value:s}=t,c=r?.valueOf(),d=s?.valueOf();return typeof c=="number"&&typeof d=="number"?et(Math.abs(c-d)<.01):Ni(c)&&Ni(d)?et(fk(c,d)):et(n==="Coding"&&o==="Coding"?typeof c!="object"||typeof d!="object"?!1:c.code===d.code&&c.system===d.system:typeof c=="object"&&typeof d=="object"?dS({...c,id:void 0},{...d,id:void 0}):typeof c=="string"&&typeof d=="string"?c.toLowerCase()===d.toLowerCase():c===d)}function IT(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function lk(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 ck(n);case"DateTime":return $d(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return uk(n);case"Quantity":return Ni(n);default:return e.type===r||typeof n=="object"&&n?.resourceType===r}}function ck(e){return typeof e=="string"&&!!ik.date.exec(e)}function $d(e){return typeof e=="string"&&!!ik.dateTime.exec(e)}function uk(e){return!!(e&&typeof e=="object"&&("start"in e&&$d(e.start)||"end"in e&&$d(e.end)))}function dk(e){if(e){if(ck(e)||$d(e))return{start:ip(e,"0000-01-01T00:00:00.000"),end:ip(e,"xxxx-12-31T23:59:59.999")};if(uk(e))return{start:e.start?ip(e.start,"0000-01-01T00:00:00.000"):void 0,end:e.end?ip(e.end,"xxxx-12-31T23:59:59.999"):void 0}}}function ip(e,t){let n="Z";const r=Math.max(e.indexOf("+",10),e.indexOf("-",10));r>-1?(n=e.substring(r),e=e.substring(0,r)):e.endsWith("Z")&&(e=e.substring(0,e.length-1));const o=e+t.substring(e.length)+n;return new Date(o).toISOString()}function Ni(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function fk(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 dS(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o],c=t[o];if(zT(s)&&zT(c)){if(!dS(s,c))return!1}else if(s!==c)return!1}return!0}function zT(e){return e!==null&&typeof e=="object"}function nx(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return yB(e??{},t)}return e}function yB(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function hk(e,t){return qo(e,t)&&"id"in e&&typeof e.id=="string"}function Yt(e){const t=It(e)??"undefined/undefined",n=Ca(e);return n===t?{reference:t}:{reference:t,display:n}}function It(e){if(Na(e))return e.reference;if(hk(e))return`${e.resourceType}/${e.id}`}function Sl(e){if(e)return Na(e)?e.reference.split("/")[1]:e.id}function xB(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Ca(e){if(xB(e)){const t=bB(e);if(t)return t}if(e.resourceType==="Device"){const t=SB(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return bs(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]),vk(t))return bs(t);if(kB(t))return t.text}return It(e)??""}function bB(e){const t=e.name;if(t&&t.length>0)return Pa(t[0])}function SB(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function wB(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=$T(n);if(r)return r}else return $T(t)}function $T(e){if(e.url&&e.contentType?.startsWith("image/"))return e.url}function pk(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const o=n.getUTCFullYear(),s=n.getUTCMonth(),c=n.getUTCDate(),d=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=d-o;(f<s||f===s&&p<c)&&m--;let g=d*12+f-(o*12+s);p<c&&g--;const y=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:y}}function jB(e,t){const{years:n,months:r,days:o}=pk(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function Ho(e,...t){let n=e;for(let r=0;r<t.length&&n;r++)n=n?.extension?.find(o=>o.url===t[r]);return n}function ao(e,t){const n=fS(e);return JSON.stringify(n,null,t?2:void 0)??""}function fS(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?CB(e):EB(e):e}function CB(e){const t=e.length;if(t===0)return;let n,r=0;for(let o=0;o<t;o++){const s=e[o],c=fS(s);c!==s&&!n&&(n=Array.from(e)),c===void 0?n&&(n[o]=null):(n&&(n[o]=c),r++)}if(r!==0)return n??e}function EB(e){let t,n=0;for(const r in e){const o=e[r],s=fS(o);s!==o&&!t&&(t={...e}),s===void 0?t&&delete t[r]:(t&&(t[r]=s),n++)}if(n!==0)return t??e}function Cn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Mn(e):!1}function Mn(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 TB(e){if(!e)return;let t=e.length-1;for(;t>=0&&Cn(e[t]);)t--;return t>=0?e.slice(0,t+1):void 0}function Lo(e,t,n){return e===t||Cn(e)&&Cn(t)?!0:Cn(e)||Cn(t)?!1:Array.isArray(e)&&Array.isArray(t)?RB(e,t):Array.isArray(e)||Array.isArray(t)?!1:lr(e)&&lr(t)?_B(e,t,n):(lr(e)||lr(t),!1)}function RB(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Lo(e[n],t[n]))return!1;return!0}function _B(e,t,n){const r=new Set;for(const o of Object.keys(e))r.add(o);for(const o of Object.keys(t))r.add(o);n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const o of r){const s=e[o],c=t[o];if(!Lo(s,c,o))return!1}return!0}function hS(e,t){return Cn(e)?!0:Cn(t)?!1:Array.isArray(e)&&Array.isArray(t)?DB(e,t):Array.isArray(e)||Array.isArray(t)?!1:lr(e)&&lr(t)?AB(e,t):lr(e)||lr(t)?!1:e===t}function DB(e,t){return t.every(n=>e.some(r=>hS(r,n)))}function AB(e,t){return Object.entries(t).every(([n,r])=>n in e&&hS(e[n],r))}function mi(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function pS(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 lr(e){return e!==null&&typeof e=="object"}function mk(e){return typeof e=="string"}function gk(e){return lr(e)&&"code"in e&&typeof e.code=="string"}function vk(e){return lr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(gk)}function kB(e){return lr(e)&&"text"in e&&typeof e.text=="string"}const yk=[];for(let e=0;e<256;e++)yk.push(e.toString(16).padStart(2,"0"));function PB(e){const t=xk(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=yk[n[o]];return r.join("")}function NB(e){const t=xk(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=String.fromCodePoint(n[o]);return window.btoa(r.join(""))}function xk(e){return ArrayBuffer.isView(e)?e.buffer:e}function Wn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function mS(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function dl(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function OB(e,t){return e.coding?.find(n=>n.system===t)?.code}function MB(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const UT=(e,t)=>new Promise((n,r)=>{t?.signal?.throwIfAborted();const o=setTimeout(n,e);t?.signal?.addEventListener("abort",()=>{clearTimeout(o),r(t.signal?.reason)},{once:!0})});function Yx(e,t,n){const r=[];for(let o=0;o<n-1;o++){const s=e.indexOf(t);if(s<0)break;r.push(e.slice(0,s)),e=e.slice(s+t.length)}return r.push(e),r}function LB(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function al(e,t){return e?(e.push(t),e):[t]}function nu(e){return e.sort((t,n)=>t.localeCompare(n))}function gS(e){return e.endsWith("/")?e:e+"/"}function IB(e){return e.startsWith("/")?e.slice(1):e}function So(e,t){return new URL(IB(t),gS(e.toString())).toString()}function zB(e,t){return So(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function $B(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 bk(e,t){return e?.meta?.profile?.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function UB(e,t){if(e?.meta?.profile?.includes(t)){const n=e.meta.profile.indexOf(t);e.meta.profile.splice(n,1)}return e}const yr=Object.freeze([]);function wl(e){if(!e)return"";switch(e.type){case"Address":return Sk(e.value);case"CodeableConcept":return bs(e.value);case"Coding":return bf(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Pa(e.value);case"Quantity":return fl(e.value);case"Reference":return BB(e.value);default:return e.value?.toString()??""}}function BB(e){return e?e.display??e.reference??ao(e):""}function Sk(e,t){if(!e)return"";const n=[];if(e.line&&n.push(...e.line),e.city||e.state||e.postalCode){const r=[];e.city&&r.push(e.city),e.state&&r.push(e.state),e.postalCode&&r.push(e.postalCode),n.push(r.join(", "))}return e.use&&t?.use,n.join(", ").trim()}function Pa(e,t){if(!e)return"";const n=[];if(e.prefix&&t?.prefix!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&t?.suffix!==!1&&n.push(...e.suffix),e.use&&(t?.all||t?.use)&&n.push("["+e.use+"]"),n.length===0){const r=Bd(e.text);if(r)return r}return n.join(" ").trim()}function Gm(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function wk(e,t,n){if(!e)return"";const[r=0,o=0,s=0]=e.split(":").map(Number),c=new Date(Date.UTC(1970,0,1,r,o,s));return Gm(c)?new Intl.DateTimeFormat(t,{hour:"numeric",minute:"2-digit",second:s===0?void 0:"numeric",...n,timeZone:"UTC"}).format(c):""}function Dr(e,t,n){if(!e)return"";const r=new Date(e);return Gm(r)?r.toLocaleString(t,n):""}function VB(e,t,n){return!e||!e.start&&!e.end?"":Dr(e.start,t,n)+" - "+Dr(e.end,t,n)}const FB={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},HB={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},qB={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function jk(e){if(!e)return"";const t=[];return GB(t,e.repeat),e.event&&t.push(e.event.map(n=>Dr(n)).join(", ")),Wn(t.join(" ").trim())}function GB(e,t){if(!t?.periodUnit)return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(FB[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+HB[o]):e.push("per "+r+" "+qB[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Wn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>wk(s)).join(", "))}function Ud(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=e?.low&&{...e.low,comparator:void 0},o=e?.high&&{...e.high,comparator:void 0};return r?.value===void 0&&o?.value===void 0?"":r?.value!==void 0&&o?.value===void 0?`>= ${fl(r)}`:r?.value===void 0&&o?.value!==void 0?`<= ${fl(o)}`:(r?.unit===o?.unit&&delete r?.unit,`${fl(r)} - ${fl(o)}`)}function fl(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.at(-1)!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function QB(e){return e?.value===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function bs(e){if(!e)return"";const t=Bd(e.text);return t||(e.coding?e.coding.map(n=>bf(n)).join(", "):"")}function bf(e,t){const n=Bd(e?.display);return n?`${n}`:Bd(e?.code)??""}function Ck(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(fl(e.valueQuantity));else if(e.valueCodeableConcept)t.push(bs(e.valueCodeableConcept));else{const n=Bd(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>Ck(n)).join(" / ")),t.join(" / ").trim()}function Bd(e){return typeof e=="string"?e:void 0}const re={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Element:"Element",ElementDefinition:"ElementDefinition",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",MoneyQuantity:"MoneyQuantity",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",SimpleQuantity:"SimpleQuantity",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",xhtml:"xhtml"};function WB(e){const t=Array.isArray(e)?e:e.entry?.map(n=>n.resource)??[];for(const n of t)n?.resourceType==="StructureDefinition"&&n.kind==="resource"&&Ek(n.type)}function Ek(e){let t=Io.types[e];return t||(t={searchParamsDetails:{}},Io.types[e]=t),!t.searchParams&&e!=="Binary"&&(t.searchParams={_id:{base:[e],code:"_id",type:"token",expression:e+".id"},_lastUpdated:{base:[e],code:"_lastUpdated",type:"date",expression:e+".meta.lastUpdated"},_compartment:{base:[e],code:"_compartment",type:"reference",expression:e+".meta.compartment"},_profile:{base:[e],code:"_profile",type:"uri",expression:e+".meta.profile"},_security:{base:[e],code:"_security",type:"token",expression:e+".meta.security"},_source:{base:[e],code:"_source",type:"uri",expression:e+".meta.source"},_tag:{base:[e],code:"_tag",type:"token",expression:e+".meta.tag"}}),t}function YB(e){for(const t of e.base??yr){const n=Ek(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function BT(e){const t=e.type?.[0]?.code;return t==="BackboneElement"||t==="Element"?KB((e.base?.path??e.path)?.split(".")):t}function KB(e){return e.length===1?e[0]:e.map(Wn).join("")}function vS(e){return Io.types[e]?.searchParams}function XB(e,t){return Io.types[e]?.searchParams?.[t]}function jl(e){const t=e.replaceAll("[x]","").split(".").pop();return Tk(t)}function Tk(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(ZB).join(" ").replace("_"," ").replaceAll(/\s+/g," ")}const JB=new Set(["CDS","ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function ZB(e){const t=e.toUpperCase();return e===t?e:JB.has(t)?t:t.charAt(0)+e.slice(1)}function Ds(e,t,n){const r=Hm(e,n);if(r)return eV(r.elements,t)}function eV(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const o=t[r];if(o>="A"&&o<="Z"){const s=t.slice(0,r)+"[x]",c=e[s];if(c)return c}}}function qo(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function Na(e,t){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Io={types:{}};function wp(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 pa=()=>[],Wr={empty:(e,t)=>et(t.every(n=>Cn(n.value))),hasValue:(e,t)=>et(t.length!==0),exists:(e,t,n)=>et(n?t.some(r=>Ro(n.eval(e,[r]))):t.length>0&&t.every(r=>!Cn(r.value))),all:(e,t,n)=>et(t.every(r=>Ro(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return et(!1);return et(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return et(!0);return et(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return et(!1);return et(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return et(!0);return et(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return et(!0);const r=n.eval(e,el(e));return r.length===0?et(!1):et(t.every(o=>r.some(s=>s.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,el(e));return r.length===0?et(!0):t.length===0?et(!1):et(r.every(o=>t.some(s=>s.value===o.value)))},count:(e,t)=>[{type:re.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>et(t.length===Wr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>Ro(n.eval(e,[r]))),select:(e,t,n)=>t.flatMap(r=>n.eval({parent:e,variables:{$this:r}},[r])),repeat:pa,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(-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{const r=n.eval(e,t)[0]?.value;if(typeof r!="number")throw new TypeError("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{const r=n.eval(e,t)[0]?.value;if(typeof r!="number")throw new TypeError("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,el(e)),o=[];for(const s of t)!o.some(c=>c.value===s.value)&&r.some(c=>c.value===s.value)&&o.push(s);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,el(e)),o=[];for(const s of t)r.some(c=>c.value===s.value)||o.push(s);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,el(e));return ak([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,el(e));return[...t,...r]},htmlChecks:(e,t,n)=>[pi(!0)],iif:(e,t,n,r,o)=>{const s=n.eval(e,t);if(s.length>1||s.length===1&&typeof s[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return Ro(s)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=wo(t,1);if(typeof n=="boolean")return[{type:re.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return et(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return et(!0);if(["false","f","no","n","0","0.0"].includes(r))return et(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:et(Wr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=wo(t,1);return typeof n=="number"?[{type:re.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:re.integer,value:Number.parseInt(n,10)}]:typeof n=="boolean"?[{type:re.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:et(Wr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=wo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.date,value:wp(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:et(Wr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=wo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.dateTime,value:wp(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:et(Wr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=wo(t,1);return typeof n=="number"?[{type:re.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:re.decimal,value:Number.parseFloat(n)}]:typeof n=="boolean"?[{type:re.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:et(Wr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=wo(t,1);return Ni(n)?[{type:re.Quantity,value:n}]:typeof n=="number"?[{type:re.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:re.Quantity,value:{value:Number.parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:re.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:et(Wr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=wo(t,1);return n==null?[]:Ni(n)?[{type:re.string,value:`${n.value} '${n.unit}'`}]:[{type:re.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:et(Wr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=wo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:re.time,value:wp("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:et(Wr.toTime(e,t).length===1),indexOf:(e,t,n)=>_i((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>_i((o,s,c)=>{const d=s,f=c?d+c:o.length;return d<0||d>=o.length?void 0:o.substring(d,f)},e,t,n,r),startsWith:(e,t,n)=>_i((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>_i((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>_i((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>_i(n=>n.toUpperCase(),e,t),lower:(e,t)=>_i(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>_i((o,s,c)=>o.replaceAll(s,c),e,t,n,r),matches:(e,t,n)=>_i((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>_i((o,s,c)=>o.replaceAll(new RegExp(s,"g"),c.replaceAll(/\$\{(\w+)\}/g,"$<$1>")),e,t,n,r),length:(e,t)=>_i(n=>n.length,e,t),toChars:(e,t)=>_i(n=>n?n.split(""):void 0,e,t),encode:pa,decode:pa,escape:pa,unescape:pa,trim:pa,split:pa,join:(e,t,n)=>{const r=n?.eval(e,el(e))[0]?.value??"";if(typeof r!="string")throw new TypeError("Separator must be a string.");return[{type:re.string,value:t.map(o=>o.value?.toString()??"").join(r)}]},abs:(e,t)=>yo(Math.abs,e,t),ceiling:(e,t)=>yo(Math.ceil,e,t),exp:(e,t)=>yo(Math.exp,e,t),floor:(e,t)=>yo(Math.floor,e,t),ln:(e,t)=>yo(Math.log,e,t),log:(e,t,n)=>yo((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>yo(Math.pow,e,t,n),round:(e,t,...n)=>yo((r,o=0)=>{if(typeof o!="number"||o<0)throw new Error("Invalid precision provided to round()");const s=Math.pow(10,o);return Math.round(r*s)/s},e,t,...n),sqrt:(e,t)=>yo(Math.sqrt,e,t),truncate:(e,t)=>yo(n=>Math.trunc(n),e,t),children:pa,descendants:pa,trace:(e,t,n)=>t,now:()=>[{type:re.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:re.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:re.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{const s=Wr.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const c=Wr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const d=o.eval(e,t)[0]?.value;if(d!=="years"&&d!=="months"&&d!=="days")throw new Error("Invalid units");const f=pk(s[0].value,c[0].value);return[{type:re.Quantity,value:{value:f[d],unit:d}}]},is:(e,t,n)=>{let r="";return n instanceof Vd?r=n.name:n instanceof Qm&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:re.boolean,value:lk(o,r)})):[]},not:(e,t)=>Wr.toBoolean(e,t).map(n=>({type:re.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const s=r;if(s.resource)return pi(s.resource);s.reference?o=s.reference:s.type&&s.identifier&&(o=`${s.type}?identifier=${s.identifier.system}|${s.identifier.value}`)}if(o?.includes("?")){const[s]=o.split("?");return{type:s,value:{resourceType:s}}}if(o?.includes("/")){const[s,c]=o.split("/");return{type:s,value:{resourceType:s,id:c}}}return{type:re.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:re.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:re.BackboneElement,value:{namespace:"System",name:"Integer"}}:qo(n)?{type:re.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:re.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(s=>({type:re.boolean,value:s.value?.resourceType===o}))},getResourceKey:(e,t)=>{const n=t[0].value;return n?.id?[{type:re.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!r?.reference)return[];let o="";return n instanceof Vd&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:re.id,value:Sl(r)}]},extension:(e,t,n)=>{const r=n.eval(e,t)[0].value,o=t?.[0]?.value;if(o){const s=Ho(o,r);if(s)return[{type:re.Extension,value:s}]}return[]}};function _i(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=wo(n,1);if(typeof o!="string")throw new TypeError("String function cannot be called with non-string");const s=r.map(d=>d?.eval(t,n)[0]?.value),c=e(o,...s);return c===void 0?[]:Array.isArray(c)?c.map(pi):[pi(c)]}function yo(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=wo(n,1),s=Ni(o),c=s?o.value:o;if(typeof c!="number")throw new TypeError("Math function cannot be called with non-number");const d=e(c,...r.map(m=>m.eval(t,n)[0]?.value)),f=s?re.Quantity:n[0].type,p=s?{...o,value:d}:d;return[{type:f,value:p}]}function wo(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 el(e){let t=e;for(;t.parent?.variables.$this;)t=t.parent;return[t.variables.$this]}class yS{original;child;constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const o of n)r.push(this.child.eval({parent:t,variables:{$this:o}},[o]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`,{cause:r})}}toString(){return this.child.toString()}}class Pc{value;constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Vd{name;constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(o=>this.evalValue(o)).filter(o=>o?.value!==void 0)}getVariable(t){const n=t.variables[this.name];if(n!==void 0)return n;if(t.parent)return this.getVariable(t.parent)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return qo(n,this.name)?t:rk(t,this.name)}toString(){return this.name}}class tV{eval(){return[]}toString(){return"{}"}}class nV extends L8{impl;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 Bp extends gf{constructor(t,n){super("as",t,n)}eval(t,n){return Wr.ofType(t,this.left.eval(t,n),this.right)}}class ei extends gf{}class Xi extends ei{impl;constructor(t,n,r,o){super(t,n,r),this.impl=o}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.eval(t,n);if(o.length!==1)return[];const s=r[0].value,c=o[0].value,d=Ni(s)?s.value:s,f=Ni(c)?c.value:c,p=this.impl(d,f);return typeof p=="boolean"?et(p):Ni(s)?[{type:re.Quantity,value:{...s,value:p}}]:[pi(p)]}}class rV extends gf{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),s=[...r,...o];return s.length>0&&s.every(c=>typeof c.value=="string")?[{type:re.string,value:s.map(c=>c.value).join("")}]:s}}class iV extends ei{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return et(r.some(s=>s.value===o[0].value))}}class oV extends ei{constructor(t,n){super("in",t,n)}eval(t,n){const r=ja(this.left.eval(t,n)),o=this.right.eval(t,n);return r?et(o.some(s=>qm(r,s)[0].value)):[]}}class Qm extends gf{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 xS extends gf{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return ak([...r,...o])}}class aV extends ei{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return mB(r,o)}}class sV extends ei{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return gB(r,o)}}class lV extends ei{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return sk(r,o)}}class cV extends ei{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return pB(sk(r,o))}}class bS extends ei{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.name;return et(lk(r[0],o))}}class uV extends ei{constructor(t,n){super("and",t,n)}eval(t,n){const r=ja(this.left.eval(t,n),"boolean"),o=ja(this.right.eval(t,n),"boolean");return r?.value===!0&&o?.value===!0?et(!0):r?.value===!1||o?.value===!1?et(!1):[]}}class dV extends ei{constructor(t,n){super("or",t,n)}eval(t,n){const r=ja(this.left.eval(t,n),"boolean"),o=ja(this.right.eval(t,n),"boolean");return r?.value===!1&&o?.value===!1?et(!1):r?.value||o?.value?et(!0):[]}}class fV extends ei{constructor(t,n){super("xor",t,n)}eval(t,n){const r=ja(this.left.eval(t,n),"boolean"),o=ja(this.right.eval(t,n),"boolean");return!r||!o?[]:et(r.value!==o.value)}}class hV extends ei{constructor(t,n){super("implies",t,n)}eval(t,n){const r=ja(this.left.eval(t,n),"boolean"),o=ja(this.right.eval(t,n),"boolean");return o?.value===!0||r?.value===!1?et(!0):!r||!o?[]:et(!1)}}class SS{name;args;constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Wr[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 wS{left;expr;constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const o=r[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const s=this.left.eval(t,n);return o in s?[s[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const pV=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"],mV={"'":"'",'"':'"',"`":"`",r:"\r",n:`
|
|
54
|
-
`,t:" ",f:"\f","\\":"\\"};class gV{str;keywords;operators;dateTimeLiterals;symbolRegex;result=[];pos={index:0,line:1,column:0};markStack=[];constructor(t,n,r,o){this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!o?.dateTimeLiterals,this.symbolRegex=o?.symbolRegex??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
|
|
55
|
-
`))}consumeString(t){this.advance();let n="",r;for(;r=this.consumeChar(t);)n+=r;const o=this.buildToken(t==="`"?"Symbol":"String",n);return this.advance(),o}consumeChar(t){const n=this.curr();if(n==="\\"){this.advance();const r=this.curr(),o=mV[r];if(o!==void 0)return this.advance(),o;if(r==="u"){this.advance();const s=/^[0-9a-fA-F]{4}$/.exec(this.str.substring(this.pos.index,this.pos.index+4))?.[0];return s?(this.advance(),this.advance(),this.advance(),this.advance(),String.fromCodePoint(Number.parseInt(s,16))):"u"}return this.consumeChar(t)}return n===t||!n?"":(this.advance(),n)}consumeQuotedSymbol(t){this.mark();const n=this.pos.index;this.advance(),this.consumeString(t);const r=this.str.substring(n,this.pos.index);return this.buildToken("Symbol",r)}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;if(this.curr()==="T"&&(n=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?(r=!0,this.advance()):(this.curr()==="+"||this.curr()==="-")&&(r=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.pos.index===t)throw new Error("Invalid DateTime literal");let o=this.str.substring(t,this.pos.index);return o.endsWith("T")?o=o.substring(0,o.length-1):!o.startsWith("T")&&n&&!r&&(o+="Z"),this.buildToken("DateTime",o)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&vV(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return this.prevToken()?.value!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
|
|
56
|
-
`?(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 vV(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&pV.includes(e.value)))}const yV=["true","false"],xV=["!=","!~","<=",">=","{}","->"];function bV(e){return new gV(e,yV,xV).tokenize()}const en={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},SV={parse(e){const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+e.peek()?.value+"`");return t}},wV={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new wS(t,n)},precedence:en.Indexer},jV={parse(e,t){if(!(t instanceof Vd))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new SS(t.name,n)},precedence:en.FunctionCall};function CV(e){const t=e.split(" "),n=Number.parseFloat(t[0]);let r=t[1];return r?.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function EV(){return new I8().registerPrefix("String",{parse:(e,t)=>new Pc({type:re.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Pc({type:re.dateTime,value:wp(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Pc({type:re.Quantity,value:CV(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Pc({type:t.value.includes(".")?re.decimal:re.integer,value:Number.parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Pc({type:re.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Pc({type:re.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Vd(t.value)}).registerPrefix("{}",{parse:()=>new tV}).registerPrefix("(",SV).registerInfix("[",wV).registerInfix("(",jV).prefix("+",en.UnaryAdd,(e,t)=>new nV("+",t,n=>n)).prefix("-",en.UnarySubtract,(e,t)=>new Xi("-",t,t,(n,r)=>-r)).infixLeft(".",en.Dot,(e,t,n)=>new Qm(e,n)).infixLeft("/",en.Divide,(e,t,n)=>new Xi("/",e,n,(r,o)=>r/o)).infixLeft("*",en.Multiply,(e,t,n)=>new Xi("*",e,n,(r,o)=>r*o)).infixLeft("+",en.Add,(e,t,n)=>new Xi("+",e,n,(r,o)=>r+o)).infixLeft("-",en.Subtract,(e,t,n)=>new Xi("-",e,n,(r,o)=>r-o)).infixLeft("|",en.Union,(e,t,n)=>new xS(e,n)).infixLeft("=",en.Equals,(e,t,n)=>new aV(e,n)).infixLeft("!=",en.NotEquals,(e,t,n)=>new sV(e,n)).infixLeft("~",en.Equivalent,(e,t,n)=>new lV(e,n)).infixLeft("!~",en.NotEquivalent,(e,t,n)=>new cV(e,n)).infixLeft("<",en.LessThan,(e,t,n)=>new Xi("<",e,n,(r,o)=>r<o)).infixLeft("<=",en.LessThanOrEquals,(e,t,n)=>new Xi("<=",e,n,(r,o)=>r<=o)).infixLeft(">",en.GreaterThan,(e,t,n)=>new Xi(">",e,n,(r,o)=>r>o)).infixLeft(">=",en.GreaterThanOrEquals,(e,t,n)=>new Xi(">=",e,n,(r,o)=>r>=o)).infixLeft("&",en.Ampersand,(e,t,n)=>new rV(e,n)).infixLeft("and",en.And,(e,t,n)=>new uV(e,n)).infixLeft("as",en.As,(e,t,n)=>new Bp(e,n)).infixLeft("contains",en.Contains,(e,t,n)=>new iV(e,n)).infixLeft("div",en.Divide,(e,t,n)=>new Xi("div",e,n,(r,o)=>Math.trunc(r/o))).infixLeft("in",en.In,(e,t,n)=>new oV(e,n)).infixLeft("is",en.Is,(e,t,n)=>new bS(e,n)).infixLeft("mod",en.Modulo,(e,t,n)=>new Xi("mod",e,n,(r,o)=>r%o)).infixLeft("or",en.Or,(e,t,n)=>new dV(e,n)).infixLeft("xor",en.Xor,(e,t,n)=>new fV(e,n)).infixLeft("implies",en.Implies,(e,t,n)=>new hV(e,n))}const TV=EV();function jS(e){return new yS(e,TV.construct(bV(e)).consumeAndParse())}function RV(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const o=n[r];typeof o=="object"&&"type"in o&&"value"in o||(n[r]=pi(n[r]))}return Ss(e,n).map(r=>r.value)}function Ss(e,t,n={},r=void 0){let o;if(typeof e=="string"){const s=r?.get(e);o=s??jS(e),r&&!s&&r.set(e,o)}else o=e;return o.eval({variables:n},t).map(s=>{const c={type:s.type,value:s.value?.valueOf()};return"path"in s&&(c.path=s.path),c})}function _V(e){const t=[];for(const n of e){const r=dk(n.value);r&&t.push(r)}return t}function DV(e){const t=new Set;for(const n of e){const r=wl(n);r&&t.add(r)}return Array.from(t)}function AV(e){const t=new Set;for(const n of e){const{value:r}=n;r&&(mk(r)?t.add(r):Na(r)?t.add(r.reference):hk(r)?t.add(It(r)):typeof r.identifier=="object"&&t.add(`identifier:${r.identifier.system}|${r.identifier.value}`))}return Array.from(t)}function kV(e,t={}){const n=[];for(const r of e)PV(t,n,r);return n}function PV(e,t,n){const{type:r,value:o}=n;switch(r){case re.Identifier:NV(t,e,o);break;case re.CodeableConcept:OV(t,e,o);break;case re.Coding:Rk(t,e,o);break;case re.ContactPoint:MV(t,e,o);break;default:Cl(t,e,void 0,o?.toString())}}function NV(e,t,n){n?.type?.text&&Cl(e,t,t.textSearchSystem,n.type.text),Cl(e,t,n?.system,n?.value)}function OV(e,t,n){n?.text&&Cl(e,t,t.textSearchSystem,n.text);for(const r of n?.coding??yr)Rk(e,t,r)}function Rk(e,t,n){n&&(n.display&&Cl(e,t,t.textSearchSystem,n.display),Cl(e,t,n.system,n.code))}function MV(e,t,n){n&&Cl(e,t,n.system,n.value?.toLocaleLowerCase())}function Cl(e,t,n,r){(n||r)&&!e.some(o=>o.system===n&&o.value===r)&&e.push({system:n,value:r&&t.caseInsensitive?r.toLocaleLowerCase():r})}const Wm=20,he={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"},_k={contains:he.CONTAINS,exact:he.EXACT,above:he.ABOVE,below:he.BELOW,text:he.TEXT,not:he.NOT,in:he.IN,"not-in":he.NOT_IN,"of-type":he.OF_TYPE,missing:he.MISSING,identifier:he.IDENTIFIER,iterate:he.ITERATE},CS={eq:he.EQUALS,ne:he.NOT_EQUALS,lt:he.LESS_THAN,le:he.LESS_THAN_OR_EQUALS,gt:he.GREATER_THAN,ge:he.GREATER_THAN_OR_EQUALS,sa:he.STARTS_AFTER,eb:he.ENDS_BEFORE,ap:he.APPROXIMATELY,sw:he.STARTS_WITH};function Dk(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,d]=e.split("?");n=c,r=new URLSearchParams(d)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let o;n.includes("/")?o=n.split("/").filter(Boolean).pop():o=n;const s=[];return r&&s.push(...r.entries()),LV(o,s)}function LV(e,t){const n={resourceType:e};for(const[r,o]of t)IV(n,r,o);return n}function IV(e,t,n){let r,o;const s=t.indexOf(":");if(s>=0?(r=t.substring(0,s),o=t.substring(s+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=al(e.filters,{code:t,operator:he.EQUALS,value:n});return}switch(r){case"_sort":zV(e,n);break;case"_cursor":e.cursor=n;break;case"_count":e.count=Number.parseInt(n,10);break;case"_offset":e.offset=Number.parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const c=VT(n);o==="iterate"&&(c.modifier=he.ITERATE),e.include=al(e.include,c);break}case"_revinclude":{const c=VT(n);o==="iterate"&&(c.modifier=he.ITERATE),e.revInclude=al(e.revInclude,c);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const c=Io.types[e.resourceType]?.searchParams?.[r];c?e.filters=al(e.filters,UV(c,o,n)):e.filters=al(e.filters,BV(r,o,n))}}}}function zV(e,t){for(const n of t.split(",")){let r,o=!1;n.startsWith("-")?(r=n.substring(1),o=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:o})}}const $V=[he.MISSING,he.PRESENT];function UV(e,t,n){if($V.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=VV(n,t||he.EQUALS);if(!FT(e,o))throw new ht(Ao(`Invalid format for ${e.type} search parameter: ${o}`));return{code:e.code,operator:r,value:o}}case"reference":case"string":case"token":case"uri":if(!FT(e,n))throw new ht(Ao(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:FV(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function BV(e,t,n){let r=he.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in CS&&(n.length===2||n.at(2)?.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function VV(e,t){const n=e.substring(0,2),r=CS[n];return r?{operator:r,value:e.substring(2)}:{operator:t,value:e}}function FV(e){return _k[e]??he.EQUALS}function VT(e){const t=e.split(":");if(t.includes("*"))throw new ht(Ao("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new ht(Ao(`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 ht(Ao(`Invalid include value '${e}'`))}function FT(e,t){return e.type==="date"?$d(t):!0}function gs(e){const t=[];e.fields&&t.push("_fields="+e.fields.join(","));for(const n of e.filters??yr)t.push(HV(n));e.sortRules&&e.sortRules.length>0&&t.push(qV(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(","));for(const n of e.include??yr)t.push(HT("_include",n));for(const n of e.revInclude??yr)t.push(HT("_revinclude",n));return t.length===0?"":(nu(t),"?"+t.join("&"))}function HV(e){const t=e.operator in _k?":"+e.operator:"",n=e.operator!==he.EQUALS&&e.operator in CS?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function qV(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function HT(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Ym(e){const t=[];let n="",r=!1;for(const o of e)r?(n+=o,r=!1):o==="\\"?r=!0:o===","?(t.push(n),n=""):n+=o;return t.push(n),t}function GV(e,t){if(t.resourceType!==e.resourceType)return!1;for(const n of t.filters??yr)if(!QV(e,t,n))return!1;return!0}function QV(e,t,n){const r=Io.types[t.resourceType]?.searchParams?.[n.code];if(!r)return!1;const o=Ss(r.expression,[pi(e)]);if(n.operator===he.MISSING||n.operator===he.PRESENT)return WV(o,n);switch(r.type){case"reference":return YV(o,n);case"string":case"uri":return JV(o,n);case"token":return KV(o,n);case"date":return eF(o,n);default:return!1}}function WV(e,t){const n=e.length>0;return(t.operator===he.MISSING&&t.value==="false"||t.operator===he.PRESENT&&t.value==="true")===n}function YV(e,t){const n=Km(t.operator);if(t.value===""&&e.length===0)return t.operator===he.EQUALS;const r=AV(e);for(const o of Ym(t.value)){let s=r.includes(o);if(!s&&t.code==="_compartment"&&(s=r.some(c=>c?.endsWith("/"+o))),s)return!n}return n}function KV(e,t){const n=kV(e),r=Ym(t.value),o=Km(t.operator);for(const s of n)for(const c of r)if(XV(s,c))return!o;return o}function XV(e,t){if(t.includes("|")){const[n,r]=t.split("|").map(o=>o.toLowerCase());return!n&&!r?!1:n?e.system?.toLowerCase()===n&&(!r||e.value?.toLowerCase()===r):!e.system&&e.value?.toLowerCase()===r}return e.value?.toLowerCase()===t.toLowerCase()}function JV(e,t){const n=DV(e),r=Ym(t.value),o=Km(t.operator);for(const s of n)for(const c of r)if(ZV(s,c))return!o;return o}function ZV(e,t){return e.toLowerCase().includes(t.toLowerCase())}function eF(e,t){const n=_V(e),r=Ym(t.value),o=Km(t.operator);for(const s of n)for(const c of r)if(tF(s,t.operator,c))return!o;return o}function tF(e,t,n){if(!e)return!1;const r=dk(n);if(!r)return!1;const o=e.start??"0000",s=e.end??"9999",c=r.start,d=r.end;switch(t){case he.APPROXIMATELY:case he.EQUALS:case he.NOT_EQUALS:return o<d&&s>c;case he.LESS_THAN:return o<c;case he.GREATER_THAN:return s>d;case he.LESS_THAN_OR_EQUALS:return o<=d;case he.GREATER_THAN_OR_EQUALS:return s>=c;case he.STARTS_AFTER:return o>d;case he.ENDS_BEFORE:return s<c;default:return!1}}function Km(e){return e===he.NOT_EQUALS||e===he.NOT}const nF={resourceType:"*"},rF=["DomainConfiguration","JsonWebKey","Login"],iF=["UserSecurityRequest","Project","ProjectMembership","User"],hl={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},oF=[hl.READ,hl.VREAD,hl.HISTORY,hl.SEARCH];function aF(e,t){return rF.includes(t)?!1:sF(e,hl.UPDATE,t)}function sF(e,t,n){return!!e.resource?.some(r=>kk(r,n,t))}function Ak(e,t,n){return n?n.resource?.find(r=>lF(e,t,r)):nF}function lF(e,t,n){const r=e.resourceType;return kk(n,r,t)?r==="Binary"?!0:!(n.compartment&&!e.meta?.compartment?.some(o=>o.reference===n.compartment?.reference)||n.criteria&&!GV(e,Dk(n.criteria))):!1}function kk(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||iF.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||oF.includes(n)}function jo(){return typeof window<"u"}function Pk(){return typeof Buffer<"u"?Buffer:void 0}const er={assign(e){jo()&&globalThis.location.assign(e)},reload(){jo()&&globalThis.location.reload()},getSearch(){return jo()?globalThis.location.search:""},getPathname(){return jo()?globalThis.location.pathname:""},getLocation(){return jo()?globalThis.location.toString():""},getOrigin(){return jo()?globalThis.location.protocol+"//"+globalThis.location.host+"/":""}};function cF(e){if(jo()){const n=window.atob(e),r=Uint8Array.from(n,o=>o.codePointAt(0));return new window.TextDecoder().decode(r)}const t=Pk();if(t)return t.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function qT(e){if(jo()){const n=new window.TextEncoder().encode(e),r=String.fromCodePoint.apply(null,n);return window.btoa(r)}const t=Pk();if(t)return t.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function uF(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replaceAll("-","+").replaceAll("_","/");return cF(t)}function GT(){const e=new Uint32Array(28);return crypto.getRandomValues(e),PB(e.buffer)}async function dF(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function Nk(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,e=>{const t=Math.trunc(Math.random()*16);return(e==="x"?t:t&3|8).toString(16)})}function Ok(e){const t={};e=mi(e);for(const o of e.entry??yr){const s=o.resource;if(!s)continue;s.meta!==void 0&&(delete s.meta.author,delete s.meta.compartment,delete s.meta.lastUpdated,delete s.meta.project,delete s.meta.versionId,Object.keys(s.meta).length===0&&delete s.meta);const c=s?.id;c&&(t[c]=Nk(),o.fullUrl="urn:uuid:"+t[c],delete o.resource?.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n?.map(o=>({fullUrl:o.fullUrl,request:{method:"POST",url:o.resource?.resourceType},resource:o.resource}))},(o,s)=>fF(o,s,t),2);return hF(JSON.parse(r))}function fF(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const o=n[r];if(o)return"urn:uuid:"+o}}return t}function hF(e){const t=mF(e),{sorted:n,cycles:r}=pF(t),o={},s=[];for(const d of e.entry??yr)d.fullUrl?o[d.fullUrl]=d:s.push(d);const c=n.map(d=>o[d]);for(const d of r)for(const f of d){const p=o[f],m={...p,request:{...p.request,method:"PUT"}};c.push(m)}return c.push(...s),{...e,entry:c}}const Nc={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function pF(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=Nc.NotVisited;function o(s,c){if(n[s]===Nc.Visited)return!0;if(n[s]===Nc.Visiting){const f=c.lastIndexOf(s);return f!==-1&&r.push(c.slice(f)),!0}n[s]=Nc.Visiting,c.push(s);let d=!1;for(const f of e[s])o(f,c)||(d=!0);return n[s]=Nc.Visited,c.pop(),t.unshift(s),!d}for(const s in e)n[s]===Nc.NotVisited&&o(s,[]);return{sorted:t,cycles:r}}function Mk(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Na(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else Mk(r,t)}}function mF(e){const t={};for(const n of e.entry??yr)n.fullUrl&&(t[n.fullUrl]=[]);for(const n of e.entry??yr){const r=n.fullUrl;n.resource&&Mk(n.resource,o=>{t[o]&&t[o].push(r)})}return t}const tn={CSS:"text/css",DICOM:"application/dicom",FAVICON:"image/vnd.microsoft.icon",FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",HTML:"text/html",JAVASCRIPT:"text/javascript",JSON:"application/json",JSON_PATCH:"application/json-patch+json",JWT:"application/jwt",MULTIPART_FORM_DATA:"multipart/form-data",PNG:"image/png",SCIM_JSON:"application/scim+json",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml",OCTET_STREAM:"application/octet-stream"};let gF=class{listeners;constructor(){this.listeners={}}addEventListener(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}removeEventListener(t,n){const r=this.listeners[t];if(r){for(let o=0;o<r.length;o++)if(r[o]===n){r.splice(o,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];for(const r of n??yr)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}listenerCount(t){return this.listeners[t]?.length??0}};class Xm{emitter=new gF;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()}listenerCount(t){return this.emitter.listenerCount(t)}}const Kx={"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"},vF=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],ES=["DiagnosticReport-update"];function yF(e){return ES.includes(e)}function xF(e){if(ES.includes(e))throw new ht(jn(`'context.version' is required for '${e}'.`))}const bF={"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 SF(e){return vF.includes(e)}function Lk(e){return!!e.endpoint}function QT(e){if(!TS(e))throw new ht(jn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,s={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return Lk(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function TS(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:o}=e;if(!(t&&n&&r&&o)||typeof r!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const s of o)if(!Kx[s])return!1;return!(Lk(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function wF(e,t,n,r){if(typeof t!="object")throw new ht(jn(`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 ht(jn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new ht(jn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!SF(t.resourceType))throw new ht(jn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new ht(jn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function jF(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),r.reference){if(!Na(t.reference))throw new ht(jn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else wF(e,t.resource,n,r)}function CF(e,t){const n=new Map,r=bF[e];for(let o=0;o<t.length;o++){const s=t[o].key;if(!r[s])throw new ht(jn(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));jF(e,t[o],o,r[s],n)}for(const[o,s]of Object.entries(r)){if(!(s.optional||n.has(o)))throw new ht(jn(`Missing required key '${o}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(o)??0)>1)throw new ht(jn(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function WT(e,t,n,r){if(!(e&&typeof e=="string"))throw new ht(jn("Must provide a topic."));if(!Kx[t])throw new ht(jn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Kx).join(", ")}`));if(typeof n!="object")throw new ht(jn("context must be a context object or array of context objects."));if(ES.includes(t)&&!r)throw new ht(jn(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return CF(t,o),{timestamp:new Date().toISOString(),id:Nk(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class EF extends Xm{subRequest;websocket;constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new ht(jn("Subscription request should contain an endpoint."));if(!TS(t))throw new ht(jn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const o=JSON.parse(r.data);if(o["hub.topic"])return;const s=o;s.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:s}),n.send(JSON.stringify({id:o?.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function TF(e){return JSON.parse(uF(e))}function RF(e){return e.split(".").length===3}function RS(e){const[t,n,r]=e.split(".");return TF(n)}function _F(e){try{return typeof RS(e).login_id=="string"}catch{return!1}}function DF(e){try{const n=RS(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class AF{medplum;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,tn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}class Ji{[Symbol.toStringTag]="ReadablePromise";suspender;status="pending";response;error;constructor(t){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 kF{storage;prefix="";constructor(t,n=""){this.storage=t??globalThis.localStorage??new PF,this.prefix=n}makeKey(t){return this.prefix+t}clear(){this.storage===globalThis.localStorage&&this.prefix?Object.keys(this.storage).filter(t=>t.startsWith(this.prefix)).forEach(t=>{this.storage.removeItem(t)}):this.storage.clear()}getString(t){return this.storage.getItem(this.makeKey(t))??void 0}setString(t,n){n?this.storage.setItem(this.makeKey(t),n):this.storage.removeItem(this.makeKey(t))}getObject(t){const n=this.getString(t);return n?JSON.parse(n):void 0}setObject(t,n){this.setString(t,n?ao(n):void 0)}}class PF{data;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]}}const qc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let YT=!1;function NF(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");qc.Event=globalThis.Event,qc.ErrorEvent=class extends Event{message;error;constructor(t,n){super("error",n),this.message=t.message,this.error=t}},qc.CloseEvent=class extends Event{code;reason;wasClean=!0;constructor(t=1e3,n="",r){super("close",r),this.code=t,this.reason=n}}}function OF(e,t){if(!e)throw new Error(t)}function op(e){return new e.constructor(e.type,e)}const tl={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let KT=!1;class ds extends Xm{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=!0;_connectLock=!1;_binaryType;_closeCalled=!1;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(t,n,r={}){YT||(NF(),YT=!0),super(),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 ds.CONNECTING}get OPEN(){return ds.OPEN}get CLOSING(){return ds.CLOSING}get CLOSED(){return ds.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((n,r)=>(typeof r=="string"?n+=r.length:r instanceof Blob?n+=r.size:n+=r.byteLength,n),0)+(this._ws?.bufferedAmount??0)}get extensions(){return this._ws?.extensions??""}get protocol(){return this._ws?.protocol??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?ds.CLOSED:ds.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;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?.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=tl.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=tl.reconnectionDelayGrowFactor,minReconnectionDelay:n=tl.minReconnectionDelay,maxReconnectionDelay:r=tl.maxReconnectionDelay}=this._options;let o=0;return this._retryCount>0&&(o=n*Math.pow(t,this._retryCount-1),o>r&&(o=r)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=tl.maxRetries,connectionTimeout:n=tl.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"&&!KT&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),KT=!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 qc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new qc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new qc.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");const{minUptime:n=tl.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),n),OF(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(r=>this._ws?.send(r)),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(op(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(op(t))};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(op(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(op(t))};_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 MF=5e3;class Xx extends Xm{criteria;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 LF{criteria;emitter;refCount;subscriptionProps;subscriptionId;token;connecting=!1;constructor(t,n){this.criteria=t,this.emitter=new Xx(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class IF{medplum;ws;masterSubEmitter;criteriaEntries;criteriaEntriesBySubscriptionId;wsClosed;pingTimer=void 0;pingIntervalMs;waitingForPong=!1;currentProfile;constructor(t,n,r){if(!(t instanceof zk))throw new ht(jn("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new ht(jn("Not a valid URL"))}const s=r?.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger}):new ds(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new Xx,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=r?.pingIntervalMs??MF,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{try{const r=JSON.parse(n.data);if(r.type==="pong"){this.waitingForPong=!1;return}const o=r,s=o?.entry?.[0]?.resource;if(s.type==="heartbeat"){this.masterSubEmitter?.dispatchEvent({type:"heartbeat",payload:o});return}if(s.type==="handshake"){const d=Sl(s.subscription),f={type:"connect",payload:{subscriptionId:d}};this.masterSubEmitter?.dispatchEvent(f);const p=this.criteriaEntriesBySubscriptionId.get(d);if(!p){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}p.connecting=!1,p.emitter.dispatchEvent({...f});return}this.masterSubEmitter?.dispatchEvent({type:"message",payload:o});const c=this.criteriaEntriesBySubscriptionId.get(Sl(s.subscription));if(!c){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}c.emitter.dispatchEvent({type:"message",payload:o})}catch(r){console.error(r);const o={type:"error",payload:r};this.masterSubEmitter?.dispatchEvent(o);for(const s of this.getAllCriteriaEmitters())s.dispatchEvent({...o})}}),t.addEventListener("error",()=>{const n={type:"error",payload:new ht(Y8(new Error("WebSocket error")))};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n})}),t.addEventListener("close",()=>{const n={type:"close"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),this.masterSubEmitter?.removeAllListeners())}),t.addEventListener("open",()=>{const n={type:"open"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n});this.refreshAllSubscriptions().catch(console.error),this.pingTimer||(this.pingTimer=setInterval(()=>{if(this.waitingForPong){this.waitingForPong=!1,t.reconnect();return}t.send(JSON.stringify({type:"ping"})),this.waitingForPong=!0},this.pingIntervalMs))}),this.medplum.addEventListener("change",()=>{const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&this.currentProfile?.id!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){const r={type:"error",payload:n};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){const{subscriptionId:n}=t;if(n){const r={type:"disconnect",payload:{subscriptionId:n}};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){let n=t?.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${It(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),o=r?.find(c=>c.name==="token")?.valueString,s=r?.find(c=>c.name==="websocket-url")?.valueUrl;if(!o)throw new ht(jn("Failed to get token"));if(!s)throw new ht(jn("Failed to get URL from $get-ws-binding-token"));return[n,o]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const o of r.criteriaWithProps)if(Lo(n,o.subscriptionProps))return o}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let o;this.criteriaEntries.has(n)?o=this.criteriaEntries.get(n):(o={criteriaWithProps:[]},this.criteriaEntries.set(n,o)),r?o.criteriaWithProps.push(t):o.bareCriteria=t}removeCriteriaEntry(t){const{criteria:n,subscriptionProps:r,subscriptionId:o,token:s}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(d=>{const f=d.subscriptionProps;return!Lo(r,f)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),this.masterSubEmitter?._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),s&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:s}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Qe(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const o=new LF(t,n);return this.addCriteriaEntry(o),this.subscribeToCriteria(o).catch(console.error),o.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}getWebSocket(){return this.ws}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}reconnectWebSocket(){this.ws.reconnect(),this.wsClosed=!1}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new Xx(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const Ik="5.0.11-9f75df8",zF=tn.FHIR_JSON+", */*; q=0.1",$F="https://api.medplum.com/",UF=1e3,BF=6e4,VF=0,FF=3e5,HF="Binary/",XT={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},Oc={ClientCredentials:"client_credentials",AuthorizationCode:"authorization_code",RefreshToken:"refresh_token",JwtBearer:"urn:ietf:params:oauth:grant-type:jwt-bearer",TokenExchange:"urn:ietf:params:oauth:grant-type:token-exchange"},qF={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},GF={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class zk extends Xm{options;fetch;createPdfImpl;storage;requestCache;cacheTime;baseUrl;fhirBaseUrl;authorizeUrl;tokenUrl;logoutUrl;fhircastHubUrl;defaultHeaders;onUnauthenticated;autoBatchTime;autoBatchQueue;refreshGracePeriod;subscriptionManager;medplumServer;clientId;clientSecret;credentialsInHeader;autoBatchTimerId;accessToken;accessTokenExpires;refreshToken;refreshPromise;profilePromise;sessionDetails;currentRateLimits;basicAuth;initPromise;initComplete=!0;keyValueClient;logLevel;constructor(t){if(super(),t?.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=t?.fetch??QF(),this.storage=t?.storage??new kF(void 0,t?.storagePrefix),this.createPdfImpl=t?.createPdf,this.baseUrl=gS(t?.baseUrl??$F),this.fhirBaseUrl=So(this.baseUrl,t?.fhirUrlPath??"fhir/R4"),this.authorizeUrl=So(this.baseUrl,t?.authorizeUrl??"oauth2/authorize"),this.tokenUrl=So(this.baseUrl,t?.tokenUrl??"oauth2/token"),this.logoutUrl=So(this.baseUrl,t?.logoutUrl??"oauth2/logout"),this.fhircastHubUrl=So(this.baseUrl,t?.fhircastHubUrl??"fhircast/STU3"),this.clientId=t?.clientId??"",this.clientSecret=t?.clientSecret??"",this.credentialsInHeader=t?.authCredentialsMethod==="header",this.defaultHeaders=t?.defaultHeaders??{},this.onUnauthenticated=t?.onUnauthenticated,this.refreshGracePeriod=t?.refreshGracePeriod??FF,this.logLevel=this.initializeLogLevel(t),this.cacheTime=t?.cacheTime??(jo()?BF:VF),this.cacheTime>0?this.requestCache=new WA(t?.resourceCacheSize??UF):this.requestCache=void 0,t?.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t?.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t?.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initPromise=Promise.resolve(),this.dispatchEvent({type:"storageInitialized"})):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t?.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0,this.dispatchEvent({type:"storageInitialized"})}).catch(n=>{console.error(n),this.initComplete=!0,this.dispatchEvent({type:"storageInitFailed",payload:{error:n}})})),this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}initializeLogLevel(t){return t?.logLevel?t.logLevel:t?.verbose!==void 0&&t.verbose?"verbose":"none"}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(),jo()&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){this.storage.setString("activeLogin",void 0),this.requestCache?.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.refreshPromise=void 0,this.accessTokenExpires=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){t=t.toString(),this.requestCache?.delete(t)}invalidateAll(){this.requestCache?.clear()}invalidateSearches(t){const n=So(this.fhirBaseUrl,t);for(const r of this.requestCache?.keys()??yr)(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache?.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?o=new Promise((c,d)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:d}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const s=new Ji(o);return this.setCacheEntry(t,s,n),s}post(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("POST",t,o)}put(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,tn.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:o},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(er.getSearch()).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){er.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,o,s=!0){let c=o;s&&(c=await this.ensureCodeChallenge(o)),er.assign(this.getExternalAuthRedirectUri(t,n,r,c,s))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:Oc.TokenExchange,subject_token_type:qF.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,o,s=!0){const c=new URL(t);if(c.searchParams.set("response_type","code"),c.searchParams.set("client_id",n),c.searchParams.set("redirect_uri",r),c.searchParams.set("scope",o.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(o)),s){const{codeChallenge:d,codeChallengeMethod:f}=o;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!d)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",d)}return c.toString()}fhirUrl(...t){return new URL(So(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=$B(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),s="search-"+o.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=this.getBundle(o,r);return this.setCacheEntry(s,d,r),d}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const s="searchOne-"+o.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=new Ji(this.search(t,o.searchParams,r).then(f=>f.entry?.[0]?.resource));return this.setCacheEntry(s,d,r),d}searchResources(t,n,r){const s="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=new Ji(this.search(t,n,r).then(ZT));return this.setCacheEntry(s,d,r),d}async*searchResourcePages(t,n,r){let o=this.fhirSearchUrl(t,n);for(;o;){const s=new URL(o).searchParams;s.has("_count")||s.set("_count","1000");const c=await this.search(t,s,r),d=c.link?.find(f=>f.relation==="next");if(!c.entry?.length&&!d)break;yield ZT(c),o=d?.url?new URL(d.url):void 0}}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){const r=this.requestCache?.get(this.fhirUrl(t,n).toString())?.value;return r?.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return XT;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}readResource(t,n,r){if(!n)throw new Error('The "id" parameter cannot be null, undefined, or an empty string.');return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new Ji(Promise.reject(new Error("Missing reference")));if(r==="system")return new Ji(Promise.resolve(XT));const[o,s]=r.split("/");return!o||!s?new Ji(Promise.reject(new Error("Invalid reference"))):this.readResource(o,s,n)}readCanonical(t,n,r){return Array.isArray(t)?this.searchOne("",{_type:t.join(","),url:n},r):this.searchOne(t,"url="+n,r)}requestSchema(t,n){if(tk(t))return Promise.resolve();const r=t+"-requestSchema",o=this.getCacheEntry(r,void 0);if(o)return o.value;const s=new Ji((async()=>{const c=`{
|
|
57
|
-
StructureDefinitionList(_filter: "name eq ${t}") {
|
|
58
|
-
resourceType,
|
|
59
|
-
name,
|
|
60
|
-
kind,
|
|
61
|
-
description,
|
|
62
|
-
type,
|
|
63
|
-
url,
|
|
64
|
-
snapshot {
|
|
65
|
-
element {
|
|
66
|
-
id,
|
|
67
|
-
path,
|
|
68
|
-
definition,
|
|
69
|
-
min,
|
|
70
|
-
max,
|
|
71
|
-
base {
|
|
72
|
-
path,
|
|
73
|
-
min,
|
|
74
|
-
max
|
|
75
|
-
},
|
|
76
|
-
contentReference,
|
|
77
|
-
type {
|
|
78
|
-
code,
|
|
79
|
-
profile,
|
|
80
|
-
targetProfile
|
|
81
|
-
},
|
|
82
|
-
binding {
|
|
83
|
-
strength,
|
|
84
|
-
valueSet
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
SearchParameterList(base: "${t}", _count: 100) {
|
|
90
|
-
base,
|
|
91
|
-
code,
|
|
92
|
-
type,
|
|
93
|
-
expression,
|
|
94
|
-
target
|
|
95
|
-
}
|
|
96
|
-
}`.replaceAll(/\s+/g," "),d=await this.graphql(c);NT(d.data.StructureDefinitionList);for(const f of d.data.SearchParameterList)YB(f)})());return this.setCacheEntry(r,s,n),s}requestProfileSchema(t,n){if(!n?.expandProfile&&uS(t))return Promise.resolve();const r=t+"-requestSchema"+(n?.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const s=new Ji((async()=>{if(n?.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const d=await this.post(c.toString(),{});NT(d)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}ek(c)}})());return this.setCacheEntry(r,s,n),s}readHistory(t,n,r,o){const s=this.fhirUrl(t,n,"_history");return r?.count&&s.searchParams.set("_count",r.count.toString()),r?.offset&&s.searchParams.set("_offset",r.offset.toString()),this.get(s.toString(),o)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}readPatientEverything(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$everything"),n)}readPatientSummary(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$summary"),n)}createResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,n)}async createResourceIfNoneExist(t,n,r={}){const o=this.fhirUrl(t.resourceType);this.setRequestHeader(r,"If-None-Exist",n);const s=await this.post(o,t,void 0,r);return this.cacheResource(s,r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async upsertResource(t,n,r){const o=this.fhirSearchUrl(t.resourceType,n);let s=await this.put(o,t,void 0,r);return s||(s=t),this.cacheResource(s,r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async createAttachment(t,n,r,o,s){let c=eR(t,n,r,o);if(c.contentType===tn.XML){const p=c.data;let m;p instanceof Blob?m=await new Promise((g,y)=>{const x=new FileReader;x.onload=()=>{if(!x.result){y(new Error("Failed to load file"));return}g(x.result)},x.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:tn.CDA_XML})}const d=s??(typeof n=="object"?n:{}),f=await this.createBinary(c,d);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,o,s){const c=eR(t,n,r,o),d=s??(typeof n=="object"?n:{}),{data:f,contentType:p,filename:m,securityContext:g,onProgress:y}=c,x=this.fhirUrl("Binary");return m&&x.searchParams.set("_filename",m),g?.reference&&this.setRequestHeader(d,"X-Security-Context",g.reference),y?this.uploadwithProgress(x,f,p,y,d):this.post(x,f,p,d)}uploadwithProgress(t,n,r,o,s){return new Promise((c,d)=>{const f=new XMLHttpRequest,p=()=>f.abort();s?.signal?.addEventListener("abort",p);const m=g=>{s?.signal?.removeEventListener("abort",p),g instanceof Error?d(g):c(g)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),o&&(f.upload.onprogress=g=>o(g),f.upload.onload=g=>o(g)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new ht(Qt(f.response||f.statusText)))},f.open("POST",t),f.withCredentials=!0,f.setRequestHeader("Authorization","Bearer "+this.accessToken),f.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),f.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&f.setRequestHeader("X-Medplum","extended"),s?.headers){const g=s.headers;for(const[y,x]of Object.entries(g))f.setRequestHeader(y,x)}f.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const s=KF(t,n,r,o),c=typeof n=="object"?n:{},{docDefinition:d,tableLayouts:f,fonts:p,...m}=s,g=await this.createPdfImpl(d,f,p),y={...m,data:g,contentType:"application/pdf"};return this.createBinary(y,c)}createComment(t,n,r){const o=this.getProfile();let s,c;return t.resourceType==="Encounter"&&(s=Yt(t),c=t.subject),t.resourceType==="ServiceRequest"&&(s=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=Yt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Yt(t)],encounter:s,subject:c,sender:o?Yt(o):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r,n),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,o){const s=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(s,o),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),s}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,o){let s;if(typeof t=="string"){const c=t;s=this.fhirUrl("Bot",c,"$execute")}else{const c=t;s=this.fhirUrl("Bot","$execute"),s.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(s,n,r,o)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,tn.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},tn.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,s,c){const{waitTimeout:d,...f}=c??{};return this.post(this.fhirUrl("Agent",Sl(t),"$push"),{destination:typeof n=="string"?n:It(n),body:r,contentType:o,waitForResponse:s,...d!==void 0?{waitTimeout:d}:void 0},tn.FHIR_JSON,f)}getCdsServices(t){return this.get("/cds-services",t)}callCdsService(t,n,r){return this.post(`/cds-services/${t}`,n,tn.JSON,r)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){(!this.sessionDetails?.profile||It(this.sessionDetails.profile)!==t.profile?.reference)&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}isAuthenticated(t){return this.accessTokenExpires!==void 0&&Date.now()<this.accessTokenExpires-(t??this.refreshGracePeriod)}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=DF(t),this.medplumServer=_F(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>r.profile?.reference!==t.profile?.reference);n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){if(this.medplumServer)return this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{this.profilePromise=void 0;const o=this.sessionDetails?.profile?.id!==r.profile.id;this.sessionDetails=r,o&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise}isLoading(){return!this.isInitialized||!!this.profilePromise&&!this.sessionDetails?.profile}isSuperAdmin(){return!!this.sessionDetails?.project.superAdmin}isProjectAdmin(){return!!this.sessionDetails?.membership.admin}getProject(){return this.sessionDetails?.project}getProjectMembership(){return this.sessionDetails?.membership}getProfile(){return this.sessionDetails?.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){return this.sessionDetails?.config}getAccessPolicy(){return this.sessionDetails?.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(HF)&&(t=this.fhirUrl(r));let o=n.headers;return o||(o={},n.headers=o),o.Accept||(o.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...o}=t,s=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=Yt(s));const c=await this.createAttachment(o,n);return this.updateResource({...s,status:"completed",content:c})}async uploadMedia(t,n,r,o,s){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},s)}async createDocumentReference(t,n){const{additionalFields:r,...o}=t,s=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});o.securityContext||(o.securityContext=Yt(s));const c=await this.createAttachment(o,n);return this.updateResource({...s,content:[{attachment:c}]})}async bulkExport(t="",n,r,o){const s=t&&`${t}/`,c=this.fhirUrl(`${s}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),o)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;return r.Prefer="respond-async",this.request("POST",t,n)}get keyValue(){return this.keyValueClient||(this.keyValueClient=new AF(this)),this.keyValueClient}getBundle(t,n){return new Ji((async()=>{const r=await this.get(t,n);for(const o of r.entry??yr)this.cacheResource(o.resource,n);return r})())}isCacheEnabled(t){return!!this.requestCache&&!this.getRequestHeader(t,"x-medplum-on-behalf-of")}getCacheEntry(t,n){if(!this.isCacheEnabled(n)||n?.cache==="no-cache"||n?.cache==="reload")return;const r=this.requestCache.get(t);if(!(!r||r.requestTime+this.cacheTime<Date.now()))return r}setCacheEntry(t,n,r){this.isCacheEnabled(r)&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t,n){t?.id&&!t.meta?.tag?.some(r=>r.code==="SUBSETTED")&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Ji(Promise.resolve(t)),n)}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},o={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const s=await this.fetchWithRetry(n,r);if(s.status===401)return this.handleUnauthenticated(t,n,r);if(s.status===204||s.status===304)return;const d=s.headers.get("content-type")?.includes("json");if(s.status===404&&!d)throw new ht(Q8);const f=await this.parseBody(s,d);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const p=await JT(s,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const m=await JT(s,f)??o.statusUrl;if(m)return this.pollStatus(m,r,o)}if(s.status>=400)throw new ht(Qt(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(o){throw console.error("Error parsing response",t.status,o),o}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=So(this.baseUrl,t));const r=n?.maxRetries??2;for(let o=0;o<=r;o++)try{this.logLevel!=="none"&&this.logRequest(t,n);const s=await this.fetch(t,n);if(this.logLevel!=="none"&&this.logResponse(s),this.setCurrentRateLimit(s),o>=r||!XF(s))return s;const c=this.getRetryDelay(o),d=n.maxRetryTime??2e3;if(c>d)return s;await UT(c,{signal:n.signal})}catch(s){if(s.message==="Failed to fetch"&&o===0&&this.dispatchEvent({type:"offline"}),s.name==="AbortError"||o===r)throw s}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),this.logLevel==="verbose"&&n.headers){const r=n.headers;for(const o of nu(Object.keys(r)))console.log(`> ${o}: ${r[o]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),this.logLevel==="verbose"&&t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){if(!t?.headers||typeof t.headers.get!="function")return;const n=t.headers.get("ratelimit");n&&(this.currentRateLimits=n)}rateLimitStatus(){if(!this.currentRateLimits)return[];const t=this.currentRateLimits;return t.split(",").map(n=>{const r=n.split(";").map(p=>p.trim());if(r.length!==3)throw new Error("Could not parse RateLimit header: "+t);const o=r[0].substring(1,r[0].length-1),s=r.find(p=>p.startsWith("r="))?.substring(2),c=s?Number.parseInt(s,10):Number.NaN,d=r.find(p=>p.startsWith("t="))?.substring(2),f=d?Number.parseInt(d,10):Number.NaN;if(!o||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:o,remainingUnits:c,secondsUntilReset:f,resetsAfter:Math.ceil((Date.now()+1e3*f)/1e3)}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const o of n)o.remainingUnits||(r=Math.max(r,o.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const o={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(o.headers={...n.headers},delete o.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const s=n.pollStatusPeriod??1e3;await UT(s,{signal:n.signal}),r.pollCount++}return this.request("GET",t,o,r)}async executeAutoBatch(){if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const o=t[0];try{o.resolve(await this.request(o.method,So(this.fhirBaseUrl,o.url),o.options))}catch(s){o.reject(new ht(Qt(s)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(o=>({request:{method:o.method,url:o.url},resource:o.options.body?JSON.parse(o.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let o=0;o<t.length;o++){const s=t[o],c=r.entry?.[o];c?.response?.outcome&&!KA(c.response.outcome)?s.reject(new ht(c.response.outcome)):s.resolve(c?.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",zF,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",tn.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)}getRequestHeader(t,n){const r=t?.headers;if(r)if(Array.isArray(r)){const o=r.find(([s])=>s.toLowerCase()===n.toLowerCase());return o?o[1]:void 0}else{if(r instanceof Headers)return r.get(n)??void 0;if(lr(r))return r[n]??void 0}else return}setRequestHeader(t,n,r,o=!1){const s=t.headers;s?Array.isArray(s)?(!o||!s.some(([c])=>c.toLowerCase()===n.toLowerCase()))&&s.push([n,r]):s instanceof Headers?(!o||!s.has(n))&&s.set(n,r):lr(s)&&(!o||!s[n])&&(s[n]=r):t.headers={[n]:r}}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||n?.constructor.name==="Blob")||typeof File<"u"&&(n instanceof File||n?.constructor.name==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||n?.constructor.name==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}async handleUnauthenticated(t,n,r){if(this.refresh())return this.request(t,n,r);throw this.clear(),this.onUnauthenticated?.(),new ht(Id)}async startPkce(){const t=GT();sessionStorage.setItem("pkceState",t);const n=GT().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await dF(n);return{codeChallengeMethod:"S256",codeChallenge:NB(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}}catch(r){return console.warn("Failed to hash code verifier. Falling back to 'plain' code challenge method",r),{codeChallengeMethod:"plain",codeChallenge:n}}}async requestAuthorization(t){const n=await this.ensureCodeChallenge(t??{}),r=new URL(this.authorizeUrl);r.searchParams.set("response_type","code"),r.searchParams.set("state",sessionStorage.getItem("pkceState")),r.searchParams.set("client_id",n.clientId??this.clientId),r.searchParams.set("redirect_uri",n.redirectUri??er.getOrigin()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),er.assign(r.toString())}processCode(t,n){const r={grant_type:Oc.AuthorizationCode,code:t,client_id:n?.clientId??this.clientId??"",redirect_uri:n?.redirectUri??er.getOrigin()};if(typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&(r.code_verifier=o)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken)return this.refreshPromise=this.fetchTokens({grant_type:Oc.RefreshToken,client_id:this.clientId??"",refresh_token:this.refreshToken}),this.refreshPromise;if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){return this.clientId=t,this.clientSecret=n,this.fetchTokens({grant_type:Oc.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:Oc.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:Oc.ClientCredentials,client_assertion_type:GF.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=qT(t+":"+n)}setLogLevel(t){this.logLevel=t,this.options.verbose=t==="verbose"}getLogLevel(){return this.logLevel}setVerbose(t){this.logLevel=t?"verbose":"none",this.options.verbose=t}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new ht(jn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new ht(jn("Invalid events provided. Events must be an array of event names containing at least one event."));const r={channelType:"websocket",mode:"subscribe",topic:t,events:n},s=(await this.post(this.fhircastHubUrl,QT(r),tn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!TS(t))throw new ht(jn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new ht(jn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,QT(t),tn.FORM_URL_ENCODED)}fhircastConnect(t){return new EF(t)}async fhircastPublish(t,n,r,o){return yF(n)?this.post(this.fhircastHubUrl,WT(t,n,r,o),tn.JSON):(xF(n),this.post(this.fhircastHubUrl,WT(t,n,r),tn.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 handleTokenError(t){try{const n=await t.json();throw yf(n)?new ht(n):n.error_description?new ht(Ao(n.error_description)):new Error(JSON.stringify(n))}catch(n){throw n instanceof ht?(n.message=`Failed to fetch tokens: ${n.message}`,n):new ht(Ao("Failed to fetch tokens"),{cause:n})}}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":tn.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 ${qT(t.client_id+":"+t.client_secret)}`));const o={method:"POST",headers:r,body:n.toString(),credentials:"include"};let s;try{s=await this.fetchWithRetry(this.tokenUrl,o)}catch(d){throw this.refreshPromise=void 0,d}s.ok||(this.clearActiveLogin(),this.onUnauthenticated?.(),await this.handleTokenError(s));const c=await s.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(RF(n)){const r=RS(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new ht(W8);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new ht(kT)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new ht(kT)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){return this.sessionDetails&&t?t.profile?.reference?.endsWith(this.sessionDetails.profile.id)??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)er.reload();else if(t.key===this.storage.makeKey("activeLogin")){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;n?.profile.reference!==r?.profile.reference||!this.checkSessionDetailsMatchLogin(r)?er.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new IF(this,zB(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 QF(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}async function JT(e,t){const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(yf(t)&&t.issue?.[0]?.diagnostics)return t.issue[0].diagnostics}function ZT(e){const t=e.entry?.map(n=>n.resource)??[];return Object.assign(t,{bundle:e})}function WF(e){return lr(e)&&"data"in e&&"contentType"in e}function eR(e,t,n,r){return WF(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function YF(e){return lr(e)&&"docDefinition"in e}function KF(e,t,n,r){return YF(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function XF(e){return e.status===429||e.status>=500}function ru({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:s}){if(t===e?.path)return;o??=e?.debugMode??!1,s??=e?.accessPolicyResource;let c=JF(t,n,e,!!o);const d=Yx(t,".",2)[1];c=ZF(c,s,d),c=eH(c,s,d);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const m=Object.create(null);p=g=>{const y=Yx(g,".",2)[1];if(y){if(!m[y]){const x=Vp(y,s?.hiddenFields);m[y]={hidden:x,readonly:x||Vp(y,s?.readonlyFields)}}return m[y]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??e?.profileUrl,debugMode:o,getExtendedProps:p,accessPolicyResource:s}}function JF(e,t,n,r){const o=Object.create(null);if(n)for(const[c,d]of Object.entries(n.elementsByPath)){const f=dl(e,c);f!==void 0&&(o[f]=d)}let s=!1;if(t)for(const[c,d]of Object.entries(t))c in o||(o[c]=d,s=!0);return r&&console.assert(s,"Unnecessary ElementsContext; not using any newly provided elements"),o}function ZF(e,t,n){if(!t?.hiddenFields?.length)return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!Vp(r+o,t.hiddenFields)))}function eH(e,t,n){if(!t?.readonlyFields?.length)return e;const r=Object.create(null),o=n?n+".":"";for(const[s,c]of Object.entries(e))Vp(o+s,t.readonlyFields)?r[s]={...c,readonly:!0}:r[s]=c;return r}function Vp(e,t){if(!t?.length)return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const o=n.slice(0,r).join(".");if(t.includes(o))return!0}return!1}function $k(e){return e.type!==void 0&&e.type.length>0}function tH(e,t,n,r){const o=dB(e,t.path,{profileUrl:r});if(o){const s=n.typeSchema?.elements??n.elements;return o.some(c=>hB(c,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function Uk(e,t,n,r){if(e)for(const o of t){const s={value:e,type:o.typeSchema?.type??o.type?.[0].code};if(n.every(c=>tH(s,c,o,o.typeSchema?.url??r)))return o.name}}class nH{rootSchema;visitor;elementsContextStack;sliceAllowList;constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=ru({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(o===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[o],this.visitor=n}get elementsContext(){return this.elementsContextStack.at(-1)}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const o=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([s])=>s.startsWith(n)));this.crawlElementsImpl(o,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const o=this.prepareSlices(r.slices,r);if(!Mn(o.slices))throw new Error(`cannot crawl slice ${n.name} since it has no type information`);this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.sliceAllowList=[n],this.crawlSliceImpl(o.slices[0],n.path,o),this.sliceAllowList=void 0,this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlResource(){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.crawlElementsImpl(this.rootSchema.elements,this.rootSchema.type),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlElementsImpl(t,n){const r=rH(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const o of t.children)this.crawlElementNode(o,n);Mn(t.element?.slicing?.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){const r=[];for(const s of t){if(!$k(s))continue;const c=s.type.find(d=>Mn(d.profile))?.profile?.[0];if(Mn(c)){const d=vu(c);d&&(s.typeSchema=d)}r.push(s)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const o of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(o))&&this.crawlSliceImpl(o,n,r)}crawlSliceImpl(t,n,r){const o=t.typeSchema;o&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(o),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let s;const c=o?.elements??t.elements;Mn(c)&&(s=ru({path:n,parentContext:this.elementsContext,elements:c})),s&&this.elementsContextStack.push(s),this.crawlElementsImpl(c,n),s&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function rH(e){const t=[];function n(s,c){return c.startsWith(s+".")}function r(s,c){for(const d of s.children)if(n(d.key,c.key)){r(d,c);return}s.children.push(c)}const o=Object.entries(e);o.sort((s,c)=>s[0].localeCompare(c[0]));for(const[s,c]of o){const d={key:s,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,s)){r(p,d),f=!0;break}f||t.push(d)}return t}const rx="__sliceName";function iH(e,t){const n=new oH(e,e.resourceType,"resource");return new nH(t,n).crawlResource(),n.getDefaultValue()}function tR(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Fp(e,r,o,t);continue}const s=dl(n,r);s!==void 0&&Fp(e,s,o,t)}return e}class oH{rootValue;schemaStack;valueStack;constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=mi(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack.at(-1)}get value(){return this.valueStack.at(-1)}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const o=this.value.values,s=this.value.path,c=dl(s,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${s}`);const d=[];for(const f of o){if(f===void 0)continue;const p=dl(r.path,s),m=Array.isArray(f)?f:[f];for(const g of m){aH(g,c,n,r.elements,p),Fp(g,c,n,r.elements);const y=Zx(g,c,r.elements,p);y!==void 0&&d.push(y)}}this.valueStack.push({type:"element",path:t,values:d})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const s=dl(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=dl(r.path,this.value.path);for(const d of this.value.values){const f=Zx(d,s,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];Mn(m)||f.splice(p,1)}Cn(f)&&Jx(d,void 0,s,n)}}onEnterSlice(t,n,r){const o=this.value.values,s=[];for(const c of o)if(c!==void 0){const d=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(d,n,r);s.push(f)}this.valueStack.push({type:"slice",path:t,values:s})}getMatchingSliceValues(t,n,r){const o=[];for(const s of t)(s[rx]??Uk(s,[n],r.discriminator,this.schema.url))===n.name&&o.push(s);for(let s=o.length;s<n.min;s++)if(mS(n.type[0].code)){const c=Object.create(null);o.push(c),t.push(c)}return o}onExitSlice(){const t=this.valueStack.pop();if(!t)throw new Error("Expected value context to exist in onExitSlice");for(const n of t.values)for(let r=n.length-1;r>=0;r--){const o=n[r];rx in o&&delete o[rx]}}getDefaultValue(){return this.rootValue}}function aH(e,t,n,r,o){const s=Zx(e,t,r,o);n.min>0&&s===void 0&&mS(n.type[0].code)&&(n.isArray?Jx(e,[Object.create(null)],t,n):Jx(e,Object.create(null),t,n))}function Jx(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const s=r.type[0].code;o=n.replace("[x]",Wn(s))}t===void 0?delete e[o]:e[o]=t}function Zx(e,t,n,r){const o=t.split(".");let s=e,c;for(let d=0;d<o.length;d++){let f=o[d];if(f.includes("[x]")){const p=(r?r+".":"")+o.slice(0,d+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",Wn(g))}if(d===o.length-1){Array.isArray(s)?c=s.map(p=>p[f]):c=s[f];continue}if(Array.isArray(s))s=s.map(p=>p[f]);else if(lr(s)){if(s[f]===void 0)return;s=s[f]}else return}return c}function Fp(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(d=>Fp(d,t,n,r));e==null&&(e=Object.create(null));const o=e,s=t.split(".");let c=o;for(let d=0;d<s.length;d++){let f=s[d];if(f.includes("[x]")){const m=r[s.slice(0,d+1).join(".")].type[0].code;f=f.replace("[x]",Wn(m))}if(d===s.length-1){const p=Array.isArray(c)?c:[c];for(const m of p)n.fixed?m[f]??=n.fixed.value:n.pattern&&(m[f]=Bk(m[f],n.pattern.value))}else{if(!(f in c)){const p=s.slice(0,d+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return o}function Bk(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return(e?.length??0)>0?e:mi(t);if(lr(t)&&(lr(e)&&!Array.isArray(e)||e===void 0)){const n=mi(e)??Object.create(null);for(const r of Object.keys(t))n[r]=Bk(n[r],t[r]);return n}return e}function sH(e){return e.match(/^\((.+)\)\.identifier$/)?.[1]}function lH(e,t){return new yS(e,new Qm(t,new Vd("identifier")))}const jr={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Jm(e,t){let n=Io.types[e]?.searchParamsDetails?.[t.code];return n||(n=uH(e,t)),n}function cH(e,t,n){let r=Io.types[e];r||(r={},Io.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function uH(e,t){const n=t.code,r=t.expression,o=pH(e,r),s={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const f of o){const p=jp(f),m=LB(()=>p.join("."));p.length===1&&p[0]instanceof ei?s.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?s.propertyTypes.add("Identifier"):m().endsWith("extension.value.code")||m().endsWith("extension.value.coding.code")?(s.array=!0,s.propertyTypes.clear(),s.propertyTypes.add("code")):Vk(s,p,e,1),m().endsWith("extension.valueDateTime")&&(s.array=!1,s.propertyTypes.clear(),s.propertyTypes.add("dateTime"))}let c;if(t.code.endsWith(":identifier")){const f=sH(r);if(f===void 0)throw new Error(`Unexpected expression for derived identifier search parameter: ${r}`);const p=nR(e,f);c=lH(r,p)}else c=nR(e,r);const d={type:hH(t,s.propertyTypes),elementDefinitions:s.elementDefinitions.map(f=>({...f,type:f.type?.filter(p=>s.propertyTypes.has(p.code))})).filter(f=>f.type&&f.type.length>0),parsedExpression:c,array:s.array};return cH(e,n,d),d}function Vk(e,t,n,r){const o=t[r];if(o instanceof Bp){e.propertyTypes.add(o.right.toString());return}if(o instanceof SS){dH(e,o);return}const s=o.toString(),c=Ds(n,s);if(!c)throw new Error(`Element definition not found for ${n} ${s}`);let d=!1,f=r+1;f<t.length&&t[f]instanceof wS&&(d=!0,f++);const p=t[f];if(c.isArray&&!d&&(e.array=!0),f===t.length-1&&p instanceof Bp){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??yr)e.propertyTypes.add(m.code);return}for(const m of c.type??yr){let g=m.code;fH(g)&&(g=c.type[0].code),Vk(e,t,g,f)}}function dH(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 bS){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function fH(e){return e==="Element"||e==="BackboneElement"}function hH(e,t){switch(e.type){case"date":return t.size===1&&t.has(re.date)?jr.DATE:jr.DATETIME;case"number":return jr.NUMBER;case"quantity":return jr.QUANTITY;case"reference":return t.has(re.canonical)?jr.CANONICAL:jr.REFERENCE;case"token":return t.size===1&&t.has(re.boolean)?jr.BOOLEAN:jr.TEXT;default:return jr.TEXT}}function pH(e,t){const n=[],r=jS(t);return Hp(e,r.child,n),n}function nR(e,t){const n=[],r=jS(t);if(Hp(e,r.child,n),n.length===0)return r;let o=n[0];for(let s=1;s<n.length;s++)o=new xS(o,n[s]);return new yS("<original-not-available>",o)}function Hp(e,t,n){t instanceof xS?(Hp(e,t.left,n),Hp(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function jp(e){if(e instanceof Bp||e instanceof wS)return[jp(e.left),e].flat();if(e instanceof ei)return[e];if(e instanceof Qm)return[jp(e.left),jp(e.right)].flat();if(e instanceof SS){if(e.name==="where"&&!(e.args[0]instanceof bS))return[];if(e.name==="last")return[]}return[e]}const mH="https://meta.medplum.com/releases",ix=new Map;function gH(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!n?.length)throw new Error("Manifest missing assets list");for(const r of n){if(!r.browser_download_url)throw new Error("Asset missing browser download URL");if(!r.name)throw new Error("Asset missing name")}}async function vH(e,t,n){let r=ix.get("latest");if(!r){const o="latest",s=new URL(`${mH}/${o}.json`);s.searchParams.set("a",e),s.searchParams.set("c",Ik);const c=await fetch(s.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(p){console.error(`Failed to parse message from body: ${Qe(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const d=await c.json();gH(d),r=d,ix.set("latest",r),ix.set(r.tag_name.slice(1),r)}return r}async function yH(e){const t=await vH(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 Fk=v.createContext(void 0);function Zm(){return v.useContext(Fk)}function Re(){return Zm().medplum}function yu(){return Zm().navigate}function Sf(){return Zm().profile}const rR=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function xH(e){const t=e.medplum,n=e.navigate??bH,[r,o]=v.useState({profile:t.getProfile(),loading:t.isLoading()});v.useEffect(()=>{function c(){o(d=>({...d,profile:t.getProfile(),loading:t.isLoading()}))}for(const d of rR)t.addEventListener(d,c);return()=>{for(const d of rR)t.removeEventListener(d,c)}},[t]);const s=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(Fk.Provider,{value:s,children:e.children})}function bH(e){window.location.assign(e)}const iR=new Map,Hk=e=>v.useMemo(()=>{if(!e)return;const t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;const r=n.get("Expires");if(!r||r.length>13)return e;const o=iR.get(t);if(o){const c=new URLSearchParams(new URL(o).search).get("Expires");if(c&&Number.parseInt(c,10)*1e3-5e3>Date.now())return o}return iR.set(t,e),e},[e]);function Xt(e,t){const n=Re(),[r,o]=v.useState(()=>oR(n,e)),s=v.useCallback(c=>{Lo(c,r)||o(c)},[r]);return v.useEffect(()=>{let c=!0;const d=oR(n,e);return!d&&Na(e)?n.readReference(e).then(f=>{c&&s(f)}).catch(f=>{c&&(s(void 0),t&&t(Qt(f)))}):s(d),(()=>c=!1)},[n,e,s,t]),r}function oR(e,t){if(t){if(qo(t))return t;if(Na(t))return e.getCachedReference(t)}}const vt={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"},_S=`${lo}/fhir/StructureDefinition/questionnaire-itemControl`,SH=`${lo}/fhir/StructureDefinition/questionnaire-referenceFilter`,eb=`${lo}/fhir/StructureDefinition/questionnaire-referenceResource`,wH=`${lo}/fhir/StructureDefinition/questionnaire-validationError`,jH=`${lo}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,CH=`${lo}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,EH=`${lo}/fhir/StructureDefinition/questionnaire-signatureRequired`,Cp=`${lo}/fhir/StructureDefinition/questionnaireresponse-signature`;function TH(e){return e.type==="choice"||e.type==="open-choice"}function RH(e,t){const n=_H(e,t);return n!==void 0?n:DH(e,t)}function _H(e,t){const n=Ho(e,jH);if(t&&n){const r=n.valueExpression?.expression;if(r){const o=pi(t),s=Ss(r,[o],{"%resource":o});return Ro(s)}}}function DH(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=Qk(t?.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!o?.length){if(n==="any")return!0;continue}const{anyMatch:s,allMatch:c}=MH(r,o,n);if(n==="any"&&s)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function qk(e,t,n=t.item){for(const r of e){const o=n?.find(s=>s.linkId===r.linkId);o&&(AH(t,r,o),r.item&&o.item&&qk(r.item,t,o.item))}}function AH(e,t,n){try{const r=NH(t,e);if(!r)return;const o=PH(t,r);if(!o)return;n.answer=[o]}catch(r){n.extension=[{url:wH,valueString:`Expression evaluation failed: ${Qe(r)}`}]}}const kH={[vt.boolean]:[re.boolean],[vt.date]:[re.date],[vt.dateTime]:[re.dateTime],[vt.time]:[re.time],[vt.url]:[re.string,re.uri,re.url],[vt.attachment]:[re.Attachment],[vt.reference]:[re.Reference],[vt.quantity]:[re.Quantity],[vt.decimal]:[re.decimal,re.integer],[vt.integer]:[re.decimal,re.integer]};function PH(e,t){if(!e.type)return;if(e.type===vt.choice||e.type===vt.openChoice)return{[`value${Wn(t.type)}`]:t.value};if(e.type===vt.string||e.type===vt.text)return typeof t.value=="string"?{valueString:t.value}:void 0;if(kH[e.type]?.includes(t.type))return{[`value${Wn(e.type)}`]:t.value}}function NH(e,t){if(!t)return;const n=Ho(e,CH);if(n){const r=n.valueExpression?.expression;if(r){const o=pi(t),s=Ss(r,[o],{"%resource":o});return s.length!==0?s[0]:void 0}}}function Gk(e,t,n){const r=[];for(const o of e){const s=n.answerOption?.find(c=>wl(zo(c))===o);if(s){const c=zo(s);c&&r.push({[t]:c.value})}}return r}function Qk(e,t){for(const n of e??yr){if(n.linkId===t)return n.answer;if(n.item){const r=Qk(n.item,t);if(r)return r}}}function OH(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n?.replace("=","~"):n,[{value:o}]=Ss(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function MH(e,t,n){const r=t||[],o=zH(e);let s=!1,c=!0;for(const d of r){const f=$H(d),{operator:p}=e;if(OH(f,o,p)?s=!0:c=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:c}}function Wk(e){const t=Ho(e,eb);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return t.valueCodeableConcept?.coding?.map(n=>n.code)}}function ox(e,t){const n=mi(e);let r=Ho(n,eb);return!t||t.length===0?(r&&(n.extension=n.extension?.filter(o=>o!==r)),n):(r||(n.extension??=[],r={url:eb},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 LH(e,t,n){const r=Ho(e,SH);if(!r?.valueString)return;let o=r.valueString;t?.reference&&(o=o.replaceAll("$subj",t.reference)),n?.reference&&(o=o.replaceAll("$encounter",n.reference));const s={},c=o.split("&");for(const d of c){const[f,p]=Yx(d,"=",2);s[f]=p}return s}function aR(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??It(e),item:DS(e.item,t?.item),status:"in-progress"}}function DS(e,t){let n;for(const r of e??yr){if(r.type===vt.display)continue;const o=t?.filter(s=>s.linkId===r.linkId);if(o?.length)for(const s of o)s.id=s.id??Kk(),s.text=s.text??r.text,s.item=DS(r.item,s.item),s.answer=Xk(r,s),n=al(n,s);else n=al(n,Yk(r))}return n}function Yk(e){return{id:Kk(),linkId:e.linkId,text:e.text,item:DS(e.item,void 0),answer:Xk(e)}}let IH=1;function Kk(){return"id-"+IH++}function Xk(e,t){if(!(e.type===vt.display||e.type===vt.group)){if(t?.answer&&t.answer.length>0)return t.answer;if(e.initial&&e.initial.length>0)return e.initial.map(n=>({...n}));if(e.answerOption)return e.answerOption.filter(n=>n.initialSelected).map(n=>({...n,initialSelected:void 0}))}}function AS(e){return xf({value:e},"value")}function zo(e){return xf({value:e},"value")}function zH(e){return xf({value:e},"answer")}function $H(e){return xf({value:e},"value")}function UH(e){const t=Xt(e.questionnaire),n=Xt(e.defaultValue),[,r]=v.useReducer(S=>S+1,0),o=v.useRef({activePage:0});if(!o.current.questionnaire&&t&&(o.current.questionnaire=t,o.current.pages=e.disablePagination?void 0:BH(t)),t&&e.defaultValue&&n&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=aR(t,n),x()),t&&!e.defaultValue&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=aR(t),x()),!o.current.questionnaire||!o.current.questionnaireResponse)return{loading:!0};function s(S,j){let C=o.current.questionnaireResponse;for(const T of S)C=C?.item?.find(R=>T.id?R.id===T.id:R.linkId===T.linkId);return j&&(C=C?.item?.find(T=>T.linkId===j.linkId)),C}function c(){o.current.activePage=(o.current.activePage??0)+1,r()}function d(){o.current.activePage=(o.current.activePage??0)-1,r()}function f(S,j){const C=s(S);C&&(C.item??=[],C.item.push(Yk(j)),x())}function p(S,j){const C=s(S,j);C&&(C.answer??=[],C.answer.push({}),x())}function m(S,j,C){const T=s(S,j);T&&(T.answer=C,x())}function g(S){const j=o.current.questionnaireResponse;j&&(S?(j.extension=j.extension??[],j.extension=j.extension.filter(C=>C.url!==Cp),j.extension.push({url:Cp,valueSignature:S})):j.extension=j.extension?.filter(C=>C.url!==Cp),x())}function y(){const S=o.current.questionnaire;if(S?.item){const j=o.current.questionnaireResponse;qk(S.item,j)}}function x(){const S=o.current.questionnaireResponse;S&&(y(),r(),e.onChange?.(S))}return{loading:!1,pagination:!!o.current.pages,questionnaire:o.current.questionnaire,questionnaireResponse:o.current.questionnaireResponse,subject:e.subject,encounter:e.encounter,activePage:o.current.activePage,pages:o.current.pages,items:VH(o.current.questionnaire,o.current.pages,o.current.activePage),responseItems:FH(o.current.questionnaireResponse,o.current.pages,o.current.activePage),onNextPage:c,onPrevPage:d,onAddGroup:f,onAddAnswer:p,onChangeAnswer:m,onChangeSignature:g}}function BH(e){if(!(!e?.item||Ho(e?.item?.[0],_S)?.valueCodeableConcept?.coding?.[0]?.code!=="page"))return e.item.map((n,r)=>({linkId:n.linkId,title:n.text??`Page ${r+1}`,group:n}))}function VH(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function FH(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function HH(e,t,n={leading:!1}){const[r,o]=v.useState(e),s=v.useRef(!1),c=v.useRef(void 0),d=v.useRef(!1),f=v.useCallback(()=>window.clearTimeout(c.current),[]);return v.useEffect(()=>{s.current&&(!d.current&&n.leading?(d.current=!0,o(e)):(f(),c.current=setTimeout(()=>{d.current=!1,o(e)},t)))},[e,n.leading,t,f]),v.useEffect(()=>(s.current=!0,f),[f]),[r,f]}const qH=250;function GH(e,t,n){return Jk("searchOne",e,t)}function iu(e,t,n){return Jk("searchResources",e,t)}function Jk(e,t,n,r){const o=Re(),[s,c]=v.useState(!0),[d,f]=v.useState(),[p,m]=v.useState(),g=o.fhirSearchUrl(t,n).toString(),y=v.useMemo(()=>({resourceType:t,query:n}),[g]),x=qH,[S]=HH(y,x,{leading:!0});return v.useEffect(()=>{let j=!0;return o[e](S.resourceType,S.query).then(C=>{j&&(c(!1),f(C),m(G8))}).catch(C=>{j&&(c(!1),f(void 0),m(Qt(C)))}),()=>{j=!1}},[o,e,S]),[d,s,p]}function QH(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Sk(t)}):null}const Zk=["meta","implicitRules","contained","extension","modifierExtension"],eP=["language","text"],pn=v.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});pn.displayName="ElementsContext";const kS=["extension","modifierExtension"],WH=["id",...Zk].filter(e=>!kS.includes(e));function YH(e){return Object.entries(e).filter(([n,r])=>!Mn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||kS.includes(n)&&!Mn(r.slicing?.slices)||WH.includes(n)?!1:!(eP.includes(n)&&r.path.split(".").length===2||n.includes(".")))}function sR(e,t){return e.line&&e.line.length>t?e.line[t]:""}function lR(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:TB(r)}}function KH(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(pn),[s,c,d,f,p,m,g]=v.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(_=>o(e.path+"."+_)),[o,e.path]);function y(_){n(_),e.onChange&&e.onChange(_)}function x(_){y({...r.current,use:_})}function S(_){y({...r.current,type:_})}function j(_){y(lR(r.current||{},0,_))}function C(_){y(lR(r.current||{},1,_))}function T(_){y({...r.current,city:_})}function R(_){y({...r.current,state:_})}function E(_){y({...r.current,postalCode:_})}return a.jsxs(xe,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(fn,{disabled:e.disabled||s?.readonly,"data-testid":"address-use",defaultValue:t.use,onChange:_=>x(_.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(fn,{disabled:e.disabled||c?.readonly,"data-testid":"address-type",defaultValue:t.type,onChange:_=>S(_.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(He,{disabled:e.disabled||d?.readonly,placeholder:"Line 1",defaultValue:sR(t,0),onChange:_=>j(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Line 2",defaultValue:sR(t,1),onChange:_=>C(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||p?.readonly,placeholder:"City",defaultValue:t.city,onChange:_=>T(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||m?.readonly,placeholder:"State",defaultValue:t.state,onChange:_=>R(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||g?.readonly,placeholder:"Postal Code",defaultValue:t.postalCode,onChange:_=>E(_.currentTarget.value)})]})}function XH(e){const t=Sf(),[n,r]=v.useState(e.defaultValue||{});function o(s){const c=s?{text:s,authorReference:t&&Yt(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return a.jsx(He,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:s=>o(s.currentTarget.value)})}var JH={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"}};const Be=(e,t,n,r)=>{const o=v.forwardRef(({color:s="currentColor",size:c=24,stroke:d=2,title:f,className:p,children:m,...g},y)=>v.createElement("svg",{ref:y,...JH[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:s}:{strokeWidth:d,stroke:s},...g},[f&&v.createElement("title",{key:"svg-title"},f),...r.map(([x,S])=>v.createElement(x,S)),...Array.isArray(m)?m:[m]]));return o.displayName=`${n}`,o};const ZH=[["path",{d:"M12 6a2 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:"M6 12a2 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:"M15 18a2 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"}]],eq=Be("outline","adjustments-horizontal","AdjustmentsHorizontal",ZH);const tq=[["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"}]],As=Be("outline","alert-circle","AlertCircle",tq);const nq=[["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"}]],rq=Be("outline","arrow-down","ArrowDown",nq);const iq=[["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"}]],oq=Be("outline","arrow-up","ArrowUp",iq);const aq=[["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"}]],sq=Be("outline","bleach-off","BleachOff",aq);const lq=[["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"}]],cq=Be("outline","bleach","Bleach",lq);const uq=[["path",{d:"M18 7v14l-6 -4l-6 4v-14a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4",key:"svg-0"}]],dq=Be("outline","bookmark","Bookmark",uq);const fq=[["path",{d:"M7 5a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10",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"}]],hq=Be("outline","box-multiple","BoxMultiple",fq);const pq=[["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"}]],mq=Be("outline","brackets-contain","BracketsContain",pq);const gq=[["path",{d:"M9 7a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M14 16a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M4 16a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]],vq=Be("outline","brand-asana","BrandAsana",gq);const yq=[["path",{d:"M3 9a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -9",key:"svg-0"}],["path",{d:"M8 7v-2a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v2",key:"svg-1"}],["path",{d:"M12 12l0 .01",key:"svg-2"}],["path",{d:"M3 13a20 20 0 0 0 18 0",key:"svg-3"}]],xq=Be("outline","briefcase","Briefcase",yq);const bq=[["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"}]],Sq=Be("outline","bucket-off","BucketOff",bq);const wq=[["path",{d:"M4 7a8 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"}]],jq=Be("outline","bucket","Bucket",wq);const Cq=[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]],Eq=Be("outline","building","Building",Cq);const Tq=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12",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"}]],ss=Be("outline","calendar","Calendar",Tq);const Rq=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Go=Be("outline","check","Check",Rq);const _q=[["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"}]],Dq=Be("outline","checkbox","Checkbox",_q);const Aq=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],PS=Be("outline","chevron-down","ChevronDown",Aq);const kq=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]],Pq=Be("outline","circle-check","CircleCheck",kq);const Nq=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]],qp=Be("outline","circle-minus","CircleMinus",Nq);const Oq=[["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"}]],Fd=Be("outline","circle-plus","CirclePlus",Oq);const Mq=[["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"}]],NS=Be("outline","cloud-upload","CloudUpload",Mq);const Lq=[["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"}]],Iq=Be("outline","columns","Columns",Lq);const zq=[["path",{d:"M7 9.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.667l0 -8.666",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"}]],OS=Be("outline","copy","Copy",zq);const $q=[["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"}]],Uq=Be("outline","currency-dollar","CurrencyDollar",$q);const Bq=[["path",{d:"M4 6a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],Vq=Be("outline","database","Database",Bq);const Fq=[["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:"M10 14a2 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"}]],Hq=Be("outline","device-floppy","DeviceFloppy",Fq);const qq=[["path",{d:"M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],Gq=Be("outline","dots","Dots",qq);const Qq=[["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.415",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]],tP=Be("outline","edit","Edit",Qq);const Wq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],wf=Be("outline","equal-not","EqualNot",Wq);const Yq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],jf=Be("outline","equal","Equal",Yq);const Kq=[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],Xq=Be("outline","eye-off","EyeOff",Kq);const Jq=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],Zq=Be("outline","eye","Eye",Jq);const eG=[["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 2",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]],cR=Be("outline","file-alert","FileAlert",eG);const tG=[["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 2",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]],nG=Be("outline","file-plus","FilePlus",tG);const rG=[["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.227",key:"svg-0"}]],iG=Be("outline","filter","Filter",rG);const oG=[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]],aG=Be("outline","folder","Folder",oG);const sG=[["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"}]],lG=Be("outline","forms","Forms",sG);const cG=[["path",{d:"M3 7a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3l0 -10",key:"svg-0"}],["path",{d:"M7 10a2 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"}]],uG=Be("outline","id","Id",cG);const dG=[["path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M9 4l0 16",key:"svg-1"}]],fG=Be("outline","layout-sidebar","LayoutSidebar",dG);const hG=[["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 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4",key:"svg-4"}],["path",{d:"M3 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4",key:"svg-5"}]],uR=Be("outline","list-details","ListDetails",hG);const pG=[["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 12a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1l0 -3",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]],mG=Be("outline","lock-access","LockAccess",pG);const gG=[["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-6",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"}]],vG=Be("outline","lock","Lock",gG);const yG=[["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"}]],xG=Be("outline","logout","Logout",yG);const bG=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],nP=Be("outline","math-greater","MathGreater",bG);const SG=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],rP=Be("outline","math-lower","MathLower",SG);const wG=[["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 -3h12",key:"svg-2"}]],jG=Be("outline","message","Message",wG);const CG=[["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 -3l-6 6",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"}]],EG=Be("outline","microscope","Microscope",CG);const TG=[["path",{d:"M5 12l14 0",key:"svg-0"}]],RG=Be("outline","minus","Minus",TG);const _G=[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3l0 -5.5",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 3l0 -5.5",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"}]],DG=Be("outline","packages","Packages",_G);const AG=[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]],kG=Be("outline","pencil","Pencil",AG);const PG=[["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"}]],NG=Be("outline","pin","Pin",PG);const OG=[["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"}]],MG=Be("outline","pinned-off","PinnedOff",OG);const LG=[["path",{d:"M7 4v16l13 -8l-13 -8",key:"svg-0"}]],IG=Be("outline","player-play","PlayerPlay",LG);const zG=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],$G=Be("outline","plus","Plus",zG);const UG=[["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"}]],BG=Be("outline","receipt","Receipt",UG);const VG=[["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"}]],iP=Be("outline","refresh","Refresh",VG);const FG=[["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"}]],HG=Be("outline","repeat","Repeat",FG);const qG=[["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 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]],GG=Be("outline","report-medical","ReportMedical",qG);const QG=[["path",{d:"M3 15a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -4",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"}]],WG=Be("outline","router","Router",QG);const YG=[["path",{d:"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],eg=Be("outline","search","Search",YG);const KG=[["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.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],tb=Be("outline","settings","Settings",KG);const XG=[["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"}]],MS=Be("outline","sort-ascending","SortAscending",XG);const JG=[["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"}]],LS=Be("outline","sort-descending","SortDescending",JG);const ZG=[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14",key:"svg-0"}]],eQ=Be("outline","square","Square",ZG);const tQ=[["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.873l-6.158 -3.245",key:"svg-0"}]],nQ=Be("outline","star","Star",tQ);const rQ=[["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"}]],iQ=Be("outline","switch-horizontal","SwitchHorizontal",rQ);const oQ=[["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"}]],aQ=Be("outline","table-export","TableExport",oQ);const sQ=[["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"}]],lQ=Be("outline","text-recognition","TextRecognition",sQ);const cQ=[["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"}]],tg=Be("outline","trash","Trash",cQ);const uQ=[["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"}]],dR=Be("outline","upload","Upload",uQ);const dQ=[["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"}]],fQ=Be("outline","webhook","Webhook",dQ);const hQ=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],El=Be("outline","x","X",hQ);const pQ=[["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"}]],mQ=Be("filled","circle-filled","CircleFilled",pQ);class IS extends v.Component{state;constructor(t){super(t),this.state={lastLocation:er.getLocation()}}static getDerivedStateFromError(t){return{error:t,lastLocation:er.getLocation()}}componentDidUpdate(t,n){er.getLocation()!==this.state.lastLocation&&this.setState({lastLocation:er.getLocation(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==er.getLocation())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx(Fo,{icon:a.jsx(As,{size:16}),title:"Something went wrong",color:"red",children:Qe(this.state.error)}):this.props.children}}function Mi(){return a.jsx(To,{style:{width:"100%",height:"100vh"},children:a.jsx(_r,{})})}const gQ="_main_6f7o5_1",vQ={main:gQ};function vn(e){e.preventDefault(),e.stopPropagation()}function zS(e){return e.button===1||e.ctrlKey||e.metaKey}function oP(e){if(fR(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&fR(t[0]))return!0}return!1}function fR(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Ed(e,t){return new Promise((n,r)=>{const o=new MessageChannel;o.port1.onmessage=({data:s})=>{o.port1.close(),s.error?r(s.error):n(s.result)},e.contentWindow?.postMessage(t,new URL(e.src).origin,[o.port2])})}function aP(e,t){const n=new Blob([e],{type:tn.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const s=t??new Date().toISOString().replaceAll(/\D/g,"");o.download=`${s}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function St(e){const t=yu(),{to:n,suffix:r,label:o,onClick:s,children:c,...d}=e;let f=yQ(n);return r&&(f+="/"+r),a.jsx(Tt,{href:f,"aria-label":o,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),s?(p.preventDefault(),s(p)):n&&(zS(p)||(p.preventDefault(),t(f)))},...d,children:c})}function yQ(e){if(e){if(typeof e=="string")return xQ(e);if(qo(e))return bQ(e);if(Na(e))return SQ(e)}return"#"}function xQ(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function bQ(e){return`/${e.resourceType}/${e.id}`}function SQ(e){return`/${e.reference}`}function wQ(e){const t=e.split(" ").filter(Boolean);return t.length>1?t[0][0]+t.at(-1)?.at(0):t.length===1?t[0][0]:""}function co(e){const t=Xt(e.value),n=t?Ca(t):e.alt??"",r=wQ(n),o=(t&&wB(t))??e.src,s=Hk(o??void 0),c=e.radius??"xl",d={...e,value:void 0,link:void 0};return e.link?a.jsx(St,{to:t,children:a.jsx(Zc,{src:s,alt:n,radius:c,...d,children:r})}):a.jsx(Zc,{src:s,alt:n,radius:c,...d,children:r})}const jQ="_logoButton_799cf_1",CQ="_user_799cf_11",EQ="_userName_799cf_25",ax={logoButton:jQ,user:CQ,userName:EQ};function $S(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Pa(t,e.options)}):null}function sP(){return"Medplum"}function lP(e){const t=Zm(),{medplum:n,profile:r,navigate:o}=t,s=n.getLogins(),{colorScheme:c,setColorScheme:d}=P5(),[f]=v.useState(localStorage.appShellLayoutVersion??"v1");function p(m){localStorage.appShellLayoutVersion=m,er.reload()}return a.jsxs(a.Fragment,{children:[a.jsxs(Me,{align:"center",p:"xl",children:[a.jsx(co,{size:"xl",radius:100,value:t.profile}),a.jsx($S,{value:t.profile?.name?.[0]}),a.jsx(be,{c:"dimmed",size:"xs",children:n.getActiveLogin()?.project.display})]}),s.length>1&&a.jsx(Se.Divider,{}),s.map(m=>m.profile.reference!==It(t.profile)&&a.jsx(Se.Item,{onClick:()=>{n.setActiveLogin(m).then(()=>er.reload()).catch(console.log)},children:a.jsxs(xe,{children:[a.jsx(Zc,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(be,{size:"sm",fw:500,children:m.profile.display}),a.jsx(be,{c:"dimmed",size:"xs",children:m.project.display})]})]})},m.profile.reference)),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(iQ,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Switch to another project"}),a.jsx(Se.Divider,{}),a.jsxs(xe,{justify:"center",children:[a.jsx(eu,{size:"xs",value:c,onChange:m=>d(m),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]}),a.jsx(eu,{size:"xs",value:f,onChange:m=>p(m),data:[{label:"v1",value:"v1"},{label:"v2",value:"v2"}]})]}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(tb,{size:14,stroke:1.5}),onClick:()=>o(`/${It(r)}`),children:"Account settings"}),a.jsx(Se.Item,{leftSection:a.jsx(xG,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsxs(be,{size:"xs",c:"dimmed",my:"sm",ta:"center",children:[sP()," ",e.version]})]})}const hR={selectedItems:"selected-items",options:"options"};function US(e){const t=Il({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:s,defaultValue:c,toOption:d,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:y,onCreate:x,creatable:S,clearable:j,required:C,placeholder:T,leftSection:R,maxValues:E,optionsDropdownMaxHeight:_=320,minInputLength:k=0,...I}=e,D=I.disabled,P=TQ(c),[$,B]=v.useState(""),[Q,K]=v.useState(),[Z,U]=v.useState(),[G,M]=v.useState(),[L,z]=v.useState(P.map(d)),[F,Y]=v.useState([]),O=p??RQ,H=m??_Q,se=g??DQ,de=v.useRef($);de.current=$;const ye=v.useRef(void 0),we=v.useRef(void 0),Ee=v.useRef(Q);Ee.current=Q;const Xe=v.useRef(Z);Xe.current=Z;const Ae=v.useRef(G);Ae.current=G;const dt=v.useRef(F);dt.current=F;const Et=v.useCallback(()=>{if(K(void 0),de.current===we.current&&f===ye.current||(de.current?.length??0)<k)return;we.current=de.current,ye.current=f;const Le=new AbortController;U(Le),f(de.current??"",Le.signal).then(lt=>{Le.signal.aborted||(Y(lt.map(d)),Ae.current?(lt.length>0&&y(lt.slice(0,1)),M(!1)):lt.length>0&&t.openDropdown())}).catch(lt=>{Le.signal.aborted||lt.message.includes("aborted")||ke({color:"red",message:Qe(lt)})}).finally(()=>{Le.signal.aborted||U(void 0)})},[t,f,y,d,k]),it=v.useCallback(Le=>{(F&&F.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),B(Le.currentTarget.value),Xe.current&&(Xe.current.abort(),U(void 0)),Ee.current!==void 0&&window.clearTimeout(Ee.current);const lt=window.setTimeout(()=>Et(),100);K(lt)},[t,F,S,Et]),rt=v.useCallback(Le=>{const lt=L.some(pe=>pe.value===Le),tt=lt?L.filter(pe=>pe.value!==Le):[...L];let ft=F?.find(pe=>pe.value===Le);if(!ft&&S!==!1&&x){const pe=x(Le);ft=d(pe)}if(ft){if(E===0){y([ft.resource]),L.length>0&&z([]);return}lt||tt.push(ft)}if(E!==void 0)for(;tt.length>E;)tt.shift();y(tt.map(pe=>pe.resource)),z(tt)},[S,F,L,E,y,x,d]),mt=v.useMemo(()=>{if(!D)return Le=>{D||(E===1&&(B(""),Y([]),t.closeDropdown()),we.current=void 0,Le==="$create"?(B(""),rt($)):rt(Le))}},[rt,t,D,E,$]),Ct=v.useCallback(Le=>{const lt=L.filter(tt=>tt.value!==Le.value);y(lt.map(tt=>tt.resource)),z(lt)},[L,y]),jt=v.useCallback(Le=>{Le.key==="Enter"?(Q||Z)&&M(!0):Le.key==="Backspace"&&$.length===0&&(vn(Le),Ct(L[L.length-1]))},[Z,Ct,$.length,L,Q]);v.useEffect(()=>()=>{Xe.current&&Xe.current.abort()},[]);const Te=!D&&j&&L.length>0&&a.jsx(Ke.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{B(""),z([]),y([]),t.closeDropdown()}}),_e=S&&$.trim().length>0,$e=F.length>0||_e;return a.jsxs(Ke,{store:t,onOptionSubmit:mt,withinPortal:!0,shadow:"xl",...I,children:[a.jsx(Ke.DropdownTarget,{children:a.jsx(xs,{label:r,description:o,error:s,className:e.className,leftSection:R,rightSection:Z?a.jsx(_r,{size:16}):Te,required:C,disabled:D,children:a.jsxs(wa.Group,{"data-testid":hR.selectedItems,children:[L.map(Le=>a.jsx(H,{item:Le,disabled:D,onRemove:()=>Ct(Le)},Le.value)),!D&&(E===void 0||E===0||L.length<E)&&a.jsx(Ke.EventsTarget,{children:a.jsx(xs.Field,{role:"searchbox",name:n,value:$,placeholder:T,onFocus:it,onBlur:()=>{t.closeDropdown(),B("")},onKeyDown:jt,onChange:it})})]})})}),a.jsx(Ke.Dropdown,{hidden:!$e,"data-testid":hR.options,children:a.jsx(Ke.Options,{children:a.jsxs(ym,{type:"scroll",mah:_,children:[F.map(Le=>{const lt=L.some(tt=>tt.value===Le.value);return a.jsx(Ke.Option,{value:Le.value,active:lt,children:a.jsx(O,{...Le,active:lt})},Le.value)}),_e&&a.jsxs(Ke.Option,{value:"$create",children:["+ Create ",$]}),!S&&$.trim().length>0&&F.length===0&&a.jsx(se,{search:$})]})})})]})}function TQ(e){return e?Array.isArray(e)?e:[e]:[]}function RQ(e){return a.jsxs(xe,{gap:"xs",children:[e.active&&a.jsx(Go,{size:12}),a.jsx("span",{children:e.label})]})}function _Q({item:e,disabled:t,onRemove:n}){return a.jsx(wa,{withRemoveButton:!t,onRemove:n,children:e.label})}function DQ(){return a.jsx(Ke.Empty,{children:"Nothing found"})}const AQ="_searchInput_dick8_1",kQ={searchInput:AQ};function PQ(e){return{value:e.id,label:Ca(e),resource:e}}function NQ(e){const t=yu(),n=Re(),r=v.useCallback(async(s,c)=>{const d=MQ(s),f={signal:c},p=await n.graphql(d,void 0,void 0,f);return LQ(p,s)},[n]),o=v.useCallback(s=>{s.length>0&&t(`/${It(s[0])}`)},[t]);return a.jsx(US,{size:"sm",radius:"md",className:kQ.searchInput,leftSection:a.jsx(eg,{size:16}),placeholder:"Search",itemComponent:OQ,toOption:PQ,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const OQ=v.forwardRef(({resource:e,active:t,...n},r)=>{let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=e.subject?.display),a.jsx("div",{ref:r,...n,children:a.jsxs(xe,{wrap:"nowrap",children:[a.jsx(co,{value:e}),a.jsxs("div",{children:[a.jsx(be,{children:Ca(e)}),a.jsx(be,{size:"xs",c:"dimmed",children:o})]})]})})});function MQ(e){const t=JSON.stringify(e);return pS(e)?`{
|
|
97
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
98
|
-
resourceType
|
|
99
|
-
id
|
|
100
|
-
identifier {
|
|
101
|
-
system
|
|
102
|
-
value
|
|
103
|
-
}
|
|
104
|
-
name {
|
|
105
|
-
given
|
|
106
|
-
family
|
|
107
|
-
}
|
|
108
|
-
birthDate
|
|
109
|
-
}
|
|
110
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
111
|
-
resourceType
|
|
112
|
-
id
|
|
113
|
-
identifier {
|
|
114
|
-
system
|
|
115
|
-
value
|
|
116
|
-
}
|
|
117
|
-
subject {
|
|
118
|
-
display
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}`.replaceAll(/\s+/g," "):`{
|
|
122
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
123
|
-
resourceType
|
|
124
|
-
id
|
|
125
|
-
identifier {
|
|
126
|
-
system
|
|
127
|
-
value
|
|
128
|
-
}
|
|
129
|
-
name {
|
|
130
|
-
given
|
|
131
|
-
family
|
|
132
|
-
}
|
|
133
|
-
birthDate
|
|
134
|
-
}
|
|
135
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
136
|
-
resourceType
|
|
137
|
-
id
|
|
138
|
-
identifier {
|
|
139
|
-
system
|
|
140
|
-
value
|
|
141
|
-
}
|
|
142
|
-
name {
|
|
143
|
-
given
|
|
144
|
-
family
|
|
145
|
-
}
|
|
146
|
-
birthDate
|
|
147
|
-
}
|
|
148
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
149
|
-
resourceType
|
|
150
|
-
id
|
|
151
|
-
identifier {
|
|
152
|
-
system
|
|
153
|
-
value
|
|
154
|
-
}
|
|
155
|
-
subject {
|
|
156
|
-
display
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}`.replaceAll(/\s+/g," ")}function LQ(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),zQ(IQ(n),t).slice(0,5)}function IQ(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 zQ(e,t){return e.sort((n,r)=>pR(r,t)-pR(n,t))}function pR(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,mR(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,mR(Pa(r),t));return n}function mR(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function $Q(e){const t=Sf(),[n,r]=v.useState(!1);return a.jsx(Tr.Header,{p:8,style:{zIndex:101},children:a.jsxs(xe,{justify:"space-between",children:[a.jsxs(xe,{gap:"xs",children:[a.jsx(Pn,{className:ax.logoButton,"aria-expanded":e.navbarOpen,"aria-controls":"navbar",onClick:()=>e.navbarToggle(),children:e.logo}),!e.headerSearchDisabled&&a.jsx(NQ,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(xe,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(Se,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"fade-down"},opened:n,onClose:()=>r(!1),children:[a.jsx(Se.Target,{children:a.jsx(Pn,{className:ax.user,"aria-label":"User menu","data-active":n||void 0,onClick:()=>r(o=>!o),children:a.jsxs(xe,{gap:7,children:[a.jsx(co,{value:t,radius:"xl",size:24}),a.jsx(be,{size:"sm",className:ax.userName,children:Pa(t?.name?.[0])}),a.jsx(PS,{size:12,stroke:1.5})]})})}),a.jsx(Se.Dropdown,{children:a.jsx(lP,{version:e.version})})]})]})]})})}const UQ=()=>BA({opened:!1,empty:!1,selected:-1,listId:"",query:"",registeredActions:new Set}),BQ=e=>VA(e);function ou(e,t){const n=t.getState();t.setState({...n,...e(t.getState())})}function cP(e){ou(()=>({opened:!0,selected:-1}),e)}function uP(e){ou(()=>({opened:!1}),e)}function dP(e){ou(t=>({opened:!t.opened,selected:t.opened?t.selected:-1}),e)}function fP(e,t){t.updateState(n=>({...n,selected:e}))}function VQ(e,t){t.updateState(n=>({...n,listId:e}))}function Gp(e,t=document){const n=t.querySelector(e);if(n)return n;const r=t instanceof ShadowRoot?t.host.children:t.children;for(let o=0;o<r.length;o+=1){const s=r[o];if(s.shadowRoot){const d=Gp(e,s.shadowRoot);if(d)return d}const c=Gp(e,s);if(c)return c}return null}function ng(e,t){const n=t.getState(),r=n.listId?Gp(`#${n.listId}`):null,o=r?.querySelector("[data-selected]"),s=r?.querySelectorAll("[data-action]")??[],c=e===-1?s.length-1:e===s.length?0:e,d=jd(c,0,s.length-1);return o?.removeAttribute("data-selected"),s[d]?.scrollIntoView({block:"nearest"}),s[d]?.setAttribute("data-selected","true"),fP(d,t),d}function FQ(e){return ng(e.getState().selected+1,e)}function HQ(e){return ng(e.getState().selected-1,e)}function qQ(e){const t=e.getState();Gp(`#${t.listId} [data-selected]`)?.click()}function GQ(e,t){const n=t.getState();return n.registeredActions.add(e),()=>{n.registeredActions.delete(e)}}function QQ(e,t){ou(()=>({query:e}),t),Promise.resolve().then(()=>{ng(0,t),ou(n=>({empty:n.query.trim().length>0&&n.registeredActions.size===0||!1}),t)})}function WQ({clearQuery:e},t){t.updateState(n=>({...n,selected:-1,query:e?"":n.query,empty:e?!1:n.empty}))}const ko={open:cP,close:uP,toggle:dP,updateState:ou,setSelectedAction:fP,setListId:VQ,selectAction:ng,selectNextAction:FQ,selectPreviousAction:HQ,triggerSelectedAction:qQ,registerAction:GQ,setQuery:QQ,clearSpotlightState:WQ};function YQ(){const e=UQ();return[e,{open:()=>cP(e),close:()=>uP(e),toggle:()=>dP(e)}]}const[hP,Cf]=YQ(),{open:iae,close:oae,toggle:aae}=Cf;function pP(e){const t=e;return t.group!==void 0&&Array.isArray(t.actions)}function KQ(e){return Array.isArray(e)?e.map(t=>t.trim()).join(",").toLowerCase().trim():typeof e=="string"?e.toLowerCase().trim():""}function XQ(e){return e.reduce((t,n)=>"actions"in n?[...t,...n.actions.map(r=>({...r,group:n.group}))]:[...t,n],[])}function JQ(e){const t={},n=[];return e.forEach(r=>{r.group?(t[r.group]||(t[r.group]={pushed:!1,data:{group:r.group,actions:[]}}),t[r.group].data.actions.push(r),t[r.group].pushed||(t[r.group].pushed=!0,n.push(t[r.group].data))):n.push(r)}),n}const ZQ=(e,t)=>{const n=e.trim().toLowerCase(),r=[[],[]];return XQ(t).forEach(s=>{s.label?.toLowerCase().includes(n)?r[0].push(s):(s.description?.toLowerCase().includes(n)||KQ(s.keywords).includes(n))&&r[1].push(s)}),JQ(r.flat())};function mP(e,t){if(!Array.isArray(e))return[];let n=0;return e.reduce((r,o)=>{if(n>=t)return r;if(pP(o)){const s=mP(o.actions,t-n);r.push({group:o.group,actions:s}),n+=s.length}else r.push(o),n+=1;return r},[])}const[eW,xu]=Ar("Spotlight component was not found in tree");var $o={root:"m_d2b315db",content:"m_3cd250e0",body:"m_d2abce9b",search:"m_f366a061",actionsList:"m_6e463822",action:"m_d49bb8ef",actionBody:"m_3d475731",actionSection:"m_832642f6",actionLabel:"m_6c2a1345",actionDescription:"m_a6d9d78d",empty:"m_82f78f74",footer:"m_ddcaf054",actionsGroup:"m_5a3e5f7b"};const tW={dimmedSections:!0,highlightQuery:!1},Hd=ge((e,t)=>{const n=oe("SpotlightAction",tW,e),{className:r,style:o,classNames:s,styles:c,id:d,description:f,label:p,leftSection:m,rightSection:g,children:y,dimmedSections:x,highlightQuery:S,highlightColor:j,closeSpotlightOnTrigger:C,onClick:T,onMouseDown:R,keywords:E,vars:_,...k}=n,I=xu(),D={classNames:s,styles:c},P=S&&typeof p=="string"?a.jsx(_0,{component:"span",highlight:I.query,color:j,...I.getStyles("actionLabel",D),children:p}):a.jsx("span",{...I.getStyles("actionLabel",D),children:p});return a.jsx(Pn,{ref:t,"data-action":!0,...I.getStyles("action",{className:r,style:o,...D}),...k,onMouseDown:$=>{$.preventDefault(),R?.($)},onClick:$=>{T?.($),(C??I.closeOnActionTrigger)&&ko.close(I.store)},tabIndex:-1,children:y||a.jsxs(a.Fragment,{children:[m&&a.jsx(le,{component:"span",mod:{position:"left",dimmed:x},...I.getStyles("actionSection",D),children:m}),a.jsxs("span",{...I.getStyles("actionBody",D),children:[P,a.jsx("span",{...I.getStyles("actionDescription",D),children:f})]}),g&&a.jsx(le,{component:"span",mod:{position:"right",dimmed:x},...I.getStyles("actionSection",D),children:g})]})})});Hd.classes=$o;Hd.displayName="@mantine/spotlight/SpotlightAction";const rg=ge((e,t)=>{const{className:n,style:r,styles:o,classNames:s,label:c,children:d,...f}=oe("SpotlightActionsGroup",null,e),p=xu();return a.jsx(le,{...p.getStyles("actionsGroup",{className:n,style:r,classNames:s,styles:o}),ref:t,...f,__vars:{"--spotlight-label":`'${c?.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`},children:d})});rg.classes=$o;rg.displayName="@mantine/core/SpotlightActionsGroup";const ig=ge((e,t)=>{const{className:n,style:r,id:o,children:s,vars:c,classNames:d,styles:f,...p}=oe("SpotlightActionsList",null,e),m=xu(),g=`mantine-${v.useId().replace(/:/g,"")}`,y=o||g;return v.useEffect(()=>(ko.setListId(y,m.store),()=>ko.setListId("",m.store)),[]),a.jsx(Jr.Autosize,{...m.getStyles("actionsList",{className:n,style:r,classNames:d,styles:f}),ref:t,type:"scroll",scrollbarSize:"var(--spotlight-actions-list-padding)",offsetScrollbars:"y",id:y,...p,children:s})});ig.classes=$o;ig.displayName="@mantine/spotlight/SpotlightActionsList";const og=ge((e,t)=>{const{className:n,style:r,classNames:o,styles:s,...c}=oe("SpotlightEmpty",null,e),d=xu();return a.jsx(le,{ref:t,...d.getStyles("empty",{classNames:o,styles:s,className:n,style:r}),...c})});og.classes=$o;og.displayName="@mantine/spotlight/SpotlightEmpty";const BS=ge((e,t)=>{const{className:n,style:r,classNames:o,styles:s,...c}=oe("SpotlightFooter",null,e),d=xu();return a.jsx(le,{ref:t,...d.getStyles("footer",{className:n,classNames:o,style:r,styles:s}),...c})});BS.classes=$o;BS.displayName="@mantine/spotlight/SpotlightFooter";function nW(e,t){if(!e)return[];const n=()=>ko.open(t);return Array.isArray(e)?e.map(r=>[r,n]):[[e,n]]}const rW={size:600,yOffset:80,zIndex:zr("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"},store:hP,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K",maxHeight:400},ag=ge((e,t)=>{const n=oe("SpotlightRoot",rW,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,store:p,children:m,query:g,onQueryChange:y,transitionProps:x,clearQueryOnClose:S,shortcut:j,tagsToIgnore:C,triggerOnContentEditable:T,disabled:R,onSpotlightOpen:E,onSpotlightClose:_,forceOpened:k,closeOnActionTrigger:I,maxHeight:D,scrollable:P,attributes:$,...B}=n,Q=Tn(),{opened:K,query:Z}=BQ(p),U=typeof g=="string"?g:Z,G=L=>{y?.(L),ko.setQuery(L,p)},M=Ie({name:"Spotlight",classes:$o,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:$});return UM(nW(j,p),C,T),yl(()=>{K?E?.():_?.()},[K]),R?null:a.jsx(eW,{value:{getStyles:M,query:U,setQuery:G,store:p,closeOnActionTrigger:I},children:a.jsx(Ln,{ref:t,...B,withCloseButton:!1,opened:K||!!k,padding:0,onClose:()=>ko.close(p),className:o,style:s,classNames:Jd({theme:Q,classNames:[$o,r],props:n,stylesCtx:void 0}),styles:Ad({theme:Q,styles:c,props:n,stylesCtx:void 0}),transitionProps:{...x,onExited:()=>{S&&G(""),ko.clearSpotlightState({clearQuery:S},p),x?.onExited?.()}},__vars:{"--spotlight-max-height":P?ue(D):void 0},__staticSelector:"Spotlight","data-scrollable":P||void 0,children:m})})});ag.classes=$o;ag.displayName="@mantine/spotlight/SpotlightRoot";const iW={size:"lg"},sg=ge((e,t)=>{const{classNames:n,styles:r,onKeyDown:o,onChange:s,vars:c,value:d,...f}=oe("SpotlightSearch",iW,e),p=xu(),m=p.getStyles("search"),[g,y]=v.useState(!1),x=S=>{o?.(S),!g&&(S.nativeEvent.code==="ArrowDown"&&(S.preventDefault(),ko.selectNextAction(p.store)),S.nativeEvent.code==="ArrowUp"&&(S.preventDefault(),ko.selectPreviousAction(p.store)),(S.nativeEvent.code==="Enter"||S.nativeEvent.code==="NumpadEnter")&&(S.preventDefault(),ko.triggerSelectedAction(p.store)))};return a.jsx(hn,{ref:t,classNames:[{input:m.className},n],styles:[{input:m.style},r],...f,value:d??p.query,onChange:S=>{p.setQuery(S.currentTarget.value),s?.(S)},onKeyDown:x,onCompositionStart:()=>y(!0),onCompositionEnd:()=>y(!1)})});sg.classes=$o;sg.displayName="@mantine/spotlight/SpotlightSearch";const oW={size:600,yOffset:80,limit:1/0,zIndex:zr("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"},store:hP,filter:ZQ,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K"},gi=ge((e,t)=>{const n=oe("Spotlight",oW,e),{searchProps:r,filter:o,query:s,onQueryChange:c,actions:d,nothingFound:f,highlightQuery:p,limit:m,scrollAreaProps:g,...y}=n,[x,S]=nr({value:s,defaultValue:"",finalValue:"",onChange:c}),j=mP(o(x,d),m).map(C=>{if(pP(C)){const T=C.actions.map(({id:R,...E})=>a.jsx(Hd,{highlightQuery:p,...E},R));return a.jsx(rg,{label:C.group,children:T},C.group)}return a.jsx(Hd,{highlightQuery:p,...C},C.id)});return a.jsxs(ag,{...y,query:x,onQueryChange:S,ref:t,children:[a.jsx(sg,{...r}),a.jsxs(ig,{...g,children:[j,j.length===0&&f&&a.jsx(og,{children:f})]})]})});gi.classes=$o;gi.displayName="@mantine/spotlight/Spotlight";gi.Search=sg;gi.ActionsList=ig;gi.Action=Hd;gi.Empty=og;gi.ActionsGroup=rg;gi.Footer=BS;gi.Root=ag;gi.open=Cf.open;gi.close=Cf.close;gi.toggle=Cf.toggle;const VS=v.createContext({submitting:!1});VS.displayName="FormContext";function aW(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?sW(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&lW(t,n);return t}function sW(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function lW(e,t){e[t.name]=t.value}function pt(e){const[t,n]=v.useState(!1);return a.jsx(VS.Provider,{value:{submitting:t},children:a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const o=aW(r.target);if(e.onSubmit){n(!0);const s=e.onSubmit(o);s?.then?s.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function cr(e){const{children:t,...n}=e,{submitting:r}=v.useContext(VS);return a.jsx(Ne,{type:"submit",loading:r,...n,children:t})}function cW(e){const t=Re(),n=t.getUserConfiguration();function r(o){const{menuname:s,bookmarkname:c}=o,d=`${e.pathname}?${e.searchParams.toString()}`,f=mi(n);f.menu?.find(({title:m})=>m===s)?.link?.push({name:c,target:d}),t.updateResource(f).then(m=>{n.menu=m.menu,t.dispatchEvent({type:"change"}),ke({color:"green",message:"Success"}),e.onOk()}).catch(m=>{ke({color:"red",message:Qe(m)})})}return a.jsx(Ln,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(pt,{onSubmit:r,children:a.jsxs(Me,{children:[a.jsx(uW,{config:n}),a.jsx(He,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",defaultValue:e.pathname.split("/")[1]||"",withAsterisk:!0}),a.jsx(xe,{justify:"flex-end",children:a.jsx(cr,{mt:"sm",children:"OK"})})]})})})}function uW(e){function t(r){return r?.menu?.map(o=>o.title)}const n=t(e.config);return a.jsx(fn,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function gP(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function dW(e){return typeof e.display=="string"?e.display:gP(e)}function fW(e){return{value:gP(e),label:dW(e),resource:e}}function hW(e){return{code:e,display:e}}function Ef(e){const t=Re(),{binding:n,creatable:r,clearable:o,expandParams:s,withHelpText:c,...d}=e,f=v.useCallback(async(p,m)=>{if(!n)return[];const y=(await t.valueSetExpand({...s,url:n,filter:p,count:10},{signal:m})).expansion?.contains??[],x=[];for(const S of y)S.code&&!x.some(j=>j.code===S.code)&&x.push(S);return x},[t,s,n]);return a.jsx(US,{...d,creatable:r??!0,clearable:o??!0,toOption:fW,loadOptions:f,onCreate:hW,itemComponent:c?pW:void 0})}const pW=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(xe,{wrap:"nowrap",gap:"xs",children:[n&&a.jsx(Go,{size:12}),a.jsxs("div",{children:[a.jsx(be,{children:e}),a.jsx(be,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function vP(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[s,c]=v.useState(t);function d(f){const p=f[0],m=gW(p);c(m),n&&n(m)}return a.jsx(Ef,{defaultValue:mW(s),onChange:d,withHelpText:r??!0,...o})}function mW(e){return e?{code:e}:void 0}function gW(e){return e?.code}function FS(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,o=v.useCallback(s=>{n(s),r&&r(s)},[r]);return a.jsx(vP,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const vW="_navbar_qu4n7_1",yW="_logoButton_qu4n7_6",xW="_menuTitle_qu4n7_25",bW="_link_qu4n7_51",SW="_linkLabel_qu4n7_97",wW="_addBookmarkLink_qu4n7_108",jW="_toggleButton_qu4n7_118",CW="_divider_qu4n7_143",Yr={navbar:vW,logoButton:yW,menuTitle:xW,link:bW,linkLabel:SW,addBookmarkLink:wW,toggleButton:jW,divider:CW},EW="_actionSection_1l8yv_8",TW="_action_1l8yv_8",RW="_actionDescription_1l8yv_27",_W="_actionsGroup_1l8yv_32",DW="_actionsList_1l8yv_55",AW="_content_1l8yv_60",ls={actionSection:EW,action:TW,actionDescription:RW,actionsGroup:_W,actionsList:DW,content:AW},kW=200;function gR(){return a.jsxs(Me,{gap:"xs",py:"lg",children:[a.jsxs(be,{size:"sm",c:"dimmed",children:["Press ",a.jsx(Uc,{children:"⌘"})," + ",a.jsx(Uc,{children:"K"})," to open Search next time."]}),a.jsxs(be,{size:"sm",c:"dimmed",children:["(",a.jsx(Uc,{children:"Ctrl"})," + ",a.jsx(Uc,{children:"K"})," on Windows)"]})]})}function PW({patientsOnly:e}){const t=Re(),n=yu(),[r,o]=v.useState(a.jsx(gR,{})),[s,c]=v.useState([]),d=Xd(p=>{const m=NW(p);e?t.graphql(m).then(g=>{const x=vR(g).filter(S=>S.resourceType==="Patient");c(MW(x,n))}).catch(console.error).finally(()=>o("No results found")):Promise.all([t.graphql(m),t.valueSetExpand({url:"https://medplum.com/fhir/ValueSet/resource-types",filter:p,count:5})]).then(([g,y])=>{const x=vR(g),S=y.expansion?.contains??[];c(LW(x,S,n))}).catch(console.error).finally(()=>o("No results found"))},kW),f=p=>{if(!p){d.cancel(),o(a.jsx(gR,{})),c([]);return}o("Searching..."),d(p)};return a.jsx(gi,{actions:s,nothingFound:r,radius:"md",highlightQuery:!0,searchProps:{leftSection:a.jsx(eg,{size:"1.2rem",stroke:2,color:"var(--mantine-color-gray-5)"}),placeholder:"Start typing to search…",type:"search",autoComplete:"off",autoCorrect:"off",spellCheck:!1,name:e?"provider-spotlight-search":"spotlight-search",inputProps:{"data-1p-ignore":"true","data-lpignore":"true"},leftSectionProps:{style:{marginLeft:"calc(var(--mantine-spacing-md) - 12px)"}}},classNames:{body:ls.body,content:ls.content,search:ls.search,actionsList:ls.actionsList,action:ls.action,actionSection:ls.actionSection,actionDescription:ls.actionDescription,actionsGroup:ls.actionsGroup},onQueryChange:f})}function NW(e){const t=JSON.stringify(e);return pS(e)?`{
|
|
160
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
161
|
-
resourceType
|
|
162
|
-
id
|
|
163
|
-
identifier { system value }
|
|
164
|
-
name { given family }
|
|
165
|
-
birthDate
|
|
166
|
-
photo { url contentType }
|
|
167
|
-
}
|
|
168
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
169
|
-
resourceType
|
|
170
|
-
id
|
|
171
|
-
identifier { system value }
|
|
172
|
-
subject { display }
|
|
173
|
-
}
|
|
174
|
-
}`.replaceAll(/\s+/g," "):`{
|
|
175
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
176
|
-
resourceType
|
|
177
|
-
id
|
|
178
|
-
identifier { system value }
|
|
179
|
-
name { given family }
|
|
180
|
-
birthDate
|
|
181
|
-
photo { url contentType }
|
|
182
|
-
}
|
|
183
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
184
|
-
resourceType
|
|
185
|
-
id
|
|
186
|
-
identifier { system value }
|
|
187
|
-
name { given family }
|
|
188
|
-
birthDate
|
|
189
|
-
photo { url contentType }
|
|
190
|
-
}
|
|
191
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
192
|
-
resourceType
|
|
193
|
-
id
|
|
194
|
-
identifier { system value }
|
|
195
|
-
subject { display }
|
|
196
|
-
}
|
|
197
|
-
}`.replaceAll(/\s+/g," ")}function vR(e){const t=[];return e.data.Patients1&&t.push(...e.data.Patients1),e.data.Patients2&&t.push(...e.data.Patients2),e.data.ServiceRequestList&&t.push(...e.data.ServiceRequestList),OW(t)}function OW(e){const t=new Set,n=[];for(const r of e)r.id&&!t.has(r.id)&&(t.add(r.id),n.push(r));return n}function MW(e,t){const n=e.filter(r=>!!r.id).map(r=>({id:r.id,label:r.name?Pa(r.name[0]):r.id,description:r.birthDate,leftSection:a.jsx(co,{value:r,radius:"xl",size:24}),onClick:()=>t(`/Patient/${r.id}`)}));return n.length>0?[{group:"Patients",actions:n}]:[]}function LW(e,t,n){const r=[],o=t.map(d=>({id:`resource-type-${d.code}`,label:d.display??d.code??"",description:"Resource Type",onClick:()=>n(`/${d.code}`)}));o.length>0&&r.push({group:"Resource Types",actions:o});const s=[],c=[];for(const d of e)d.resourceType==="Patient"&&d.id?s.push({id:d.id,label:d.name?Pa(d.name[0]):d.id,description:d.birthDate,leftSection:a.jsx(co,{value:d,radius:"xl",size:24}),onClick:()=>n(`/Patient/${d.id}`)}):d.resourceType==="ServiceRequest"&&d.id&&c.push({id:d.id,label:d.id,description:d.subject?.display,onClick:()=>n(`/ServiceRequest/${d.id}`)});return s.length>0&&r.push({group:"Patients",actions:s}),c.length>0&&r.push({group:"Service Requests",actions:c}),r}function yR(e){const t=yu(),n=Sf(),r=zW(e.pathname,e.searchParams,e.menus),[o,s]=v.useState(!1),[c,d]=v.useState(!1);function f(g,y){g.stopPropagation(),g.preventDefault(),t(y),window.innerWidth<768&&e.closeNavbar()}function p(g){g&&t(`/${g}`)}const m=e.opened??!0;return a.jsxs(a.Fragment,{children:[a.jsxs(Tr.Navbar,{id:"navbar",className:Yr.navbar,children:[e.logo&&a.jsx(Tr.Section,{px:"xs",pt:"xs",pb:"4px",children:a.jsx(Pn,{className:Yr.logoButton,onClick:e.navbarToggle,"aria-expanded":m,"aria-controls":"navbar",children:e.logo})}),a.jsx(Jr,{px:"xs",pb:"xs",pt:"sm",h:"100%",children:a.jsxs(Tr.Section,{grow:!0,children:[e.spotlightEnabled&&a.jsx(le,{mb:2,children:a.jsx(fi,{label:"Search",position:"right",transitionProps:{duration:0},disabled:m,children:a.jsxs(Pn,{className:Yr.link,onClick:()=>Cf.open(),children:[a.jsx(eg,{size:"1.2rem"}),a.jsx("span",{className:Yr.linkLabel,"data-opened":m||void 0,children:"Search"})]})})}),e.spotlightEnabled&&a.jsx(PW,{patientsOnly:e.patientsOnly}),!e.resourceTypeSearchDisabled&&a.jsx(Tr.Section,{mb:"sm",children:a.jsx(FS,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:g=>p(g)},window.location.pathname)}),e.menus?.map((g,y)=>a.jsxs(v.Fragment,{children:[g.title&&a.jsx(be,{className:Yr.menuTitle,"data-opened":m||void 0,children:g.title}),a.jsx(Me,{gap:"2",children:g.links?.map(x=>a.jsx(IW,{to:x.href,active:x.href===r?.href,onClick:S=>f(S,x.href),icon:x.icon,label:x.label??"",opened:m},x.href))})]},`menu-${g.title??y}`)),e.displayAddBookmark&&a.jsx(fi,{label:"Add Bookmark",position:"right",transitionProps:{duration:0},disabled:m,children:a.jsxs(Pn,{className:`${Yr.link} ${Yr.addBookmarkLink}`,onClick:()=>d(!0),children:[a.jsx(Fd,{}),a.jsx("span",{className:Yr.linkLabel,"data-opened":m||void 0,children:"Add Bookmark"})]})})]})}),e.userMenuEnabled&&a.jsxs(Tr.Section,{px:"xs",py:"xs",children:[a.jsx(fi,{label:m?"Close Sidebar":"Open Sidebar",position:"right",transitionProps:{duration:0},children:a.jsx(Pn,{className:Yr.toggleButton,"aria-label":m?"Close Sidebar":"Open Sidebar",onClick:e.navbarToggle,"aria-expanded":m,"aria-controls":"navbar",children:a.jsx(fG,{})})}),a.jsx(Sn,{my:"xs",mx:6,className:Yr.divider}),a.jsxs(Se,{width:260,shadow:"xl",position:"top-start",transitionProps:{transition:"fade-up"},opened:o,onClose:()=>s(!1),children:[a.jsx(Se.Target,{children:a.jsxs(Pn,{className:Yr.link,pl:"7","aria-label":"User menu","data-active":o||void 0,onClick:()=>s(g=>!g),bd:"1px 0 0 0 solid var(--mantine-color-gray-200)",children:[a.jsx(co,{value:n,radius:"xl",size:24}),a.jsx("span",{className:Yr.linkLabel,"data-opened":m||void 0,children:Pa(n?.name?.[0])})]})}),a.jsx(Se.Dropdown,{children:a.jsx(lP,{version:e.version})})]})]})]}),e.pathname&&e.searchParams&&a.jsx(cW,{pathname:e.pathname,searchParams:e.searchParams,visible:c,onOk:()=>d(!1),onCancel:()=>d(!1)})]})}function IW(e){const{to:t,icon:n,label:r,onClick:o,active:s}=e;return a.jsx(fi,{label:r,position:"right",transitionProps:{duration:0},disabled:e.opened,children:a.jsxs(St,{to:t,onClick:o,className:Yr.link,"data-active":s||void 0,children:[n??a.jsx(dq,{}),a.jsx("span",{className:Yr.linkLabel,"data-opened":e.opened||void 0,children:r})]})})}function zW(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const s of n)if(s.links)for(const c of s.links){const d=$W(e,t,c.href);d>o&&(o=d,r=c)}return r}function $W(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[c,d]of r.searchParams.entries())if(!o.includes(c)&&t.get(c)!==d)return 0;let s=1;for(const[c,d]of t.entries())o.includes(c)||r.searchParams.get(c)===d&&s++;return s}const xR=250,UW=59;function BW(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),[r]=v.useState(e.layoutVersion??localStorage.appShellLayoutVersion??"v1"),o=Re(),s=Sf();function c(x){localStorage.navbarOpen=x.toString(),n(x)}function d(){c(!1)}function f(){c(!t)}if(o.isLoading())return a.jsx(Mi,{});let p,m,g,y;return r==="v2"?(p={height:0},m={width:t?xR:UW,breakpoint:0,collapsed:{desktop:!s,mobile:!s}},g=void 0,y=s?a.jsx(yR,{logo:e.logo,pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,navbarToggle:f,closeNavbar:d,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:!0,opened:t,spotlightEnabled:!0,patientsOnly:e.spotlightPatientsOnly,userMenuEnabled:!0,version:e.version}):void 0):(p={height:60},m={width:xR,breakpoint:"sm",collapsed:{desktop:!s||!t,mobile:!s||!t}},g=s&&a.jsx($Q,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarOpen:t,navbarToggle:f,notifications:e.notifications}),y=s&&t?a.jsx(yR,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,navbarToggle:f,closeNavbar:d,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled,patientsOnly:e.spotlightPatientsOnly}):void 0),a.jsxs(Tr,{header:p,navbar:m,padding:0,children:[g,y,a.jsx(Tr.Main,{className:vQ.main,children:a.jsx(IS,{children:a.jsx(v.Suspense,{fallback:a.jsx(Mi,{}),children:e.children})})})]})}const VW="https://ccda.medplum.com",FW="https://ccda-validator.medplum.com/";function HW(e){const{url:t}=e,[n,r]=v.useState(!1),o=v.useRef(null),[s,c]=v.useState(),[d,f]=v.useState(!1);v.useEffect(()=>{t&&n&&o.current&&(Ed(o.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{f(!0);const x=await(await fetch(t)).text(),S=new FormData;S.append("ccdaFile",new Blob([x],{type:"text/xml"}),"ccda.xml");const j=`${FW}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 T=await C.json();c(T)}catch(y){c(void 0),console.error("CCDA validation error:",y)}finally{f(!1)}},m=()=>{if(!s)return;const y=JSON.stringify(s,null,2);aP(y,"ccda-validation-results")},g=()=>s?s.resultsMetaData.resultMetaData.filter(y=>y?.type.includes("Error")).reduce((y,x)=>y+(x.count||0),0):0;return t?a.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[a.jsx("div",{style:{minHeight:400},children:a.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:o,src:VW,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),a.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[a.jsx(Ne,{type:"button",onClick:p,disabled:d,children:d?"Validating...":"Validate"}),s&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{marginLeft:"15px"},children:[a.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),a.jsx(Ne,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function Tf(e){const{contentType:t,url:n,title:r}=e.value??{},o=Hk(n);return o?a.jsxs("div",{"data-testid":"attachment-display",children:[t?.startsWith("image/")&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),t?.startsWith("video/")&&a.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:a.jsx("source",{type:t,src:o})}),(t?.startsWith("text/")||t==="application/json"||t==="application/pdf")&&a.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:a.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===tn.CDA_XML&&a.jsx(HW,{url:o}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(Tt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:qW(r),children:r||"Download"})})]}):null}function qW(e){return e?.includes(".")?e:void 0}const GW="_root_1bd5a_1",QW="_compact_1bd5a_19",bR={root:GW,compact:QW};function Rf(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:Ut(bR.root,{[bR.compact]:n}),children:t})}function Ir(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function WW(e){const t=e.values?.map((r,o)=>a.jsx("div",{children:a.jsx(Tf,{value:r,maxWidth:e.maxWidth})},"attatchment-"+o));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!Mn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const r=e.path.split(".").pop();n=a.jsx(Ir,{term:jl(r),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function HS(e){const t=Re(),n=v.useRef(null);function r(c){vn(c),n.current?.click()}function o(c){vn(c);const d=c.target.files;d&&Array.from(d).forEach(s)}function s(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Qt(f))}))}return a.jsxs(a.Fragment,{children:[a.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:c=>o(c)}),e.children({onClick:r,disabled:e.disabled})]})}function YW(e){const[t,n]=v.useState(e.defaultValue??[]),r=v.useRef(t);r.current=t;function o(s){n(s),e.onChange&&e.onChange(s)}return a.jsxs("table",{style:{width:"100%"},children:[a.jsxs("colgroup",{children:[a.jsx("col",{width:"97%"}),a.jsx("col",{width:"3%"})]}),a.jsxs("tbody",{children:[t.map((s,c)=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Tf,{value:s,maxWidth:200})}),a.jsx("td",{children:a.jsx(En,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:d=>{vn(d);const f=t.slice();f.splice(c,1),o(f)},children:a.jsx(qp,{})})})]},`${c}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(HS,{disabled:e.disabled,onUpload:s=>{o([...r.current,s])},children:s=>a.jsx(En,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:a.jsx(NS,{})})})})]})]})]})}function yP(e){const[t,n]=v.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?a.jsxs(a.Fragment,{children:[a.jsx(Tf,{value:t,maxWidth:200}),a.jsx(Ne,{disabled:e.disabled,onClick:o=>{vn(o),r(void 0)},children:"Remove"})]}):a.jsx(HS,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(Ne,{...o,children:"Upload..."})})}function Bi(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180 180",style:{width:e.size,height:e.size},children:[a.jsx("title",{children:"Medplum Logo"}),a.jsx("path",{fill:e.fill??"#9c36b5",d:"M84 56c-3-15-15-24-23-28l5-10c8 2 14 8 20 14 0-12 1-16 5-21 8-9 13-9 41-9 0 7 1 18-3 24-7 9-16 7-41 8 5 8 7 14 8 22 36-24 74-7 74 39 0 42-40 83-80 83s-80-41-80-83c0-46 38-63 74-39Zm-3 43H65c-4 0-7 3-7 7v4c0 4 3 7 7 7h16v16c0 4 3 7 7 7h4c4 0 7-3 7-7v-16h16c4 0 7-3 7-7v-4c0-4-3-7-7-7H99V83c0-4-3-7-7-7h-4c-4 0-7 3-7 7z"})]})}function Qp(e){const[t,n]=v.useState();return a.jsxs(pt,{onSubmit:r=>{n(void 0),e.onSubmit(r)?.catch(o=>n(Qe(o)))},children:[a.jsxs(To,{style:{flexDirection:"column"},children:[a.jsx(Bi,{size:32}),a.jsx(Ue,{order:3,py:"lg",children:e.title}),!e.qrCodeUrl&&e.description&&a.jsx(be,{c:"dimmed",mb:"lg",mt:"-lg",children:e.description})]}),t&&a.jsx(Fo,{icon:a.jsx(As,{size:16}),title:"Error",color:"red",mb:"lg",children:t}),e.qrCodeUrl&&a.jsx(To,{children:a.jsxs(Me,{mb:"xl",children:[e.description&&a.jsx(be,{c:"dimmed",mb:"md",mt:"-lg",ta:"center",children:e.description}),a.jsx(D0,{src:e.qrCodeUrl,alt:"Multi Factor Auth QR Code",w:"60%",mx:"auto",radius:"md",p:"xs",bg:"var(--mantine-color-white)",style:{border:"1px solid light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-4))"}})]})}),a.jsx(Me,{gap:"sm",children:a.jsx(He,{name:"token",label:"MFA code",autoComplete:"one-time-code",required:!0,autoFocus:!0})}),a.jsx(Me,{gap:"xs",pt:"md",children:a.jsx(cr,{fullWidth:!0,children:e.buttonText})})]})}const KW="_root_1vii2_1",XW={root:KW};function bu(e){const{children:t,...n}=e;return a.jsx(cf,{className:XW.root,...n,children:t})}const JW="_paper_1igaj_1",ZW="_fill_1igaj_20",SR={paper:JW,fill:ZW};function Bl(e){const{width:t,fill:n,className:r,children:o,...s}=e,c=t?{maxWidth:t}:void 0;return a.jsx(Mr,{className:Ut(SR.paper,n&&SR.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...s,children:o})}function ut(e){const{children:t,...n}=e;return a.jsx(bu,{children:a.jsx(Bl,{...n,children:t})})}function ur(e){const{outcome:t,issues:n,...r}=e,o=t?.issue||n;return!o||o.length===0?null:a.jsx(Fo,{icon:a.jsx(As,{size:16}),color:"red",...r,children:o.map(s=>a.jsx("div",{"data-testid":"text-field-error",children:JA(s)},s.details?.text))})}function $t(e,t){return e?.issue?.filter(n=>xP(n.expression?.[0],t))?.map(n=>n.details?.text)?.join(`
|
|
198
|
-
`)}function ks(e,t){return e?.issue?.filter(n=>xP(n.expression?.[0],t))}const ap=/\[\d+\]/;function xP(e,t){const n=typeof e=="string"&&ap.test(e),r=typeof t=="string"&&ap.test(t);if(n!==r&&(e=e?.replace(ap,""),t=t?.replace(ap,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const s=t.indexOf(".");return s>=0&&t.substring(s+1)===e}function bP(e){const t=Re(),[n,r]=v.useState(),o=ks(n,void 0);return a.jsxs(pt,{onSubmit:async s=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:s.projectName}))}catch(c){r(Qt(c))}},children:[a.jsxs(rr,{direction:"column",align:"center",justify:"center",children:[a.jsx(Bi,{size:32}),a.jsx(Ue,{order:3,py:"lg",children:"Create a new project"})]}),a.jsx(ur,{issues:o,mb:"lg"}),a.jsx(Me,{gap:"sm",children:a.jsx(He,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:$t(n,"projectName")})}),a.jsxs(Me,{gap:"xs",mt:"md",children:[a.jsx(cr,{fullWidth:!0,children:"Create Project"}),a.jsxs(be,{c:"dimmed",size:"xs",pt:"lg",ta:"center",children:['By clicking "Create Project" you agree to the Medplum'," ",a.jsx(Tt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Tt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]})]})}function SP(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 wP(e){const{googleClientId:t,handleGoogleCredential:n}=e,r=v.useRef(null),[o,s]=v.useState(typeof google<"u"),c=v.useRef(!1),d=v.useRef(!1);return v.useEffect(()=>{if(typeof google>"u"){SP("https://accounts.google.com/gsi/client",()=>s(!0));return}c.current||(google.accounts.id.initialize({client_id:t,callback:n}),c.current=!0),r.current&&!d.current&&(google.accounts.id.renderButton(r.current,{type:"standard",logo_alignment:"center",width:r.current.clientWidth}),d.current=!0)},[t,o,n]),t?a.jsx(le,{ref:r,w:"100%",h:40,display:"flex",style:{justifyContent:"center"}}):null}function jP(e){if(e)return e;const t=er.getOrigin();if(t&&[].includes(t))return"__GOOGLE_CLIENT_ID__"}function CP(e){typeof grecaptcha>"u"&&SP("https://www.google.com/recaptcha/api.js?render="+e)}function EP(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function eY(e){const t=jP(e.googleClientId),n=e.recaptchaSiteKey,r=Re(),[o,s]=v.useState(),c=ks(o,void 0);return v.useEffect(()=>{n&&CP(n)},[n]),a.jsxs(pt,{onSubmit:async d=>{s(void 0);try{let f="";n&&(f=await EP(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:d.firstName,lastName:d.lastName,email:d.email,password:d.password,remember:d.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){s(Qt(f))}},children:[a.jsx(rr,{direction:"column",align:"center",justify:"center",children:e.children}),a.jsx(ur,{issues:c,mb:"lg"}),t&&a.jsxs(a.Fragment,{children:[a.jsx(le,{style:{minHeight:40},children:a.jsx(wP,{googleClientId:t,handleGoogleCredential:async d=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:d.clientId,googleCredential:d.credential,projectId:e.projectId,createUser:!0}))}catch(f){s(Qt(f))}}})}),a.jsx(Sn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Me,{gap:"sm",children:[a.jsx(He,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:$t(o,"firstName")}),a.jsx(He,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:$t(o,"lastName")}),a.jsx(He,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:$t(o,"email")}),a.jsx(no,{name:"password",label:"Password",autoComplete:"off",required:!0,error:$t(o,"password")})]}),a.jsxs(Me,{gap:"xs",children:[a.jsx(un,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1},pt:"md",pb:"xs"}),a.jsx(cr,{fullWidth:!0,children:"Register Account"}),a.jsxs(be,{c:"dimmed",size:"xs",pt:"lg",ta:"center",children:['By clicking "Register Account" you agree to the Medplum'," ",a.jsx(Tt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Tt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(be,{c:"dimmed",size:"xs",ta:"center",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Tt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Tt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]})]})}function tY(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,onSuccess:c}=e,d=Re(),[f,p]=v.useState(),[m,g]=v.useState();v.useEffect(()=>{t==="patient"&&f&&d.startNewPatient({login:f,projectId:n}).then(S=>d.processCode(S.code)).then(()=>c()).catch(S=>g(Qt(S)))},[d,t,n,f,c]);function y(S){S.code?d.processCode(S.code).then(()=>c()).catch(j=>g(Qt(j))):S.login&&p(S.login)}const x=ks(m,void 0);return a.jsxs(ut,{width:400,px:"xl",py:"xl",bdrs:"md",children:[a.jsx(ur,{issues:x,mb:"lg"}),!f&&a.jsx(eY,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,handleAuthResponse:y,children:e.children}),f&&t==="project"&&a.jsx(bP,{login:f,handleAuthResponse:y})]})}function nY(e){const[t,n]=v.useState();return t?a.jsx(iY,{email:t,resetEmail:()=>n(void 0),...e}):a.jsx(rY,{setEmail:n,...e})}function rY(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:s,...c}=e,d=Re(),f=!e.disableGoogleAuth&&jP(e.googleClientId),[p,m]=v.useState(),g=ks(p,void 0),y=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await d.ensureCodeChallenge(c),domain:j.domain}),T=new URL(j.authorizeUrl);return T.searchParams.set("state",C),er.assign(T.toString()),!0},[d,c]),x=v.useCallback(async j=>{const C=await d.post("auth/method",{email:j.email});await y(C)||t(j.email)},[d,y,t]),S=v.useCallback(async j=>{try{const C=await d.startGoogleLogin({...c,googleCredential:j.credential});await y(C)||r(C)}catch(C){m(Qt(C))}},[d,c,y,r]);return a.jsxs(pt,{onSubmit:x,children:[a.jsx(rr,{direction:"column",align:"center",justify:"center",children:o}),a.jsx(ur,{issues:g,mb:"lg"}),f&&a.jsxs(a.Fragment,{children:[a.jsx(le,{style:{minHeight:40},children:a.jsx(wP,{googleClientId:f,handleGoogleCredential:S})}),!s&&a.jsx(Sn,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&a.jsx(He,{name:"email",type:"email",label:"Email",mb:"md",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:$t(p,"email"),"data-testid":"auth.email"}),a.jsxs(Me,{gap:"xs",children:[!s&&a.jsx(cr,{fullWidth:!0,children:"Continue"}),n&&a.jsxs(be,{size:"sm",mt:"lg",c:"dimmed",style:{textAlign:"center"},"data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:["Don’t have an account? ",a.jsx(Tt,{onClick:n,children:"Register"})]})]})]})}function iY(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,s=Re(),[c,d]=v.useState(),f=ks(c,void 0),p=v.useCallback(m=>{s.startLogin({...o,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>d(Qt(g)))},[s,o,n]);return a.jsxs(pt,{onSubmit:p,children:[a.jsx(rr,{direction:"column",align:"center",justify:"center",children:r}),a.jsx(ur,{issues:f,mb:"lg"}),a.jsxs(Me,{gap:"sm",children:[a.jsx(He,{label:"Email",value:e.email,disabled:!0,rightSectionWidth:36,rightSection:a.jsx(En,{variant:"subtle",color:"gray",onClick:e.resetEmail,"aria-label":"Change email",children:a.jsx(kG,{size:"1rem",stroke:1.5})})}),a.jsx(no,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:$t(c,"password"),"data-testid":"auth.password"})]}),a.jsxs(Me,{gap:"xs",children:[a.jsx(un,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1},pt:"md",pb:"xs"}),a.jsx(cr,{children:"Sign In"}),t&&a.jsx(be,{size:"sm",mt:"lg",c:"dimmed",style:{textAlign:"center"},"data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:a.jsx(Tt,{onClick:t,children:"Reset Password"})})]})]})}const oY="_option_18k89_1",aY="_iconBox_18k89_9",TP={option:oY,iconBox:aY};function sY(e){const t=Re(),n=Il(),[r,o]=v.useState(""),[s,c]=v.useState();function d(g){return!!g?.toLowerCase()?.includes(r.toLowerCase())}function f(g){return d(g.profile?.display)||d(g.project?.display)}function p(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(y=>c(Qt(y)))}const m=e.memberships.filter(f).slice(0,10).map(g=>a.jsx(Ke.Option,{value:g.id,className:TP.option,children:a.jsx(cY,{...g})},g.id));return a.jsxs(Me,{gap:"0",children:[a.jsxs(rr,{justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(Bi,{size:32}),a.jsx(Ue,{order:3,py:"lg",children:"Choose a Project"})]}),a.jsx(ur,{outcome:s,mb:"lg"}),a.jsxs(Ke,{store:n,onOptionSubmit:p,children:[a.jsx(Ke.EventsTarget,{children:a.jsx(He,{placeholder:"Search",value:r,mb:"md",autoFocus:!0,leftSection:a.jsx(eg,{size:16}),onChange:g=>{o(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(Ke.Options,{style:{marginLeft:"-10px",marginRight:"-10px",marginBottom:"-10px"},children:m.length>0?m:a.jsx(Ke.Empty,{children:"Nothing found..."})})})]}),a.jsx(be,{size:"sm",ta:"center",mt:"md",children:a.jsx(Tt,{component:"button",type:"button",onClick:()=>{window.location.href=`/signin?project=new&login=${e.login}`},children:"Create a new project"})})]})}function lY(e){return e.identifier?.find(t=>t.system==="https://medplum.com/identifier/label")?.value}function cY(e){const t=lY(e);return a.jsxs(xe,{gap:"xs",align:"center",children:[a.jsx(le,{className:TP.iconBox,children:a.jsx(xq,{size:16,stroke:2})}),a.jsxs("div",{children:[a.jsxs(be,{size:"sm",fw:500,children:[e.project?.display," ",t?` - ${t}`:""]}),a.jsx(be,{size:"xs",c:"dimmed",children:e.profile?.display})]})]})}const uY=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,dY="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",fY="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",hY="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",pY=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,mY="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",gY="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",vY="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",yY="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",xY="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",bY="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function SY(e){const t=Re();return a.jsx(pt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Me,{children:[a.jsxs(rr,{direction:"column",align:"center",justify:"center",children:[a.jsx(Bi,{size:32}),a.jsx(Ue,{order:3,py:"lg",children:"Choose scope"})]}),a.jsx(Me,{children:(e.scope??"openid").split(" ").map(n=>{let r;return uY.test(n)?r=[n+dY,n+fY,n+hY]:pY.test(n)&&(r=[n+mY,n+gY,n+vY,n+yY,n+xY,n+bY]),a.jsxs(a.Fragment,{children:[a.jsx(un,{id:n,name:n,label:n,defaultChecked:!0},n),r?.map(o=>a.jsx(un,{id:o,name:o,label:o},o))]},n+"_group")})}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(cr,{fullWidth:!0,children:"Set Scope"})})]})})}function RP(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:s,onCode:c,...d}=e,f=Re(),[p,m]=v.useState(),g=v.useRef(!1),[y,x]=v.useState(!1),[S,j]=v.useState(),[C,T]=v.useState(!1),[R,E]=v.useState(),_=v.useCallback(D=>{c?c(D):f.processCode(D).then(()=>{r&&r()}).catch(P=>ke({color:"red",message:Qe(P)}))},[f,c,r]),k=v.useCallback(D=>{x(!!D.mfaEnrollRequired),j(D.enrollQrCode),T(!!D.mfaRequired),D.login&&m(D.login),D.memberships&&E(D.memberships),D.code&&(n?E(void 0):_(D.code))},[n,_]),I=v.useCallback(D=>{_(D.code)},[_]);return v.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(k).catch(D=>ke({color:"red",message:Qe(D)})))},[f,t,g,p,k]),a.jsx(ut,{width:400,px:"xl",py:"xl",bdrs:"md",children:p?y&&S?a.jsx(Qp,{title:"Enroll in MFA",description:"Scan this QR code with your authenticator app.",buttonText:"Enroll",qrCodeUrl:S,onSubmit:async D=>{const P=await f.post("auth/mfa/login-enroll",{login:p,token:D.token});k(P)}}):C?a.jsx(Qp,{title:"Enter MFA code",description:"Enter the code from your authenticator app.",buttonText:"Submit Code",onSubmit:async D=>{const P=await f.post("auth/mfa/verify",{login:p,token:D.token});k(P)}}):e.projectId==="new"?a.jsx(bP,{login:p,handleAuthResponse:k}):R?a.jsx(sY,{login:p,memberships:R,handleAuthResponse:k}):e.chooseScopes?a.jsx(SY,{login:p,scope:e.scope,handleAuthResponse:I}):a.jsx("div",{children:"Success"}):a.jsx(nY,{onForgotPassword:o,onRegister:s,handleAuthResponse:k,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...d,children:e.children})})}function Po(e){return a.jsx(a.Fragment,{children:bs(e.value)})}function wY(e){return a.jsx(a.Fragment,{children:bf(e.value)})}function _P(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),a.jsx(a.Fragment,{children:n.join("").trim()})}function jY(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",t.telecom?.map(n=>a.jsx(_P,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function lg(e,t,n){const r=zd(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function CY(e,t,n){const r=ok(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function EY(e){const{elementDefinitionType:t}=e,n=Re(),r=v.useContext(pn),[o,s]=v.useState(nk("Extension")),c=v.useMemo(()=>{if(Mn(t?.profile))return t.profile[0]},[t]),[d,f]=v.useState(c!==void 0);if(v.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=vu(c);f(!1),g&&s(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(d||!uS(c)))return a.jsx("div",{children:"Loading..."});if(o.elements["value[x]"]?.max!==0){const[g,y]=lg({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return a.jsx(so,{propertyType:y,value:g})}return a.jsx(Yp,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function TY(e){return a.jsxs("div",{children:[e.value?.system,": ",e.value?.value]})}function RY(e){return a.jsx(a.Fragment,{children:QB(e.value)})}function qd(e){return a.jsx(a.Fragment,{children:fl(e.value)})}function qS(e){return a.jsx(a.Fragment,{children:Ud(e.value)})}function _Y(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(qd,{value:t.numerator})," / ",a.jsx(qd,{value:t.denominator})]}):null}function Wp(e){if(!e.value)return null;const t=e.value.display||e.value.reference||ao(e.value);return e.link!==!1&&e.value.reference?a.jsx(St,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function DP(e,t,n,r){if(!Mn(n?.slices))return[e];const o=new Array(t.length+1);for(let s=0;s<o.length;s++)o[s]=[];for(const s of e){const c=Uk(s,t,n.discriminator,r);let d=c?t.findIndex(f=>f.name===c):-1;d===-1&&(d=t.length),o[d].push(s)}return o}async function AP({medplum:e,property:t}){return new Promise((n,r)=>{if(!t.slicing){n([]);return}const o=[],s=[],c=[];for(const d of t.slicing.slices){if(!$k(d)){console.debug("Unsupported slice definition",d);continue}let f;Mn(d.elements)||(f=d.type[0]?.profile?.[0]),o.push(d),s.push(f),f&&c.push(e.requestProfileSchema(f))}Promise.all(c).then(()=>{for(let d=0;d<o.length;d++){const f=o[d],p=s[d];if(p){const m=vu(p);f.typeSchema=m}}n(o)}).catch(r)})}function cg(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function DY(e){const{slice:t,property:n}=e,r=t.typeSchema?.elements??t.elements,o=v.useContext(pn),s=v.useMemo(()=>{if(Mn(r))return ru({parentContext:o,elements:r,path:e.path,profileUrl:t.typeSchema?.url})},[o,e.path,t.typeSchema?.url,r]);return cg(pn.Provider,s,a.jsx(a.Fragment,{children:e.value.map((c,d)=>a.jsx("div",{children:a.jsx(so,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${d}-${e.value.length}`))}))}const wR=50;function AY(e){const{property:t,propertyType:n}=e,r=Re(),o=v.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[s,c]=v.useState(!0),[d,f]=v.useState([]),[p,m]=v.useState(()=>[o]),[g,y]=v.useState(0),x=v.useContext(pn);if(v.useEffect(()=>{AP({medplum:r,property:t}).then(C=>{y(o.length),f(C);const T=o.slice(0,wR),R=DP(T,C,t.slicing,x.profileUrl);m(R),c(!1)}).catch(C=>{console.error(C),c(!1)})},[r,t,x.profileUrl,m,o]),s)return a.jsx("div",{children:"Loading..."});let S;if(t.type[0]?.code!=="Extension"){const C=p[d.length],T=C.map((R,E)=>a.jsx("div",{children:a.jsx(so,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:R,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${E}-${C.length}`));if(e.includeDescriptionListEntry){if(!Mn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const R=e.path.split(".").pop();S=a.jsx(Ir,{term:jl(R),children:T})}else S=a.jsx(a.Fragment,{children:T})}return a.jsxs(a.Fragment,{children:[d.map((C,T)=>{if(!e.path)throw new Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let R=a.jsx(DY,{path:e.path,slice:C,property:t,value:p[T],ignoreMissingValues:e.ignoreMissingValues,link:e.link},C.name);return e.includeDescriptionListEntry&&(R=a.jsx(Ir,{term:jl(C.name),children:R},C.name)),R}),S,g>wR&&a.jsx(xe,{justify:"right",children:a.jsxs(be,{children:["... ",g," total values"]})})]})}function so(e){const{property:t,propertyType:n,value:r}=e;if(t?.path?.endsWith(".id"))return a.jsxs(rr,{gap:3,align:"center",children:[r,!Cn(r)&&a.jsx(C0,{value:r,timeout:2e3,children:({copied:s,copy:c})=>a.jsx(fi,{label:s?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(En,{variant:"subtle",color:s?"teal":"gray",onClick:c,children:s?a.jsx(Go,{size:"1rem"}):a.jsx(OS,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===re.Attachment?a.jsx(WW,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(AY,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case re.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case re.SystemString:case re.string:return e.property?.path?.toLowerCase().includes("secret")?a.jsx(kY,{value:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case re.code:case re.date:case re.decimal:case re.id:case re.integer:case re.positiveInt:case re.unsignedInt:case re.uri:case re.url:case re.xhtml:return a.jsx(a.Fragment,{children:r});case re.canonical:return a.jsx(Wp,{value:{reference:r},link:e.link});case re.dateTime:case re.instant:return a.jsx(a.Fragment,{children:Dr(r)});case re.time:return a.jsx(a.Fragment,{children:wk(r)});case re.markdown:return a.jsx("pre",{children:r});case re.Address:return a.jsx(QH,{value:r});case re.Annotation:return a.jsx(a.Fragment,{children:r?.text});case re.Attachment:return a.jsx(Tf,{value:r,maxWidth:e.maxWidth});case re.CodeableConcept:return a.jsx(Po,{value:r});case re.Coding:return a.jsx(wY,{value:r});case re.ContactDetail:return a.jsx(jY,{value:r});case re.ContactPoint:return a.jsx(_P,{value:r});case re.HumanName:return a.jsx($S,{value:r});case re.Identifier:return a.jsx(TY,{value:r});case re.Money:return a.jsx(RY,{value:r});case re.Period:return a.jsx(a.Fragment,{children:VB(r)});case re.Quantity:case re.Duration:return a.jsx(qd,{value:r});case re.Range:return a.jsx(qS,{value:r});case re.Ratio:return a.jsx(_Y,{value:r});case re.Reference:return a.jsx(Wp,{value:r,link:e.link});case re.Timing:return a.jsx(a.Fragment,{children:jk(r)});case re.Dosage:case re.UsageContext:if(!e.path)throw new Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Yp,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case re.Extension:if(!e.path)throw new Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(EY,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw new Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw new Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Yp,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function kY(e){const[t,n]=v.useState(!1),r=e.value??"",o=!Cn(r),s="•".repeat(8);return a.jsxs(rr,{gap:3,align:"center",children:[t?a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},"aria-hidden":"true",children:o?s:""}),o&&a.jsxs(a.Fragment,{children:[a.jsx(C0,{value:e.value,timeout:2e3,children:({copied:c,copy:d})=>a.jsx(fi,{label:c?"Copied":"Copy secret",withArrow:!0,position:"right",children:a.jsx(En,{variant:"subtle",color:c?"teal":"gray",onClick:d,"aria-label":c?"Copied":"Copy secret",children:c?a.jsx(Go,{size:"1rem"}):a.jsx(OS,{size:"1rem"})})})}),a.jsx(fi,{label:t?"Hide secret":"Show secret",withArrow:!0,position:"right",children:a.jsx(En,{variant:"subtle",color:"gray",onClick:()=>n(!t),"aria-label":t?"Hide secret":"Show secret",children:t?a.jsx(Xq,{size:"1rem"}):a.jsx(Zq,{size:"1rem"})})})]})]})}const kP=["extension","modifierExtension"],PY=Zk.filter(e=>!kP.includes(e));function Yp(e){const t=e.value,{value:n,type:r}=t,o=v.useContext(pn),s=e.profileUrl??o?.profileUrl,c=v.useMemo(()=>Hm(r,s),[s,r]),d=v.useMemo(()=>{if(c)return ru({parentContext:o,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,o,e.path,e.accessPolicyResource]);if(Cn(n))return null;if(!c)return a.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return a.jsx("div",{children:n.name});const f=d??o;return cg(pn.Provider,d,a.jsx(Rf,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{if(kP.includes(p)&&Cn(m.slicing?.slices))return null;if(PY.includes(p))return null;if(eP.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,y]=lg(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Cn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const x=m.max>1||m.isArray,S=a.jsx(so,{property:m,propertyType:y,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:x,link:e.link},p);return x?S:a.jsx(Ir,{term:jl(p),children:S},p)})}))}const NY="_dimmed_11me5_1",OY="_preserveBreaks_11me5_5",nb={dimmed:NY,preserveBreaks:OY},PP="Read Only";function NP(e,t){return e?a.jsx(fi.Floating,{label:e,children:t}):t}function OP(e){const{debugMode:t}=v.useContext(pn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,NP(e?.readonly?PP:void 0,a.jsxs(xe,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(hn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e?.readonly?nb.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function zt(e){const{debugMode:t}=v.useContext(pn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,NP(e?.readonly?PP:void 0,a.jsx(hn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:Ut({[nb.dimmed]:e?.readonly},nb.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:$t(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function MY(e,t,n,r,o){const s=r.type;if(s.length>1)for(const c of s){const d=t.replace("[x]",Wn(c.code));d in e&&delete e[d]}return Cn(o)?e[n]=void 0:e[n]=o,e}function LY(e){return!!e&&!Cn(e.url)&&!Cn(e.name)}function IY(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:s,valuePath:c,...d}=e,[f,p]=v.useState(t);function m(g){const y=$Y(g);p(y),n&&n(y)}return a.jsx(Ef,{defaultValue:f&&zY(f),onChange:m,withHelpText:r??!0,...d})}function zY(e){return e.coding?.map(t=>({system:t.system,code:t.code,display:t.display}))}function $Y(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function UY(e){const{defaultValue:t,onChange:n,withHelpText:r,response:o,...s}=e,[c,d]=v.useState(o?.answer?.[0]?.valueCoding??t);function f(p){const m=p[0],g=m&&VY(m);d(g),n&&n(g)}return a.jsx(Ef,{defaultValue:c?BY(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...s})}function BY(e){return{system:e.system,code:e.code,display:e.display}}function VY(e){return{system:e.system,code:e.code,display:e.display}}function MP(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=v.useContext(pn),[s,c]=v.useState(e.defaultValue),d=v.useRef(s);d.current=s;const[f,p,m]=v.useMemo(()=>["system","use","value"].map(E=>r[t+"."+E]),[r,t]),[g,y,x]=v.useMemo(()=>["system","use","value"].map(E=>o(t+"."+E)),[o,t]);function S(E){E&&Object.keys(E).length===0&&(E=void 0),c(E),e.onChange&&e.onChange(E)}function j(E){const _={...d.current,system:E};E||delete _.system,S(_)}function C(E){const _={...d.current,use:E};E||delete _.use,S(_)}function T(E){const _={...d.current,value:E};E||delete _.value,S(_)}const R=e.valuePath??t;return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(fn,{disabled:e.disabled||g?.readonly,"data-testid":"system",defaultValue:s?.system,required:(f?.min??0)>0,onChange:E=>j(E.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:$t(n,R+".system")}),a.jsx(fn,{disabled:e.disabled||y?.readonly,"data-testid":"use",defaultValue:s?.use,required:(p?.min??0)>0,onChange:E=>C(E.currentTarget.value),data:["","home","work","temp","old","mobile"],error:$t(n,R+".use")}),a.jsx(He,{disabled:e.disabled||x?.readonly,placeholder:"Value",defaultValue:s?.value,required:(m?.min??0)>0,onChange:E=>T(E.currentTarget.value),error:$t(n,R+".value")})]})}function FY(e){const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(pn),[s,c]=v.useMemo(()=>["name","telecom"].map(m=>o(e.path+"."+m)),[o,e.path]);function d(m){n(m),e.onChange&&e.onChange(m)}function f(m){const g={...r.current,name:m};m||delete g.name,d(g)}function p(m){const g={...r.current,telecom:m&&[m]};m||delete g.telecom,d(g)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(He,{disabled:e.disabled||s?.readonly,"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t?.name,onChange:m=>f(m.currentTarget.value)}),a.jsx(MP,{disabled:e.disabled||c?.readonly,name:e.name+"-telecom",path:e.path+".telecom",defaultValue:t?.telecom?.[0],onChange:p,outcome:e.outcome})]})}function HY(e){if(!e)return"";const t=new Date(e);return Gm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function GS(e){if(!e)return"";const t=new Date(e);return Gm(t)?t.toISOString():""}function No(e){return a.jsx(He,{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:qY(),step:1,defaultValue:HY(e.defaultValue),autoFocus:e.autoFocus,error:$t(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(GS(n))}}})}function qY(){return"datetime-local"}function GY(e){const{propertyType:t}=e,n=Re(),r=v.useMemo(()=>{if(Mn(t.profile))return t.profile[0]},[t]),[o,s]=v.useState(r!==void 0);return v.useEffect(()=>{r&&(s(!0),n.requestProfileSchema(r).then(()=>s(!1)).catch(c=>{s(!1),console.warn(c)}))},[n,r]),r&&(o||!uS(r))?a.jsx("div",{children:"Loading..."}):a.jsx(KS,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function QY(e){const{outcome:t,path:n}=e,[r,o]=v.useState(e.defaultValue),{getExtendedProps:s}=v.useContext(pn),[c,d,f,p,m]=v.useMemo(()=>["use","prefix","given","family","suffix"].map(R=>s(e.path+"."+R)),[s,e.path]);function g(R){o(R),e.onChange&&e.onChange(R)}function y(R){g({...r,use:R||void 0})}function x(R){g({...r,prefix:R?R.split(" "):void 0})}function S(R){g({...r,given:R?R.split(" "):void 0})}function j(R){g({...r,family:R||void 0})}function C(R){g({...r,suffix:R?R.split(" "):void 0})}const T=e.valuePath??n;return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(fn,{disabled:e.disabled||c?.readonly,defaultValue:r?.use,name:e.name+"-use","data-testid":"use",onChange:R=>y(R.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:$t(t,T+".use")}),a.jsx(He,{disabled:e.disabled||d?.readonly,placeholder:"Prefix",name:e.name+"-prefix",defaultValue:r?.prefix?.join(" "),onChange:R=>x(R.currentTarget.value),error:$t(t,T+".prefix")}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Given",name:e.name+"-given",defaultValue:r?.given?.join(" "),onChange:R=>S(R.currentTarget.value),error:$t(t,T+".given")}),a.jsx(He,{disabled:e.disabled||p?.readonly,name:e.name+"-family",placeholder:"Family",defaultValue:r?.family,onChange:R=>j(R.currentTarget.value),error:$t(t,T+".family")}),a.jsx(He,{disabled:e.disabled||m?.readonly,placeholder:"Suffix",name:e.name+"-suffix",defaultValue:r?.suffix?.join(" "),onChange:R=>C(R.currentTarget.value),error:$t(t,T+".suffix")})]})}function WY(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=v.useContext(pn),[s,c]=v.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[d,f]=v.useMemo(()=>["system","value"].map(g=>o(e.path+"."+g)),[o,e.path]);function p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(He,{disabled:e.disabled||d?.readonly,placeholder:"System",required:(s?.min??0)>0,defaultValue:t?.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:$t(e.outcome,m+".system")}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Value",required:(c?.min??0)>0,defaultValue:t?.value,onChange:g=>p({...t,value:g.currentTarget.value}),error:$t(e.outcome,m+".value")})]})}const YY=["USD","EUR","CAD","GBP","AUD"];function KY(e){const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:o}=v.useContext(pn),[s,c]=v.useMemo(()=>["currency","value"].map(g=>o(e.path+"."+g)),[o,e.path]),d=v.useCallback(g=>{r(g),t&&t(g)},[t]),f=v.useCallback(g=>{d({...n,currency:g.currentTarget.value})},[n,d]),p=v.useCallback(g=>{d({...n,value:g.currentTarget.valueAsNumber})},[n,d]),m=a.jsx(fn,{disabled:e.disabled||s?.readonly,defaultValue:n?.currency,data:YY,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return a.jsx(He,{disabled:e.disabled||c?.readonly,type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:n?.value?.toString()??"USD",leftSection:a.jsx(Uq,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function XY(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(pn),[o,s]=v.useMemo(()=>["start","end"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(No,{disabled:e.disabled||o?.readonly,name:e.name+".start",placeholder:"Start",defaultValue:t?.start,onChange:d=>c({...t,start:d})}),a.jsx(No,{disabled:e.disabled||s?.readonly,name:e.name+".end",placeholder:"End",defaultValue:t?.end,onChange:d=>c({...t,end:d})})]})}function Tl(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(pn),[o,s,c]=v.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function d(f){n(f),e.onChange&&e.onChange(f)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(fn,{disabled:e.disabled||o?.readonly,style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t?.comparator,data:["","<","<=",">=",">"],onChange:f=>d({...t,comparator:f.currentTarget.value})}),a.jsx(He,{disabled:e.disabled||s?.readonly,id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t?.value,autoFocus:e.autoFocus,step:"any",onWheel:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{d({...t,value:JY(f.currentTarget.value)})}}),a.jsx(He,{disabled:e.disabled||c?.readonly,placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t?.unit,onChange:f=>d({...t,unit:f.currentTarget.value})})]})}function JY(e){if(e)return Number.parseFloat(e)}function QS(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(pn),[o,s]=v.useMemo(()=>["low","high"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Tl,{path:e.path+".low",disabled:e.disabled||o?.readonly,name:e.name+"-low",defaultValue:t?.low,onChange:d=>c({...t,low:d})}),a.jsx(Tl,{path:e.path+".high",disabled:e.disabled||s?.readonly,name:e.name+"-high",defaultValue:t?.high,onChange:d=>c({...t,high:d})})]})}function ZY(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(pn),[o,s]=v.useMemo(()=>["numerator","denominator"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Tl,{path:e.path+".numerator",disabled:e.disabled||o?.readonly,name:e.name+"-numerator",defaultValue:t?.numerator,onChange:d=>c({...t,numerator:d})}),a.jsx(Tl,{path:e.path+".denominator",disabled:e.disabled||s?.readonly,name:e.name+"-denominator",defaultValue:t?.denominator,onChange:d=>c({...t,denominator:d})})]})}const eK={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},tK=["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 nK(e){return{value:It(e)??"",label:Ca(e),resource:e}}function Vl(e){const t=Re(),{resourceType:n,searchCriteria:r}=e,[o,s]=v.useState(),c=Xt(e.defaultValue,s),d=e.itemComponent??rK,f=e.onChange,p=v.useCallback(async(g,y)=>{const x=iK(n),S=new URLSearchParams({[x]:g??"",_count:"10",...r});return await t.searchResources(n,S,{signal:y})},[t,n,r]),m=v.useCallback(g=>{f&&f(g[0])},[f]);return Mn(e.defaultValue)&&!o&&!c?null:a.jsx(US,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:d,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:nK,loadOptions:p,onChange:m,clearable:!0})}const rK=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(xe,{wrap:"nowrap",children:[a.jsx(co,{value:t}),a.jsxs("div",{children:[a.jsx(be,{children:e}),a.jsx(be,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function iK(e){return eK[e]??(tK.includes(e)?"name":"_id")}function ys(e){const{onChange:t}=e,n=Re(),[r,o]=v.useState(e.defaultValue),[s,c]=v.useState(()=>oK(e.targetTypes)),[d,f]=v.useState(()=>aK(e.defaultValue,s)),p=v.useRef(new WA),m=v.useMemo(()=>d?.type==="profile"?{...e.searchCriteria,_profile:d.value}:e.searchCriteria,[e.searchCriteria,d]);v.useEffect(()=>{let x=!1;const S=s?.map(j=>{if(!lK(j))return Promise.resolve(j);x=!0;const C=j.value,T=p.current.get(C);if(T)return T;const R=sK(n,j.value).then(_=>{const k={...j};return _?Mn(_.type)?(k.resourceType=_.type,k.name=_.name,k.title=_.title):(console.error(`StructureDefinition.type missing for ${j.value}`),k.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),k.error="StructureDefinition not found"),k}).catch(_=>(console.error(_),{...j,error:_})),E=new Ji(R);return p.current.set(C,E),E});!S||!x||Promise.all(S).then(j=>{if(c(j),!d)return;const C=j.findIndex(T=>T.value===d.value||T.resourceType===d.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${d.resourceType}`);return}f(j[C])}).catch(console.error)},[n,d,s]);const g=v.useCallback(x=>{const S=x?Yt(x):void 0;o(S),t&&t(S)},[t]),y=v.useMemo(()=>s?s.map(x=>({value:x.value,label:x.type==="profile"?x.title??x.name??x.resourceType??x.value:x.value})):[],[s]);return a.jsxs(a.Fragment,{children:[e.name&&a.jsx("input",{type:"hidden",name:e.name,value:r?.reference??""}),a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s&&s.length>1&&a.jsx(fn,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:d?.resourceType,autoFocus:e.autoFocus,onChange:x=>{const S=x.currentTarget.value,j=s.find(C=>C.value===S);f(j)},data:y}),!s&&a.jsx(FS,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:d?.resourceType,onChange:x=>{f(x?{type:"resourceType",value:x,resourceType:x}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(Vl,{resourceType:d?.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function oK(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 aK(e,t){const n=e?.reference?.split("/")[0];if(n){const r=t?.find(o=>o.resourceType===n);return r||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function sK(e,t){const n=vu(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
199
|
-
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
200
|
-
type,
|
|
201
|
-
name,
|
|
202
|
-
title,
|
|
203
|
-
}
|
|
204
|
-
}`.replaceAll(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function lK(e){return e.type==="profile"&&!e?.error&&Cn(e.resourceType)}function cK(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const uK="_indented_ldk1d_1",LP={indented:uK};function ug({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(Ne,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(Fd,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(En,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(Fd,{size:"1.25rem"})})}function WS({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(En,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(qp,{size:"1.25rem"})})}function dK(e){const{slice:t,property:n}=e,[r,o]=v.useState(e.defaultValue),s=t.typeSchema?.elements??t.elements,c=v.useContext(pn),d=v.useMemo(()=>{if(Mn(s))return ru({parentContext:c,elements:s,path:e.path,profileUrl:t.typeSchema?.url})},[c,e.path,t.typeSchema?.url,s]);function f(x){o(x),e.onChange&&e.onChange(x)}const p=t.min>0,m=Cn(t.elements),g=Tk(t.name),y=e.property.readonly&&r.length===0;return cg(pn.Provider,d,a.jsx(zt,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:y?a.jsx(be,{c:"dimmed",children:"(empty)"}):a.jsxs(Me,{className:m?LP.indented:void 0,children:[r.map((x,S)=>a.jsxs(xe,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${S}`,children:a.jsx(YS,{elementDefinitionType:t.type[0],name:t.name,defaultValue:x,onChange:j=>{const C=[...r];C[S]=j,f(C)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0,readOnly:e.property.readonly})}),!e.property.readonly&&r.length>t.min&&a.jsx(WS,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${S}`,onClick:j=>{vn(j);const C=[...r];C.splice(S,1),f(C)}})]},`${S}-${r.length}`)),!e.property.readonly&&r.length<t.max&&a.jsx(xe,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(ug,{propertyDisplayName:g,onClick:x=>{vn(x);const S=[...r,void 0];f(S)},testId:e.testId&&`${e.testId}-add`})})]})}))}function fK(e){const{property:t}=e,n=Re(),[r,o]=v.useState(!0),[s,c]=v.useState([]),[d]=v.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=v.useState(()=>[d]),m=v.useContext(pn),g=t.type[0]?.code;v.useEffect(()=>{AP({medplum:n,property:t}).then(R=>{c(R);const E=DP(d,R,t.slicing,m.profileUrl);hK(E,R),p(E),o(!1)}).catch(R=>{console.error(R),o(!1)})},[n,t,d,m.profileUrl,p]);function y(R,E){const _=[...f];if(_[E]=R,p(_),e.onChange){const k=_.flat().filter(I=>I!==void 0);e.onChange(k)}}if(r)return a.jsx("div",{children:"Loading..."});const x=s.length,S=f[x],j=!(e.hideNonSliceValues??(g==="Extension"&&s.length>0)),C=jl(t.path),T=e.property.readonly&&s.length===0&&d.length===0;return a.jsxs(Me,{className:e.indent?LP.indented:void 0,children:[T&&a.jsx(be,{c:"dimmed",children:"(empty)"}),s.map((R,E)=>a.jsx(dK,{slice:R,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[E],onChange:_=>{y(_,E)},testId:`slice-${R.name}`},R.name)),j&&S.map((R,E)=>a.jsxs(xe,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(_f,{arrayElement:!0,property:e.property,name:e.name+"."+E,path:e.path,valuePath:cK(e.path,e.valuePath,E),defaultValue:R,onChange:_=>{const k=[...S];k[E]=_,y(k,x)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&a.jsx(WS,{propertyDisplayName:C,testId:`nonsliced-remove-${E}`,onClick:_=>{vn(_);const k=[...S];k.splice(E,1),y(k,x)}})]},`${E}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&a.jsx(xe,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(ug,{propertyDisplayName:C,onClick:R=>{vn(R);const E=[...S];E.push(void 0),y(E,x)},testId:"nonsliced-add"})})]})}function hK(e,t){for(let n=0;n<t.length;n++){const r=t[n],o=e[n];for(;o.length<r.min;)o.push(void 0)}}function pK(e){const[t,n]=v.useState(!1),r=X_(),o=v.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),a.jsxs(rr,{gap:"xs",children:[a.jsx(zl,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(En,{title:"Copy secret",onClick:()=>{r.copy(o.current?.value),ke({color:"green",message:"Copied"})},children:a.jsx(OS,{})})]})}const mK=["sun","mon","tue","wed","thu","fri","sat"];function gK(e){const[t,n]=v.useState(e.defaultValue),[r,o]=v.useState(!e.disabled&&(e.defaultModalOpen??!1));return a.jsxs(a.Fragment,{children:[a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{"data-testid":"timinginput-display",children:jk(t)||"No repeat"}),a.jsx(Ne,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&a.jsx(vK,{path:e.path,visible:r,defaultValue:t,onOk:s=>{e.onChange&&e.onChange(s),n(s),o(!1)},onCancel:()=>o(!1)})]})}const jR={repeat:{period:1,periodUnit:"d"}};function vK(e){const[t,n]=v.useState(e.defaultValue||jR),[r,o]=v.useState(()=>(e.defaultValue?.repeat?.timeOfDay??[]).map((E,_)=>({id:_,value:E}))),s=v.useRef(r.length),{getExtendedProps:c}=v.useContext(pn),[d,f,p,m,g,y]=v.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek","repeat.timeOfDay"].map(E=>c(e.path+"."+E)),[c,e.path]);function x(E){n(_=>({..._,event:[E]}))}function S(E){n(_=>({..._,repeat:E}))}function j(E){n(_=>({..._,repeat:{..._.repeat,period:E}}))}function C(E){n(_=>({..._,repeat:{..._.repeat,periodUnit:E}}))}function T(E){n(_=>({..._,repeat:{..._.repeat,dayOfWeek:E}}))}function R(E){o(_=>{const k=E(_),I=k.map(D=>D.value);return n(D=>({...D,repeat:{...D.repeat,timeOfDay:I}})),k})}return a.jsx(Ln,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Me,{gap:"md",children:[a.jsx(zt,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(No,{disabled:d?.readonly,name:"timing-dialog-start",onChange:E=>x(E)})}),a.jsx(hf,{disabled:f?.readonly,label:"Repeat",checked:!!t.repeat,onChange:E=>S(E.currentTarget.checked?jR.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(zt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(He,{disabled:p?.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:E=>j(Number.parseInt(E.currentTarget.value,10)||1)}),a.jsx(fn,{disabled:m?.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:E=>C(E.currentTarget.value),data:[{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&a.jsx(zt,{title:"Repeat on",children:a.jsx(Od.Group,{multiple:!0,onChange:T,value:t.repeat?.dayOfWeek,children:a.jsx(xe,{justify:"space-between",mt:"xs",gap:"xs",children:mK.map(E=>a.jsx(Od,{value:E,size:"xs",radius:"xl",disabled:g?.readonly,checked:(t.repeat?.dayOfWeek??[]).includes(E),children:E.charAt(0).toUpperCase()},E))})})}),a.jsx(zt,{title:"At times",children:a.jsxs(Me,{mt:"xs",children:[r.map((E,_)=>a.jsxs(xe,{children:[a.jsx(He,{disabled:y?.readonly,type:"time",id:`timing-dialog-repeat-timeOfDay[${_}]`,name:`timing-dialog-repeat-timeOfDay[${_}]`,"data-testid":`timing-repeat-timeOfDay-input-${_}`,defaultValue:E.value.slice(0,5),onChange:k=>{const I=`${k.currentTarget.value}:00`;R(D=>D.with(_,{...E,value:I}))},style:{flexGrow:1}}),a.jsx(WS,{testId:`timing-repeat-timeOfDay-remove-${_}`,onClick:()=>R(k=>k.toSpliced(_,1))})]},E.id)),a.jsx(le,{children:a.jsx(ug,{propertyDisplayName:"Time of Day",onClick:()=>R(E=>{const _=s.current++;return E.concat({id:_,value:"00:00:00"})})})})]})})]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ne,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function _f(e){const{property:t,name:n,onChange:r,defaultValue:o}=e,s=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(s===re.Attachment)return a.jsx(YW,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const d=c[0]?.code!==re.Extension;return a.jsx(fK,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:d,onChange:r,outcome:e.outcome})}else return c.length>1?a.jsx(yK,{elementDefinitionTypes:c,...e}):a.jsx(YS,{name:n,defaultValue:o,onChange:d=>{if(e.onChange){const f=e.name.replace("[x]",Wn(c[0].code));e.onChange(d,f)}},outcome:e.outcome,elementDefinitionType:c[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function yK(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(s=>s.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=v.useState(n);return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(fn,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:s=>{o(t.find(c=>c.code===s.currentTarget.value))},data:t.map(s=>({value:s.code,label:s.code}))}),a.jsx(YS,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:s=>{e.onChange&&e.onChange(s,e.name.replace("[x]",Wn(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 YS(e){const{name:t,onChange:n,outcome:r,binding:o,path:s,valuePath:c,readOnly:d}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=v.useContext(pn),g=v.useMemo(()=>{if(!mS(p)||!Cn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)tR(S,m.elements);else{const j=dl(m.path,e.path);if(j===void 0)return e.defaultValue;tR(S,m.elements,j)}return Mn(S)?S:e.defaultValue},[p,m.path,m.elements,e.path,e.defaultValue]);if(!p)return a.jsx("div",{children:"Property type not specified "});function y(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:s,valuePath:c,disabled:d}}function x(){const S=$t(e.outcome,c??s);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:d}}switch(p){case re.SystemString:case re.canonical:case re.string:case re.uri:case re.url:return e.path==="Project.secret.value[x]"?a.jsx(pK,{...x(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):a.jsx(He,{...x(),onChange:S=>{n&&n(S.currentTarget.value)}});case re.date:return a.jsx(He,{...x(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case re.time:return a.jsx(He,{...x(),type:"time",step:1,onChange:S=>{n&&n(S.currentTarget.value)}});case re.dateTime:case re.instant:return a.jsx(No,{...x(),onChange:n,outcome:r});case re.decimal:case re.integer:case re.positiveInt:case re.unsignedInt:return a.jsx(He,{...x(),type:"number",step:p===re.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case re.code:return a.jsx(vP,{...x(),error:void 0,onChange:n,binding:o?.valueSet,creatable:!0,maxValues:1});case re.boolean:return a.jsx(un,{...x(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case re.base64Binary:case re.markdown:case re.xhtml:return a.jsx(zl,{...x(),spellCheck:p!==re.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case re.Address:return a.jsx(KH,{...y()});case re.Annotation:return a.jsx(XH,{...y()});case re.Attachment:return a.jsx(yP,{...y()});case re.CodeableConcept:return a.jsx(IY,{binding:o?.valueSet,...y()});case re.Coding:return a.jsx(UY,{binding:o?.valueSet,...y()});case re.ContactDetail:return a.jsx(FY,{...y()});case re.ContactPoint:return a.jsx(MP,{...y()});case re.Extension:return a.jsx(GY,{...y(),propertyType:e.elementDefinitionType});case re.HumanName:return a.jsx(QY,{...y()});case re.Identifier:return a.jsx(WY,{...y()});case re.Money:return a.jsx(KY,{...y()});case re.Period:return a.jsx(XY,{...y()});case re.Duration:case re.Quantity:return a.jsx(Tl,{...y()});case re.Range:return a.jsx(QS,{...y()});case re.Ratio:return a.jsx(ZY,{...y()});case re.Reference:return a.jsx(ys,{...y(),targetTypes:bK(e.elementDefinitionType)});case re.Timing:return a.jsx(gK,{...y()});case re.Dosage:case re.UsageContext:default:return a.jsx(KS,{...y(),typeName:p})}}const xK=[`${lo}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function bK(e){return e?.targetProfile?.map(t=>{const n=xK.find(r=>t.startsWith(r));return n?t.slice(n.length):t})}function SK(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(pn),o=v.useMemo(()=>YH(r.elements),[r.elements]);function s(d){n(d),e.onChange&&e.onChange(d)}const c={type:e.type,value:t};return a.jsx(Me,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([d,f])=>{const[p,m]=CY(c,d,f),g=f.min!==void 0&&f.min>0,y=e.valuePath?e.valuePath+"."+d:void 0,x=a.jsx(_f,{property:f,name:d,path:e.path+"."+d,valuePath:y,defaultValue:p,defaultPropertyType:m,onChange:(S,j)=>{s(MY({...t},d,j??d,f,S))},outcome:e.outcome},d);return e.type==="Extension"||kS.includes(d)?x:f.type.length===1&&f.type[0].code==="boolean"?a.jsx(OP,{title:jl(d),description:f.description,htmlFor:d,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:x},d):a.jsx(zt,{title:jl(d),description:f.description,withAsterisk:g,htmlFor:d,outcome:e.outcome,fhirPath:f.path,errorExpression:y,readonly:f.readonly,children:x},d)})})}const wK="_nested_1ya4k_1",jK={nested:wK};function KS(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(pn),r=e.profileUrl??n?.profileUrl,o=v.useMemo(()=>Hm(e.typeName,r),[e.typeName,r]),s=o?.type??e.typeName,c=v.useMemo(()=>{if(o)return ru({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);if(!o)return a.jsxs("div",{children:[s," not implemented"]});const d=n.path!=="";return cg(pn.Provider,c,a.jsx(le,{className:Ut({[jK.nested]:d}),children:a.jsx(SK,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})}))}const CK="_noteCite_10swh_5",EK="_noteRoot_10swh_10",CR={noteCite:CK,noteRoot:EK};function IP({value:e}){return e?a.jsx(Me,{justify:"flex-start",gap:"xs",children:e.map(t=>t.text&&a.jsx(S0,{classNames:{cite:CR.noteCite,root:CR.noteRoot},cite:t.authorReference?.display||t.authorString,icon:null,children:t.text},`note-${t.text}`))}):null}function Fl(e){const{value:t,link:n,...r}=e,[o,s]=v.useState(),c=Xt(t,s);let d;if(o&&!KA(o))d=`[${Qe(o)}]`;else if(c)d=Ca(c);else return null;return n?a.jsx(St,{to:t,...r,children:d}):a.jsx(be,{component:"span",...r,children:d})}function Gc(e){return a.jsxs(xe,{gap:"xs",children:[a.jsx(co,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(Fl,{value:e.value,link:e.link})]})}const TK={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 dg(e){const{status:t,...n}=e;return a.jsx(b0,{color:e.color||TK[t],...n,children:t.replaceAll("-"," ")})}const RK="_table_pe9td_1",_K="_criticalRow_pe9td_12",zP={table:RK,criticalRow:_K};XS.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function XS(e){const t=Re(),n=Xt(e.value),[r,o]=v.useState();if(v.useEffect(()=>{n?.specimen&&Promise.allSettled(n.specimen.map(c=>t.readReference(c))).then(c=>c.filter(d=>d.status==="fulfilled").map(d=>d.value)).then(o).catch(console.error)},[t,n]),!n)return null;const s=r?.flatMap(c=>c.note||[])||[];if(n.presentedForm&&n.presentedForm.length>0){const c=n.presentedForm[0];c.contentType?.startsWith("text/plain")&&c.data&&s.push({text:window.atob(c.data)})}return a.jsxs(Me,{children:[a.jsx(Ue,{children:"Diagnostic Report"}),a.jsx(DK,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&AK(r),n.result&&a.jsx(kK,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&a.jsx(IP,{value:s})]})}function DK({value:e,hideSubject:t=!1}){return a.jsxs(xe,{mt:"md",gap:30,children:[e.subject&&!t&&a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(Gc,{value:e.subject,link:!0})]}),e.resultsInterpreter?.map(n=>a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(Gc,{value:n,link:!0})]},n.reference)),e.performer?.map(n=>a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(Gc,{value:n,link:!0})]},n.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(be,{children:Dr(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(be,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(dg,{status:e.status})]})]})}function AK(e){return a.jsxs(Me,{gap:"xs",children:[a.jsx(Ue,{order:2,size:"h6",children:"Specimens"}),a.jsx(Or,{type:"ordered",children:e?.map(t=>a.jsx(Or.Item,{ml:"sm",children:a.jsxs(xe,{gap:20,children:[a.jsxs(xe,{gap:5,children:[a.jsx(be,{fw:500,children:"Collected:"})," ",Dr(t.collection?.collectedDateTime)]}),a.jsxs(xe,{gap:5,children:[a.jsx(be,{fw:500,children:"Received:"})," ",Dr(t.receivedTime)]})]})},`specimen-${t.id}`))})]})}function kK(e){return a.jsxs("table",{className:zP.table,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Test"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Reference Range"}),a.jsx("th",{children:"Interpretation"}),a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Performer"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:a.jsx($P,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function $P(e){return a.jsx(a.Fragment,{children:e.value?.map(t=>a.jsx(PK,{value:t,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Na(t)?t.reference:t.id}`))})}function PK(e){const t=Xt(e.value);if(!t||e.ancestorIds?.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=MK(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:Ut({[zP.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(St,{to:t,children:a.jsx(Po,{value:t.code})})}),a.jsx("td",{children:a.jsx(NK,{value:t})}),a.jsx("td",{children:a.jsx(OK,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(Po,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(o=>a.jsx("div",{children:a.jsx(Po,{value:o})},`category-${bs(o)}`))})}),a.jsx("td",{children:t.performer?.map(o=>a.jsx(Wp,{value:o},o.reference))}),a.jsx("td",{children:t.status&&a.jsx(dg,{status:t.status})})]}),t.hasMember&&a.jsx($P,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,children:a.jsx(IP,{value:t.note})})})]})}function NK(e){const t=e.value;return a.jsx(a.Fragment,{children:Ck(t)})}function OK(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?a.jsx(a.Fragment,{children:t.text}):a.jsx(qS,{value:t}):null}function MK(e){const t=e.interpretation?.[0]?.coding?.[0]?.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var sx={},ma={},ER;function UP(){if(ER)return ma;ER=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.Pointer=ma.escapeToken=ma.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}ma.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}ma.escapeToken=t;var n=(function(){function r(o){o===void 0&&(o=[""]),this.tokens=o}return r.fromJSON=function(o){var s=o.split("/").map(e);if(s[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(o));return new r(s)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(o){for(var s=null,c="",d=o,f=1,p=this.tokens.length;f<p;f++)s=d,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(d=(s||{})[c]);return{parent:s,key:c,value:d}},r.prototype.get=function(o){return this.evaluate(o).value},r.prototype.set=function(o,s){var c=this.evaluate(o);c.parent&&(c.parent[c.key]=s)},r.prototype.push=function(o){this.tokens.push(o)},r.prototype.add=function(o){var s=this.tokens.concat(String(o));return new r(s)},r})();return ma.Pointer=n,ma}var bn={},lx={},TR;function BP(){return TR||(TR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function n(o){return o!=null&&typeof o=="object"}function r(o){if(!n(o))return o;if(o.constructor==Array){for(var s=o.length,c=new Array(s),d=0;d<s;d++)c[d]=r(o[d]);return c}if(o.constructor==Date){var f=new Date(+o);return f}var p={};for(var m in o)e.hasOwnProperty.call(o,m)&&(p[m]=r(o[m]));return p}e.clone=r})(lx)),lx}var Nr={},RR;function VP(){if(RR)return Nr;RR=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.diffAny=Nr.diffObjects=Nr.diffArrays=Nr.intersection=Nr.subtract=Nr.isDestructive=void 0;var e=BP();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}Nr.isDestructive=t;function n(m,g){var y={};for(var x in m)e.hasOwnProperty.call(m,x)&&m[x]!==void 0&&(y[x]=1);for(var S in g)e.hasOwnProperty.call(g,S)&&g[S]!==void 0&&delete y[S];return Object.keys(y)}Nr.subtract=n;function r(m){for(var g=m.length,y={},x=0;x<g;x++){var S=m[x];for(var j in S)e.hasOwnProperty.call(S,j)&&S[j]!==void 0&&(y[j]=(y[j]||0)+1)}for(var j in y)y[j]<g&&delete y[j];return Object.keys(y)}Nr.intersection=r;function o(m){return m.op==="add"}function s(m){return m.op==="remove"}function c(m,g){return{operations:m.operations.concat(g),cost:m.cost+1}}function d(m,g,y,x){x===void 0&&(x=p);var S={"0,0":{operations:[],cost:0}};function j(_,k){var I="".concat(_,",").concat(k),D=S[I];if(D===void 0){if(_>0&&k>0&&!x(m[_-1],g[k-1],y.add(String(_-1))).length)D=j(_-1,k-1);else{var P=[];if(_>0){var $=j(_-1,k),B={op:"remove",index:_-1};P.push(c($,B))}if(k>0){var Q=j(_,k-1),K={op:"add",index:_-1,value:g[k-1]};P.push(c(Q,K))}if(_>0&&k>0){var Z=j(_-1,k-1),U={op:"replace",index:_-1,original:m[_-1],value:g[k-1]};P.push(c(Z,U))}var G=P.sort(function(M,L){return M.cost-L.cost})[0];D=G}S[I]=D}return D}var C=isNaN(m.length)||m.length<=0?0:m.length,T=isNaN(g.length)||g.length<=0?0:g.length,R=j(C,T).operations,E=R.reduce(function(_,k){var I=_[0],D=_[1];if(o(k)){var P=k.index+1+D,$=P<C+D?String(P):"-",B={op:k.op,path:y.add($).toString(),value:k.value};return[I.concat(B),D+1]}else if(s(k)){var B={op:k.op,path:y.add(String(k.index+D)).toString()};return[I.concat(B),D-1]}else{var Q=y.add(String(k.index+D)),K=x(k.original,k.value,Q);return[I.concat.apply(I,K),D]}},[[],0])[0];return E}Nr.diffArrays=d;function f(m,g,y,x){x===void 0&&(x=p);var S=[];return n(m,g).forEach(function(j){S.push({op:"remove",path:y.add(j).toString()})}),n(g,m).forEach(function(j){S.push({op:"add",path:y.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){S.push.apply(S,x(m[j],g[j],y.add(j)))}),S}Nr.diffObjects=f;function p(m,g,y,x){if(x===void 0&&(x=p),m===g)return[];var S=(0,e.objectType)(m),j=(0,e.objectType)(g);return S=="array"&&j=="array"?d(m,g,y,x):S=="object"&&j=="object"?f(m,g,y,x):[{op:"replace",path:y.toString(),value:g}]}return Nr.diffAny=p,Nr}var _R;function LK(){if(_R)return bn;_R=1;var e=bn&&bn.__extends||(function(){var C=function(T,R){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,_){E.__proto__=_}||function(E,_){for(var k in _)Object.prototype.hasOwnProperty.call(_,k)&&(E[k]=_[k])},C(T,R)};return function(T,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");C(T,R);function E(){this.constructor=T}T.prototype=R===null?Object.create(R):(E.prototype=R.prototype,new E)}})();Object.defineProperty(bn,"__esModule",{value:!0}),bn.apply=bn.InvalidOperationError=bn.test=bn.copy=bn.move=bn.replace=bn.remove=bn.add=bn.TestError=bn.MissingError=void 0;var t=UP(),n=BP(),r=VP(),o=(function(C){e(T,C);function T(R){var E=C.call(this,"Value required at path: ".concat(R))||this;return E.path=R,E.name="MissingError",E}return T})(Error);bn.MissingError=o;var s=(function(C){e(T,C);function T(R,E){var _=C.call(this,"Test failed: ".concat(R," != ").concat(E))||this;return _.actual=R,_.expected=E,_.name="TestError",_}return T})(Error);bn.TestError=s;function c(C,T,R){if(Array.isArray(C))if(T=="-")C.push(R);else{var E=parseInt(T,10);C.splice(E,0,R)}else C[T]=R}function d(C,T){if(Array.isArray(C)){var R=parseInt(T,10);C.splice(R,1)}else delete C[T]}function f(C,T){var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.parent===void 0?new o(T.path):(c(R.parent,R.key,(0,n.clone)(T.value)),null)}bn.add=f;function p(C,T){var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.value===void 0?new o(T.path):(d(R.parent,R.key),null)}bn.remove=p;function m(C,T){var R=t.Pointer.fromJSON(T.path).evaluate(C);if(R.parent===null)return new o(T.path);if(Array.isArray(R.parent)){if(parseInt(R.key,10)>=R.parent.length)return new o(T.path)}else if(R.value===void 0)return new o(T.path);return R.parent[R.key]=(0,n.clone)(T.value),null}bn.replace=m;function g(C,T){var R=t.Pointer.fromJSON(T.from).evaluate(C);if(R.value===void 0)return new o(T.from);var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.parent===void 0?new o(T.path):(d(R.parent,R.key),c(E.parent,E.key,R.value),null)}bn.move=g;function y(C,T){var R=t.Pointer.fromJSON(T.from).evaluate(C);if(R.value===void 0)return new o(T.from);var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.parent===void 0?new o(T.path):(c(E.parent,E.key,(0,n.clone)(R.value)),null)}bn.copy=y;function x(C,T){var R=t.Pointer.fromJSON(T.path).evaluate(C);return(0,r.diffAny)(R.value,T.value,new t.Pointer).length?new s(R.value,T.value):null}bn.test=x;var S=(function(C){e(T,C);function T(R){var E=C.call(this,"Invalid operation: ".concat(R.op))||this;return E.operation=R,E.name="InvalidOperationError",E}return T})(Error);bn.InvalidOperationError=S;function j(C,T){switch(T.op){case"add":return f(C,T);case"remove":return p(C,T);case"replace":return m(C,T);case"move":return g(C,T);case"copy":return y(C,T);case"test":return x(C,T)}return new S(T)}return bn.apply=j,bn}var DR;function IK(){return DR||(DR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=UP();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=LK(),r=VP();function o(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=o;function s(p){function m(g,y,x){var S=p(g,y,x);return Array.isArray(S)?S:(0,r.diffAny)(g,y,x,m)}return m}function c(p,m,g){var y=new t.Pointer;return(g?s(g):r.diffAny)(p,m,y)}e.createPatch=c;function d(p,m){var g=t.Pointer.fromJSON(m).evaluate(p);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(p,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(y){var x=d(p,y.path);if(x&&g.push(x),"from"in y){var S=d(p,y.from);S&&g.push(S)}}),g}e.createTests=f})(sx)),sx}var FP=IK();const zK="_removed_el5zk_1",$K="_added_el5zk_6",AR={removed:zK,added:$K};function UK(e){const{name:t,path:n,property:r,originalValue:o,revisedValue:s}=e,c=!!r?.type?.find(m=>m.code==="Attachment"),[d,f]=v.useState(c),p=()=>f(m=>!m);return a.jsx(a.Fragment,{children:c&&!d||!c?a.jsx(a.Fragment,{children:a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:t}),a.jsx(ee.Td,{className:AR.removed,children:o&&a.jsx(so,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})}),a.jsx(ee.Td,{className:AR.added,children:s&&a.jsx(so,{path:n,property:r,propertyType:s.type,value:s.value,ignoreMissingValues:!0})})]})}):a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:t}),a.jsx(ee.Td,{colSpan:2,style:{textAlign:"right"},children:a.jsx(Ne,{onClick:p,variant:"light",children:"Expand"})})]})})}const BK="_root_15xvr_1",VK={root:BK};function FK(e){const t=Re(),{original:n,revised:r}=e,[o,s]=v.useState(!1);v.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>s(!0)).catch(console.log)},[t,e.original.resourceType]);const c=v.useMemo(()=>{if(!o)return null;const d=[pi(n)],f=[pi(r)],p=[],m=HK(FP.createPatch(n,r));for(const g of m){const y=g.path,x=qK(y),S=GK(n.resourceType,x),j=g.op==="add"?void 0:Ss(x,d),C=g.op==="remove"?void 0:Ss(x,f);p.push({key:`op-${g.op}-${g.path}`,name:`${Wn(g.op)} ${x}`,path:S?.path??n.resourceType+"."+x,property:S,originalValue:kR(S,j),revisedValue:kR(S,C)})}return p},[o,n,r]);return c?a.jsxs(ee,{className:VK.root,children:[a.jsx(ee.Thead,{children:a.jsxs(ee.Tr,{children:[a.jsx(ee.Th,{}),a.jsx(ee.Th,{children:"Before"}),a.jsx(ee.Th,{children:"After"})]})}),a.jsx(ee.Tbody,{children:c.map(d=>{const{key:f,...p}=d;return a.jsx(UK,{...p},f)})})]}):null}function HK(e){const t=[];for(const n of e){const{op:r,path:o}=n;if(o.startsWith("/meta/author")||o.startsWith("/meta/compartment")||o.startsWith("/meta/lastUpdated")||o.startsWith("/meta/versionId"))continue;const s=e.filter(d=>d.op===r&&d.path===o).length,c={op:r,path:o};s>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(c.op="replace",c.path=o.replace(/\/[^/]+$/,"")),t.some(d=>d.op===c.op&&d.path===c.path)||t.push(c)}return t}function qK(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const o=t[r];o==="-"?n+=".last()":/^\d+$/.test(o)?n+=`[${o}]`:(r>0&&(n+="."),n+=o)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function GK(e,t){try{return Jm(e,{resourceType:"SearchParameter",base:[e],code:e+"."+t,expression:e+"."+t})?.elementDefinitions?.[0]}catch(n){console.warn("Failed to get element definition",{resourceType:e,fhirPath:t,err:n});return}}function kR(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:QK(t,!!e?.isArray)}}function QK(e,t){const n=MB(e).flatMap(r=>r.value);return t?n:n[0]}function JS(e){const{profileUrl:t}=e,n=Re(),r=n.getAccessPolicy(),o=Xt(e.value),[s,c]=v.useState(!1);v.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{vu(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=o.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,o]);const d=v.useMemo(()=>o&&Ak(o,hl.READ,r),[r,o]);return!s||!o?null:a.jsx(Yp,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:d})}const WK="_item_5q6yx_1",YK="_itemPadding_5q6yx_5",PR={item:WK,itemPadding:YK};function KK(e){return a.jsx(bu,{children:e.children})}function Rl(e){const{resource:t,profile:n,padding:r,popupMenuItems:o,...s}=e,c=n??t.meta?.author,d=e.dateTime??t.meta?.lastUpdated;return a.jsxs(Bl,{"data-testid":"timeline-item",fill:!0,...s,children:[a.jsxs(xe,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(co,{value:c,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(be,{size:"sm",children:a.jsx(Fl,{c:"dark",fw:500,value:c,link:!0})}),a.jsxs(be,{size:"xs",children:[a.jsx(St,{c:"dimmed",to:e.resource,children:Dr(d)}),a.jsx(be,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(St,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(Se,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(Se.Target,{children:a.jsx(En,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${It(e.resource)}`,children:a.jsx(Gq,{})})}),o]})]}),a.jsx(IS,{children:a.jsx("div",{className:Ut(PR.item,{[PR.itemPadding]:r}),children:e.children})})]})}function HP(e,t){e.sort((n,r)=>{const o=NR(n,t),s=NR(r,t);return o>s?1:o<s?-1:OR(n,t)-OR(r,t)})}function NR(e,t){if(!qP(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function OR(e,t){if(!qP(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const n=e.meta?.lastUpdated;return n?new Date(n).getTime():0}function qP(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const XK="_pinnedComment_u08s5_1",JK={pinnedComment:XK};function fg(e){const t=Re(),n=t.getProfile(),r=v.useRef(null),o=Xt(e.value),[s,c]=v.useState(),[d,f]=v.useState([]),[p,m]=v.useState(10),g=e.loadTimelineResources,y=v.useRef(d);y.current=d;const x=v.useCallback(D=>{HP(D,o),D.reverse(),f(D)},[o]),S=v.useCallback(D=>{const P=[];for(const $ of D){if($.status!=="fulfilled")continue;const B=$.value;if(B.type==="history"&&c(B),B.entry)for(const Q of B.entry)P.push(Q.resource)}x(P)},[x]),j=v.useCallback(D=>x([...y.current,D]),[x]),C=v.useCallback(()=>{let D,P;"resourceType"in e.value?(D=e.value.resourceType,P=e.value.id):[D,P]=e.value.reference?.split("/"),g(t,D,P).then(S).catch(console.error)},[t,e.value,g,S]);v.useEffect(()=>C(),[C]);function T(D){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,D)).then(P=>j(P)).catch(console.error)}function R(D){!o||!e.createMedia||t.createResource(e.createMedia(o,n,D)).then(P=>j(P)).then(()=>cl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(Go,{size:16}),autoClose:2e3})).catch(P=>cl({id:"upload-notification",color:"red",title:"Upload error",message:Qe(P),icon:a.jsx(cR,{size:16}),autoClose:2e3}))}function E(){ke({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(D){cl({id:"upload-notification",loading:!0,title:"Uploading...",message:oX(D),autoClose:!1,withCloseButton:!1})}function k(D){cl({id:"upload-notification",color:"red",title:"Upload error",message:Qe(D),icon:a.jsx(cR,{size:16}),autoClose:2e3})}if(!o)return a.jsx(To,{style:{width:"100%",height:"100%"},children:a.jsx(_r,{})});const I=d.filter(D=>D).slice(0,p);return a.jsxs(KK,{children:[e.createCommunication&&a.jsx(Bl,{children:a.jsx(pt,{testid:"timeline-form",onSubmit:D=>{T(D.text);const P=r.current;P&&(P.value="",P.focus())},children:a.jsxs(xe,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(co,{value:n}),a.jsx(He,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(En,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(jG,{size:16})}),a.jsx(HS,{securityContext:Yt(o),onUpload:R,onUploadStart:E,onUploadProgress:_,onUploadError:k,children:D=>a.jsx(En,{...D,radius:"xl",color:"blue",variant:"filled",children:a.jsx(NS,{size:16})})})]})})}),I.map(D=>{const P=`${D.resourceType}/${D.id}/${D.meta?.versionId}`,$=e.getMenu?e.getMenu({primaryResource:o,currentResource:D,reloadTimeline:C}):void 0;if(D.resourceType===o.resourceType&&D.id===o.id)return a.jsx(ZK,{history:s,resource:D,popupMenuItems:$},P);switch(D.resourceType){case"AuditEvent":return a.jsx(rX,{resource:D,popupMenuItems:$},P);case"Communication":return a.jsx(tX,{resource:D,popupMenuItems:$},P);case"DiagnosticReport":return a.jsx(iX,{resource:D,popupMenuItems:$},P);case"Media":return a.jsx(nX,{resource:D,popupMenuItems:$},P);default:return a.jsx(Rl,{resource:D,padding:!0,children:a.jsx(JS,{value:D,ignoreMissingValues:!0})},P)}}),p<d.length&&a.jsx(xe,{justify:"center",pb:"lg",children:a.jsx(Ne,{onClick:()=>m(p+10),children:"Show More"})})]})}function ZK(e){const{history:t,resource:n,...r}=e,o=eX(t,n);return o?a.jsx(Rl,{resource:n,padding:!0,...r,children:a.jsx(FK,{original:o,revised:e.resource})}):a.jsxs(Rl,{resource:n,padding:!0,...r,children:[a.jsx("h3",{children:"Created"}),a.jsx(JS,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function eX(e,t){const n=e.entry??[],r=n.findIndex(o=>o.resource?.meta?.versionId===t.meta?.versionId);if(!(r>=n.length-1))return n[r+1].resource}function tX(e){const n=!e.resource.priority||e.resource.priority==="routine"?void 0:JK.pinnedComment;return a.jsx(Rl,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:a.jsx("p",{children:e.resource.payload?.[0]?.contentString})})}function nX(e){const t=e.resource.content?.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(Rl,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:a.jsx(Tf,{value:e.resource.content})})}function rX(e){return a.jsx(Rl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Jr,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function iX(e){return a.jsx(Rl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(XS,{value:e.resource})})}function oX(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${cx(e.loaded)} / ${cx(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${cx(e.loaded)}`}function cx(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 aX(e){const{resource:t,...n}=e;return a.jsx(fg,{value:t,loadTimelineResources:async(r,o,s)=>{const c=`${o}/${s}`;return Promise.allSettled([r.readHistory(o,s),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function sX(e){const{encounter:t,...n}=e;return a.jsx(fg,{value:t,loadTimelineResources:async(r,o,s)=>Promise.allSettled([r.readHistory("Encounter",s),r.search("Communication","encounter=Encounter/"+s),r.search("Media","encounter=Encounter/"+s)]),createCommunication:(r,o,s)=>({resourceType:"Communication",status:"completed",encounter:Yt(r),subject:r.subject,sender:Yt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",encounter:Yt(r),subject:r.subject,operator:Yt(o),issued:new Date().toISOString(),content:s}),...n})}function lX(e){let t;try{t=RV(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return a.jsx(so,{value:t[0]||"",propertyType:e.propertyType})}function cX(e){return a.jsxs(Ln,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(le,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(MR,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(MR,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(be,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function MR(e){return a.jsx(Ne,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const uX={string:[he.EQUALS,he.NOT,he.CONTAINS,he.EXACT],fulltext:[he.EQUALS,he.NOT,he.CONTAINS,he.EXACT],token:[he.EQUALS,he.NOT],reference:[he.EQUALS,he.NOT],numeric:[he.EQUALS,he.NOT_EQUALS,he.GREATER_THAN,he.LESS_THAN,he.GREATER_THAN_OR_EQUALS,he.LESS_THAN_OR_EQUALS],quantity:[he.EQUALS,he.NOT_EQUALS,he.GREATER_THAN,he.LESS_THAN,he.GREATER_THAN_OR_EQUALS,he.LESS_THAN_OR_EQUALS],date:[he.EQUALS,he.NOT_EQUALS,he.GREATER_THAN,he.LESS_THAN,he.GREATER_THAN_OR_EQUALS,he.LESS_THAN_OR_EQUALS,he.STARTS_AFTER,he.ENDS_BEFORE,he.APPROXIMATELY],datetime:[he.EQUALS,he.NOT_EQUALS,he.GREATER_THAN,he.LESS_THAN,he.GREATER_THAN_OR_EQUALS,he.LESS_THAN_OR_EQUALS,he.STARTS_AFTER,he.ENDS_BEFORE,he.APPROXIMATELY],uri:[he.EQUALS,he.NOT,he.ABOVE,he.BELOW]},dX={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 ZS(e,t){return{...e,filters:t,offset:0,name:void 0}}function GP(e,t){return ZS(e,(e.filters??[]).filter(n=>n.code!==t))}function hg(e,t,n,r,o){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),ZS(e,s)}function fX(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function hX(e,t){return e1(e,t,-1)}function pX(e,t){return e1(e,t,0)}function mX(e,t){return e1(e,t,1)}function e1(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),pg(e,t,r,o)}function gX(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return pg(e,t,n,r)}function vX(e,t){return t1(e,t,-1)}function yX(e,t){return t1(e,t,0)}function xX(e,t){return t1(e,t,1)}function t1(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),pg(e,t,r,o)}function bX(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),pg(e,t,n,new Date)}function pg(e,t,n,r){return e=GP(e,t),e=LR(e,t,he.GREATER_THAN_OR_EQUALS,n),e=LR(e,t,he.LESS_THAN_OR_EQUALS,r),e}function LR(e,t,n,r){return hg(e,t,n,r.toISOString())}function IR(e,t,n=!0){return hg(e,t,he.MISSING,n.toString())}function SX(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function wX(e,t){const n=e.count??Wm,r=(t-1)*n;return SX(e,r)}function jX(e,t,n){return t===CX(e)&&n!==void 0&&n===EX(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function CX(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function EX(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function TX(e){return uX[e.type]}function QP(e){return dX[e]??""}function _l(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replaceAll(/([A-Z])/g," $1"),t=t.replaceAll(/[-_]/g," "),t=t.replaceAll(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map(Wn).join(" "))}function RX(e,t){const n=t.name;return n==="id"?a.jsx(St,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?e.meta?.versionId:n==="_lastUpdated"?Dr(e.meta?.lastUpdated):`${e.resourceType}.${t.name}`===t.elementDefinition?.path?_X(e,t.elementDefinition):t.searchParams?.length===1&&t.name===t.searchParams[0].code?DX(e,t.searchParams[0]):null}function _X(e,t){const n=t.path?.split(".")?.pop()?.replaceAll("[x]","")??"",[r,o]=lg({type:e.resourceType,value:e},n);return r?a.jsx(so,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function DX(e,t){const n=Ss(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(so,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function AX(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(ao(e.search))}),[o,s]=v.useState(!1);v.useEffect(()=>{r({search:e.search})},[e.search]);const c=v.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,p=nk(f),m=vS(f);return nu(kX(p,m)).map(g=>({value:g,label:_l(g)}))},[e.visible,e.search.resourceType]);function d(f){r({search:{...n.search,fields:f}})}return a.jsx(Ln,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs(Me,{children:[a.jsx(Mm,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:d,onDropdownOpen:()=>s(!0),onDropdownClose:()=>s(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ne,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function kX(e,t){const n=[],r=new Set,o=new Set;for(const s of Object.keys(e.elements))n.push(s),r.add(s.toLowerCase()),o.add(_l(s));if(t)for(const s of Object.keys(t)){const c=_l(s);!r.has(s)&&!o.has(c)&&(n.push(s),r.add(s),o.add(c))}return n}function WP(e){const t=Jm(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case jr.REFERENCE:return a.jsx(ys,{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 jr.BOOLEAN:return a.jsx(un,{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 jr.DATE:return a.jsx(He,{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 jr.DATETIME:return a.jsx(No,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case jr.NUMBER:return a.jsx(He,{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 jr.QUANTITY:return a.jsx(Tl,{name:n,path:"",defaultValue:PX(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(He,{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 PX(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:Number.parseFloat(t),system:n,unit:r}}}function NX(e){const[t,n]=v.useState(mi(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(mi(e.search))},[e.search]);function o(f){n(hg(r.current,f.code,f.operator,f.value))}const s=e.search.resourceType,c=vS(s)??{},d=t.filters||[];return a.jsx(Ln,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:a.jsxs(pt,{onSubmit:()=>e.onOk(r.current),children:[a.jsxs("div",{children:[a.jsxs("table",{children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:380}}),a.jsx("col",{style:{width:40}})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Field"}),a.jsx("th",{children:"Operation"}),a.jsx("th",{children:"Value"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:d.map((f,p)=>a.jsx(OX,{id:`filter-${p}-row`,resourceType:s,searchParams:c,value:f,onChange:m=>{const g=[...d];g[p]=m,n(ZS(r.current,g))},onDelete:()=>n(fX(r.current,p))},`filter-${p}-row`))})]}),a.jsx(ug,{propertyDisplayName:"Filter",onClick:()=>o({})})]}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(cr,{children:"OK"})})]})})}function OX(e){const t=e.value,n=v.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=he.EQUALS,n.current.value="",e.onChange(n.current)}function o(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function s(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],d=c&&TX(c);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(fn,{"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:_l(f)}))]})}),a.jsx("td",{children:d&&a.jsx(fn,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>o(f.currentTarget.value),data:["",...d.map(f=>({value:f,label:QP(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),a.jsx("td",{children:c&&t.operator&&a.jsx(WP,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:s},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),a.jsx("td",{children:e.onDelete&&a.jsx(En,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:a.jsx(El,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function MX(e){const[t,n]=v.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return a.jsx(Ln,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(pt,{onSubmit:r,children:a.jsxs(Rr,{children:[a.jsx(Rr.Col,{span:10,children:a.jsx(WP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(Rr.Col,{span:2,children:a.jsx(Ne,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function LX(e){const{resourceType:t,filter:n}=e,r=Io.types[t].searchParams?.[n.code];if(r){if(r.type==="reference"&&(n.operator===he.EQUALS||n.operator===he.NOT_EQUALS))return a.jsx(Fl,{value:{reference:n.value}});const o=Jm(t,r);if(n.code==="_lastUpdated"||o.type===jr.DATETIME)return a.jsx(a.Fragment,{children:Dr(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function IX(e){if(!e.searchParams)return null;function t(s,c){o(jX(e.search,s.code,c))}function n(s){o(GP(e.search,s.code))}function r(s,c){e.onPrompt(s,{code:s.code,operator:c,value:""})}function o(s){e.onChange(s)}return e.searchParams.length===1?a.jsx(zX,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(Se.Dropdown,{children:e.searchParams.map(s=>a.jsx(Se.Item,{children:_l(s.code)},s.code))})}function zX(e){switch(e.searchParam.type){case"date":return a.jsx($X,{...e});case"number":case"quantity":return a.jsx(UX,{...e});case"reference":return a.jsx(BX,{...e});case"string":return a.jsx(VX,{...e});case"token":case"uri":return a.jsx(FX,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function $X(e){const{searchParam:t}=e,n=t.code;return a.jsxs(Se.Dropdown,{children:[a.jsx(Se.Item,{leftSection:a.jsx(MS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(Se.Item,{leftSection:a.jsx(LS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(Se.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(rP,{size:14}),onClick:()=>e.onPrompt(t,he.ENDS_BEFORE),children:"Before..."}),a.jsx(Se.Item,{leftSection:a.jsx(nP,{size:14}),onClick:()=>e.onPrompt(t,he.STARTS_AFTER),children:"After..."}),a.jsx(Se.Item,{leftSection:a.jsx(mq,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Between..."}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(ss,{size:14}),onClick:()=>e.onChange(mX(e.search,n)),children:"Tomorrow"}),a.jsx(Se.Item,{leftSection:a.jsx(ss,{size:14}),onClick:()=>e.onChange(pX(e.search,n)),children:"Today"}),a.jsx(Se.Item,{leftSection:a.jsx(ss,{size:14}),onClick:()=>e.onChange(hX(e.search,n)),children:"Yesterday"}),a.jsx(Se.Item,{leftSection:a.jsx(ss,{size:14}),onClick:()=>e.onChange(gX(e.search,n)),children:"Next 24 Hours"}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(ss,{size:14}),onClick:()=>e.onChange(xX(e.search,n)),children:"Next Month"}),a.jsx(Se.Item,{leftSection:a.jsx(ss,{size:14}),onClick:()=>e.onChange(yX(e.search,n)),children:"This Month"}),a.jsx(Se.Item,{leftSection:a.jsx(ss,{size:14}),onClick:()=>e.onChange(vX(e.search,n)),children:"Last Month"}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(ss,{size:14}),onClick:()=>e.onChange(bX(e.search,n)),children:"Year to date"}),a.jsx(Df,{...e})]})}function UX(e){const{searchParam:t}=e;return a.jsxs(Se.Dropdown,{children:[a.jsx(Se.Item,{leftSection:a.jsx(MS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(Se.Item,{leftSection:a.jsx(LS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(Se.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(nP,{size:14}),onClick:()=>e.onPrompt(t,he.GREATER_THAN),children:"Greater than..."}),a.jsx(Se.Item,{leftSection:a.jsx(tb,{size:14}),onClick:()=>e.onPrompt(t,he.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(Se.Item,{leftSection:a.jsx(rP,{size:14}),onClick:()=>e.onPrompt(t,he.LESS_THAN),children:"Less than..."}),a.jsx(Se.Item,{leftSection:a.jsx(tb,{size:14}),onClick:()=>e.onPrompt(t,he.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(Df,{...e})]})}function BX(e){const{searchParam:t}=e;return a.jsxs(Se.Dropdown,{children:[a.jsx(Se.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(Se.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(Df,{...e})]})}function VX(e){const{searchParam:t}=e;return a.jsxs(Se.Dropdown,{children:[a.jsx(Se.Item,{leftSection:a.jsx(MS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(Se.Item,{leftSection:a.jsx(LS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(Se.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(jq,{size:14}),onClick:()=>e.onPrompt(t,he.CONTAINS),children:"Contains..."}),a.jsx(Se.Item,{leftSection:a.jsx(Sq,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Does not contain..."}),a.jsx(Df,{...e})]})}function FX(e){const{searchParam:t}=e;return a.jsxs(Se.Dropdown,{children:[a.jsx(Se.Item,{leftSection:a.jsx(jf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(Se.Item,{leftSection:a.jsx(wf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(Df,{...e})]})}function Df(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(cq,{size:14}),onClick:()=>e.onChange(IR(e.search,n)),children:"Missing"}),a.jsx(Se.Item,{leftSection:a.jsx(sq,{size:14}),onClick:()=>e.onChange(IR(e.search,n,!1)),children:"Not missing"}),a.jsx(Se.Divider,{}),a.jsx(Se.Item,{leftSection:a.jsx(El,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function YP(e){switch(e){case"next":return{"aria-label":"Next page"};case"previous":return{"aria-label":"Previous page"};case"first":return{"aria-label":"First page"};case"last":return{"aria-label":"Last page"};default:return{}}}const HX="_root_vlout_1",qX="_table_vlout_8",GX="_tr_vlout_12",QX="_control_vlout_22",WX="_icon_vlout_31",pd={root:HX,table:qX,tr:GX,control:QX,icon:WX};function YX(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(KX(t,r));return n}function KX(e,t){if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const n=Ds(e,t),r=XB(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=vS(e);let s;if(o){const c=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);s=Object.values(o).filter(d=>!!d.expression&&c.test(d?.expression)),s.length===0&&(s=void 0)}return{name:t,elementDefinition:n,searchParams:s}}if(r){const o=Jm(e,r);return{name:t,elementDefinition:o.elementDefinitions?.[0],searchParams:[r]}}return{name:t}}class XX extends Event{definition;constructor(t){super("change"),this.definition=t}}class JX extends Event{response;constructor(t){super("load"),this.response=t}}class Kp extends Event{resource;browserEvent;constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function Su(e){const t=Re(),[n,r]=v.useState(),{search:o,onLoad:s}=e,[c,d]=v.useState(o);Lo(o,c)||d(o);const[f,p]=v.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=v.useRef(f);m.current=f;const g=c.total??"accurate",y=v.useCallback(U=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,gs({...c,total:g,fields:void 0}),U)).then(G=>{p({...m.current,searchResponse:G}),s&&s(new JX(G))}).catch(G=>{p({...m.current,searchResponse:void 0}),r(Qt(G))})},[t,c,g,s]),x=v.useCallback(()=>{p({...m.current,searchResponse:void 0}),y({cache:"reload"})},[y]);v.useEffect(()=>{y()},[y]);function S(U,G){U.stopPropagation();const L=U.target.checked,z={...m.current.selected};L?z[G]=!0:delete z[G],p({...m.current,selected:z})}function j(U){U.stopPropagation();const M=U.target.checked,L={},z=m.current.searchResponse;M&&z?.entry&&z.entry.forEach(F=>{F.resource?.id&&(L[F.resource.id]=!0)}),p({...m.current,selected:L})}function C(){const U=m.current;if(!U.searchResponse?.entry||U.searchResponse.entry.length===0)return!1;for(const G of U.searchResponse.entry)if(G.resource?.id&&!U.selected[G.resource.id])return!1;return!0}function T(U){e.onChange&&e.onChange(new XX(U))}function R(U,G){if(oP(U.target)||U.button===2)return;vn(U);const M=zS(U);!M&&e.onClick&&e.onClick(new Kp(G,U)),M&&e.onAuxClick&&e.onAuxClick(new Kp(G,U))}function E(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return a.jsx(ur,{outcome:n});if(!tk(c.resourceType))return a.jsx(To,{style:{width:"100%",height:"100%"},children:a.jsx(_r,{})});const _=e.checkboxesEnabled,k=YX(c),I=c.resourceType,D=f.searchResponse,$=D?.entry?.map(U=>U.resource),B="subtle",Q="gray",K=16,Z=window.innerWidth<768;return a.jsxs("div",{className:pd.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(xe,{justify:"space-between",mb:"xl",children:[a.jsxs(xe,{gap:2,children:[a.jsx(Ne,{size:"compact-md",variant:B,color:Q,leftSection:a.jsx(Iq,{size:K}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),a.jsx(Ne,{size:"compact-md",variant:B,color:Q,leftSection:a.jsx(iG,{size:K}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&a.jsx(Ne,{size:"compact-md",variant:B,color:Q,leftSection:a.jsx(nG,{size:K}),onClick:e.onNew,children:"New..."}),!Z&&E()&&a.jsx(Ne,{size:"compact-md",variant:B,color:Q,leftSection:a.jsx(aQ,{size:K}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!Z&&e.onDelete&&a.jsx(Ne,{size:"compact-md",variant:B,color:Q,leftSection:a.jsx(tg,{size:K}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!Z&&e.onBulk&&a.jsx(Ne,{size:"compact-md",variant:B,color:Q,leftSection:a.jsx(hq,{size:K}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),a.jsxs(xe,{gap:2,children:[D&&a.jsxs(be,{size:"xs",c:"dimmed","data-testid":"count-display",children:[KP(c,D).toLocaleString(),"-",nJ(c,D).toLocaleString(),D.total!==void 0&&` of ${c.total==="estimate"?"~":""}${D.total?.toLocaleString()}`]}),a.jsx(En,{variant:B,color:Q,title:"Refresh",onClick:x,children:a.jsx(iP,{size:K})})]})]}),a.jsxs(ee,{className:pd.table,children:[a.jsxs(ee.Thead,{children:[a.jsxs(ee.Tr,{children:[_&&a.jsx(ee.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:U=>j(U)})}),k.map(U=>a.jsx(ee.Th,{children:a.jsxs(Se,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(Se.Target,{children:a.jsx(Pn,{className:pd.control,p:2,children:a.jsxs(xe,{justify:"space-between",wrap:"nowrap",children:[a.jsx(be,{fw:500,children:_l(U.name)}),a.jsx(To,{className:pd.icon,children:a.jsx(eq,{size:14,stroke:1.5})})]})})}),a.jsx(IX,{search:c,searchParams:U.searchParams,onPrompt:(G,M)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:G,filterDialogFilter:M,dialogOpenTime:Date.now()})},onChange:G=>{T(G)}})]})},U.name))]}),!e.hideFilters&&a.jsxs(ee.Tr,{children:[_&&a.jsx(ee.Th,{}),k.map(U=>a.jsx(ee.Th,{children:U.searchParams&&a.jsx(ZX,{resourceType:I,searchParams:U.searchParams,filters:c.filters})},U.name))]})]}),a.jsx(ee.Tbody,{children:$?.map(U=>U&&a.jsxs(ee.Tr,{className:pd.tr,"data-testid":"search-control-row",onClick:G=>R(G,U),onAuxClick:G=>R(G,U),children:[_&&a.jsx(ee.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${U.id}`,checked:!!f.selected[U.id],onChange:G=>S(G,U.id)})}),k.map(G=>a.jsx(ee.Td,{children:RX(U,G)},G.name))]},U.id))})]}),!$?.length&&a.jsx(bu,{children:a.jsx(To,{style:{height:150},children:a.jsx(be,{size:"xl",c:"dimmed",children:"No results"})})}),D&&a.jsx(To,{m:"md",p:"md",children:a.jsx(Ui,{value:eJ(c),total:tJ(c,D),onChange:U=>T(wX(c,U)),getControlProps:YP})}),a.jsx(AX,{search:c,visible:m.current.fieldEditorVisible,onOk:U=>{T(U),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),a.jsx(NX,{search:c,visible:m.current.filterEditorVisible,onOk:U=>{T(U),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),a.jsx(cX,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),a.jsx(MX,{visible:m.current.filterDialogVisible,title:f.filterDialogSearchParam?.code?_l(f.filterDialogSearchParam.code):"",resourceType:I,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:U=>{T(hg(c,U.code,U.operator,U.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}function ZX(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?a.jsx("span",{children:"no filters"}):a.jsx(a.Fragment,{children:t.map(n=>a.jsxs("div",{children:[QP(n.operator)," ",a.jsx(LX,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function eJ(e){return Math.floor((e.offset??0)/(e.count??Wm))+1}function tJ(e,t){const n=e.count??Wm,r=XP(e,t);return Math.ceil(r/n)}function KP(e,t){return Math.min(XP(e,t),(e.offset??0)+1)}function nJ(e,t){return Math.max(KP(e,t)+(t.entry?.length??0)-1,0)}function XP(e,t){let n=t.total;return n===void 0&&(n=(e.offset??0)+(t.entry?.length??0)+(t.link?.some(r=>r.relation==="next")?1:0)),n}function rJ(e){const t=Re(),[n,r]=v.useState(!1),[o,s]=v.useState(),{query:c,fields:d}=e,[f,p]=v.useState(),[m,g]=v.useState({}),y=v.useRef(f);y.current=f;const x=v.useRef({});x.current=m,v.useEffect(()=>{s(void 0),t.graphql(c).then(p).catch(E=>s(Qt(E)))},[t,c]);function S(E,_){E.stopPropagation();const I=E.target.checked,D={...x.current};I?D[_]=!0:delete D[_],g(D)}function j(E){E.stopPropagation();const k=E.target.checked,I={},D=y.current?.data.ResourceList;k&&D&&D.forEach(P=>{P.id&&(I[P.id]=!0)}),g(I)}function C(){const E=y.current?.data.ResourceList;if(!E||E.length===0)return!1;for(const _ of E)if(_.id&&!x.current[_.id])return!1;return!0}function T(E,_){oP(E.target)||(vn(E),E.button!==1&&e.onClick&&e.onClick(new Kp(_,E)),E.button===1&&e.onAuxClick&&e.onAuxClick(new Kp(_,E)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(_r,{});const R=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:E=>vn(E),"data-testid":"search-control",children:[a.jsxs(ee,{children:[a.jsx(ee.Thead,{children:a.jsxs(ee.Tr,{children:[R&&a.jsx(ee.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:E=>j(E)})}),d.map(E=>a.jsx(ee.Th,{children:E.name},E.name))]})}),a.jsx(ee.Tbody,{children:f?.data.ResourceList.map(E=>E&&a.jsxs(ee.Tr,{"data-testid":"search-control-row",onClick:_=>T(_,E),onAuxClick:_=>T(_,E),children:[R&&a.jsx(ee.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${E.id}`,checked:!!m[E.id],onChange:_=>S(_,E.id)})}),d.map(_=>a.jsx(ee.Td,{children:a.jsx(lX,{propertyType:_.propertyType,path:_.fhirPath,resource:E})},_.name))]},E.id))})]}),f?.data.ResourceList.length===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&a.jsx(Ne,{onClick:()=>e.onBulk(Object.keys(x.current)),children:"Bulk..."})]})}const iJ=v.memo(rJ),oJ="_root_1fbwr_1",aJ="_entry_1fbwr_8",sJ="_key_1fbwr_13",lJ="_value_1fbwr_20",mg={root:oJ,entry:aJ,key:sJ,value:lJ};function yt(e){return a.jsx(Jr,{children:a.jsx("div",{className:mg.root,children:e.children})})}yt.Entry=function(t){return a.jsx("div",{className:mg.entry,children:t.children})};yt.Key=function(t){return a.jsx("div",{className:mg.key,children:t.children})};yt.Value=function(t){return a.jsx("div",{className:mg.value,children:t.children})};const cJ="_list_y4z6g_1",uJ="_link_y4z6g_6",zR={list:cJ,link:uJ};function n1(e){const{baseUrl:t,tabs:n,children:r,...o}=e,s=dJ(n),c=yu(),[d,f]=v.useState(()=>{const m=er.getPathname().split("/").pop();return m&&s.some(g=>g.value===m)?m:s[0].value});function p(m){m=m||s[0].value,f(m),c(`${t}/${m}`)}return a.jsxs(Gt,{value:d.toLowerCase(),onChange:p,...o,children:[a.jsx(Gt.List,{className:zR.list,children:s.map(m=>a.jsx(Gt.Tab,{value:m.value,children:a.jsx(Tt,{className:zR.link,href:`${t}/${m.value}`,onClick:fJ,children:m.label})},m.value))}),r]})}function dJ(e){return e.map(t=>mk(t)?{label:t,value:t.toLowerCase()}:t)}function fJ(e){zS(e)||e.preventDefault()}function hJ(e){const{group:t}=e;return a.jsx(Mr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(xe,{children:[t.measureScore&&a.jsx(gJ,{group:t}),!t.measureScore&&a.jsx(mJ,{group:t})]})})}function pJ(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(be,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(be,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function mJ(e){const{group:t}=e,n=t.population,r=n?.find(f=>bs(f.code)==="numerator"),o=n?.find(f=>bs(f.code)==="denominator"),s=r?.count,c=o?.count;if(c===0)return a.jsxs(le,{children:[a.jsx(Ue,{order:3,children:"Not Applicable"}),a.jsx(be,{children:`Denominator: ${c}`})]});if(s===void 0||c===void 0)return a.jsxs(le,{children:[a.jsx(Ue,{order:3,children:"Insufficient Data"}),a.jsx(be,{children:`Numerator: ${s}`}),a.jsx(be,{children:`Denominator: ${c}`})]});const d=s/c*100;return a.jsx(Vm,{size:120,thickness:12,roundCaps:!0,sections:[{value:d,color:JP(d)}],label:a.jsx(rr,{justify:"center",children:a.jsxs(be,{fw:700,fz:18,children:[s," / ",c]})})})}function gJ(e){const{group:t}=e,n=t.measureScore?.unit??t.measureScore?.code;return a.jsx(a.Fragment,{children:n==="%"?a.jsx(Vm,{size:120,thickness:12,roundCaps:!0,sections:[{value:vJ(t),color:JP(t?.measureScore?.value??0)}],label:a.jsx(rr,{justify:"center",children:a.jsx(be,{fw:700,fz:18,children:a.jsx(qd,{value:t.measureScore})})})}):a.jsx(rr,{h:120,align:"center",children:a.jsx(Ue,{order:3,children:a.jsx(qd,{value:t.measureScore})})})})}function vJ(e){const t=e.measureScore?.value,n=e.measureScore?.unit;return t?t<=1&&n==="%"?t*100:t:0}function JP(e){return e<=33?"red":e<=67?"yellow":"green"}function yJ(e){const t=Xt(e.measureReport),[n]=GH("Measure",{url:t?.measure});return t?a.jsxs(le,{children:[n&&a.jsx(pJ,{measure:n}),a.jsx(Fm,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:t.group?.map((r,o)=>a.jsx(hJ,{group:r},r.id??o))})]}):null}const ux="patient-export",dx="Patient Export",xJ={everything:{operation:"$everything",extension:"json",contentType:tn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:tn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:tn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:tn.CDA_XML}};function bJ(e){const t=Re(),{patient:n}=e,r=v.useCallback(async o=>{const s=Sl(n),c=o.format,{operation:d,type:f,contentType:p,extension:m}=xJ[c],g=t.fhirUrl("Patient",s,d),y={};f&&(y.type=f),o.author&&(y.author={reference:o.author}),o.authoredOn&&(y.authoredOn=GS(o.authoredOn)),o.startDate&&(y.start=o.startDate),o.endDate&&(y.end=o.endDate),Pi.show({id:ux,title:dx,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const x=await t.post(g,y,void 0,{cache:"no-cache",headers:{Accept:p}}),S=`Patient-export-${s}-${new Date().toISOString().replaceAll(":","-")}.${m}`;SJ(x,S,p),Pi.update({id:ux,title:dx,color:"green",message:"Done",icon:a.jsx(Go,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(x){Pi.update({id:ux,title:dx,color:"red",message:Qe(x),icon:a.jsx(El,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return a.jsx(pt,{onSubmit:r,children:a.jsxs(Me,{children:[a.jsx(zt,{title:"Export Format",description:"Required",withAsterisk:!0,children:a.jsx(eu,{name:"format",data:[{label:"FHIR Everything",value:"everything"},{label:"Patient Summary",value:"summary"},{label:"C-CDA",value:"ccda"},{label:"C-CDA Referral",value:"ccdaReferral"}],fullWidth:!0})}),a.jsx(zt,{title:"Author",description:"Optional author for composition. Default value is current user.",children:a.jsx(ys,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),a.jsx(zt,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:a.jsx(No,{name:"authoredOn",placeholder:"Authored on"})}),a.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:a.jsx(No,{name:"startDate",placeholder:"Start date"})}),a.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:a.jsx(No,{name:"endDate",placeholder:"End date"})}),a.jsx(xe,{justify:"right",children:a.jsx(cr,{children:"Request Export"})})]})})}function SJ(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),o=new Blob([r],{type:n}),s=window.URL.createObjectURL(o),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=s,c.download=t,c.click(),window.URL.revokeObjectURL(s)}function wJ(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function ZP(e){const t=Xt(e.patient);return t?a.jsxs(yt,{children:[a.jsx(co,{value:t,size:"lg",color:wJ(t)}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Name"}),a.jsx(yt.Value,{children:a.jsx(St,{to:t,fw:500,children:t.name?a.jsx($S,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"DoB"}),a.jsx(yt.Value,{children:t.birthDate})]}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Age"}),a.jsx(yt.Value,{children:jB(t.birthDate)})]})]}),t.gender&&a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Gender"}),a.jsx(yt.Value,{children:t.gender})]}),t.address&&a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"State"}),a.jsx(yt.Value,{children:t.address[0]?.state})]}),t.identifier?.map(n=>a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:n?.system}),a.jsx(yt.Value,{children:n?.value})]},`${n?.system}-${n?.value}`))]}):null}function jJ(e){const{patient:t,...n}=e,r=v.useCallback((o,s,c)=>{const d=`${s}/${c}`,f=100;return Promise.allSettled([o.readHistory("Patient",c),o.search("Communication",{subject:d,_count:f}),o.search("Device",{patient:d,_count:f}),o.search("DeviceRequest",{patient:d,_count:f}),o.search("DiagnosticReport",{subject:d,_count:f}),o.search("Media",{subject:d,_count:f}),o.search("ServiceRequest",{subject:d,_count:f}),o.search("Task",{subject:d,_count:f})])},[]);return a.jsx(fg,{value:t,loadTimelineResources:r,createCommunication:(o,s,c)=>({resourceType:"Communication",status:"completed",subject:Yt(o),sender:Yt(s),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(o,s,c)=>({resourceType:"Media",status:"completed",subject:Yt(o),operator:Yt(s),issued:new Date().toISOString(),content:c}),...n})}const CJ="_section_pqpwm_1",EJ="_hovering_pqpwm_7",rb={section:CJ,hovering:EJ};function TJ(e){const t=Re(),n=Xt(e.value),[r,o]=v.useState(!1),[s,c]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState();function g(){f(void 0)}function y(){c(void 0)}const x=v.useRef(p);if(x.current=p,v.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(kJ(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]),!r||!p)return null;function S(j,C){m({...x.current,[j]:C})}return a.jsx("div",{children:a.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[a.jsx(He,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>S("title",j.currentTarget.value)}),a.jsx(RJ,{actions:p.action||[],selectedKey:s,setSelectedKey:c,hoverKey:d,setHoverKey:f,onChange:j=>S("action",j)}),a.jsx(cr,{children:"Save"})]})})}function RJ(e){const t=v.useRef(e.actions);t.current=e.actions;function n(s){e.onChange(t.current.map(c=>c.id===s.id?s:c))}function r(s){e.onChange([...t.current,s]),e.setSelectedKey(s.id)}function o(s){e.onChange(t.current.filter(c=>c!==s))}return a.jsxs(Me,{gap:"md",className:rb.section,children:[e.actions.map(s=>a.jsx(_J,{action:s,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(s)},s.id)),a.jsx("div",{children:a.jsx(Ne,{variant:"outline",onClick:s=>{vn(s),r({id:eN()})},children:"Add action"})})]})}function _J(e){const{action:t}=e;function n(o){o.stopPropagation(),e.setSelectedKey(e.action.id)}function r(o){vn(o),e.setHoverKey(e.action.id)}return a.jsx("div",{onClick:n,onMouseOver:r,onFocus:r,children:a.jsx(DJ,{action:t,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function DJ(e){const{action:t}=e,[n,r]=v.useState(),o=Re(),[s,c]=v.useState(!1),[d,f]=v.useState(),p=e.selectedKey===e.action.id,m=e.hoverKey===e.action.id;function g(x,S){e.onChange({...t,[x]:S})}const y=Ut(rb.section,{[rb.hovering]:m&&!p});return v.useEffect(()=>{(async()=>{if(!t.definitionCanonical)return;c(!0);const S=await o.readCanonical(["Questionnaire","ActivityDefinition"],t.definitionCanonical);r(AJ(S)),f(S),c(!1)})().catch(console.error)},[t.definitionCanonical,o]),s?a.jsx(_r,{}):a.jsxs(Mr,{"data-testid":t.id,className:y,p:0,radius:"sm",withBorder:!0,children:[a.jsxs(rr,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[a.jsx(He,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:x=>g("title",x.currentTarget.value)}),a.jsx(Es,{"data-testid":"close-button",onClick:e.onRemove})]}),p&&a.jsxs(Me,{gap:"xl",p:"md",children:[a.jsx(le,{children:a.jsx(He,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:x=>g("description",x.currentTarget.value)})}),a.jsx(le,{children:a.jsx(fn,{label:"Type of Action",value:n,onChange:x=>{const S=x.currentTarget.value==="standard"?void 0:x.currentTarget.value;r(S),e.onChange({...e.action,definitionCanonical:S==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&a.jsxs(Me,{gap:0,children:[a.jsxs(xe,{gap:0,mb:"xs",children:[a.jsx(be,{fw:600,children:"Select questionnaire"}),a.jsx(be,{c:"red",children:"*"})]}),a.jsxs(be,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",a.jsx(Tt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),a.jsx($R,{resource:d,resourceType:"Questionnaire",action:t,onChange:e.onChange,placeholder:"Search for questionnaire"})]}),n==="activitydefinition"&&a.jsxs(Me,{gap:0,children:[a.jsxs(xe,{gap:0,mb:"xs",children:[a.jsx(be,{fw:600,children:"Select activity definition"}),a.jsx(be,{c:"red",children:"*"})]}),a.jsxs(be,{size:"sm",c:"dimmed",mb:"sm",children:["ActivityDefinition.kind resource to be shown in the task in Encounter view. You can create new one from"," ",a.jsx(Tt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),a.jsx($R,{resource:d,resourceType:"ActivityDefinition",action:t,onChange:e.onChange,placeholder:"Search for activity definition"})]})]})]})}function $R(e){const{id:t}=e.action,{resource:n}=e;return a.jsx(Vl,{name:t,placeholder:e.placeholder,resourceType:e.resourceType,defaultValue:n,onChange:r=>{r?e.onChange({...e.action,definitionCanonical:"url"in r?r.url:void 0,definitionUri:"url"in r?void 0:It(r)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function AJ(e){return e===void 0?"standard":e.resourceType.toLowerCase()}let fx=1;function eN(e){if(e){if(e.startsWith("id-")){const t=Number.parseInt(e.substring(3),10);Number.isNaN(t)||(fx=Math.max(fx,t+1))}return e}return"id-"+fx++}function kJ(e){return{...e,action:tN(e.action)}}function tN(e){if(e)return e.map(t=>({...t,id:eN(t.id),action:tN(t.action)}))}const gl=30,Xp=50;function Jp(e){const t=e.formState,n=e.item,r=e.responseItem;function o(x){if(t&&e.context)if(n.repeats&&e.index!==void 0&&n.type!==vt.choice&&n.type!==vt.openChoice){const C=[...r.answer||[]];x.length===0?C.splice(e.index,1):C[e.index]=x[0],t.onChangeAnswer(e.context,e.item,C)}else t.onChangeAnswer(e.context,e.item,x)}const s=n.type;if(!s)return null;const c=n.linkId;if(!c)return null;const f=n.repeats&&e.index!==void 0&&n.type!==vt.choice&&n.type!==vt.openChoice?`${c}-${e.index}`:c;let p;n.initial&&n.initial.length>0?p=n.initial[0]:n.answerOption&&n.answerOption.length>0&&(p=n.answerOption.find(x=>x.initialSelected));const m=i1(r,e.index)??AS(p),g=Ho(r,`${lo}/fhir/StructureDefinition/questionnaire-validationError`);let y=null;switch(s){case vt.display:y=a.jsx("p",{children:e.item.text},e.item.linkId);break;case vt.boolean:y=a.jsx(OP,{title:e.item.text,htmlFor:f,children:a.jsx(un,{id:f,name:c,required:e.required??n.required,defaultChecked:m?.value,onChange:x=>o([{valueBoolean:x.currentTarget.checked}])})},e.item.linkId);break;case vt.decimal:y=a.jsx(He,{type:"number",step:"any",id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o(x.currentTarget.value===""?[]:[{valueDecimal:x.currentTarget.valueAsNumber}])});break;case vt.integer:y=a.jsx(He,{type:"number",step:1,id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o(x.currentTarget.value===""?[]:[{valueInteger:x.currentTarget.valueAsNumber}])});break;case vt.date:y=a.jsx(He,{type:"date",id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o([{valueDate:x.currentTarget.value}])});break;case vt.dateTime:y=a.jsx(No,{name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o([{valueDateTime:x}])});break;case vt.time:y=a.jsx(He,{type:"time",id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o([{valueTime:x.currentTarget.value}])});break;case vt.string:case vt.url:y=a.jsx(He,{id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>{const S=x.currentTarget.value;o(S===""?[]:[{valueString:S}])}});break;case vt.text:y=a.jsx(zl,{id:f,name:c,required:e.required??n.required,defaultValue:m?.value,onChange:x=>{const S=x.currentTarget.value;o(S===""?[]:[{valueString:S}])}});break;case vt.attachment:y=a.jsx(xe,{py:4,children:a.jsx(yP,{path:"",name:f,defaultValue:m?.value,onChange:x=>o([{valueAttachment:x}])})});break;case vt.reference:y=a.jsx(ys,{name:f,required:e.required??n.required,targetTypes:Wk(n),searchCriteria:LH(n,t?.subject,t?.encounter),defaultValue:m?.value,onChange:x=>o([{valueReference:x}])});break;case vt.quantity:y=a.jsx(Tl,{path:"",name:f,required:e.required??n.required,defaultValue:m?.value,onChange:x=>o([{valueQuantity:x}]),disableWheel:!0});break;case vt.choice:case vt.openChoice:zJ(n)?y=a.jsx(MJ,{name:f,item:n,required:e.required??n.required,initial:p,response:r,onChangeAnswer:x=>o(x)}):IJ(n)||n.answerValueSet&&!$J(n)?y=a.jsx(PJ,{name:f,item:n,required:e.required??n.required,initial:p,response:r,onChangeAnswer:x=>o(x)}):y=a.jsx(OJ,{name:f,item:n,required:e.required??n.required,initial:p,response:r,onChangeAnswer:x=>o(x)});break;default:return null}return a.jsxs(a.Fragment,{children:[y,g?.valueString&&a.jsx(be,{c:"red",size:"lg",mt:4,children:g.valueString})]})}function PJ(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e;if(!n.answerOption?.length&&!n.answerValueSet)return a.jsx(r1,{});const d=AS(o),f=i1(c)??d,p=iN(c),m=n.repeats||UJ(n);if(n.answerValueSet)return a.jsx(Ef,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:m?void 0:1,required:r,onChange:g=>{m?g.length===0?s([{}]):s(g.map(y=>({valueCoding:y}))):s([{valueCoding:g[0]}])},defaultValue:f?.value});if(m){const{propertyName:g,data:y}=BJ(n);return a.jsx(Mm,{data:y,placeholder:"Select items",searchable:!0,defaultValue:p||[wl(d)],required:r,onChange:x=>{if(x.length===0)s([{}]);else{const S=Gk(x,g,n);s(S)}}})}else{const g=[""];if(n.answerOption)for(const y of n.answerOption){const x=zo(y);g.push(wl(x))}return a.jsx(fn,{id:t,name:t,required:r,onChange:y=>{const x=y.currentTarget.selectedIndex;if(x===0){s([{}]);return}const S=n.answerOption[x-1],j=zo(S),C="value"+Wn(j.type);s([{[C]:j.value}])},defaultValue:bf(f?.value)||f?.value,data:g})}}function NJ(e,t){return e?t.valueSetExpand({url:e,count:gl+1}).then(n=>n.expansion?.contains??[]):Promise.resolve([])}function nN(e){const t=Re(),[n,r]=v.useState([]),[o,s]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){s(!0);try{const d=await NJ(e,t);r(d)}catch(d){console.error("Error loading value set:",d)}finally{s(!1)}}}c().catch(console.error)},[e,t]),[n,o]}function rN(e,t){return e.map((n,r)=>{const o=`${t}-valueset-${r}`,s={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[o,s]})}function OJ(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e,d=Ds("QuestionnaireItemAnswerOption","value[x]"),f=AS(o),[p,m]=nN(n.answerValueSet),g=[];let y;if(n.answerValueSet)g.push(...rN(p,t));else if(n.answerOption){const C=n.answerOption.slice(0,Xp).map((T,R)=>{const E=`${t}-option-${R}`,_=zo(T);return _?.value?(f&&ao(_)===ao(f)&&(y=E),[E,_]):null}).filter(T=>T!==null);g.push(...C)}const x=i1(c),S=LJ(g,x);if(m)return a.jsx(be,{children:"Loading options..."});if(g.length===0)return a.jsx(r1,{});const j=g.slice(0,gl);return a.jsxs(a.Fragment,{children:[a.jsx(wr.Group,{name:t,value:S??y,required:r,onChange:C=>{const T=g.find(R=>R[0]===C);if(T){const R=T[1],E="value"+Wn(R.type);s([{[E]:R.value}])}},children:j.map(([C,T])=>a.jsx(wr,{id:C,value:C,py:4,required:r,label:a.jsx(so,{property:d,propertyType:T.type,value:T.value})},C))}),(n.answerValueSet&&g.length>gl||n.answerOption&&g.length>Xp)&&a.jsxs(be,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",gl," options"]})]})}function MJ(e){const{name:t,item:n,onChangeAnswer:r,response:o}=e,s=Ds("QuestionnaireItemAnswerOption","value[x]"),[c,d]=nN(n.answerValueSet),f=n.answerValueSet?(o?.answer?.map(S=>S.valueCoding)||[]).filter(S=>S!==void 0):iN(o),[p,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...rN(c,t));else if(n.answerOption){const S=n.answerOption.slice(0,Xp).map((j,C)=>{const T=`${t}-option-${C}`,R=zo(j);return R?.value?[T,R]:null}).filter(j=>j!==null);g.push(...S)}if(d)return a.jsx(be,{children:"Loading options..."});if(g.length===0)return a.jsx(r1,{});const y=g.slice(0,gl),x=(S,j)=>{if(n.answerValueSet){const C=p;let T;j?T=[...C,S.value]:T=C.filter(R=>!Lo(R,S.value)),m(T),T.length===0?r([{}]):r(T.map(R=>({valueCoding:R})))}else{const C=p,T=wl(S);let R;if(j?R=[...C,T]:R=C.filter(E=>E!==T),m(R),R.length===0)r([{}]);else{const E=Gk(R,"value"+Wn(S.type),n);r(E)}}};return a.jsxs(xe,{style:{flexDirection:"column",alignItems:"flex-start"},children:[y.map(([S,j])=>{const C=wl(j),T=n.answerValueSet?p.some(R=>Lo(R,j.value)):p.includes(C);return a.jsx(un,{id:S,label:a.jsx(so,{property:s,propertyType:j.type,value:j.value}),checked:T,onChange:R=>x(j,R.currentTarget.checked)},S)}),(n.answerValueSet&&g.length>gl||n.answerOption&&g.length>Xp)&&a.jsxs(be,{size:"sm",c:"dimmed",children:["Showing first ",gl," options"]})]})}function r1(){return a.jsx(He,{disabled:!0,placeholder:"No Answers Defined"})}function i1(e,t=0){return zo(e?.answer?.[t]??{})}function iN(e){const t=e?.answer;return t?t.map(r=>zo(r)).map(r=>bf(r?.value)||r?.value).filter(Boolean):[]}function LJ(e,t){return e.find(n=>Lo(n[1].value,t?.value))?.[0]}function gg(e,t){return!!e.extension?.some(n=>n.url===_S&&n.valueCodeableConcept?.coding?.[0]?.code===t)}function IJ(e){return gg(e,"drop-down")}function zJ(e){return gg(e,"check-box")}function $J(e){return gg(e,"radio-button")}function UJ(e){return gg(e,"multi-select")}function BJ(e){if(e.answerOption?.length===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=zo(t),r="value"+Wn(n.type),o=(e.answerOption??[]).map(s=>{const c=zo(s),d=wl(c);return{value:d,label:d}});return{propertyName:r,data:o}}const VJ="_section_my8o4_1",FJ="_hovering_my8o4_10",HJ="_editing_my8o4_14",qJ="_questionBody_my8o4_20",GJ="_topActions_my8o4_24",QJ="_bottomActions_my8o4_33",WJ="_movementActions_my8o4_44",YJ="_movementIcons_my8o4_56",KJ="_columnAlignment_my8o4_60",XJ="_linkIdInput_my8o4_65",JJ="_typeSelect_my8o4_70",ZJ="_preserveBreaks_my8o4_74",ui={section:VJ,hovering:FJ,editing:HJ,questionBody:qJ,topActions:GJ,bottomActions:QJ,movementActions:WJ,movementIcons:YJ,columnAlignment:KJ,linkIdInput:XJ,typeSelect:JJ,preserveBreaks:ZJ};function eZ(e){const t=Re(),n=Xt(e.questionnaire),[r,o]=v.useState(!1),[s,c]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState();function g(){m(void 0)}function y(){f(void 0)}v.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(c(iZ(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]);const x=(S,j)=>{c(S),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(S)};return!r||!s?null:a.jsx("div",{children:a.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(s),children:[a.jsx(oN,{item:s,selectedKey:d,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:x}),a.jsx(cr,{children:"Save"})]})})}function oN(e){const t=e.item,n=e.item,r=qo(e.item),o=r||n.type===vt.group,s=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,d=e.hoverKey===e.item.id,f=v.useRef(e.item);f.current=e.item;function p(E){vn(E),e.setSelectedKey(e.item.id)}function m(E){vn(E),e.setHoverKey(e.item.id)}function g(E){const _=f.current;e.onChange({..._,item:_.item?.map(k=>k.id===E.id?E:k)})}function y(E,_){e.onChange({...e.item,item:[...e.item.item??[],E]},_)}function x(E){e.onChange({...e.item,item:e.item.item?.filter(_=>_!==E)})}function S(E,_){e.onChange({...f.current,[E]:_})}function j(E){e.onChange({...e.item,...E})}function C(E){e.onChange({...e.item,item:e.item.item?.map(_=>_===E?{..._,repeats:!_.repeats}:_)})}function T(E,_){const k=sZ(e.item.item,E,_);e.onChange({...e.item,item:k})}const R=Ut(ui.section,{[ui.editing]:c,[ui.hovering]:d&&!c});return a.jsxs("div",{"data-testid":n.linkId,className:R,onClick:p,onMouseOver:m,onFocus:m,children:[a.jsx("div",{className:ui.questionBody,children:c?a.jsxs(a.Fragment,{children:[r&&a.jsx(He,{size:"xl",defaultValue:t.title,onBlur:E=>S("title",E.currentTarget.value)}),!r&&a.jsx(zl,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:E=>S("text",E.currentTarget.value)}),n.type==="reference"&&a.jsx(rZ,{item:n,onChange:j}),TH(n)&&a.jsx(tZ,{item:n,onChange:E=>j(E)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(Ue,{children:t.title}),n.text&&a.jsx("div",{className:ui.preserveBreaks,children:n.text}),!o&&a.jsx(Jp,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),n.item?.map((E,_)=>a.jsx("div",{children:a.jsx(oN,{item:E,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>x(E),onRepeatable:C,onMoveUp:()=>T(_,-1),onMoveDown:()=>T(_,1)})},E.id)),!o&&a.jsx("div",{className:ui.topActions,children:c?a.jsxs(a.Fragment,{children:[a.jsx(He,{size:"xs",className:ui.linkIdInput,defaultValue:n.linkId,onBlur:E=>S("linkId",E.currentTarget.value)}),!o&&a.jsx(fn,{size:"xs",className:ui.typeSelect,defaultValue:n.type,onChange:E=>S("type",E.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):a.jsx("div",{children:s})}),!r&&a.jsx(le,{className:ui.movementActions,children:a.jsxs(le,{className:ui.columnAlignment,children:[!e.isFirst&&a.jsx(Tt,{href:"#",onClick:E=>{E.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(oq,{"data-testid":"up-button",size:15,className:ui.movementIcons})}),!e.isLast&&a.jsx(Tt,{href:"#",onClick:E=>{E.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(rq,{"data-testid":"down-button",size:15,className:ui.movementIcons})})]})}),a.jsxs("div",{className:ui.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Tt,{href:"#",onClick:E=>{E.preventDefault(),y({id:Dl(),linkId:ab("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Tt,{href:"#",onClick:E=>{E.preventDefault(),y({id:Dl(),linkId:ab("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Tt,{href:"#",onClick:E=>{E.preventDefault(),y(aZ(),!0)},children:"Add Page"}),c&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Tt,{href:"#",onClick:E=>{E.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Tt,{href:"#",onClick:E=>{E.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function tZ(e){const t=Ds("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(He,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(nZ,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(le,{display:"flex",children:[a.jsx(Tt,{href:"#",onClick:r=>{vn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Dl()}]})},children:"Add choice"}),a.jsx(AA,{w:"lg"}),a.jsx(Tt,{href:"#",onClick:r=>{vn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function nZ(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=lg({type:"QuestionnaireItemAnswerOption",value:t},"value");return a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[a.jsx("div",{children:a.jsx(_f,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,s)=>{const c=[...e.options],d=c.findIndex(f=>f.id===t.id);c[d]={id:t.id,[s]:o},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(Tt,{href:"#",onClick:o=>{vn(o),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function rZ(e){const t=Wk(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(xe,{children:[a.jsx(FS,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(ox(e.item,t.map(s=>s===n?o:s)))}}),a.jsx(Tt,{href:"#",onClick:o=>{vn(o),e.onChange(ox(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Tt,{href:"#",onClick:n=>{vn(n),e.onChange(ox(e.item,[...t,""]))},children:"Add Resource Type"})]})}let ib=1,ob=1;function ab(e){return e+ib++}function Dl(){return"id-"+ob++}function iZ(e){return{...e,id:e.id||Dl(),item:aN(e.item)}}function aN(e){if(e)return e.forEach(t=>{t.id?.match(/^id-\d+$/)&&(ob=Math.max(ob,Number.parseInt(t.id.substring(3),10)+1)),t.linkId?.match(/^q\d+$/)&&(ib=Math.max(ib,Number.parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Dl(),item:aN(t.item),answerOption:oZ(t.answerOption)}))}function oZ(e){if(e)return e.map(t=>({...t,id:t.id||Dl()}))}function aZ(){return{id:Dl(),linkId:ab("s"),type:"group",text:"New Page",extension:[{url:_S,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function sZ(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const s=[...r];return[s[t],s[o]]=[s[o],s[t]],s}var Zp=class{x;y;pressure;time;constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}},lZ=class sN{constructor(t,n,r,o,s,c){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=o,this.startWidth=s,this.endWidth=c}static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,o=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new sN(t[1],r,o,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const o=t.x-n.x,s=t.y-n.y,c=n.x-r.x,d=n.y-r.y,f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},p={x:(n.x+r.x)/2,y:(n.y+r.y)/2},m=Math.sqrt(o*o+s*s),g=Math.sqrt(c*c+d*d),y=f.x-p.x,x=f.y-p.y,S=m+g==0?0:g/(m+g),j={x:p.x+y*S,y:p.y+x*S},C=n.x-j.x,T=n.y-j.y;return{c1:new Zp(f.x+C,f.y+T),c2:new Zp(p.x+C,p.y+T)}}length(){let n=0,r,o;for(let s=0;s<=10;s+=1){const c=s/10,d=this.point(c,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),f=this.point(c,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const p=d-r,m=f-o;n+=Math.sqrt(p*p+m*m)}r=d,o=f}return n}point(t,n,r,o,s){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*o*(1-t)*t*t+s*t*t*t}},cZ=class{_et;constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}};function uZ(e,t=250){let n=0,r=null,o,s,c;const d=()=>{n=Date.now(),r=null,o=e.apply(s,c),r||(s=null,c=[])};return function(...p){const m=Date.now(),g=t-(m-n);return s=this,c=p,g<=0||g>t?(r&&(clearTimeout(r),r=null),n=m,o=e.apply(s,c),r||(s=null,c=[])):r||(r=window.setTimeout(d,g)),o}}var dZ=class sb extends cZ{constructor(t,n={}){super(),this.canvas=t,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=n.throttle??16,this.minDistance=n.minDistance??5,this.dotSize=n.dotSize||0,this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=n.compositeOperation||"source-over",this.canvasContextOptions=n.canvasContextOptions??{},this._strokeMoveUpdate=this.throttle?uZ(sb.prototype._strokeUpdate,this.throttle):sb.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handlePointerCancel=this._handlePointerCancel.bind(this),this._handleTouchCancel=this._handleTouchCancel.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}dotSize;minWidth;maxWidth;penColor;minDistance;velocityFilterWeight;compositeOperation;backgroundColor;throttle;canvasContextOptions;_ctx;_drawingStroke=!1;_isEmpty=!0;_dataUrl;_dataUrlOptions;_lastPoints=[];_data=[];_lastVelocity=0;_lastWidth=0;_strokeMoveUpdate;_strokePointerId;clear(){const{_ctx:t,canvas:n}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,n.width,n.height),t.fillRect(0,0,n.width,n.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._dataUrl=void 0,this._dataUrlOptions=void 0,this._strokePointerId=void 0}redraw(){const t=this._data,n=this._dataUrl,r=this._dataUrlOptions;this.clear(),n&&this.fromDataURL(n,r),this.fromData(t,{clear:!1})}fromDataURL(t,n={}){return new Promise((r,o)=>{const s=new Image,c=n.ratio||window.devicePixelRatio||1,d=n.width||this.canvas.width/c,f=n.height||this.canvas.height/c,p=n.xOffset||0,m=n.yOffset||0;this._reset(this._getPointGroupOptions()),s.onload=()=>{this._ctx.drawImage(s,p,m,d,f),r()},s.onerror=g=>{o(g)},s.crossOrigin="anonymous",s.src=t,this._isEmpty=!1,this._dataUrl=t,this._dataUrlOptions={...n}})}toDataURL(t="image/png",n){return t==="image/svg+xml"?(typeof n!="object"&&(n=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(n))}`):(typeof n!="number"&&(n=void 0),this.canvas.toDataURL(t,n))}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none",this.canvas.style.webkitUserSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.style.webkitUserSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){const t=window.document===this.canvas.ownerDocument?window:this.canvas.ownerDocument.defaultView??this.canvas.ownerDocument;return{addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("pointercancel",this._handlePointerCancel),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd),t("touchcancel",this._handleTouchCancel)}isEmpty(){return this._isEmpty}fromData(t,{clear:n=!0}={}){n&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,n){return n?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const n=t.changedTouches[0];return{event:t,type:t.type,x:n.clientX,y:n.clientY,pressure:n.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_handlePointerCancel(t){this._allowPointerId(t)&&(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t),!1))}_handleTouchCancel(t){t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t),!1)}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,n=!1){return typeof this._strokePointerId>"u"?n:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:r}=this._getListenerFunctions();switch(t.event.type){case"mousedown":r("mousemove",this._handleMouseMove,{passive:!1}),r("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":r("touchmove",this._handleTouchMove,{passive:!1}),r("touchend",this._handleTouchEnd,{passive:!1}),r("touchcancel",this._handleTouchCancel,{passive:!1});break;case"pointerdown":r("pointermove",this._handlePointerMove,{passive:!1}),r("pointerup",this._handlePointerUp,{passive:!1}),r("pointercancel",this._handlePointerCancel,{passive:!1});break}this._drawingStroke=!0;const o=this._getPointGroupOptions(),s={...o,points:[]};this._data.push(s),this._reset(o),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const n=this._createPoint(t.x,t.y,t.pressure),r=this._data[this._data.length-1],o=r.points,s=o.length>0&&o[o.length-1],c=s?n.distanceTo(s)<=this.minDistance:!1,d=this._getPointGroupOptions(r);if(!s||!(s&&c)){const f=this._addPoint(n,d);s?f&&this._drawCurve(f,d):this._drawDot(n,d),o.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,n=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(n&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,n,r){const o=this.canvas.getBoundingClientRect();return new Zp(t-o.left,n-o.top,r,new Date().getTime())}_addPoint(t,n){const{_lastPoints:r}=this;if(r.push(t),r.length>2){r.length===3&&r.unshift(r[0]);const o=this._calculateCurveWidths(r[1],r[2],n),s=lZ.fromPoints(r,o);return r.shift(),s}return null}_calculateCurveWidths(t,n,r){const o=r.velocityFilterWeight*n.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(o,r),c={end:s,start:this._lastWidth};return this._lastVelocity=o,this._lastWidth=s,c}_strokeWidth(t,n){return Math.max(n.maxWidth/(t+1),n.minWidth)}_drawCurveSegment(t,n,r){const o=this._ctx;o.moveTo(t,n),o.arc(t,n,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,n){const r=this._ctx,o=t.endWidth-t.startWidth,s=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=n.penColor;for(let c=0;c<s;c+=1){const d=c/s,f=d*d,p=f*d,m=1-d,g=m*m,y=g*m;let x=y*t.startPoint.x;x+=3*g*d*t.control1.x,x+=3*m*f*t.control2.x,x+=p*t.endPoint.x;let S=y*t.startPoint.y;S+=3*g*d*t.control1.y,S+=3*m*f*t.control2.y,S+=p*t.endPoint.y;const j=Math.min(t.startWidth+p*o,n.maxWidth);this._drawCurveSegment(x,S,j)}r.closePath(),r.fill()}_drawDot(t,n){const r=this._ctx,o=n.dotSize>0?n.dotSize:(n.minWidth+n.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,o),r.closePath(),r.fillStyle=n.penColor,r.fill()}_fromData(t,n,r){for(const o of t){const{points:s}=o,c=this._getPointGroupOptions(o);if(s.length>1)for(let d=0;d<s.length;d+=1){const f=s[d],p=new Zp(f.x,f.y,f.pressure,f.time);d===0&&this._reset(c);const m=this._addPoint(p,c);m&&n(m,c)}else this._reset(c),r(s[0],c)}}toSVG({includeBackgroundColor:t=!1,includeDataUrl:n=!1}={}){const r=this._data,o=Math.max(window.devicePixelRatio||1,1),s=0,c=0,d=this.canvas.width/o,f=this.canvas.height/o,p=document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),p.setAttribute("viewBox",`${s} ${c} ${d} ${f}`),p.setAttribute("width",d.toString()),p.setAttribute("height",f.toString()),t&&this.backgroundColor){const m=document.createElement("rect");m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("fill",this.backgroundColor),p.appendChild(m)}if(n&&this._dataUrl){const m=this._dataUrlOptions?.ratio||window.devicePixelRatio||1,g=this._dataUrlOptions?.width||this.canvas.width/m,y=this._dataUrlOptions?.height||this.canvas.height/m,x=this._dataUrlOptions?.xOffset||0,S=this._dataUrlOptions?.yOffset||0,j=document.createElement("image");j.setAttribute("x",x.toString()),j.setAttribute("y",S.toString()),j.setAttribute("width",g.toString()),j.setAttribute("height",y.toString()),j.setAttribute("preserveAspectRatio","none"),j.setAttribute("href",this._dataUrl),p.appendChild(j)}return this._fromData(r,(m,{penColor:g})=>{const y=document.createElement("path");if(!isNaN(m.control1.x)&&!isNaN(m.control1.y)&&!isNaN(m.control2.x)&&!isNaN(m.control2.y)){const x=`M ${m.startPoint.x.toFixed(3)},${m.startPoint.y.toFixed(3)} C ${m.control1.x.toFixed(3)},${m.control1.y.toFixed(3)} ${m.control2.x.toFixed(3)},${m.control2.y.toFixed(3)} ${m.endPoint.x.toFixed(3)},${m.endPoint.y.toFixed(3)}`;y.setAttribute("d",x),y.setAttribute("stroke-width",(m.endWidth*2.25).toFixed(3)),y.setAttribute("stroke",g),y.setAttribute("fill","none"),y.setAttribute("stroke-linecap","round"),p.appendChild(y)}},(m,{penColor:g,dotSize:y,minWidth:x,maxWidth:S})=>{const j=document.createElement("circle"),C=y>0?y:(x+S)/2;j.setAttribute("r",C.toString()),j.setAttribute("cx",m.x.toString()),j.setAttribute("cy",m.y.toString()),j.setAttribute("fill",g),p.appendChild(j)}),p.outerHTML}};function fZ(e){const t=Re(),{width:n=500,height:r=200,defaultValue:o,who:s,onChange:c,...d}=e,f=v.useRef(null),p=v.useRef(null),m=v.useRef(c);m.current=c,v.useEffect(()=>{function y(){m.current?.({type:[{system:lo+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:s??Yt(t.getProfile()),data:p.current?.toDataURL().split(",")[1]})}if(f.current){const x=new dZ(f.current);o?.data&&x.fromDataURL(o.data).catch(console.error),x.addEventListener("endStroke",y),p.current=x}return()=>{p.current&&p.current.removeEventListener("beginStroke",y)}},[t,o,s]);const g=()=>{p.current&&p.current.clear(),m.current?.(void 0)};return a.jsxs(Mr,{withBorder:!0,p:0,w:n,h:r,pos:"relative",...d,children:[a.jsx("canvas",{ref:f,width:n,height:r,"aria-label":"Signature input area"}),a.jsx(Ne,{onClick:g,"aria-label":"Clear signature",pos:"absolute",top:0,right:0,size:"xs",leftSection:a.jsx(tg,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function lN(e){const t=[...e.context,e.responseItem];return a.jsxs("div",{children:[e.item.text&&a.jsx(Ue,{order:3,mb:"md",children:e.item.text}),a.jsx(lb,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function hZ(e){return a.jsxs(a.Fragment,{children:[e.responseItems.map(t=>a.jsx(lN,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),a.jsx(Tt,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function pZ(e){const{formState:t,context:n,item:r,responseItem:o}=e,s=r.type!==vt.choice&&r.type!==vt.openChoice,c=o.answer&&o.answer.length>0?o.answer:[{}];return a.jsxs(zt,{title:e.item.text,withAsterisk:e.item.required,children:[a.jsx(Me,{gap:"xs",children:c?.map((d,f)=>a.jsx(Jp,{formState:t,context:n,item:r,responseItem:o,index:f},`${r.linkId}-${f}`))}),s&&a.jsx(Tt,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function lb(e){const{formState:t,context:n,items:r,responseItems:o}=e;return a.jsx(Me,{children:r.map((s,c)=>{if(!RH(s,t.questionnaireResponse))return null;if(s.type===vt.display)return a.jsx("p",{children:s.text},`display-${s.id}-${c}`);const d=o.filter(f=>f.linkId===s.linkId);return s.type===vt.group&&s.repeats?a.jsx(hZ,{formState:t,context:n,item:s,responseItems:d},`repeating-group-${s.id}-${c}`):s.type===vt.group?a.jsx(lN,{formState:t,context:n,item:s,responseItem:d[0]},`group-${s.id}-${c}`):s.type===vt.boolean?a.jsx(Jp,{formState:t,context:n,item:s,responseItem:d[0],index:0},`boolean-item-${s.id}-${c}`):s.repeats?a.jsx(pZ,{formState:t,context:n,item:s,responseItem:d[0]},`repeating-item-${s.id}-${c}`):a.jsx(zt,{htmlFor:s.linkId,title:s.text,withAsterisk:s.required,children:a.jsx(Jp,{formState:t,context:n,item:s,responseItem:d[0],index:0})},`repeating-item-${s.id}-${c}`)})})}function mZ(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:o}=e,s=t.pages,c=t.activePage,d=c>0,f=c<s.length-1,p=c===s.length-1;return a.jsxs(a.Fragment,{children:[a.jsx(tu,{active:c,allowNextStepsSelect:!1,p:6,children:s.map((m,g)=>a.jsx(tu.Step,{label:m.title,children:g===c&&o},m.linkId))}),!r&&a.jsxs(xe,{justify:"flex-end",mt:"xl",gap:"xs",children:[d&&a.jsx(Ne,{onClick:t.onPrevPage,children:"Back"}),f&&a.jsx(Ne,{onClick:m=>{m.currentTarget.closest("form").reportValidity()&&t.onNextPage()},children:"Next"}),p&&a.jsx(cr,{children:n??"Submit"})]})]})}function cN(e){const t=Re(),[n,r]=v.useState(!1),o=v.useRef(e);o.current=e;const s=v.useCallback(g=>{r(!1),o.current.onChange?.(g)},[]),c=UH({questionnaire:e.questionnaire,defaultValue:e.questionnaireResponse,subject:e.subject,encounter:e.encounter,source:e.source,disablePagination:e.disablePagination,onChange:s}),d=v.useRef(c);d.current=c;const f=v.useMemo(()=>c.loading?!1:!!Ho(c.questionnaire,EH),[c]),p=v.useMemo(()=>c.loading?!1:!!c.questionnaireResponse.extension?.find(g=>g.url===Cp),[c]),m=v.useCallback(()=>{const g=d.current;if(g.loading)return;const y=o.current.onSubmit;if(!y)return;if(f&&!p){r(!0);return}const x=g.questionnaire,S=g.questionnaireResponse,j=o.current.subject;let C=o.current.source;if(!C){const T=t.getProfile();T&&(C=Yt(T))}y({...S,questionnaire:x.url??It(x),subject:j,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,p]);return c.loading?null:a.jsxs(pt,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&a.jsx(Ue,{children:c.questionnaire.title}),c.pagination?a.jsx(mZ,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:a.jsx(lb,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):a.jsxs(a.Fragment,{children:[a.jsx(lb,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&a.jsxs(Me,{mt:"md",gap:0,children:[a.jsx(be,{size:"sm",fw:500,children:"Signature"}),a.jsx(fZ,{onChange:c.onChangeSignature}),!p&&n&&a.jsx(be,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&a.jsx(xe,{justify:"flex-end",mt:"xl",gap:"xs",children:a.jsx(cr,{children:e.submitButtonText??"Submit"})})]})]})}const gZ="_section_4m5it_1",vZ={section:gZ},yZ=["gender","age","gestationalAge","context","appliesTo","category"],xZ={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function bZ(e){e=Object.assign(xZ,e);const t=e.definition,[n,r]=v.useState([]),[o,s]=v.useState(1),[c,d]=v.useState(1);return v.useEffect(()=>{const S=jZ(t,d);r(CZ(S.qualifiedInterval||[],s))},[t]),a.jsxs(pt,{testid:"reference-range-editor",onSubmit:f,children:[a.jsx(Me,{children:n.map(S=>a.jsx(SZ,{unit:TZ(t.quantitativeDetails?.unit),onChange:g,onAdd:y,onRemove:x,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`))}),a.jsx(En,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{vn(S),p({id:`group-id-${o}`,filters:{},intervals:[]}),s(j=>j+1)},children:a.jsx(Fd,{})}),a.jsx(xe,{justify:"flex-end",children:a.jsx(cr,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!RZ(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 T=C.find(E=>E.id===S),R=T?.intervals.findIndex(E=>E.id===j.id);return R!==void 0&&T?.intervals[R]&&(T.intervals[R]=j),C})}function y(S,j){j.id===void 0&&(j.id=`id-${c}`,d(C=>C+1)),r(C=>{C=[...C];const T=C.findIndex(R=>R.id===S);if(T!==-1){const R={...C[T]};j={...j,...R.filters},R.intervals=[...R.intervals,j],C[T]=R}return C})}function x(S,j){r(C=>{C=[...C];const T=C.find(R=>R.id===S);return T&&(T.intervals=T.intervals.filter(R=>R.id!==j.id)),C})}}function SZ(e){const{intervalGroup:t,unit:n}=e;return a.jsx(bu,{"data-testid":t.id,className:vZ.section,children:a.jsxs(Me,{gap:"lg",children:[a.jsx(xe,{justify:"flex-end",children:a.jsx(En,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{vn(r),e.onRemoveGroup(t)},children:a.jsx(qp,{})},`remove-group-button-${t.id}`)}),a.jsx(wZ,{intervalGroup:t,onChange:e.onChange}),a.jsx(Sn,{}),t.intervals.map(r=>a.jsxs(Me,{gap:"xs",children:[a.jsxs(xe,{children:[a.jsx(He,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{vn(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(En,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{vn(o),e.onRemove(t.id,r)},children:a.jsx(qp,{})},`remove-interval-${r.id}`)]}),a.jsx(QS,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(En,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{vn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(Fd,{})})]})})}function wZ(e){const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const r of["low","high"])t.filters.age[r]?.unit||(t.filters.age[r]={...t.filters.age[r],unit:"years",system:"http://unitsofmeasure.org"});return a.jsxs(Me,{style:{maxWidth:"50%"},children:[a.jsx(xe,{children:a.jsx(fn,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:r=>{for(const o of t.intervals){let s=r.currentTarget.value;s===""&&(s=void 0),n(t.id,{...o,gender:s})}}})}),a.jsxs(xe,{gap:"xs",children:[a.jsx(be,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(QS,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:r=>{for(const o of t.intervals)n(t.id,{...o,age:r})}},`age-${t.id}`)})]}),a.jsx(fn,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:t.filters.context?.text||"",onChange:r=>{for(const o of t.intervals){let s=r.currentTarget.value;s===""?(s=void 0,n(t.id,{...o,context:void 0})):n(t.id,{...o,context:{text:s,coding:[{code:s,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),a.jsx(fn,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:r=>{for(const o of t.intervals){const s=r.currentTarget.value;s===""?n(t.id,{...o,category:void 0}):n(t.id,{...o,category:s})}}})]})}function jZ(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{const s=Number.parseInt(o.id?.substring(3)||"",10);return Number.isNaN(s)?Number.NEGATIVE_INFINITY:s}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function CZ(e,t){let n=1;const r={};for(const o of e){const s=EZ(o);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(yZ.map(c=>[c,o[c]])),intervals:[]}),r[s].intervals.push(o)}return t(n),Object.values(r)}function EZ(e){return[`gender=${e.gender}`,`age=${Ud(e.age)}`,`gestationalAge=${Ud(e.gestationalAge)}`,`context=${e.context?.text}`,`appliesTo=${e.appliesTo?.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function TZ(e){return e&&(OB(e,"http://unitsofmeasure.org")||e.text)}function RZ(e){return e.range?.low?.value===void 0&&e.range?.high?.value===void 0}function _Z(e){const t=Re(),n=Xt(e.value),[r,o]=v.useState(!1),[s,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(d(n)).then(c).catch(console.log),o(!0))},[t,n,r]),!n||!s)return null;return a.jsx(Rr,{children:n.action?.map((p,m)=>{const g=p.resource&&f(p.resource),y=g?.input?.[0]?.valueReference,x=g?.output?.[0]?.valueReference;return a.jsxs(v.Fragment,{children:[a.jsx(Rr.Col,{span:1,p:"md",children:g?.status==="completed"?a.jsx(Dq,{}):a.jsx(eQ,{color:"gray"})}),a.jsxs(Rr.Col,{span:9,p:"xs",children:[a.jsx(be,{fw:500,children:p.title}),p.description&&a.jsx("div",{children:p.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(Fl,{value:g?.meta?.author})," on ",Dr(g?.meta?.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(dg,{status:g?.status||"unknown"})]})]}),a.jsxs(Rr.Col,{span:2,p:"md",children:[y&&!x&&a.jsx(Ne,{onClick:()=>e.onStart(g,y),children:"Start"}),y&&x&&a.jsx(Ne,{onClick:()=>e.onEdit(g,y,x),children:"Edit"})]})]},`action-${m}`)})});function d(p){const m=[];if(p.action)for(const g of p.action)g.resource?.reference&&m.push({request:{method:"GET",url:g.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:m}}function f(p){for(const m of s?.entry??[])if(m.resource&&p.reference===It(m.resource))return m.resource}}function uN(e,t){const n=DZ(e,t);return AZ(n,e,t)}function DZ(e,t){const n=e.length,r=t.length,o=n+r+1,s=1+2*o,c=Math.trunc(s/2),d=new Array(s);d[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<o;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,y=m-1,x=d[g],S=d[y];let j,C=0;p===-f||p!==f&&S.i<x.i?(C=x.i,j=x):(C=S.i+1,j=S),d[y]=void 0;let T=C-p,R={i:C,j:T,prev:kZ(j),snake:!1};for(;C<n&&T<r&&e[C]===t[T];)C++,T++;if(C>R.i&&(R={i:C,j:T,prev:R,snake:!0}),d[m]=R,C>=n&&T>=r)return d[m]}d[c+f-1]=void 0}}function AZ(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o?.prev&&o.prev.j>=0;){const s=o.i,c=o.j;o=o.prev;const d=o.i,f=o.j,p={position:d,lines:t.slice(d,s)},m={position:f,lines:n.slice(f,c)};let g;p.lines.length===0&&m.lines.length>0?g="insert":p.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:p,revised:m,type:g}),o.snake&&(o=o.prev)}return r}function kZ(e){return e&&!e.snake&&e.prev?e.prev:e}function PZ(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>({meta:r.resource?.meta,lines:ao(r.resource,!0).match(/[^\r\n]+/g)})).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.meta.lastUpdated));if(!t.length)return[];const n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return NZ(n,t),OZ(n),n}function NZ(e,t){for(let n=1;n<t.length;n++){const r=uN(t[n-1].lines,t[n].lines);for(const o of r){const s=o.original.position,c=o.original.lines,d=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(s,c.length),o.type==="insert"||o.type==="change")for(let f=0;f<o.revised.lines.length;f++)e.splice(s+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:d[f],span:1})}}}function OZ(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 MZ="_container_1tyf3_1",LZ="_root_1tyf3_5",IZ="_startRow_1tyf3_20",zZ="_normalRow_1tyf3_25",$Z="_author_1tyf3_30",UZ="_dateTime_1tyf3_34",BZ="_lineNumber_1tyf3_40",VZ="_line_1tyf3_40",FZ="_pre_1tyf3_55",ga={container:MZ,root:LZ,startRow:IZ,normalRow:zZ,author:$Z,dateTime:UZ,lineNumber:BZ,line:VZ,pre:FZ};function HZ(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function qZ(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Mc(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Mc(r,"month");const o=Math.floor(t/86400);if(o>0)return Mc(o,"day");const s=Math.floor(t/3600);if(s>0)return Mc(s,"hour");const c=Math.floor(t/60);return c>0?Mc(c,"minute"):Mc(t,"second")}function Mc(e,t){return`${e} ${e===1?t:t+"s"} ago`}function GZ(e){const t=Re(),[n,r]=v.useState(e.history);if(v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return a.jsx("div",{children:"Loading..."});const o=n.entry?.[0]?.resource;if(!o)return null;const s=PZ(n);return a.jsx("div",{className:ga.container,children:a.jsx("table",{className:ga.root,children:a.jsx("tbody",{children:s.map((c,d)=>a.jsxs("tr",{className:c.span>0?ga.startRow:ga.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:ga.author,rowSpan:c.span,children:a.jsx(Fl,{value:c.meta.author,link:!0,fz:"xs"})}),a.jsx("td",{className:ga.dateTime,rowSpan:c.span,children:a.jsx(St,{to:HZ(o,c.meta.versionId),fz:"xs",children:qZ(c.meta.lastUpdated)})})]}),a.jsx("td",{className:ga.lineNumber,children:d+1}),a.jsx("td",{className:ga.line,children:a.jsx("pre",{className:ga.pre,children:c.value})})]},"row-"+d))})})})}const QZ="_removed_el5zk_1",WZ="_added_el5zk_6",UR={removed:QZ,added:WZ};function YZ(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=ao(t,!0).match(/[^\r\n]+/g),o=ao(n,!0).match(/[^\r\n]+/g),s=uN(r,o);return a.jsx("pre",{style:{color:"gray"},children:s.map((c,d)=>a.jsx(KZ,{delta:c},"delta"+d))})}function KZ(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:UR.removed,children:e.delta.original.lines.join(`
|
|
205
|
-
`)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:UR.added,children:e.delta.revised.lines.join(`
|
|
206
|
-
`)}),"...",a.jsx("br",{})]})}const XZ="_splitButton_1i0gi_1",JZ="_menuControl_1i0gi_6",BR={splitButton:XZ,menuControl:JZ};function em(e){const{outcome:t}=e,n=Re(),r=Xt(e.defaultValue),o=r?.resourceType,[s,c]=v.useState(!1),[d,f]=v.useState(),p=n.getAccessPolicy(),m=Tn();v.useEffect(()=>{if(r)if(e.profileUrl){const x=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=vu(x);if(S){c(!0);const j=iH(r,S);f(j)}else console.error(`Schema not found for ${x}`)}).catch(S=>{console.error("Error in requestProfileSchema",S)})}else n.requestSchema(o).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,o,e.profileUrl]);const g=v.useMemo(()=>r&&Ak(r,hl.READ,p),[p,r]),y=v.useMemo(()=>n.isSuperAdmin()||!p||!Mn(d?.resourceType)?!0:aF(p,d?.resourceType),[n,p,d?.resourceType]);return!s||!d?a.jsx("div",{children:"Loading..."}):y?a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:x=>{x.preventDefault(),e.onSubmit&&e.onSubmit(d)},children:[a.jsxs(Me,{mb:"xl",children:[a.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(He,{name:"resourceType",defaultValue:d.resourceType,disabled:!0})}),a.jsx(zt,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(He,{name:"id",defaultValue:d.id,disabled:!0})})]}),a.jsx(KS,{path:d.resourceType,valuePath:d.resourceType,typeName:o,defaultValue:d,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),a.jsxs(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[a.jsx(Ne,{type:"submit",className:Ut((e.onPatch||e.onDelete)&&BR.splitButton),children:r?.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&a.jsxs(Se,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[a.jsx(Se.Target,{children:a.jsx(En,{variant:"filled",color:m.primaryColor,size:36,className:BR.menuControl,"aria-label":"More actions",children:a.jsx(PS,{size:14,stroke:1.5})})}),a.jsxs(Se.Dropdown,{children:[e.onPatch&&a.jsx(Se.Item,{leftSection:a.jsx(tP,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(d)},children:"Patch"}),e.onDelete&&a.jsx(Se.Item,{color:"red",leftSection:a.jsx(tg,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(d)},children:"Delete"})]})]})]})]}):a.jsxs(Fo,{color:"red",title:"Permission denied",icon:a.jsx(As,{}),children:["Your access level prevents you from editing and creating ",d.resourceType," resources."]})}function ZZ(e){const t=Re(),[n,r]=v.useState(e.history);return v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?a.jsxs(ee,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(ee.Thead,{children:a.jsxs(ee.Tr,{children:[a.jsx(ee.Th,{children:"Author"}),a.jsx(ee.Th,{children:"Date"}),a.jsx(ee.Th,{children:"Version"})]})}),a.jsx(ee.Tbody,{children:n.entry?.map((o,s)=>a.jsx(eee,{entry:o},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function eee(e){const{response:t,resource:n}=e.entry;return n?a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:a.jsx(Gc,{value:n.meta?.author,link:!0})}),a.jsx(ee.Td,{children:Dr(n.meta?.lastUpdated)}),a.jsx(ee.Td,{children:a.jsx(St,{to:tee(n),children:n.meta?.versionId})})]}):a.jsx(ee.Tr,{children:a.jsx(ee.Td,{colSpan:3,children:Qe(t?.outcome)})})}function tee(e){return`/${e.resourceType}/${e.id}/_history/${e.meta?.versionId}`}function nee(e){const{serviceRequest:t,...n}=e;return a.jsx(fg,{value:t,loadTimelineResources:async(r,o,s)=>{const c=`${o}/${s}`,d=100;return Promise.allSettled([r.readHistory("ServiceRequest",s),r.search("Communication",{"based-on":c,_count:d}),r.search("DiagnosticReport",{"based-on":c,_count:d}),r.search("Media",{"based-on":c,_count:d}),r.search("DocumentReference",{related:c,_count:d}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:d})])},createCommunication:(r,o,s)=>({resourceType:"Communication",status:"completed",basedOn:[Yt(r)],subject:r.subject,sender:Yt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",basedOn:[Yt(r)],subject:r.subject,operator:Yt(o),issued:new Date().toISOString(),content:s}),...n})}function ree(e){const t=Re(),{client:n,patient:r,encounter:o,children:s,...c}=e;function d(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",gS(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),er.assign(p.toString())}).catch(f=>ke({color:"red",message:Qe(f),autoClose:!1}))}return a.jsx(Tt,{onClick:()=>d(),...c,children:s})}var hx={exports:{}},md={},px={exports:{}},mx={};var VR;function iee(){return VR||(VR=1,(function(e){function t(M,L){var z=M.length;M.push(L);e:for(;0<z;){var F=z-1>>>1,Y=M[F];if(0<o(Y,L))M[F]=L,M[z]=Y,z=F;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var L=M[0],z=M.pop();if(z!==L){M[0]=z;e:for(var F=0,Y=M.length,O=Y>>>1;F<O;){var H=2*(F+1)-1,se=M[H],de=H+1,ye=M[de];if(0>o(se,z))de<Y&&0>o(ye,se)?(M[F]=ye,M[de]=z,F=de):(M[F]=se,M[H]=z,F=H);else if(de<Y&&0>o(ye,z))M[F]=ye,M[de]=z,F=de;else break e}}return L}function o(M,L){var z=M.sortIndex-L.sortIndex;return z!==0?z:M.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],p=[],m=1,g=null,y=3,x=!1,S=!1,j=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function _(M){for(var L=n(p);L!==null;){if(L.callback===null)r(p);else if(L.startTime<=M)r(p),L.sortIndex=L.expirationTime,t(f,L);else break;L=n(p)}}function k(M){if(j=!1,_(M),!S)if(n(f)!==null)S=!0,I||(I=!0,K());else{var L=n(p);L!==null&&G(k,L.startTime-M)}}var I=!1,D=-1,P=5,$=-1;function B(){return C?!0:!(e.unstable_now()-$<P)}function Q(){if(C=!1,I){var M=e.unstable_now();$=M;var L=!0;try{e:{S=!1,j&&(j=!1,R(D),D=-1),x=!0;var z=y;try{t:{for(_(M),g=n(f);g!==null&&!(g.expirationTime>M&&B());){var F=g.callback;if(typeof F=="function"){g.callback=null,y=g.priorityLevel;var Y=F(g.expirationTime<=M);if(M=e.unstable_now(),typeof Y=="function"){g.callback=Y,_(M),L=!0;break t}g===n(f)&&r(f),_(M)}else r(f);g=n(f)}if(g!==null)L=!0;else{var O=n(p);O!==null&&G(k,O.startTime-M),L=!1}}break e}finally{g=null,y=z,x=!1}L=void 0}}finally{L?K():I=!1}}}var K;if(typeof E=="function")K=function(){E(Q)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,U=Z.port2;Z.port1.onmessage=Q,K=function(){U.postMessage(null)}}else K=function(){T(Q,0)};function G(M,L){D=T(function(){M(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(M){switch(y){case 1:case 2:case 3:var L=3;break;default:L=y}var z=y;y=L;try{return M()}finally{y=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,L){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var z=y;y=M;try{return L()}finally{y=z}},e.unstable_scheduleCallback=function(M,L,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,M){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=z+Y,M={id:m++,callback:L,priorityLevel:M,startTime:z,expirationTime:Y,sortIndex:-1},z>F?(M.sortIndex=z,t(p,M),n(f)===null&&M===n(p)&&(j?(R(D),D=-1):j=!0,G(k,z-F))):(M.sortIndex=Y,t(f,M),S||x||(S=!0,I||(I=!0,K()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var L=y;return function(){var z=y;y=L;try{return M.apply(this,arguments)}finally{y=z}}}})(mx)),mx}var FR;function oee(){return FR||(FR=1,px.exports=iee()),px.exports}var HR;function aee(){if(HR)return md;HR=1;var e=oee(),t=wb(),n=v2();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var l=i,u=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(u=l.return),i=l.return;while(i)}return l.tag===3?u:null}function c(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function d(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function f(i){if(s(i)!==i)throw Error(r(188))}function p(i){var l=i.alternate;if(!l){if(l=s(i),l===null)throw Error(r(188));return l!==i?null:i}for(var u=i,h=l;;){var b=u.return;if(b===null)break;var w=b.alternate;if(w===null){if(h=b.return,h!==null){u=h;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===u)return f(b),i;if(w===h)return f(b),l;w=w.sibling}throw Error(r(188))}if(u.return!==h.return)u=b,h=w;else{for(var A=!1,N=b.child;N;){if(N===u){A=!0,u=b,h=w;break}if(N===h){A=!0,h=b,u=w;break}N=N.sibling}if(!A){for(N=w.child;N;){if(N===u){A=!0,u=w,h=b;break}if(N===h){A=!0,h=w,u=b;break}N=N.sibling}if(!A)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:l}function m(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=m(i),l!==null)return l;i=i.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),E=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function K(i){return i===null||typeof i!="object"?null:(i=Q&&i[Q]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Symbol.for("react.client.reference");function U(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Z?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case j:return"Fragment";case T:return"Profiler";case C:return"StrictMode";case k:return"Suspense";case I:return"SuspenseList";case $:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case E:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case _:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case D:return l=i.displayName||null,l!==null?l:U(i.type)||"Memo";case P:l=i._payload,i=i._init;try{return U(i(l))}catch{}}return null}var G=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},F=[],Y=-1;function O(i){return{current:i}}function H(i){0>Y||(i.current=F[Y],F[Y]=null,Y--)}function se(i,l){Y++,F[Y]=i.current,i.current=l}var de=O(null),ye=O(null),we=O(null),Ee=O(null);function Xe(i,l){switch(se(we,l),se(ye,i),se(de,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?kC(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=kC(l),i=PC(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}H(de),se(de,i)}function Ae(){H(de),H(ye),H(we)}function dt(i){i.memoizedState!==null&&se(Ee,i);var l=de.current,u=PC(l,i.type);l!==u&&(se(ye,i),se(de,u))}function Et(i){ye.current===i&&(H(de),H(ye)),Ee.current===i&&(H(Ee),sd._currentValue=z)}var it,rt;function mt(i){if(it===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);it=l&&l[1]||"",rt=-1<u.stack.indexOf(`
|
|
207
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
208
|
-
`+it+i+rt}var Ct=!1;function jt(i,l){if(!i||Ct)return"";Ct=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(ce){var ae=ce}Reflect.construct(i,[],ve)}else{try{ve.call()}catch(ce){ae=ce}i.call(ve.prototype)}}else{try{throw Error()}catch(ce){ae=ce}(ve=i())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ce){if(ce&&ae&&typeof ce.stack=="string")return[ce.stack,ae.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),A=w[0],N=w[1];if(A&&N){var q=A.split(`
|
|
209
|
-
`),ne=N.split(`
|
|
210
|
-
`);for(b=h=0;h<q.length&&!q[h].includes("DetermineComponentFrameRoot");)h++;for(;b<ne.length&&!ne[b].includes("DetermineComponentFrameRoot");)b++;if(h===q.length||b===ne.length)for(h=q.length-1,b=ne.length-1;1<=h&&0<=b&&q[h]!==ne[b];)b--;for(;1<=h&&0<=b;h--,b--)if(q[h]!==ne[b]){if(h!==1||b!==1)do if(h--,b--,0>b||q[h]!==ne[b]){var fe=`
|
|
211
|
-
`+q[h].replace(" at new "," at ");return i.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",i.displayName)),fe}while(1<=h&&0<=b);break}}}finally{Ct=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?mt(u):""}function Te(i,l){switch(i.tag){case 26:case 27:case 5:return mt(i.type);case 16:return mt("Lazy");case 13:return i.child!==l&&l!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return jt(i.type,!1);case 11:return jt(i.type.render,!1);case 1:return jt(i.type,!0);case 31:return mt("Activity");default:return""}}function _e(i){try{var l="",u=null;do l+=Te(i,u),u=i,i=i.return;while(i);return l}catch(h){return`
|
|
212
|
-
Error generating stack: `+h.message+`
|
|
213
|
-
`+h.stack}}var $e=Object.prototype.hasOwnProperty,Le=e.unstable_scheduleCallback,lt=e.unstable_cancelCallback,tt=e.unstable_shouldYield,ft=e.unstable_requestPaint,pe=e.unstable_now,qe=e.unstable_getCurrentPriorityLevel,Ce=e.unstable_ImmediatePriority,Pe=e.unstable_UserBlockingPriority,At=e.unstable_NormalPriority,mn=e.unstable_LowPriority,gn=e.unstable_IdlePriority,Bn=e.log,an=e.unstable_setDisableYieldValue,br=null,Wt=null;function dr(i){if(typeof Bn=="function"&&an(i),Wt&&typeof Wt.setStrictMode=="function")try{Wt.setStrictMode(br,i)}catch{}}var Rn=Math.clz32?Math.clz32:Ma,fo=Math.log,Qo=Math.LN2;function Ma(i){return i>>>=0,i===0?32:31-(fo(i)/Qo|0)|0}var Ur=256,Wo=262144,Fi=4194304;function ti(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:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;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 Hi(i,l,u){var h=i.pendingLanes;if(h===0)return 0;var b=0,w=i.suspendedLanes,A=i.pingedLanes;i=i.warmLanes;var N=h&134217727;return N!==0?(h=N&~w,h!==0?b=ti(h):(A&=N,A!==0?b=ti(A):u||(u=N&~i,u!==0&&(b=ti(u))))):(N=h&~w,N!==0?b=ti(N):A!==0?b=ti(A):u||(u=h&~i,u!==0&&(b=ti(u)))),b===0?0:l!==0&&l!==b&&(l&w)===0&&(w=b&-b,u=l&-l,w>=u||w===32&&(u&4194048)!==0)?l:b}function fr(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function Os(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 Vn(){var i=Fi;return Fi<<=1,(Fi&62914560)===0&&(Fi=4194304),i}function ho(i){for(var l=[],u=0;31>u;u++)l.push(i);return l}function Yo(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function wu(i,l,u,h,b,w){var A=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var N=i.entanglements,q=i.expirationTimes,ne=i.hiddenUpdates;for(u=A&~u;0<u;){var fe=31-Rn(u),ve=1<<fe;N[fe]=0,q[fe]=-1;var ae=ne[fe];if(ae!==null)for(ne[fe]=null,fe=0;fe<ae.length;fe++){var ce=ae[fe];ce!==null&&(ce.lane&=-536870913)}u&=~ve}h!==0&&ql(i,h,0),w!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=w&~(A&~l))}function ql(i,l,u){i.pendingLanes|=l,i.suspendedLanes&=~l;var h=31-Rn(l);i.entangledLanes|=l,i.entanglements[h]=i.entanglements[h]|1073741824|u&261930}function V(i,l){var u=i.entangledLanes|=l;for(i=i.entanglements;u;){var h=31-Rn(u),b=1<<h;b&l|i[h]&l&&(i[h]|=l),u&=~b}}function X(i,l){var u=l&-l;return u=(u&42)!==0?1:ie(u),(u&(i.suspendedLanes|l))!==0?0:u}function ie(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 je(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function De(){var i=L.p;return i!==0?i:(i=window.event,i===void 0?32:tE(i.type))}function Ye(i,l){var u=L.p;try{return L.p=i,l()}finally{L.p=u}}var ze=Math.random().toString(36).slice(2),Oe="__reactFiber$"+ze,Ve="__reactProps$"+ze,Je="__reactContainer$"+ze,st="__reactEvents$"+ze,nt="__reactListeners$"+ze,Rt="__reactHandles$"+ze,Ge="__reactResources$"+ze,sn="__reactMarker$"+ze;function _n(i){delete i[Oe],delete i[Ve],delete i[st],delete i[nt],delete i[Rt]}function Dn(i){var l=i[Oe];if(l)return l;for(var u=i.parentNode;u;){if(l=u[Je]||u[Oe]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(i=$C(i);i!==null;){if(u=i[Oe])return u;i=$C(i)}return l}i=u,u=i.parentNode}return null}function Nt(i){if(i=i[Oe]||i[Je]){var l=i.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return i}return null}function or(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function Br(i){var l=i[Ge];return l||(l=i[Ge]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function An(i){i[sn]=!0}var qi=new Set,ni={};function Gi(i,l){yi(i,l),yi(i+"Capture",l)}function yi(i,l){for(ni[i]=l,i=0;i<l.length;i++)qi.add(l[i])}var Ko=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]*$"),Ms={},Ls={};function Ot(i){return $e.call(Ls,i)?!0:$e.call(Ms,i)?!1:Ko.test(i)?Ls[i]=!0:(Ms[i]=!0,!1)}function Fn(i,l,u){if(Ot(l))if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+u)}}function Qi(i,l,u){if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+u)}}function hr(i,l,u,h){if(h===null)i.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(l,u,""+h)}}function Mt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Is(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function If(i,l,u){var h=Object.getOwnPropertyDescriptor(i.constructor.prototype,l);if(!i.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,w=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return b.call(this)},set:function(A){u=""+A,w.call(this,A)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function ju(i){if(!i._valueTracker){var l=Is(i)?"checked":"value";i._valueTracker=If(i,l,""+i[l])}}function C1(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return i&&(h=Is(i)?i.checked?"true":"false":i.value),i=h,i!==u?(l.setValue(i),!0):!1}function zf(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 pO=/[\n"\\]/g;function xi(i){return i.replace(pO,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function wg(i,l,u,h,b,w,A,N){i.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?i.type=A:i.removeAttribute("type"),l!=null?A==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+Mt(l)):i.value!==""+Mt(l)&&(i.value=""+Mt(l)):A!=="submit"&&A!=="reset"||i.removeAttribute("value"),l!=null?jg(i,A,Mt(l)):u!=null?jg(i,A,Mt(u)):h!=null&&i.removeAttribute("value"),b==null&&w!=null&&(i.defaultChecked=!!w),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+Mt(N):i.removeAttribute("name")}function E1(i,l,u,h,b,w,A,N){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.type=w),l!=null||u!=null){if(!(w!=="submit"&&w!=="reset"||l!=null)){ju(i);return}u=u!=null?""+Mt(u):"",l=l!=null?""+Mt(l):u,N||l===i.value||(i.value=l),i.defaultValue=l}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=N?i.checked:!!h,i.defaultChecked=!!h,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.name=A),ju(i)}function jg(i,l,u){l==="number"&&zf(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Gl(i,l,u,h){if(i=i.options,l){l={};for(var b=0;b<u.length;b++)l["$"+u[b]]=!0;for(u=0;u<i.length;u++)b=l.hasOwnProperty("$"+i[u].value),i[u].selected!==b&&(i[u].selected=b),b&&h&&(i[u].defaultSelected=!0)}else{for(u=""+Mt(u),l=null,b=0;b<i.length;b++){if(i[b].value===u){i[b].selected=!0,h&&(i[b].defaultSelected=!0);return}l!==null||i[b].disabled||(l=i[b])}l!==null&&(l.selected=!0)}}function T1(i,l,u){if(l!=null&&(l=""+Mt(l),l!==i.value&&(i.value=l),u==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=u!=null?""+Mt(u):""}function R1(i,l,u,h){if(l==null){if(h!=null){if(u!=null)throw Error(r(92));if(G(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),l=u}u=Mt(l),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h),ju(i)}function Ql(i,l){if(l){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=l;return}}i.textContent=l}var mO=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 _1(i,l,u){var h=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":h?i.setProperty(l,u):typeof u!="number"||u===0||mO.has(l)?l==="float"?i.cssFloat=u:i[l]=(""+u).trim():i[l]=u+"px"}function D1(i,l,u){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var b in l)h=l[b],l.hasOwnProperty(b)&&u[b]!==h&&_1(i,b,h)}else for(var w in l)l.hasOwnProperty(w)&&_1(i,w,l[w])}function Cg(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 gO=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"]]),vO=/^[\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 $f(i){return vO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Xo(){}var Eg=null;function Tg(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Wl=null,Yl=null;function A1(i){var l=Nt(i);if(l&&(i=l.stateNode)){var u=i[Ve]||null;e:switch(i=l.stateNode,l.type){case"input":if(wg(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+xi(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==i&&h.form===i.form){var b=h[Ve]||null;if(!b)throw Error(r(90));wg(h,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(l=0;l<u.length;l++)h=u[l],h.form===i.form&&C1(h)}break e;case"textarea":T1(i,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&Gl(i,!!u.multiple,l,!1)}}}var Rg=!1;function k1(i,l,u){if(Rg)return i(l,u);Rg=!0;try{var h=i(l);return h}finally{if(Rg=!1,(Wl!==null||Yl!==null)&&(Th(),Wl&&(l=Wl,i=Yl,Yl=Wl=null,A1(l),i)))for(l=0;l<i.length;l++)A1(i[l])}}function Cu(i,l){var u=i.stateNode;if(u===null)return null;var h=u[Ve]||null;if(h===null)return null;u=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,l,typeof u));return u}var Jo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_g=!1;if(Jo)try{var Eu={};Object.defineProperty(Eu,"passive",{get:function(){_g=!0}}),window.addEventListener("test",Eu,Eu),window.removeEventListener("test",Eu,Eu)}catch{_g=!1}var La=null,Dg=null,Uf=null;function P1(){if(Uf)return Uf;var i,l=Dg,u=l.length,h,b="value"in La?La.value:La.textContent,w=b.length;for(i=0;i<u&&l[i]===b[i];i++);var A=u-i;for(h=1;h<=A&&l[u-h]===b[w-h];h++);return Uf=b.slice(i,1<h?1-h:void 0)}function Bf(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 Vf(){return!0}function N1(){return!1}function Vr(i){function l(u,h,b,w,A){this._reactName=u,this._targetInst=b,this.type=h,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(u=i[N],this[N]=u?u(w):w[N]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Vf:N1,this.isPropagationStopped=N1,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Vf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Vf)},persist:function(){},isPersistent:Vf}),l}var zs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ff=Vr(zs),Tu=g({},zs,{view:0,detail:0}),yO=Vr(Tu),Ag,kg,Ru,Hf=g({},Tu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ng,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!==Ru&&(Ru&&i.type==="mousemove"?(Ag=i.screenX-Ru.screenX,kg=i.screenY-Ru.screenY):kg=Ag=0,Ru=i),Ag)},movementY:function(i){return"movementY"in i?i.movementY:kg}}),O1=Vr(Hf),xO=g({},Hf,{dataTransfer:0}),bO=Vr(xO),SO=g({},Tu,{relatedTarget:0}),Pg=Vr(SO),wO=g({},zs,{animationName:0,elapsedTime:0,pseudoElement:0}),jO=Vr(wO),CO=g({},zs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),EO=Vr(CO),TO=g({},zs,{data:0}),M1=Vr(TO),RO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_O={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"},DO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AO(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=DO[i])?!!l[i]:!1}function Ng(){return AO}var kO=g({},Tu,{key:function(i){if(i.key){var l=RO[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Bf(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?_O[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ng,charCode:function(i){return i.type==="keypress"?Bf(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Bf(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),PO=Vr(kO),NO=g({},Hf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),L1=Vr(NO),OO=g({},Tu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ng}),MO=Vr(OO),LO=g({},zs,{propertyName:0,elapsedTime:0,pseudoElement:0}),IO=Vr(LO),zO=g({},Hf,{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}),$O=Vr(zO),UO=g({},zs,{newState:0,oldState:0}),BO=Vr(UO),VO=[9,13,27,32],Og=Jo&&"CompositionEvent"in window,_u=null;Jo&&"documentMode"in document&&(_u=document.documentMode);var FO=Jo&&"TextEvent"in window&&!_u,I1=Jo&&(!Og||_u&&8<_u&&11>=_u),z1=" ",$1=!1;function U1(i,l){switch(i){case"keyup":return VO.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Kl=!1;function HO(i,l){switch(i){case"compositionend":return B1(l);case"keypress":return l.which!==32?null:($1=!0,z1);case"textInput":return i=l.data,i===z1&&$1?null:i;default:return null}}function qO(i,l){if(Kl)return i==="compositionend"||!Og&&U1(i,l)?(i=P1(),Uf=Dg=La=null,Kl=!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 I1&&l.locale!=="ko"?null:l.data;default:return null}}var GO={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"?!!GO[i.type]:l==="textarea"}function F1(i,l,u,h){Wl?Yl?Yl.push(h):Yl=[h]:Wl=h,l=Nh(l,"onChange"),0<l.length&&(u=new Ff("onChange","change",null,u,h),i.push({event:u,listeners:l}))}var Du=null,Au=null;function QO(i){EC(i,0)}function qf(i){var l=or(i);if(C1(l))return i}function H1(i,l){if(i==="change")return l}var q1=!1;if(Jo){var Mg;if(Jo){var Lg="oninput"in document;if(!Lg){var G1=document.createElement("div");G1.setAttribute("oninput","return;"),Lg=typeof G1.oninput=="function"}Mg=Lg}else Mg=!1;q1=Mg&&(!document.documentMode||9<document.documentMode)}function Q1(){Du&&(Du.detachEvent("onpropertychange",W1),Au=Du=null)}function W1(i){if(i.propertyName==="value"&&qf(Au)){var l=[];F1(l,Au,i,Tg(i)),k1(QO,l)}}function WO(i,l,u){i==="focusin"?(Q1(),Du=l,Au=u,Du.attachEvent("onpropertychange",W1)):i==="focusout"&&Q1()}function YO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return qf(Au)}function KO(i,l){if(i==="click")return qf(l)}function XO(i,l){if(i==="input"||i==="change")return qf(l)}function JO(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var ri=typeof Object.is=="function"?Object.is:JO;function ku(i,l){if(ri(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var u=Object.keys(i),h=Object.keys(l);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var b=u[h];if(!$e.call(l,b)||!ri(i[b],l[b]))return!1}return!0}function Y1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function K1(i,l){var u=Y1(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=l&&h>=l)return{node:u,offset:l-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Y1(u)}}function X1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?X1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function J1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=zf(i.document);l instanceof i.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)i=l.contentWindow;else break;l=zf(i.document)}return l}function Ig(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 ZO=Jo&&"documentMode"in document&&11>=document.documentMode,Xl=null,zg=null,Pu=null,$g=!1;function Z1(i,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;$g||Xl==null||Xl!==zf(h)||(h=Xl,"selectionStart"in h&&Ig(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}),Pu&&ku(Pu,h)||(Pu=h,h=Nh(zg,"onSelect"),0<h.length&&(l=new Ff("onSelect","select",null,l,u),i.push({event:l,listeners:h}),l.target=Xl)))}function $s(i,l){var u={};return u[i.toLowerCase()]=l.toLowerCase(),u["Webkit"+i]="webkit"+l,u["Moz"+i]="moz"+l,u}var Jl={animationend:$s("Animation","AnimationEnd"),animationiteration:$s("Animation","AnimationIteration"),animationstart:$s("Animation","AnimationStart"),transitionrun:$s("Transition","TransitionRun"),transitionstart:$s("Transition","TransitionStart"),transitioncancel:$s("Transition","TransitionCancel"),transitionend:$s("Transition","TransitionEnd")},Ug={},ew={};Jo&&(ew=document.createElement("div").style,"AnimationEvent"in window||(delete Jl.animationend.animation,delete Jl.animationiteration.animation,delete Jl.animationstart.animation),"TransitionEvent"in window||delete Jl.transitionend.transition);function Us(i){if(Ug[i])return Ug[i];if(!Jl[i])return i;var l=Jl[i],u;for(u in l)if(l.hasOwnProperty(u)&&u in ew)return Ug[i]=l[u];return i}var tw=Us("animationend"),nw=Us("animationiteration"),rw=Us("animationstart"),e4=Us("transitionrun"),t4=Us("transitionstart"),n4=Us("transitioncancel"),iw=Us("transitionend"),ow=new Map,Bg="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(" ");Bg.push("scrollEnd");function Wi(i,l){ow.set(i,l),Gi(l,[i])}var Gf=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)},bi=[],Zl=0,Vg=0;function Qf(){for(var i=Zl,l=Vg=Zl=0;l<i;){var u=bi[l];bi[l++]=null;var h=bi[l];bi[l++]=null;var b=bi[l];bi[l++]=null;var w=bi[l];if(bi[l++]=null,h!==null&&b!==null){var A=h.pending;A===null?b.next=b:(b.next=A.next,A.next=b),h.pending=b}w!==0&&aw(u,b,w)}}function Wf(i,l,u,h){bi[Zl++]=i,bi[Zl++]=l,bi[Zl++]=u,bi[Zl++]=h,Vg|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function Fg(i,l,u,h){return Wf(i,l,u,h),Yf(i)}function Bs(i,l){return Wf(i,null,null,l),Yf(i)}function aw(i,l,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var b=!1,w=i.return;w!==null;)w.childLanes|=u,h=w.alternate,h!==null&&(h.childLanes|=u),w.tag===22&&(i=w.stateNode,i===null||i._visibility&1||(b=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,b&&l!==null&&(b=31-Rn(u),i=w.hiddenUpdates,h=i[b],h===null?i[b]=[l]:h.push(l),l.lane=u|536870912),w):null}function Yf(i){if(50<ed)throw ed=0,Jv=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var ec={};function r4(i,l,u,h){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(i,l,u,h){return new r4(i,l,u,h)}function Hg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Zo(i,l){var u=i.alternate;return u===null?(u=ii(i.tag,l,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=l,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,l=i.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function sw(i,l){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=l,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,l=u.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function Kf(i,l,u,h,b,w){var A=0;if(h=i,typeof i=="function")Hg(i)&&(A=1);else if(typeof i=="string")A=l3(i,u,de.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case $:return i=ii(31,u,l,b),i.elementType=$,i.lanes=w,i;case j:return Vs(u.children,b,w,l);case C:A=8,b|=24;break;case T:return i=ii(12,u,l,b|2),i.elementType=T,i.lanes=w,i;case k:return i=ii(13,u,l,b),i.elementType=k,i.lanes=w,i;case I:return i=ii(19,u,l,b),i.elementType=I,i.lanes=w,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case E:A=10;break e;case R:A=9;break e;case _:A=11;break e;case D:A=14;break e;case P:A=16,h=null;break e}A=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return l=ii(A,u,l,b),l.elementType=i,l.type=h,l.lanes=w,l}function Vs(i,l,u,h){return i=ii(7,i,h,l),i.lanes=u,i}function qg(i,l,u){return i=ii(6,i,null,l),i.lanes=u,i}function lw(i){var l=ii(18,null,null,0);return l.stateNode=i,l}function Gg(i,l,u){return l=ii(4,i.children!==null?i.children:[],i.key,l),l.lanes=u,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var cw=new WeakMap;function Si(i,l){if(typeof i=="object"&&i!==null){var u=cw.get(i);return u!==void 0?u:(l={value:i,source:l,stack:_e(l)},cw.set(i,l),l)}return{value:i,source:l,stack:_e(l)}}var tc=[],nc=0,Xf=null,Nu=0,wi=[],ji=0,Ia=null,po=1,mo="";function ea(i,l){tc[nc++]=Nu,tc[nc++]=Xf,Xf=i,Nu=l}function uw(i,l,u){wi[ji++]=po,wi[ji++]=mo,wi[ji++]=Ia,Ia=i;var h=po;i=mo;var b=32-Rn(h)-1;h&=~(1<<b),u+=1;var w=32-Rn(l)+b;if(30<w){var A=b-b%5;w=(h&(1<<A)-1).toString(32),h>>=A,b-=A,po=1<<32-Rn(l)+b|u<<b|h,mo=w+i}else po=1<<w|u<<b|h,mo=i}function Qg(i){i.return!==null&&(ea(i,1),uw(i,1,0))}function Wg(i){for(;i===Xf;)Xf=tc[--nc],tc[nc]=null,Nu=tc[--nc],tc[nc]=null;for(;i===Ia;)Ia=wi[--ji],wi[ji]=null,mo=wi[--ji],wi[ji]=null,po=wi[--ji],wi[ji]=null}function dw(i,l){wi[ji++]=po,wi[ji++]=mo,wi[ji++]=Ia,po=l.id,mo=l.overflow,Ia=i}var pr=null,yn=null,Lt=!1,za=null,Ci=!1,Yg=Error(r(519));function $a(i){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ou(Si(l,i)),Yg}function fw(i){var l=i.stateNode,u=i.type,h=i.memoizedProps;switch(l[Oe]=i,l[Ve]=h,u){case"dialog":Dt("cancel",l),Dt("close",l);break;case"iframe":case"object":case"embed":Dt("load",l);break;case"video":case"audio":for(u=0;u<nd.length;u++)Dt(nd[u],l);break;case"source":Dt("error",l);break;case"img":case"image":case"link":Dt("error",l),Dt("load",l);break;case"details":Dt("toggle",l);break;case"input":Dt("invalid",l),E1(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Dt("invalid",l);break;case"textarea":Dt("invalid",l),R1(l,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||h.suppressHydrationWarning===!0||DC(l.textContent,u)?(h.popover!=null&&(Dt("beforetoggle",l),Dt("toggle",l)),h.onScroll!=null&&Dt("scroll",l),h.onScrollEnd!=null&&Dt("scrollend",l),h.onClick!=null&&(l.onclick=Xo),l=!0):l=!1,l||$a(i,!0)}function hw(i){for(pr=i.return;pr;)switch(pr.tag){case 5:case 31:case 13:Ci=!1;return;case 27:case 3:Ci=!0;return;default:pr=pr.return}}function rc(i){if(i!==pr)return!1;if(!Lt)return hw(i),Lt=!0,!1;var l=i.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||hy(i.type,i.memoizedProps)),u=!u),u&&yn&&$a(i),hw(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));yn=zC(i)}else if(l===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));yn=zC(i)}else l===27?(l=yn,Za(i.type)?(i=yy,yy=null,yn=i):yn=l):yn=pr?Ti(i.stateNode.nextSibling):null;return!0}function Fs(){yn=pr=null,Lt=!1}function Kg(){var i=za;return i!==null&&(Gr===null?Gr=i:Gr.push.apply(Gr,i),za=null),i}function Ou(i){za===null?za=[i]:za.push(i)}var Xg=O(null),Hs=null,ta=null;function Ua(i,l,u){se(Xg,l._currentValue),l._currentValue=u}function na(i){i._currentValue=Xg.current,H(Xg)}function Jg(i,l,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),i===u)break;i=i.return}}function Zg(i,l,u,h){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var w=b.dependencies;if(w!==null){var A=b.child;w=w.firstContext;e:for(;w!==null;){var N=w;w=b;for(var q=0;q<l.length;q++)if(N.context===l[q]){w.lanes|=u,N=w.alternate,N!==null&&(N.lanes|=u),Jg(w.return,u,i),h||(A=null);break e}w=N.next}}else if(b.tag===18){if(A=b.return,A===null)throw Error(r(341));A.lanes|=u,w=A.alternate,w!==null&&(w.lanes|=u),Jg(A,u,i),A=null}else A=b.child;if(A!==null)A.return=b;else for(A=b;A!==null;){if(A===i){A=null;break}if(b=A.sibling,b!==null){b.return=A.return,A=b;break}A=A.return}b=A}}function ic(i,l,u,h){i=null;for(var b=l,w=!1;b!==null;){if(!w){if((b.flags&524288)!==0)w=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var A=b.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var N=b.type;ri(b.pendingProps.value,A.value)||(i!==null?i.push(N):i=[N])}}else if(b===Ee.current){if(A=b.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(sd):i=[sd])}b=b.return}i!==null&&Zg(l,i,u,h),l.flags|=262144}function Jf(i){for(i=i.firstContext;i!==null;){if(!ri(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function qs(i){Hs=i,ta=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function mr(i){return pw(Hs,i)}function Zf(i,l){return Hs===null&&qs(i),pw(i,l)}function pw(i,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},ta===null){if(i===null)throw Error(r(308));ta=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else ta=ta.next=l;return u}var i4=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(u,h){i.push(h)}};this.abort=function(){l.aborted=!0,i.forEach(function(u){return u()})}},o4=e.unstable_scheduleCallback,a4=e.unstable_NormalPriority,Kn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ev(){return{controller:new i4,data:new Map,refCount:0}}function Mu(i){i.refCount--,i.refCount===0&&o4(a4,function(){i.controller.abort()})}var Lu=null,tv=0,oc=0,ac=null;function s4(i,l){if(Lu===null){var u=Lu=[];tv=0,oc=iy(),ac={status:"pending",value:void 0,then:function(h){u.push(h)}}}return tv++,l.then(mw,mw),l}function mw(){if(--tv===0&&Lu!==null){ac!==null&&(ac.status="fulfilled");var i=Lu;Lu=null,oc=0,ac=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function l4(i,l){var u=[],h={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return i.then(function(){h.status="fulfilled",h.value=l;for(var b=0;b<u.length;b++)(0,u[b])(l)},function(b){for(h.status="rejected",h.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),h}var gw=M.S;M.S=function(i,l){Zj=pe(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&s4(i,l),gw!==null&&gw(i,l)};var Gs=O(null);function nv(){var i=Gs.current;return i!==null?i:ln.pooledCache}function eh(i,l){l===null?se(Gs,Gs.current):se(Gs,l.pool)}function vw(){var i=nv();return i===null?null:{parent:Kn._currentValue,pool:i}}var sc=Error(r(460)),rv=Error(r(474)),th=Error(r(542)),nh={then:function(){}};function yw(i){return i=i.status,i==="fulfilled"||i==="rejected"}function xw(i,l,u){switch(u=i[u],u===void 0?i.push(l):u!==l&&(l.then(Xo,Xo),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,Sw(i),i;default:if(typeof l.status=="string")l.then(Xo,Xo);else{if(i=ln,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(h){if(l.status==="pending"){var b=l;b.status="fulfilled",b.value=h}},function(h){if(l.status==="pending"){var b=l;b.status="rejected",b.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,Sw(i),i}throw Ws=l,sc}}function Qs(i){try{var l=i._init;return l(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Ws=u,sc):u}}var Ws=null;function bw(){if(Ws===null)throw Error(r(459));var i=Ws;return Ws=null,i}function Sw(i){if(i===sc||i===th)throw Error(r(483))}var lc=null,Iu=0;function rh(i){var l=Iu;return Iu+=1,lc===null&&(lc=[]),xw(lc,i,l)}function zu(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function ih(i,l){throw l.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(l),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function ww(i){function l(J,W){if(i){var te=J.deletions;te===null?(J.deletions=[W],J.flags|=16):te.push(W)}}function u(J,W){if(!i)return null;for(;W!==null;)l(J,W),W=W.sibling;return null}function h(J){for(var W=new Map;J!==null;)J.key!==null?W.set(J.key,J):W.set(J.index,J),J=J.sibling;return W}function b(J,W){return J=Zo(J,W),J.index=0,J.sibling=null,J}function w(J,W,te){return J.index=te,i?(te=J.alternate,te!==null?(te=te.index,te<W?(J.flags|=67108866,W):te):(J.flags|=67108866,W)):(J.flags|=1048576,W)}function A(J){return i&&J.alternate===null&&(J.flags|=67108866),J}function N(J,W,te,me){return W===null||W.tag!==6?(W=qg(te,J.mode,me),W.return=J,W):(W=b(W,te),W.return=J,W)}function q(J,W,te,me){var ot=te.type;return ot===j?fe(J,W,te.props.children,me,te.key):W!==null&&(W.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===P&&Qs(ot)===W.type)?(W=b(W,te.props),zu(W,te),W.return=J,W):(W=Kf(te.type,te.key,te.props,null,J.mode,me),zu(W,te),W.return=J,W)}function ne(J,W,te,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==te.containerInfo||W.stateNode.implementation!==te.implementation?(W=Gg(te,J.mode,me),W.return=J,W):(W=b(W,te.children||[]),W.return=J,W)}function fe(J,W,te,me,ot){return W===null||W.tag!==7?(W=Vs(te,J.mode,me,ot),W.return=J,W):(W=b(W,te),W.return=J,W)}function ve(J,W,te){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=qg(""+W,J.mode,te),W.return=J,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case x:return te=Kf(W.type,W.key,W.props,null,J.mode,te),zu(te,W),te.return=J,te;case S:return W=Gg(W,J.mode,te),W.return=J,W;case P:return W=Qs(W),ve(J,W,te)}if(G(W)||K(W))return W=Vs(W,J.mode,te,null),W.return=J,W;if(typeof W.then=="function")return ve(J,rh(W),te);if(W.$$typeof===E)return ve(J,Zf(J,W),te);ih(J,W)}return null}function ae(J,W,te,me){var ot=W!==null?W.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return ot!==null?null:N(J,W,""+te,me);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return te.key===ot?q(J,W,te,me):null;case S:return te.key===ot?ne(J,W,te,me):null;case P:return te=Qs(te),ae(J,W,te,me)}if(G(te)||K(te))return ot!==null?null:fe(J,W,te,me,null);if(typeof te.then=="function")return ae(J,W,rh(te),me);if(te.$$typeof===E)return ae(J,W,Zf(J,te),me);ih(J,te)}return null}function ce(J,W,te,me,ot){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return J=J.get(te)||null,N(W,J,""+me,ot);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case x:return J=J.get(me.key===null?te:me.key)||null,q(W,J,me,ot);case S:return J=J.get(me.key===null?te:me.key)||null,ne(W,J,me,ot);case P:return me=Qs(me),ce(J,W,te,me,ot)}if(G(me)||K(me))return J=J.get(te)||null,fe(W,J,me,ot,null);if(typeof me.then=="function")return ce(J,W,te,rh(me),ot);if(me.$$typeof===E)return ce(J,W,te,Zf(W,me),ot);ih(W,me)}return null}function We(J,W,te,me){for(var ot=null,Vt=null,Ze=W,wt=W=0,Pt=null;Ze!==null&&wt<te.length;wt++){Ze.index>wt?(Pt=Ze,Ze=null):Pt=Ze.sibling;var Ft=ae(J,Ze,te[wt],me);if(Ft===null){Ze===null&&(Ze=Pt);break}i&&Ze&&Ft.alternate===null&&l(J,Ze),W=w(Ft,W,wt),Vt===null?ot=Ft:Vt.sibling=Ft,Vt=Ft,Ze=Pt}if(wt===te.length)return u(J,Ze),Lt&&ea(J,wt),ot;if(Ze===null){for(;wt<te.length;wt++)Ze=ve(J,te[wt],me),Ze!==null&&(W=w(Ze,W,wt),Vt===null?ot=Ze:Vt.sibling=Ze,Vt=Ze);return Lt&&ea(J,wt),ot}for(Ze=h(Ze);wt<te.length;wt++)Pt=ce(Ze,J,wt,te[wt],me),Pt!==null&&(i&&Pt.alternate!==null&&Ze.delete(Pt.key===null?wt:Pt.key),W=w(Pt,W,wt),Vt===null?ot=Pt:Vt.sibling=Pt,Vt=Pt);return i&&Ze.forEach(function(is){return l(J,is)}),Lt&&ea(J,wt),ot}function ct(J,W,te,me){if(te==null)throw Error(r(151));for(var ot=null,Vt=null,Ze=W,wt=W=0,Pt=null,Ft=te.next();Ze!==null&&!Ft.done;wt++,Ft=te.next()){Ze.index>wt?(Pt=Ze,Ze=null):Pt=Ze.sibling;var is=ae(J,Ze,Ft.value,me);if(is===null){Ze===null&&(Ze=Pt);break}i&&Ze&&is.alternate===null&&l(J,Ze),W=w(is,W,wt),Vt===null?ot=is:Vt.sibling=is,Vt=is,Ze=Pt}if(Ft.done)return u(J,Ze),Lt&&ea(J,wt),ot;if(Ze===null){for(;!Ft.done;wt++,Ft=te.next())Ft=ve(J,Ft.value,me),Ft!==null&&(W=w(Ft,W,wt),Vt===null?ot=Ft:Vt.sibling=Ft,Vt=Ft);return Lt&&ea(J,wt),ot}for(Ze=h(Ze);!Ft.done;wt++,Ft=te.next())Ft=ce(Ze,J,wt,Ft.value,me),Ft!==null&&(i&&Ft.alternate!==null&&Ze.delete(Ft.key===null?wt:Ft.key),W=w(Ft,W,wt),Vt===null?ot=Ft:Vt.sibling=Ft,Vt=Ft);return i&&Ze.forEach(function(x3){return l(J,x3)}),Lt&&ea(J,wt),ot}function on(J,W,te,me){if(typeof te=="object"&&te!==null&&te.type===j&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case x:e:{for(var ot=te.key;W!==null;){if(W.key===ot){if(ot=te.type,ot===j){if(W.tag===7){u(J,W.sibling),me=b(W,te.props.children),me.return=J,J=me;break e}}else if(W.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===P&&Qs(ot)===W.type){u(J,W.sibling),me=b(W,te.props),zu(me,te),me.return=J,J=me;break e}u(J,W);break}else l(J,W);W=W.sibling}te.type===j?(me=Vs(te.props.children,J.mode,me,te.key),me.return=J,J=me):(me=Kf(te.type,te.key,te.props,null,J.mode,me),zu(me,te),me.return=J,J=me)}return A(J);case S:e:{for(ot=te.key;W!==null;){if(W.key===ot)if(W.tag===4&&W.stateNode.containerInfo===te.containerInfo&&W.stateNode.implementation===te.implementation){u(J,W.sibling),me=b(W,te.children||[]),me.return=J,J=me;break e}else{u(J,W);break}else l(J,W);W=W.sibling}me=Gg(te,J.mode,me),me.return=J,J=me}return A(J);case P:return te=Qs(te),on(J,W,te,me)}if(G(te))return We(J,W,te,me);if(K(te)){if(ot=K(te),typeof ot!="function")throw Error(r(150));return te=ot.call(te),ct(J,W,te,me)}if(typeof te.then=="function")return on(J,W,rh(te),me);if(te.$$typeof===E)return on(J,W,Zf(J,te),me);ih(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,W!==null&&W.tag===6?(u(J,W.sibling),me=b(W,te),me.return=J,J=me):(u(J,W),me=qg(te,J.mode,me),me.return=J,J=me),A(J)):u(J,W)}return function(J,W,te,me){try{Iu=0;var ot=on(J,W,te,me);return lc=null,ot}catch(Ze){if(Ze===sc||Ze===th)throw Ze;var Vt=ii(29,Ze,null,J.mode);return Vt.lanes=me,Vt.return=J,Vt}}}var Ys=ww(!0),jw=ww(!1),Ba=!1;function iv(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ov(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 Va(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Fa(i,l,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(qt&2)!==0){var b=h.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),h.pending=l,l=Yf(i),aw(i,null,u),l}return Wf(i,h,l,u),Yf(i)}function $u(i,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var h=l.lanes;h&=i.pendingLanes,u|=h,l.lanes=u,V(i,u)}}function av(i,l){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var b=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?b=w=A:w=w.next=A,u=u.next}while(u!==null);w===null?b=w=l:w=w.next=l}else b=w=l;u={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=l:i.next=l,u.lastBaseUpdate=l}var sv=!1;function Uu(){if(sv){var i=ac;if(i!==null)throw i}}function Bu(i,l,u,h){sv=!1;var b=i.updateQueue;Ba=!1;var w=b.firstBaseUpdate,A=b.lastBaseUpdate,N=b.shared.pending;if(N!==null){b.shared.pending=null;var q=N,ne=q.next;q.next=null,A===null?w=ne:A.next=ne,A=q;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,N=fe.lastBaseUpdate,N!==A&&(N===null?fe.firstBaseUpdate=ne:N.next=ne,fe.lastBaseUpdate=q))}if(w!==null){var ve=b.baseState;A=0,fe=ne=q=null,N=w;do{var ae=N.lane&-536870913,ce=ae!==N.lane;if(ce?(kt&ae)===ae:(h&ae)===ae){ae!==0&&ae===oc&&(sv=!0),fe!==null&&(fe=fe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var We=i,ct=N;ae=l;var on=u;switch(ct.tag){case 1:if(We=ct.payload,typeof We=="function"){ve=We.call(on,ve,ae);break e}ve=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=ct.payload,ae=typeof We=="function"?We.call(on,ve,ae):We,ae==null)break e;ve=g({},ve,ae);break e;case 2:Ba=!0}}ae=N.callback,ae!==null&&(i.flags|=64,ce&&(i.flags|=8192),ce=b.callbacks,ce===null?b.callbacks=[ae]:ce.push(ae))}else ce={lane:ae,tag:N.tag,payload:N.payload,callback:N.callback,next:null},fe===null?(ne=fe=ce,q=ve):fe=fe.next=ce,A|=ae;if(N=N.next,N===null){if(N=b.shared.pending,N===null)break;ce=N,N=ce.next,ce.next=null,b.lastBaseUpdate=ce,b.shared.pending=null}}while(!0);fe===null&&(q=ve),b.baseState=q,b.firstBaseUpdate=ne,b.lastBaseUpdate=fe,w===null&&(b.shared.lanes=0),Wa|=A,i.lanes=A,i.memoizedState=ve}}function Cw(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function Ew(i,l){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)Cw(u[i],l)}var cc=O(null),oh=O(0);function Tw(i,l){i=da,se(oh,i),se(cc,l),da=i|l.baseLanes}function lv(){se(oh,da),se(cc,cc.current)}function cv(){da=oh.current,H(cc),H(oh)}var oi=O(null),Ei=null;function Ha(i){var l=i.alternate;se(Hn,Hn.current&1),se(oi,i),Ei===null&&(l===null||cc.current!==null||l.memoizedState!==null)&&(Ei=i)}function uv(i){se(Hn,Hn.current),se(oi,i),Ei===null&&(Ei=i)}function Rw(i){i.tag===22?(se(Hn,Hn.current),se(oi,i),Ei===null&&(Ei=i)):qa()}function qa(){se(Hn,Hn.current),se(oi,oi.current)}function ai(i){H(oi),Ei===i&&(Ei=null),H(Hn)}var Hn=O(0);function ah(i){for(var l=i;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||gy(u)||vy(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){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}var ra=0,xt=null,nn=null,Xn=null,sh=!1,uc=!1,Ks=!1,lh=0,Vu=0,dc=null,c4=0;function In(){throw Error(r(321))}function dv(i,l){if(l===null)return!1;for(var u=0;u<l.length&&u<i.length;u++)if(!ri(i[u],l[u]))return!1;return!0}function fv(i,l,u,h,b,w){return ra=w,xt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=i===null||i.memoizedState===null?uj:Rv,Ks=!1,w=u(h,b),Ks=!1,uc&&(w=Dw(l,u,h,b)),_w(i),w}function _w(i){M.H=qu;var l=nn!==null&&nn.next!==null;if(ra=0,Xn=nn=xt=null,sh=!1,Vu=0,dc=null,l)throw Error(r(300));i===null||Jn||(i=i.dependencies,i!==null&&Jf(i)&&(Jn=!0))}function Dw(i,l,u,h){xt=i;var b=0;do{if(uc&&(dc=null),Vu=0,uc=!1,25<=b)throw Error(r(301));if(b+=1,Xn=nn=null,i.updateQueue!=null){var w=i.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}M.H=dj,w=l(u,h)}while(uc);return w}function u4(){var i=M.H,l=i.useState()[0];return l=typeof l.then=="function"?Fu(l):l,i=i.useState()[0],(nn!==null?nn.memoizedState:null)!==i&&(xt.flags|=1024),l}function hv(){var i=lh!==0;return lh=0,i}function pv(i,l,u){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~u}function mv(i){if(sh){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}sh=!1}ra=0,Xn=nn=xt=null,uc=!1,Vu=lh=0,dc=null}function kr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?xt.memoizedState=Xn=i:Xn=Xn.next=i,Xn}function qn(){if(nn===null){var i=xt.alternate;i=i!==null?i.memoizedState:null}else i=nn.next;var l=Xn===null?xt.memoizedState:Xn.next;if(l!==null)Xn=l,nn=i;else{if(i===null)throw xt.alternate===null?Error(r(467)):Error(r(310));nn=i,i={memoizedState:nn.memoizedState,baseState:nn.baseState,baseQueue:nn.baseQueue,queue:nn.queue,next:null},Xn===null?xt.memoizedState=Xn=i:Xn=Xn.next=i}return Xn}function ch(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fu(i){var l=Vu;return Vu+=1,dc===null&&(dc=[]),i=xw(dc,i,l),l=xt,(Xn===null?l.memoizedState:Xn.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?uj:Rv),i}function uh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Fu(i);if(i.$$typeof===E)return mr(i)}throw Error(r(438,String(i)))}function gv(i){var l=null,u=xt.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var h=xt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(b){return b.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=ch(),xt.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(i),h=0;h<i;h++)u[h]=B;return l.index++,u}function ia(i,l){return typeof l=="function"?l(i):l}function dh(i){var l=qn();return vv(l,nn,i)}function vv(i,l,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var b=i.baseQueue,w=h.pending;if(w!==null){if(b!==null){var A=b.next;b.next=w.next,w.next=A}l.baseQueue=b=w,h.pending=null}if(w=i.baseState,b===null)i.memoizedState=w;else{l=b.next;var N=A=null,q=null,ne=l,fe=!1;do{var ve=ne.lane&-536870913;if(ve!==ne.lane?(kt&ve)===ve:(ra&ve)===ve){var ae=ne.revertLane;if(ae===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ve===oc&&(fe=!0);else if((ra&ae)===ae){ne=ne.next,ae===oc&&(fe=!0);continue}else ve={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},q===null?(N=q=ve,A=w):q=q.next=ve,xt.lanes|=ae,Wa|=ae;ve=ne.action,Ks&&u(w,ve),w=ne.hasEagerState?ne.eagerState:u(w,ve)}else ae={lane:ve,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},q===null?(N=q=ae,A=w):q=q.next=ae,xt.lanes|=ve,Wa|=ve;ne=ne.next}while(ne!==null&&ne!==l);if(q===null?A=w:q.next=N,!ri(w,i.memoizedState)&&(Jn=!0,fe&&(u=ac,u!==null)))throw u;i.memoizedState=w,i.baseState=A,i.baseQueue=q,h.lastRenderedState=w}return b===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function yv(i){var l=qn(),u=l.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,b=u.pending,w=l.memoizedState;if(b!==null){u.pending=null;var A=b=b.next;do w=i(w,A.action),A=A.next;while(A!==b);ri(w,l.memoizedState)||(Jn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),u.lastRenderedState=w}return[w,h]}function Aw(i,l,u){var h=xt,b=qn(),w=Lt;if(w){if(u===void 0)throw Error(r(407));u=u()}else u=l();var A=!ri((nn||b).memoizedState,u);if(A&&(b.memoizedState=u,Jn=!0),b=b.queue,Sv(Nw.bind(null,h,b,i),[i]),b.getSnapshot!==l||A||Xn!==null&&Xn.memoizedState.tag&1){if(h.flags|=2048,fc(9,{destroy:void 0},Pw.bind(null,h,b,u,l),null),ln===null)throw Error(r(349));w||(ra&127)!==0||kw(h,l,u)}return u}function kw(i,l,u){i.flags|=16384,i={getSnapshot:l,value:u},l=xt.updateQueue,l===null?(l=ch(),xt.updateQueue=l,l.stores=[i]):(u=l.stores,u===null?l.stores=[i]:u.push(i))}function Pw(i,l,u,h){l.value=u,l.getSnapshot=h,Ow(l)&&Mw(i)}function Nw(i,l,u){return u(function(){Ow(l)&&Mw(i)})}function Ow(i){var l=i.getSnapshot;i=i.value;try{var u=l();return!ri(i,u)}catch{return!0}}function Mw(i){var l=Bs(i,2);l!==null&&Qr(l,i,2)}function xv(i){var l=kr();if(typeof i=="function"){var u=i;if(i=u(),Ks){dr(!0);try{u()}finally{dr(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:i},l}function Lw(i,l,u,h){return i.baseState=u,vv(i,nn,typeof h=="function"?h:ia)}function d4(i,l,u,h,b){if(ph(i))throw Error(r(485));if(i=l.action,i!==null){var w={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){w.listeners.push(A)}};M.T!==null?u(!0):w.isTransition=!1,h(w),u=l.pending,u===null?(w.next=l.pending=w,Iw(l,w)):(w.next=u.next,l.pending=u.next=w)}}function Iw(i,l){var u=l.action,h=l.payload,b=i.state;if(l.isTransition){var w=M.T,A={};M.T=A;try{var N=u(b,h),q=M.S;q!==null&&q(A,N),zw(i,l,N)}catch(ne){bv(i,l,ne)}finally{w!==null&&A.types!==null&&(w.types=A.types),M.T=w}}else try{w=u(b,h),zw(i,l,w)}catch(ne){bv(i,l,ne)}}function zw(i,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){$w(i,l,h)},function(h){return bv(i,l,h)}):$w(i,l,u)}function $w(i,l,u){l.status="fulfilled",l.value=u,Uw(l),i.state=u,l=i.pending,l!==null&&(u=l.next,u===l?i.pending=null:(u=u.next,l.next=u,Iw(i,u)))}function bv(i,l,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,Uw(l),l=l.next;while(l!==h)}i.action=null}function Uw(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function Bw(i,l){return l}function Vw(i,l){if(Lt){var u=ln.formState;if(u!==null){e:{var h=xt;if(Lt){if(yn){t:{for(var b=yn,w=Ci;b.nodeType!==8;){if(!w){b=null;break t}if(b=Ti(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){yn=Ti(b.nextSibling),h=b.data==="F!";break e}}$a(h)}h=!1}h&&(l=u[0])}}return u=kr(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bw,lastRenderedState:l},u.queue=h,u=sj.bind(null,xt,h),h.dispatch=u,h=xv(!1),w=Tv.bind(null,xt,!1,h.queue),h=kr(),b={state:l,dispatch:null,action:i,pending:null},h.queue=b,u=d4.bind(null,xt,b,w,u),b.dispatch=u,h.memoizedState=i,[l,u,!1]}function Fw(i){var l=qn();return Hw(l,nn,i)}function Hw(i,l,u){if(l=vv(i,l,Bw)[0],i=dh(ia)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=Fu(l)}catch(A){throw A===sc?th:A}else h=l;l=qn();var b=l.queue,w=b.dispatch;return u!==l.memoizedState&&(xt.flags|=2048,fc(9,{destroy:void 0},f4.bind(null,b,u),null)),[h,w,i]}function f4(i,l){i.action=l}function qw(i){var l=qn(),u=nn;if(u!==null)return Hw(l,u,i);qn(),l=l.memoizedState,u=qn();var h=u.queue.dispatch;return u.memoizedState=i,[l,h,!1]}function fc(i,l,u,h){return i={tag:i,create:u,deps:h,inst:l,next:null},l=xt.updateQueue,l===null&&(l=ch(),xt.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,l.lastEffect=i),i}function Gw(){return qn().memoizedState}function fh(i,l,u,h){var b=kr();xt.flags|=i,b.memoizedState=fc(1|l,{destroy:void 0},u,h===void 0?null:h)}function hh(i,l,u,h){var b=qn();h=h===void 0?null:h;var w=b.memoizedState.inst;nn!==null&&h!==null&&dv(h,nn.memoizedState.deps)?b.memoizedState=fc(l,w,u,h):(xt.flags|=i,b.memoizedState=fc(1|l,w,u,h))}function Qw(i,l){fh(8390656,8,i,l)}function Sv(i,l){hh(2048,8,i,l)}function h4(i){xt.flags|=4;var l=xt.updateQueue;if(l===null)l=ch(),xt.updateQueue=l,l.events=[i];else{var u=l.events;u===null?l.events=[i]:u.push(i)}}function Ww(i){var l=qn().memoizedState;return h4({ref:l,nextImpl:i}),function(){if((qt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Yw(i,l){return hh(4,2,i,l)}function Kw(i,l){return hh(4,4,i,l)}function Xw(i,l){if(typeof l=="function"){i=i();var u=l(i);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Jw(i,l,u){u=u!=null?u.concat([i]):null,hh(4,4,Xw.bind(null,l,i),u)}function wv(){}function Zw(i,l){var u=qn();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&dv(l,h[1])?h[0]:(u.memoizedState=[i,l],i)}function ej(i,l){var u=qn();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&dv(l,h[1]))return h[0];if(h=i(),Ks){dr(!0);try{i()}finally{dr(!1)}}return u.memoizedState=[h,l],h}function jv(i,l,u){return u===void 0||(ra&1073741824)!==0&&(kt&261930)===0?i.memoizedState=l:(i.memoizedState=u,i=tC(),xt.lanes|=i,Wa|=i,u)}function tj(i,l,u,h){return ri(u,l)?u:cc.current!==null?(i=jv(i,u,h),ri(i,l)||(Jn=!0),i):(ra&42)===0||(ra&1073741824)!==0&&(kt&261930)===0?(Jn=!0,i.memoizedState=u):(i=tC(),xt.lanes|=i,Wa|=i,l)}function nj(i,l,u,h,b){var w=L.p;L.p=w!==0&&8>w?w:8;var A=M.T,N={};M.T=N,Tv(i,!1,l,u);try{var q=b(),ne=M.S;if(ne!==null&&ne(N,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var fe=l4(q,h);Hu(i,l,fe,ci(i))}else Hu(i,l,h,ci(i))}catch(ve){Hu(i,l,{then:function(){},status:"rejected",reason:ve},ci())}finally{L.p=w,A!==null&&N.types!==null&&(A.types=N.types),M.T=A}}function p4(){}function Cv(i,l,u,h){if(i.tag!==5)throw Error(r(476));var b=rj(i).queue;nj(i,b,l,z,u===null?p4:function(){return ij(i),u(h)})}function rj(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:ia,lastRenderedState:z},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:u},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function ij(i){var l=rj(i);l.next===null&&(l=i.alternate.memoizedState),Hu(i,l.next.queue,{},ci())}function Ev(){return mr(sd)}function oj(){return qn().memoizedState}function aj(){return qn().memoizedState}function m4(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var u=ci();i=Va(u);var h=Fa(l,i,u);h!==null&&(Qr(h,l,u),$u(h,l,u)),l={cache:ev()},i.payload=l;return}l=l.return}}function g4(i,l,u){var h=ci();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ph(i)?lj(l,u):(u=Fg(i,l,u,h),u!==null&&(Qr(u,i,h),cj(u,l,h)))}function sj(i,l,u){var h=ci();Hu(i,l,u,h)}function Hu(i,l,u,h){var b={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(ph(i))lj(l,b);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var A=l.lastRenderedState,N=w(A,u);if(b.hasEagerState=!0,b.eagerState=N,ri(N,A))return Wf(i,l,b,0),ln===null&&Qf(),!1}catch{}if(u=Fg(i,l,b,h),u!==null)return Qr(u,i,h),cj(u,l,h),!0}return!1}function Tv(i,l,u,h){if(h={lane:2,revertLane:iy(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ph(i)){if(l)throw Error(r(479))}else l=Fg(i,u,h,2),l!==null&&Qr(l,i,2)}function ph(i){var l=i.alternate;return i===xt||l!==null&&l===xt}function lj(i,l){uc=sh=!0;var u=i.pending;u===null?l.next=l:(l.next=u.next,u.next=l),i.pending=l}function cj(i,l,u){if((u&4194048)!==0){var h=l.lanes;h&=i.pendingLanes,u|=h,l.lanes=u,V(i,u)}}var qu={readContext:mr,use:uh,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useLayoutEffect:In,useInsertionEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useSyncExternalStore:In,useId:In,useHostTransitionStatus:In,useFormState:In,useActionState:In,useOptimistic:In,useMemoCache:In,useCacheRefresh:In};qu.useEffectEvent=In;var uj={readContext:mr,use:uh,useCallback:function(i,l){return kr().memoizedState=[i,l===void 0?null:l],i},useContext:mr,useEffect:Qw,useImperativeHandle:function(i,l,u){u=u!=null?u.concat([i]):null,fh(4194308,4,Xw.bind(null,l,i),u)},useLayoutEffect:function(i,l){return fh(4194308,4,i,l)},useInsertionEffect:function(i,l){fh(4,2,i,l)},useMemo:function(i,l){var u=kr();l=l===void 0?null:l;var h=i();if(Ks){dr(!0);try{i()}finally{dr(!1)}}return u.memoizedState=[h,l],h},useReducer:function(i,l,u){var h=kr();if(u!==void 0){var b=u(l);if(Ks){dr(!0);try{u(l)}finally{dr(!1)}}}else b=l;return h.memoizedState=h.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},h.queue=i,i=i.dispatch=g4.bind(null,xt,i),[h.memoizedState,i]},useRef:function(i){var l=kr();return i={current:i},l.memoizedState=i},useState:function(i){i=xv(i);var l=i.queue,u=sj.bind(null,xt,l);return l.dispatch=u,[i.memoizedState,u]},useDebugValue:wv,useDeferredValue:function(i,l){var u=kr();return jv(u,i,l)},useTransition:function(){var i=xv(!1);return i=nj.bind(null,xt,i.queue,!0,!1),kr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,u){var h=xt,b=kr();if(Lt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=l(),ln===null)throw Error(r(349));(kt&127)!==0||kw(h,l,u)}b.memoizedState=u;var w={value:u,getSnapshot:l};return b.queue=w,Qw(Nw.bind(null,h,w,i),[i]),h.flags|=2048,fc(9,{destroy:void 0},Pw.bind(null,h,w,u,l),null),u},useId:function(){var i=kr(),l=ln.identifierPrefix;if(Lt){var u=mo,h=po;u=(h&~(1<<32-Rn(h)-1)).toString(32)+u,l="_"+l+"R_"+u,u=lh++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=c4++,l="_"+l+"r_"+u.toString(32)+"_";return i.memoizedState=l},useHostTransitionStatus:Ev,useFormState:Vw,useActionState:Vw,useOptimistic:function(i){var l=kr();l.memoizedState=l.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Tv.bind(null,xt,!0,u),u.dispatch=l,[i,l]},useMemoCache:gv,useCacheRefresh:function(){return kr().memoizedState=m4.bind(null,xt)},useEffectEvent:function(i){var l=kr(),u={impl:i};return l.memoizedState=u,function(){if((qt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Rv={readContext:mr,use:uh,useCallback:Zw,useContext:mr,useEffect:Sv,useImperativeHandle:Jw,useInsertionEffect:Yw,useLayoutEffect:Kw,useMemo:ej,useReducer:dh,useRef:Gw,useState:function(){return dh(ia)},useDebugValue:wv,useDeferredValue:function(i,l){var u=qn();return tj(u,nn.memoizedState,i,l)},useTransition:function(){var i=dh(ia)[0],l=qn().memoizedState;return[typeof i=="boolean"?i:Fu(i),l]},useSyncExternalStore:Aw,useId:oj,useHostTransitionStatus:Ev,useFormState:Fw,useActionState:Fw,useOptimistic:function(i,l){var u=qn();return Lw(u,nn,i,l)},useMemoCache:gv,useCacheRefresh:aj};Rv.useEffectEvent=Ww;var dj={readContext:mr,use:uh,useCallback:Zw,useContext:mr,useEffect:Sv,useImperativeHandle:Jw,useInsertionEffect:Yw,useLayoutEffect:Kw,useMemo:ej,useReducer:yv,useRef:Gw,useState:function(){return yv(ia)},useDebugValue:wv,useDeferredValue:function(i,l){var u=qn();return nn===null?jv(u,i,l):tj(u,nn.memoizedState,i,l)},useTransition:function(){var i=yv(ia)[0],l=qn().memoizedState;return[typeof i=="boolean"?i:Fu(i),l]},useSyncExternalStore:Aw,useId:oj,useHostTransitionStatus:Ev,useFormState:qw,useActionState:qw,useOptimistic:function(i,l){var u=qn();return nn!==null?Lw(u,nn,i,l):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:gv,useCacheRefresh:aj};dj.useEffectEvent=Ww;function _v(i,l,u,h){l=i.memoizedState,u=u(h,l),u=u==null?l:g({},l,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Dv={enqueueSetState:function(i,l,u){i=i._reactInternals;var h=ci(),b=Va(h);b.payload=l,u!=null&&(b.callback=u),l=Fa(i,b,h),l!==null&&(Qr(l,i,h),$u(l,i,h))},enqueueReplaceState:function(i,l,u){i=i._reactInternals;var h=ci(),b=Va(h);b.tag=1,b.payload=l,u!=null&&(b.callback=u),l=Fa(i,b,h),l!==null&&(Qr(l,i,h),$u(l,i,h))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var u=ci(),h=Va(u);h.tag=2,l!=null&&(h.callback=l),l=Fa(i,h,u),l!==null&&(Qr(l,i,u),$u(l,i,u))}};function fj(i,l,u,h,b,w,A){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,w,A):l.prototype&&l.prototype.isPureReactComponent?!ku(u,h)||!ku(b,w):!0}function hj(i,l,u,h){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,h),l.state!==i&&Dv.enqueueReplaceState(l,l.state,null)}function Xs(i,l){var u=l;if("ref"in l){u={};for(var h in l)h!=="ref"&&(u[h]=l[h])}if(i=i.defaultProps){u===l&&(u=g({},u));for(var b in i)u[b]===void 0&&(u[b]=i[b])}return u}function pj(i){Gf(i)}function mj(i){console.error(i)}function gj(i){Gf(i)}function mh(i,l){try{var u=i.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function vj(i,l,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Av(i,l,u){return u=Va(u),u.tag=3,u.payload={element:null},u.callback=function(){mh(i,l)},u}function yj(i){return i=Va(i),i.tag=3,i}function xj(i,l,u,h){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var w=h.value;i.payload=function(){return b(w)},i.callback=function(){vj(l,u,h)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(i.callback=function(){vj(l,u,h),typeof b!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})})}function v4(i,l,u,h,b){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&ic(l,u,b,!0),u=oi.current,u!==null){switch(u.tag){case 31:case 13:return Ei===null?Rh():u.alternate===null&&zn===0&&(zn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,h===nh?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([h]):l.add(h),ty(i,h,b)),!1;case 22:return u.flags|=65536,h===nh?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([h]):u.add(h)),ty(i,h,b)),!1}throw Error(r(435,u.tag))}return ty(i,h,b),Rh(),!1}if(Lt)return l=oi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,h!==Yg&&(i=Error(r(422),{cause:h}),Ou(Si(i,u)))):(h!==Yg&&(l=Error(r(423),{cause:h}),Ou(Si(l,u))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,h=Si(h,u),b=Av(i.stateNode,h,b),av(i,b),zn!==4&&(zn=2)),!1;var w=Error(r(520),{cause:h});if(w=Si(w,u),Zu===null?Zu=[w]:Zu.push(w),zn!==4&&(zn=2),l===null)return!0;h=Si(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,i=b&-b,u.lanes|=i,i=Av(u.stateNode,h,i),av(u,i),!1;case 1:if(l=u.type,w=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ya===null||!Ya.has(w))))return u.flags|=65536,b&=-b,u.lanes|=b,b=yj(b),xj(b,i,u,h),av(u,b),!1}u=u.return}while(u!==null);return!1}var kv=Error(r(461)),Jn=!1;function gr(i,l,u,h){l.child=i===null?jw(l,null,u,h):Ys(l,i.child,u,h)}function bj(i,l,u,h,b){u=u.render;var w=l.ref;if("ref"in h){var A={};for(var N in h)N!=="ref"&&(A[N]=h[N])}else A=h;return qs(l),h=fv(i,l,u,A,w,b),N=hv(),i!==null&&!Jn?(pv(i,l,b),oa(i,l,b)):(Lt&&N&&Qg(l),l.flags|=1,gr(i,l,h,b),l.child)}function Sj(i,l,u,h,b){if(i===null){var w=u.type;return typeof w=="function"&&!Hg(w)&&w.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=w,wj(i,l,w,h,b)):(i=Kf(u.type,null,h,l,l.mode,b),i.ref=l.ref,i.return=l,l.child=i)}if(w=i.child,!$v(i,b)){var A=w.memoizedProps;if(u=u.compare,u=u!==null?u:ku,u(A,h)&&i.ref===l.ref)return oa(i,l,b)}return l.flags|=1,i=Zo(w,h),i.ref=l.ref,i.return=l,l.child=i}function wj(i,l,u,h,b){if(i!==null){var w=i.memoizedProps;if(ku(w,h)&&i.ref===l.ref)if(Jn=!1,l.pendingProps=h=w,$v(i,b))(i.flags&131072)!==0&&(Jn=!0);else return l.lanes=i.lanes,oa(i,l,b)}return Pv(i,l,u,h,b)}function jj(i,l,u,h){var b=h.children,w=i!==null?i.memoizedState:null;if(i===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((l.flags&128)!==0){if(w=w!==null?w.baseLanes|u:u,i!==null){for(h=l.child=i.child,b=0;h!==null;)b=b|h.lanes|h.childLanes,h=h.sibling;h=b&~w}else h=0,l.child=null;return Cj(i,l,w,u,h)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&eh(l,w!==null?w.cachePool:null),w!==null?Tw(l,w):lv(),Rw(l);else return h=l.lanes=536870912,Cj(i,l,w!==null?w.baseLanes|u:u,u,h)}else w!==null?(eh(l,w.cachePool),Tw(l,w),qa(),l.memoizedState=null):(i!==null&&eh(l,null),lv(),qa());return gr(i,l,b,u),l.child}function Gu(i,l){return i!==null&&i.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function Cj(i,l,u,h,b){var w=nv();return w=w===null?null:{parent:Kn._currentValue,pool:w},l.memoizedState={baseLanes:u,cachePool:w},i!==null&&eh(l,null),lv(),Rw(l),i!==null&&ic(i,l,h,!0),l.childLanes=b,null}function gh(i,l){return l=yh({mode:l.mode,children:l.children},i.mode),l.ref=i.ref,i.child=l,l.return=i,l}function Ej(i,l,u){return Ys(l,i.child,null,u),i=gh(l,l.pendingProps),i.flags|=2,ai(l),l.memoizedState=null,i}function y4(i,l,u){var h=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,i===null){if(Lt){if(h.mode==="hidden")return i=gh(l,h),l.lanes=536870912,Gu(null,i);if(uv(l),(i=yn)?(i=IC(i,Ci),i=i!==null&&i.data==="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:Ia!==null?{id:po,overflow:mo}:null,retryLane:536870912,hydrationErrors:null},u=lw(i),u.return=l,l.child=u,pr=l,yn=null)):i=null,i===null)throw $a(l);return l.lanes=536870912,null}return gh(l,h)}var w=i.memoizedState;if(w!==null){var A=w.dehydrated;if(uv(l),b)if(l.flags&256)l.flags&=-257,l=Ej(i,l,u);else if(l.memoizedState!==null)l.child=i.child,l.flags|=128,l=null;else throw Error(r(558));else if(Jn||ic(i,l,u,!1),b=(u&i.childLanes)!==0,Jn||b){if(h=ln,h!==null&&(A=X(h,u),A!==0&&A!==w.retryLane))throw w.retryLane=A,Bs(i,A),Qr(h,i,A),kv;Rh(),l=Ej(i,l,u)}else i=w.treeContext,yn=Ti(A.nextSibling),pr=l,Lt=!0,za=null,Ci=!1,i!==null&&dw(l,i),l=gh(l,h),l.flags|=4096;return l}return i=Zo(i.child,{mode:h.mode,children:h.children}),i.ref=l.ref,l.child=i,i.return=l,i}function vh(i,l){var u=l.ref;if(u===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(l.flags|=4194816)}}function Pv(i,l,u,h,b){return qs(l),u=fv(i,l,u,h,void 0,b),h=hv(),i!==null&&!Jn?(pv(i,l,b),oa(i,l,b)):(Lt&&h&&Qg(l),l.flags|=1,gr(i,l,u,b),l.child)}function Tj(i,l,u,h,b,w){return qs(l),l.updateQueue=null,u=Dw(l,h,u,b),_w(i),h=hv(),i!==null&&!Jn?(pv(i,l,w),oa(i,l,w)):(Lt&&h&&Qg(l),l.flags|=1,gr(i,l,u,w),l.child)}function Rj(i,l,u,h,b){if(qs(l),l.stateNode===null){var w=ec,A=u.contextType;typeof A=="object"&&A!==null&&(w=mr(A)),w=new u(h,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Dv,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=h,w.state=l.memoizedState,w.refs={},iv(l),A=u.contextType,w.context=typeof A=="object"&&A!==null?mr(A):ec,w.state=l.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(_v(l,u,A,h),w.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(A=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),A!==w.state&&Dv.enqueueReplaceState(w,w.state,null),Bu(l,h,w,b),Uu(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(i===null){w=l.stateNode;var N=l.memoizedProps,q=Xs(u,N);w.props=q;var ne=w.context,fe=u.contextType;A=ec,typeof fe=="object"&&fe!==null&&(A=mr(fe));var ve=u.getDerivedStateFromProps;fe=typeof ve=="function"||typeof w.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,fe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N||ne!==A)&&hj(l,w,h,A),Ba=!1;var ae=l.memoizedState;w.state=ae,Bu(l,h,w,b),Uu(),ne=l.memoizedState,N||ae!==ne||Ba?(typeof ve=="function"&&(_v(l,u,ve,h),ne=l.memoizedState),(q=Ba||fj(l,u,q,h,ae,ne,A))?(fe||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=ne),w.props=h,w.state=ne,w.context=A,h=q):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{w=l.stateNode,ov(i,l),A=l.memoizedProps,fe=Xs(u,A),w.props=fe,ve=l.pendingProps,ae=w.context,ne=u.contextType,q=ec,typeof ne=="object"&&ne!==null&&(q=mr(ne)),N=u.getDerivedStateFromProps,(ne=typeof N=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==ve||ae!==q)&&hj(l,w,h,q),Ba=!1,ae=l.memoizedState,w.state=ae,Bu(l,h,w,b),Uu();var ce=l.memoizedState;A!==ve||ae!==ce||Ba||i!==null&&i.dependencies!==null&&Jf(i.dependencies)?(typeof N=="function"&&(_v(l,u,N,h),ce=l.memoizedState),(fe=Ba||fj(l,u,fe,h,ae,ce,q)||i!==null&&i.dependencies!==null&&Jf(i.dependencies))?(ne||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,ce,q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,ce,q)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ce),w.props=h,w.state=ce,w.context=q,h=fe):(typeof w.componentDidUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),h=!1)}return w=h,vh(i,l),h=(l.flags&128)!==0,w||h?(w=l.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,i!==null&&h?(l.child=Ys(l,i.child,null,b),l.child=Ys(l,null,u,b)):gr(i,l,u,b),l.memoizedState=w.state,i=l.child):i=oa(i,l,b),i}function _j(i,l,u,h){return Fs(),l.flags|=256,gr(i,l,u,h),l.child}var Nv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ov(i){return{baseLanes:i,cachePool:vw()}}function Mv(i,l,u){return i=i!==null?i.childLanes&~u:0,l&&(i|=li),i}function Dj(i,l,u){var h=l.pendingProps,b=!1,w=(l.flags&128)!==0,A;if((A=w)||(A=i!==null&&i.memoizedState===null?!1:(Hn.current&2)!==0),A&&(b=!0,l.flags&=-129),A=(l.flags&32)!==0,l.flags&=-33,i===null){if(Lt){if(b?Ha(l):qa(),(i=yn)?(i=IC(i,Ci),i=i!==null&&i.data!=="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:Ia!==null?{id:po,overflow:mo}:null,retryLane:536870912,hydrationErrors:null},u=lw(i),u.return=l,l.child=u,pr=l,yn=null)):i=null,i===null)throw $a(l);return vy(i)?l.lanes=32:l.lanes=536870912,null}var N=h.children;return h=h.fallback,b?(qa(),b=l.mode,N=yh({mode:"hidden",children:N},b),h=Vs(h,b,u,null),N.return=l,h.return=l,N.sibling=h,l.child=N,h=l.child,h.memoizedState=Ov(u),h.childLanes=Mv(i,A,u),l.memoizedState=Nv,Gu(null,h)):(Ha(l),Lv(l,N))}var q=i.memoizedState;if(q!==null&&(N=q.dehydrated,N!==null)){if(w)l.flags&256?(Ha(l),l.flags&=-257,l=Iv(i,l,u)):l.memoizedState!==null?(qa(),l.child=i.child,l.flags|=128,l=null):(qa(),N=h.fallback,b=l.mode,h=yh({mode:"visible",children:h.children},b),N=Vs(N,b,u,null),N.flags|=2,h.return=l,N.return=l,h.sibling=N,l.child=h,Ys(l,i.child,null,u),h=l.child,h.memoizedState=Ov(u),h.childLanes=Mv(i,A,u),l.memoizedState=Nv,l=Gu(null,h));else if(Ha(l),vy(N)){if(A=N.nextSibling&&N.nextSibling.dataset,A)var ne=A.dgst;A=ne,h=Error(r(419)),h.stack="",h.digest=A,Ou({value:h,source:null,stack:null}),l=Iv(i,l,u)}else if(Jn||ic(i,l,u,!1),A=(u&i.childLanes)!==0,Jn||A){if(A=ln,A!==null&&(h=X(A,u),h!==0&&h!==q.retryLane))throw q.retryLane=h,Bs(i,h),Qr(A,i,h),kv;gy(N)||Rh(),l=Iv(i,l,u)}else gy(N)?(l.flags|=192,l.child=i.child,l=null):(i=q.treeContext,yn=Ti(N.nextSibling),pr=l,Lt=!0,za=null,Ci=!1,i!==null&&dw(l,i),l=Lv(l,h.children),l.flags|=4096);return l}return b?(qa(),N=h.fallback,b=l.mode,q=i.child,ne=q.sibling,h=Zo(q,{mode:"hidden",children:h.children}),h.subtreeFlags=q.subtreeFlags&65011712,ne!==null?N=Zo(ne,N):(N=Vs(N,b,u,null),N.flags|=2),N.return=l,h.return=l,h.sibling=N,l.child=h,Gu(null,h),h=l.child,N=i.child.memoizedState,N===null?N=Ov(u):(b=N.cachePool,b!==null?(q=Kn._currentValue,b=b.parent!==q?{parent:q,pool:q}:b):b=vw(),N={baseLanes:N.baseLanes|u,cachePool:b}),h.memoizedState=N,h.childLanes=Mv(i,A,u),l.memoizedState=Nv,Gu(i.child,h)):(Ha(l),u=i.child,i=u.sibling,u=Zo(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,i!==null&&(A=l.deletions,A===null?(l.deletions=[i],l.flags|=16):A.push(i)),l.child=u,l.memoizedState=null,u)}function Lv(i,l){return l=yh({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function yh(i,l){return i=ii(22,i,null,l),i.lanes=0,i}function Iv(i,l,u){return Ys(l,i.child,null,u),i=Lv(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function Aj(i,l,u){i.lanes|=l;var h=i.alternate;h!==null&&(h.lanes|=l),Jg(i.return,l,u)}function zv(i,l,u,h,b,w){var A=i.memoizedState;A===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:b,treeForkCount:w}:(A.isBackwards=l,A.rendering=null,A.renderingStartTime=0,A.last=h,A.tail=u,A.tailMode=b,A.treeForkCount=w)}function kj(i,l,u){var h=l.pendingProps,b=h.revealOrder,w=h.tail;h=h.children;var A=Hn.current,N=(A&2)!==0;if(N?(A=A&1|2,l.flags|=128):A&=1,se(Hn,A),gr(i,l,h,u),h=Lt?Nu:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Aj(i,u,l);else if(i.tag===19)Aj(i,u,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(b){case"forwards":for(u=l.child,b=null;u!==null;)i=u.alternate,i!==null&&ah(i)===null&&(b=u),u=u.sibling;u=b,u===null?(b=l.child,l.child=null):(b=u.sibling,u.sibling=null),zv(l,!1,b,u,w,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=l.child,l.child=null;b!==null;){if(i=b.alternate,i!==null&&ah(i)===null){l.child=b;break}i=b.sibling,b.sibling=u,u=b,b=i}zv(l,!0,u,null,w,h);break;case"together":zv(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function oa(i,l,u){if(i!==null&&(l.dependencies=i.dependencies),Wa|=l.lanes,(u&l.childLanes)===0)if(i!==null){if(ic(i,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(i!==null&&l.child!==i.child)throw Error(r(153));if(l.child!==null){for(i=l.child,u=Zo(i,i.pendingProps),l.child=u,u.return=l;i.sibling!==null;)i=i.sibling,u=u.sibling=Zo(i,i.pendingProps),u.return=l;u.sibling=null}return l.child}function $v(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&Jf(i)))}function x4(i,l,u){switch(l.tag){case 3:Xe(l,l.stateNode.containerInfo),Ua(l,Kn,i.memoizedState.cache),Fs();break;case 27:case 5:dt(l);break;case 4:Xe(l,l.stateNode.containerInfo);break;case 10:Ua(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,uv(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Ha(l),l.flags|=128,null):(u&l.child.childLanes)!==0?Dj(i,l,u):(Ha(l),i=oa(i,l,u),i!==null?i.sibling:null);Ha(l);break;case 19:var b=(i.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(ic(i,l,u,!1),h=(u&l.childLanes)!==0),b){if(h)return kj(i,l,u);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),se(Hn,Hn.current),h)break;return null;case 22:return l.lanes=0,jj(i,l,u,l.pendingProps);case 24:Ua(l,Kn,i.memoizedState.cache)}return oa(i,l,u)}function Pj(i,l,u){if(i!==null)if(i.memoizedProps!==l.pendingProps)Jn=!0;else{if(!$v(i,u)&&(l.flags&128)===0)return Jn=!1,x4(i,l,u);Jn=(i.flags&131072)!==0}else Jn=!1,Lt&&(l.flags&1048576)!==0&&uw(l,Nu,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(i=Qs(l.elementType),l.type=i,typeof i=="function")Hg(i)?(h=Xs(i,h),l.tag=1,l=Rj(null,l,i,h,u)):(l.tag=0,l=Pv(null,l,i,h,u));else{if(i!=null){var b=i.$$typeof;if(b===_){l.tag=11,l=bj(null,l,i,h,u);break e}else if(b===D){l.tag=14,l=Sj(null,l,i,h,u);break e}}throw l=U(i)||i,Error(r(306,l,""))}}return l;case 0:return Pv(i,l,l.type,l.pendingProps,u);case 1:return h=l.type,b=Xs(h,l.pendingProps),Rj(i,l,h,b,u);case 3:e:{if(Xe(l,l.stateNode.containerInfo),i===null)throw Error(r(387));h=l.pendingProps;var w=l.memoizedState;b=w.element,ov(i,l),Bu(l,h,null,u);var A=l.memoizedState;if(h=A.cache,Ua(l,Kn,h),h!==w.cache&&Zg(l,[Kn],u,!0),Uu(),h=A.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:A.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=_j(i,l,h,u);break e}else if(h!==b){b=Si(Error(r(424)),l),Ou(b),l=_j(i,l,h,u);break e}else for(i=l.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,yn=Ti(i.firstChild),pr=l,Lt=!0,za=null,Ci=!0,u=jw(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Fs(),h===b){l=oa(i,l,u);break e}gr(i,l,h,u)}l=l.child}return l;case 26:return vh(i,l),i===null?(u=FC(l.type,null,l.pendingProps,null))?l.memoizedState=u:Lt||(u=l.type,i=l.pendingProps,h=Oh(we.current).createElement(u),h[Oe]=l,h[Ve]=i,vr(h,u,i),An(h),l.stateNode=h):l.memoizedState=FC(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return dt(l),i===null&&Lt&&(h=l.stateNode=UC(l.type,l.pendingProps,we.current),pr=l,Ci=!0,b=yn,Za(l.type)?(yy=b,yn=Ti(h.firstChild)):yn=b),gr(i,l,l.pendingProps.children,u),vh(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&Lt&&((b=h=yn)&&(h=Y4(h,l.type,l.pendingProps,Ci),h!==null?(l.stateNode=h,pr=l,yn=Ti(h.firstChild),Ci=!1,b=!0):b=!1),b||$a(l)),dt(l),b=l.type,w=l.pendingProps,A=i!==null?i.memoizedProps:null,h=w.children,hy(b,w)?h=null:A!==null&&hy(b,A)&&(l.flags|=32),l.memoizedState!==null&&(b=fv(i,l,u4,null,null,u),sd._currentValue=b),vh(i,l),gr(i,l,h,u),l.child;case 6:return i===null&&Lt&&((i=u=yn)&&(u=K4(u,l.pendingProps,Ci),u!==null?(l.stateNode=u,pr=l,yn=null,i=!0):i=!1),i||$a(l)),null;case 13:return Dj(i,l,u);case 4:return Xe(l,l.stateNode.containerInfo),h=l.pendingProps,i===null?l.child=Ys(l,null,h,u):gr(i,l,h,u),l.child;case 11:return bj(i,l,l.type,l.pendingProps,u);case 7:return gr(i,l,l.pendingProps,u),l.child;case 8:return gr(i,l,l.pendingProps.children,u),l.child;case 12:return gr(i,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,Ua(l,l.type,h.value),gr(i,l,h.children,u),l.child;case 9:return b=l.type._context,h=l.pendingProps.children,qs(l),b=mr(b),h=h(b),l.flags|=1,gr(i,l,h,u),l.child;case 14:return Sj(i,l,l.type,l.pendingProps,u);case 15:return wj(i,l,l.type,l.pendingProps,u);case 19:return kj(i,l,u);case 31:return y4(i,l,u);case 22:return jj(i,l,u,l.pendingProps);case 24:return qs(l),h=mr(Kn),i===null?(b=nv(),b===null&&(b=ln,w=ev(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=u),b=w),l.memoizedState={parent:h,cache:b},iv(l),Ua(l,Kn,b)):((i.lanes&u)!==0&&(ov(i,l),Bu(l,null,null,u),Uu()),b=i.memoizedState,w=l.memoizedState,b.parent!==h?(b={parent:h,cache:h},l.memoizedState=b,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=b),Ua(l,Kn,h)):(h=w.cache,Ua(l,Kn,h),h!==b.cache&&Zg(l,[Kn],u,!0))),gr(i,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function aa(i){i.flags|=4}function Uv(i,l,u,h,b){if((l=(i.mode&32)!==0)&&(l=!1),l){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(oC())i.flags|=8192;else throw Ws=nh,rv}else i.flags&=-16777217}function Nj(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!WC(l))if(oC())i.flags|=8192;else throw Ws=nh,rv}function xh(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?Vn():536870912,i.lanes|=l,gc|=l)}function Qu(i,l){if(!Lt)switch(i.tailMode){case"hidden":l=i.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function xn(i){var l=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(l)for(var b=i.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags&65011712,h|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=h,i.childLanes=u,l}function b4(i,l,u){var h=l.pendingProps;switch(Wg(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(l),null;case 1:return xn(l),null;case 3:return u=l.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),na(Kn),Ae(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(rc(l)?aa(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Kg())),xn(l),null;case 26:var b=l.type,w=l.memoizedState;return i===null?(aa(l),w!==null?(xn(l),Nj(l,w)):(xn(l),Uv(l,b,null,h,u))):w?w!==i.memoizedState?(aa(l),xn(l),Nj(l,w)):(xn(l),l.flags&=-16777217):(i=i.memoizedProps,i!==h&&aa(l),xn(l),Uv(l,b,i,h,u)),null;case 27:if(Et(l),u=we.current,b=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&aa(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return xn(l),null}i=de.current,rc(l)?fw(l):(i=UC(b,h,u),l.stateNode=i,aa(l))}return xn(l),null;case 5:if(Et(l),b=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&aa(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return xn(l),null}if(w=de.current,rc(l))fw(l);else{var A=Oh(we.current);switch(w){case 1:w=A.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:w=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":w=A.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":w=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":w=A.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof h.is=="string"?A.createElement("select",{is:h.is}):A.createElement("select"),h.multiple?w.multiple=!0:h.size&&(w.size=h.size);break;default:w=typeof h.is=="string"?A.createElement(b,{is:h.is}):A.createElement(b)}}w[Oe]=l,w[Ve]=h;e:for(A=l.child;A!==null;){if(A.tag===5||A.tag===6)w.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===l)break e;for(;A.sibling===null;){if(A.return===null||A.return===l)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}l.stateNode=w;e:switch(vr(w,b,h),b){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&aa(l)}}return xn(l),Uv(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,u),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==h&&aa(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(i=we.current,rc(l)){if(i=l.stateNode,u=l.memoizedProps,h=null,b=pr,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}i[Oe]=l,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||DC(i.nodeValue,u)),i||$a(l,!0)}else i=Oh(i).createTextNode(h),i[Oe]=l,l.stateNode=i}return xn(l),null;case 31:if(u=l.memoizedState,i===null||i.memoizedState!==null){if(h=rc(l),u!==null){if(i===null){if(!h)throw Error(r(318));if(i=l.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Oe]=l}else Fs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;xn(l),i=!1}else u=Kg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return l.flags&256?(ai(l),l):(ai(l),null);if((l.flags&128)!==0)throw Error(r(558))}return xn(l),null;case 13:if(h=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=rc(l),h!==null&&h.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=l.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Oe]=l}else Fs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;xn(l),b=!1}else b=Kg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(ai(l),l):(ai(l),null)}return ai(l),(l.flags&128)!==0?(l.lanes=u,l):(u=h!==null,i=i!==null&&i.memoizedState!==null,u&&(h=l.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool),w=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==b&&(h.flags|=2048)),u!==i&&u&&(l.child.flags|=8192),xh(l,l.updateQueue),xn(l),null);case 4:return Ae(),i===null&&ly(l.stateNode.containerInfo),xn(l),null;case 10:return na(l.type),xn(l),null;case 19:if(H(Hn),h=l.memoizedState,h===null)return xn(l),null;if(b=(l.flags&128)!==0,w=h.rendering,w===null)if(b)Qu(h,!1);else{if(zn!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(w=ah(i),w!==null){for(l.flags|=128,Qu(h,!1),i=w.updateQueue,l.updateQueue=i,xh(l,i),l.subtreeFlags=0,i=u,u=l.child;u!==null;)sw(u,i),u=u.sibling;return se(Hn,Hn.current&1|2),Lt&&ea(l,h.treeForkCount),l.child}i=i.sibling}h.tail!==null&&pe()>Ch&&(l.flags|=128,b=!0,Qu(h,!1),l.lanes=4194304)}else{if(!b)if(i=ah(w),i!==null){if(l.flags|=128,b=!0,i=i.updateQueue,l.updateQueue=i,xh(l,i),Qu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!Lt)return xn(l),null}else 2*pe()-h.renderingStartTime>Ch&&u!==536870912&&(l.flags|=128,b=!0,Qu(h,!1),l.lanes=4194304);h.isBackwards?(w.sibling=l.child,l.child=w):(i=h.last,i!==null?i.sibling=w:l.child=w,h.last=w)}return h.tail!==null?(i=h.tail,h.rendering=i,h.tail=i.sibling,h.renderingStartTime=pe(),i.sibling=null,u=Hn.current,se(Hn,b?u&1|2:u&1),Lt&&ea(l,h.treeForkCount),i):(xn(l),null);case 22:case 23:return ai(l),cv(),h=l.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(u&536870912)!==0&&(l.flags&128)===0&&(xn(l),l.subtreeFlags&6&&(l.flags|=8192)):xn(l),u=l.updateQueue,u!==null&&xh(l,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==u&&(l.flags|=2048),i!==null&&H(Gs),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),na(Kn),xn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function S4(i,l){switch(Wg(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return na(Kn),Ae(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return Et(l),null;case 31:if(l.memoizedState!==null){if(ai(l),l.alternate===null)throw Error(r(340));Fs()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 13:if(ai(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Fs()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return H(Hn),null;case 4:return Ae(),null;case 10:return na(l.type),null;case 22:case 23:return ai(l),cv(),i!==null&&H(Gs),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return na(Kn),null;case 25:return null;default:return null}}function Oj(i,l){switch(Wg(l),l.tag){case 3:na(Kn),Ae();break;case 26:case 27:case 5:Et(l);break;case 4:Ae();break;case 31:l.memoizedState!==null&&ai(l);break;case 13:ai(l);break;case 19:H(Hn);break;case 10:na(l.type);break;case 22:case 23:ai(l),cv(),i!==null&&H(Gs);break;case 24:na(Kn)}}function Wu(i,l){try{var u=l.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var b=h.next;u=b;do{if((u.tag&i)===i){h=void 0;var w=u.create,A=u.inst;h=w(),A.destroy=h}u=u.next}while(u!==b)}}catch(N){Zt(l,l.return,N)}}function Ga(i,l,u){try{var h=l.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var w=b.next;h=w;do{if((h.tag&i)===i){var A=h.inst,N=A.destroy;if(N!==void 0){A.destroy=void 0,b=l;var q=u,ne=N;try{ne()}catch(fe){Zt(b,q,fe)}}}h=h.next}while(h!==w)}}catch(fe){Zt(l,l.return,fe)}}function Mj(i){var l=i.updateQueue;if(l!==null){var u=i.stateNode;try{Ew(l,u)}catch(h){Zt(i,i.return,h)}}}function Lj(i,l,u){u.props=Xs(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){Zt(i,l,h)}}function Yu(i,l){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(b){Zt(i,l,b)}}function go(i,l){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(b){Zt(i,l,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){Zt(i,l,b)}else u.current=null}function Ij(i){var l=i.type,u=i.memoizedProps,h=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(b){Zt(i,i.return,b)}}function Bv(i,l,u){try{var h=i.stateNode;F4(h,i.type,u,l),h[Ve]=l}catch(b){Zt(i,i.return,b)}}function zj(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Za(i.type)||i.tag===4}function Vv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||zj(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&&Za(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 Fv(i,l,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(i),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=Xo));else if(h!==4&&(h===27&&Za(i.type)&&(u=i.stateNode,l=null),i=i.child,i!==null))for(Fv(i,l,u),i=i.sibling;i!==null;)Fv(i,l,u),i=i.sibling}function bh(i,l,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?u.insertBefore(i,l):u.appendChild(i);else if(h!==4&&(h===27&&Za(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(bh(i,l,u),i=i.sibling;i!==null;)bh(i,l,u),i=i.sibling}function $j(i){var l=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);vr(l,h,u),l[Oe]=i,l[Ve]=u}catch(w){Zt(i,i.return,w)}}var sa=!1,Zn=!1,Hv=!1,Uj=typeof WeakSet=="function"?WeakSet:Set,ar=null;function w4(i,l){if(i=i.containerInfo,dy=Bh,i=J1(i),Ig(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var b=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var A=0,N=-1,q=-1,ne=0,fe=0,ve=i,ae=null;t:for(;;){for(var ce;ve!==u||b!==0&&ve.nodeType!==3||(N=A+b),ve!==w||h!==0&&ve.nodeType!==3||(q=A+h),ve.nodeType===3&&(A+=ve.nodeValue.length),(ce=ve.firstChild)!==null;)ae=ve,ve=ce;for(;;){if(ve===i)break t;if(ae===u&&++ne===b&&(N=A),ae===w&&++fe===h&&(q=A),(ce=ve.nextSibling)!==null)break;ve=ae,ae=ve.parentNode}ve=ce}u=N===-1||q===-1?null:{start:N,end:q}}else u=null}u=u||{start:0,end:0}}else u=null;for(fy={focusedElem:i,selectionRange:u},Bh=!1,ar=l;ar!==null;)if(l=ar,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ar=i;else for(;ar!==null;){switch(l=ar,w=l.alternate,i=l.flags,l.tag){case 0:if((i&4)!==0&&(i=l.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)b=i[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&w!==null){i=void 0,u=l,b=w.memoizedProps,w=w.memoizedState,h=u.stateNode;try{var We=Xs(u.type,b);i=h.getSnapshotBeforeUpdate(We,w),h.__reactInternalSnapshotBeforeUpdate=i}catch(ct){Zt(u,u.return,ct)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,u=i.nodeType,u===9)my(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":my(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,ar=i;break}ar=l.return}}function Bj(i,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:ca(i,u),h&4&&Wu(5,u);break;case 1:if(ca(i,u),h&4)if(i=u.stateNode,l===null)try{i.componentDidMount()}catch(A){Zt(u,u.return,A)}else{var b=Xs(u.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(b,l,i.__reactInternalSnapshotBeforeUpdate)}catch(A){Zt(u,u.return,A)}}h&64&&Mj(u),h&512&&Yu(u,u.return);break;case 3:if(ca(i,u),h&64&&(i=u.updateQueue,i!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{Ew(i,l)}catch(A){Zt(u,u.return,A)}}break;case 27:l===null&&h&4&&$j(u);case 26:case 5:ca(i,u),l===null&&h&4&&Ij(u),h&512&&Yu(u,u.return);break;case 12:ca(i,u);break;case 31:ca(i,u),h&4&&Hj(i,u);break;case 13:ca(i,u),h&4&&qj(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=k4.bind(null,u),X4(i,u))));break;case 22:if(h=u.memoizedState!==null||sa,!h){l=l!==null&&l.memoizedState!==null||Zn,b=sa;var w=Zn;sa=h,(Zn=l)&&!w?ua(i,u,(u.subtreeFlags&8772)!==0):ca(i,u),sa=b,Zn=w}break;case 30:break;default:ca(i,u)}}function Vj(i){var l=i.alternate;l!==null&&(i.alternate=null,Vj(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&_n(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 kn=null,Fr=!1;function la(i,l,u){for(u=u.child;u!==null;)Fj(i,l,u),u=u.sibling}function Fj(i,l,u){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(br,u)}catch{}switch(u.tag){case 26:Zn||go(u,l),la(i,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Zn||go(u,l);var h=kn,b=Fr;Za(u.type)&&(kn=u.stateNode,Fr=!1),la(i,l,u),id(u.stateNode),kn=h,Fr=b;break;case 5:Zn||go(u,l);case 6:if(h=kn,b=Fr,kn=null,la(i,l,u),kn=h,Fr=b,kn!==null)if(Fr)try{(kn.nodeType===9?kn.body:kn.nodeName==="HTML"?kn.ownerDocument.body:kn).removeChild(u.stateNode)}catch(w){Zt(u,l,w)}else try{kn.removeChild(u.stateNode)}catch(w){Zt(u,l,w)}break;case 18:kn!==null&&(Fr?(i=kn,MC(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Cc(i)):MC(kn,u.stateNode));break;case 4:h=kn,b=Fr,kn=u.stateNode.containerInfo,Fr=!0,la(i,l,u),kn=h,Fr=b;break;case 0:case 11:case 14:case 15:Ga(2,u,l),Zn||Ga(4,u,l),la(i,l,u);break;case 1:Zn||(go(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&Lj(u,l,h)),la(i,l,u);break;case 21:la(i,l,u);break;case 22:Zn=(h=Zn)||u.memoizedState!==null,la(i,l,u),Zn=h;break;default:la(i,l,u)}}function Hj(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Cc(i)}catch(u){Zt(l,l.return,u)}}}function qj(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Cc(i)}catch(u){Zt(l,l.return,u)}}function j4(i){switch(i.tag){case 31:case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new Uj),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new Uj),l;default:throw Error(r(435,i.tag))}}function Sh(i,l){var u=j4(i);l.forEach(function(h){if(!u.has(h)){u.add(h);var b=P4.bind(null,i,h);h.then(b,b)}})}function Hr(i,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var b=u[h],w=i,A=l,N=A;e:for(;N!==null;){switch(N.tag){case 27:if(Za(N.type)){kn=N.stateNode,Fr=!1;break e}break;case 5:kn=N.stateNode,Fr=!1;break e;case 3:case 4:kn=N.stateNode.containerInfo,Fr=!0;break e}N=N.return}if(kn===null)throw Error(r(160));Fj(w,A,b),kn=null,Fr=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)Gj(l,i),l=l.sibling}var Yi=null;function Gj(i,l){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Hr(l,i),qr(i),h&4&&(Ga(3,i,i.return),Wu(3,i),Ga(5,i,i.return));break;case 1:Hr(l,i),qr(i),h&512&&(Zn||u===null||go(u,u.return)),h&64&&sa&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var b=Yi;if(Hr(l,i),qr(i),h&512&&(Zn||u===null||go(u,u.return)),h&4){var w=u!==null?u.memoizedState:null;if(h=i.memoizedState,u===null)if(h===null)if(i.stateNode===null){e:{h=i.type,u=i.memoizedProps,b=b.ownerDocument||b;t:switch(h){case"title":w=b.getElementsByTagName("title")[0],(!w||w[sn]||w[Oe]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=b.createElement(h),b.head.insertBefore(w,b.querySelector("head > title"))),vr(w,h,u),w[Oe]=i,An(w),h=w;break e;case"link":var A=GC("link","href",b).get(h+(u.href||""));if(A){for(var N=0;N<A.length;N++)if(w=A[N],w.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&w.getAttribute("rel")===(u.rel==null?null:u.rel)&&w.getAttribute("title")===(u.title==null?null:u.title)&&w.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(N,1);break t}}w=b.createElement(h),vr(w,h,u),b.head.appendChild(w);break;case"meta":if(A=GC("meta","content",b).get(h+(u.content||""))){for(N=0;N<A.length;N++)if(w=A[N],w.getAttribute("content")===(u.content==null?null:""+u.content)&&w.getAttribute("name")===(u.name==null?null:u.name)&&w.getAttribute("property")===(u.property==null?null:u.property)&&w.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&w.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(N,1);break t}}w=b.createElement(h),vr(w,h,u),b.head.appendChild(w);break;default:throw Error(r(468,h))}w[Oe]=i,An(w),h=w}i.stateNode=h}else QC(b,i.type,i.stateNode);else i.stateNode=qC(b,h,i.memoizedProps);else w!==h?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,h===null?QC(b,i.type,i.stateNode):qC(b,h,i.memoizedProps)):h===null&&i.stateNode!==null&&Bv(i,i.memoizedProps,u.memoizedProps)}break;case 27:Hr(l,i),qr(i),h&512&&(Zn||u===null||go(u,u.return)),u!==null&&h&4&&Bv(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Hr(l,i),qr(i),h&512&&(Zn||u===null||go(u,u.return)),i.flags&32){b=i.stateNode;try{Ql(b,"")}catch(We){Zt(i,i.return,We)}}h&4&&i.stateNode!=null&&(b=i.memoizedProps,Bv(i,b,u!==null?u.memoizedProps:b)),h&1024&&(Hv=!0);break;case 6:if(Hr(l,i),qr(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(We){Zt(i,i.return,We)}}break;case 3:if(Ih=null,b=Yi,Yi=Mh(l.containerInfo),Hr(l,i),Yi=b,qr(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Cc(l.containerInfo)}catch(We){Zt(i,i.return,We)}Hv&&(Hv=!1,Qj(i));break;case 4:h=Yi,Yi=Mh(i.stateNode.containerInfo),Hr(l,i),qr(i),Yi=h;break;case 12:Hr(l,i),qr(i);break;case 31:Hr(l,i),qr(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Sh(i,h)));break;case 13:Hr(l,i),qr(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(jh=pe()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Sh(i,h)));break;case 22:b=i.memoizedState!==null;var q=u!==null&&u.memoizedState!==null,ne=sa,fe=Zn;if(sa=ne||b,Zn=fe||q,Hr(l,i),Zn=fe,sa=ne,qr(i),h&8192)e:for(l=i.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(u===null||q||sa||Zn||Js(i)),u=null,l=i;;){if(l.tag===5||l.tag===26){if(u===null){q=u=l;try{if(w=q.stateNode,b)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{N=q.stateNode;var ve=q.memoizedProps.style,ae=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;N.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(We){Zt(q,q.return,We)}}}else if(l.tag===6){if(u===null){q=l;try{q.stateNode.nodeValue=b?"":q.memoizedProps}catch(We){Zt(q,q.return,We)}}}else if(l.tag===18){if(u===null){q=l;try{var ce=q.stateNode;b?LC(ce,!0):LC(q.stateNode,!1)}catch(We){Zt(q,q.return,We)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===i)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break e;for(;l.sibling===null;){if(l.return===null||l.return===i)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=i.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Sh(i,u))));break;case 19:Hr(l,i),qr(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Sh(i,h)));break;case 30:break;case 21:break;default:Hr(l,i),qr(i)}}function qr(i){var l=i.flags;if(l&2){try{for(var u,h=i.return;h!==null;){if(zj(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,w=Vv(i);bh(i,w,b);break;case 5:var A=u.stateNode;u.flags&32&&(Ql(A,""),u.flags&=-33);var N=Vv(i);bh(i,N,A);break;case 3:case 4:var q=u.stateNode.containerInfo,ne=Vv(i);Fv(i,ne,q);break;default:throw Error(r(161))}}catch(fe){Zt(i,i.return,fe)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function Qj(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;Qj(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function ca(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Bj(i,l.alternate,l),l=l.sibling}function Js(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:Ga(4,l,l.return),Js(l);break;case 1:go(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&Lj(l,l.return,u),Js(l);break;case 27:id(l.stateNode);case 26:case 5:go(l,l.return),Js(l);break;case 22:l.memoizedState===null&&Js(l);break;case 30:Js(l);break;default:Js(l)}i=i.sibling}}function ua(i,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,b=i,w=l,A=w.flags;switch(w.tag){case 0:case 11:case 15:ua(b,w,u),Wu(4,w);break;case 1:if(ua(b,w,u),h=w,b=h.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ne){Zt(h,h.return,ne)}if(h=w,b=h.updateQueue,b!==null){var N=h.stateNode;try{var q=b.shared.hiddenCallbacks;if(q!==null)for(b.shared.hiddenCallbacks=null,b=0;b<q.length;b++)Cw(q[b],N)}catch(ne){Zt(h,h.return,ne)}}u&&A&64&&Mj(w),Yu(w,w.return);break;case 27:$j(w);case 26:case 5:ua(b,w,u),u&&h===null&&A&4&&Ij(w),Yu(w,w.return);break;case 12:ua(b,w,u);break;case 31:ua(b,w,u),u&&A&4&&Hj(b,w);break;case 13:ua(b,w,u),u&&A&4&&qj(b,w);break;case 22:w.memoizedState===null&&ua(b,w,u),Yu(w,w.return);break;case 30:break;default:ua(b,w,u)}l=l.sibling}}function qv(i,l){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&Mu(u))}function Gv(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Mu(i))}function Ki(i,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Wj(i,l,u,h),l=l.sibling}function Wj(i,l,u,h){var b=l.flags;switch(l.tag){case 0:case 11:case 15:Ki(i,l,u,h),b&2048&&Wu(9,l);break;case 1:Ki(i,l,u,h);break;case 3:Ki(i,l,u,h),b&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Mu(i)));break;case 12:if(b&2048){Ki(i,l,u,h),i=l.stateNode;try{var w=l.memoizedProps,A=w.id,N=w.onPostCommit;typeof N=="function"&&N(A,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){Zt(l,l.return,q)}}else Ki(i,l,u,h);break;case 31:Ki(i,l,u,h);break;case 13:Ki(i,l,u,h);break;case 23:break;case 22:w=l.stateNode,A=l.alternate,l.memoizedState!==null?w._visibility&2?Ki(i,l,u,h):Ku(i,l):w._visibility&2?Ki(i,l,u,h):(w._visibility|=2,hc(i,l,u,h,(l.subtreeFlags&10256)!==0||!1)),b&2048&&qv(A,l);break;case 24:Ki(i,l,u,h),b&2048&&Gv(l.alternate,l);break;default:Ki(i,l,u,h)}}function hc(i,l,u,h,b){for(b=b&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var w=i,A=l,N=u,q=h,ne=A.flags;switch(A.tag){case 0:case 11:case 15:hc(w,A,N,q,b),Wu(8,A);break;case 23:break;case 22:var fe=A.stateNode;A.memoizedState!==null?fe._visibility&2?hc(w,A,N,q,b):Ku(w,A):(fe._visibility|=2,hc(w,A,N,q,b)),b&&ne&2048&&qv(A.alternate,A);break;case 24:hc(w,A,N,q,b),b&&ne&2048&&Gv(A.alternate,A);break;default:hc(w,A,N,q,b)}l=l.sibling}}function Ku(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=i,h=l,b=h.flags;switch(h.tag){case 22:Ku(u,h),b&2048&&qv(h.alternate,h);break;case 24:Ku(u,h),b&2048&&Gv(h.alternate,h);break;default:Ku(u,h)}l=l.sibling}}var Xu=8192;function pc(i,l,u){if(i.subtreeFlags&Xu)for(i=i.child;i!==null;)Yj(i,l,u),i=i.sibling}function Yj(i,l,u){switch(i.tag){case 26:pc(i,l,u),i.flags&Xu&&i.memoizedState!==null&&c3(u,Yi,i.memoizedState,i.memoizedProps);break;case 5:pc(i,l,u);break;case 3:case 4:var h=Yi;Yi=Mh(i.stateNode.containerInfo),pc(i,l,u),Yi=h;break;case 22:i.memoizedState===null&&(h=i.alternate,h!==null&&h.memoizedState!==null?(h=Xu,Xu=16777216,pc(i,l,u),Xu=h):pc(i,l,u));break;default:pc(i,l,u)}}function Kj(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 Ju(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];ar=h,Jj(h,i)}Kj(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Xj(i),i=i.sibling}function Xj(i){switch(i.tag){case 0:case 11:case 15:Ju(i),i.flags&2048&&Ga(9,i,i.return);break;case 3:Ju(i);break;case 12:Ju(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,wh(i)):Ju(i);break;default:Ju(i)}}function wh(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];ar=h,Jj(h,i)}Kj(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:Ga(8,l,l.return),wh(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,wh(l));break;default:wh(l)}i=i.sibling}}function Jj(i,l){for(;ar!==null;){var u=ar;switch(u.tag){case 0:case 11:case 15:Ga(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Mu(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,ar=h;else e:for(u=i;ar!==null;){h=ar;var b=h.sibling,w=h.return;if(Vj(h),h===u){ar=null;break e}if(b!==null){b.return=w,ar=b;break e}ar=w}}}var C4={getCacheForType:function(i){var l=mr(Kn),u=l.data.get(i);return u===void 0&&(u=i(),l.data.set(i,u)),u},cacheSignal:function(){return mr(Kn).controller.signal}},E4=typeof WeakMap=="function"?WeakMap:Map,qt=0,ln=null,_t=null,kt=0,Jt=0,si=null,Qa=!1,mc=!1,Qv=!1,da=0,zn=0,Wa=0,Zs=0,Wv=0,li=0,gc=0,Zu=null,Gr=null,Yv=!1,jh=0,Zj=0,Ch=1/0,Eh=null,Ya=null,tr=0,Ka=null,vc=null,fa=0,Kv=0,Xv=null,eC=null,ed=0,Jv=null;function ci(){return(qt&2)!==0&&kt!==0?kt&-kt:M.T!==null?iy():De()}function tC(){if(li===0)if((kt&536870912)===0||Lt){var i=Wo;Wo<<=1,(Wo&3932160)===0&&(Wo=262144),li=i}else li=536870912;return i=oi.current,i!==null&&(i.flags|=32),li}function Qr(i,l,u){(i===ln&&(Jt===2||Jt===9)||i.cancelPendingCommit!==null)&&(yc(i,0),Xa(i,kt,li,!1)),Yo(i,u),((qt&2)===0||i!==ln)&&(i===ln&&((qt&2)===0&&(Zs|=u),zn===4&&Xa(i,kt,li,!1)),vo(i))}function nC(i,l,u){if((qt&6)!==0)throw Error(r(327));var h=!u&&(l&127)===0&&(l&i.expiredLanes)===0||fr(i,l),b=h?_4(i,l):ey(i,l,!0),w=h;do{if(b===0){mc&&!h&&Xa(i,l,0,!1);break}else{if(u=i.current.alternate,w&&!T4(u)){b=ey(i,l,!1),w=!1;continue}if(b===2){if(w=l,i.errorRecoveryDisabledLanes&w)var A=0;else A=i.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){l=A;e:{var N=i;b=Zu;var q=N.current.memoizedState.isDehydrated;if(q&&(yc(N,A).flags|=256),A=ey(N,A,!1),A!==2){if(Qv&&!q){N.errorRecoveryDisabledLanes|=w,Zs|=w,b=4;break e}w=Gr,Gr=b,w!==null&&(Gr===null?Gr=w:Gr.push.apply(Gr,w))}b=A}if(w=!1,b!==2)continue}}if(b===1){yc(i,0),Xa(i,l,0,!0);break}e:{switch(h=i,w=b,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Xa(h,l,li,!Qa);break e;case 2:Gr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=jh+300-pe(),10<b)){if(Xa(h,l,li,!Qa),Hi(h,0,!0)!==0)break e;fa=l,h.timeoutHandle=NC(rC.bind(null,h,u,Gr,Eh,Yv,l,li,Zs,gc,Qa,w,"Throttled",-0,0),b);break e}rC(h,u,Gr,Eh,Yv,l,li,Zs,gc,Qa,w,null,-0,0)}}break}while(!0);vo(i)}function rC(i,l,u,h,b,w,A,N,q,ne,fe,ve,ae,ce){if(i.timeoutHandle=-1,ve=l.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xo},Yj(l,w,ve);var We=(w&62914560)===w?jh-pe():(w&4194048)===w?Zj-pe():0;if(We=u3(ve,We),We!==null){fa=w,i.cancelPendingCommit=We(dC.bind(null,i,l,w,u,h,b,A,N,q,fe,ve,null,ae,ce)),Xa(i,w,A,!ne);return}}dC(i,l,w,u,h,b,A,N,q)}function T4(i){for(var l=i;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var b=u[h],w=b.getSnapshot;b=b.value;try{if(!ri(w(),b))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Xa(i,l,u,h){l&=~Wv,l&=~Zs,i.suspendedLanes|=l,i.pingedLanes&=~l,h&&(i.warmLanes|=l),h=i.expirationTimes;for(var b=l;0<b;){var w=31-Rn(b),A=1<<w;h[w]=-1,b&=~A}u!==0&&ql(i,u,l)}function Th(){return(qt&6)===0?(td(0),!1):!0}function Zv(){if(_t!==null){if(Jt===0)var i=_t.return;else i=_t,ta=Hs=null,mv(i),lc=null,Iu=0,i=_t;for(;i!==null;)Oj(i.alternate,i),i=i.return;_t=null}}function yc(i,l){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,G4(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),fa=0,Zv(),ln=i,_t=u=Zo(i.current,null),kt=l,Jt=0,si=null,Qa=!1,mc=fr(i,l),Qv=!1,gc=li=Wv=Zs=Wa=zn=0,Gr=Zu=null,Yv=!1,(l&8)!==0&&(l|=l&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=l;0<h;){var b=31-Rn(h),w=1<<b;l|=i[b],h&=~w}return da=l,Qf(),u}function iC(i,l){xt=null,M.H=qu,l===sc||l===th?(l=bw(),Jt=3):l===rv?(l=bw(),Jt=4):Jt=l===kv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,si=l,_t===null&&(zn=1,mh(i,Si(l,i.current)))}function oC(){var i=oi.current;return i===null?!0:(kt&4194048)===kt?Ei===null:(kt&62914560)===kt||(kt&536870912)!==0?i===Ei:!1}function aC(){var i=M.H;return M.H=qu,i===null?qu:i}function sC(){var i=M.A;return M.A=C4,i}function Rh(){zn=4,Qa||(kt&4194048)!==kt&&oi.current!==null||(mc=!0),(Wa&134217727)===0&&(Zs&134217727)===0||ln===null||Xa(ln,kt,li,!1)}function ey(i,l,u){var h=qt;qt|=2;var b=aC(),w=sC();(ln!==i||kt!==l)&&(Eh=null,yc(i,l)),l=!1;var A=zn;e:do try{if(Jt!==0&&_t!==null){var N=_t,q=si;switch(Jt){case 8:Zv(),A=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(l=!0);var ne=Jt;if(Jt=0,si=null,xc(i,N,q,ne),u&&mc){A=0;break e}break;default:ne=Jt,Jt=0,si=null,xc(i,N,q,ne)}}R4(),A=zn;break}catch(fe){iC(i,fe)}while(!0);return l&&i.shellSuspendCounter++,ta=Hs=null,qt=h,M.H=b,M.A=w,_t===null&&(ln=null,kt=0,Qf()),A}function R4(){for(;_t!==null;)lC(_t)}function _4(i,l){var u=qt;qt|=2;var h=aC(),b=sC();ln!==i||kt!==l?(Eh=null,Ch=pe()+500,yc(i,l)):mc=fr(i,l);e:do try{if(Jt!==0&&_t!==null){l=_t;var w=si;t:switch(Jt){case 1:Jt=0,si=null,xc(i,l,w,1);break;case 2:case 9:if(yw(w)){Jt=0,si=null,cC(l);break}l=function(){Jt!==2&&Jt!==9||ln!==i||(Jt=7),vo(i)},w.then(l,l);break e;case 3:Jt=7;break e;case 4:Jt=5;break e;case 7:yw(w)?(Jt=0,si=null,cC(l)):(Jt=0,si=null,xc(i,l,w,7));break;case 5:var A=null;switch(_t.tag){case 26:A=_t.memoizedState;case 5:case 27:var N=_t;if(A?WC(A):N.stateNode.complete){Jt=0,si=null;var q=N.sibling;if(q!==null)_t=q;else{var ne=N.return;ne!==null?(_t=ne,_h(ne)):_t=null}break t}}Jt=0,si=null,xc(i,l,w,5);break;case 6:Jt=0,si=null,xc(i,l,w,6);break;case 8:Zv(),zn=6;break e;default:throw Error(r(462))}}D4();break}catch(fe){iC(i,fe)}while(!0);return ta=Hs=null,M.H=h,M.A=b,qt=u,_t!==null?0:(ln=null,kt=0,Qf(),zn)}function D4(){for(;_t!==null&&!tt();)lC(_t)}function lC(i){var l=Pj(i.alternate,i,da);i.memoizedProps=i.pendingProps,l===null?_h(i):_t=l}function cC(i){var l=i,u=l.alternate;switch(l.tag){case 15:case 0:l=Tj(u,l,l.pendingProps,l.type,void 0,kt);break;case 11:l=Tj(u,l,l.pendingProps,l.type.render,l.ref,kt);break;case 5:mv(l);default:Oj(u,l),l=_t=sw(l,da),l=Pj(u,l,da)}i.memoizedProps=i.pendingProps,l===null?_h(i):_t=l}function xc(i,l,u,h){ta=Hs=null,mv(l),lc=null,Iu=0;var b=l.return;try{if(v4(i,b,l,u,kt)){zn=1,mh(i,Si(u,i.current)),_t=null;return}}catch(w){if(b!==null)throw _t=b,w;zn=1,mh(i,Si(u,i.current)),_t=null;return}l.flags&32768?(Lt||h===1?i=!0:mc||(kt&536870912)!==0?i=!1:(Qa=i=!0,(h===2||h===9||h===3||h===6)&&(h=oi.current,h!==null&&h.tag===13&&(h.flags|=16384))),uC(l,i)):_h(l)}function _h(i){var l=i;do{if((l.flags&32768)!==0){uC(l,Qa);return}i=l.return;var u=b4(l.alternate,l,da);if(u!==null){_t=u;return}if(l=l.sibling,l!==null){_t=l;return}_t=l=i}while(l!==null);zn===0&&(zn=5)}function uC(i,l){do{var u=S4(i.alternate,i);if(u!==null){u.flags&=32767,_t=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(i=i.sibling,i!==null)){_t=i;return}_t=i=u}while(i!==null);zn=6,_t=null}function dC(i,l,u,h,b,w,A,N,q){i.cancelPendingCommit=null;do Dh();while(tr!==0);if((qt&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=Vg,wu(i,u,w,A,N,q),i===ln&&(_t=ln=null,kt=0),vc=l,Ka=i,fa=u,Kv=w,Xv=b,eC=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,N4(At,function(){return gC(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=M.T,M.T=null,b=L.p,L.p=2,A=qt,qt|=4;try{w4(i,l,u)}finally{qt=A,L.p=b,M.T=h}}tr=1,fC(),hC(),pC()}}function fC(){if(tr===1){tr=0;var i=Ka,l=vc,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=M.T,M.T=null;var h=L.p;L.p=2;var b=qt;qt|=4;try{Gj(l,i);var w=fy,A=J1(i.containerInfo),N=w.focusedElem,q=w.selectionRange;if(A!==N&&N&&N.ownerDocument&&X1(N.ownerDocument.documentElement,N)){if(q!==null&&Ig(N)){var ne=q.start,fe=q.end;if(fe===void 0&&(fe=ne),"selectionStart"in N)N.selectionStart=ne,N.selectionEnd=Math.min(fe,N.value.length);else{var ve=N.ownerDocument||document,ae=ve&&ve.defaultView||window;if(ae.getSelection){var ce=ae.getSelection(),We=N.textContent.length,ct=Math.min(q.start,We),on=q.end===void 0?ct:Math.min(q.end,We);!ce.extend&&ct>on&&(A=on,on=ct,ct=A);var J=K1(N,ct),W=K1(N,on);if(J&&W&&(ce.rangeCount!==1||ce.anchorNode!==J.node||ce.anchorOffset!==J.offset||ce.focusNode!==W.node||ce.focusOffset!==W.offset)){var te=ve.createRange();te.setStart(J.node,J.offset),ce.removeAllRanges(),ct>on?(ce.addRange(te),ce.extend(W.node,W.offset)):(te.setEnd(W.node,W.offset),ce.addRange(te))}}}}for(ve=[],ce=N;ce=ce.parentNode;)ce.nodeType===1&&ve.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ve.length;N++){var me=ve[N];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Bh=!!dy,fy=dy=null}finally{qt=b,L.p=h,M.T=u}}i.current=l,tr=2}}function hC(){if(tr===2){tr=0;var i=Ka,l=vc,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=M.T,M.T=null;var h=L.p;L.p=2;var b=qt;qt|=4;try{Bj(i,l.alternate,l)}finally{qt=b,L.p=h,M.T=u}}tr=3}}function pC(){if(tr===4||tr===3){tr=0,ft();var i=Ka,l=vc,u=fa,h=eC;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?tr=5:(tr=0,vc=Ka=null,mC(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(Ya=null),je(u),l=l.stateNode,Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(br,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=M.T,b=L.p,L.p=2,M.T=null;try{for(var w=i.onRecoverableError,A=0;A<h.length;A++){var N=h[A];w(N.value,{componentStack:N.stack})}}finally{M.T=l,L.p=b}}(fa&3)!==0&&Dh(),vo(i),b=i.pendingLanes,(u&261930)!==0&&(b&42)!==0?i===Jv?ed++:(ed=0,Jv=i):ed=0,td(0)}}function mC(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Mu(l)))}function Dh(){return fC(),hC(),pC(),gC()}function gC(){if(tr!==5)return!1;var i=Ka,l=Kv;Kv=0;var u=je(fa),h=M.T,b=L.p;try{L.p=32>u?32:u,M.T=null,u=Xv,Xv=null;var w=Ka,A=fa;if(tr=0,vc=Ka=null,fa=0,(qt&6)!==0)throw Error(r(331));var N=qt;if(qt|=4,Xj(w.current),Wj(w,w.current,A,u),qt=N,td(0,!1),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(br,w)}catch{}return!0}finally{L.p=b,M.T=h,mC(i,l)}}function vC(i,l,u){l=Si(u,l),l=Av(i.stateNode,l,2),i=Fa(i,l,2),i!==null&&(Yo(i,2),vo(i))}function Zt(i,l,u){if(i.tag===3)vC(i,i,u);else for(;l!==null;){if(l.tag===3){vC(l,i,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ya===null||!Ya.has(h))){i=Si(u,i),u=yj(2),h=Fa(l,u,2),h!==null&&(xj(u,h,l,i),Yo(h,2),vo(h));break}}l=l.return}}function ty(i,l,u){var h=i.pingCache;if(h===null){h=i.pingCache=new E4;var b=new Set;h.set(l,b)}else b=h.get(l),b===void 0&&(b=new Set,h.set(l,b));b.has(u)||(Qv=!0,b.add(u),i=A4.bind(null,i,l,u),l.then(i,i))}function A4(i,l,u){var h=i.pingCache;h!==null&&h.delete(l),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,ln===i&&(kt&u)===u&&(zn===4||zn===3&&(kt&62914560)===kt&&300>pe()-jh?(qt&2)===0&&yc(i,0):Wv|=u,gc===kt&&(gc=0)),vo(i)}function yC(i,l){l===0&&(l=Vn()),i=Bs(i,l),i!==null&&(Yo(i,l),vo(i))}function k4(i){var l=i.memoizedState,u=0;l!==null&&(u=l.retryLane),yC(i,u)}function P4(i,l){var u=0;switch(i.tag){case 31:case 13:var h=i.stateNode,b=i.memoizedState;b!==null&&(u=b.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),yC(i,u)}function N4(i,l){return Le(i,l)}var Ah=null,bc=null,ny=!1,kh=!1,ry=!1,Ja=0;function vo(i){i!==bc&&i.next===null&&(bc===null?Ah=bc=i:bc=bc.next=i),kh=!0,ny||(ny=!0,M4())}function td(i,l){if(!ry&&kh){ry=!0;do for(var u=!1,h=Ah;h!==null;){if(i!==0){var b=h.pendingLanes;if(b===0)var w=0;else{var A=h.suspendedLanes,N=h.pingedLanes;w=(1<<31-Rn(42|i)+1)-1,w&=b&~(A&~N),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,wC(h,w))}else w=kt,w=Hi(h,h===ln?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||fr(h,w)||(u=!0,wC(h,w));h=h.next}while(u);ry=!1}}function O4(){xC()}function xC(){kh=ny=!1;var i=0;Ja!==0&&q4()&&(i=Ja);for(var l=pe(),u=null,h=Ah;h!==null;){var b=h.next,w=bC(h,l);w===0?(h.next=null,u===null?Ah=b:u.next=b,b===null&&(bc=u)):(u=h,(i!==0||(w&3)!==0)&&(kh=!0)),h=b}tr!==0&&tr!==5||td(i),Ja!==0&&(Ja=0)}function bC(i,l){for(var u=i.suspendedLanes,h=i.pingedLanes,b=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var A=31-Rn(w),N=1<<A,q=b[A];q===-1?((N&u)===0||(N&h)!==0)&&(b[A]=Os(N,l)):q<=l&&(i.expiredLanes|=N),w&=~N}if(l=ln,u=kt,u=Hi(i,i===l?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===l&&(Jt===2||Jt===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&<(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||fr(i,u)){if(l=u&-u,l===i.callbackPriority)return l;switch(h!==null&<(h),je(u)){case 2:case 8:u=Pe;break;case 32:u=At;break;case 268435456:u=gn;break;default:u=At}return h=SC.bind(null,i),u=Le(u,h),i.callbackPriority=l,i.callbackNode=u,l}return h!==null&&h!==null&<(h),i.callbackPriority=2,i.callbackNode=null,2}function SC(i,l){if(tr!==0&&tr!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Dh()&&i.callbackNode!==u)return null;var h=kt;return h=Hi(i,i===ln?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(nC(i,h,l),bC(i,pe()),i.callbackNode!=null&&i.callbackNode===u?SC.bind(null,i):null)}function wC(i,l){if(Dh())return null;nC(i,l,!0)}function M4(){Q4(function(){(qt&6)!==0?Le(Ce,O4):xC()})}function iy(){if(Ja===0){var i=oc;i===0&&(i=Ur,Ur<<=1,(Ur&261888)===0&&(Ur=256)),Ja=i}return Ja}function jC(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:$f(""+i)}function CC(i,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,i.id&&u.setAttribute("form",i.id),l.parentNode.insertBefore(u,l),i=new FormData(i),u.parentNode.removeChild(u),i}function L4(i,l,u,h,b){if(l==="submit"&&u&&u.stateNode===b){var w=jC((b[Ve]||null).action),A=h.submitter;A&&(l=(l=A[Ve]||null)?jC(l.formAction):A.getAttribute("formAction"),l!==null&&(w=l,A=null));var N=new Ff("action","action",null,h,b);i.push({event:N,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Ja!==0){var q=A?CC(b,A):new FormData(b);Cv(u,{pending:!0,data:q,method:b.method,action:w},null,q)}}else typeof w=="function"&&(N.preventDefault(),q=A?CC(b,A):new FormData(b),Cv(u,{pending:!0,data:q,method:b.method,action:w},w,q))},currentTarget:b}]})}}for(var oy=0;oy<Bg.length;oy++){var ay=Bg[oy],I4=ay.toLowerCase(),z4=ay[0].toUpperCase()+ay.slice(1);Wi(I4,"on"+z4)}Wi(tw,"onAnimationEnd"),Wi(nw,"onAnimationIteration"),Wi(rw,"onAnimationStart"),Wi("dblclick","onDoubleClick"),Wi("focusin","onFocus"),Wi("focusout","onBlur"),Wi(e4,"onTransitionRun"),Wi(t4,"onTransitionStart"),Wi(n4,"onTransitionCancel"),Wi(iw,"onTransitionEnd"),yi("onMouseEnter",["mouseout","mouseover"]),yi("onMouseLeave",["mouseout","mouseover"]),yi("onPointerEnter",["pointerout","pointerover"]),yi("onPointerLeave",["pointerout","pointerover"]),Gi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nd="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(" "),$4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nd));function EC(i,l){l=(l&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],b=h.event;h=h.listeners;e:{var w=void 0;if(l)for(var A=h.length-1;0<=A;A--){var N=h[A],q=N.instance,ne=N.currentTarget;if(N=N.listener,q!==w&&b.isPropagationStopped())break e;w=N,b.currentTarget=ne;try{w(b)}catch(fe){Gf(fe)}b.currentTarget=null,w=q}else for(A=0;A<h.length;A++){if(N=h[A],q=N.instance,ne=N.currentTarget,N=N.listener,q!==w&&b.isPropagationStopped())break e;w=N,b.currentTarget=ne;try{w(b)}catch(fe){Gf(fe)}b.currentTarget=null,w=q}}}}function Dt(i,l){var u=l[st];u===void 0&&(u=l[st]=new Set);var h=i+"__bubble";u.has(h)||(TC(l,i,2,!1),u.add(h))}function sy(i,l,u){var h=0;l&&(h|=4),TC(u,i,h,l)}var Ph="_reactListening"+Math.random().toString(36).slice(2);function ly(i){if(!i[Ph]){i[Ph]=!0,qi.forEach(function(u){u!=="selectionchange"&&($4.has(u)||sy(u,!1,i),sy(u,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Ph]||(l[Ph]=!0,sy("selectionchange",!1,l))}}function TC(i,l,u,h){switch(tE(l)){case 2:var b=h3;break;case 8:b=p3;break;default:b=jy}u=b.bind(null,l,u,i),b=void 0,!_g||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),h?b!==void 0?i.addEventListener(l,u,{capture:!0,passive:b}):i.addEventListener(l,u,!0):b!==void 0?i.addEventListener(l,u,{passive:b}):i.addEventListener(l,u,!1)}function cy(i,l,u,h,b){var w=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var A=h.tag;if(A===3||A===4){var N=h.stateNode.containerInfo;if(N===b)break;if(A===4)for(A=h.return;A!==null;){var q=A.tag;if((q===3||q===4)&&A.stateNode.containerInfo===b)return;A=A.return}for(;N!==null;){if(A=Dn(N),A===null)return;if(q=A.tag,q===5||q===6||q===26||q===27){h=w=A;continue e}N=N.parentNode}}h=h.return}k1(function(){var ne=w,fe=Tg(u),ve=[];e:{var ae=ow.get(i);if(ae!==void 0){var ce=Ff,We=i;switch(i){case"keypress":if(Bf(u)===0)break e;case"keydown":case"keyup":ce=PO;break;case"focusin":We="focus",ce=Pg;break;case"focusout":We="blur",ce=Pg;break;case"beforeblur":case"afterblur":ce=Pg;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=O1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=bO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=MO;break;case tw:case nw:case rw:ce=jO;break;case iw:ce=IO;break;case"scroll":case"scrollend":ce=yO;break;case"wheel":ce=$O;break;case"copy":case"cut":case"paste":ce=EO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=L1;break;case"toggle":case"beforetoggle":ce=BO}var ct=(l&4)!==0,on=!ct&&(i==="scroll"||i==="scrollend"),J=ct?ae!==null?ae+"Capture":null:ae;ct=[];for(var W=ne,te;W!==null;){var me=W;if(te=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||te===null||J===null||(me=Cu(W,J),me!=null&&ct.push(rd(W,me,te))),on)break;W=W.return}0<ct.length&&(ae=new ce(ae,We,null,u,fe),ve.push({event:ae,listeners:ct}))}}if((l&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ce=i==="mouseout"||i==="pointerout",ae&&u!==Eg&&(We=u.relatedTarget||u.fromElement)&&(Dn(We)||We[Je]))break e;if((ce||ae)&&(ae=fe.window===fe?fe:(ae=fe.ownerDocument)?ae.defaultView||ae.parentWindow:window,ce?(We=u.relatedTarget||u.toElement,ce=ne,We=We?Dn(We):null,We!==null&&(on=s(We),ct=We.tag,We!==on||ct!==5&&ct!==27&&ct!==6)&&(We=null)):(ce=null,We=ne),ce!==We)){if(ct=O1,me="onMouseLeave",J="onMouseEnter",W="mouse",(i==="pointerout"||i==="pointerover")&&(ct=L1,me="onPointerLeave",J="onPointerEnter",W="pointer"),on=ce==null?ae:or(ce),te=We==null?ae:or(We),ae=new ct(me,W+"leave",ce,u,fe),ae.target=on,ae.relatedTarget=te,me=null,Dn(fe)===ne&&(ct=new ct(J,W+"enter",We,u,fe),ct.target=te,ct.relatedTarget=on,me=ct),on=me,ce&&We)t:{for(ct=U4,J=ce,W=We,te=0,me=J;me;me=ct(me))te++;me=0;for(var ot=W;ot;ot=ct(ot))me++;for(;0<te-me;)J=ct(J),te--;for(;0<me-te;)W=ct(W),me--;for(;te--;){if(J===W||W!==null&&J===W.alternate){ct=J;break t}J=ct(J),W=ct(W)}ct=null}else ct=null;ce!==null&&RC(ve,ae,ce,ct,!1),We!==null&&on!==null&&RC(ve,on,We,ct,!0)}}e:{if(ae=ne?or(ne):window,ce=ae.nodeName&&ae.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ae.type==="file")var Vt=H1;else if(V1(ae))if(q1)Vt=XO;else{Vt=YO;var Ze=WO}else ce=ae.nodeName,!ce||ce.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&Cg(ne.elementType)&&(Vt=H1):Vt=KO;if(Vt&&(Vt=Vt(i,ne))){F1(ve,Vt,u,fe);break e}Ze&&Ze(i,ae,ne),i==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&jg(ae,"number",ae.value)}switch(Ze=ne?or(ne):window,i){case"focusin":(V1(Ze)||Ze.contentEditable==="true")&&(Xl=Ze,zg=ne,Pu=null);break;case"focusout":Pu=zg=Xl=null;break;case"mousedown":$g=!0;break;case"contextmenu":case"mouseup":case"dragend":$g=!1,Z1(ve,u,fe);break;case"selectionchange":if(ZO)break;case"keydown":case"keyup":Z1(ve,u,fe)}var wt;if(Og)e:{switch(i){case"compositionstart":var Pt="onCompositionStart";break e;case"compositionend":Pt="onCompositionEnd";break e;case"compositionupdate":Pt="onCompositionUpdate";break e}Pt=void 0}else Kl?U1(i,u)&&(Pt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Pt="onCompositionStart");Pt&&(I1&&u.locale!=="ko"&&(Kl||Pt!=="onCompositionStart"?Pt==="onCompositionEnd"&&Kl&&(wt=P1()):(La=fe,Dg="value"in La?La.value:La.textContent,Kl=!0)),Ze=Nh(ne,Pt),0<Ze.length&&(Pt=new M1(Pt,i,null,u,fe),ve.push({event:Pt,listeners:Ze}),wt?Pt.data=wt:(wt=B1(u),wt!==null&&(Pt.data=wt)))),(wt=FO?HO(i,u):qO(i,u))&&(Pt=Nh(ne,"onBeforeInput"),0<Pt.length&&(Ze=new M1("onBeforeInput","beforeinput",null,u,fe),ve.push({event:Ze,listeners:Pt}),Ze.data=wt)),L4(ve,i,ne,u,fe)}EC(ve,l)})}function rd(i,l,u){return{instance:i,listener:l,currentTarget:u}}function Nh(i,l){for(var u=l+"Capture",h=[];i!==null;){var b=i,w=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||w===null||(b=Cu(i,u),b!=null&&h.unshift(rd(i,b,w)),b=Cu(i,l),b!=null&&h.push(rd(i,b,w))),i.tag===3)return h;i=i.return}return[]}function U4(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function RC(i,l,u,h,b){for(var w=l._reactName,A=[];u!==null&&u!==h;){var N=u,q=N.alternate,ne=N.stateNode;if(N=N.tag,q!==null&&q===h)break;N!==5&&N!==26&&N!==27||ne===null||(q=ne,b?(ne=Cu(u,w),ne!=null&&A.unshift(rd(u,ne,q))):b||(ne=Cu(u,w),ne!=null&&A.push(rd(u,ne,q)))),u=u.return}A.length!==0&&i.push({event:l,listeners:A})}var B4=/\r\n?/g,V4=/\u0000|\uFFFD/g;function _C(i){return(typeof i=="string"?i:""+i).replace(B4,`
|
|
214
|
-
`).replace(V4,"")}function DC(i,l){return l=_C(l),_C(i)===l}function rn(i,l,u,h,b,w){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||Ql(i,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&Ql(i,""+h);break;case"className":Qi(i,"class",h);break;case"tabIndex":Qi(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Qi(i,u,h);break;case"style":D1(i,h,w);break;case"data":if(l!=="object"){Qi(i,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||u!=="href")){i.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=$f(""+h),i.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(u==="formAction"?(l!=="input"&&rn(i,l,"name",b.name,b,null),rn(i,l,"formEncType",b.formEncType,b,null),rn(i,l,"formMethod",b.formMethod,b,null),rn(i,l,"formTarget",b.formTarget,b,null)):(rn(i,l,"encType",b.encType,b,null),rn(i,l,"method",b.method,b,null),rn(i,l,"target",b.target,b,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=$f(""+h),i.setAttribute(u,h);break;case"onClick":h!=null&&(i.onclick=Xo);break;case"onScroll":h!=null&&Dt("scroll",i);break;case"onScrollEnd":h!=null&&Dt("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}u=$f(""+h),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""+h):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":h===!0?i.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,h):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(u,h):i.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(u):i.setAttribute(u,h);break;case"popover":Dt("beforetoggle",i),Dt("toggle",i),Fn(i,"popover",h);break;case"xlinkActuate":hr(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":hr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":hr(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":hr(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":hr(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":hr(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":hr(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":hr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":hr(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Fn(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=gO.get(u)||u,Fn(i,u,h))}}function uy(i,l,u,h,b,w){switch(u){case"style":D1(i,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof h=="string"?Ql(i,h):(typeof h=="number"||typeof h=="bigint")&&Ql(i,""+h);break;case"onScroll":h!=null&&Dt("scroll",i);break;case"onScrollEnd":h!=null&&Dt("scrollend",i);break;case"onClick":h!=null&&(i.onclick=Xo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ni.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),l=u.slice(2,b?u.length-7:void 0),w=i[Ve]||null,w=w!=null?w[u]:null,typeof w=="function"&&i.removeEventListener(l,w,b),typeof h=="function")){typeof w!="function"&&w!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(l,h,b);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):Fn(i,u,h)}}}function vr(i,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Dt("error",i),Dt("load",i);var h=!1,b=!1,w;for(w in u)if(u.hasOwnProperty(w)){var A=u[w];if(A!=null)switch(w){case"src":h=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:rn(i,l,w,A,u,null)}}b&&rn(i,l,"srcSet",u.srcSet,u,null),h&&rn(i,l,"src",u.src,u,null);return;case"input":Dt("invalid",i);var N=w=A=b=null,q=null,ne=null;for(h in u)if(u.hasOwnProperty(h)){var fe=u[h];if(fe!=null)switch(h){case"name":b=fe;break;case"type":A=fe;break;case"checked":q=fe;break;case"defaultChecked":ne=fe;break;case"value":w=fe;break;case"defaultValue":N=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,l));break;default:rn(i,l,h,fe,u,null)}}E1(i,w,N,q,ne,A,b,!1);return;case"select":Dt("invalid",i),h=A=w=null;for(b in u)if(u.hasOwnProperty(b)&&(N=u[b],N!=null))switch(b){case"value":w=N;break;case"defaultValue":A=N;break;case"multiple":h=N;default:rn(i,l,b,N,u,null)}l=w,u=A,i.multiple=!!h,l!=null?Gl(i,!!h,l,!1):u!=null&&Gl(i,!!h,u,!0);return;case"textarea":Dt("invalid",i),w=b=h=null;for(A in u)if(u.hasOwnProperty(A)&&(N=u[A],N!=null))switch(A){case"value":h=N;break;case"defaultValue":b=N;break;case"children":w=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:rn(i,l,A,N,u,null)}R1(i,h,b,w);return;case"option":for(q in u)u.hasOwnProperty(q)&&(h=u[q],h!=null)&&(q==="selected"?i.selected=h&&typeof h!="function"&&typeof h!="symbol":rn(i,l,q,h,u,null));return;case"dialog":Dt("beforetoggle",i),Dt("toggle",i),Dt("cancel",i),Dt("close",i);break;case"iframe":case"object":Dt("load",i);break;case"video":case"audio":for(h=0;h<nd.length;h++)Dt(nd[h],i);break;case"image":Dt("error",i),Dt("load",i);break;case"details":Dt("toggle",i);break;case"embed":case"source":case"link":Dt("error",i),Dt("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 u)if(u.hasOwnProperty(ne)&&(h=u[ne],h!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:rn(i,l,ne,h,u,null)}return;default:if(Cg(l)){for(fe in u)u.hasOwnProperty(fe)&&(h=u[fe],h!==void 0&&uy(i,l,fe,h,u,void 0));return}}for(N in u)u.hasOwnProperty(N)&&(h=u[N],h!=null&&rn(i,l,N,h,u,null))}function F4(i,l,u,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,w=null,A=null,N=null,q=null,ne=null,fe=null;for(ce in u){var ve=u[ce];if(u.hasOwnProperty(ce)&&ve!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":q=ve;default:h.hasOwnProperty(ce)||rn(i,l,ce,null,h,ve)}}for(var ae in h){var ce=h[ae];if(ve=u[ae],h.hasOwnProperty(ae)&&(ce!=null||ve!=null))switch(ae){case"type":w=ce;break;case"name":b=ce;break;case"checked":ne=ce;break;case"defaultChecked":fe=ce;break;case"value":A=ce;break;case"defaultValue":N=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:ce!==ve&&rn(i,l,ae,ce,h,ve)}}wg(i,A,N,q,ne,fe,w,b);return;case"select":ce=A=N=ae=null;for(w in u)if(q=u[w],u.hasOwnProperty(w)&&q!=null)switch(w){case"value":break;case"multiple":ce=q;default:h.hasOwnProperty(w)||rn(i,l,w,null,h,q)}for(b in h)if(w=h[b],q=u[b],h.hasOwnProperty(b)&&(w!=null||q!=null))switch(b){case"value":ae=w;break;case"defaultValue":N=w;break;case"multiple":A=w;default:w!==q&&rn(i,l,b,w,h,q)}l=N,u=A,h=ce,ae!=null?Gl(i,!!u,ae,!1):!!h!=!!u&&(l!=null?Gl(i,!!u,l,!0):Gl(i,!!u,u?[]:"",!1));return;case"textarea":ce=ae=null;for(N in u)if(b=u[N],u.hasOwnProperty(N)&&b!=null&&!h.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:rn(i,l,N,null,h,b)}for(A in h)if(b=h[A],w=u[A],h.hasOwnProperty(A)&&(b!=null||w!=null))switch(A){case"value":ae=b;break;case"defaultValue":ce=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==w&&rn(i,l,A,b,h,w)}T1(i,ae,ce);return;case"option":for(var We in u)ae=u[We],u.hasOwnProperty(We)&&ae!=null&&!h.hasOwnProperty(We)&&(We==="selected"?i.selected=!1:rn(i,l,We,null,h,ae));for(q in h)ae=h[q],ce=u[q],h.hasOwnProperty(q)&&ae!==ce&&(ae!=null||ce!=null)&&(q==="selected"?i.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":rn(i,l,q,ae,h,ce));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 ct in u)ae=u[ct],u.hasOwnProperty(ct)&&ae!=null&&!h.hasOwnProperty(ct)&&rn(i,l,ct,null,h,ae);for(ne in h)if(ae=h[ne],ce=u[ne],h.hasOwnProperty(ne)&&ae!==ce&&(ae!=null||ce!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,l));break;default:rn(i,l,ne,ae,h,ce)}return;default:if(Cg(l)){for(var on in u)ae=u[on],u.hasOwnProperty(on)&&ae!==void 0&&!h.hasOwnProperty(on)&&uy(i,l,on,void 0,h,ae);for(fe in h)ae=h[fe],ce=u[fe],!h.hasOwnProperty(fe)||ae===ce||ae===void 0&&ce===void 0||uy(i,l,fe,ae,h,ce);return}}for(var J in u)ae=u[J],u.hasOwnProperty(J)&&ae!=null&&!h.hasOwnProperty(J)&&rn(i,l,J,null,h,ae);for(ve in h)ae=h[ve],ce=u[ve],!h.hasOwnProperty(ve)||ae===ce||ae==null&&ce==null||rn(i,l,ve,ae,h,ce)}function AC(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function H4(){if(typeof performance.getEntriesByType=="function"){for(var i=0,l=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var b=u[h],w=b.transferSize,A=b.initiatorType,N=b.duration;if(w&&N&&AC(A)){for(A=0,N=b.responseEnd,h+=1;h<u.length;h++){var q=u[h],ne=q.startTime;if(ne>N)break;var fe=q.transferSize,ve=q.initiatorType;fe&&AC(ve)&&(q=q.responseEnd,A+=fe*(q<N?1:(N-ne)/(q-ne)))}if(--h,l+=8*(w+A)/(b.duration/1e3),i++,10<i)break}}if(0<i)return l/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var dy=null,fy=null;function Oh(i){return i.nodeType===9?i:i.ownerDocument}function kC(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 PC(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 hy(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 py=null;function q4(){var i=window.event;return i&&i.type==="popstate"?i===py?!1:(py=i,!0):(py=null,!1)}var NC=typeof setTimeout=="function"?setTimeout:void 0,G4=typeof clearTimeout=="function"?clearTimeout:void 0,OC=typeof Promise=="function"?Promise:void 0,Q4=typeof queueMicrotask=="function"?queueMicrotask:typeof OC<"u"?function(i){return OC.resolve(null).then(i).catch(W4)}:NC;function W4(i){setTimeout(function(){throw i})}function Za(i){return i==="head"}function MC(i,l){var u=l,h=0;do{var b=u.nextSibling;if(i.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(h===0){i.removeChild(b),Cc(l);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")id(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,id(u);for(var w=u.firstChild;w;){var A=w.nextSibling,N=w.nodeName;w[sn]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=A}}else u==="body"&&id(i.ownerDocument.body);u=b}while(u);Cc(l)}function LC(i,l){var u=i;i=0;do{var h=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=h}while(u)}function my(i){var l=i.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":my(u),_n(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function Y4(i,l,u,h){for(;i.nodeType===1;){var b=u;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[sn])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!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var w=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=Ti(i.nextSibling),i===null)break}return null}function K4(i,l,u){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Ti(i.nextSibling),i===null))return null;return i}function IC(i,l){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Ti(i.nextSibling),i===null))return null;return i}function gy(i){return i.data==="$?"||i.data==="$~"}function vy(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function X4(i,l){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=l;else if(i.data!=="$?"||u.readyState!=="loading")l();else{var h=function(){l(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function Ti(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==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return i}var yy=null;function zC(i){i=i.nextSibling;for(var l=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(l===0)return Ti(i.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}i=i.nextSibling}return null}function $C(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return i;l--}else u!=="/$"&&u!=="/&"||l++}i=i.previousSibling}return null}function UC(i,l,u){switch(l=Oh(u),i){case"html":if(i=l.documentElement,!i)throw Error(r(452));return i;case"head":if(i=l.head,!i)throw Error(r(453));return i;case"body":if(i=l.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function id(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);_n(i)}var Ri=new Map,BC=new Set;function Mh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var ha=L.d;L.d={f:J4,r:Z4,D:e3,C:t3,L:n3,m:r3,X:o3,S:i3,M:a3};function J4(){var i=ha.f(),l=Th();return i||l}function Z4(i){var l=Nt(i);l!==null&&l.tag===5&&l.type==="form"?ij(l):ha.r(i)}var Sc=typeof document>"u"?null:document;function VC(i,l,u){var h=Sc;if(h&&typeof l=="string"&&l){var b=xi(l);b='link[rel="'+i+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),BC.has(b)||(BC.add(b),i={rel:i,crossOrigin:u,href:l},h.querySelector(b)===null&&(l=h.createElement("link"),vr(l,"link",i),An(l),h.head.appendChild(l)))}}function e3(i){ha.D(i),VC("dns-prefetch",i,null)}function t3(i,l){ha.C(i,l),VC("preconnect",i,l)}function n3(i,l,u){ha.L(i,l,u);var h=Sc;if(h&&i&&l){var b='link[rel="preload"][as="'+xi(l)+'"]';l==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+xi(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+xi(u.imageSizes)+'"]')):b+='[href="'+xi(i)+'"]';var w=b;switch(l){case"style":w=wc(i);break;case"script":w=jc(i)}Ri.has(w)||(i=g({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:i,as:l},u),Ri.set(w,i),h.querySelector(b)!==null||l==="style"&&h.querySelector(od(w))||l==="script"&&h.querySelector(ad(w))||(l=h.createElement("link"),vr(l,"link",i),An(l),h.head.appendChild(l)))}}function r3(i,l){ha.m(i,l);var u=Sc;if(u&&i){var h=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+xi(h)+'"][href="'+xi(i)+'"]',w=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=jc(i)}if(!Ri.has(w)&&(i=g({rel:"modulepreload",href:i},l),Ri.set(w,i),u.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(ad(w)))return}h=u.createElement("link"),vr(h,"link",i),An(h),u.head.appendChild(h)}}}function i3(i,l,u){ha.S(i,l,u);var h=Sc;if(h&&i){var b=Br(h).hoistableStyles,w=wc(i);l=l||"default";var A=b.get(w);if(!A){var N={loading:0,preload:null};if(A=h.querySelector(od(w)))N.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":l},u),(u=Ri.get(w))&&xy(i,u);var q=A=h.createElement("link");An(q),vr(q,"link",i),q._p=new Promise(function(ne,fe){q.onload=ne,q.onerror=fe}),q.addEventListener("load",function(){N.loading|=1}),q.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Lh(A,l,h)}A={type:"stylesheet",instance:A,count:1,state:N},b.set(w,A)}}}function o3(i,l){ha.X(i,l);var u=Sc;if(u&&i){var h=Br(u).hoistableScripts,b=jc(i),w=h.get(b);w||(w=u.querySelector(ad(b)),w||(i=g({src:i,async:!0},l),(l=Ri.get(b))&&by(i,l),w=u.createElement("script"),An(w),vr(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(b,w))}}function a3(i,l){ha.M(i,l);var u=Sc;if(u&&i){var h=Br(u).hoistableScripts,b=jc(i),w=h.get(b);w||(w=u.querySelector(ad(b)),w||(i=g({src:i,async:!0,type:"module"},l),(l=Ri.get(b))&&by(i,l),w=u.createElement("script"),An(w),vr(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(b,w))}}function FC(i,l,u,h){var b=(b=we.current)?Mh(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=wc(u.href),u=Br(b).hoistableStyles,h=u.get(l),h||(h={type:"style",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=wc(u.href);var w=Br(b).hoistableStyles,A=w.get(i);if(A||(b=b.ownerDocument||b,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,A),(w=b.querySelector(od(i)))&&!w._p&&(A.instance=w,A.state.loading=5),Ri.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ri.set(i,u),w||s3(b,i,u,A.state))),l&&h===null)throw Error(r(528,""));return A}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=jc(u),u=Br(b).hoistableScripts,h=u.get(l),h||(h={type:"script",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function wc(i){return'href="'+xi(i)+'"'}function od(i){return'link[rel="stylesheet"]['+i+"]"}function HC(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function s3(i,l,u,h){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=i.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),vr(l,"link",u),An(l),i.head.appendChild(l))}function jc(i){return'[src="'+xi(i)+'"]'}function ad(i){return"script[async]"+i}function qC(i,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=i.querySelector('style[data-href~="'+xi(u.href)+'"]');if(h)return l.instance=h,An(h),h;var b=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),An(h),vr(h,"style",b),Lh(h,u.precedence,i),l.instance=h;case"stylesheet":b=wc(u.href);var w=i.querySelector(od(b));if(w)return l.state.loading|=4,l.instance=w,An(w),w;h=HC(u),(b=Ri.get(b))&&xy(h,b),w=(i.ownerDocument||i).createElement("link"),An(w);var A=w;return A._p=new Promise(function(N,q){A.onload=N,A.onerror=q}),vr(w,"link",h),l.state.loading|=4,Lh(w,u.precedence,i),l.instance=w;case"script":return w=jc(u.src),(b=i.querySelector(ad(w)))?(l.instance=b,An(b),b):(h=u,(b=Ri.get(w))&&(h=g({},u),by(h,b)),i=i.ownerDocument||i,b=i.createElement("script"),An(b),vr(b,"link",h),i.head.appendChild(b),l.instance=b);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,Lh(h,u.precedence,i));return l.instance}function Lh(i,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,w=b,A=0;A<h.length;A++){var N=h[A];if(N.dataset.precedence===l)w=N;else if(w!==b)break}w?w.parentNode.insertBefore(i,w.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(i,l.firstChild))}function xy(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function by(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Ih=null;function GC(i,l,u){if(Ih===null){var h=new Map,b=Ih=new Map;b.set(u,h)}else b=Ih,h=b.get(u),h||(h=new Map,b.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),b=0;b<u.length;b++){var w=u[b];if(!(w[sn]||w[Oe]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var A=w.getAttribute(l)||"";A=i+A;var N=h.get(A);N?N.push(w):h.set(A,[w])}}return h}function QC(i,l,u){i=i.ownerDocument||i,i.head.insertBefore(u,l==="title"?i.querySelector("head > title"):null)}function l3(i,l,u){if(u===1||l.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(i=l.disabled,typeof l.precedence=="string"&&i==null):!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 WC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function c3(i,l,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=wc(h.href),w=l.querySelector(od(b));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(i.count++,i=zh.bind(i),l.then(i,i)),u.state.loading|=4,u.instance=w,An(w);return}w=l.ownerDocument||l,h=HC(h),(b=Ri.get(b))&&xy(h,b),w=w.createElement("link"),An(w);var A=w;A._p=new Promise(function(N,q){A.onload=N,A.onerror=q}),vr(w,"link",h),u.instance=w}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=zh.bind(i),l.addEventListener("load",u),l.addEventListener("error",u))}}var Sy=0;function u3(i,l){return i.stylesheets&&i.count===0&&Uh(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var h=setTimeout(function(){if(i.stylesheets&&Uh(i,i.stylesheets),i.unsuspend){var w=i.unsuspend;i.unsuspend=null,w()}},6e4+l);0<i.imgBytes&&Sy===0&&(Sy=62500*H4());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Uh(i,i.stylesheets),i.unsuspend)){var w=i.unsuspend;i.unsuspend=null,w()}},(i.imgBytes>Sy?50:800)+l);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(h),clearTimeout(b)}}:null}function zh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Uh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var $h=null;function Uh(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,$h=new Map,l.forEach(d3,i),$h=null,zh.call(i))}function d3(i,l){if(!(l.state.loading&4)){var u=$h.get(i);if(u)var h=u.get(null);else{u=new Map,$h.set(i,u);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var A=b[w];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),h=A)}h&&u.set(null,h)}b=l.instance,A=b.getAttribute("data-precedence"),w=u.get(A)||h,w===h&&u.set(null,b),u.set(A,b),this.count++,h=zh.bind(this),b.addEventListener("load",h),b.addEventListener("error",h),w?w.parentNode.insertBefore(b,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),l.state.loading|=4}}var sd={$$typeof:E,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function f3(i,l,u,h,b,w,A,N,q){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=ho(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ho(0),this.hiddenUpdates=ho(null),this.identifierPrefix=h,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function YC(i,l,u,h,b,w,A,N,q,ne,fe,ve){return i=new f3(i,l,u,A,q,ne,fe,ve,N),l=1,w===!0&&(l|=24),w=ii(3,null,null,l),i.current=w,w.stateNode=i,l=ev(),l.refCount++,i.pooledCache=l,l.refCount++,w.memoizedState={element:h,isDehydrated:u,cache:l},iv(w),i}function KC(i){return i?(i=ec,i):ec}function XC(i,l,u,h,b,w){b=KC(b),h.context===null?h.context=b:h.pendingContext=b,h=Va(l),h.payload={element:u},w=w===void 0?null:w,w!==null&&(h.callback=w),u=Fa(i,h,l),u!==null&&(Qr(u,i,l),$u(u,i,l))}function JC(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<l?u:l}}function wy(i,l){JC(i,l),(i=i.alternate)&&JC(i,l)}function ZC(i){if(i.tag===13||i.tag===31){var l=Bs(i,67108864);l!==null&&Qr(l,i,67108864),wy(i,67108864)}}function eE(i){if(i.tag===13||i.tag===31){var l=ci();l=ie(l);var u=Bs(i,l);u!==null&&Qr(u,i,l),wy(i,l)}}var Bh=!0;function h3(i,l,u,h){var b=M.T;M.T=null;var w=L.p;try{L.p=2,jy(i,l,u,h)}finally{L.p=w,M.T=b}}function p3(i,l,u,h){var b=M.T;M.T=null;var w=L.p;try{L.p=8,jy(i,l,u,h)}finally{L.p=w,M.T=b}}function jy(i,l,u,h){if(Bh){var b=Cy(h);if(b===null)cy(i,l,h,Vh,u),nE(i,h);else if(g3(b,i,l,u,h))h.stopPropagation();else if(nE(i,h),l&4&&-1<m3.indexOf(i)){for(;b!==null;){var w=Nt(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var A=ti(w.pendingLanes);if(A!==0){var N=w;for(N.pendingLanes|=2,N.entangledLanes|=2;A;){var q=1<<31-Rn(A);N.entanglements[1]|=q,A&=~q}vo(w),(qt&6)===0&&(Ch=pe()+500,td(0))}}break;case 31:case 13:N=Bs(w,2),N!==null&&Qr(N,w,2),Th(),wy(w,2)}if(w=Cy(h),w===null&&cy(i,l,h,Vh,u),w===b)break;b=w}b!==null&&h.stopPropagation()}else cy(i,l,h,null,u)}}function Cy(i){return i=Tg(i),Ey(i)}var Vh=null;function Ey(i){if(Vh=null,i=Dn(i),i!==null){var l=s(i);if(l===null)i=null;else{var u=l.tag;if(u===13){if(i=c(l),i!==null)return i;i=null}else if(u===31){if(i=d(l),i!==null)return i;i=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return Vh=i,null}function tE(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(qe()){case Ce:return 2;case Pe:return 8;case At:case mn:return 32;case gn:return 268435456;default:return 32}default:return 32}}var Ty=!1,es=null,ts=null,ns=null,ld=new Map,cd=new Map,rs=[],m3="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 nE(i,l){switch(i){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":ld.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":cd.delete(l.pointerId)}}function ud(i,l,u,h,b,w){return i===null||i.nativeEvent!==w?(i={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:w,targetContainers:[b]},l!==null&&(l=Nt(l),l!==null&&ZC(l)),i):(i.eventSystemFlags|=h,l=i.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),i)}function g3(i,l,u,h,b){switch(l){case"focusin":return es=ud(es,i,l,u,h,b),!0;case"dragenter":return ts=ud(ts,i,l,u,h,b),!0;case"mouseover":return ns=ud(ns,i,l,u,h,b),!0;case"pointerover":var w=b.pointerId;return ld.set(w,ud(ld.get(w)||null,i,l,u,h,b)),!0;case"gotpointercapture":return w=b.pointerId,cd.set(w,ud(cd.get(w)||null,i,l,u,h,b)),!0}return!1}function rE(i){var l=Dn(i.target);if(l!==null){var u=s(l);if(u!==null){if(l=u.tag,l===13){if(l=c(u),l!==null){i.blockedOn=l,Ye(i.priority,function(){eE(u)});return}}else if(l===31){if(l=d(u),l!==null){i.blockedOn=l,Ye(i.priority,function(){eE(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Fh(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var u=Cy(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);Eg=h,u.target.dispatchEvent(h),Eg=null}else return l=Nt(u),l!==null&&ZC(l),i.blockedOn=u,!1;l.shift()}return!0}function iE(i,l,u){Fh(i)&&u.delete(l)}function v3(){Ty=!1,es!==null&&Fh(es)&&(es=null),ts!==null&&Fh(ts)&&(ts=null),ns!==null&&Fh(ns)&&(ns=null),ld.forEach(iE),cd.forEach(iE)}function Hh(i,l){i.blockedOn===l&&(i.blockedOn=null,Ty||(Ty=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,v3)))}var qh=null;function oE(i){qh!==i&&(qh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){qh===i&&(qh=null);for(var l=0;l<i.length;l+=3){var u=i[l],h=i[l+1],b=i[l+2];if(typeof h!="function"){if(Ey(h||u)===null)continue;break}var w=Nt(u);w!==null&&(i.splice(l,3),l-=3,Cv(w,{pending:!0,data:b,method:u.method,action:h},h,b))}}))}function Cc(i){function l(q){return Hh(q,i)}es!==null&&Hh(es,i),ts!==null&&Hh(ts,i),ns!==null&&Hh(ns,i),ld.forEach(l),cd.forEach(l);for(var u=0;u<rs.length;u++){var h=rs[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<rs.length&&(u=rs[0],u.blockedOn===null);)rE(u),u.blockedOn===null&&rs.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var b=u[h],w=u[h+1],A=b[Ve]||null;if(typeof w=="function")A||oE(u);else if(A){var N=null;if(w&&w.hasAttribute("formAction")){if(b=w,A=w[Ve]||null)N=A.formAction;else if(Ey(b)!==null)continue}else N=A.action;typeof N=="function"?u[h+1]=N:(u.splice(h,3),h-=3),oE(u)}}}function aE(){function i(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(A){return b=A})},focusReset:"manual",scroll:"manual"})}function l(){b!==null&&(b(),b=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,b=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),b!==null&&(b(),b=null)}}}function Ry(i){this._internalRoot=i}Gh.prototype.render=Ry.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var u=l.current,h=ci();XC(u,h,i,l,null,null)},Gh.prototype.unmount=Ry.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;XC(i.current,2,null,i,null,null),Th(),l[Je]=null}};function Gh(i){this._internalRoot=i}Gh.prototype.unstable_scheduleHydration=function(i){if(i){var l=De();i={blockedOn:null,target:i,priority:l};for(var u=0;u<rs.length&&l!==0&&l<rs[u].priority;u++);rs.splice(u,0,i),u===0&&rE(i)}};var sE=t.version;if(sE!=="19.2.3")throw Error(r(527,sE,"19.2.3"));L.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=p(l),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var y3={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qh.isDisabled&&Qh.supportsFiber)try{br=Qh.inject(y3),Wt=Qh}catch{}}return md.createRoot=function(i,l){if(!o(i))throw Error(r(299));var u=!1,h="",b=pj,w=mj,A=gj;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError)),l=YC(i,1,!1,null,null,u,h,null,b,w,A,aE),i[Je]=l.current,ly(i),new Ry(l)},md.hydrateRoot=function(i,l,u){if(!o(i))throw Error(r(299));var h=!1,b="",w=pj,A=mj,N=gj,q=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(N=u.onRecoverableError),u.formState!==void 0&&(q=u.formState)),l=YC(i,1,!0,l,u??null,h,b,q,w,A,N,aE),l.context=KC(null),u=l.current,h=ci(),h=ie(h),b=Va(h),b.callback=null,Fa(u,b,h),u=h,l.current.lanes=u,Yo(l,u),vo(l),i[Je]=l.current,ly(i),new Gh(l)},md.version="19.2.3",md}var qR;function see(){if(qR)return hx.exports;qR=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(),hx.exports=aee(),hx.exports}var lee=see();var dN=e=>{throw TypeError(e)},cee=(e,t,n)=>t.has(e)||dN("Cannot "+n),gx=(e,t,n)=>(cee(e,t,"read from private field"),n?n.call(e):t.get(e)),uee=(e,t,n)=>t.has(e)?dN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),GR="popstate";function dee(e={}){function t(r,o){let{pathname:s,search:c,hash:d}=r.location;return Gd("",{pathname:s,search:c,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Uo(o)}return hee(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $n(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function fee(){return Math.random().toString(36).substring(2,10)}function QR(e,t){return{usr:e.state,key:e.key,idx:t}}function Gd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Oa(t):t,state:n,key:t&&t.key||r||fee()}}function Uo({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 Oa(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 hee(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,c=o.history,d="POP",f=null,p=m();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function m(){return(c.state||{idx:null}).idx}function g(){d="POP";let C=m(),T=C==null?null:C-p;p=C,f&&f({action:d,location:j.location,delta:T})}function y(C,T){d="PUSH";let R=Gd(j.location,C,T);p=m()+1;let E=QR(R,p),_=j.createHref(R);try{c.pushState(E,"",_)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(_)}s&&f&&f({action:d,location:j.location,delta:1})}function x(C,T){d="REPLACE";let R=Gd(j.location,C,T);p=m();let E=QR(R,p),_=j.createHref(R);c.replaceState(E,"",_),s&&f&&f({action:d,location:j.location,delta:0})}function S(C){return fN(C)}let j={get action(){return d},get location(){return e(o,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(GR,g),f=C,()=>{o.removeEventListener(GR,g),f=null}},createHref(C){return t(o,C)},createURL:S,encodeLocation(C){let T=S(C);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:y,replace:x,go(C){return c.go(C)}};return j}function fN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Uo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Sd,WR=class{constructor(e){if(uee(this,Sd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(gx(this,Sd).has(e))return gx(this,Sd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){gx(this,Sd).set(e,t)}};Sd=new WeakMap;var pee=new Set(["lazy","caseSensitive","path","id","index","children"]);function mee(e){return pee.has(e)}var gee=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function vee(e){return gee.has(e)}function yee(e){return e.index===!0}function Qd(e,t,n=[],r={},o=!1){return e.map((s,c)=>{let d=[...n,String(c)],f=typeof s.id=="string"?s.id:d.join("-");if(bt(s.index!==!0||!s.children,"Cannot specify children on an index route"),bt(o||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),yee(s)){let p={...s,id:f};return r[f]=YR(p,t(p)),p}else{let p={...s,id:f,children:void 0};return r[f]=YR(p,t(p)),s.children&&(p.children=Qd(s.children,t,d,r,o)),p}})}function YR(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function hs(e,t,n="/"){return wd(e,t,n,!1)}function wd(e,t,n,r){let o=typeof t=="string"?Oa(t):t,s=Li(o.pathname||"/",n);if(s==null)return null;let c=hN(e);bee(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let p=kee(s);d=Dee(c[f],p,r)}return d}function xee(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function hN(e,t=[],n=[],r="",o=!1){let s=(c,d,f=o,p)=>{let m={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;bt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=Oo([r,m.relativePath]),y=n.concat(m);c.children&&c.children.length>0&&(bt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),hN(c.children,t,y,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:Ree(g,c.index),routesMeta:y})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))s(c,d);else for(let f of pN(c.path))s(c,d,!0,f)}),t}function pN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let c=pN(r.join("/")),d=[];return d.push(...c.map(f=>f===""?s:[s,f].join("/"))),o&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function bee(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_ee(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var See=/^:[\w-]+$/,wee=3,jee=2,Cee=1,Eee=10,Tee=-2,KR=e=>e==="*";function Ree(e,t){let n=e.split("/"),r=n.length;return n.some(KR)&&(r+=Tee),t&&(r+=jee),n.filter(o=>!KR(o)).reduce((o,s)=>o+(See.test(s)?wee:s===""?Cee:Eee),r)}function _ee(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Dee(e,t,n=!1){let{routesMeta:r}=e,o={},s="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],p=d===r.length-1,m=s==="/"?t:t.slice(s.length)||"/",g=tm({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),y=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=tm({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(o,g.params),c.push({params:o,pathname:Oo([s,g.pathname]),pathnameBase:Oee(Oo([s,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(s=Oo([s,g.pathnameBase]))}return c}function tm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Aee(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],c=s.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},y)=>{if(m==="*"){let S=d[y]||"";c=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const x=d[y];return g&&!x?p[m]=void 0:p[m]=(x||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:c,pattern:e}}function Aee(e,t=!1,n=!0){$n(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f)=>(r.push({paramName:d,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function kee(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $n(!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 Li(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 Pee({basename:e,pathname:t}){return t==="/"?e:Oo([e,t])}var mN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vg=e=>mN.test(e);function Nee(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Oa(e):e,s;if(n)if(vg(n))s=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),$n(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?s=XR(n.substring(1),"/"):s=XR(n,t)}else s=t;return{pathname:s,search:Mee(r),hash:Lee(o)}}function XR(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function vx(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 gN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function o1(e){let t=gN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function a1(e,t,n,r=!1){let o;typeof e=="string"?o=Oa(e):(o={...e},bt(!o.pathname||!o.pathname.includes("?"),vx("?","pathname","search",o)),bt(!o.pathname||!o.pathname.includes("#"),vx("#","pathname","hash",o)),bt(!o.search||!o.search.includes("#"),vx("#","search","hash",o)));let s=e===""||o.pathname==="",c=s?"/":o.pathname,d;if(c==null)d=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;o.pathname=y.join("/")}d=g>=0?t[g]:"/"}let f=Nee(o,d),p=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var Oo=e=>e.join("/").replace(/\/\/+/g,"/"),Oee=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Mee=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Lee=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Af=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 Wd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function kf(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var vN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yN(e,t){let n=e;if(typeof n!="string"||!mN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(vN)try{let s=new URL(window.location.href),c=n.startsWith("//")?new URL(s.protocol+n):new URL(n),d=Li(c.pathname,t);c.origin===s.origin&&d!=null?n=d+c.search+c.hash:o=!0}catch{$n(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}var vs=Symbol("Uninstrumented");function Iee(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(s){let c=Object.keys(n);for(let d of c)s[d]&&n[d].push(s[d])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=Bc(n.lazy,t.lazy,()=>{});o&&(r.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(s=>{let c=o[s],d=n[`lazy.${s}`];if(typeof c=="function"&&d.length>0){let f=Bc(d,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[s]:f}))}})}return["loader","action"].forEach(o=>{let s=t[o];if(typeof s=="function"&&n[o].length>0){let c=s[vs]??s,d=Bc(n[o],c,(...f)=>JR(f[0]));d&&(o==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[vs]=c,r[o]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(o=>{let s=o[vs]??o,c=Bc(n.middleware,s,(...d)=>JR(d[0]));return c?(c[vs]=s,c):o})),r}function zee(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(o){let s=Object.keys(o);for(let c of s)o[c]&&n[c].push(o[c])}})),n.navigate.length>0){let r=e.navigate[vs]??e.navigate,o=Bc(n.navigate,r,(...s)=>{let[c,d]=s;return{to:typeof c=="number"||typeof c=="string"?c:c?Uo(c):".",...ZR(e,d??{})}});o&&(o[vs]=r,e.navigate=o)}if(n.fetch.length>0){let r=e.fetch[vs]??e.fetch,o=Bc(n.fetch,r,(...s)=>{let[c,,d,f]=s;return{href:d??".",fetcherKey:c,...ZR(e,f??{})}});o&&(o[vs]=r,e.fetch=o)}return e}function Bc(e,t,n){return e.length===0?null:async(...r)=>{let o=await xN(e,n(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function xN(e,t,n,r){let o=e[r],s;if(o){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=xN(e,t,n,r-1),s=await c,bt(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await o(d,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await d(),await c}else try{s={type:"success",value:await n()}}catch(c){s={type:"error",value:c}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function JR(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:$ee(t),params:{...r},unstable_pattern:o,context:Uee(n)}}function ZR(e,t){return{currentUrl:Uo(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function $ee(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Uee(e){if(Vee(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Bee=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Vee(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Bee}var bN=["POST","PUT","PATCH","DELETE"],Fee=new Set(bN),Hee=["GET",...bN],qee=new Set(Hee),SN=new Set([301,302,303,307,308]),Gee=new Set([307,308]),yx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qee={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Wee=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),wN="remix-router-transitions",jN=Symbol("ResetLoaderData");function Yee(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";bt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||Wee,s=o;if(e.unstable_instrumentations){let V=e.unstable_instrumentations;s=X=>({...o(X),...Iee(V.map(ie=>ie.route).filter(Boolean),X)})}let c={},d=Qd(e.routes,s,void 0,c),f,p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let m=e.dataStrategy||ete,g={...e.future},y=null,x=new Set,S=null,j=null,C=null,T=e.hydrationData!=null,R=hs(d,e.history.location,p),E=!1,_=null,k;if(R==null&&!e.patchRoutesOnNavigation){let V=ki(404,{pathname:e.history.location.pathname}),{matches:X,route:ie}=sp(d);k=!0,R=X,_={[ie.id]:V}}else if(R&&!e.hydrationData&&Vn(R,d,e.history.location.pathname).active&&(R=null),R)if(R.some(V=>V.route.lazy))k=!1;else if(!R.some(V=>s1(V.route)))k=!0;else{let V=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let ie=R.findIndex(je=>X[je.route.id]!==void 0);k=R.slice(0,ie+1).every(je=>!ub(je.route,V,X))}else k=R.every(ie=>!ub(ie.route,V,X))}else{k=!1,R=[];let V=Vn(null,d,e.history.location.pathname);V.active&&V.matches&&(E=!0,R=V.matches)}let I,D={historyAction:e.history.action,location:e.history.location,matches:R,initialized:k,navigation:yx,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||_,fetchers:new Map,blockers:new Map},P="POP",$=null,B=!1,Q,K=!1,Z=new Map,U=null,G=!1,M=!1,L=new Set,z=new Map,F=0,Y=-1,O=new Map,H=new Set,se=new Map,de=new Map,ye=new Set,we=new Map,Ee,Xe=null;function Ae(){if(y=e.history.listen(({action:V,location:X,delta:ie})=>{if(Ee){Ee(),Ee=void 0;return}$n(we.size===0||ie!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let je=Wo({currentLocation:D.location,nextLocation:X,historyAction:V});if(je&&ie!=null){let De=new Promise(Ye=>{Ee=Ye});e.history.go(ie*-1),Ur(je,{state:"blocked",location:X,proceed(){Ur(je,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),De.then(()=>e.history.go(ie))},reset(){let Ye=new Map(D.blockers);Ye.set(je,gd),it({blockers:Ye})}}),$?.resolve(),$=null;return}return jt(V,X)}),n){yte(t,Z);let V=()=>xte(t,Z);t.addEventListener("pagehide",V),U=()=>t.removeEventListener("pagehide",V)}return D.initialized||jt("POP",D.location,{initialHydration:!0}),I}function dt(){y&&y(),U&&U(),x.clear(),Q&&Q.abort(),D.fetchers.forEach((V,X)=>an(X)),D.blockers.forEach((V,X)=>Ma(X))}function Et(V){return x.add(V),()=>x.delete(V)}function it(V,X={}){V.matches&&(V.matches=V.matches.map(De=>{let Ye=c[De.route.id],ze=De.route;return ze.element!==Ye.element||ze.errorElement!==Ye.errorElement||ze.hydrateFallbackElement!==Ye.hydrateFallbackElement?{...De,route:Ye}:De})),D={...D,...V};let ie=[],je=[];D.fetchers.forEach((De,Ye)=>{De.state==="idle"&&(ye.has(Ye)?ie.push(Ye):je.push(Ye))}),ye.forEach(De=>{!D.fetchers.has(De)&&!z.has(De)&&ie.push(De)}),[...x].forEach(De=>De(D,{deletedFetchers:ie,newErrors:V.errors??null,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),ie.forEach(De=>an(De)),je.forEach(De=>D.fetchers.delete(De))}function rt(V,X,{flushSync:ie}={}){let je=D.actionData!=null&&D.navigation.formMethod!=null&&Cr(D.navigation.formMethod)&&D.navigation.state==="loading"&&V.state?._isRedirect!==!0,De;X.actionData?Object.keys(X.actionData).length>0?De=X.actionData:De=null:je?De=D.actionData:De=null;let Ye=X.loaderData?c_(D.loaderData,X.loaderData,X.matches||[],X.errors):D.loaderData,ze=D.blockers;ze.size>0&&(ze=new Map(ze),ze.forEach((st,nt)=>ze.set(nt,gd)));let Oe=G?!1:Os(V,X.matches||D.matches),Ve=B===!0||D.navigation.formMethod!=null&&Cr(D.navigation.formMethod)&&V.state?._isRedirect!==!0;f&&(d=f,f=void 0),G||P==="POP"||(P==="PUSH"?e.history.push(V,V.state):P==="REPLACE"&&e.history.replace(V,V.state));let Je;if(P==="POP"){let st=Z.get(D.location.pathname);st&&st.has(V.pathname)?Je={currentLocation:D.location,nextLocation:V}:Z.has(V.pathname)&&(Je={currentLocation:V,nextLocation:D.location})}else if(K){let st=Z.get(D.location.pathname);st?st.add(V.pathname):(st=new Set([V.pathname]),Z.set(D.location.pathname,st)),Je={currentLocation:D.location,nextLocation:V}}it({...X,actionData:De,loaderData:Ye,historyAction:P,location:V,initialized:!0,navigation:yx,revalidation:"idle",restoreScrollPosition:Oe,preventScrollReset:Ve,blockers:ze},{viewTransitionOpts:Je,flushSync:ie===!0}),P="POP",B=!1,K=!1,G=!1,M=!1,$?.resolve(),$=null,Xe?.resolve(),Xe=null}async function mt(V,X){if($?.resolve(),$=null,typeof V=="number"){$||($=h_());let Ge=$.promise;return e.history.go(V),Ge}let ie=cb(D.location,D.matches,p,V,X?.fromRouteId,X?.relative),{path:je,submission:De,error:Ye}=e_(!1,ie,X),ze=D.location,Oe=Gd(D.location,je,X&&X.state);Oe={...Oe,...e.history.encodeLocation(Oe)};let Ve=X&&X.replace!=null?X.replace:void 0,Je="PUSH";Ve===!0?Je="REPLACE":Ve===!1||De!=null&&Cr(De.formMethod)&&De.formAction===D.location.pathname+D.location.search&&(Je="REPLACE");let st=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,nt=(X&&X.flushSync)===!0,Rt=Wo({currentLocation:ze,nextLocation:Oe,historyAction:Je});if(Rt){Ur(Rt,{state:"blocked",location:Oe,proceed(){Ur(Rt,{state:"proceeding",proceed:void 0,reset:void 0,location:Oe}),mt(V,X)},reset(){let Ge=new Map(D.blockers);Ge.set(Rt,gd),it({blockers:Ge})}});return}await jt(Je,Oe,{submission:De,pendingError:Ye,preventScrollReset:st,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:nt,callSiteDefaultShouldRevalidate:X&&X.unstable_defaultShouldRevalidate})}function Ct(){Xe||(Xe=h_()),Pe(),it({revalidation:"loading"});let V=Xe.promise;return D.navigation.state==="submitting"?V:D.navigation.state==="idle"?(jt(D.historyAction,D.location,{startUninterruptedRevalidation:!0}),V):(jt(P||D.historyAction,D.navigation.location,{overrideNavigation:D.navigation,enableViewTransition:K===!0}),V)}async function jt(V,X,ie){Q&&Q.abort(),Q=null,P=V,G=(ie&&ie.startUninterruptedRevalidation)===!0,fr(D.location,D.matches),B=(ie&&ie.preventScrollReset)===!0,K=(ie&&ie.enableViewTransition)===!0;let je=f||d,De=ie&&ie.overrideNavigation,Ye=ie?.initialHydration&&D.matches&&D.matches.length>0&&!E?D.matches:hs(je,X,p),ze=(ie&&ie.flushSync)===!0;if(Ye&&D.initialized&&!M&<e(D.location,X)&&!(ie&&ie.submission&&Cr(ie.submission.formMethod))){rt(X,{matches:Ye},{flushSync:ze});return}let Oe=Vn(Ye,je,X.pathname);if(Oe.active&&Oe.matches&&(Ye=Oe.matches),!Ye){let{error:_n,notFoundMatches:Dn,route:Nt}=Fi(X.pathname);rt(X,{matches:Dn,loaderData:{},errors:{[Nt.id]:_n}},{flushSync:ze});return}Q=new AbortController;let Ve=$c(e.history,X,Q.signal,ie&&ie.submission),Je=e.getContext?await e.getContext():new WR,st;if(ie&&ie.pendingError)st=[ps(Ye).route.id,{type:"error",error:ie.pendingError}];else if(ie&&ie.submission&&Cr(ie.submission.formMethod)){let _n=await Te(Ve,X,ie.submission,Ye,Je,Oe.active,ie&&ie.initialHydration===!0,{replace:ie.replace,flushSync:ze});if(_n.shortCircuited)return;if(_n.pendingActionResult){let[Dn,Nt]=_n.pendingActionResult;if(di(Nt)&&Wd(Nt.error)&&Nt.error.status===404){Q=null,rt(X,{matches:_n.matches,loaderData:{},errors:{[Dn]:Nt.error}});return}}Ye=_n.matches||Ye,st=_n.pendingActionResult,De=xx(X,ie.submission),ze=!1,Oe.active=!1,Ve=$c(e.history,Ve.url,Ve.signal)}let{shortCircuited:nt,matches:Rt,loaderData:Ge,errors:sn}=await _e(Ve,X,Ye,Je,Oe.active,De,ie&&ie.submission,ie&&ie.fetcherSubmission,ie&&ie.replace,ie&&ie.initialHydration===!0,ze,st,ie&&ie.callSiteDefaultShouldRevalidate);nt||(Q=null,rt(X,{matches:Rt||Ye,...u_(st),loaderData:Ge,errors:sn}))}async function Te(V,X,ie,je,De,Ye,ze,Oe={}){Pe();let Ve=gte(X,ie);if(it({navigation:Ve},{flushSync:Oe.flushSync===!0}),Ye){let nt=await ho(je,X.pathname,V.signal);if(nt.type==="aborted")return{shortCircuited:!0};if(nt.type==="error"){if(nt.partialMatches.length===0){let{matches:Ge,route:sn}=sp(d);return{matches:Ge,pendingActionResult:[sn.id,{type:"error",error:nt.error}]}}let Rt=ps(nt.partialMatches).route.id;return{matches:nt.partialMatches,pendingActionResult:[Rt,{type:"error",error:nt.error}]}}else if(nt.matches)je=nt.matches;else{let{notFoundMatches:Rt,error:Ge,route:sn}=Fi(X.pathname);return{matches:Rt,pendingActionResult:[sn.id,{type:"error",error:Ge}]}}}let Je,st=Ep(je,X);if(!st.route.action&&!st.route.lazy)Je={type:"error",error:ki(405,{method:V.method,pathname:X.pathname,routeId:st.route.id})};else{let nt=Qc(s,c,V,je,st,ze?[]:r,De),Rt=await qe(V,nt,De,null);if(Je=Rt[st.route.id],!Je){for(let Ge of je)if(Rt[Ge.route.id]){Je=Rt[Ge.route.id];break}}if(V.signal.aborted)return{shortCircuited:!0}}if(pl(Je)){let nt;return Oe&&Oe.replace!=null?nt=Oe.replace:nt=a_(Je.response.headers.get("Location"),new URL(V.url),p,e.history)===D.location.pathname+D.location.search,await pe(V,Je,!0,{submission:ie,replace:nt}),{shortCircuited:!0}}if(di(Je)){let nt=ps(je,st.route.id);return(Oe&&Oe.replace)!==!0&&(P="PUSH"),{matches:je,pendingActionResult:[nt.route.id,Je,st.route.id]}}return{matches:je,pendingActionResult:[st.route.id,Je]}}async function _e(V,X,ie,je,De,Ye,ze,Oe,Ve,Je,st,nt,Rt){let Ge=Ye||xx(X,ze),sn=ze||Oe||f_(Ge),_n=!G&&!Je;if(De){if(_n){let Fn=$e(nt);it({navigation:Ge,...Fn!==void 0?{actionData:Fn}:{}},{flushSync:st})}let Ot=await ho(ie,X.pathname,V.signal);if(Ot.type==="aborted")return{shortCircuited:!0};if(Ot.type==="error"){if(Ot.partialMatches.length===0){let{matches:Qi,route:hr}=sp(d);return{matches:Qi,loaderData:{},errors:{[hr.id]:Ot.error}}}let Fn=ps(Ot.partialMatches).route.id;return{matches:Ot.partialMatches,loaderData:{},errors:{[Fn]:Ot.error}}}else if(Ot.matches)ie=Ot.matches;else{let{error:Fn,notFoundMatches:Qi,route:hr}=Fi(X.pathname);return{matches:Qi,loaderData:{},errors:{[hr.id]:Fn}}}}let Dn=f||d,{dsMatches:Nt,revalidatingFetchers:or}=t_(V,je,s,c,e.history,D,ie,sn,X,Je?[]:r,Je===!0,M,L,ye,se,H,Dn,p,e.patchRoutesOnNavigation!=null,nt,Rt);if(Y=++F,!e.dataStrategy&&!Nt.some(Ot=>Ot.shouldLoad)&&!Nt.some(Ot=>Ot.route.middleware&&Ot.route.middleware.length>0)&&or.length===0){let Ot=Rn();return rt(X,{matches:ie,loaderData:{},errors:nt&&di(nt[1])?{[nt[0]]:nt[1].error}:null,...u_(nt),...Ot?{fetchers:new Map(D.fetchers)}:{}},{flushSync:st}),{shortCircuited:!0}}if(_n){let Ot={};if(!De){Ot.navigation=Ge;let Fn=$e(nt);Fn!==void 0&&(Ot.actionData=Fn)}or.length>0&&(Ot.fetchers=Le(or)),it(Ot,{flushSync:st})}or.forEach(Ot=>{Wt(Ot.key),Ot.controller&&z.set(Ot.key,Ot.controller)});let Br=()=>or.forEach(Ot=>Wt(Ot.key));Q&&Q.signal.addEventListener("abort",Br);let{loaderResults:An,fetcherResults:qi}=await Ce(Nt,or,V,je);if(V.signal.aborted)return{shortCircuited:!0};Q&&Q.signal.removeEventListener("abort",Br),or.forEach(Ot=>z.delete(Ot.key));let ni=lp(An);if(ni)return await pe(V,ni.result,!0,{replace:Ve}),{shortCircuited:!0};if(ni=lp(qi),ni)return H.add(ni.key),await pe(V,ni.result,!0,{replace:Ve}),{shortCircuited:!0};let{loaderData:Gi,errors:yi}=l_(D,ie,An,nt,or,qi);Je&&D.errors&&(yi={...D.errors,...yi});let Ko=Rn(),Ms=fo(Y),Ls=Ko||Ms||or.length>0;return{matches:ie,loaderData:Gi,errors:yi,...Ls?{fetchers:new Map(D.fetchers)}:{}}}function $e(V){if(V&&!di(V[1]))return{[V[0]]:V[1].data};if(D.actionData)return Object.keys(D.actionData).length===0?null:D.actionData}function Le(V){return V.forEach(X=>{let ie=D.fetchers.get(X.key),je=vd(void 0,ie?ie.data:void 0);D.fetchers.set(X.key,je)}),new Map(D.fetchers)}async function lt(V,X,ie,je){Wt(V);let De=(je&&je.flushSync)===!0,Ye=f||d,ze=cb(D.location,D.matches,p,ie,X,je?.relative),Oe=hs(Ye,ze,p),Ve=Vn(Oe,Ye,ze);if(Ve.active&&Ve.matches&&(Oe=Ve.matches),!Oe){mn(V,X,ki(404,{pathname:ze}),{flushSync:De});return}let{path:Je,submission:st,error:nt}=e_(!0,ze,je);if(nt){mn(V,X,nt,{flushSync:De});return}let Rt=e.getContext?await e.getContext():new WR,Ge=(je&&je.preventScrollReset)===!0;if(st&&Cr(st.formMethod)){await tt(V,X,Je,Oe,Rt,Ve.active,De,Ge,st,je&&je.unstable_defaultShouldRevalidate);return}se.set(V,{routeId:X,path:Je}),await ft(V,X,Je,Oe,Rt,Ve.active,De,Ge,st)}async function tt(V,X,ie,je,De,Ye,ze,Oe,Ve,Je){Pe(),se.delete(V);let st=D.fetchers.get(V);At(V,vte(Ve,st),{flushSync:ze});let nt=new AbortController,Rt=$c(e.history,ie,nt.signal,Ve);if(Ye){let Mt=await ho(je,new URL(Rt.url).pathname,Rt.signal,V);if(Mt.type==="aborted")return;if(Mt.type==="error"){mn(V,X,Mt.error,{flushSync:ze});return}else if(Mt.matches)je=Mt.matches;else{mn(V,X,ki(404,{pathname:ie}),{flushSync:ze});return}}let Ge=Ep(je,ie);if(!Ge.route.action&&!Ge.route.lazy){let Mt=ki(405,{method:Ve.formMethod,pathname:ie,routeId:X});mn(V,X,Mt,{flushSync:ze});return}z.set(V,nt);let sn=F,_n=Qc(s,c,Rt,je,Ge,r,De),Dn=await qe(Rt,_n,De,V),Nt=Dn[Ge.route.id];if(!Nt){for(let Mt of _n)if(Dn[Mt.route.id]){Nt=Dn[Mt.route.id];break}}if(Rt.signal.aborted){z.get(V)===nt&&z.delete(V);return}if(ye.has(V)){if(pl(Nt)||di(Nt)){At(V,va(void 0));return}}else{if(pl(Nt))if(z.delete(V),Y>sn){At(V,va(void 0));return}else return H.add(V),At(V,vd(Ve)),pe(Rt,Nt,!1,{fetcherSubmission:Ve,preventScrollReset:Oe});if(di(Nt)){mn(V,X,Nt.error);return}}let or=D.navigation.location||D.location,Br=$c(e.history,or,nt.signal),An=f||d,qi=D.navigation.state!=="idle"?hs(An,D.navigation.location,p):D.matches;bt(qi,"Didn't find any matches after fetcher action");let ni=++F;O.set(V,ni);let Gi=vd(Ve,Nt.data);D.fetchers.set(V,Gi);let{dsMatches:yi,revalidatingFetchers:Ko}=t_(Br,De,s,c,e.history,D,qi,Ve,or,r,!1,M,L,ye,se,H,An,p,e.patchRoutesOnNavigation!=null,[Ge.route.id,Nt],Je);Ko.filter(Mt=>Mt.key!==V).forEach(Mt=>{let Is=Mt.key,If=D.fetchers.get(Is),ju=vd(void 0,If?If.data:void 0);D.fetchers.set(Is,ju),Wt(Is),Mt.controller&&z.set(Is,Mt.controller)}),it({fetchers:new Map(D.fetchers)});let Ms=()=>Ko.forEach(Mt=>Wt(Mt.key));nt.signal.addEventListener("abort",Ms);let{loaderResults:Ls,fetcherResults:Ot}=await Ce(yi,Ko,Br,De);if(nt.signal.aborted)return;if(nt.signal.removeEventListener("abort",Ms),O.delete(V),z.delete(V),Ko.forEach(Mt=>z.delete(Mt.key)),D.fetchers.has(V)){let Mt=va(Nt.data);D.fetchers.set(V,Mt)}let Fn=lp(Ls);if(Fn)return pe(Br,Fn.result,!1,{preventScrollReset:Oe});if(Fn=lp(Ot),Fn)return H.add(Fn.key),pe(Br,Fn.result,!1,{preventScrollReset:Oe});let{loaderData:Qi,errors:hr}=l_(D,qi,Ls,void 0,Ko,Ot);fo(ni),D.navigation.state==="loading"&&ni>Y?(bt(P,"Expected pending action"),Q&&Q.abort(),rt(D.navigation.location,{matches:qi,loaderData:Qi,errors:hr,fetchers:new Map(D.fetchers)})):(it({errors:hr,loaderData:c_(D.loaderData,Qi,qi,hr),fetchers:new Map(D.fetchers)}),M=!1)}async function ft(V,X,ie,je,De,Ye,ze,Oe,Ve){let Je=D.fetchers.get(V);At(V,vd(Ve,Je?Je.data:void 0),{flushSync:ze});let st=new AbortController,nt=$c(e.history,ie,st.signal);if(Ye){let Nt=await ho(je,new URL(nt.url).pathname,nt.signal,V);if(Nt.type==="aborted")return;if(Nt.type==="error"){mn(V,X,Nt.error,{flushSync:ze});return}else if(Nt.matches)je=Nt.matches;else{mn(V,X,ki(404,{pathname:ie}),{flushSync:ze});return}}let Rt=Ep(je,ie);z.set(V,st);let Ge=F,sn=Qc(s,c,nt,je,Rt,r,De),Dn=(await qe(nt,sn,De,V))[Rt.route.id];if(z.get(V)===st&&z.delete(V),!nt.signal.aborted){if(ye.has(V)){At(V,va(void 0));return}if(pl(Dn))if(Y>Ge){At(V,va(void 0));return}else{H.add(V),await pe(nt,Dn,!1,{preventScrollReset:Oe});return}if(di(Dn)){mn(V,X,Dn.error);return}At(V,va(Dn.data))}}async function pe(V,X,ie,{submission:je,fetcherSubmission:De,preventScrollReset:Ye,replace:ze}={}){ie||($?.resolve(),$=null),X.response.headers.has("X-Remix-Revalidate")&&(M=!0);let Oe=X.response.headers.get("Location");bt(Oe,"Expected a Location header on the redirect Response"),Oe=a_(Oe,new URL(V.url),p,e.history);let Ve=Gd(D.location,Oe,{_isRedirect:!0});if(n){let sn=!1;if(X.response.headers.has("X-Remix-Reload-Document"))sn=!0;else if(vg(Oe)){const _n=fN(Oe,!0);sn=_n.origin!==t.location.origin||Li(_n.pathname,p)==null}if(sn){ze?t.location.replace(Oe):t.location.assign(Oe);return}}Q=null;let Je=ze===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:st,formAction:nt,formEncType:Rt}=D.navigation;!je&&!De&&st&&nt&&Rt&&(je=f_(D.navigation));let Ge=je||De;if(Gee.has(X.response.status)&&Ge&&Cr(Ge.formMethod))await jt(Je,Ve,{submission:{...Ge,formAction:Oe},preventScrollReset:Ye||B,enableViewTransition:ie?K:void 0});else{let sn=xx(Ve,je);await jt(Je,Ve,{overrideNavigation:sn,fetcherSubmission:De,preventScrollReset:Ye||B,enableViewTransition:ie?K:void 0})}}async function qe(V,X,ie,je){let De,Ye={};try{De=await nte(m,V,X,je,ie,!1)}catch(ze){return X.filter(Oe=>Oe.shouldLoad).forEach(Oe=>{Ye[Oe.route.id]={type:"error",error:ze}}),Ye}if(V.signal.aborted)return Ye;if(!Cr(V.method))for(let ze of X){if(De[ze.route.id]?.type==="error")break;!De.hasOwnProperty(ze.route.id)&&!D.loaderData.hasOwnProperty(ze.route.id)&&(!D.errors||!D.errors.hasOwnProperty(ze.route.id))&&ze.shouldCallHandler()&&(De[ze.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ze.route.id}`)})}for(let[ze,Oe]of Object.entries(De))if(fte(Oe)){let Ve=Oe.result;Ye[ze]={type:"redirect",response:ate(Ve,V,ze,X,p)}}else Ye[ze]=await ote(Oe);return Ye}async function Ce(V,X,ie,je){let De=qe(ie,V,je,null),Ye=Promise.all(X.map(async Ve=>{if(Ve.matches&&Ve.match&&Ve.request&&Ve.controller){let st=(await qe(Ve.request,Ve.matches,je,Ve.key))[Ve.match.route.id];return{[Ve.key]:st}}else return Promise.resolve({[Ve.key]:{type:"error",error:ki(404,{pathname:Ve.path})}})})),ze=await De,Oe=(await Ye).reduce((Ve,Je)=>Object.assign(Ve,Je),{});return{loaderResults:ze,fetcherResults:Oe}}function Pe(){M=!0,se.forEach((V,X)=>{z.has(X)&&L.add(X),Wt(X)})}function At(V,X,ie={}){D.fetchers.set(V,X),it({fetchers:new Map(D.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function mn(V,X,ie,je={}){let De=ps(D.matches,X);an(V),it({errors:{[De.route.id]:ie},fetchers:new Map(D.fetchers)},{flushSync:(je&&je.flushSync)===!0})}function gn(V){return de.set(V,(de.get(V)||0)+1),ye.has(V)&&ye.delete(V),D.fetchers.get(V)||Qee}function Bn(V,X){Wt(V,X?.reason),At(V,va(null))}function an(V){let X=D.fetchers.get(V);z.has(V)&&!(X&&X.state==="loading"&&O.has(V))&&Wt(V),se.delete(V),O.delete(V),H.delete(V),ye.delete(V),L.delete(V),D.fetchers.delete(V)}function br(V){let X=(de.get(V)||0)-1;X<=0?(de.delete(V),ye.add(V)):de.set(V,X),it({fetchers:new Map(D.fetchers)})}function Wt(V,X){let ie=z.get(V);ie&&(ie.abort(X),z.delete(V))}function dr(V){for(let X of V){let ie=gn(X),je=va(ie.data);D.fetchers.set(X,je)}}function Rn(){let V=[],X=!1;for(let ie of H){let je=D.fetchers.get(ie);bt(je,`Expected fetcher: ${ie}`),je.state==="loading"&&(H.delete(ie),V.push(ie),X=!0)}return dr(V),X}function fo(V){let X=[];for(let[ie,je]of O)if(je<V){let De=D.fetchers.get(ie);bt(De,`Expected fetcher: ${ie}`),De.state==="loading"&&(Wt(ie),O.delete(ie),X.push(ie))}return dr(X),X.length>0}function Qo(V,X){let ie=D.blockers.get(V)||gd;return we.get(V)!==X&&we.set(V,X),ie}function Ma(V){D.blockers.delete(V),we.delete(V)}function Ur(V,X){let ie=D.blockers.get(V)||gd;bt(ie.state==="unblocked"&&X.state==="blocked"||ie.state==="blocked"&&X.state==="blocked"||ie.state==="blocked"&&X.state==="proceeding"||ie.state==="blocked"&&X.state==="unblocked"||ie.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${ie.state} -> ${X.state}`);let je=new Map(D.blockers);je.set(V,X),it({blockers:je})}function Wo({currentLocation:V,nextLocation:X,historyAction:ie}){if(we.size===0)return;we.size>1&&$n(!1,"A router only supports one blocker at a time");let je=Array.from(we.entries()),[De,Ye]=je[je.length-1],ze=D.blockers.get(De);if(!(ze&&ze.state==="proceeding")&&Ye({currentLocation:V,nextLocation:X,historyAction:ie}))return De}function Fi(V){let X=ki(404,{pathname:V}),ie=f||d,{matches:je,route:De}=sp(ie);return{notFoundMatches:je,route:De,error:X}}function ti(V,X,ie){if(S=V,C=X,j=ie||null,!T&&D.navigation===yx){T=!0;let je=Os(D.location,D.matches);je!=null&&it({restoreScrollPosition:je})}return()=>{S=null,C=null,j=null}}function Hi(V,X){return j&&j(V,X.map(je=>xee(je,D.loaderData)))||V.key}function fr(V,X){if(S&&C){let ie=Hi(V,X);S[ie]=C()}}function Os(V,X){if(S){let ie=Hi(V,X),je=S[ie];if(typeof je=="number")return je}return null}function Vn(V,X,ie){if(e.patchRoutesOnNavigation)if(V){if(Object.keys(V[0].params).length>0)return{active:!0,matches:wd(X,ie,p,!0)}}else return{active:!0,matches:wd(X,ie,p,!0)||[]};return{active:!1,matches:null}}async function ho(V,X,ie,je){if(!e.patchRoutesOnNavigation)return{type:"success",matches:V};let De=V;for(;;){let Ye=f==null,ze=f||d,Oe=c;try{await e.patchRoutesOnNavigation({signal:ie,path:X,matches:De,fetcherKey:je,patch:(st,nt)=>{ie.aborted||n_(st,nt,ze,Oe,s,!1)}})}catch(st){return{type:"error",error:st,partialMatches:De}}finally{Ye&&!ie.aborted&&(d=[...d])}if(ie.aborted)return{type:"aborted"};let Ve=hs(ze,X,p),Je=null;if(Ve){if(Object.keys(Ve[0].params).length===0)return{type:"success",matches:Ve};if(Je=wd(ze,X,p,!0),!(Je&&De.length<Je.length&&Yo(De,Je.slice(0,De.length))))return{type:"success",matches:Ve}}if(Je||(Je=wd(ze,X,p,!0)),!Je||Yo(De,Je))return{type:"success",matches:null};De=Je}}function Yo(V,X){return V.length===X.length&&V.every((ie,je)=>ie.route.id===X[je].route.id)}function wu(V){c={},f=Qd(V,s,void 0,c)}function ql(V,X,ie=!1){let je=f==null;n_(V,X,f||d,c,s,ie),je&&(d=[...d],it({}))}return I={get basename(){return p},get future(){return g},get state(){return D},get routes(){return d},get window(){return t},initialize:Ae,subscribe:Et,enableScrollRestoration:ti,navigate:mt,fetch:lt,revalidate:Ct,createHref:V=>e.history.createHref(V),encodeLocation:V=>e.history.encodeLocation(V),getFetcher:gn,resetFetcher:Bn,deleteFetcher:br,dispose:dt,getBlocker:Qo,deleteBlocker:Ma,patchRoutes:ql,_internalFetchControllers:z,_internalSetRoutes:wu,_internalSetStateDoNotUseOrYouWillBreakYourApp(V){it(V)}},e.unstable_instrumentations&&(I=zee(I,e.unstable_instrumentations.map(V=>V.router).filter(Boolean))),I}function Kee(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function cb(e,t,n,r,o,s){let c,d;if(o){c=[];for(let p of t)if(c.push(p),p.route.id===o){d=p;break}}else c=t,d=t[t.length-1];let f=a1(r||".",o1(c),Li(e.pathname,n)||e.pathname,s==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&d){let p=c1(f.search);if(d.route.index&&!p)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(x=>x).forEach(x=>m.append("index",x));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=Pee({basename:n,pathname:f.pathname})),Uo(f)}function e_(e,t,n){if(!n||!Kee(n))return{path:t};if(n.formMethod&&!mte(n.formMethod))return{path:t,error:ki(405,{method:n.formMethod})};let r=()=>({path:t,error:ki(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=DN(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Cr(s))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[x,S])=>`${y}${x}=${S}
|
|
215
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!Cr(s))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}bt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=fb(n.formData),f=n.formData;else if(n.body instanceof FormData)d=fb(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=s_(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=s_(d)}catch{return r()}let p={formMethod:s,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Cr(p.formMethod))return{path:t,submission:p};let m=Oa(t);return e&&m.search&&c1(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Uo(m),submission:p}}function t_(e,t,n,r,o,s,c,d,f,p,m,g,y,x,S,j,C,T,R,E,_){let k=E?di(E[1])?E[1].error:E[1].data:void 0,I=o.createURL(s.location),D=o.createURL(f),P;if(m&&s.errors){let G=Object.keys(s.errors)[0];P=c.findIndex(M=>M.route.id===G)}else if(E&&di(E[1])){let G=E[0];P=c.findIndex(M=>M.route.id===G)-1}let $=E?E[1].statusCode:void 0,B=$&&$>=400,Q={currentUrl:I,currentParams:s.matches[0]?.params||{},nextUrl:D,nextParams:c[0].params,...d,actionResult:k,actionStatus:$},K=kf(c),Z=c.map((G,M)=>{let{route:L}=G,z=null;if(P!=null&&M>P?z=!1:L.lazy?z=!0:s1(L)?m?z=ub(L,s.loaderData,s.errors):Xee(s.loaderData,s.matches[M],G)&&(z=!0):z=!1,z!==null)return db(n,r,e,K,G,p,t,z);let F=!1;typeof _=="boolean"?F=_:B?F=!1:(g||I.pathname+I.search===D.pathname+D.search||I.search!==D.search||Jee(s.matches[M],G))&&(F=!0);let Y={...Q,defaultShouldRevalidate:F},O=Td(G,Y);return db(n,r,e,K,G,p,t,O,Y,_)}),U=[];return S.forEach((G,M)=>{if(m||!c.some(de=>de.route.id===G.routeId)||x.has(M))return;let L=s.fetchers.get(M),z=L&&L.state!=="idle"&&L.data===void 0,F=hs(C,G.path,T);if(!F){if(R&&z)return;U.push({key:M,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(j.has(M))return;let Y=Ep(F,G.path),O=new AbortController,H=$c(o,G.path,O.signal),se=null;if(y.has(M))y.delete(M),se=Qc(n,r,H,F,Y,p,t);else if(z)g&&(se=Qc(n,r,H,F,Y,p,t));else{let de;typeof _=="boolean"?de=_:B?de=!1:de=g;let ye={...Q,defaultShouldRevalidate:de};Td(Y,ye)&&(se=Qc(n,r,H,F,Y,p,t,ye))}se&&U.push({key:M,routeId:G.routeId,path:G.path,matches:se,match:Y,request:H,controller:O})}),{dsMatches:Z,revalidatingFetchers:U}}function s1(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ub(e,t,n){if(e.lazy)return!0;if(!s1(e))return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function Xee(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function Jee(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Td(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function n_(e,t,n,r,o,s){let c;if(e){let p=r[e];bt(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),c=p.children}else c=n;let d=[],f=[];if(t.forEach(p=>{let m=c.find(g=>CN(p,g));m?f.push({existingRoute:m,newRoute:p}):d.push(p)}),d.length>0){let p=Qd(d,o,[e||"_","patch",String(c?.length||"0")],r);c.push(...p)}if(s&&f.length>0)for(let p=0;p<f.length;p++){let{existingRoute:m,newRoute:g}=f[p],y=m,[x]=Qd([g],o,[],{},!0);Object.assign(y,{element:x.element?x.element:y.element,errorElement:x.errorElement?x.errorElement:y.errorElement,hydrateFallbackElement:x.hydrateFallbackElement?x.hydrateFallbackElement:y.hydrateFallbackElement})}}function CN(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>t.children?.some(o=>CN(n,o))):!1}var r_=new WeakMap,EN=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(bt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let s=o.lazy[e];if(!s)return;let c=r_.get(o);c||(c={},r_.set(o,c));let d=c[e];if(d)return d;let f=(async()=>{let p=mee(e),g=o[e]!==void 0&&e!=="hasErrorBoundary";if(p)$n(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)$n(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await s();y!=null&&(Object.assign(o,{[e]:y}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(y=>y===void 0)&&(o.lazy=void 0))})();return c[e]=f,f},i_=new WeakMap;function Zee(e,t,n,r,o){let s=n[e.id];if(bt(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=i_.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{bt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),x={};for(let S in y){let j=y[S];if(j===void 0)continue;let C=vee(S),R=s[S]!==void 0&&S!=="hasErrorBoundary";C?$n(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?$n(!R,`Route "${s.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):x[S]=j}Object.assign(s,x),Object.assign(s,{...r(s),lazy:void 0})})();return i_.set(s,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],f;for(let m of c){if(o&&o.includes(m))continue;let g=EN({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(d.push(g),m===t&&(f=g))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:f}}async function o_(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,s)=>{n[t[s].route.id]=o}),n}async function ete(e){return e.matches.some(t=>t.route.middleware)?TN(e,()=>o_(e)):o_(e)}function TN(e,t){return tte(e,t,r=>{if(pte(r))throw r;return r},ute,n);function n(r,o,s){if(s)return Promise.resolve(Object.assign(s.value,{[o]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(p=>p.route.id===o),0),Math.max(c.findIndex(p=>p.shouldCallHandler()),0)),f=ps(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function tte(e,t,n,r,o){let{matches:s,request:c,params:d,context:f,unstable_pattern:p}=e,m=s.flatMap(y=>y.route.middleware?y.route.middleware.map(x=>[y.route.id,x]):[]);return await RN({request:c,params:d,context:f,unstable_pattern:p},m,t,n,r,o)}async function RN(e,t,n,r,o,s,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=t[c];if(!f)return await n();let[p,m]=f,g,y=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await RN(e,t,n,r,o,s,c+1)},g.value}catch(x){return g={value:await s(x,p,g)},g.value}};try{let x=await m(e,y),S=x!=null?r(x):void 0;return o(S)?S:g?S??g.value:(g={value:await y()},g.value)}catch(x){return await s(x,p,g)}}function _N(e,t,n,r,o){let s=EN({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=Zee(r.route,Cr(n.method)?"action":"loader",t,e,o);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function db(e,t,n,r,o,s,c,d,f=null,p){let m=!1,g=_N(e,t,n,o,s);return{...o,_lazyPromises:g,shouldLoad:d,shouldRevalidateArgs:f,shouldCallHandler(y){return m=!0,f?typeof p=="boolean"?Td(o,{...f,defaultShouldRevalidate:p}):typeof y=="boolean"?Td(o,{...f,defaultShouldRevalidate:y}):Td(o,f):d},resolve(y){let{lazy:x,loader:S,middleware:j}=o.route,C=m||d||y&&!Cr(n.method)&&(x||S),T=j&&j.length>0&&!S&&!x;return C&&(Cr(n.method)||!T)?rte({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:g?.handler,lazyRoutePromise:g?.route,handlerOverride:y,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function Qc(e,t,n,r,o,s,c,d=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:_N(e,t,n,f,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:db(e,t,n,kf(r),f,s,c,!0,d))}async function nte(e,t,n,r,o,s){n.some(p=>p._lazyPromises?.middleware)&&await Promise.all(n.map(p=>p._lazyPromises?.middleware));let c={request:t,unstable_pattern:kf(n),params:n[0].params,context:o,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:p=>{let m=c;return TN(m,()=>p({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return f}async function rte({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:s,scopedContext:c}){let d,f,p=Cr(e.method),m=p?"action":"loader",g=y=>{let x,S=new Promise((T,R)=>x=R);f=()=>x(),e.signal.addEventListener("abort",f);let j=T=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:c},...T!==void 0?[T]:[]),C=(async()=>{try{return{type:"data",result:await(s?s(R=>j(R)):j())}}catch(T){return{type:"error",result:T}}})();return Promise.race([C,S])};try{let y=p?n.route.action:n.route.loader;if(r||o)if(y){let x,[S]=await Promise.all([g(y).catch(j=>{x=j}),r,o]);if(x!==void 0)throw x;d=S}else{await r;let x=p?n.route.action:n.route.loader;if(x)[d]=await Promise.all([g(x),o]);else if(m==="action"){let S=new URL(e.url),j=S.pathname+S.search;throw ki(405,{method:e.method,pathname:j,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)d=await g(y);else{let x=new URL(e.url),S=x.pathname+x.search;throw ki(404,{pathname:S})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return d}async function ite(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function ote(e){let{result:t,type:n}=e;if(l1(t)){let r;try{r=await ite(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new Af(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?d_(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:cte(t),statusCode:Wd(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Wd(t)?t.status:void 0}:d_(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function ate(e,t,n,r,o){let s=e.headers.get("Location");if(bt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!vg(s)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);s=cb(new URL(t.url),c,o,s),e.headers.set("Location",s)}return e}function a_(e,t,n,r){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(vg(e)){let s=e,c=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(o.includes(c.protocol))throw new Error("Invalid redirect location");let d=Li(c.pathname,n)!=null;if(c.origin===t.origin&&d)return c.pathname+c.search+c.hash}try{let s=r.createURL(e);if(o.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function $c(e,t,n,r){let o=e.createURL(DN(t)).toString(),s={signal:n};if(r&&Cr(r.formMethod)){let{formMethod:c,formEncType:d}=r;s.method=c.toUpperCase(),d==="application/json"?(s.headers=new Headers({"Content-Type":d}),s.body=JSON.stringify(r.json)):d==="text/plain"?s.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?s.body=fb(r.formData):s.body=r.formData}return new Request(o,s)}function fb(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function s_(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function ste(e,t,n,r=!1,o=!1){let s={},c=null,d,f=!1,p={},m=n&&di(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let y=g.route.id,x=t[y];if(bt(!pl(x),"Cannot handle redirect results in processLoaderData"),di(x)){let S=x.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},o)c[y]=S;else{let j=ps(e,y);c[j.route.id]==null&&(c[j.route.id]=S)}r||(s[y]=jN),f||(f=!0,d=Wd(x.error)?x.error.status:500),x.headers&&(p[y]=x.headers)}else s[y]=x.data,x.statusCode&&x.statusCode!==200&&!f&&(d=x.statusCode),x.headers&&(p[y]=x.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:c,statusCode:d||200,loaderHeaders:p}}function l_(e,t,n,r,o,s){let{loaderData:c,errors:d}=ste(t,n,r);return o.filter(f=>!f.matches||f.matches.some(p=>p.shouldLoad)).forEach(f=>{let{key:p,match:m,controller:g}=f;if(g&&g.signal.aborted)return;let y=s[p];if(bt(y,"Did not find corresponding fetcher result"),di(y)){let x=ps(e.matches,m?.route.id);d&&d[x.route.id]||(d={...d,[x.route.id]:y.error}),e.fetchers.delete(p)}else if(pl(y))bt(!1,"Unhandled fetcher revalidation redirect");else{let x=va(y.data);e.fetchers.set(p,x)}}),{loaderData:c,errors:d}}function c_(e,t,n,r){let o=Object.entries(t).filter(([,s])=>s!==jN).reduce((s,[c,d])=>(s[c]=d,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(o[c]=e[c]),r&&r.hasOwnProperty(c))break}return o}function u_(e){return e?di(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ps(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 sp(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 ki(e,{pathname:t,routeId:n,method:r,type:o,message:s}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:o==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new Af(e||500,c,new Error(d),!0)}function lp(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(pl(o))return{key:r,result:o}}}function DN(e){let t=typeof e=="string"?Oa(e):e;return Uo({...t,hash:""})}function lte(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function cte(e){return new Af(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function ute(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&dte(n))}function dte(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function fte(e){return l1(e.result)&&SN.has(e.result.status)}function di(e){return e.type==="error"}function pl(e){return(e&&e.type)==="redirect"}function d_(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function l1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function hte(e){return SN.has(e)}function pte(e){return l1(e)&&hte(e.status)&&e.headers.has("Location")}function mte(e){return qee.has(e.toUpperCase())}function Cr(e){return Fee.has(e.toUpperCase())}function c1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ep(e,t){let n=typeof t=="string"?Oa(t).search:t.search;if(e[e.length-1].route.index&&c1(n||""))return e[e.length-1];let r=gN(e);return r[r.length-1]}function f_(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:s,json:c}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function xx(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 gte(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 vd(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 vte(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 va(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 yte(e,t){try{let n=e.sessionStorage.getItem(wN);if(n){let r=JSON.parse(n);for(let[o,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(o,new Set(s||[]))}}catch{}}function xte(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(wN,JSON.stringify(n))}catch(r){$n(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function h_(){let e,t,n=new Promise((r,o)=>{e=async s=>{r(s);try{await n}catch{}},t=async s=>{o(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Hl=v.createContext(null);Hl.displayName="DataRouter";var Pf=v.createContext(null);Pf.displayName="DataRouterState";var AN=v.createContext(!1);function bte(){return v.useContext(AN)}var u1=v.createContext({isTransitioning:!1});u1.displayName="ViewTransition";var kN=v.createContext(new Map);kN.displayName="Fetchers";var Ste=v.createContext(null);Ste.displayName="Await";var Vi=v.createContext(null);Vi.displayName="Navigation";var Nf=v.createContext(null);Nf.displayName="Location";var uo=v.createContext({outlet:null,matches:[],isDataRoute:!1});uo.displayName="Route";var d1=v.createContext(null);d1.displayName="RouteError";var PN="REACT_ROUTER_ERROR",wte="REDIRECT",jte="ROUTE_ERROR_RESPONSE";function Cte(e){if(e.startsWith(`${PN}:${wte}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Ete(e){if(e.startsWith(`${PN}:${jte}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Af(t.status,t.statusText,t.data)}catch{}}function Tte(e,{relative:t}={}){bt(Of(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Vi),{hash:o,pathname:s,search:c}=Mf(e,{relative:t}),d=s;return n!=="/"&&(d=s==="/"?n:Oo([n,s])),r.createHref({pathname:d,search:c,hash:o})}function Of(){return v.useContext(Nf)!=null}function vi(){return bt(Of(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Nf).location}var NN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ON(e){v.useContext(Vi).static||v.useLayoutEffect(e)}function Yn(){let{isDataRoute:e}=v.useContext(uo);return e?Bte():Rte()}function Rte(){bt(Of(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Hl),{basename:t,navigator:n}=v.useContext(Vi),{matches:r}=v.useContext(uo),{pathname:o}=vi(),s=JSON.stringify(o1(r)),c=v.useRef(!1);return ON(()=>{c.current=!0}),v.useCallback((f,p={})=>{if($n(c.current,NN),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=a1(f,JSON.parse(s),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Oo([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,o,e])}var _te=v.createContext(null);function Dte(e){let t=v.useContext(uo).outlet;return v.useMemo(()=>t&&v.createElement(_te.Provider,{value:e},t),[t,e])}function Ht(){let{matches:e}=v.useContext(uo),t=e[e.length-1];return t?t.params:{}}function Mf(e,{relative:t}={}){let{matches:n}=v.useContext(uo),{pathname:r}=vi(),o=JSON.stringify(o1(n));return v.useMemo(()=>a1(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function Ate(e,t){return MN(e,t)}function MN(e,t,n,r,o){bt(Of(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(Vi),{matches:c}=v.useContext(uo),d=c[c.length-1],f=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let R=g&&g.path||"";IN(p,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${R}">) 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.
|
|
216
|
-
|
|
217
|
-
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=vi(),x;if(t){let R=typeof t=="string"?Oa(t):t;bt(m==="/"||R.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${R.pathname}" was given in the \`location\` prop.`),x=R}else x=y;let S=x.pathname||"/",j=S;if(m!=="/"){let R=m.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(R.length).join("/")}let C=hs(e,{pathname:j});$n(g||C!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),$n(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 "${x.pathname}${x.search}${x.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 T=Mte(C&&C.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Oo([m,s.encodeLocation?s.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:Oo([m,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,n,r,o);return t&&T?v.createElement(Nf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},T):T}function kte(){let e=Ute(),t=Wd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:s},"ErrorBoundary")," or"," ",v.createElement("code",{style:s},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:o},n):null,c)}var Pte=v.createElement(kte,null),LN=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Ete(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(uo.Provider,{value:this.props.routeContext},v.createElement(d1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(Nte,{error:e},t):t}};LN.contextType=AN;var bx=new WeakMap;function Nte({children:e,error:t}){let{basename:n}=v.useContext(Vi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Cte(t.digest);if(r){let o=bx.get(t);if(o)throw o;let s=yN(r.location,n);if(vN&&!bx.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw bx.set(t,c),c}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function Ote({routeContext:e,match:t,children:n}){let r=v.useContext(Hl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(uo.Provider,{value:e},n)}function Mte(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,c=n?.errors;if(c!=null){let m=s.findIndex(g=>g.route.id&&c?.[g.route.id]!==void 0);bt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let d=!1,f=-1;if(n)for(let m=0;m<s.length;m++){let g=s[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=m),g.route.id){let{loaderData:y,errors:x}=n,S=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!x||x[g.route.id]===void 0);if(g.route.lazy||S){d=!0,f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}let p=n&&r?(m,g)=>{r(m,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:kf(n.matches),errorInfo:g})}:void 0;return s.reduceRight((m,g,y)=>{let x,S=!1,j=null,C=null;n&&(x=c&&g.route.id?c[g.route.id]:void 0,j=g.route.errorElement||Pte,d&&(f<0&&y===0?(IN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):f===y&&(S=!0,C=g.route.hydrateFallbackElement||null)));let T=t.concat(s.slice(0,y+1)),R=()=>{let E;return x?E=j:S?E=C:g.route.Component?E=v.createElement(g.route.Component,null):g.route.element?E=g.route.element:E=m,v.createElement(Ote,{match:g,routeContext:{outlet:m,matches:T,isDataRoute:n!=null},children:E})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?v.createElement(LN,{location:n.location,revalidation:n.revalidation,component:j,error:x,children:R(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:p}):R()},null)}function f1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lte(e){let t=v.useContext(Hl);return bt(t,f1(e)),t}function Ite(e){let t=v.useContext(Pf);return bt(t,f1(e)),t}function zte(e){let t=v.useContext(uo);return bt(t,f1(e)),t}function h1(e){let t=zte(e),n=t.matches[t.matches.length-1];return bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $te(){return h1("useRouteId")}function Ute(){let e=v.useContext(d1),t=Ite("useRouteError"),n=h1("useRouteError");return e!==void 0?e:t.errors?.[n]}function Bte(){let{router:e}=Lte("useNavigate"),t=h1("useNavigate"),n=v.useRef(!1);return ON(()=>{n.current=!0}),v.useCallback(async(o,s={})=>{$n(n.current,NN),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var p_={};function IN(e,t,n){!t&&!p_[e]&&(p_[e]=!0,$n(!1,n))}var m_={};function g_(e,t){!e&&!m_[t]&&(m_[t]=!0,console.warn(t))}var Vte="useOptimistic",v_=jb[Vte],Fte=()=>{};function Hte(e){return v_?v_(e):[e,Fte]}function qte(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&$n(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&$n(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&$n(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Gte=["HydrateFallback","hydrateFallbackElement"],Qte=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 Wte({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=bte()||r;let[s,c]=v.useState(e.state),[d,f]=Hte(s),[p,m]=v.useState(),[g,y]=v.useState({isTransitioning:!1}),[x,S]=v.useState(),[j,C]=v.useState(),[T,R]=v.useState(),E=v.useRef(new Map),_=v.useCallback((P,{deletedFetchers:$,newErrors:B,flushSync:Q,viewTransitionOpts:K})=>{B&&n&&Object.values(B).forEach(U=>n(U,{location:P.location,params:P.matches[0]?.params??{},unstable_pattern:kf(P.matches)})),P.fetchers.forEach((U,G)=>{U.data!==void 0&&E.current.set(G,U.data)}),$.forEach(U=>E.current.delete(U)),g_(Q===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Z=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(g_(K==null||Z,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!K||!Z){t&&Q?t(()=>c(P)):r===!1?c(P):v.startTransition(()=>{r===!0&&f(U=>y_(U,P)),c(P)});return}if(t&&Q){t(()=>{j&&(x?.resolve(),j.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:K.currentLocation,nextLocation:K.nextLocation})});let U=e.window.document.startViewTransition(()=>{t(()=>c(P))});U.finished.finally(()=>{t(()=>{S(void 0),C(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>C(U));return}j?(x?.resolve(),j.skipTransition(),R({state:P,currentLocation:K.currentLocation,nextLocation:K.nextLocation})):(m(P),y({isTransitioning:!0,flushSync:!1,currentLocation:K.currentLocation,nextLocation:K.nextLocation}))},[e.window,t,j,x,r,f,n]);v.useLayoutEffect(()=>e.subscribe(_),[e,_]),v.useEffect(()=>{g.isTransitioning&&!g.flushSync&&S(new Qte)},[g]),v.useEffect(()=>{if(x&&p&&e.window){let P=p,$=x.promise,B=e.window.document.startViewTransition(async()=>{r===!1?c(P):v.startTransition(()=>{r===!0&&f(Q=>y_(Q,P)),c(P)}),await $});B.finished.finally(()=>{S(void 0),C(void 0),m(void 0),y({isTransitioning:!1})}),C(B)}},[p,x,e.window,r,f]),v.useEffect(()=>{x&&p&&d.location.key===p.location.key&&x.resolve()},[x,j,d.location,p]),v.useEffect(()=>{!g.isTransitioning&&T&&(m(T.state),y({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),R(void 0))},[g.isTransitioning,T]);let k=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,$,B)=>e.navigate(P,{state:$,preventScrollReset:B?.preventScrollReset}),replace:(P,$,B)=>e.navigate(P,{replace:!0,state:$,preventScrollReset:B?.preventScrollReset})}),[e]),I=e.basename||"/",D=v.useMemo(()=>({router:e,navigator:k,static:!1,basename:I,onError:n}),[e,k,I,n]);return v.createElement(v.Fragment,null,v.createElement(Hl.Provider,{value:D},v.createElement(Pf.Provider,{value:d},v.createElement(kN.Provider,{value:E.current},v.createElement(u1.Provider,{value:g},v.createElement(Xte,{basename:I,location:d.location,navigationType:d.historyAction,navigator:k,unstable_useTransitions:r},v.createElement(Yte,{routes:e.routes,future:e.future,state:d,onError:n})))))),null)}function y_(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var Yte=v.memo(Kte);function Kte({routes:e,future:t,state:n,onError:r}){return MN(e,void 0,n,r,t)}function p1(e){return Dte(e.context)}function Fe(e){bt(!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 Xte({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1,unstable_useTransitions:c}){bt(!Of(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:o,static:s,unstable_useTransitions:c,future:{}}),[d,o,s,c]);typeof n=="string"&&(n=Oa(n));let{pathname:p="/",search:m="",hash:g="",state:y=null,key:x="default"}=n,S=v.useMemo(()=>{let j=Li(p,d);return j==null?null:{location:{pathname:j,search:m,hash:g,state:y,key:x},navigationType:r}},[d,p,m,g,y,x,r]);return $n(S!=null,`<Router basename="${d}"> is not able to match the URL "${p}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:v.createElement(Vi.Provider,{value:f},v.createElement(Nf.Provider,{children:t,value:S}))}function Jte({children:e,location:t}){return Ate(hb(e),t)}function hb(e,t=[]){let n=[];return v.Children.forEach(e,(r,o)=>{if(!v.isValidElement(r))return;let s=[...t,o];if(r.type===v.Fragment){n.push.apply(n,hb(r.props.children,s));return}bt(r.type===Fe,`[${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>`),bt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,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=hb(r.props.children,s)),n.push(c)}),n}var Tp="get",Rp="application/x-www-form-urlencoded";function yg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Zte(e){return yg(e)&&e.tagName.toLowerCase()==="button"}function ene(e){return yg(e)&&e.tagName.toLowerCase()==="form"}function tne(e){return yg(e)&&e.tagName.toLowerCase()==="input"}function nne(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rne(e,t){return e.button===0&&(!t||t==="_self")&&!nne(e)}function pb(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function ine(e,t){let n=pb(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}var cp=null;function one(){if(cp===null)try{new FormData(document.createElement("form"),0),cp=!1}catch{cp=!0}return cp}var ane=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sx(e){return e!=null&&!ane.has(e)?($n(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rp}"`),null):e}function sne(e,t){let n,r,o,s,c;if(ene(e)){let d=e.getAttribute("action");r=d?Li(d,t):null,n=e.getAttribute("method")||Tp,o=Sx(e.getAttribute("enctype"))||Rp,s=new FormData(e)}else if(Zte(e)||tne(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(r=f?Li(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Tp,o=Sx(e.getAttribute("formenctype"))||Sx(d.getAttribute("enctype"))||Rp,s=new FormData(d,e),!one()){let{name:p,type:m,value:g}=e;if(m==="image"){let y=p?`${p}.`:"";s.append(`${y}x`,"0"),s.append(`${y}y`,"0")}else p&&s.append(p,g)}}else{if(yg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Tp,r=null,o=Rp,c=e}return s&&o==="text/plain"&&(c=s,s=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function m1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function lne(e,t,n,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:t&&Li(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${r}`,o}async function cne(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 une(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 dne(e,t,n){let r=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let c=await cne(s,n);return c.links?c.links():[]}return[]}));return mne(r.flat(1).filter(une).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function x_(e,t,n,r,o,s){let c=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,d=(f,p)=>n[p].pathname!==f.pathname||n[p].route.path?.endsWith("*")&&n[p].params["*"]!==f.params["*"];return s==="assets"?t.filter((f,p)=>c(f,p)||d(f,p)):s==="data"?t.filter((f,p)=>{let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,p)||d(f,p))return!0;if(f.route.shouldRevalidate){let g=f.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function fne(e,t,{includeHydrateFallback:n}={}){return hne(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function hne(e){return[...new Set(e)]}function pne(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function mne(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let s=JSON.stringify(pne(o));return n.has(s)||(n.add(s),r.push({key:s,link:o})),r},[])}function zN(){let e=v.useContext(Hl);return m1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gne(){let e=v.useContext(Pf);return m1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var g1=v.createContext(void 0);g1.displayName="FrameworkContext";function $N(){let e=v.useContext(g1);return m1(e,"You must render this element inside a <HydratedRouter> element"),e}function vne(e,t){let n=v.useContext(g1),[r,o]=v.useState(!1),[s,c]=v.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=T=>{T.forEach(R=>{c(R.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(r){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[r]);let x=()=>{o(!0)},S=()=>{o(!1),c(!1)};return n?e!=="intent"?[s,y,{}]:[s,y,{onFocus:yd(d,x),onBlur:yd(f,S),onMouseEnter:yd(p,x),onMouseLeave:yd(m,S),onTouchStart:yd(g,x)}]:[!1,y,{}]}function yd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yne({page:e,...t}){let{router:n}=zN(),r=v.useMemo(()=>hs(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(bne,{page:e,matches:r,...t}):null}function xne(e){let{manifest:t,routeModules:n}=$N(),[r,o]=v.useState([]);return v.useEffect(()=>{let s=!1;return dne(e,t,n).then(c=>{s||o(c)}),()=>{s=!0}},[e,t,n]),r}function bne({page:e,matches:t,...n}){let r=vi(),{future:o,manifest:s,routeModules:c}=$N(),{basename:d}=zN(),{loaderData:f,matches:p}=gne(),m=v.useMemo(()=>x_(e,t,p,s,r,"data"),[e,t,p,s,r]),g=v.useMemo(()=>x_(e,t,p,s,r,"assets"),[e,t,p,s,r]),y=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let j=new Set,C=!1;if(t.forEach(R=>{let E=s.routes[R.route.id];!E||!E.hasLoader||(!m.some(_=>_.route.id===R.route.id)&&R.route.id in f&&c[R.route.id]?.shouldRevalidate||E.hasClientLoader?C=!0:j.add(R.route.id))}),j.size===0)return[];let T=lne(e,d,o.unstable_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&T.searchParams.set("_routes",t.filter(R=>j.has(R.route.id)).map(R=>R.route.id).join(",")),[T.pathname+T.search]},[d,o.unstable_trailingSlashAwareDataRequests,f,r,s,m,t,e,c]),x=v.useMemo(()=>fne(g,s),[g,s]),S=xne(g);return v.createElement(v.Fragment,null,y.map(j=>v.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),x.map(j=>v.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),S.map(({key:j,link:C})=>v.createElement("link",{key:j,nonce:n.nonce,...C})))}function Sne(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var wne=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wne&&(window.__reactRouterVersion="7.12.0")}catch{}function jne(e,t){return Yee({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:dee({window:t?.window}),hydrationData:Cne(),routes:e,mapRouteProperties:qte,hydrationRouteProperties:Gte,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Cne(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Ene(e.errors)}),e}function Ene(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Af(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let c=new s(o.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let s=new Error(o.message);s.stack="",n[r]=s}}else n[r]=o;return n}var UN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,BN=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:s,replace:c,state:d,target:f,to:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:y,...x},S){let{basename:j,unstable_useTransitions:C}=v.useContext(Vi),T=typeof p=="string"&&UN.test(p),R=yN(p,j);p=R.to;let E=Tte(p,{relative:o}),[_,k,I]=vne(r,x),D=Dne(p,{replace:c,state:d,target:f,preventScrollReset:m,relative:o,viewTransition:g,unstable_defaultShouldRevalidate:y,unstable_useTransitions:C});function P(B){t&&t(B),B.defaultPrevented||D(B)}let $=v.createElement("a",{...x,...I,href:R.absoluteURL||E,onClick:R.isExternal||s?t:P,ref:Sne(S,k),target:f,"data-discover":!T&&n==="render"?"true":void 0});return _&&!T?v.createElement(v.Fragment,null,$,v.createElement(yne,{page:E})):$});BN.displayName="Link";var Tne=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:s,to:c,viewTransition:d,children:f,...p},m){let g=Mf(c,{relative:p.relative}),y=vi(),x=v.useContext(Pf),{navigator:S,basename:j}=v.useContext(Vi),C=x!=null&&One(g)&&d===!0,T=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,R=y.pathname,E=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(R=R.toLowerCase(),E=E?E.toLowerCase():null,T=T.toLowerCase()),E&&j&&(E=Li(E,j)||E);const _=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let k=R===T||!o&&R.startsWith(T)&&R.charAt(_)==="/",I=E!=null&&(E===T||!o&&E.startsWith(T)&&E.charAt(T.length)==="/"),D={isActive:k,isPending:I,isTransitioning:C},P=k?t:void 0,$;typeof r=="function"?$=r(D):$=[r,k?"active":null,I?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let B=typeof s=="function"?s(D):s;return v.createElement(BN,{...p,"aria-current":P,className:$,ref:m,style:B,to:c,viewTransition:d},typeof f=="function"?f(D):f)});Tne.displayName="NavLink";var Rne=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:c=Tp,action:d,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:y,...x},S)=>{let{unstable_useTransitions:j}=v.useContext(Vi),C=Pne(),T=Nne(d,{relative:p}),R=c.toLowerCase()==="get"?"get":"post",E=typeof d=="string"&&UN.test(d),_=k=>{if(f&&f(k),k.defaultPrevented)return;k.preventDefault();let I=k.nativeEvent.submitter,D=I?.getAttribute("formmethod")||c,P=()=>C(I||k.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:o,state:s,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:y});j&&n!==!1?v.startTransition(()=>P()):P()};return v.createElement("form",{ref:S,method:R,action:T,onSubmit:r?f:_,...x,"data-discover":!E&&e==="render"?"true":void 0})});Rne.displayName="Form";function _ne(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function VN(e){let t=v.useContext(Hl);return bt(t,_ne(e)),t}function Dne(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:f}={}){let p=Yn(),m=vi(),g=Mf(e,{relative:s});return v.useCallback(y=>{if(rne(y,t)){y.preventDefault();let x=n!==void 0?n:Uo(m)===Uo(g),S=()=>p(e,{replace:x,state:r,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:d});f?v.startTransition(()=>S()):S()}},[m,p,g,n,r,t,e,o,s,c,d,f])}function xg(e){$n(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(pb(e)),n=v.useRef(!1),r=vi(),o=v.useMemo(()=>ine(r.search,n.current?null:t.current),[r.search]),s=Yn(),c=v.useCallback((d,f)=>{const p=pb(typeof d=="function"?d(new URLSearchParams(o)):d);n.current=!0,s("?"+p,f)},[s,o]);return[o,c]}var Ane=0,kne=()=>`__${String(++Ane)}__`;function Pne(){let{router:e}=VN("useSubmit"),{basename:t}=v.useContext(Vi),n=$te(),r=e.fetch,o=e.navigate;return v.useCallback(async(s,c={})=>{let{action:d,method:f,encType:p,formData:m,body:g}=sne(s,t);if(c.navigate===!1){let y=c.fetcherKey||kne();await r(y,n,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:g,formMethod:c.method||f,formEncType:c.encType||p,flushSync:c.flushSync})}else await o(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:g,formMethod:c.method||f,formEncType:c.encType||p,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,o,t,n])}function Nne(e,{relative:t}={}){let{basename:n}=v.useContext(Vi),r=v.useContext(uo);bt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Mf(e||".",{relative:t})},c=vi();if(e==null){s.search=c.search;let d=new URLSearchParams(s.search),f=d.getAll("index");if(f.some(m=>m==="")){d.delete("index"),f.filter(g=>g).forEach(g=>d.append("index",g));let m=d.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Oo([n,s.pathname])),Uo(s)}function One(e,{relative:t}={}){let n=v.useContext(u1);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=VN("useViewTransitionState"),o=Mf(e,{relative:t});if(!n.isTransitioning)return!1;let s=Li(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Li(n.nextLocation.pathname,r)||n.nextLocation.pathname;return tm(o.pathname,c)!=null||tm(o.pathname,s)!=null}function v1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function Mne(e){if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return e.specimen?.[0]}function Ps(e){return Sl(e.getActiveLogin()?.project)}function bg(e){const t=Re(),n=Ps(t),r=Yn(),[o,s]=v.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:he.EQUALS,value:"Project/"+n},{code:"profile-type",operator:he.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(Su,{search:o,onClick:c=>r(`/admin/members/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})}function Lne(){return a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"Bots"}),a.jsx(bg,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/bots/new",children:"Create new bot"})})]})}function Ine(){return a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"Clients"}),a.jsx(bg,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/clients/new",children:"Create new client"})})]})}function Sg(e){return a.jsx(Vl,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{qo(t)?e.onChange(Yt(t)):e.onChange(void 0)}})}function zne(){const e=Re(),t=Ps(e),[n,r]=v.useState(""),[o,s]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"Create new Bot"}),a.jsxs(pt,{onSubmit:()=>{const y={name:n,description:o,accessPolicy:c};e.post("admin/projects/"+t+"/bot",y).then(x=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(x),ke({color:"green",message:"Bot created"})}).catch(x=>{ke({color:"red",message:Qe(x),autoClose:!1}),p(Qt(x))})},children:[!m&&a.jsxs(Me,{children:[a.jsx(zt,{title:"Name",htmlFor:"name",outcome:f,children:a.jsx(He,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:y=>r(y.currentTarget.value),error:$t(f,"name")})}),a.jsx(zt,{title:"Description",htmlFor:"description",outcome:f,children:a.jsx(He,{id:"description",name:"description",onChange:y=>s(y.currentTarget.value),error:$t(f,"description")})}),a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(Sg,{name:"accessPolicy",onChange:d})}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ne,{type:"submit",children:"Create Bot"})})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(be,{children:"Bot created"}),a.jsxs(Or,{children:[a.jsx(Or.Item,{children:a.jsx(St,{to:m,children:"Go to new bot"})}),a.jsx(Or.Item,{children:a.jsx(St,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function $ne(){const e=Re(),t=Ps(e),[n,r]=v.useState(""),[o,s]=v.useState(""),[c,d]=v.useState(""),[f,p]=v.useState(),[m,g]=v.useState(),[y,x]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"Create new Client"}),a.jsxs(pt,{onSubmit:()=>{const S={name:n,description:o,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",S).then(j=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),x(j),ke({color:"green",message:"Client created"})}).catch(j=>{ke({color:"red",message:Qe(j),autoClose:!1}),g(Qt(j))})},children:[!y&&a.jsxs(Me,{children:[a.jsx(zt,{title:"Name",htmlFor:"name",outcome:m,children:a.jsx(He,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:S=>r(S.currentTarget.value),error:$t(m,"name")})}),a.jsx(zt,{title:"Description",htmlFor:"description",outcome:m,children:a.jsx(He,{id:"description",name:"description",onChange:S=>s(S.currentTarget.value),error:$t(m,"description")})}),a.jsx(zt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:a.jsx(He,{id:"redirectUri",name:"redirectUri",onChange:S=>d(S.currentTarget.value),error:$t(m,"redirectUri")})}),a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:a.jsx(Sg,{name:"accessPolicy",onChange:p})}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ne,{type:"submit",children:"Create Client"})})]}),y&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(be,{children:"Client created"}),a.jsxs(Or,{children:[a.jsx(Or.Item,{children:a.jsx(St,{to:y,children:"Go to new client"})}),a.jsx(Or.Item,{children:a.jsx(St,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}const Une=8;function FN({inputProps:e,data:t,onChange:n}){const r=Il({onDropdownClose:()=>r.resetSelectedOption()}),[o,s]=v.useState(null),[c,d]=v.useState(""),f=v.useMemo(()=>t.filter(m=>m.toLowerCase().includes(c.toLowerCase().trim())),[t,c]),p=v.useMemo(()=>{const m=new Array(Math.min(f.length,Une));for(let g=0;g<m.length;g++){const y=f[g];m[g]=a.jsx(Ke.Option,{value:y,children:y},y)}return m},[f]);return a.jsxs(Ke,{store:r,withinPortal:!1,onOptionSubmit:m=>{n&&n(m),s(m),d(m),r.closeDropdown()},children:[a.jsx(Ke.Target,{children:a.jsx($r,{rightSection:a.jsx(Ke.Chevron,{}),value:c,onChange:m=>{r.openDropdown(),r.updateSelectedOptionIndex(),d(m.currentTarget.value)},onClick:()=>r.openDropdown(),onFocus:()=>r.openDropdown(),onBlur:()=>{r.closeDropdown(),d(o||"")},rightSectionPointerEvents:"none",...e})}),a.jsx(Ke.Dropdown,{children:a.jsx(Ke.Options,{children:p.length>0?p:a.jsx(Ke.Empty,{children:"Nothing found"})})})]})}function Bne(e){let t=[];for(const n of e)t.push(n),t.push(n+"_History"),t.push(n+"_References");return t.push("Address"),t.push("ContactPoint"),t.push("HumanName"),t.push("Coding"),t.push("Coding_Property"),t.push("DatabaseMigration"),t=nu(t),t}function HN(e){return typeof e=="string"?e.length>50?e.substring(0,50)+"...":e:typeof e=="boolean"?e.toString().toLocaleUpperCase():e}const qN=({medplum:e,onChange:t,onError:n})=>{v.useEffect(()=>{async function r(){return(await e.valueSetExpand({url:"https://medplum.com/fhir/ValueSet/resource-types",count:200})).expansion?.contains?.map(s=>s.code).filter(s=>s!==void 0)??[]}r().then(o=>{t(Bne(o))}).catch(o=>{n?n(o):console.error(o)})},[e,t,n])};function Vne(){const e=Re(),[t,{open:n,close:r}]=Pl(!1),[o,s]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(void 0),[m,g]=v.useState(0),[y,x]=v.useState(!1),[S,j]=v.useState([]),[C,T]=v.useState([]),[R,E]=v.useState(!1),[_,k]=v.useState(void 0),[I,D]=v.useState([]),[P,$]=v.useState(0),[B,Q]=v.useState(!1),[K,Z]=v.useState(!1);qN({medplum:e,onChange:D}),v.useEffect(()=>{x(!0),e.get("fhir/R4/$db-column-statistics?tableName="+encodeURIComponent(f??""),{cache:"no-cache"}).then(L=>{const z=L.parameter?.find(O=>O.name==="defaultStatisticsTarget")?.valueInteger??0;g(z);const Y=L.parameter?.find(O=>O.name==="table")?.part?.filter(O=>O.name==="column");j(Y??[])}).finally(()=>{x(!1)}).catch(L=>{ke({color:"red",message:L.message})})},[e,f,P]);function U(){if(f){if(C.length===0){ke({color:"red",message:"No columns selected",autoClose:!0});return}ke({title:"Submit",message:JSON.stringify({resetToDefault:R,newStatisticsTarget:_,selectedRowNames:C}),autoClose:!0}),e.post("fhir/R4/$db-configure-column-statistics",{tableName:f,columnNames:C,resetToDefault:R,newStatisticsTarget:R?void 0:_}).then(L=>{ke({color:"green",message:"Done"}),$(z=>z+1)}).catch(L=>ke({color:"red",message:Qe(L),autoClose:!1}))}}const G={onClick:L=>{s("Details"),d(a.jsx("pre",{children:L})),n()}};let M=0;return a.jsxs(pt,{onSubmit:U,children:[a.jsxs(Me,{gap:"sm",children:[a.jsxs(xe,{children:[a.jsx(FN,{data:I,inputProps:{placeholder:"Table name",inputSize:"50"},onChange:L=>{p(L),T([])}}),a.jsx(Ne,{loading:y,onClick:()=>$(L=>L+1),children:"Refresh"})]}),a.jsxs(xe,{children:[a.jsx(be,{span:!0,fw:700,children:"Statistics Target:"}),a.jsx(bl,{value:R?"":_,disabled:R,required:!R,size:"sm",w:"100",min:0,step:100,max:1e4,onChange:L=>{typeof L=="number"&&k(L)}}),a.jsx(be,{span:!0,fw:700,c:"dimmed",children:"– or –"}),a.jsx(un,{checked:R,onChange:L=>E(L.currentTarget.checked),label:"Reset to default ("+m+")",size:"sm"}),a.jsx(cr,{size:"sm",children:"Update"})]}),a.jsx(xe,{children:a.jsx(un,{checked:K,onChange:L=>Z(L.currentTarget.checked),label:"Hide columns with default statistics target",size:"sm"})}),a.jsx(xe,{children:a.jsx(un,{checked:B,onChange:L=>Q(L.currentTarget.checked),label:"Show all column stats",size:"sm"})}),a.jsx(ee.ScrollContainer,{minWidth:500,children:a.jsxs(ee,{striped:!0,highlightOnHover:!0,children:[a.jsx(ee.Thead,{children:a.jsxs(ee.Tr,{children:[a.jsx(ee.Th,{children:a.jsx(un,{size:"sm",checked:S.length>0&&C.length===S.length,indeterminate:C.length>0&&C.length<S.length,onChange:()=>{C.length===S.length?T([]):T(S.map(L=>L.part?.find(z=>z.name==="name")?.valueString??""))}})}),a.jsx(ee.Th,{children:"Column"}),a.jsx(ee.Th,{children:"Statistics Target"}),a.jsx(ee.Th,{children:"null_frac"}),a.jsx(ee.Th,{children:"avg_width"}),a.jsx(ee.Th,{children:"n_distinct"}),a.jsx(ee.Th,{children:"correlation"}),B&&a.jsxs(a.Fragment,{children:[a.jsx(ee.Th,{children:"most_common_vals"}),a.jsx(ee.Th,{children:"most_common_freqs"}),a.jsx(ee.Th,{children:"histogram_bounds"}),a.jsx(ee.Th,{children:"most_common_elems"}),a.jsx(ee.Th,{children:"most_common_elem_freqs"}),a.jsx(ee.Th,{children:"elem_count_histogram"})]})]})}),a.jsxs(ee.Tbody,{children:[S?.map(L=>{const z=L.part??[],F=z.find(O=>O.name==="name")?.valueString,Y=z.find(O=>O.name==="statisticsTarget")?.valueInteger;if(Y===-1&&(M++,K))return null;if(!F)throw new Error("Column missing name",{cause:L});return a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:a.jsx(un,{size:"sm",checked:C.includes(F),onChange:O=>{T(O.currentTarget.checked?[...C,F]:C.filter(H=>H!==F))}})}),a.jsx(ee.Td,{children:F}),a.jsx(ee.Td,{children:Y===-1?a.jsxs(be,{span:!0,c:"dimmed",fs:"italic",children:["default (",m,")"]}):Y}),a.jsx(xo,{value:z.find(O=>O.name==="nullFraction")?.valueDecimal,...G}),a.jsx(xo,{value:z.find(O=>O.name==="avgWidth")?.valueInteger,...G}),a.jsx(xo,{value:z.find(O=>O.name==="nDistinct")?.valueDecimal,...G}),a.jsx(xo,{value:z.find(O=>O.name==="correlation")?.valueDecimal,...G}),B&&a.jsxs(a.Fragment,{children:[a.jsx(xo,{value:z.find(O=>O.name==="mostCommonValues")?.valueString,...G}),a.jsx(xo,{value:z.find(O=>O.name==="mostCommonFreqs")?.valueString,...G}),a.jsx(xo,{value:z.find(O=>O.name==="histogramBounds")?.valueString,...G}),a.jsx(xo,{value:z.find(O=>O.name==="mostCommonElems")?.valueString,...G}),a.jsx(xo,{value:z.find(O=>O.name==="mostCommonElemFreqs")?.valueString,...G}),a.jsx(xo,{value:z.find(O=>O.name==="elemCountHistogram")?.valueString,...G})]})]},F)}),K&&a.jsx(ee.Tr,{children:a.jsx(ee.Td,{colSpan:B?13:7,children:a.jsxs(be,{c:"dimmed",fs:"italic",children:[M," hidden columns with default statistics target"]})})})]})]})})]}),a.jsx(Ln,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function xo({value:e,onClick:t}){return a.jsx(ee.Td,{style:{cursor:"pointer"},onClick:()=>t?.(e),children:Fne(e)})}function Fne(e){return typeof e=="string"&&e.length>30?e.substring(0,30)+"...":e}function y1(e,t,n,r){const o=Date.now().toString();ke({id:o,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const s={method:"POST",pollStatusOnAccepted:!0};return r&&(s.body=JSON.stringify(r)),e.startAsyncRequest(n,s).then(c=>{let d="Done";return c.resourceType==="AsyncJob"?d=a.jsx(St,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&c.issue?.[0]?.details?.text&&(d=a.jsx(be,{children:c.issue[0].details.text})),Pi.update({id:o,color:"green",title:t,message:d,icon:a.jsx(Go,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw Pi.update({id:o,color:"red",title:t,message:Qe(c),icon:a.jsx(El,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function Lc(e,t,n,r){y1(e,t,n,r).catch(()=>{})}const Hne=8;function qne({pillInputProps:e,inputProps:t,data:n,onChange:r}){const o=Il({onDropdownClose:()=>o.resetSelectedOption(),onDropdownOpen:()=>o.updateSelectedOptionIndex("active")}),[s,c]=v.useState(""),[d,f]=v.useState([]),p=S=>{const j=d.includes(S)?d.filter(C=>C!==S):[...d,S];f(j),r&&r(j)},m=S=>f(j=>j.filter(C=>C!==S)),g=v.useMemo(()=>d.map(S=>a.jsx(wa,{withRemoveButton:!0,onRemove:()=>m(S),children:S},S)),[d]),y=v.useMemo(()=>{const S=s.trim().toLowerCase();return n.filter(j=>j.toLowerCase().includes(S))},[n,s]),x=v.useMemo(()=>{const S=new Array(Math.min(y.length,Hne));for(let j=0;j<S.length;j++){const C=y[j];S[j]=a.jsx(Ke.Option,{value:C,active:d.includes(C),children:a.jsxs(xe,{gap:"sm",children:[d.includes(C)?a.jsx(sf,{size:12}):null,a.jsx("span",{children:C})]})},C)}return S},[y,d]);return a.jsxs(Ke,{store:o,onOptionSubmit:p,withinPortal:!1,children:[a.jsx(Ke.DropdownTarget,{children:a.jsx(xs,{onClick:()=>o.openDropdown(),...e,children:a.jsxs(wa.Group,{children:[g,a.jsx(Ke.EventsTarget,{children:a.jsx(xs.Field,{onFocus:()=>o.openDropdown(),onBlur:()=>{o.closeDropdown(),c("")},value:s,onChange:S=>{o.updateSelectedOptionIndex(),c(S.currentTarget.value)},onKeyDown:S=>{S.key==="Backspace"&&s.length===0&&d.length>0&&(S.preventDefault(),m(d[d.length-1]))},...t})})]})})}),a.jsx(Ke.Dropdown,{children:a.jsx(Ke.Options,{children:x.length>0?x:a.jsx(Ke.Empty,{children:"Nothing found..."})})})]})}function Gne({defaultGinPendingListLimit:e,availableTables:t,onResponse:n}){const r=Re(),[o,s]=v.useState(!1),[c,d]=v.useState([]),[f,p]=v.useState("unspecified"),[m,g]=v.useState("unspecified"),[y,x]=v.useState(void 0),S=()=>{const j={tableName:c};f==="reset"?j.fastUpdateAction="reset":f==="on"?(j.fastUpdateAction="set",j.fastUpdateValue=!0):f==="off"&&(j.fastUpdateAction="set",j.fastUpdateValue=!1),m==="reset"?j.ginPendingListLimitAction="reset":m==="set"&&(j.ginPendingListLimitAction="set",j.ginPendingListLimitValue=y),s(!0),y1(r,"Configure GIN Indexes","fhir/R4/$db-configure-indexes",j).then(C=>{n(C)}).catch(()=>{}).finally(()=>{s(!1)})};return a.jsx(pt,{onSubmit:S,children:a.jsxs(Me,{gap:"sm",maw:"800",children:[a.jsx(nf,{label:"Table(s)",children:a.jsx(qne,{data:t,onChange:j=>d(j),inputProps:{name:"tables",placeholder:"e.g. Observation"}})}),a.jsx(wr.Group,{name:"fastUpdate",label:"fastupdate",value:f,onChange:j=>p(j),children:a.jsxs(xe,{h:"36",children:[a.jsx(wr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(wr,{size:"sm",value:"reset",label:"reset to default (on)"}),a.jsx(wr,{size:"sm",value:"off",label:"off"}),a.jsx(wr,{size:"sm",value:"on",label:"on"})]})}),a.jsx(wr.Group,{name:"ginPendingListLimit",label:"gin_pending_list_limit",value:m,onChange:j=>{g(j),j!=="set"&&x(void 0)},children:a.jsxs(xe,{h:"36",children:[a.jsx(wr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(wr,{size:"sm",value:"reset",label:`reset to default (${e}kB)`}),a.jsxs(xe,{children:[a.jsx(wr,{size:"sm",value:"set",label:"Set to (kB)"}),a.jsx(bl,{title:"gin_pending_list_limit_value",name:"gin_pending_list_limit_value",value:(m==="set"?y:"")||"",disabled:m!=="set",required:m==="set",size:"sm",w:"100",min:64,max:2147483647,onChange:j=>{x(typeof j=="number"?j:void 0)}})]})]})}),a.jsx(xe,{justify:"center",children:a.jsx(cr,{size:"sm",loading:o,children:"Update"})})]})})}function Qne(){const e=Re(),[t,{open:n,close:r}]=Pl(!1),[o,s]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(void 0),[m,g]=v.useState(0),[y,x]=v.useState(!1),[S,j]=v.useState(void 0),[C,T]=v.useState([]),[R,E]=v.useState(0);qN({medplum:e,onChange:T}),v.useEffect(()=>{x(!0),e.get("fhir/R4/$db-indexes?tableName="+encodeURIComponent(f??""),{cache:"no-cache"}).then(D=>{const P=D.parameter?.find(B=>B.name==="defaultGinPendingListLimit")?.valueInteger??0;g(P);const $=D.parameter?.filter(B=>B.name==="index");j($??[])}).finally(()=>{x(!1)}).catch(D=>{ke({color:"red",message:D.message})})},[e,f,R]);const _=D=>{s("Configure results"),d(a.jsx("pre",{children:JSON.stringify(D,null,2)})),n(),E(P=>(P+1)%100)},k={onClick:D=>{s("Details"),d(a.jsx("pre",{children:D})),n()}};let I;return y?I="Loading...":f?S?.length===0&&(I="No GIN indexes on this table"):I="Select a table",a.jsxs(a.Fragment,{children:[a.jsxs(Me,{gap:"sm",children:[a.jsx("h2",{children:"Configure GIN indexes"}),a.jsx(xe,{children:a.jsx(Gne,{defaultGinPendingListLimit:m,availableTables:C,onResponse:_})}),a.jsx("h2",{children:"GIN index stats"}),a.jsxs(xe,{children:[a.jsx(FN,{data:C,inputProps:{placeholder:"Table name",inputSize:"50"},onChange:D=>{p(D)}}),a.jsx(Ne,{loading:y,onClick:()=>E(D=>(D+1)%100),disabled:!f,children:"Refresh"})]}),a.jsx(ee.ScrollContainer,{minWidth:500,children:a.jsxs(ee,{striped:!0,highlightOnHover:!0,children:[a.jsx(ee.Thead,{children:a.jsxs(ee.Tr,{children:[a.jsx(ee.Th,{children:"Schema"}),a.jsx(ee.Th,{children:"Table"}),a.jsx(ee.Th,{children:"Index"}),a.jsx(ee.Th,{children:"fastupdate"}),a.jsx(ee.Th,{children:"gin_pending_list_limit"}),a.jsx(ee.Th,{children:"options"})]})}),a.jsxs(ee.Tbody,{children:[I&&a.jsx(ee.Tr,{children:a.jsx(ee.Td,{colSpan:16,children:I})}),!I&&S?.map(D=>{const P=D.part??[],$=P.find(B=>B.name==="indexName")?.valueString;if(!$)throw new Error("Index missing name",{cause:D});return a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:P.find(B=>B.name==="schemaName")?.valueString}),a.jsx(ee.Td,{children:P.find(B=>B.name==="tableName")?.valueString}),a.jsx(ee.Td,{children:$}),a.jsx(wx,{value:P.find(B=>B.name==="fastUpdate")?.valueBoolean,defaultValue:a.jsxs(be,{span:!0,c:"dimmed",fs:"italic",children:["default (",HN(!0),")"]}),...k}),a.jsx(wx,{value:P.find(B=>B.name==="ginPendingListLimit")?.valueInteger,defaultValue:a.jsxs(be,{span:!0,c:"dimmed",fs:"italic",children:["default (",m,")"]}),...k}),a.jsx(wx,{value:P.find(B=>B.name==="indexOptions")?.valueString,defaultValue:a.jsx(be,{span:!0,c:"dimmed",fs:"italic",children:"NULL"}),...k})]},$)})]})]})})]}),a.jsx(Ln,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function wx({value:e,onClick:t,defaultValue:n}){return a.jsx(ee.Td,{style:{cursor:"pointer"},onClick:()=>t?.(e),children:e===void 0?n:HN(e)})}function Wne(){const e=Re(),t=["GIN Indexes","Column Statistics"],[n,r]=v.useState(t[0]);function o(s){s||(s=t[0]),r(s)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(ur,{outcome:vf}):a.jsx(bu,{maw:"100%",children:a.jsxs(Bl,{children:[a.jsx(Ue,{order:1,children:"Database Tools"}),a.jsxs(Gt,{value:n,onChange:o,children:[a.jsx(Gt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:t.map(s=>a.jsx(Gt.Tab,{value:s,children:s},s))}),a.jsx(Gt.Panel,{value:"GIN Indexes",pt:"md",children:a.jsx(Qne,{})}),a.jsx(Gt.Panel,{value:"Column Statistics",pt:"md",children:a.jsx(Vne,{})})]})]})})}function Yne(e){return a.jsx(Vl,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{qo(t)?e.onChange(Yt(t)):e.onChange(void 0)}})}function Kne(){const{membershipId:e}=Ht(),t=Re(),n=Ps(t),r=Yn(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[s,c]=v.useState(o.accessPolicy),[d,f]=v.useState(o.userConfiguration),[p,m]=v.useState(o.admin),[g,y]=v.useState(),[x,S]=v.useState(!1);function j(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${n}/members/${e}`).then(()=>t.get(`admin/projects/${n}`,{cache:"no-cache"})).then(()=>r("/admin/project")).catch(C=>y(Qt(C)))}return a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(Gc,{value:o.profile,link:!0})}),a.jsxs(pt,{onSubmit:()=>{const C={...o,accessPolicy:s,userConfiguration:d,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(T=>y(Qt(T)))},children:[!x&&a.jsxs(Me,{children:[a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:a.jsx(Sg,{name:"accessPolicy",defaultValue:s,onChange:c})}),a.jsx(zt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:a.jsx(Yne,{name:"userConfiguration",defaultValue:d,onChange:f})}),a.jsx(zt,{title:"Admin",htmlFor:"admin",outcome:g,children:a.jsx(un,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),a.jsxs(xe,{justify:"flex-end",mt:"xl",children:[a.jsx(Ne,{type:"submit",children:"Save"}),a.jsx(Ne,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),x&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User updated"}),a.jsx("pre",{children:JSON.stringify(g,void 0,2)}),a.jsxs("p",{children:["Click ",a.jsx(St,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function Xne(){const e=Re(),[t,n]=v.useState(e.getProject()),[r,o]=v.useState(),[s,c]=v.useState(),[d,f]=v.useState(!1),[p,m]=v.useState(void 0),g=v.useCallback(y=>{const x={resourceType:y.resourceType,firstName:y.firstName,lastName:y.lastName,email:y.email,sendEmail:y.sendEmail==="on",accessPolicy:r,admin:y.isAdmin==="on",scope:y.isProjectScoped==="on"?"project":"server",mfaRequired:y.mfaRequired==="on"};return e.invite(t?.id,x).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),yf(S)?c(S):m(S),f(x.sendEmail??!1),ke({color:"green",message:"Invite success"})}).catch(S=>{ke({color:"red",message:Qe(S),autoClose:!1}),c(Qt(S))})},[e,t,r]);return a.jsxs(pt,{onSubmit:g,children:[!p&&!s&&a.jsxs(Me,{children:[a.jsx(Ue,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(zt,{title:"Project",htmlFor:"project",outcome:s,children:a.jsx(Vl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(fn,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:$t(s,"resourceType")}),a.jsx(He,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:$t(s,"firstName")}),a.jsx(He,{name:"lastName",label:"Last Name",required:!0,error:$t(s,"lastName")}),a.jsx(He,{name:"email",type:"email",label:"Email",required:!0,error:$t(s,"email")}),a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:a.jsx(Sg,{name:"accessPolicy",onChange:o})}),a.jsx(un,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(un,{name:"isAdmin",label:"Admin"}),a.jsx(un,{name:"isProjectScoped",label:"Project scoped"}),a.jsx(un,{name:"mfaRequired",label:"MFA required"}),a.jsx(xe,{justify:"flex-end",children:a.jsx(cr,{children:"Invite"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User created, email couldn't be sent"}),a.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),a.jsxs("p",{children:["Click ",a.jsx(St,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(be,{children:"User created"}),d&&a.jsx(be,{children:"Email sent"}),a.jsxs(Or,{children:[a.jsx(Or.Item,{children:a.jsx(St,{to:p,children:"Go to new membership"})}),a.jsx(Or.Item,{children:a.jsx(St,{to:p.profile,children:"Go to new profile"})}),a.jsx(Or.Item,{children:a.jsx(St,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function Jne(){return a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"Patients"}),a.jsx(bg,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/invite",children:"Invite new patient"})})]})}function Zne(){const e=Re();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(ur,{outcome:vf});function t(n){e.post("admin/projects/setpassword",n).then(()=>ke({color:"green",message:"Done"})).catch(r=>ke({color:"red",message:Qe(r),autoClose:!1}))}return a.jsxs(ut,{width:600,children:[a.jsx(Ue,{order:1,children:"Project Admin"}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Force Set Password"}),a.jsx(be,{children:"Sets the password for the specified user in this project."}),a.jsx(be,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(pt,{onSubmit:t,children:a.jsxs(Me,{children:[a.jsx(He,{name:"email",label:"Email",required:!0}),a.jsx(no,{name:"password",label:"Password",required:!0}),a.jsx(Ne,{type:"submit",children:"Force Set Password"})]})})]})}function b_(){const e=Re(),t=Ps(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"Details"}),a.jsxs(Rf,{children:[a.jsx(Ir,{term:"ID",children:n.project.id}),a.jsx(Ir,{term:"Name",children:n.project.name})]})]})}const ere=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function tre(){const e=Re(),t=Ps(e),n=v.useMemo(()=>e.get("admin/projects/"+t).read(),[e,t]);return a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{children:[a.jsx(yt,{children:a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Project"}),a.jsx(yt.Value,{children:n.project.name})]})}),a.jsx(Jr,{children:a.jsx(n1,{baseUrl:"/admin",tabs:ere})})]}),a.jsx(ut,{children:a.jsx(p1,{})})]})}function nre(){const e=Re(),t=Ps(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(mi(n.project.secret||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/secrets`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>ke({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(Ue,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(_f,{property:Ds("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(Ne,{type:"submit",children:"Save"})]})}function rre(){const e=Re(),t=Ps(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(mi(n.project.site||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/sites`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>ke({color:"green",message:"Saved"})).catch(f=>{const p=Qt(f);ke({color:"red",message:`Error ${p.issue?.[0].details?.text} ${p.issue?.[0].expression?.[0]}`,autoClose:!1})})},children:[a.jsx(Ue,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(_f,{property:Ds("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(Ne,{type:"submit",children:"Save"})]})}const GN="System AsyncJob",QN="Post-deploy Migrations",up=[QN,GN];function ire(){const e=Re(),[t,n]=v.useState(up[0]);function r(o){o||=up[0],up.includes(o)&&n(o)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(ur,{outcome:vf}):a.jsx(bu,{miw:"1600",maw:"2000",children:a.jsxs(Bl,{children:[a.jsx(Ue,{order:1,children:"AsyncJob Dashboard"}),a.jsxs(Gt,{keepMounted:!1,value:t,onChange:r,children:[a.jsx(Gt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:up.map(o=>a.jsx(Gt.Tab,{value:o,children:o},o))}),a.jsx(Gt.Panel,{value:GN,pt:"md",children:a.jsx(are,{})}),a.jsx(Gt.Panel,{value:QN,pt:"md",children:a.jsx(lre,{})})]})]})})}const ore={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:he.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function are(){const e=Yn(),[t]=v.useState(ore);return a.jsxs(Me,{children:[a.jsx(St,{to:`/${t.resourceType}/${gs(t)}`,children:"Show in search page"}),a.jsx(Su,{checkboxesEnabled:!1,search:t,onClick:n=>e(S_(n.resource))?.catch(console.error),onAuxClick:n=>window.open(S_(n.resource),"_blank")})]})}const sre={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:he.MISSING,value:"true"},{code:"type",operator:he.EQUALS,value:"data-migration"}],count:1e3,sortRules:[{code:"_lastUpdated",descending:!0}]};function lre(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(),[s,c]=v.useState([]),[d,f]=v.useState(0),[p,m]=v.useState([]);v.useEffect(()=>{const j="info";m(C=>C.includes(j)?C:[...C,j]),e.get("admin/super/migrations",{cache:"no-cache"}).then(C=>{C.postDeployMigrations.sort((T,R)=>R-T),n(C)}).catch(C=>{ke({color:"red",message:Qe(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,d]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",gs({...sre,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{o(C.entry?.map(T=>T.resource))})).catch(C=>{o(void 0),ke({color:"red",message:Qe(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,d]);function g(){f(j=>j+1)}function y(j){y1(e,"Run pending post-deploy migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const x=p.length>0;function S(j,{isLoading:C}){return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(Em,{visible:C}),a.jsxs(ee,{children:[a.jsx(ee.Thead,{children:a.jsxs(ee.Tr,{children:[a.jsx(ee.Th,{children:"Version"}),a.jsx(ee.Th,{children:"Action"}),a.jsx(ee.Th,{children:"Status"}),a.jsx(ee.Th,{children:"AsyncJob"}),a.jsx(ee.Th,{children:"Last Updated"}),a.jsx(ee.Th,{children:"Request Time"}),a.jsx(ee.Th,{children:"Duration"}),a.jsx(ee.Th,{children:"Attempts"})]})}),a.jsx(ee.Tbody,{children:j()})]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(Ne,{size:"xs",mb:"xs",variant:"subtle",leftSection:a.jsx(iP,{size:14}),onClick:g,loading:x,children:"Refresh"}),S(()=>{if(!x){if(!t)return a.jsx(ee.Tr,{children:a.jsx(ee.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return a.jsx(ee.Tr,{children:a.jsx(ee.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:t.postDeployMigrations?.map(j=>{const{status:C,asyncJob:T,asyncJobs:R}=cre(j,r??[],t?.pendingPostDeployMigration),E=s.includes(j),_=j===t?.pendingPostDeployMigration&&(!T||T?.status==="error"),k=[a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:j}),a.jsx(ee.Td,{children:_&&a.jsx(Ne,{color:"green",size:"xs",onClick:()=>y(j),children:"Start"})}),a.jsx(ee.Td,{children:C}),a.jsx(ee.Td,{children:T&&a.jsx(St,{to:`/AsyncJob/${T?.id}`,children:T?.id})}),a.jsx(ee.Td,{children:T?.meta?.lastUpdated}),a.jsx(ee.Td,{children:T?.requestTime}),a.jsx(ee.Td,{children:w_(T)}),a.jsx(ee.Td,{display:"flex",children:a.jsxs(xe,{gap:"xs",children:[R.length?R.length:"",E&&R.length>1&&a.jsx(Ne,{leftSection:a.jsx(RG,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(j)?I.filter(D=>D!==j):I),children:"Hide all"}),!E&&R.length>1&&a.jsx(Ne,{leftSection:a.jsx($G,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(j)?I:[...I,j]),children:"Show all"})]})})]},j)];return E&&k.push(...R.filter(I=>I.id!==T?.id).map(I=>a.jsxs(ee.Tr,{bg:"gray.1",children:[a.jsx(ee.Td,{children:j}),a.jsx(ee.Td,{}),a.jsx(ee.Td,{children:I.status}),a.jsx(ee.Td,{children:a.jsx(St,{to:`/AsyncJob/${I.id}`,children:I.id})}),a.jsx(ee.Td,{children:I.meta?.lastUpdated}),a.jsx(ee.Td,{children:I.requestTime}),a.jsx(ee.Td,{children:w_(I)}),a.jsx(ee.Td,{})]},I.id))),k})},{isLoading:x})]})}function cre(e,t,n){const r=t.filter(c=>c.dataVersion===e),o=r.find(c=>c.status==="completed")??r[0];let s;return n===0?s=o?.status??"completed":e>n?s=o?.status??"pending":e===n?s=o?.status??"next":s=o?.status??"completed",{status:s,asyncJob:o,asyncJobs:r}}function S_(e){return`/${e.resourceType}/${e.id}`}function w_(e){const t=e?.requestTime,n=e?.transactionTime??e?.meta?.lastUpdated;if(!t||!n)return"";const r=new Date(t),s=new Date(n).getTime()-r.getTime();if(s<1e3)return`${s.toFixed(0)}ms`;const c=s/1e3;return c<60?`${c.toFixed(2)}s`:c<3600?`${(c/60).toFixed(2)}m`:`${(c/3600).toFixed(2)}h`}function ure(){const e=Re(),[t,{open:n,close:r}]=Pl(!1),[o,s]=v.useState(""),[c,d]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(ur,{outcome:vf});function f(){Lc(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){Lc(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){Lc(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(_){Lc(e,"Reindexing Resources","admin/super/reindex",_)}function y(){Lc(e,"Reload Cron Resources","admin/super/reloadcron")}function x(_){e.post("admin/super/removebotidjobsfromqueue",_).then(()=>ke({color:"green",message:"Done"})).catch(k=>ke({color:"red",message:Qe(k),autoClose:!1}))}function S(_){e.post("admin/super/purge",{..._,before:GS(_.before)}).then(()=>ke({color:"green",message:"Done"})).catch(k=>ke({color:"red",message:Qe(k),autoClose:!1}))}function j(_){e.post("admin/super/setpassword",_).then(()=>ke({color:"green",message:"Done"})).catch(k=>ke({color:"red",message:Qe(k),autoClose:!1}))}function C(_){e.post("fhir/R4/$db-stats",_.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:_.tableNames}]}:void 0).then(k=>{s("Database Stats"),d(a.jsx("pre",{children:k.parameter?.find(I=>I.name==="tableString")?.valueString})),n()}).catch(k=>ke({color:"red",message:Qe(k),autoClose:!1}))}function T(){e.post("fhir/R4/$db-invalid-indexes").then(_=>{s("Database Invalid Indexes"),d(a.jsx("pre",{children:_.parameter?.filter(k=>k.name==="invalidIndex").map(k=>k.valueString).join(`
|
|
218
|
-
`)})),n()}).catch(_=>ke({color:"red",message:Qe(_),autoClose:!1}))}function R(){e.post("fhir/R4/$db-schema-diff").then(_=>{s("Schema Diff"),d(a.jsx("pre",{children:_.parameter?.find(k=>k.name==="migrationString")?.valueString})),n()}).catch(_=>ke({color:"red",message:Qe(_),autoClose:!1}))}function E(){Lc(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return a.jsxs(ut,{width:600,children:[a.jsx(Ue,{order:1,children:"Super Admin"}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Structure Definitions"}),a.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),a.jsx(pt,{children:a.jsx(Ne,{onClick:f,children:"Rebuild StructureDefinitions"})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Search Parameters"}),a.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),a.jsx(pt,{children:a.jsx(Ne,{onClick:p,children:"Rebuild SearchParameters"})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Value Sets"}),a.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),a.jsx(pt,{children:a.jsx(Ne,{onClick:m,children:"Rebuild ValueSets"})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Reindex Resources"}),a.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),a.jsx(pt,{onSubmit:g,children:a.jsxs(Me,{children:[a.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",children:a.jsx(He,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(zt,{title:"Search Filter",htmlFor:"filter",children:a.jsx(He,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),a.jsx(zt,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:a.jsx(dre,{})}),a.jsx(Ne,{type:"submit",children:"Reindex"})]})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Purge Resources"}),a.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),a.jsx(pt,{onSubmit:S,children:a.jsxs(Me,{children:[a.jsx(zt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(fn,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(zt,{title:"Purge Before",htmlFor:"before",children:a.jsx(No,{name:"before",placeholder:"Before Date"})}),a.jsx(Ne,{type:"submit",children:"Purge"})]})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(pt,{onSubmit:x,children:a.jsxs(Me,{children:[a.jsx(zt,{title:"Bot ID",children:a.jsx(He,{name:"botId",placeholder:"Bot Id"})}),a.jsx(Ne,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Force Set Password"}),a.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),a.jsx(pt,{onSubmit:j,children:a.jsxs(Me,{children:[a.jsx(He,{name:"email",label:"Email",required:!0}),a.jsx(no,{name:"password",label:"Password",required:!0}),a.jsx(He,{name:"projectId",label:"Project ID"}),a.jsx(Ne,{type:"submit",children:"Force Set Password"})]})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Database Stats"}),a.jsx("p",{children:"Query current table statistics from the database."}),a.jsx(pt,{onSubmit:C,children:a.jsxs(Me,{children:[a.jsx(zt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:a.jsx(He,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),a.jsx(Ne,{type:"submit",children:"Get Database Stats"})]})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Database Invalid Indexes"}),a.jsx("p",{children:"Query invalid indexes from the database."}),a.jsx(pt,{onSubmit:T,children:a.jsx(Me,{children:a.jsx(Ne,{type:"submit",children:"Get Database Invalid Indexes"})})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Database Schema Drift"}),a.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),a.jsxs(Rr,{children:[a.jsx(Rr.Col,{span:6,children:a.jsx(pt,{onSubmit:R,children:a.jsx(Me,{children:a.jsx(Ne,{type:"submit",children:"Get Schema Drift"})})})}),a.jsx(Rr.Col,{span:6,children:a.jsx(pt,{onSubmit:E,children:a.jsx(Me,{children:a.jsx(Ne,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Reload Cron Resources"}),a.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),a.jsx(pt,{onSubmit:y,children:a.jsx(Me,{children:a.jsx(Ne,{type:"submit",children:"Reload Cron Resources"})})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Database Explain Search"}),a.jsx("p",{children:"Runs an EXPLAIN query on the database to show the query plan for a search."}),a.jsx(fre,{setModalTitle:s,setModalContent:d,openModal:n}),a.jsx(Ln,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function dre(){const[e,t]=v.useState("outdated");return a.jsxs(a.Fragment,{children:[a.jsx(fn,{id:"reindexType",name:"reindexType",value:e,onChange:n=>t(n.target.value),data:[{label:"Outdated resources",value:"outdated"},{label:"All resources",value:"all"},{label:"Less than or equal to a specific version",value:"specific"}]}),e==="specific"&&a.jsx(bl,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function fre({setModalTitle:e,setModalContent:t,openModal:n}){const r=Re(),[o,s]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(),y=v.useMemo(()=>{if(o?.reference)return{"_has:ProjectMembership:profile:project":o.reference}},[o]);v.useEffect(()=>{if(g(void 0),!c?.reference&&!o?.reference){p(void 0);return}r.searchResources("ProjectMembership",{profile:c?.reference,project:o?.reference,_count:20}).then(j=>{p(j),j.length===1&&g(Yt(j[0]))}).catch(j=>{console.error(j),ke({color:"red",message:Qe(j),autoClose:!1})})},[r,c,o]);const x=v.useMemo(()=>{const j={};return c?.reference&&(j.profile=c?.reference),o?.reference&&(j.project=o?.reference),j},[c,o]);function S(j){if(!j.query){ke({color:"red",message:"Query is required",autoClose:!1});return}const C=j.onBehalfOfProjectMembership;delete j.onBehalfOfProjectMembership;const T={query:j.query,analyze:j.analyze==="on",format:"text"},R={};C&&(R["x-medplum-on-behalf-of"]=C),r.post("fhir/R4/$explain",T,void 0,{headers:R}).then(E=>{e("Database Explain");const _=E.parameter?.find(P=>P.name==="explain")?.valueString,k=E.parameter?.find(P=>P.name==="query")?.valueString,I=E.parameter?.find(P=>P.name==="parameters")?.valueString,D=[k,I,`
|
|
219
|
-
`,_].join(`
|
|
220
|
-
`);t(a.jsx(lf,{block:!0,maw:"100%",children:D})),n()}).catch(E=>{ke({color:"red",message:Qe(E),autoClose:!1})})}return!r.isLoading()&&!r.isSuperAdmin()?a.jsx(ur,{outcome:vf}):a.jsx(pt,{onSubmit:S,children:a.jsxs(Me,{children:[a.jsx(He,{name:"query",label:"Search",required:!0,placeholder:"Observation?code=85354-9&_sort=-date&_count=5"}),a.jsx(un,{name:"analyze",label:"Analyze"}),a.jsx(nf,{label:"On Behalf Of",children:a.jsxs(Me,{gap:"sm",children:[a.jsx(ys,{required:!0,placeholder:"Project",targetTypes:["Project"],name:"onBehalfOfProject",onChange:s}),a.jsx(ys,{required:!0,placeholder:"Practitioner or Patient",name:"onBehalfOfProfile",targetTypes:["Practitioner","Patient"],onChange:d,searchCriteria:y}),f?.length!==1&&a.jsx(ys,{required:!0,placeholder:"ProjectMembership",name:"onBehalfOfProjectMembership",targetTypes:["ProjectMembership"],onChange:g,searchCriteria:x}),f?.length===1&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"hidden",name:"onBehalfOfProjectMembership",value:It(f[0])}),a.jsx(Wp,{value:Yt(f[0])})]}),!m&&a.jsx(be,{fs:"italic",children:"On Behalf Of not set. Running as super admin"})]})}),a.jsx(Ne,{type:"submit",children:"Explain Search"})]})})}function hre(){return a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"Users"}),a.jsx(bg,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/invite",children:"Invite new user"})})]})}const pre=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 au(e,t,n){const r=mre(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&j_(r,"path",s),j_(r,"relativePath",s),r}function mre(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=pre.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function j_(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const gre=[".DS_Store","Thumbs.db"];function vre(e){return Al(this,void 0,void 0,function*(){return nm(e)&&yre(e.dataTransfer)?wre(e.dataTransfer,e.type):xre(e)?bre(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Sre(e):[]})}function yre(e){return nm(e)}function xre(e){return nm(e)&&nm(e.target)}function nm(e){return typeof e=="object"&&e!==null}function bre(e){return mb(e.target.files).map(t=>au(t))}function Sre(e){return Al(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>au(n))})}function wre(e,t){return Al(this,void 0,void 0,function*(){if(e.items){const n=mb(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(jre));return C_(WN(r))}return C_(mb(e.files).map(n=>au(n)))})}function C_(e){return e.filter(t=>gre.indexOf(t.name)===-1)}function mb(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 jre(e){if(typeof e.webkitGetAsEntry!="function")return E_(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?YN(t):E_(e,t)}function WN(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?WN(n):[n]],[])}function E_(e,t){return Al(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const c=yield s.getFile();return c.handle=s,au(c)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return au(r,(n=t?.fullPath)!==null&&n!==void 0?n:void 0)})}function Cre(e){return Al(this,void 0,void 0,function*(){return e.isDirectory?YN(e):Ere(e)})}function YN(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function s(){t.readEntries(c=>Al(this,void 0,void 0,function*(){if(c.length){const d=Promise.all(c.map(Cre));o.push(d),s()}else try{const d=yield Promise.all(o);n(d)}catch(d){r(d)}}),c=>{r(c)})}s()})}function Ere(e){return Al(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const o=au(r,e.fullPath);t(o)},r=>{n(r)})})})}var dp={},T_;function Tre(){return T_||(T_=1,dp.__esModule=!0,dp.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(c){var d=c.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?s===d.replace(/\/.*$/,""):o===d})}return!0}),dp}var Rre=Tre();const jx=om(Rre);function R_(e){return Are(e)||Dre(e)||XN(e)||_re()}function _re(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
221
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Are(e){if(Array.isArray(e))return gb(e)}function __(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function D_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?__(Object(n),!0).forEach(function(r){KN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):__(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yd(e,t){return Nre(e)||Pre(e,t)||XN(e,t)||kre()}function kre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
222
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XN(e,t){if(e){if(typeof e=="string")return gb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gb(e,t)}}function gb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,d;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,d=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw d}}return r}}function Nre(e){if(Array.isArray(e))return e}var Ore=typeof jx=="function"?jx:jx.default,Mre="file-invalid-type",Lre="file-too-large",Ire="file-too-small",zre="too-many-files",$re=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:Mre,message:"File type must be ".concat(r)}},A_=function(t){return{code:Lre,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},k_=function(t){return{code:Ire,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ure={code:zre,message:"Too many files"};function JN(e,t){var n=e.type==="application/x-moz-file"||Ore(e,t);return[n,n?null:$re(t)]}function ZN(e,t,n){if(sl(e.size))if(sl(t)&&sl(n)){if(e.size>n)return[!1,A_(n)];if(e.size<t)return[!1,k_(t)]}else{if(sl(t)&&e.size<t)return[!1,k_(t)];if(sl(n)&&e.size>n)return[!1,A_(n)]}return[!0,null]}function sl(e){return e!=null}function Bre(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,d=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var p=JN(f,n),m=Yd(p,1),g=m[0],y=ZN(f,r,o),x=Yd(y,1),S=x[0],j=d?d(f):null;return g&&S&&!j})}function rm(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function fp(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function P_(e){e.preventDefault()}function Vre(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Fre(e){return e.indexOf("Edge/")!==-1}function Hre(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Vre(e)||Fre(e)}function bo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return t.some(function(d){return!rm(r)&&d&&d.apply(void 0,[r].concat(s)),rm(r)})}}function qre(){return"showOpenFilePicker"in window}function Gre(e){if(sl(e)){var t=Object.entries(e).filter(function(n){var r=Yd(n,2),o=r[0],s=r[1],c=!0;return eO(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(s)||!s.every(tO))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=Yd(r,2),s=o[0],c=o[1];return D_(D_({},n),{},KN({},s,c))},{});return[{description:"Files",accept:t}]}return e}function Qre(e){if(sl(e))return Object.entries(e).reduce(function(t,n){var r=Yd(n,2),o=r[0],s=r[1];return[].concat(R_(t),[o],R_(s))},[]).filter(function(t){return eO(t)||tO(t)}).join(",")}function Wre(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Yre(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function eO(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function tO(e){return/^.*\.[\w]+$/.test(e)}var Kre=["children"],Xre=["open"],Jre=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Zre=["refKey","onChange","onClick"];function eie(e){return rie(e)||nie(e)||nO(e)||tie()}function tie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
223
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rie(e){if(Array.isArray(e))return vb(e)}function Cx(e,t){return aie(e)||oie(e,t)||nO(e,t)||iie()}function iie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
224
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nO(e,t){if(e){if(typeof e=="string")return vb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vb(e,t)}}function vb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,d;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,d=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw d}}return r}}function aie(e){if(Array.isArray(e))return e}function N_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N_(Object(n),!0).forEach(function(r){yb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function im(e,t){if(e==null)return{};var n=sie(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sie(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var x1=v.forwardRef(function(e,t){var n=e.children,r=im(e,Kre),o=iO(r),s=o.open,c=im(o,Xre);return v.useImperativeHandle(t,function(){return{open:s}},[s]),On.createElement(v.Fragment,null,n(Nn(Nn({},c),{},{open:s})))});x1.displayName="Dropzone";var rO={disabled:!1,getFilesFromEvent:vre,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};x1.defaultProps=rO;x1.propTypes={children:cn.func,accept:cn.objectOf(cn.arrayOf(cn.string)),multiple:cn.bool,preventDropOnDocument:cn.bool,noClick:cn.bool,noKeyboard:cn.bool,noDrag:cn.bool,noDragEventsBubbling:cn.bool,minSize:cn.number,maxSize:cn.number,maxFiles:cn.number,disabled:cn.bool,getFilesFromEvent:cn.func,onFileDialogCancel:cn.func,onFileDialogOpen:cn.func,useFsAccessApi:cn.bool,autoFocus:cn.bool,onDragEnter:cn.func,onDragLeave:cn.func,onDragOver:cn.func,onDrop:cn.func,onDropAccepted:cn.func,onDropRejected:cn.func,onError:cn.func,validator:cn.func};var xb={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function iO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Nn(Nn({},rO),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,d=t.multiple,f=t.maxFiles,p=t.onDragEnter,m=t.onDragLeave,g=t.onDragOver,y=t.onDrop,x=t.onDropAccepted,S=t.onDropRejected,j=t.onFileDialogCancel,C=t.onFileDialogOpen,T=t.useFsAccessApi,R=t.autoFocus,E=t.preventDropOnDocument,_=t.noClick,k=t.noKeyboard,I=t.noDrag,D=t.noDragEventsBubbling,P=t.onError,$=t.validator,B=v.useMemo(function(){return Qre(n)},[n]),Q=v.useMemo(function(){return Gre(n)},[n]),K=v.useMemo(function(){return typeof C=="function"?C:O_},[C]),Z=v.useMemo(function(){return typeof j=="function"?j:O_},[j]),U=v.useRef(null),G=v.useRef(null),M=v.useReducer(lie,xb),L=Cx(M,2),z=L[0],F=L[1],Y=z.isFocused,O=z.isFileDialogActive,H=v.useRef(typeof window<"u"&&window.isSecureContext&&T&&qre()),se=function(){!H.current&&O&&setTimeout(function(){if(G.current){var qe=G.current.files;qe.length||(F({type:"closeDialog"}),Z())}},300)};v.useEffect(function(){return window.addEventListener("focus",se,!1),function(){window.removeEventListener("focus",se,!1)}},[G,O,Z,H]);var de=v.useRef([]),ye=function(qe){U.current&&U.current.contains(qe.target)||(qe.preventDefault(),de.current=[])};v.useEffect(function(){return E&&(document.addEventListener("dragover",P_,!1),document.addEventListener("drop",ye,!1)),function(){E&&(document.removeEventListener("dragover",P_),document.removeEventListener("drop",ye))}},[U,E]),v.useEffect(function(){return!r&&R&&U.current&&U.current.focus(),function(){}},[U,R,r]);var we=v.useCallback(function(pe){P?P(pe):console.error(pe)},[P]),Ee=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Le(pe),de.current=[].concat(eie(de.current),[pe.target]),fp(pe)&&Promise.resolve(o(pe)).then(function(qe){if(!(rm(pe)&&!D)){var Ce=qe.length,Pe=Ce>0&&Bre({files:qe,accept:B,minSize:c,maxSize:s,multiple:d,maxFiles:f,validator:$}),At=Ce>0&&!Pe;F({isDragAccept:Pe,isDragReject:At,isDragActive:!0,type:"setDraggedFiles"}),p&&p(pe)}}).catch(function(qe){return we(qe)})},[o,p,we,D,B,c,s,d,f,$]),Xe=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Le(pe);var qe=fp(pe);if(qe&&pe.dataTransfer)try{pe.dataTransfer.dropEffect="copy"}catch{}return qe&&g&&g(pe),!1},[g,D]),Ae=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Le(pe);var qe=de.current.filter(function(Pe){return U.current&&U.current.contains(Pe)}),Ce=qe.indexOf(pe.target);Ce!==-1&&qe.splice(Ce,1),de.current=qe,!(qe.length>0)&&(F({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),fp(pe)&&m&&m(pe))},[U,m,D]),dt=v.useCallback(function(pe,qe){var Ce=[],Pe=[];pe.forEach(function(At){var mn=JN(At,B),gn=Cx(mn,2),Bn=gn[0],an=gn[1],br=ZN(At,c,s),Wt=Cx(br,2),dr=Wt[0],Rn=Wt[1],fo=$?$(At):null;if(Bn&&dr&&!fo)Ce.push(At);else{var Qo=[an,Rn];fo&&(Qo=Qo.concat(fo)),Pe.push({file:At,errors:Qo.filter(function(Ma){return Ma})})}}),(!d&&Ce.length>1||d&&f>=1&&Ce.length>f)&&(Ce.forEach(function(At){Pe.push({file:At,errors:[Ure]})}),Ce.splice(0)),F({acceptedFiles:Ce,fileRejections:Pe,isDragReject:Pe.length>0,type:"setFiles"}),y&&y(Ce,Pe,qe),Pe.length>0&&S&&S(Pe,qe),Ce.length>0&&x&&x(Ce,qe)},[F,d,B,c,s,f,y,x,S,$]),Et=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Le(pe),de.current=[],fp(pe)&&Promise.resolve(o(pe)).then(function(qe){rm(pe)&&!D||dt(qe,pe)}).catch(function(qe){return we(qe)}),F({type:"reset"})},[o,dt,we,D]),it=v.useCallback(function(){if(H.current){F({type:"openDialog"}),K();var pe={multiple:d,types:Q};window.showOpenFilePicker(pe).then(function(qe){return o(qe)}).then(function(qe){dt(qe,null),F({type:"closeDialog"})}).catch(function(qe){Wre(qe)?(Z(qe),F({type:"closeDialog"})):Yre(qe)?(H.current=!1,G.current?(G.current.value=null,G.current.click()):we(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):we(qe)});return}G.current&&(F({type:"openDialog"}),K(),G.current.value=null,G.current.click())},[F,K,Z,T,dt,we,Q,d]),rt=v.useCallback(function(pe){!U.current||!U.current.isEqualNode(pe.target)||(pe.key===" "||pe.key==="Enter"||pe.keyCode===32||pe.keyCode===13)&&(pe.preventDefault(),it())},[U,it]),mt=v.useCallback(function(){F({type:"focus"})},[]),Ct=v.useCallback(function(){F({type:"blur"})},[]),jt=v.useCallback(function(){_||(Hre()?setTimeout(it,0):it())},[_,it]),Te=function(qe){return r?null:qe},_e=function(qe){return k?null:Te(qe)},$e=function(qe){return I?null:Te(qe)},Le=function(qe){D&&qe.stopPropagation()},lt=v.useMemo(function(){return function(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},qe=pe.refKey,Ce=qe===void 0?"ref":qe,Pe=pe.role,At=pe.onKeyDown,mn=pe.onFocus,gn=pe.onBlur,Bn=pe.onClick,an=pe.onDragEnter,br=pe.onDragOver,Wt=pe.onDragLeave,dr=pe.onDrop,Rn=im(pe,Jre);return Nn(Nn(yb({onKeyDown:_e(bo(At,rt)),onFocus:_e(bo(mn,mt)),onBlur:_e(bo(gn,Ct)),onClick:Te(bo(Bn,jt)),onDragEnter:$e(bo(an,Ee)),onDragOver:$e(bo(br,Xe)),onDragLeave:$e(bo(Wt,Ae)),onDrop:$e(bo(dr,Et)),role:typeof Pe=="string"&&Pe!==""?Pe:"presentation"},Ce,U),!r&&!k?{tabIndex:0}:{}),Rn)}},[U,rt,mt,Ct,jt,Ee,Xe,Ae,Et,k,I,r]),tt=v.useCallback(function(pe){pe.stopPropagation()},[]),ft=v.useMemo(function(){return function(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},qe=pe.refKey,Ce=qe===void 0?"ref":qe,Pe=pe.onChange,At=pe.onClick,mn=im(pe,Zre),gn=yb({accept:B,multiple:d,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:Te(bo(Pe,Et)),onClick:Te(bo(At,tt)),tabIndex:-1},Ce,G);return Nn(Nn({},gn),mn)}},[G,n,d,Et,r]);return Nn(Nn({},z),{},{isFocused:Y&&!r,getRootProps:lt,getInputProps:ft,rootRef:U,inputRef:G,open:Te(it)})}function lie(e,t){switch(t.type){case"focus":return Nn(Nn({},e),{},{isFocused:!0});case"blur":return Nn(Nn({},e),{},{isFocused:!1});case"openDialog":return Nn(Nn({},xb),{},{isFileDialogActive:!0});case"closeDialog":return Nn(Nn({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Nn(Nn({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Nn(Nn({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Nn({},xb);default:return e}}function O_(){}const[cie,uie]=Ar("Dropzone component was not found in tree");function b1(e){const t=n=>{const{children:r,...o}=oe(`Dropzone${xE(e)}`,{},n),s=uie(),c=sm(r)?r:a.jsx("span",{children:r});return s[e]?v.cloneElement(c,o):null};return t.displayName=`@mantine/dropzone/${xE(e)}`,t}const die=b1("accept"),fie=b1("reject"),hie=b1("idle");var Kd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const pie={multiple:!0,maxSize:1/0,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},mie=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const s=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Bt(t),"--dropzone-accept-color":s.color,"--dropzone-accept-bg":s.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},Ns=ge((e,t)=>{const n=oe("Dropzone",pie,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,disabled:m,loading:g,multiple:y,maxSize:x,accept:S,children:j,onDropAny:C,onDrop:T,onReject:R,openRef:E,name:_,maxFiles:k,autoFocus:I,activateOnClick:D,activateOnDrag:P,dragEventsBubbling:$,activateOnKeyboard:B,onDragEnter:Q,onDragLeave:K,onDragOver:Z,onFileDialogCancel:U,onFileDialogOpen:G,preventDropOnDocument:M,useFsAccessApi:L,getFilesFromEvent:z,validator:F,rejectColor:Y,acceptColor:O,enablePointerEvents:H,loaderProps:se,inputProps:de,mod:ye,attributes:we,...Ee}=n,Xe=Ie({name:"Dropzone",classes:Kd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:we,vars:f,varsResolver:mie}),{getRootProps:Ae,getInputProps:dt,isDragAccept:Et,isDragReject:it,isDragActive:rt,open:mt}=iO({onDrop:C,onDropAccepted:T,onDropRejected:R,disabled:m||g,accept:Array.isArray(S)?S.reduce((_e,$e)=>({..._e,[$e]:[]}),{}):S,multiple:y,maxSize:x,maxFiles:k,autoFocus:I,noClick:!D,noDrag:!P,noDragEventsBubbling:!$,noKeyboard:!B,onDragEnter:Q,onDragLeave:K,onDragOver:Z,onFileDialogCancel:U,onFileDialogOpen:G,preventDropOnDocument:M,useFsAccessApi:L,validator:F,...z?{getFilesFromEvent:z}:null});Dd(E,mt);const Ct=rt&&Et,jt=rt&&it,Te=!Ct&&!jt;return a.jsx(cie,{value:{accept:Ct,reject:jt,idle:Te},children:a.jsxs(le,{...Ae(),...Xe("root",{focusable:!0}),...Ee,mod:[{accept:Ct,reject:jt,idle:Te,disabled:m,loading:g,"activate-on-click":D},ye],children:[a.jsx(Em,{visible:g,overlayProps:{radius:p},unstyled:d,loaderProps:se}),a.jsx("input",{...dt(de),name:_}),a.jsx("div",{...Xe("inner"),ref:t,"data-enable-pointer-events":H||void 0,children:j})]})})});Ns.classes=Kd;Ns.displayName="@mantine/dropzone/Dropzone";Ns.Accept=die;Ns.Idle=hie;Ns.Reject=fie;const gie={maxSize:1/0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:zr("max"),withinPortal:!0},S1=ge((e,t)=>{const n=oe("DropzoneFullScreen",gie,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,active:p,onDrop:m,onReject:g,zIndex:y,withinPortal:x,portalProps:S,attributes:j,...C}=n,T=Ie({name:"DropzoneFullScreen",classes:Kd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:j,rootSelector:"fullScreen"}),{resolvedClassNames:R,resolvedStyles:E}=Ol({classNames:r,styles:c,props:n}),[_,k]=v.useState(0),[I,{open:D,close:P}]=Pl(!1),$=Q=>{Q.dataTransfer?.types.includes("Files")&&(k(K=>K+1),D())},B=()=>{k(Q=>Q-1)};return v.useEffect(()=>{_===0&&P()},[_]),v.useEffect(()=>{if(p)return document.addEventListener("dragenter",$,!1),document.addEventListener("dragleave",B,!1),()=>{document.removeEventListener("dragenter",$,!1),document.removeEventListener("dragleave",B,!1)}},[p]),a.jsx(Sa,{...S,withinPortal:x,children:a.jsx(le,{ref:t,...T("fullScreen",{style:{opacity:I?1:0,pointerEvents:I?"all":"none",zIndex:y}}),children:a.jsx(Ns,{activateOnClick:!1,...C,classNames:R,styles:E,unstyled:d,className:Kd.dropzone,onDrop:Q=>{m?.(Q),P(),k(0)},onReject:Q=>{g?.(Q),P(),k(0)}})})})});S1.classes=Kd;S1.displayName="@mantine/dropzone/DropzoneFullScreen";Ns.FullScreen=S1;const hp=Ns,vie='{"resourceType": "Bundle"}';function Ex({id:e,title:t,message:n,color:r,icon:o,withCloseButton:s=!1,method:c="show",loading:d}){Pi[c]({id:e,loading:d,title:t,message:n,color:r,icon:o,withCloseButton:s,autoClose:!1})}function yie(){const e=Tn(),t=Re(),[n,r]=v.useState({}),o=v.useCallback(async(d,f)=>{const p="batch-upload";Ex({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(d);m.type!=="batch"&&m.type!=="transaction"&&(m=Ok(m));const g=await t.executeBatch(m);r(y=>({...y,[f]:g})),Ex({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(Go,{size:"1rem"}),withCloseButton:!0})}catch(m){Ex({id:p,title:"Batch Upload Failed",color:"red",message:Qe(m),method:"update",icon:a.jsx(El,{size:"1rem"}),withCloseButton:!0})}},[t]),s=v.useCallback(async d=>{for(const f of d){const p=new FileReader;p.onload=m=>o(m.target?.result,f.name),p.readAsText(f)}},[o]),c=v.useCallback(async d=>{await o(d.input,"JSON Data")},[o]);return a.jsxs(ut,{children:[a.jsx(Ue,{children:"Batch Create"}),a.jsxs(be,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",a.jsx(Tt,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Input"}),a.jsxs(Gt,{defaultValue:"upload",children:[a.jsxs(Gt.List,{children:[a.jsx(Gt.Tab,{value:"upload",children:"File Upload"}),a.jsx(Gt.Tab,{value:"json",children:"JSON"})]}),a.jsx(Gt.Panel,{value:"upload",pt:"xs",children:a.jsx(hp,{onDrop:s,accept:["application/json"],children:a.jsxs(xe,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(hp.Accept,{children:a.jsx(dR,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(hp.Reject,{children:a.jsx(El,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(hp.Idle,{children:a.jsx(dR,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(be,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(be,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(Gt.Panel,{value:"json",pt:"xs",children:a.jsxs(pt,{onSubmit:c,children:[a.jsx(hu,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:vie,deserialize:JSON.parse}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ne,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(Gt,{defaultValue:Object.keys(n)[0],children:[a.jsx(Gt.List,{children:Object.keys(n).map(d=>a.jsx(Gt.Tab,{value:d,children:d},d))}),Object.keys(n).map(d=>a.jsx(Gt.Panel,{value:d,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[d],void 0,2)})},d))]}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ne,{onClick:()=>r({}),children:"Start over"})})]})]})}function xie(){const{resourceType:e}=Ht(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=iu("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(ut,{children:[a.jsxs(Ue,{children:["No apps for ",e]}),a.jsx(St,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(ut,{children:a.jsx("div",{children:r.map(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(St,{to:`/forms/${o.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(Mi,{})}function bie(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(!1);return a.jsx(ut,{width:450,children:a.jsxs(pt,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>o(!0)).catch(c=>n(Qt(c)))},children:[a.jsxs(rr,{direction:"column",align:"center",justify:"center",children:[a.jsx(Bi,{size:32}),a.jsx(Ue,{children:"Change password"})]}),!r&&a.jsxs(Me,{gap:"xl",mt:"xl",children:[a.jsx(no,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:$t(t,"oldPassword")}),a.jsx(no,{name:"newPassword",label:"New password",required:!0,error:$t(t,"newPassword")}),a.jsx(no,{name:"confirmPassword",label:"Confirm new password",required:!0,error:$t(t,"confirmPassword")}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ne,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const Sie=["Form","JSON","Profiles"];function wie(){const{resourceType:e}=Ht();return a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{children:[a.jsxs(be,{p:"md",fw:500,children:["New ",e]}),a.jsx(Jr,{children:a.jsx(n1,{baseUrl:`/${e}/new`,tabs:Sie})})]}),a.jsx(p1,{})]})}function jie(){return a.jsx(ut,{children:a.jsxs(Me,{children:[a.jsx(Ue,{order:1,children:"Unexpected Error"}),a.jsx(be,{children:"We're sorry, something went wrong."}),a.jsxs(be,{children:["Please contact ",a.jsx(Tt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function oO(e){const t=Xt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(St,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,d){c&&d&&n.push({key:c,value:d})}function o(c){c&&r(c.system,c.value)}function s(c,d){Array.isArray(d)?d.forEach(f=>s(c,f)):typeof d=="string"?r(c,d):d&&(Array.isArray(d.coding)?r(c,d.coding.map(f=>f.display||f.code).join(", ")):r(c,d.text))}if("name"in t){const c=Ca(t);c!==It(t)&&r("Name",c)}return"category"in t&&s("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&s("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(o):o(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),a.jsx(yt,{children:n.map((c,d)=>a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:c.key}),a.jsx(yt.Value,{children:c.value})]},`${c.key}-${d}`))})}function Cie(){const{id:e}=Ht(),t=vi(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=Re(),[s,c]=v.useState(!0),[d,f]=v.useState(),[p,m]=v.useState(),[g,y]=v.useState(),[x,S]=v.useState(),[j,C]=v.useState();if(v.useEffect(()=>{const E={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const _=r.split(",").filter(k=>!!k);_.length===1&&E.entry.push({request:{method:"GET",url:_[0]}}),m(_)}o.executeBatch(E).then(_=>{_.entry?.[0]?.response?.status!=="200"?S(_.entry?.[0]?.response?.outcome):(f(_.entry[0]?.resource),y(_.entry[1]?.resource)),c(!1)}).catch(_=>{S(_),c(!1)})},[o,e,r]),x)return a.jsx(ut,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(x,void 0,2)})});if(j)return a.jsxs(ut,{children:[a.jsx(Ue,{children:d?.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[j.length===1&&a.jsx("li",{children:a.jsx(St,{to:j[0],children:"Review your answers"})}),j.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:j.map(E=>a.jsx("li",{children:a.jsx(St,{to:E,children:It(E)})},E.id))})]}),g&&a.jsx("li",{children:a.jsxs(St,{to:g,children:["Back to ",Ca(g)]})}),a.jsx("li",{children:a.jsx(St,{to:"/",children:"Go back home"})})]})]});if(s||!d)return a.jsx(Mi,{});const T=g&&v1(g);return a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{shadow:"xs",radius:0,children:[T&&a.jsx(ZP,{patient:T}),g&&g.resourceType!=="Patient"&&a.jsx(oO,{resource:g}),a.jsx(le,{px:"xl",py:"md",children:a.jsxs(be,{children:[Ca(d),p&&p.length>1&&a.jsxs(a.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),a.jsx(ut,{children:a.jsx(cN,{questionnaire:d,subject:g&&Yt(g),onSubmit:R})})]});async function R(E){const _=[];if(!p||p.length===0)_.push(await o.createResource(E));else for(const k of p)_.push(await o.createResource({...E,subject:{reference:k}}));C(_)}}const Eie="_paper_unw9o_1",Tie={paper:Eie},Rie={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function aO(e,t){const n=e.resourceType||_ie(t),r=e.fields??Die(n),o=e.filters??(e.resourceType?void 0:Aie(n)),s=e.sortRules??kie(n),c=e.offset??0,d=e.count??Wm;return{...e,resourceType:n,fields:r,filters:o,sortRules:s,offset:c,count:d}}function _ie(e){return localStorage.getItem("defaultResourceType")??e?.option?.find(t=>t.id==="defaultResourceType")?.valueString??"Patient"}function Die(e){const t=w1(e);if(t?.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AsyncJob":n.push("status","dataVersion");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function Aie(e){return w1(e)?.filters}function kie(e){const t=w1(e);return t?.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function w1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function Pie(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function Nie(e,t){const n={...e,count:1e3,offset:0},r=aO(n,t.getUserConfiguration()),o=await t.search(r.resourceType,gs({...r,total:"accurate",fields:void 0}));return Ok(o)}function M_(){const e=Re(),t=Yn(),n=vi(),[r,o]=v.useState();return v.useEffect(()=>{const s=Dk(n.pathname+n.search),c=aO(s,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===gs(c)?(Pie(c),o(c)):t(`/${c.resourceType}${gs(c)}`)?.catch(console.error)},[e,t,n]),!r?.resourceType||!r.fields||r.fields.length===0?a.jsx(Mi,{}):a.jsx(Mr,{shadow:"xs",m:"md",p:"xs",className:Tie.paper,children:a.jsx(Su,{checkboxesEnabled:!0,search:r,onClick:s=>t(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onAuxClick:s=>window.open(`/${s.resource.resourceType}/${s.resource.id}`,"_blank"),onChange:s=>{t(`/${r.resourceType}${gs(s.definition)}`)?.catch(console.error)},onNew:()=>{t(Rie[r.resourceType]??`/${r.resourceType}/new`)?.catch(console.error)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+gs(r);e.download(s).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>ke({color:"red",message:Qe(c),autoClose:!1}))},onExportTransactionBundle:async()=>{Nie(r,e).then(s=>aP(JSON.stringify(s,void 0,2))).catch(s=>ke({color:"red",message:Qe(s),autoClose:!1}))},onDelete:s=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:s.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>o({...r})).catch(c=>ke({color:"red",message:Qe(c),autoClose:!1})))},onBulk:s=>{t(`/bulk/${r.resourceType}?ids=${s.join(",")}`)?.catch(console.error)}})})}function Oie(){const[e]=iu("ObservationDefinition","_count=100");return e?a.jsxs(ee,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Method"}),a.jsx("th",{children:"Unit"}),a.jsx("th",{children:"Precision"}),a.jsx("th",{children:"Ranges"})]})}),a.jsx("tbody",{children:e.map(t=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Po,{value:t.category?.[0]})}),a.jsx("td",{children:a.jsx(Po,{value:t.code})}),a.jsx("td",{children:a.jsx(Po,{value:t.method})}),a.jsx("td",{children:t.quantitativeDetails?.unit?.text}),a.jsx("td",{children:t.quantitativeDetails?.decimalPrecision}),a.jsx("td",{children:a.jsx(bb,{ranges:t.qualifiedInterval})})]},t.id))})]}):a.jsx(Mi,{})}function bb(e){const{ranges:t}=e;if(!t)return null;const n=L_(t.map(o=>o.gender));if(n.length>1)return nu(n),a.jsx(a.Fragment,{children:n.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Wn(o)})}),a.jsx(bb,{ranges:e.ranges?.filter(s=>s.gender===o)})]},o))});const r=L_(t.map(o=>o.age&&Ud(o.age)));return r.length>1?(nu(r),a.jsx(a.Fragment,{children:r.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Wn(o)})}),a.jsx(bb,{ranges:e.ranges?.filter(s=>Ud(s.age)===o)})]},o))})):a.jsx(a.Fragment,{children:t.map(o=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:o.condition}),a.jsx("td",{children:a.jsx(qS,{value:o.range})})]})})},`range-${o.condition}`))})}function L_(e){return[...new Set(e.filter(t=>!!t))]}function Mie(){const[e]=iu("ActivityDefinition","_count=100"),[t]=iu("ObservationDefinition","_count=100");return!e||!t?a.jsx(Mi,{}):a.jsxs(ee,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Assay"}),e.map(n=>a.jsx("th",{children:n.name},n.id))]})}),a.jsx("tbody",{children:t.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Po,{value:n.category?.[0]})}),a.jsx("td",{children:a.jsx(Po,{value:n.code})}),e.map(r=>a.jsx("td",{children:r.observationResultRequirement?.find(o=>o.reference?.includes(n.id))?"✅":""},r.id))]},n.id))})]})}function Lie(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(void 0),[s,c]=v.useState(!1),d=v.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),o(m.enrolled)}).catch(m=>ke({color:"red",message:Qe(m),autoClose:!1}))},[e]);v.useEffect(()=>{d()},[d]);const f=v.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{o(!0),ke({color:"green",message:"Success"})}).catch(g=>ke({color:"red",message:Qe(g),autoClose:!1}))},[e]),p=v.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?a.jsxs(ut,{children:[a.jsx(Ln,{title:"Disable MFA",opened:s,onClose:()=>c(!1),children:a.jsx(Qp,{title:"Disable MFA",buttonText:"Submit code",onSubmit:async m=>{await p(m),c(!1),o(!1),ke({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:a.jsx(Pq,{})}),d()}})}),a.jsxs(xe,{children:[a.jsx(Ue,{children:"MFA is enabled"}),a.jsx(Ne,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):a.jsx(ut,{width:400,children:a.jsx(Qp,{title:"Multi Factor Auth Setup",buttonText:"Enroll",qrCodeUrl:t,onSubmit:f})})}const Iie={},Sb={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:Iie?.MEDPLUM_AWS_TEXTRACT_ENABLED};function Lf(){return Sb}function j1(){return sO("registerEnabled")}function zie(){return sO("awsTextractEnabled")}function sO(e){try{return Sb[e]!==!1&&Sb[e]!=="false"}catch{return!0}}function $ie(){const e=Yn(),[t]=xg(),n=Re(),r=t.get("scope")||"openid",[o,s]=v.useState(),[c,d]=v.useState(!0),f=t.get("client_id"),p=t.get("login");if(v.useEffect(()=>{if(!f||f==="medplum-cli")return;async function g(){try{const y=await n.get(`/auth/clientinfo/${f}`);s(y)}catch(y){ke({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Qe(y),withCloseButton:!0})}finally{d(!1)}}g().catch(console.error)},[n,f]),!f)return null;function m(g){const y=new URL(t.get("redirect_uri"));for(const x of["scope","state","nonce"])t.has(x)&&y.searchParams.set(x,t.get(x));y.searchParams.set("code",g),er.assign(y.toString())}return a.jsx(RP,{onCode:m,onForgotPassword:()=>e("/resetpassword")?.catch(console.error),onRegister:()=>e("/register")?.catch(console.error),googleClientId:Lf().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:p||void 0,children:!c&&a.jsxs(a.Fragment,{children:[o?.logo?.url?a.jsx("img",{src:o?.logo?.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):a.jsx(Bi,{size:32}),a.jsx(Ue,{children:o?.welcomeString??"Sign in to Medplum"})]})})}function Uie(){const e=Re(),t=Yn(),n=Lf();return v.useEffect(()=>{e.getProfile()&&t("/signin?project=new")?.catch(console.error)},[e,t]),j1()?a.jsxs(tY,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Bi,{size:32}),a.jsx(Ue,{order:3,py:"lg",children:"Register a new account"})]}):a.jsx(ut,{width:450,children:a.jsx(Fo,{icon:a.jsx(As,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function Bie(){const e=Yn(),[t]=xg(),n=Re(),[r,o]=v.useState(),[s,c]=v.useState(!1),d=Lf().recaptchaSiteKey,f=t.get("project")||void 0;return v.useEffect(()=>{CP(d)},[d]),a.jsx(ut,{width:400,px:"xl",py:"xl",bdrs:"md",children:a.jsxs(pt,{onSubmit:async p=>{o(void 0);try{let m="";d&&(m=await EP(d)),await n.post("auth/resetpassword",{...p,projectId:f,recaptchaToken:m}),c(!0)}catch(m){o(Qt(m))}},children:[a.jsxs(rr,{direction:"column",align:"center",justify:"center",children:[a.jsx(Bi,{size:32}),a.jsx(Ue,{order:3,py:"lg",children:"Reset your password"})]}),a.jsx(ur,{issues:ks(r,void 0),mb:"lg"}),!s&&a.jsxs(a.Fragment,{children:[a.jsx(Me,{gap:"sm",mb:"md",children:a.jsx(He,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:$t(r,"email")})}),a.jsxs(Me,{gap:"xs",children:[a.jsx(cr,{fullWidth:!0,children:"Reset Password"}),a.jsx(be,{size:"sm",mt:"lg",c:"dimmed",style:{textAlign:"center"},"data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:a.jsx(Tt,{onClick:()=>e("/signin")?.catch(console.error),children:"Back to Sign In"})}),j1()&&a.jsxs(be,{size:"sm",mt:"none",c:"dimmed",style:{textAlign:"center"},"data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:["Don't have an account?"," ",a.jsx(Tt,{onClick:()=>e("/register")?.catch(console.error),children:"Sign Up"})]})]})]}),s&&a.jsx(be,{c:"dimmed",size:"sm",ta:"center",mt:"md",children:"If the account exists on our system, a password reset email will be sent."})]})})}function Vie(e){const t=Re(),[n,r]=v.useState(),[o,s]=v.useState();return o?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"Request group created successfully."}),a.jsxs("ul",{children:[a.jsxs("li",{children:["Go to the"," ",a.jsx(St,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(St,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(pt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n?.reference}]}).then(s).catch(console.log)},children:a.jsxs(Me,{children:[a.jsxs(Ue,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(be,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(be,{children:"The following tasks will be created:"}),a.jsx("ul",{children:e.planDefinition.action?.map((c,d)=>a.jsxs("li",{children:[c.definitionCanonical?.startsWith("Questionnaire/")&&"Questionnaire request: ",c.title&&a.jsx(a.Fragment,{children:c.title}),c.code&&a.jsx(Po,{value:c.code[0]})]},`action-${d}`))}),a.jsx(zt,{title:"Subject",children:a.jsx(ys,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Ne,{type:"submit",children:"Go"})})]})})}function Fie(){const{resourceType:e,id:t}=Ht(),n=Xt({reference:e+"/"+t});return n?a.jsx(ut,{children:a.jsx(Vie,{planDefinition:n})}):null}function Hie(){const{resourceType:e,id:t}=Ht(),n=Xt({reference:e+"/"+t}),[r,o]=iu("Questionnaire","subject-type="+e),[s,c]=iu("ClientApplication",{_count:1e3});if(!n||o||c)return a.jsx(Mi,{});const d=s?.filter(m=>qie(e)&&!!m.launchUri);if((!r||r.length===0)&&(!d||d.length===0))return a.jsxs(ut,{children:[a.jsx(Ue,{children:"Apps"}),a.jsxs("p",{children:["No apps found. Contact your administrator or ",a.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,p;return n.resourceType==="Patient"?f=Yt(n):n.resourceType==="Encounter"&&(f=n.subject,p=Yt(n)),a.jsxs(ut,{children:[r?.map(m=>a.jsxs("div",{children:[a.jsx(Ue,{order:3,children:a.jsx(St,{to:`/forms/${m.id}?subject=${It(n)}`,children:m.title||m.name})}),a.jsx(be,{children:m.description})]},m.id)),d?.map(m=>a.jsxs("div",{children:[a.jsx(Ue,{order:3,children:a.jsx(ree,{client:m,patient:f,encounter:p,children:m.name})}),a.jsx(be,{children:m.description})]},m.id))]})}function qie(e){return e==="Patient"||e==="Encounter"}function Gie(){const{resourceType:e,id:t}=Ht(),n=Yn(),[r,o]=v.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:he.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(ut,{children:a.jsx(Su,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function Qie(){const e=Re(),{resourceType:t,id:n}=Ht(),r=e.readHistory(t,n).read();return a.jsx(cf,{maw:1200,children:a.jsx(Bl,{children:a.jsx(GZ,{history:r})})})}const Wie="_hl7Input_k5xm3_1",Yie={hl7Input:Wie};function Kie(e){return a.jsx("iframe",{title:"Bot Runner",frameBorder:"0",src:"https://codeeditor.medplum.com/bot-runner.html",className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function Xie(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),a.jsx("iframe",{title:"Code Editor",frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Ed(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Jie=`{
|
|
225
|
-
"resourceType": "Patient",
|
|
226
|
-
"name": [
|
|
227
|
-
{
|
|
228
|
-
"given": [
|
|
229
|
-
"Alice"
|
|
230
|
-
],
|
|
231
|
-
"family": "Smith"
|
|
232
|
-
}
|
|
233
|
-
]
|
|
234
|
-
}`,Zie="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 eoe(){const e=Re(),{id:t}=Ht(),[n,r]=v.useState(),[o,s]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(Jie),[m,g]=v.useState(Zie),[y,x]=v.useState(tn.FHIR_JSON),S=v.useRef(null),j=v.useRef(null),[C,T]=v.useState(!1);v.useEffect(()=>{e.readResource("Bot",t).then(async P=>{r(P),s(P.runtimeVersion==="vmcontext"?"commonjs":"esnext"),d(await toe(e,P))}).catch(P=>ke({color:"red",message:Qe(P),autoClose:!1}))},[e,t]);const R=v.useCallback(async()=>Ed(S.current,{command:"getValue"}),[]),E=v.useCallback(async()=>Ed(S.current,{command:"getOutput"}),[]),_=v.useCallback(async()=>y===tn.FHIR_JSON?JSON.parse(f):m,[y,f,m]),k=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),T(!0);try{const $=await R(),B=await E(),Q=await e.createAttachment({data:$,filename:"index.ts",contentType:tn.TYPESCRIPT}),K=await e.createAttachment({data:B,filename:o==="commonjs"?"index.cjs":"index.mjs",contentType:tn.JAVASCRIPT}),Z=[{op:"add",path:"/sourceCode",value:Q},{op:"add",path:"/executableCode",value:K}];await e.patchResource("Bot",t,Z),ke({color:"green",message:"Saved"})}catch($){ke({color:"red",message:Qe($),autoClose:!1})}finally{T(!1)}},[e,t,o,R,E]),I=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),T(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),ke({color:"green",message:"Deployed"})}catch($){ke({color:"red",message:Qe($),autoClose:!1})}finally{T(!1)}},[e,t]),D=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),T(!0);try{const $=await _(),B=await e.post(e.fhirUrl("Bot",t,"$execute"),$,y);await Ed(j.current,{command:"setValue",value:B}),ke({color:"green",message:"Success"})}catch($){ke({color:"red",message:Qe($),autoClose:!1})}finally{T(!1)}},[e,t,_,y]);return!n||c===void 0?null:a.jsxs(Rr,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(Rr.Col,{span:8,children:a.jsxs(Mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(Xie,{iframeRef:S,language:"typescript",module:o,testId:"code-frame",defaultValue:c,minHeight:"528px"}),a.jsxs(xe,{justify:"flex-end",gap:"xs",children:[a.jsx(Ne,{type:"button",onClick:k,loading:C,leftSection:a.jsx(Hq,{size:"1rem"}),children:"Save"}),a.jsx(Ne,{type:"button",onClick:I,loading:C,leftSection:a.jsx(NS,{size:"1rem"}),children:"Deploy"}),a.jsx(Ne,{type:"button",onClick:D,loading:C,leftSection:a.jsx(IG,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(Rr.Col,{span:4,children:[a.jsxs(Mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(fn,{data:[{label:"FHIR",value:tn.FHIR_JSON},{label:"HL7",value:tn.HL7_V2}],onChange:P=>x(P.currentTarget.value)}),y===tn.FHIR_JSON?a.jsx(hu,{value:f,onChange:P=>p(P),autosize:!0,minRows:15}):a.jsx("textarea",{className:Yie.hl7Input,value:m,onChange:P=>g(P.currentTarget.value),rows:15})]}),a.jsx(Mr,{m:2,p:"xs",shadow:"md",children:a.jsx(Kie,{iframeRef:j,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function toe(e,t){if(t.sourceCode?.url){const n=t.sourceCode.url?.split("/")?.find(pS);return(await e.download(e.fhirUrl("Binary",n))).text()}return t.code??""}function ws(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function noe(){const e=Re(),{resourceType:t,id:n}=Ht(),r={reference:t+"/"+n},o=v.useCallback(s=>{e.updateResource(ws(s)).then(()=>{ke({color:"green",message:"Success"})}).catch(c=>{ke({color:"red",message:Qe(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(ut,{children:a.jsx(TJ,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(ut,{children:a.jsx(eZ,{questionnaire:r,onSubmit:o})});default:return null}}function roe(){const{resourceType:e,id:t}=Ht(),n=Xt({reference:e+"/"+t}),r=Yn();return n?a.jsx(ut,{children:a.jsx(_Z,{value:n,onStart:(o,s)=>r(`/forms/${Sl(s)}`)?.catch(console.error),onEdit:(o,s,c)=>r(`/${c.reference}}`)?.catch(console.error)})}):null}function ioe(){const e=Re(),{resourceType:t,id:n}=Ht(),r=Yn();return a.jsxs(ut,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(Ne,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)?.catch(console.error)).catch(o=>ke({color:"red",message:Qe(o),autoClose:!1}))},children:"Delete"})]})}const ooe="_selectProfileBtn_tbaz6_1",aoe="_chevron_tbaz6_13",I_={selectProfileBtn:ooe,chevron:aoe};function soe(){const{resourceType:e,id:t}=Ht(),n=Xt({reference:e+"/"+t}),[r,o]=v.useState(),s=Il({onDropdownClose:()=>s.resetSelectedOption()}),c=v.useMemo(()=>{if(Mn(n?.meta?.profile))return[a.jsx(Ke.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(Ke.Option,{value:f,children:f},f))]},[n?.meta?.profile]);if(v.useEffect(()=>{n?.meta?.profile?.length===1&&o(n.meta.profile[0])},[n?.meta?.profile]),!n)return null;let d;return Mn(c)&&(d=a.jsx(xe,{justify:"flex-end",children:a.jsxs(Me,{align:"flex-end",gap:"xs",children:[a.jsxs(Ke,{store:s,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:f=>{o(f),s.closeDropdown()},children:[a.jsx(Ke.Target,{children:a.jsx(Pn,{onClick:()=>s.toggleDropdown(),children:a.jsxs(lf,{fw:"bold",fs:"sm",className:I_.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(PS,{stroke:1.5,className:I_.chevron})]})})}),a.jsx(Ke.Dropdown,{w:"max-content",children:a.jsx(Ke.Options,{children:c})})]}),a.jsx(le,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(be,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(be,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(be,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(ut,{children:a.jsxs(Me,{gap:"xl",children:[d,a.jsx(JS,{value:n,profileUrl:r})]})})}function loe(){const e=Re(),{resourceType:t,id:n}=Ht(),[r,o]=v.useState(),[s,c]=v.useState(),d=Yn(),[f,p]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(x=>{o(mi(x)),c(mi(x))}).catch(x=>{p(Qt(x)),ke({color:"red",message:Qe(x),autoClose:!1})})},[e,t,n]);const m=v.useCallback(x=>{p(void 0),e.updateResource(ws(x)).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),ke({id:"succes",color:"green",message:"Success"})}).catch(S=>{p(Qt(S)),ke({color:"red",message:Qe(S),autoClose:!1})})},[e,t,n,d]),g=v.useCallback(x=>{p(void 0);const S=FP.createPatch(r,ws(x));e.patchResource(t,n,S).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),ke({id:"succes",color:"green",message:"Success"})}).catch(j=>{p(Qt(j)),ke({color:"red",message:Qe(j),autoClose:!1})})},[e,t,n,r,d]),y=v.useCallback(()=>d(`/${t}/${n}/delete`)?.catch(console.error),[d,t,n]);return s?a.jsx(ut,{children:a.jsx(em,{defaultValue:s,onSubmit:m,onPatch:g,onDelete:y,outcome:f})}):null}function coe(){const{resourceType:e,id:t}=Ht(),n=Xt({reference:e+"/"+t});return n?a.jsx(ut,{maw:700,children:n.resourceType==="Patient"?a.jsx(bJ,{patient:n}):a.jsx(Fo,{icon:a.jsx(As,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function lO({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=Re(),[s,c]=v.useState();return v.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(d=>{c(d.filter(LY))}).catch(console.error)},[o,n,r]),a.jsx(Gt,{value:t?.url,onChange:d=>{const f=s?.find(p=>p.url===d);f&&n(f)},children:a.jsx(Gt.List,{children:s?.map(d=>{const f=e.meta?.profile?.includes(d.url),p=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return a.jsx(Gt.Tab,{value:d.url,title:p,rightSection:f&&a.jsx(sS,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(mQ,{size:"90%"})}),children:d.title||d.name},d.url)})})})}function cO(e,t){const n=Re(),r=Yn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(d=>r("/"+d.resourceType+"/"+d.id)).catch(d=>{t&&t(Qt(d)),ke({color:"red",message:Qe(d),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Tx(){const{resourceType:e}=Ht(),t=vi(),[n,r]=v.useState(),{defaultValue:o,handleSubmit:s}=cO(e,r),[c,d]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=v.useCallback(m=>{const g=ws(m);c&&bk(g,c.url),s(g)},[c,s]);return f?a.jsx(ut,{children:a.jsxs(Me,{children:[a.jsx(lO,{resource:o,currentProfile:c,onChange:d}),c?a.jsx(em,{defaultValue:o,onSubmit:p,outcome:n,profileUrl:c.url},c.url):a.jsx(be,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(ut,{children:a.jsx(em,{defaultValue:o,onSubmit:s,outcome:n})})}function z_(){const e=Re(),{resourceType:t,id:n}=Ht(),r=e.readHistory(t,n).read();return a.jsx(ut,{children:a.jsx(ZZ,{history:r})})}function uoe(){const{resourceType:e}=Ht(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:o}=cO(e,n),s=v.useCallback(c=>{o(JSON.parse(c["new-resource"]))},[o]);return a.jsxs(ut,{children:[t&&a.jsx(ur,{outcome:t}),a.jsxs(pt,{onSubmit:s,children:[a.jsx(hu,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:ao(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ne,{type:"submit",children:"OK"})})]})]})}function doe(){const e=Re(),{resourceType:t,id:n}=Ht(),r=Xt({reference:t+"/"+n}),o=Yn(),[s,c]=v.useState(),d=v.useCallback(f=>{e.updateResource(ws(JSON.parse(f.resource))).then(()=>{c(void 0),o(`/${t}/${n}/details`)?.catch(console.error),ke({color:"green",message:"Success"})}).catch(p=>{ke({color:"red",message:Qe(p),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(ut,{children:[s&&a.jsx(ur,{outcome:s}),a.jsxs(pt,{onSubmit:d,children:[a.jsx(hu,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:ao(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ne,{type:"submit",children:"OK"})})]})]}):null}function foe(e){const{resourceType:t,id:n}=e;return a.jsxs(ut,{children:[a.jsxs(Fo,{icon:a.jsx(As,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Tt,{href:`/forms/${n}`,children:`/forms/${n}`})]}),a.jsx(cN,{questionnaire:{reference:t+"/"+n},onSubmit:()=>alert("You submitted the preview")})]})}const hoe="_propertyTable_1xts4_1",poe="_propertiesTitle_1xts4_17",uO={propertyTable:hoe,propertiesTitle:poe};function moe(e){return e.valueCode||e.valueString||(e.valueBoolean===void 0?void 0:String(e.valueBoolean))||(e.valueInteger===void 0?void 0:String(e.valueInteger))||(e.valueDecimal===void 0?void 0:String(e.valueDecimal))||e.valueDate||e.valueDateTime||"N/A"}function goe(e){const{properties:t}=e,n=t.map(r=>{let o="",s="",c="";return r.part?.forEach(d=>{d.name==="code"?o=d.valueCode||"":d.name==="description"?s=d.valueString||"":d.name==="value"&&(c=moe(d))}),{code:o,description:s,value:c}});return a.jsxs(ee,{className:uO.propertyTable,children:[a.jsx(ee.Thead,{children:a.jsxs(ee.Tr,{children:[a.jsx(ee.Th,{children:"Code"}),a.jsx(ee.Th,{children:"Description"}),a.jsx(ee.Th,{children:"Value"})]})}),a.jsx(ee.Tbody,{children:n.map((r,o)=>a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:r.code}),a.jsx(ee.Td,{children:r.description}),a.jsx(ee.Td,{children:r.value})]},`property-${o}`))})]})}function voe(e){const{valueSet:t}=e,n=Re(),r=t.url,[o,s]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(!1),[m,g]=v.useState(),y=v.useCallback(async j=>{if(s(j),d(void 0),g(void 0),!j?.code||!j?.system){p(!1);return}p(!0);try{const C=new URLSearchParams({system:j.system,code:j.code}),T=n.fhirUrl("CodeSystem","$lookup")+"?"+C.toString(),R=await n.get(T);d(R)}catch(C){g(C instanceof Error?C:new Error(String(C)))}finally{p(!1)}},[n]),x=v.useMemo(()=>c?.parameter?.filter(j=>j.name==="property"&&j.part)??[],[c]),S=x.length>0;return a.jsx(ut,{children:a.jsxs(Me,{gap:"xl",children:[a.jsx(Ef,{binding:r,placeholder:"Select a value from the ValueSet",onChange:j=>y(j[0]),defaultValue:o,maxValues:1}),o?a.jsxs(Me,{gap:"md",children:[a.jsxs(Rf,{children:[a.jsx(Ir,{term:"Code",children:o.code}),o.system&&a.jsx(Ir,{term:"System",children:o.system}),o.display&&a.jsx(Ir,{term:"Display",children:o.display})]}),f&&a.jsxs(xe,{gap:"xs",children:[a.jsx(_r,{size:"sm"}),a.jsx(be,{size:"sm",c:"dimmed",children:"Loading properties..."})]}),!f&&m&&a.jsxs(Fo,{icon:a.jsx(As,{size:16}),title:"Lookup Failed",color:"red",children:["Failed to retrieve code information: ",Qe(m)]}),!f&&!m&&S&&a.jsx(IS,{children:a.jsxs(Me,{gap:"xs",mt:"lg",children:[a.jsx(be,{fw:500,size:"sm",c:"dimmed",className:uO.propertiesTitle,children:"Properties"}),a.jsx(goe,{properties:x})]})})]}):null]})})}function yoe(){const{resourceType:e,id:t}=Ht(),n=Xt({reference:e+"/"+t});return n?n.resourceType==="Questionnaire"?a.jsx(foe,{resourceType:e,id:t}):n.resourceType==="ValueSet"?a.jsx(voe,{valueSet:n}):null:null}function xoe(){const e=Re(),{resourceType:t,id:n}=Ht(),[r,o]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(d=>o(mi(d))).catch(d=>{ke({color:"red",message:Qe(d)})})},[e,t,n]),r?a.jsxs(ut,{children:[a.jsxs(Ue,{order:2,children:["Available ",t," profiles"]}),a.jsx(Me,{children:a.jsxs(a.Fragment,{children:[a.jsx(lO,{resource:r,currentProfile:s,onChange:c}),s?a.jsx(boe,{profile:s,resource:r,onResourceUpdated:d=>o(d)},s.url):a.jsx(be,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const boe=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Re(),[o,s]=v.useState(),[c,d]=v.useState(()=>t.meta?.profile?.includes(e.url)),f=v.useCallback(p=>{s(void 0);const m=ws(p);c?bk(m,e.url):UB(m,e.url),r.updateResource(m).then(g=>{n(g),ke({color:"green",message:"Success"})}).catch(g=>{s(Qt(g)),ke({color:"red",message:Qe(g),autoClose:!1})})},[r,e.url,n,c]);return a.jsxs(Me,{children:[a.jsx(hf,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>d(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?a.jsx(em,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Ne,{type:"submit",children:"OK"})})})]})},dO={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},Soe=Object.keys(dO);function woe(){const e=Re(),{id:t}=Ht(),n=Xt({reference:`Questionnaire/${t}`}),[r,o]=v.useState(),[s,c]=v.useState("create"),[d,f]=v.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>joe(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},${It(n)}`:It(n)}`,channel:{type:"rest-hook",endpoint:It(r)},...s?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:s}]}:void 0}).then(()=>{o(void 0),f(Date.now()),e.invalidateSearches("Subscription"),ke({color:"green",message:"Success"})}).catch(g=>ke({color:"red",message:Qe(g),autoClose:!1}))}return a.jsxs(ut,{children:[a.jsx(Ue,{children:"Bots"}),a.jsxs(Me,{children:[p.length===0&&a.jsx("p",{children:"No bots found."}),p.map(g=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(Fl,{value:{reference:g.channel?.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id))]}),a.jsx(Sn,{}),a.jsxs(Me,{mt:10,children:[a.jsx(tf,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),a.jsxs(xe,{children:[a.jsx(Vl,{name:"bot",resourceType:"Bot",onChange:g=>o(g)}),a.jsx(Ne,{onClick:m,children:"Connect"})]}),a.jsx(xe,{children:a.jsx(fn,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:Soe,onChange:g=>c(dO[g.target.value])})})]}),a.jsx("div",{style:{display:"none"},children:d})]})}function joe(e,t){if(!t)return!1;const n=e.criteria||"",r=e.channel?.endpoint||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(It(t))||(t.url?n.includes(t.url):!1))}function Coe(){const{id:e}=Ht(),t=Yn(),r=Re().readReference({reference:`Questionnaire/${e}`}).read(),[o,s]=v.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:he.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return a.jsx(ut,{children:a.jsx(Su,{search:o,onClick:c=>t(`/${c.resource.resourceType}/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})})}function Eoe(){const e=Re(),{resourceType:t,id:n}=Ht(),r=Xt({reference:t+"/"+n}),o=v.useCallback(s=>{e.updateResource(ws(s)).then(()=>{ke({color:"green",message:"Success"})}).catch(c=>{ke({color:"red",message:Qe(c),autoClose:!1})})},[e]);return r?a.jsx(ut,{children:a.jsx(bZ,{onSubmit:o,definition:r})}):null}function Toe(){const{resourceType:e,id:t}=Ht(),n=Xt({reference:e+"/"+t});return n?a.jsx(ut,{children:e==="MeasureReport"?a.jsx(yJ,{measureReport:n}):a.jsx(XS,{value:n})}):null}const Roe="_container_1ue98_1",_oe="_entry_1ue98_14",Doe="_active_1ue98_21",Rx={container:Roe,entry:_oe,active:Doe};function Aoe(e){const t=Re(),n=Xt(e.value),[r,o]=v.useState();return v.useEffect(()=>{if(!n)return;const s=v1(n);if(!s)return;const c="reference"in s?s.reference:It(s);t.search("ServiceRequest","subject="+c).then(d=>{const p=(d.entry??[]).map(m=>m.resource);HP(p),p.reverse(),o(p)}).catch(d=>ke({color:"red",message:Qe(d),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:Rx.container,children:r.map(s=>a.jsxs("div",{className:Ut(Rx.entry,{[Rx.active]:s.id===n?.id}),children:[a.jsx("p",{children:a.jsx(St,{to:s,children:koe(s)})}),s.category?.[0]?.text&&a.jsx("p",{children:s.category[0]?.text}),s.code?.coding?.[0]?.code&&a.jsx("p",{children:s.code.coding[0]?.code}),a.jsx("p",{children:Poe(s)})]},s.id))}):null}function koe(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function Poe(e){return e.authoredOn?e.authoredOn.substring(0,10):e.meta?.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const Noe="_container_1l2dh_1",Ooe={container:Noe};function Moe(e){const t=Xt(e.valueSet);if(!t)return null;const n=[""],r=t.compose?.include?.[0]?.concept?.map(o=>o.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:Ooe.container,children:a.jsx(fn,{defaultValue:e.defaultValue,onChange:o=>e.onChange(o.currentTarget.value),data:n})})}function Loe(e){const t=Xt(e.specimen);return t?a.jsxs(yt,{children:[a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Type"}),a.jsx(yt.Value,{children:"Specimen"})]}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Collected"}),a.jsx(yt.Value,{children:Dr(t.collection?.collectedDateTime)})]}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Specimen Age"}),a.jsx(yt.Value,{children:Ioe(t)})]}),t.collection?.collectedDateTime&&t.receivedTime?a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Specimen Stability"}),a.jsx(yt.Value,{children:zoe(t)})]}):a.jsx(a.Fragment,{})]}):null}function Ioe(e){const t=e.collection?.collectedDateTime;if(!t)return;const n=new Date(t);return fO(hO(n,new Date))}function zoe(e){if(!e.collection?.collectedDateTime||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return fO(hO(t,n))}function fO(e){return e.toString().padStart(3,"0")+"D"}function hO(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function $oe(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==="ValueSet"&&t.push("Preview"),(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 Uoe(){const e=Re(),{resourceType:t,id:n}=Ht(),r={reference:t+"/"+n},[o,s]=v.useState(),c=Xt(r,s),d=$oe(t);async function f(){const j=(await e.readHistory(t,n)).entry?.find(C=>!!C.resource)?.resource;j?p(j):ke({color:"red",message:"No history to restore",autoClose:!1})}function p(S){e.updateResource(ws(S)).then(()=>{s(void 0),ke({color:"green",message:"Success"})}).catch(j=>{ke({color:"red",message:Qe(j),autoClose:!1})})}if(o)return X8(o)?a.jsxs(ut,{children:[a.jsx(Ue,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(Ne,{color:"red",onClick:f,children:"Restore"})]}):a.jsx(ur,{outcome:o});function m(S){const j=c,C=j.orderDetail||[];C.length===0&&C.push({}),C[0].text!==S&&(C[0].text=S,p({...j,orderDetail:C}))}const g=c&&v1(c),y=c&&Mne(c),x=e.getUserConfiguration()?.option?.find(S=>S.id==="statusValueSet")?.valueString;return a.jsxs(a.Fragment,{children:[c?.resourceType==="ServiceRequest"&&x&&a.jsx(Moe,{valueSet:{reference:x},defaultValue:c.orderDetail?.[0]?.text,onChange:m},It(c)+"-"+c.orderDetail?.[0]?.text),c&&a.jsx(Aoe,{value:c}),c&&a.jsxs(Mr,{children:[g&&a.jsx(ZP,{patient:g}),y&&a.jsx(Loe,{specimen:y}),t!=="Patient"&&a.jsx(oO,{resource:r}),a.jsx(Jr,{children:a.jsx(n1,{baseUrl:`/${t}/${n}`,tabs:d})})]}),a.jsx(p1,{})]})}function pp(){const e=Yn(),{resourceType:t,id:n,versionId:r,tab:o}=Ht(),s=Re(),[c,d]=v.useState(!0),[f,p]=v.useState(),[m,g]=v.useState();if(v.useEffect(()=>{g(void 0),d(!0),s.readHistory(t,n).then(E=>p(E)).then(()=>d(!1)).catch(E=>{g(E),d(!1)})},[s,t,n]),c)return a.jsx(Mi,{});const y=f?.entry??[],x=y.findIndex(E=>E.resource?.meta?.versionId===r);if(x===-1)return a.jsxs(ut,{children:[a.jsx(Ue,{children:"Version not found"}),a.jsx(St,{to:`/${t}/${n}`,children:"Return to resource"})]});const S=y[x].resource,j=x<y.length-1?y[x+1].resource:void 0,C="diff",T=o||C,R=y.length-x;return a.jsx(cf,{maw:1200,children:a.jsx(Bl,{children:a.jsxs(Me,{gap:"lg",children:[m&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),a.jsxs(Fm,{cols:2,mb:"lg",children:[a.jsx(Ui,{total:y.length,value:R,getControlProps:YP,onChange:E=>e(`/${t}/${n}/_history/${y[y.length-E]?.resource?.meta?.versionId}/${T}`)?.catch(console.error)}),a.jsx(xe,{justify:"right",children:a.jsx(eu,{data:[{value:"diff",label:"Diff"},{value:"raw",label:"Raw"}],value:T,onChange:E=>e(`/${t}/${n}/_history/${r}/${E||C}`)?.catch(console.error)})})]}),a.jsx(le,{mb:"lg",children:a.jsxs(Rf,{compact:!0,children:[a.jsx(Ir,{term:"Version ID",children:S.meta?.versionId}),a.jsx(Ir,{term:"Author",children:a.jsx(Gc,{value:S.meta?.author,link:!0},S.meta?.author?.reference)}),a.jsx(Ir,{term:"Date/Time",children:Dr(S.meta?.lastUpdated)})]})}),T==="diff"&&a.jsx(YZ,{original:j??{resourceType:t,id:n},revised:S}),T==="raw"&&a.jsx("pre",{style:{fontSize:"9pt"},children:JSON.stringify(S,void 0,2)})]})})})}function Boe(){const{resourceType:e,id:t}=Ht(),n=Yn(),[r,o]=v.useState({resourceType:"Subscription",filters:[{code:"url",operator:he.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(ut,{children:a.jsx(Su,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function Voe(e){const t=Re(),{resource:n,opened:r,onClose:o}=e,[s,c]=v.useState(!1),[d,f]=v.useState(),[p,m]=v.useState(!1),g=v.useCallback(async()=>{if(n?.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:s&&d?It(d):void 0,verbose:p}),ke({color:"green",message:"Done"}),o()}catch(y){ke({color:"red",message:Qe(y),autoClose:!1})}},[t,n,o,s,d,p]);return a.jsx(Ln,{opened:r,onClose:o,title:"Resend Subscriptions",children:a.jsx(pt,{onSubmit:g,children:a.jsxs(Me,{children:[a.jsx(un,{label:"Choose subscription (all subscriptions by default)",onChange:y=>c(y.currentTarget.checked)}),s&&a.jsx(Vl,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),a.jsx(un,{label:"Verbose mode",onChange:y=>m(y.currentTarget.checked)}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ne,{type:"submit",children:"Resend"})})]})})})}function $_(){const e=Re(),t=yu(),{resourceType:n,id:r}=Ht(),o={reference:n+"/"+r},[s,c]=v.useState(),d=Pl(!1);function f(R,E){return e.updateResource({...R,priority:E})}function p(R,E){f(R,"stat").then(E).catch(console.error)}function m(R,E){f(R,"routine").then(E).catch(console.error)}function g(R){t(`/${R.resourceType}/${R.id}`)}function y(R){t(`/${R.resourceType}/${R.id}/edit`)}function x(R){t(`/${R.resourceType}/${R.id}/delete`)}function S(R){c(R),d[1].open()}function j(R){t(`/${R.resourceType}/${R.id}/_history/${R.meta?.versionId}`)}function C(R,E){const _="aws-textract";ke({id:_,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(R.resourceType,R.id,"$aws-textract"),{}).then(()=>{E(),cl({id:_,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:a.jsx(Go,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(k=>cl({id:_,title:"AWS Textract Error",color:"red",message:Qe(k),icon:a.jsx(El,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function T(R){const{primaryResource:E,currentResource:_,reloadTimeline:k}=R,I=_.resourceType===E.resourceType&&_.id===E.id,D=_.resourceType==="Communication"&&_.priority!=="stat",P=_.resourceType==="Communication"&&_.priority==="stat",$=I,B=!I,Q=!I,K=!I,Z=e.getProjectMembership()?.admin,U=Z,G=zie()&&(_.resourceType==="DocumentReference"||_.resourceType==="Media");return a.jsxs(Se.Dropdown,{children:[a.jsx(Se.Label,{children:"Resource"}),D&&a.jsx(Se.Item,{leftSection:a.jsx(NG,{size:14}),onClick:()=>p(_,k),"aria-label":`Pin ${It(_)}`,children:"Pin"}),P&&a.jsx(Se.Item,{leftSection:a.jsx(MG,{size:14}),onClick:()=>m(_,k),"aria-label":`Unpin ${It(_)}`,children:"Unpin"}),B&&a.jsx(Se.Item,{leftSection:a.jsx(uR,{size:14}),onClick:()=>g(_),"aria-label":`Details ${It(_)}`,children:"Details"}),$&&a.jsx(Se.Item,{leftSection:a.jsx(uR,{size:14}),onClick:()=>j(_),"aria-label":`Details ${It(_)}`,children:"Details"}),Q&&a.jsx(Se.Item,{leftSection:a.jsx(tP,{size:14}),onClick:()=>y(_),"aria-label":`Edit ${It(_)}`,children:"Edit"}),Z&&a.jsxs(a.Fragment,{children:[a.jsx(Se.Divider,{}),a.jsx(Se.Label,{children:"Admin"}),U&&a.jsx(Se.Item,{leftSection:a.jsx(HG,{size:14}),onClick:()=>S(_),"aria-label":`Resend Subscriptions ${It(_)}`,children:"Resend Subscriptions"})]}),G&&a.jsxs(a.Fragment,{children:[a.jsx(Se.Divider,{}),a.jsx(Se.Label,{children:"AWS AI"}),a.jsx(Se.Item,{leftSection:a.jsx(lQ,{size:14}),onClick:()=>C(_,k),"aria-label":`AWS Textract ${It(_)}`,children:"AWS Textract"})]}),K&&a.jsxs(a.Fragment,{children:[a.jsx(Se.Divider,{}),a.jsx(Se.Label,{children:"Danger zone"}),a.jsx(Se.Item,{color:"red",leftSection:a.jsx(tg,{size:14}),onClick:()=>x(_),"aria-label":`Delete ${It(_)}`,children:"Delete"})]})]})}return a.jsxs(a.Fragment,{children:[n==="Encounter"&&a.jsx(sX,{encounter:o,getMenu:T}),n==="Patient"&&a.jsx(jJ,{patient:o,getMenu:T}),n==="ServiceRequest"&&a.jsx(nee,{serviceRequest:o,getMenu:T}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&a.jsx(aX,{resource:o,getMenu:T}),a.jsx(Voe,{resource:s,opened:d[0],onClose:d[1].close},`resend-subscriptions-${s?.id}`)]})}function Foe(e){const{opened:t,close:n,version:r,loadingStatus:o,handleStatus:s,handleUpgrade:c}=e,[d,f]=v.useState(),[p,m]=v.useState(!1);return v.useEffect(()=>{t&&(d||yH("app-tools-page").then(f).catch(console.error),s())},[t,d,s]),d&&r&&!o?r==="unknown"?a.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(d)?a.jsxs("p",{children:["This agent is already on the latest version (",d,")."]}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",d,"?"]}),a.jsxs(xe,{children:[a.jsx(Ne,{onClick:()=>{c(p),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),a.jsx(un,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):a.jsx(Mi,{})}function Hoe(){const e=Re(),{id:t}=Ht(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=v.useState(!1),[s,c]=v.useState(!1),[d,f]=v.useState(!1),[p,m]=v.useState(!1),[g,y]=v.useState(),[x,S]=v.useState(),[j,C]=v.useState(),[T,R]=v.useState(),[E,_]=v.useState(!1),[k,I]=v.useState(!1),[D,P]=v.useState(),[$,{open:B,close:Q}]=Pl(!1);v.useEffect(()=>{if(r||s||d||E){I(!0);return}I(!1)},[r,s,d,E]);const K=v.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(F=>{y(F.parameter?.find(Y=>Y.name==="status")?.valueCode),S(F.parameter?.find(Y=>Y.name==="version")?.valueString),C(F.parameter?.find(Y=>Y.name==="lastUpdated")?.valueInstant)}).catch(F=>z(Qe(F))).finally(()=>o(!1))},[e,t]),Z=v.useCallback(F=>{const Y=F.host,O=F.pingCount||1;Y&&(_(!0),e.pushToAgent(n,Y,`PING ${O}`,tn.PING,!0).then(H=>R(H)).catch(H=>z(Qe(H))).finally(()=>_(!1)))},[e,n]),U=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(F=>{L("Agent config reloaded successfully.")}).catch(F=>z(Qe(F))).finally(()=>c(!1))},[e,t]),G=v.useCallback(F=>{f(!0);const Y=e.fhirUrl("Agent",t,"$upgrade");Y.searchParams.set("force",String(F)),e.get(Y,{cache:"reload"}).then(O=>{L("Agent upgraded successfully.")}).catch(O=>z(Qe(O))).finally(()=>f(!1))},[e,t]),M=v.useCallback(F=>{m(!0);const Y=F.logLimit||20;e.get(e.fhirUrl("Agent",t,`$fetch-logs${Y!==void 0?`?limit=${Y}`:""}`),{cache:"reload"}).then(O=>{const H=O?.parameter?.find(se=>se.name==="logs");H&&P(H?.valueString)}).catch(O=>z(Qe(O))).finally(()=>m(!1))},[e,t]);function L(F){ke({color:"green",title:"Success",icon:a.jsx(Go,{size:"1rem"}),message:F})}function z(F){ke({color:"red",title:"Error",message:F,autoClose:!1})}return a.jsxs(ut,{children:[a.jsx(Ln,{opened:$,onClose:Q,title:"Upgrade Agent",centered:!0,children:a.jsx(Foe,{opened:$,close:Q,version:x,loadingStatus:r,handleStatus:K,handleUpgrade:G})}),a.jsx(Ue,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(Fl,{value:n,link:!0})]}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Agent Status"}),a.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),a.jsx(Ne,{onClick:K,loading:r,disabled:k&&!r,children:"Get Status"}),!r&&g&&a.jsx(ee,{children:a.jsxs(ee.Tbody,{children:[a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:"Status"}),a.jsx(ee.Td,{children:a.jsx(dg,{status:g})})]}),a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:"Version"}),a.jsx(ee.Td,{children:x})]}),a.jsxs(ee.Tr,{children:[a.jsx(ee.Td,{children:"Last Updated"}),a.jsx(ee.Td,{children:Dr(j,void 0,{timeZoneName:"longOffset"})})]})]})}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Reload Config"}),a.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),a.jsx(Ne,{onClick:U,loading:s,disabled:k&&!s,"aria-label":"Reload config",children:"Reload Config"}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Upgrade Agent"}),a.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),a.jsx(Ne,{onClick:B,loading:d,disabled:k&&!d,"aria-label":"Upgrade agent",children:"Upgrade"}),a.jsx(Sn,{my:"lg"}),a.jsxs(pt,{onSubmit:M,children:[a.jsx(Ue,{order:2,children:"Fetch Logs"}),a.jsx("p",{children:"Fetch logs from the agent."}),D?.length?a.jsx(lf,{block:!0,mb:15,children:D}):null,a.jsxs(xe,{children:[a.jsx(bl,{w:100,id:"logLimit",name:"logLimit",placeholder:"20",label:"Log Limit"}),a.jsx(Ne,{mt:22,loading:p,disabled:k&&!p,"aria-label":"Fetch logs",type:"submit",children:"Fetch Logs"})]})]}),a.jsx(Sn,{my:"lg"}),a.jsx(Ue,{order:2,children:"Ping from Agent"}),a.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),a.jsx(pt,{onSubmit:Z,children:a.jsxs(xe,{children:[a.jsx(He,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(En,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:E,disabled:k&&!E,children:a.jsx(WG,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(bl,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!E&&T&&a.jsxs(a.Fragment,{children:[a.jsx(Ue,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:T})]})]})}function qoe(){const e=Yn(),t=Re(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(s=>ke({color:"red",message:Qe(s),autoClose:!1}))},[t]);function o(s){t.post("auth/revoke",{loginId:s}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>ke({color:"green",message:"Login revoked"})).catch(c=>ke({color:"red",message:Qe(c),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(ut,{children:[a.jsx(Ue,{children:"Security"}),a.jsxs(Rf,{children:[a.jsx(Ir,{term:"ID",children:a.jsx(Tt,{href:`/${It(n.profile)}`,children:n.profile.id})}),a.jsx(Ir,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(Ir,{term:"Name",children:Pa(n.profile.name?.[0])})]})]}),a.jsxs(ut,{children:[a.jsx(Ue,{children:"Sessions"}),a.jsxs(ee,{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"OS"}),a.jsx("th",{children:"Browser"}),a.jsx("th",{children:"IP Address"}),a.jsx("th",{children:"Auth Method"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.security.sessions.map(s=>a.jsxs("tr",{children:[a.jsx("td",{children:s.os}),a.jsx("td",{children:s.browser}),a.jsx("td",{children:s.remoteAddress}),a.jsx("td",{children:s.authMethod}),a.jsx("td",{children:Dr(s.lastUpdated)}),a.jsx("td",{children:a.jsx(Tt,{href:"#",onClick:()=>o(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(ut,{children:[a.jsx(Ue,{children:"Password"}),a.jsx(Ne,{onClick:()=>e("/changepassword")?.catch(console.error),children:"Change password"})]}),a.jsxs(ut,{children:[a.jsx(Ue,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(Ne,{onClick:()=>e("/mfa")?.catch(console.error),children:"Enroll"})]})]}):null}function Goe(){const{id:e,secret:t}=Ht(),n=Re(),[r,o]=v.useState(),[s,c]=v.useState(!1),d=ks(r,void 0);return a.jsxs(ut,{width:450,children:[a.jsx(ur,{issues:d}),a.jsxs(pt,{onSubmit:f=>{if(f.password!==f.confirmPassword){o(Ao("Passwords do not match","confirmPassword"));return}o(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>o(Qt(m)))},children:[a.jsxs(rr,{direction:"column",align:"center",justify:"center",children:[a.jsx(Bi,{size:32}),a.jsx(Ue,{children:"Set password"})]}),!s&&a.jsxs(Me,{children:[a.jsx(no,{name:"password",label:"New password",required:!0,error:$t(r,"password")}),a.jsx(no,{name:"confirmPassword",label:"Confirm new password",required:!0,error:$t(r,"confirmPassword")}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Ne,{type:"submit",children:"Set password"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(St,{to:"/signin",children:"sign in"}),"."]})]})]})}function Qoe(){const e=Sf(),t=Yn(),[n]=xg(),r=Lf(),o=v.useCallback(()=>{const s=n.get("next");t(s?.startsWith("/")?s:"/")?.catch(console.error)},[n,t]);return v.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),a.jsxs(RP,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword")?.catch(console.error),onRegister:j1()?()=>t("/register")?.catch(console.error):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[a.jsx(Bi,{size:32}),n.get("project")!=="new"&&a.jsxs(Ue,{order:3,py:"lg",ta:"center",children:["Sign in to ",sP()]}),n.get("project")==="new"&&a.jsx(Ue,{order:3,py:"lg",ta:"center",children:"Sign in again to create a new project"})]})}function Woe(){const e=Yn(),t=vi(),[n,r]=v.useState(),[o,s]=v.useState(),[c,d]=v.useState();return v.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),s(f.query),d(JSON.parse(f.fields))},[t]),!n||!o||!c?null:a.jsx(iJ,{resourceType:n,checkboxesEnabled:!0,query:o,fields:c,onClick:f=>e(`/${n}/${f.resource.id}`)?.catch(console.error),onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{e(`/bulk/${n}?ids=${f.join(",")}`)?.catch(console.error)}})}function Yoe(){const{id:e,secret:t}=Ht(),n=Re(),[r,o]=v.useState(),[s,c]=v.useState(!1),d=ks(r,void 0);return a.jsxs(ut,{width:450,children:[a.jsx(ur,{issues:d}),a.jsxs(pt,{onSubmit:()=>{o(void 0);const f={id:e,secret:t};n.post("auth/verifyemail",f).then(()=>c(!0)).catch(p=>o(Qt(p)))},children:[a.jsxs(rr,{direction:"column",align:"center",justify:"center",children:[a.jsx(Bi,{size:32}),a.jsx(Ue,{children:"Email address verification required"})]}),!s&&a.jsxs(Me,{children:[a.jsx("p",{children:"In order to sign in, click the button below to verify your ability to receive email at the address this link was sent to."}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Ne,{type:"submit",children:"Verify email"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Email verified. You can now ",a.jsx(St,{to:"/signin",children:"sign in"}),"."]})]})]})}function Koe(){return a.jsx(Jte,{children:a.jsxs(Fe,{errorElement:a.jsx(jie,{}),children:[a.jsx(Fe,{path:"/signin",element:a.jsx(Qoe,{})}),a.jsx(Fe,{path:"/oauth",element:a.jsx($ie,{})}),a.jsx(Fe,{path:"/resetpassword",element:a.jsx(Bie,{})}),a.jsx(Fe,{path:"/setpassword/:id/:secret",element:a.jsx(Goe,{})}),a.jsx(Fe,{path:"/verifyemail/:id/:secret",element:a.jsx(Yoe,{})}),a.jsx(Fe,{path:"/register",element:a.jsx(Uie,{})}),a.jsx(Fe,{path:"/changepassword",element:a.jsx(bie,{})}),a.jsx(Fe,{path:"/security",element:a.jsx(qoe,{})}),a.jsx(Fe,{path:"/mfa",element:a.jsx(Lie,{})}),a.jsx(Fe,{path:"/batch",element:a.jsx(yie,{})}),a.jsx(Fe,{path:"/bulk/:resourceType",element:a.jsx(xie,{})}),a.jsx(Fe,{path:"/smart",element:a.jsx(Woe,{})}),a.jsx(Fe,{path:"/forms/:id",element:a.jsx(Cie,{})}),a.jsx(Fe,{path:"/admin/super",element:a.jsx(ure,{})}),a.jsx(Fe,{path:"/admin/super/asyncjob",element:a.jsx(ire,{})}),a.jsx(Fe,{path:"/admin/super/db",element:a.jsx(Wne,{})}),a.jsx(Fe,{path:"/admin/config",element:a.jsx(Zne,{})}),a.jsxs(Fe,{path:"/admin",element:a.jsx(tre,{}),children:[a.jsx(Fe,{path:"patients",element:a.jsx(Jne,{})}),a.jsx(Fe,{path:"bots/new",element:a.jsx(zne,{})}),a.jsx(Fe,{path:"bots",element:a.jsx(Lne,{})}),a.jsx(Fe,{path:"clients/new",element:a.jsx($ne,{})}),a.jsx(Fe,{path:"clients",element:a.jsx(Ine,{})}),a.jsx(Fe,{path:"details",element:a.jsx(b_,{})}),a.jsx(Fe,{path:"invite",element:a.jsx(Xne,{})}),a.jsx(Fe,{path:"users",element:a.jsx(hre,{})}),a.jsx(Fe,{path:"project",element:a.jsx(b_,{})}),a.jsx(Fe,{path:"secrets",element:a.jsx(nre,{})}),a.jsx(Fe,{path:"sites",element:a.jsx(rre,{})}),a.jsx(Fe,{path:"members/:membershipId",element:a.jsx(Kne,{})})]}),a.jsx(Fe,{path:"/lab/assays",element:a.jsx(Oie,{})}),a.jsx(Fe,{path:"/lab/panels",element:a.jsx(Mie,{})}),a.jsxs(Fe,{path:"/:resourceType/new",element:a.jsx(wie,{}),children:[a.jsx(Fe,{index:!0,element:a.jsx(Tx,{})}),a.jsx(Fe,{path:"form",element:a.jsx(Tx,{})}),a.jsx(Fe,{path:"json",element:a.jsx(uoe,{})}),a.jsx(Fe,{path:"profiles",element:a.jsx(Tx,{})})]}),a.jsxs(Fe,{path:"/:resourceType/:id",element:a.jsx(Uoe,{}),children:[a.jsx(Fe,{index:!0,element:a.jsx($_,{})}),a.jsx(Fe,{path:"apply",element:a.jsx(Fie,{})}),a.jsx(Fe,{path:"apps",element:a.jsx(Hie,{})}),a.jsx(Fe,{path:"event",element:a.jsx(Gie,{})}),a.jsx(Fe,{path:"blame",element:a.jsx(Qie,{})}),a.jsx(Fe,{path:"bots",element:a.jsx(woe,{})}),a.jsx(Fe,{path:"builder",element:a.jsx(noe,{})}),a.jsx(Fe,{path:"checklist",element:a.jsx(roe,{})}),a.jsx(Fe,{path:"delete",element:a.jsx(ioe,{})}),a.jsx(Fe,{path:"details",element:a.jsx(soe,{})}),a.jsx(Fe,{path:"edit",element:a.jsx(loe,{})}),a.jsx(Fe,{path:"editor",element:a.jsx(eoe,{})}),a.jsxs(Fe,{path:"history",children:[a.jsx(Fe,{index:!0,element:a.jsx(z_,{})}),a.jsx(Fe,{path:":versionId/:tab",element:a.jsx(pp,{})}),a.jsx(Fe,{path:":versionId",element:a.jsx(pp,{})})]}),a.jsxs(Fe,{path:"_history",children:[a.jsx(Fe,{index:!0,element:a.jsx(z_,{})}),a.jsx(Fe,{path:":versionId/:tab",element:a.jsx(pp,{})}),a.jsx(Fe,{path:":versionId",element:a.jsx(pp,{})})]}),a.jsx(Fe,{path:"json",element:a.jsx(doe,{})}),a.jsx(Fe,{path:"preview",element:a.jsx(yoe,{})}),a.jsx(Fe,{path:"responses",element:a.jsx(Coe,{})}),a.jsx(Fe,{path:"report",element:a.jsx(Toe,{})}),a.jsx(Fe,{path:"ranges",element:a.jsx(Eoe,{})}),a.jsx(Fe,{path:"subscriptions",element:a.jsx(Boe,{})}),a.jsx(Fe,{path:"timeline",element:a.jsx($_,{})}),a.jsx(Fe,{path:"tools",element:a.jsx(Hoe,{})}),a.jsx(Fe,{path:"profiles",element:a.jsx(xoe,{})}),a.jsx(Fe,{path:"export",element:a.jsx(coe,{})})]}),a.jsx(Fe,{path:"/:resourceType",element:a.jsx(M_,{})}),a.jsx(Fe,{path:"/",element:a.jsx(M_,{})})]})})}function Xoe(){const e=Re(),t=e.getUserConfiguration(),n=vi(),[r]=xg();return e.isLoading()?a.jsx(Mi,{}):a.jsx(BW,{logo:a.jsx(Bi,{size:24}),pathname:n.pathname,searchParams:r,version:Ik,menus:Joe(t),displayAddBookmark:!!t?.id,children:a.jsx(v.Suspense,{fallback:a.jsx(Mi,{}),children:a.jsx(Koe,{})})})}function Joe(e){const t=e?.menu?.map(n=>({title:n.title,links:n.link?.map(r=>({label:r.name,href:r.target,icon:Zoe(r.target)}))||[]}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(vG,{})}]}),t}const U_={Patient:nQ,Practitioner:uG,Organization:Eq,ServiceRequest:BG,DiagnosticReport:GG,Questionnaire:lG,Project:aG,admin:vq,AccessPolicy:mG,Subscription:fQ,batch:DG,Observation:EG};function Zoe(e){if(e.includes("admin/super/db"))return a.jsx(Vq,{});try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in U_){const n=U_[t];return a.jsx(n,{})}}catch{}}async function eae(){const e=Lf(),t=new zk({baseUrl:e.baseUrl,clientId:e.clientId,storagePrefix:"@medplum:",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=jne([{path:"*",element:a.jsx(Xoe,{})}]),o=c=>r.navigate(c);lee.createRoot(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(xH,{medplum:t,navigate:o,children:a.jsxs(u2,{theme:n,children:[a.jsx(ka,{position:"bottom-right"}),a.jsx(Wte,{router:r})]})})}))}eae().catch(console.error);
|
|
235
|
-
//# sourceMappingURL=index-YtQHiULj.js.map
|