@medplum/app 5.0.7 → 5.0.9
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-CIU-2_9Z.js +263 -0
- package/dist/assets/index-CIU-2_9Z.js.map +1 -0
- package/dist/assets/{index-DW9C_fts.css → index-D19_yc6c.css} +1 -1
- package/dist/index.html +3 -3
- package/package.json +10 -10
- package/dist/assets/index-CjxNlO-J.js +0 -263
- package/dist/assets/index-CjxNlO-J.js.map +0 -1
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
function X3(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 Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sy={exports:{}},rd={};var JC;function J3(){if(JC)return rd;JC=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 rd.Fragment=t,rd.jsx=n,rd.jsxs=n,rd}var ZC;function Z3(){return ZC||(ZC=1,Sy.exports=J3()),Sy.exports}var a=Z3(),bo=function(){return bo=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},bo.apply(this,arguments)};function R2(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 jl(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 eM(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 wy={exports:{}},gt={};var eE;function tM(){if(eE)return gt;eE=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 b(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 R(O,F,ae){this.props=O,this.context=F,this.refs=C,this.updater=ae||S}R.prototype.isReactComponent={},R.prototype.setState=function(O,F){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,F,"setState")},R.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=R.prototype;function T(O,F,ae){this.props=O,this.context=F,this.refs=C,this.updater=ae||S}var _=T.prototype=new E;_.constructor=T,j(_,R.prototype),_.isPureReactComponent=!0;var k=Array.isArray;function I(){}var A={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function z(O,F,ae){var ue=ae.ref;return{$$typeof:e,type:O,key:F,ref:ue!==void 0?ue:null,props:ae}}function B(O,F){return z(O.type,F,O.props)}function Y(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function J(O){var F={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ae){return F[ae]})}var Z=/\/+/g;function $(O,F){return typeof O=="object"&&O!==null&&O.key!=null?J(""+O.key):F.toString(36)}function Q(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(F){O.status==="pending"&&(O.status="fulfilled",O.value=F)},function(F){O.status==="pending"&&(O.status="rejected",O.reason=F)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function M(O,F,ae,ue,be){var we=typeof O;(we==="undefined"||we==="boolean")&&(O=null);var Ce=!1;if(O===null)Ce=!0;else switch(we){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(O.$$typeof){case e:case t:Ce=!0;break;case m:return Ce=O._init,M(Ce(O._payload),F,ae,ue,be)}}if(Ce)return be=be(O),Ce=ue===""?"."+$(O,0):ue,k(be)?(ae="",Ce!=null&&(ae=Ce.replace(Z,"$&/")+"/"),M(be,F,ae,"",function(ft){return ft})):be!=null&&(Y(be)&&(be=B(be,ae+(be.key==null||O&&O.key===be.key?"":(""+be.key).replace(Z,"$&/")+"/")+Ce)),F.push(be)),1;Ce=0;var nt=ue===""?".":ue+":";if(k(O))for(var De=0;De<O.length;De++)ue=O[De],we=nt+$(ue,De),Ce+=M(ue,F,ae,we,be);else if(De=b(O),typeof De=="function")for(O=De.call(O),De=0;!(ue=O.next()).done;)ue=ue.value,we=nt+$(ue,De++),Ce+=M(ue,F,ae,we,be);else if(we==="object"){if(typeof O.then=="function")return M(Q(O),F,ae,ue,be);throw F=String(O),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function L(O,F,ae){if(O==null)return O;var ue=[],be=0;return M(O,ue,"","",function(we){return F.call(ae,we,be++)}),ue}function U(O){if(O._status===-1){var F=O._result;F=F(),F.then(function(ae){(O._status===0||O._status===-1)&&(O._status=1,O._result=ae)},function(ae){(O._status===0||O._status===-1)&&(O._status=2,O._result=ae)}),O._status===-1&&(O._status=0,O._result=F)}if(O._status===1)return O._result.default;throw O._result}var V=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=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(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},K={map:L,forEach:function(O,F,ae){L(O,function(){F.apply(this,arguments)},ae)},count:function(O){var F=0;return L(O,function(){F++}),F},toArray:function(O){return L(O,function(F){return F})||[]},only:function(O){if(!Y(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return gt.Activity=g,gt.Children=K,gt.Component=R,gt.Fragment=n,gt.Profiler=o,gt.PureComponent=T,gt.StrictMode=r,gt.Suspense=f,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,gt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return A.H.useMemoCache(O)}},gt.cache=function(O){return function(){return O.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(O,F,ae){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ue=j({},O.props),be=O.key;if(F!=null)for(we in F.key!==void 0&&(be=""+F.key),F)!P.call(F,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&F.ref===void 0||(ue[we]=F[we]);var we=arguments.length-2;if(we===1)ue.children=ae;else if(1<we){for(var Ce=Array(we),nt=0;nt<we;nt++)Ce[nt]=arguments[nt+2];ue.children=Ce}return z(O.type,be,ue)},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,F,ae){var ue,be={},we=null;if(F!=null)for(ue in F.key!==void 0&&(we=""+F.key),F)P.call(F,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(be[ue]=F[ue]);var Ce=arguments.length-2;if(Ce===1)be.children=ae;else if(1<Ce){for(var nt=Array(Ce),De=0;De<Ce;De++)nt[De]=arguments[De+2];be.children=nt}if(O&&O.defaultProps)for(ue in Ce=O.defaultProps,Ce)be[ue]===void 0&&(be[ue]=Ce[ue]);return z(O,we,be)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(O){return{$$typeof:d,render:O}},gt.isValidElement=Y,gt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:U}},gt.memo=function(O,F){return{$$typeof:p,type:O,compare:F===void 0?null:F}},gt.startTransition=function(O){var F=A.T,ae={};A.T=ae;try{var ue=O(),be=A.S;be!==null&&be(ae,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(I,V)}catch(we){V(we)}finally{F!==null&&ae.types!==null&&(F.types=ae.types),A.T=F}},gt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},gt.use=function(O){return A.H.use(O)},gt.useActionState=function(O,F,ae){return A.H.useActionState(O,F,ae)},gt.useCallback=function(O,F){return A.H.useCallback(O,F)},gt.useContext=function(O){return A.H.useContext(O)},gt.useDebugValue=function(){},gt.useDeferredValue=function(O,F){return A.H.useDeferredValue(O,F)},gt.useEffect=function(O,F){return A.H.useEffect(O,F)},gt.useEffectEvent=function(O){return A.H.useEffectEvent(O)},gt.useId=function(){return A.H.useId()},gt.useImperativeHandle=function(O,F,ae){return A.H.useImperativeHandle(O,F,ae)},gt.useInsertionEffect=function(O,F){return A.H.useInsertionEffect(O,F)},gt.useLayoutEffect=function(O,F){return A.H.useLayoutEffect(O,F)},gt.useMemo=function(O,F){return A.H.useMemo(O,F)},gt.useOptimistic=function(O,F){return A.H.useOptimistic(O,F)},gt.useReducer=function(O,F,ae){return A.H.useReducer(O,F,ae)},gt.useRef=function(O){return A.H.useRef(O)},gt.useState=function(O){return A.H.useState(O)},gt.useSyncExternalStore=function(O,F,ae){return A.H.useSyncExternalStore(O,F,ae)},gt.useTransition=function(){return A.H.useTransition()},gt.version="19.2.0",gt}var tE;function gb(){return tE||(tE=1,wy.exports=tM()),wy.exports}var v=gb();const Mn=Xp(v),_2=X3({__proto__:null,default:Mn},[v]);var ip="right-scroll-bar-position",op="width-before-scroll-bar",nM="with-scroll-bars-hidden",rM="--removed-body-scroll-bar-size";function jy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function iM(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 oM=typeof window<"u"?v.useLayoutEffect:v.useEffect,nE=new WeakMap;function aM(e,t){var n=iM(null,function(r){return e.forEach(function(o){return jy(o,r)})});return oM(function(){var r=nE.get(n);if(r){var o=new Set(r),s=new Set(e),c=n.current;o.forEach(function(d){s.has(d)||jy(d,null)}),s.forEach(function(d){o.has(d)||jy(d,c)})}nE.set(n,e)},[e]),n}function sM(e){return e}function lM(e,t){t===void 0&&(t=sM);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 cM(e){e===void 0&&(e={});var t=lM(null);return t.options=bo({async:!0,ssr:!1},e),t}var A2=function(e){var t=e.sideCar,n=R2(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,bo({},n))};A2.isSideCarExport=!0;function uM(e,t){return e.useMedium(t),A2}var D2=cM(),Cy=function(){},Jp=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Cy,onWheelCapture:Cy,onTouchMoveCapture:Cy}),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,b=e.noRelative,S=e.noIsolation,j=e.inert,C=e.allowPinchZoom,R=e.as,E=R===void 0?"div":R,T=e.gapMode,_=R2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=y,I=aM([n,t]),A=bo(bo({},_),o);return v.createElement(v.Fragment,null,m&&v.createElement(k,{sideCar:D2,removeScrollBar:p,shards:g,noRelative:b,noIsolation:S,inert:j,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:T}),c?v.cloneElement(v.Children.only(d),bo(bo({},A),{ref:I})):v.createElement(E,bo({},A,{className:f,ref:I}),d))});Jp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jp.classNames={fullWidth:op,zeroRight:ip};var dM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=dM();return t&&e.setAttribute("nonce",t),e}function hM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var mM=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fM())&&(hM(t,n),pM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gM=function(){var e=mM();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},k2=function(){var e=gM(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},vM={left:0,top:0,right:0,gap:0},Ey=function(e){return parseInt(e||"",10)||0},yM=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[Ey(n),Ey(r),Ey(o)]},xM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vM;var t=yM(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])}},bM=k2(),Nc="data-scroll-locked",SM=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(nM,` {
|
|
3
|
-
overflow: hidden `).concat(r,`;
|
|
4
|
-
padding-right: `).concat(d,"px ").concat(r,`;
|
|
5
|
-
}
|
|
6
|
-
body[`).concat(Nc,`] {
|
|
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(ip,` {
|
|
20
|
-
right: `).concat(d,"px ").concat(r,`;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.`).concat(op,` {
|
|
24
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.`).concat(ip," .").concat(ip,` {
|
|
28
|
-
right: 0 `).concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(op," .").concat(op,` {
|
|
32
|
-
margin-right: 0 `).concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[`).concat(Nc,`] {
|
|
36
|
-
`).concat(rM,": ").concat(d,`px;
|
|
37
|
-
}
|
|
38
|
-
`)},rE=function(){var e=parseInt(document.body.getAttribute(Nc)||"0",10);return isFinite(e)?e:0},wM=function(){v.useEffect(function(){return document.body.setAttribute(Nc,(rE()+1).toString()),function(){var e=rE()-1;e<=0?document.body.removeAttribute(Nc):document.body.setAttribute(Nc,e.toString())}},[])},jM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;wM();var s=v.useMemo(function(){return xM(o)},[o]);return v.createElement(bM,{styles:SM(s,!t,o,n?"":"!important")})},Sx=!1;if(typeof window<"u")try{var Ih=Object.defineProperty({},"passive",{get:function(){return Sx=!0,!0}});window.addEventListener("test",Ih,Ih),window.removeEventListener("test",Ih,Ih)}catch{Sx=!1}var vc=Sx?{passive:!1}:!1,CM=function(e){return e.tagName==="TEXTAREA"},P2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!CM(e)&&n[t]==="visible")},EM=function(e){return P2(e,"overflowY")},TM=function(e){return P2(e,"overflowX")},iE=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=N2(e,r);if(o){var s=O2(e,r),c=s[1],d=s[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},RM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_M=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},N2=function(e,t){return e==="v"?EM(t):TM(t)},O2=function(e,t){return e==="v"?RM(t):_M(t)},AM=function(e,t){return e==="h"&&t==="rtl"?-1:1},DM=function(e,t,n,r,o){var s=AM(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 b=O2(e,d),S=b[0],j=b[1],C=b[2],R=j-C-s*S;(S||R)&&N2(e,d)&&(g+=R,y+=S);var E=d.parentNode;d=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}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},zh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oE=function(e){return[e.deltaX,e.deltaY]},aE=function(e){return e&&"current"in e?e.current:e},kM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},PM=function(e){return`
|
|
39
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},NM=0,yc=[];function OM(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(NM++)[0],s=v.useState(k2)[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=eM([e.lockRef.current],(e.shards||[]).map(aE),!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 R=zh(j),E=n.current,T="deltaX"in j?j.deltaX:E[0]-R[0],_="deltaY"in j?j.deltaY:E[1]-R[1],k,I=j.target,A=Math.abs(T)>Math.abs(_)?"h":"v";if("touches"in j&&A==="h"&&I.type==="range")return!1;var P=window.getSelection(),z=P&&P.anchorNode,B=z?z===I||z.contains(I):!1;if(B)return!1;var Y=iE(A,I);if(!Y)return!0;if(Y?k=A:(k=A==="v"?"h":"v",Y=iE(A,I)),!Y)return!1;if(!r.current&&"changedTouches"in j&&(T||_)&&(r.current=k),!k)return!0;var J=r.current||k;return DM(J,C,j,J==="h"?T:_)},[]),f=v.useCallback(function(j){var C=j;if(!(!yc.length||yc[yc.length-1]!==s)){var R="deltaY"in C?oE(C):zh(C),E=t.current.filter(function(k){return k.name===C.type&&(k.target===C.target||C.target===k.shadowParent)&&kM(k.delta,R)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var T=(c.current.shards||[]).map(aE).filter(Boolean).filter(function(k){return k.contains(C.target)}),_=T.length>0?d(C,T[0]):!c.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),p=v.useCallback(function(j,C,R,E){var T={name:j,delta:C,target:R,should:E,shadowParent:MM(R)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(_){return _!==T})},1)},[]),m=v.useCallback(function(j){n.current=zh(j),r.current=void 0},[]),g=v.useCallback(function(j){p(j.type,oE(j),j.target,d(j,e.lockRef.current))},[]),y=v.useCallback(function(j){p(j.type,zh(j),j.target,d(j,e.lockRef.current))},[]);v.useEffect(function(){return yc.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,vc),document.addEventListener("touchmove",f,vc),document.addEventListener("touchstart",m,vc),function(){yc=yc.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,vc),document.removeEventListener("touchmove",f,vc),document.removeEventListener("touchstart",m,vc)}},[]);var b=e.removeScrollBar,S=e.inert;return v.createElement(v.Fragment,null,S?v.createElement(s,{styles:PM(o)}):null,b?v.createElement(jM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function MM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const LM=uM(D2,OM);var dl=v.forwardRef(function(e,t){return v.createElement(Jp,bo({},e,{ref:t,sideCar:LM}))});dl.classNames=Jp.classNames;function dn(e){return Object.keys(e)}function Ty(e){return e&&typeof e=="object"&&!Array.isArray(e)}function vb(e,t){const n={...e},r=t;return Ty(e)&&Ty(t)&&Object.keys(t).forEach(o=>{Ty(r[o])&&o in e?n[o]=vb(n[o],r[o]):n[o]=r[o]}),n}function IM(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function zM(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function bd(e){const t=zM(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 sE(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function M2(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?sE(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?sE(s):s}}return r}return n}const le=M2("rem",{shouldScale:!0}),vp=M2("em");function Ss(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function L2(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 Lo(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function jr(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 Io(e=null){const t=v.createContext(e);return[({children:o,value:s})=>a.jsx(t.Provider,{value:s,children:o}),()=>v.useContext(t)]}function lE(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function yp(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function $M(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 UM(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 BM(e,t,n){return yp(e,n)===yp(t,n)}function yb({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(yp(d.currentTarget,e)?.querySelectorAll(t)||[]).filter(S=>BM(d.currentTarget,S,e)),p=f.findIndex(S=>d.currentTarget===S),m=UM(p,f,r),g=$M(p,f,r),y=s==="rtl"?g:m,b=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[b].focus(),o&&f[b].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 VM={app:100,modal:200,popover:300,overlay:400,max:9999};function zr(e){return VM[e]}const xp=()=>{};function FM(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||xp:n=>{n.key==="Escape"&&(e(n),t.onTrigger?.())}}function it(e,t="size",n=!0){if(e!==void 0)return L2(e)?n?le(e):e:`var(--${t}-${e})`}function Gn(e){return it(e,"mantine-spacing")}function Ft(e){return e===void 0?"var(--mantine-radius-default)":it(e,"mantine-radius")}function Qn(e){return it(e,"mantine-font-size")}function I2(e){return it(e,"mantine-line-height",!1)}function xb(e){if(e)return it(e,"mantine-shadow",!1)}function ar(e,t){return n=>{e?.(n),t?.(n)}}function bb(e,t){return e in t?bd(t[e]):bd(e)}function Sd(e,t){const n=e.map(r=>({value:r,px:bb(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Qi(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function HM(e,t,n){return n?Array.from(yp(n,t)?.querySelectorAll(e)||[]).findIndex(r=>r===n):null}function vd(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 bp(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function qM(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 cE(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Js(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...n)=>t.current?.(...n)),[])}function Zp(e,t){const{delay:n,flushOnUnmount:r,leading:o}=typeof t=="number"?{delay:t,flushOnUnmount:!1,leading:!1}:t,s=Js(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))},b=()=>{g()};f.flush=y,f.cancel=b,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 GM=["mousedown","touchstart"];function QM(e,t,n){const r=v.useRef(null),o=t||GM;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 z2(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 WM(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 $2(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),WM(s,c=>o(c.matches))}catch{return}},[e]),r||!1}function KM(e,t){return $2("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Jc=typeof document<"u"?v.useLayoutEffect:v.useEffect;function gs(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function U2({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 gs(()=>{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 XM=/input|select|textarea|button|object/,B2="a, input, select, textarea, button, object, [tabindex]";function JM(e){return e.style.display==="none"}function ZM(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(JM(n))return!1;n=n.parentNode}return!0}function V2(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function wx(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(V2(e));return(XM.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&ZM(e)}function F2(e){const t=V2(e);return(Number.isNaN(t)||t>=0)&&wx(e)}function e4(e){return Array.from(e.querySelectorAll(B2)).filter(F2)}function t4(e,t){const n=e4(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 n4(e=!0){const t=v.useRef(null),n=o=>{let s=o.querySelector("[data-autofocus]");if(!s){const c=Array.from(o.querySelectorAll(B2));s=c.find(F2)||c.find(wx)||null,!s&&wx(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&&t4(t.current,s)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}const r4=e=>(e+1)%1e6;function i4(){const[,e]=v.useReducer(r4,0);return e}const o4=Mn.useId||(()=>{});function a4(){const e=o4();return e?`mantine-${e.replace(/:/g,"")}`:""}function mr(e){const t=a4(),[n,r]=v.useState(t);return Jc(()=>{r(bp())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function H2(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function wd(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function s4(...e){const t=new Map;return n=>{if(e.forEach(r=>{const o=wd(r,n);o&&t.set(r,o)}),t.size>0)return()=>{e.forEach(r=>{const o=t.get(r);o&&typeof o=="function"?o():wd(r,null)}),t.clear()}}}function Bn(...e){return v.useCallback(s4(...e),e)}function rr({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 is(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const $h="dots";function l4({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]=rr({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),b=()=>p(c);return{range:v.useMemo(()=>{if(t*2+3+n*2>=c)return is(1,c);const C=Math.max(d-t,n),R=Math.min(d+t,c-n),E=C>n+2,T=R<c-(n+1);if(!E&&T){const _=t*2+n+2;return[...is(1,_),$h,...is(c-(n-1),c)]}if(E&&!T){const _=n+1+2*t;return[...is(1,n),$h,...is(c-_,c)]}return[...is(1,n),$h,...is(C,R),$h,...is(c-n+1,c)]},[c,t,d]),active:d,setPage:p,next:m,previous:g,first:y,last:b}}function Sb(e,t){return $2("(prefers-reduced-motion: reduce)",e,t)}function c4(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(!qM(e[n],t[n]))return!1;return!0}function u4(e){const t=v.useRef([]),n=v.useRef(0);return c4(t.current,e)||(t.current=e,n.current+=1),[n.current]}function d4(e,t){v.useEffect(e,u4(t))}const f4={" ":"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 Uh(e){const t=e.replace("Key","").toLowerCase();return f4[e]||t}function h4(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 p4(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:b,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?Uh(S)===Uh(f):Uh(b??S)===Uh(f)))}function m4(e,t){return n=>p4(h4(e),n,t)}function g4(e,t,n=!1){return e.target instanceof HTMLElement?(n||!e.target.isContentEditable)&&!t.includes(e.target.tagName):!0}function v4(e,t=["INPUT","TEXTAREA","SELECT"],n=!1){v.useEffect(()=>{const r=o=>{e.forEach(([s,c,d={preventDefault:!0,usePhysicalKeys:!1}])=>{m4(s,d.usePhysicalKeys)(o)&&g4(o,t,n)&&(d.preventDefault&&o.preventDefault(),c(o))})};return document.documentElement.addEventListener("keydown",r),()=>document.documentElement.removeEventListener("keydown",r)},[e])}function Zc(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 y4(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 x4(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 b4(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var S4={};function q2(){return typeof process<"u"&&S4?"production":"development"}function em(e){const t=Mn.version;return typeof Mn.version!="string"||t.startsWith("18.")?e?.ref:e?.props?.ref}function ap(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=ap(e,s.shadowRoot);if(c)return c}}return null}function ss(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=ss(e,c.shadowRoot);n.push(...d)}}return n}function os(e){if(!e)return document;const t=e.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t:document}function G2(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=G2(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=G2(e))&&(r&&(r+=" "),r+=t);return r}const w4={};function j4(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 Fd({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||w4);return j4(s)}function jd({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 wb=v.createContext(null);function Sa(){const e=v.useContext(wb);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function C4(){return Sa().cssVariablesResolver}function E4(){return Sa().classNamesPrefix}function tm(){return Sa().getStyleNonce}function T4(){return Sa().withStaticClasses}function R4(){return Sa().headless}function _4(){return Sa().stylesTransform?.sx}function A4(){return Sa().stylesTransform?.styles}function nm(){return Sa().env||"default"}function D4(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function k4(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 P4(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 N4(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,b;return f>=0&&f<1?(g=d,y=p,b=0):f>=1&&f<2?(g=p,y=d,b=0):f>=2&&f<3?(g=0,y=d,b=p):f>=3&&f<4?(g=0,y=p,b=d):f>=4&&f<5?(g=p,y=0,b=d):(g=d,y=0,b=p),{r:Math.round((g+m)*255),g:Math.round((y+m)*255),b:Math.round((b+m)*255),a:c||1}}function jb(e){return D4(e)?k4(e):e.startsWith("rgb")?P4(e):e.startsWith("hsl")?N4(e):{r:0,g:0,b:0,a:1}}function Bh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:s}=jb(e),c=1-t,d=f=>Math.round(f*c);return`rgba(${d(n)}, ${d(r)}, ${d(o)}, ${s})`}function Cd(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Ry(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function O4(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function M4(e){if(e.startsWith("oklch("))return(O4(e)||0)/100;const{r:t,g:n,b:r}=jb(e),o=t/255,s=n/255,c=r/255,d=Ry(o),f=Ry(s),p=Ry(c);return .2126*d+.7152*f+.0722*p}function id(e,t=.179){return e.startsWith("var(")?!1:M4(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:id(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:id(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:id(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][Cd(t,n||"light")];return{color:r,value:d,shade:s,isThemeColor:c,isLight:id(d,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:id(e,t.luminanceThreshold),shade:s,variable:void 0}}function Wt(e,t){const n=Xr({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function jx(e,t){const n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=Wt(n.from,t),o=Wt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function _i(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}=jb(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const xc=_i,L4=({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:`${le(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:`${le(1)} solid transparent`}:{background:e,hover:Bh(e,.1),color:d,border:`${le(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:`${le(1)} solid transparent`};const d=t.colors[s.color][s.shade];return{background:_i(d,.1),hover:_i(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:_i(e,.1),hover:_i(e,.12),color:e,border:`${le(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:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:_i(t.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:_i(e,.05),color:e,border:`${le(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:`${le(1)} solid transparent`};const d=t.colors[s.color][s.shade];return{background:"transparent",hover:_i(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:_i(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:Bh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Bh(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Bh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:jx(r,t),hover:jx(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${le(1)} solid var(--mantine-color-default-border)`}:{}},I4={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"]},uE="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Cb={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:I4,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:L4,autoContrast:!1,luminanceThreshold:.3,fontFamily:uE,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:uE,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:le(34),lineHeight:"1.3"},h2:{fontSize:le(26),lineHeight:"1.35"},h3:{fontSize:le(22),lineHeight:"1.4"},h4:{fontSize:le(18),lineHeight:"1.45"},h5:{fontSize:le(16),lineHeight:"1.5"},h6:{fontSize:le(14),lineHeight:"1.5"}}},fontSizes:{xs:le(12),sm:le(14),md:le(16),lg:le(18),xl:le(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:le(2),sm:le(4),md:le(8),lg:le(16),xl:le(32)},spacing:{xs:le(10),sm:le(12),md:le(16),lg:le(20),xl:le(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), 0 ${le(1)} ${le(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(10)} ${le(15)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(7)} ${le(7)} ${le(-5)}`,md:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(20)} ${le(25)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(10)} ${le(10)} ${le(-5)}`,lg:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(28)} ${le(23)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(12)} ${le(12)} ${le(-7)}`,xl:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(36)} ${le(28)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(17)} ${le(17)} ${le(-7)}`},other:{},components:{}};function dE(e){return e==="auto"||e==="dark"||e==="light"}function z4({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 dE(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&&dE(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const $4="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",fE="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function _y(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function hE(e){if(!(e.primaryColor in e.colors))throw new Error($4);if(typeof e.primaryShade=="object"&&(!_y(e.primaryShade.dark)||!_y(e.primaryShade.light)))throw new Error(fE);if(typeof e.primaryShade=="number"&&!_y(e.primaryShade))throw new Error(fE)}function U4(e,t){if(!t)return hE(e),e;const n=vb(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),hE(n),n}const Eb=v.createContext(null),B4=()=>v.useContext(Eb)||Cb;function gn(){const e=v.useContext(Eb);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 Q2({theme:e,children:t,inherit:n=!0}){const r=B4(),o=v.useMemo(()=>U4(n?r:Cb,e),[e,r,n]);return a.jsx(Eb.Provider,{value:o,children:t})}Q2.displayName="@mantine/core/MantineThemeProvider";function V4(){const e=gn(),t=tm(),n=dn(e.breakpoints).reduce((r,o)=>{const s=e.breakpoints[o].includes("px"),c=bd(e.breakpoints[o]),d=s?`${c-.1}px`:vp(c-.1),f=s?`${c}px`:vp(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 Ay(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function od(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function F4(e,t){const n=Ay(e.variables),r=n?od(t,n):"",o=Ay(e.dark),s=Ay(e.light),c=o?od(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",d=s?od(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}
|
|
42
|
-
|
|
43
|
-
${c}
|
|
44
|
-
|
|
45
|
-
${d}`}function wa({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 pE(e,t){return wa({color:e.colors[e.primaryColor][Cd(e,t)],theme:e,autoContrast:null})}function Vh({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const d=Cd(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`]:xc(e.colors[t][d],.1),[`--mantine-color-${r}-light-hover`]:xc(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`]:xc(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=Cd(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`]:xc(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:xc(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`]:xc(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 H4(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function bc(e,t,n){dn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const W2=e=>{const t=Cd(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(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":pE(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":pE(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)"}};bc(r.variables,e.breakpoints,"breakpoint"),bc(r.variables,e.spacing,"spacing"),bc(r.variables,e.fontSizes,"font-size"),bc(r.variables,e.lineHeights,"line-height"),bc(r.variables,e.shadows,"shadow"),bc(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(H4(c)){Object.assign(r.light,Vh({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Vh({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,Vh({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Vh({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 q4({theme:e,generator:t}){const n=W2(e),r=t?.(e);return r?vb(n,r):n}const Dy=W2(Cb);function G4(e){const t={variables:{},light:{},dark:{}};return dn(e.variables).forEach(n=>{Dy.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),dn(e.light).forEach(n=>{Dy.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),dn(e.dark).forEach(n=>{Dy.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function Q4(e){return`
|
|
46
|
-
${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
|
|
47
|
-
${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
|
|
48
|
-
`}function Y2({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=gn(),r=tm(),o=C4(),s=q4({theme:n,generator:o}),c=e===":root"&&t,d=c?G4(s):s,f=F4(d,e);return f?a.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${f}${c?"":Q4(e)}`}}):null}Y2.displayName="@mantine/CssVariables";function Sc(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 W4({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||(Sc(m,n),c(m),e.set(m))},[e.set,d,r]),p=v.useCallback(()=>{c(t),Sc(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),Jc(()=>{Sc(e.get(t),n)},[]),v.useEffect(()=>{if(r)return Sc(r,n),()=>{};r===void 0&&Sc(s,n),typeof window<"u"&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=g=>{s==="auto"&&Sc(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 Y4({respectReducedMotion:e,getRootElement:t}){Jc(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}function K2({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:s=!0,withCssVariables:c=!0,cssVariablesSelector:d=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=z4(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:b,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:R,clearColorScheme:E}=W4({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return Y4({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:g}),a.jsx(wb.Provider,{value:{colorScheme:C,setColorScheme:R,clearColorScheme:E,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:d,withStaticClasses:r,stylesTransform:S,env:j},children:a.jsxs(Q2,{theme:e,children:[c&&a.jsx(Y2,{cssVariablesSelector:d,deduplicateCssVariables:s}),o&&a.jsx(V4,{}),t]})})}K2.displayName="@mantine/core/MantineProvider";function Cl({classNames:e,styles:t,props:n,stylesCtx:r}){const o=gn();return{resolvedClassNames:Fd({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:jd({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const K4={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function X4({theme:e,options:t,unstyled:n}){return Ut(t?.focusable&&!n&&(e.focusClassName||K4[e.focusRing]),t?.active&&!n&&e.activeClassName)}function J4({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Fd({theme:o,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function mE({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Fd({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function Z4({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function e5({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function t5({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function n5({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(s=>Fd({theme:t,classNames:t.components[s]?.classNames,props:r,stylesCtx:o})?.[n])}function r5({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function i5({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:b,transformedStyles:S}){return Ut(X4({theme:e,options:t,unstyled:d||b}),n5({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),r5({options:t,classes:c,selector:r,unstyled:d}),mE({selector:r,stylesCtx:g,theme:e,classNames:s,props:m}),mE({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),J4({selector:r,stylesCtx:g,options:t,props:m,theme:e}),Z4({rootSelector:p,selector:r,className:f}),e5({selector:r,classes:c,unstyled:d||b}),y&&!b&&t5({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function o5({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(s=>jd({theme:e,styles:e.components[s]?.styles,props:n,stylesCtx:r})[o]).reduce((s,c)=>({...s,...c}),{})}function Cx({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Cx({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function a5(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Ss(n[r])}}),t),{})}function s5({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:s,themeName:c,headless:d}){return a5([d?{}:t?.(n,r,o),...c.map(f=>n.components?.[f]?.vars?.(n,r,o)),e?.(n,r,o)])?.[s]}function l5({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&&o5({theme:e,themeName:t,props:o,stylesCtx:s,selector:n}),...!y&&jd({theme:e,styles:d,props:o,stylesCtx:s})[n],...!y&&jd({theme:e,styles:r?.styles,props:r?.props||o,stylesCtx:s})[n],...s5({theme:e,props:o,stylesCtx:s,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?Cx({style:f,theme:e}):null,...Cx({style:r?.style,theme:e})}}function c5({props:e,stylesCtx:t,themeName:n}){const r=gn(),o=A4()?.();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 Le({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 b=gn(),S=E4(),j=T4(),C=R4(),R=(Array.isArray(e)?e:[e]).filter(_=>_),{withStylesTransform:E,getTransformedStyles:T}=c5({props:n,stylesCtx:r,themeName:R});return(_,k)=>({className:i5({theme:b,options:k,themeName:R,selector:_,classNamesPrefix:S,classNames:f,classes:t,unstyled:d,className:o,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:j,headless:C,transformedStyles:T([k?.styles,p])}),style:l5({theme:b,themeName:R,selector:_,options:k,props:n,stylesCtx:r,rootSelector:c,styles:p,style:s,vars:m,varsResolver:g,headless:C,withStylesTransform:E}),...y?.[_]})}function El(e,t){return typeof e=="boolean"?e:t.autoContrast}function gE(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 u5({keepTransitions:e}={}){const t=v.useRef(xp),n=v.useRef(-1),r=v.useContext(wb),o=tm(),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?()=>{}:gE(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},d=()=>{r.clearColorScheme(),t.current=e?()=>{}:gE(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},f=KM("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 ie(e,t,n){const r=gn(),o=r.components[e]?.defaultProps,s=typeof o=="function"?o(r):o;return{...t,...s,...Ss(n)}}function ky(e){return dn(e).reduce((t,n)=>e[n]!==void 0?`${t}${IM(n)}:${e[n]};`:t,"").trim()}function d5({selector:e,styles:t,media:n,container:r}){const o=t?ky(t):"",s=Array.isArray(n)?n.map(d=>`@media${d.query}{${e}{${ky(d.styles)}}}`):[],c=Array.isArray(r)?r.map(d=>`@container ${d.query}{${e}{${ky(d.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${s.join("")}${c.join("")}`.trim()}function Tl(e){const t=tm();return a.jsx("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:d5(e)}})}function ja(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:b,pb:S,pl:j,pr:C,pe:R,ps:E,bd:T,bdrs:_,bg:k,c:I,opacity:A,ff:P,fz:z,fw:B,lts:Y,ta:J,lh:Z,fs:$,tt:Q,td:M,w:L,miw:U,maw:V,h:K,mih:O,mah:F,bgsz:ae,bgp:ue,bgr:be,bga:we,pos:Ce,top:nt,left:De,bottom:ft,right:ot,inset:ht,display:st,flex:yt,hiddenFrom:mt,visibleFrom:It,lightHidden:Te,darkHidden:Re,sx:Ie,...Oe}=e;return{styleProps:Ss({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:b,pb:S,pl:j,pr:C,pe:R,ps:E,bd:T,bg:k,c:I,opacity:A,ff:P,fz:z,fw:B,lts:Y,ta:J,lh:Z,fs:$,tt:Q,td:M,w:L,miw:U,maw:V,h:K,mih:O,mah:F,bgsz:ae,bgp:ue,bgr:be,bga:we,pos:Ce,top:nt,left:De,bottom:ft,right:ot,inset:ht,display:st,flex:yt,bdrs:_,hiddenFrom:mt,visibleFrom:It,lightHidden:Te,darkHidden:Re,sx:Ie}),rest:Oe}}const f5={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 Tb(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 h5(e,t){const n=Xr({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Tb(e,t)}function p5(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(c=>c.trim()!=="");let s=`${le(n)}`;return r&&(s+=` ${r}`),o.length>0&&(s+=` ${Tb(o.join(" "),t)}`),s.trim()}return e}const vE={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 m5(e){return typeof e=="string"&&e in vE?vE[e]:e}const g5=["h1","h2","h3","h4","h5","h6"];function v5(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&g5.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function y5(e){return e}const x5=["h1","h2","h3","h4","h5","h6"];function b5(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&x5.includes(e)?`var(--mantine-${e}-line-height)`:e}function S5(e,t){return typeof e=="string"&&e in t.radius?`var(--mantine-radius-${e})`:typeof e=="number"||typeof e=="string"?le(e):e}function w5(e){return typeof e=="number"?le(e):e}function j5(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return le(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const Py={color:Tb,textColor:h5,fontSize:v5,spacing:j5,radius:S5,identity:y5,size:w5,lineHeight:b5,fontFamily:m5,border:p5};function yE(e){return e.replace("(min-width: ","").replace("em)","")}function C5({media:e,...t}){const r=Object.keys(e).sort((o,s)=>Number(yE(o))-Number(yE(s))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function E5(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function T5(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function R5(e){return typeof e=="object"&&e!==null?dn(e).filter(t=>t!=="base"):[]}function _5(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function X2({styleProps:e,data:t,theme:n}){return C5(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=T5(e[o]);if(!E5(e[o]))return c.forEach(p=>{r.inlineStyles[p]=Py[s.type](d,n)}),r;r.hasResponsiveStyles=!0;const f=R5(e[o]);return c.forEach(p=>{d!=null&&(r.styles[p]=Py[s.type](d,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:Py[s.type](_5(e[o],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Hd(){return`__m__-${v.useId().replace(/[:«»]/g,"")}`}function J2(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...J2(r,t)}),{}):typeof e=="function"?e(t):e??{}}function Z2(e){return e.startsWith("data-")?e:`data-${e}`}function A5(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[Z2(n)]=e[n]),t},{})}function e_(e){return e?typeof e=="string"?{[Z2(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...e_(n)}),{}):A5(e):null}function Ex(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Ex(r,t)}),{}):typeof e=="function"?e(t):e??{}}function D5({theme:e,style:t,vars:n,styleProps:r}){const o=Ex(t,e),s=Ex(n,e);return{...o,...s,...r}}const t_=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,...b},S)=>{const j=gn(),C=e||"div",{styleProps:R,rest:E}=ja(b),_=_4()?.()?.(R.sx),k=Hd(),I=X2({styleProps:R,theme:j,data:f5}),A={ref:S,style:D5({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":L2(c)?void 0:c||void 0,size:y,...e_(s),...E};return a.jsxs(a.Fragment,{children:[I.hasResponsiveStyles&&a.jsx(Tl,{selector:`.${k}`,styles:I.styles,media:I.media}),typeof g=="function"?g(A):a.jsx(C,{...A})]})});t_.displayName="@mantine/core/Box";const ce=t_;function n_(e){return e}function k5(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=n_,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 sr(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=n_,t}const P5=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function ws(){return v.useContext(P5)}var Ny={exports:{}},gr={};var xE;function N5(){if(xE)return gr;xE=1;var e=gb();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 gr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,gr.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)},gr.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()}},gr.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))},gr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},gr.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,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},gr.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)},gr.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})}},gr.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)},gr.requestFormReset=function(f){r.d.r(f)},gr.unstable_batchedUpdates=function(f,p){return f(p)},gr.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},gr.useFormStatus=function(){return c.H.useHostTransitionStatus()},gr.version="19.2.0",gr}var bE;function r_(){if(bE)return Ny.exports;bE=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(),Ny.exports=N5(),Ny.exports}var Rb=r_();const hd=Xp(Rb);function rm(){return typeof window<"u"}function eu(e){return i_(e)?(e.nodeName||"").toLowerCase():"#document"}function Kr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zo(e){var t;return(t=(i_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function i_(e){return rm()?e instanceof Node||e instanceof Kr(e).Node:!1}function wn(e){return rm()?e instanceof Element||e instanceof Kr(e).Element:!1}function di(e){return rm()?e instanceof HTMLElement||e instanceof Kr(e).HTMLElement:!1}function Tx(e){return!rm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Kr(e).ShadowRoot}const O5=new Set(["inline","contents"]);function qd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Pi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!O5.has(o)}const M5=new Set(["table","td","th"]);function L5(e){return M5.has(eu(e))}const I5=[":popover-open",":modal"];function im(e){return I5.some(t=>{try{return e.matches(t)}catch{return!1}})}const z5=["transform","translate","scale","rotate","perspective"],$5=["transform","translate","scale","rotate","perspective","filter"],U5=["paint","layout","strict","content"];function _b(e){const t=om(),n=wn(e)?Pi(e):e;return z5.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)||$5.some(r=>(n.willChange||"").includes(r))||U5.some(r=>(n.contain||"").includes(r))}function B5(e){let t=ga(e);for(;di(t)&&!pa(t);){if(_b(t))return t;if(im(t))return null;t=ga(t)}return null}function om(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const V5=new Set(["html","body","#document"]);function pa(e){return V5.has(eu(e))}function Pi(e){return Kr(e).getComputedStyle(e)}function am(e){return wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ga(e){if(eu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tx(e)&&e.host||zo(e);return Tx(t)?t.host:t}function o_(e){const t=ga(e);return pa(t)?e.ownerDocument?e.ownerDocument.body:e.body:di(t)&&qd(t)?t:o_(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=o_(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),c=Kr(o);if(s){const d=Rx(c);return t.concat(c,c.visualViewport||[],qd(o)?o:[],d&&n?ma(d):[])}return t.concat(o,ma(o,[],n))}function Rx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const F5=["top","right","bottom","left"],Xi=Math.min,xr=Math.max,Sp=Math.round,Fh=Math.floor,jo=e=>({x:e,y:e}),H5={left:"right",right:"left",bottom:"top",top:"bottom"},q5={start:"end",end:"start"};function _x(e,t,n){return xr(e,Xi(t,n))}function Do(e,t){return typeof e=="function"?e(t):e}function Ji(e){return e.split("-")[0]}function tu(e){return e.split("-")[1]}function Ab(e){return e==="x"?"y":"x"}function Db(e){return e==="y"?"height":"width"}const G5=new Set(["top","bottom"]);function Wi(e){return G5.has(Ji(e))?"y":"x"}function kb(e){return Ab(Wi(e))}function Q5(e,t,n){n===void 0&&(n=!1);const r=tu(e),o=kb(e),s=Db(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=wp(c)),[c,wp(c)]}function W5(e){const t=wp(e);return[Ax(e),t,Ax(t)]}function Ax(e){return e.replace(/start|end/g,t=>q5[t])}const SE=["left","right"],wE=["right","left"],Y5=["top","bottom"],K5=["bottom","top"];function X5(e,t,n){switch(e){case"top":case"bottom":return n?t?wE:SE:t?SE:wE;case"left":case"right":return t?Y5:K5;default:return[]}}function J5(e,t,n,r){const o=tu(e);let s=X5(Ji(e),n==="start",r);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(Ax)))),s}function wp(e){return e.replace(/left|right|bottom|top/g,t=>H5[t])}function Z5(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pb(e){return typeof e!="number"?Z5(e):{top:e,right:e,bottom:e,left:e}}function $c(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 e9(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function t9(){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 n9(){return/apple/i.test(navigator.vendor)}function r9(){return e9().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function i9(){return t9().includes("jsdom/")}const jE="data-floating-ui-focusable",o9="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function CE(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 Ed(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Tx(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ac(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Oy(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 a9(e){return e.matches("html,body")}function nl(e){return e?.ownerDocument||document}function s9(e){return di(e)&&e.matches(o9)}function l9(e){if(!e||i9())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function c9(e){return e?e.hasAttribute(jE)?e:e.querySelector("["+jE+"]")||e:null}function sp(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,...sp(e,o.id,n)])}function u9(e){return"nativeEvent"in e}function Dx(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var d9=typeof document<"u",f9=function(){},Co=d9?v.useLayoutEffect:f9;const h9={..._2};function Hh(e){const t=v.useRef(e);return Co(()=>{t.current=e}),t}const p9=h9.useInsertionEffect,m9=p9||(e=>e());function So(e){const t=v.useRef(()=>{});return m9(()=>{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 EE(e,t,n){let{reference:r,floating:o}=e;const s=Wi(t),c=kb(t),d=Db(c),f=Ji(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 b;switch(f){case"top":b={x:m,y:r.y-o.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-o.width,y:g};break;default:b={x:r.x,y:r.y}}switch(tu(t)){case"start":b[c]-=y*(n&&p?-1:1);break;case"end":b[c]+=y*(n&&p?-1:1);break}return b}const g9=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}=EE(p,r,f),y=r,b={},S=0;for(let j=0;j<d.length;j++){const{name:C,fn:R}=d[j],{x:E,y:T,data:_,reset:k}=await R({x:m,y:g,initialPlacement:r,placement:y,strategy:o,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=E??m,g=T??g,b={...b,[C]:{...b[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}=EE(p,y,f)),j=-1)}return{x:m,y:g,placement:y,strategy:o,middlewareData:b}};async function Td(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:b=0}=Do(t,e),S=Pb(b),C=d[y?g==="floating"?"reference":"floating":g],R=$c(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})),E=g==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d.floating)),_=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},k=$c(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:T,strategy:f}):E);return{top:(R.top-k.top+S.top)/_.y,bottom:(k.bottom-R.bottom+S.bottom)/_.y,left:(R.left-k.left+S.left)/_.x,right:(k.right-R.right+S.right)/_.x}}const v9=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}=Do(e,t)||{};if(p==null)return{};const g=Pb(m),y={x:n,y:r},b=kb(o),S=Db(b),j=await c.getDimensions(p),C=b==="y",R=C?"top":"left",E=C?"bottom":"right",T=C?"clientHeight":"clientWidth",_=s.reference[S]+s.reference[b]-y[b]-s.floating[S],k=y[b]-s.reference[b],I=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let A=I?I[T]:0;(!A||!await(c.isElement==null?void 0:c.isElement(I)))&&(A=d.floating[T]||s.floating[S]);const P=_/2-k/2,z=A/2-j[S]/2-1,B=Xi(g[R],z),Y=Xi(g[E],z),J=B,Z=A-j[S]-Y,$=A/2-j[S]/2+P,Q=_x(J,$,Z),M=!f.arrow&&tu(o)!=null&&$!==Q&&s.reference[S]/2-($<J?B:Y)-j[S]/2<0,L=M?$<J?$-J:$-Z:0;return{[b]:y[b]+L,data:{[b]:Q,centerOffset:$-Q-L,...M&&{alignmentOffset:L}},reset:M}}}),y9=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:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=Do(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const R=Ji(o),E=Wi(d),T=Ji(d)===d,_=await(f.isRTL==null?void 0:f.isRTL(p.floating)),k=y||(T||!j?[wp(d)]:W5(d)),I=S!=="none";!y&&I&&k.push(...J5(d,j,S,_));const A=[d,...k],P=await Td(t,C),z=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&z.push(P[R]),g){const $=Q5(o,c,_);z.push(P[$[0]],P[$[1]])}if(B=[...B,{placement:o,overflows:z}],!z.every($=>$<=0)){var Y,J;const $=(((Y=s.flip)==null?void 0:Y.index)||0)+1,Q=A[$];if(Q&&(!(g==="alignment"?E!==Wi(Q):!1)||B.every(U=>Wi(U.placement)===E?U.overflows[0]>0:!0)))return{data:{index:$,overflows:B},reset:{placement:Q}};let M=(J=B.filter(L=>L.overflows[0]<=0).sort((L,U)=>L.overflows[1]-U.overflows[1])[0])==null?void 0:J.placement;if(!M)switch(b){case"bestFit":{var Z;const L=(Z=B.filter(U=>{if(I){const V=Wi(U.placement);return V===E||V==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((U,V)=>U[1]-V[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 TE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function RE(e){return F5.some(t=>e[t]>=0)}const x9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Do(e,t);switch(r){case"referenceHidden":{const s=await Td(t,{...o,elementContext:"reference"}),c=TE(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:RE(c)}}}case"escaped":{const s=await Td(t,{...o,altBoundary:!0}),c=TE(s,n.floating);return{data:{escapedOffsets:c,escaped:RE(c)}}}default:return{}}}}};function a_(e){const t=Xi(...e.map(s=>s.left)),n=Xi(...e.map(s=>s.top)),r=xr(...e.map(s=>s.right)),o=xr(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:o-n}}function b9(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=>$c(a_(o)))}const S9=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}=Do(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),g=b9(m),y=$c(a_(m)),b=Pb(d);function S(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&p!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&p>C.top-b.top&&p<C.bottom+b.bottom)||y;if(g.length>=2){if(Wi(n)==="y"){const B=g[0],Y=g[g.length-1],J=Ji(n)==="top",Z=B.top,$=Y.bottom,Q=J?B.left:Y.left,M=J?B.right:Y.right,L=M-Q,U=$-Z;return{top:Z,bottom:$,left:Q,right:M,width:L,height:U,x:Q,y:Z}}const C=Ji(n)==="left",R=xr(...g.map(B=>B.right)),E=Xi(...g.map(B=>B.left)),T=g.filter(B=>C?B.left===E:B.right===R),_=T[0].top,k=T[T.length-1].bottom,I=E,A=R,P=A-I,z=k-_;return{top:_,bottom:k,left:I,right:A,width:P,height:z,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}}:{}}}},s_=new Set(["left","top"]);async function w9(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Ji(n),d=tu(n),f=Wi(n)==="y",p=s_.has(c)?-1:1,m=s&&f?-1:1,g=Do(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof S=="number"&&(b=d==="end"?S*-1:S),f?{x:b*m,y:y*p}:{x:y*p,y:b*m}}const j9=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 w9(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}}}}},C9=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:R,y:E}=C;return{x:R,y:E}}},...f}=Do(e,t),p={x:n,y:r},m=await Td(t,f),g=Wi(Ji(o)),y=Ab(g);let b=p[y],S=p[g];if(s){const C=y==="y"?"top":"left",R=y==="y"?"bottom":"right",E=b+m[C],T=b-m[R];b=_x(E,b,T)}if(c){const C=g==="y"?"top":"left",R=g==="y"?"bottom":"right",E=S+m[C],T=S-m[R];S=_x(E,S,T)}const j=d.fn({...t,[y]:b,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[y]:s,[g]:c}}}}}},E9=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}=Do(e,t),m={x:n,y:r},g=Wi(o),y=Ab(g);let b=m[y],S=m[g];const j=Do(d,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const T=y==="y"?"height":"width",_=s.reference[y]-s.floating[T]+C.mainAxis,k=s.reference[y]+s.reference[T]-C.mainAxis;b<_?b=_:b>k&&(b=k)}if(p){var R,E;const T=y==="y"?"width":"height",_=s_.has(Ji(o)),k=s.reference[g]-s.floating[T]+(_&&((R=c.offset)==null?void 0:R[g])||0)+(_?0:C.crossAxis),I=s.reference[g]+s.reference[T]+(_?0:((E=c.offset)==null?void 0:E[g])||0)-(_?C.crossAxis:0);S<k?S=k:S>I&&(S=I)}return{[y]:b,[g]:S}}}},T9=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}=Do(e,t),m=await Td(t,p),g=Ji(o),y=tu(o),b=Wi(o)==="y",{width:S,height:j}=s.floating;let C,R;g==="top"||g==="bottom"?(C=g,R=y===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(R=g,C=y==="end"?"top":"bottom");const E=j-m.top-m.bottom,T=S-m.left-m.right,_=Xi(j-m[C],E),k=Xi(S-m[R],T),I=!t.middlewareData.shift;let A=_,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=E),I&&!y){const B=xr(m.left,0),Y=xr(m.right,0),J=xr(m.top,0),Z=xr(m.bottom,0);b?P=S-2*(B!==0||Y!==0?B+Y:xr(m.left,m.right)):A=j-2*(J!==0||Z!==0?J+Z:xr(m.top,m.bottom))}await f({...t,availableWidth:P,availableHeight:A});const z=await c.getDimensions(d.floating);return S!==z.width||j!==z.height?{reset:{rects:!0}}:{}}}};function l_(e){const t=Pi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=di(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r,d=Sp(n)!==s||Sp(r)!==c;return d&&(n=s,r=c),{width:n,height:r,$:d}}function Nb(e){return wn(e)?e:e.contextElement}function Oc(e){const t=Nb(e);if(!di(t))return jo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=l_(t);let c=(s?Sp(n.width):n.width)/r,d=(s?Sp(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const R9=jo(0);function c_(e){const t=Kr(e);return!om()||!t.visualViewport?R9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Kr(e)?!1:t}function fl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Nb(e);let c=jo(1);t&&(r?wn(r)&&(c=Oc(r)):c=Oc(e));const d=_9(s,n,r)?c_(s):jo(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),b=r&&wn(r)?Kr(r):r;let S=y,j=Rx(S);for(;j&&r&&b!==S;){const C=Oc(j),R=j.getBoundingClientRect(),E=Pi(j),T=R.left+(j.clientLeft+parseFloat(E.paddingLeft))*C.x,_=R.top+(j.clientTop+parseFloat(E.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=T,p+=_,S=Kr(j),j=Rx(S)}}return $c({width:m,height:g,x:f,y:p})}function sm(e,t){const n=am(e).scrollLeft;return t?t.left+n:fl(zo(e)).left+n}function u_(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-sm(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function A9(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",c=zo(r),d=t?im(t.floating):!1;if(r===c||d&&s)return n;let f={scrollLeft:0,scrollTop:0},p=jo(1);const m=jo(0),g=di(r);if((g||!g&&!s)&&((eu(r)!=="body"||qd(c))&&(f=am(r)),di(r))){const b=fl(r);p=Oc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const y=c&&!g&&!s?u_(c,f):jo(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 D9(e){return Array.from(e.getClientRects())}function k9(e){const t=zo(e),n=am(e),r=e.ownerDocument.body,o=xr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=xr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+sm(e);const d=-n.scrollTop;return Pi(r).direction==="rtl"&&(c+=xr(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:c,y:d}}const _E=25;function P9(e,t){const n=Kr(e),r=zo(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=om();(!m||m&&t==="fixed")&&(d=o.offsetLeft,f=o.offsetTop)}const p=sm(r);if(p<=0){const m=r.ownerDocument,g=m.body,y=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(r.clientWidth-g.clientWidth-b);S<=_E&&(s-=S)}else p<=_E&&(s+=p);return{width:s,height:c,x:d,y:f}}const N9=new Set(["absolute","fixed"]);function O9(e,t){const n=fl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=di(e)?Oc(e):jo(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 AE(e,t,n){let r;if(t==="viewport")r=P9(e,n);else if(t==="document")r=k9(zo(e));else if(wn(t))r=O9(t,n);else{const o=c_(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return $c(r)}function d_(e,t){const n=ga(e);return n===t||!wn(n)||pa(n)?!1:Pi(n).position==="fixed"||d_(n,t)}function M9(e,t){const n=t.get(e);if(n)return n;let r=ma(e,[],!1).filter(d=>wn(d)&&eu(d)!=="body"),o=null;const s=Pi(e).position==="fixed";let c=s?ga(e):e;for(;wn(c)&&!pa(c);){const d=Pi(c),f=_b(c);!f&&d.position==="fixed"&&(o=null),(s?!f&&!o:!f&&d.position==="static"&&!!o&&N9.has(o.position)||qd(c)&&!f&&d_(e,c))?r=r.filter(m=>m!==c):o=d,c=ga(c)}return t.set(e,r),r}function L9(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?im(t)?[]:M9(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((p,m)=>{const g=AE(t,m,o);return p.top=xr(g.top,p.top),p.right=Xi(g.right,p.right),p.bottom=Xi(g.bottom,p.bottom),p.left=xr(g.left,p.left),p},AE(t,d,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function I9(e){const{width:t,height:n}=l_(e);return{width:t,height:n}}function z9(e,t,n){const r=di(t),o=zo(t),s=n==="fixed",c=fl(e,!0,s,t);let d={scrollLeft:0,scrollTop:0};const f=jo(0);function p(){f.x=sm(o)}if(r||!r&&!s)if((eu(t)!=="body"||qd(o))&&(d=am(t)),r){const b=fl(t,!0,s,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else o&&p();s&&!r&&o&&p();const m=o&&!r&&!s?u_(o,d):jo(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 My(e){return Pi(e).position==="static"}function DE(e,t){if(!di(e)||Pi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return zo(e)===n&&(n=n.ownerDocument.body),n}function f_(e,t){const n=Kr(e);if(im(e))return n;if(!di(e)){let o=ga(e);for(;o&&!pa(o);){if(wn(o)&&!My(o))return o;o=ga(o)}return n}let r=DE(e,t);for(;r&&L5(r)&&My(r);)r=DE(r,t);return r&&pa(r)&&My(r)&&!_b(r)?n:r||B5(e)||n}const $9=async function(e){const t=this.getOffsetParent||f_,n=this.getDimensions,r=await n(e.floating);return{reference:z9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function U9(e){return Pi(e).direction==="rtl"}const B9={convertOffsetParentRelativeRectToViewportRelativeRect:A9,getDocumentElement:zo,getClippingRect:L9,getOffsetParent:f_,getElementRects:$9,getClientRects:D9,getDimensions:I9,getScale:Oc,isElement:wn,isRTL:U9};function h_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function V9(e,t){let n=null,r;const o=zo(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:b}=p;if(d||t(),!y||!b)return;const S=Fh(g),j=Fh(o.clientWidth-(m+y)),C=Fh(o.clientHeight-(g+b)),R=Fh(m),T={rootMargin:-S+"px "+-j+"px "+-C+"px "+-R+"px",threshold:xr(0,Xi(1,f))||1};let _=!0;function k(I){const A=I[0].intersectionRatio;if(A!==f){if(!_)return c();A?c(!1,A):r=setTimeout(()=>{c(!1,1e-7)},1e3)}A===1&&!h_(p,e.getBoundingClientRect())&&c(),_=!1}try{n=new IntersectionObserver(k,{...T,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,T)}n.observe(e)}return c(!0),s}function kx(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=Nb(e),m=o||s?[...p?ma(p):[],...ma(t)]:[];m.forEach(R=>{o&&R.addEventListener("scroll",n,{passive:!0}),s&&R.addEventListener("resize",n)});const g=p&&d?V9(p,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(R=>{let[E]=R;E&&E.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let S,j=f?fl(e):null;f&&C();function C(){const R=fl(e);j&&!h_(j,R)&&n(),j=R,S=requestAnimationFrame(C)}return n(),()=>{var R;m.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),g?.(),(R=b)==null||R.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const F9=j9,H9=C9,q9=y9,G9=T9,Q9=x9,kE=v9,W9=S9,Y9=E9,K9=(e,t,n)=>{const r=new Map,o={platform:B9,...n},s={...o.platform,_c:r};return g9(e,t,{...o,platform:s})};var X9=typeof document<"u",J9=function(){},lp=X9?v.useLayoutEffect:J9;function jp(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(!jp(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)&&!jp(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function p_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function PE(e,t){const n=p_(e);return Math.round(t*n)/n}function Ly(e){const t=v.useRef(e);return lp(()=>{t.current=e}),t}function Z9(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,b]=v.useState(r);jp(y,r)||b(r);const[S,j]=v.useState(null),[C,R]=v.useState(null),E=v.useCallback(U=>{U!==I.current&&(I.current=U,j(U))},[]),T=v.useCallback(U=>{U!==A.current&&(A.current=U,R(U))},[]),_=s||S,k=c||C,I=v.useRef(null),A=v.useRef(null),P=v.useRef(m),z=f!=null,B=Ly(f),Y=Ly(o),J=Ly(p),Z=v.useCallback(()=>{if(!I.current||!A.current)return;const U={placement:t,strategy:n,middleware:y};Y.current&&(U.platform=Y.current),K9(I.current,A.current,U).then(V=>{const K={...V,isPositioned:J.current!==!1};$.current&&!jp(P.current,K)&&(P.current=K,Rb.flushSync(()=>{g(K)}))})},[y,t,n,Y,J]);lp(()=>{p===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(U=>({...U,isPositioned:!1})))},[p]);const $=v.useRef(!1);lp(()=>($.current=!0,()=>{$.current=!1}),[]),lp(()=>{if(_&&(I.current=_),k&&(A.current=k),_&&k){if(B.current)return B.current(_,k,Z);Z()}},[_,k,Z,B,z]);const Q=v.useMemo(()=>({reference:I,floating:A,setReference:E,setFloating:T}),[E,T]),M=v.useMemo(()=>({reference:_,floating:k}),[_,k]),L=v.useMemo(()=>{const U={position:n,left:0,top:0};if(!M.floating)return U;const V=PE(M.floating,m.x),K=PE(M.floating,m.y);return d?{...U,transform:"translate("+V+"px, "+K+"px)",...p_(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:K}},[n,d,M.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:Z,refs:Q,elements:M,floatingStyles:L}),[m,Z,Q,M,L])}const eL=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?kE({element:r.current,padding:o}).fn(n):{}:r?kE({element:r,padding:o}).fn(n):{}}}},m_=(e,t)=>({...F9(e),options:[e,t]}),Ob=(e,t)=>({...H9(e),options:[e,t]}),NE=(e,t)=>({...Y9(e),options:[e,t]}),Cp=(e,t)=>({...q9(e),options:[e,t]}),tL=(e,t)=>({...G9(e),options:[e,t]}),nL=(e,t)=>({...Q9(e),options:[e,t]}),yd=(e,t)=>({...W9(e),options:[e,t]}),g_=(e,t)=>({...eL(e),options:[e,t]});function v_(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 rL="data-floating-ui-focusable",OE="active",ME="selected",iL={..._2};let LE=!1,oL=0;const IE=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+oL++;function aL(){const[e,t]=v.useState(()=>LE?IE():void 0);return Co(()=>{e==null&&t(IE())},[]),v.useEffect(()=>{LE=!0},[]),e}const sL=iL.useId,y_=sL||aL;function lL(){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 cL=v.createContext(null),uL=v.createContext(null),Mb=()=>{var e;return((e=v.useContext(cL))==null?void 0:e.id)||null},Lb=()=>v.useContext(uL);function Ib(e){return"data-floating-ui-"+e}function Ri(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const zE=Ib("safe-polygon");function cp(e,t,n){if(n&&!Dx(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 Iy(e){return typeof e=="function"?e():e}function dL(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,b=Lb(),S=Mb(),j=Hh(p),C=Hh(f),R=Hh(n),E=Hh(g),T=v.useRef(),_=v.useRef(-1),k=v.useRef(),I=v.useRef(-1),A=v.useRef(!0),P=v.useRef(!1),z=v.useRef(()=>{}),B=v.useRef(!1),Y=So(()=>{var L;const U=(L=o.current.openEvent)==null?void 0:L.type;return U?.includes("mouse")&&U!=="mousedown"});v.useEffect(()=>{if(!d)return;function L(U){let{open:V}=U;V||(Ri(_),Ri(I),A.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(V){Y()&&r(!1,V,"hover")}const U=nl(c.floating).documentElement;return U.addEventListener("mouseleave",L),()=>{U.removeEventListener("mouseleave",L)}},[c.floating,n,r,d,j,Y]);const J=v.useCallback(function(L,U,V){U===void 0&&(U=!0),V===void 0&&(V="hover");const K=cp(C.current,"close",T.current);K&&!k.current?(Ri(_),_.current=window.setTimeout(()=>r(!1,L,V),K)):U&&(Ri(_),r(!1,L,V))},[C,r]),Z=So(()=>{z.current(),k.current=void 0}),$=So(()=>{if(P.current){const L=nl(c.floating).body;L.style.pointerEvents="",L.removeAttribute(zE),P.current=!1}}),Q=So(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);v.useEffect(()=>{if(!d)return;function L(F){if(Ri(_),A.current=!1,m&&!Dx(T.current)||Iy(E.current)>0&&!cp(C.current,"open"))return;const ae=cp(C.current,"open",T.current);ae?_.current=window.setTimeout(()=>{R.current||r(!0,F,"hover")},ae):n||r(!0,F,"hover")}function U(F){if(Q()){$();return}z.current();const ae=nl(c.floating);if(Ri(I),B.current=!1,j.current&&o.current.floatingContext){n||Ri(_),k.current=j.current({...o.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){$(),Z(),Q()||J(F,!0,"safe-polygon")}});const be=k.current;ae.addEventListener("mousemove",be),z.current=()=>{ae.removeEventListener("mousemove",be)};return}(T.current==="touch"?!Ed(c.floating,F.relatedTarget):!0)&&J(F)}function V(F){Q()||o.current.floatingContext&&(j.current==null||j.current({...o.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){$(),Z(),Q()||J(F)}})(F))}function K(){Ri(_)}function O(F){Q()||J(F,!1)}if(wn(c.domReference)){const F=c.domReference,ae=c.floating;return n&&F.addEventListener("mouseleave",V),y&&F.addEventListener("mousemove",L,{once:!0}),F.addEventListener("mouseenter",L),F.addEventListener("mouseleave",U),ae&&(ae.addEventListener("mouseleave",V),ae.addEventListener("mouseenter",K),ae.addEventListener("mouseleave",O)),()=>{n&&F.removeEventListener("mouseleave",V),y&&F.removeEventListener("mousemove",L),F.removeEventListener("mouseenter",L),F.removeEventListener("mouseleave",U),ae&&(ae.removeEventListener("mouseleave",V),ae.removeEventListener("mouseenter",K),ae.removeEventListener("mouseleave",O))}}},[c,d,e,m,y,J,Z,$,r,n,R,b,C,j,o,Q,E]),Co(()=>{var L;if(d&&n&&(L=j.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&Y()){P.current=!0;const V=c.floating;if(wn(c.domReference)&&V){var U;const K=nl(c.floating).body;K.setAttribute(zE,"");const O=c.domReference,F=b==null||(U=b.nodesRef.current.find(ae=>ae.id===S))==null||(U=U.context)==null?void 0:U.elements.floating;return F&&(F.style.pointerEvents=""),K.style.pointerEvents="none",O.style.pointerEvents="auto",V.style.pointerEvents="auto",()=>{K.style.pointerEvents="",O.style.pointerEvents="",V.style.pointerEvents=""}}}},[d,n,S,c,b,j,Y]),Co(()=>{n||(T.current=void 0,B.current=!1,Z(),$())},[n,Z,$]),v.useEffect(()=>()=>{Z(),Ri(_),Ri(I),$()},[d,c.domReference,Z,$]);const M=v.useMemo(()=>{function L(U){T.current=U.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(U){const{nativeEvent:V}=U;function K(){!A.current&&!R.current&&r(!0,V,"hover")}m&&!Dx(T.current)||n||Iy(E.current)===0||B.current&&U.movementX**2+U.movementY**2<2||(Ri(I),T.current==="touch"?K():(B.current=!0,I.current=window.setTimeout(K,Iy(E.current))))}}},[m,r,n,R,E]);return v.useMemo(()=>d?{reference:M}:{},[d,M])}const Px=()=>{},x_=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Px,setState:Px,isInstantPhase:!1}),fL=()=>v.useContext(x_);function hL(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 Co(()=>{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(x_.Provider,{value:v.useMemo(()=>({...o,setState:s,setCurrentId:d}),[o,d]),children:t})}function pL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:s,enabled:c=!0}=t,d=s??o,f=fL(),{currentId:p,setCurrentId:m,initialDelay:g,setState:y,timeoutMs:b}=f;return Co(()=>{c&&p&&(y({delay:{open:1,close:cp(g,"close")}}),p!==d&&r(!1))},[c,d,r,y,p,g]),Co(()=>{function S(){r(!1),y({delay:g,currentId:null})}if(c&&p&&!n&&p===d){if(b){const j=window.setTimeout(S,b);return()=>{clearTimeout(j)}}S()}},[c,n,y,p,d,r,g,b]),Co(()=>{c&&(m===Px||!n||m(d))},[c,n,m,d]),f}const mL={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},gL={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},$E=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 vL(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:b,capture:S}=t,j=Lb(),C=So(typeof f=="function"?f:()=>!1),R=typeof f=="function"?C:f,E=v.useRef(!1),{escapeKey:T,outsidePress:_}=$E(b),{escapeKey:k,outsidePress:I}=$E(S),A=v.useRef(!1),P=So($=>{var Q;if(!n||!c||!d||$.key!=="Escape"||A.current)return;const M=(Q=s.current.floatingContext)==null?void 0:Q.nodeId,L=j?sp(j.nodesRef.current,M):[];if(!T&&($.stopPropagation(),L.length>0)){let U=!0;if(L.forEach(V=>{var K;if((K=V.context)!=null&&K.open&&!V.context.dataRef.current.__escapeKeyBubbles){U=!1;return}}),!U)return}r(!1,u9($)?$.nativeEvent:$,"escape-key")}),z=So($=>{var Q;const M=()=>{var L;P($),(L=Ac($))==null||L.removeEventListener("keydown",M)};(Q=Ac($))==null||Q.addEventListener("keydown",M)}),B=So($=>{var Q;const M=s.current.insideReactTree;s.current.insideReactTree=!1;const L=E.current;if(E.current=!1,p==="click"&&L||M||typeof R=="function"&&!R($))return;const U=Ac($),V="["+Ib("inert")+"]",K=nl(o.floating).querySelectorAll(V);let O=wn(U)?U:null;for(;O&&!pa(O);){const be=ga(O);if(pa(be)||!wn(be))break;O=be}if(K.length&&wn(U)&&!a9(U)&&!Ed(U,o.floating)&&Array.from(K).every(be=>!Ed(O,be)))return;if(di(U)&&Z){const be=pa(U),we=Pi(U),Ce=/auto|scroll/,nt=be||Ce.test(we.overflowX),De=be||Ce.test(we.overflowY),ft=nt&&U.clientWidth>0&&U.scrollWidth>U.clientWidth,ot=De&&U.clientHeight>0&&U.scrollHeight>U.clientHeight,ht=we.direction==="rtl",st=ot&&(ht?$.offsetX<=U.offsetWidth-U.clientWidth:$.offsetX>U.clientWidth),yt=ft&&$.offsetY>U.clientHeight;if(st||yt)return}const F=(Q=s.current.floatingContext)==null?void 0:Q.nodeId,ae=j&&sp(j.nodesRef.current,F).some(be=>{var we;return Oy($,(we=be.context)==null?void 0:we.elements.floating)});if(Oy($,o.floating)||Oy($,o.domReference)||ae)return;const ue=j?sp(j.nodesRef.current,F):[];if(ue.length>0){let be=!0;if(ue.forEach(we=>{var Ce;if((Ce=we.context)!=null&&Ce.open&&!we.context.dataRef.current.__outsidePressBubbles){be=!1;return}}),!be)return}r(!1,$,"outside-press")}),Y=So($=>{var Q;const M=()=>{var L;B($),(L=Ac($))==null||L.removeEventListener(p,M)};(Q=Ac($))==null||Q.addEventListener(p,M)});v.useEffect(()=>{if(!n||!c)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=_;let $=-1;function Q(K){r(!1,K,"ancestor-scroll")}function M(){window.clearTimeout($),A.current=!0}function L(){$=window.setTimeout(()=>{A.current=!1},om()?5:0)}const U=nl(o.floating);d&&(U.addEventListener("keydown",k?z:P,k),U.addEventListener("compositionstart",M),U.addEventListener("compositionend",L)),R&&U.addEventListener(p,I?Y:B,I);let V=[];return y&&(wn(o.domReference)&&(V=ma(o.domReference)),wn(o.floating)&&(V=V.concat(ma(o.floating))),!wn(o.reference)&&o.reference&&o.reference.contextElement&&(V=V.concat(ma(o.reference.contextElement)))),V=V.filter(K=>{var O;return K!==((O=U.defaultView)==null?void 0:O.visualViewport)}),V.forEach(K=>{K.addEventListener("scroll",Q,{passive:!0})}),()=>{d&&(U.removeEventListener("keydown",k?z:P,k),U.removeEventListener("compositionstart",M),U.removeEventListener("compositionend",L)),R&&U.removeEventListener(p,I?Y:B,I),V.forEach(K=>{K.removeEventListener("scroll",Q)}),window.clearTimeout($)}},[s,o,d,R,p,n,r,y,c,T,_,P,k,z,B,I,Y]),v.useEffect(()=>{s.current.insideReactTree=!1},[s,R,p]);const J=v.useMemo(()=>({onKeyDown:P,...m&&{[mL[g]]:$=>{r(!1,$.nativeEvent,"reference-press")},...g!=="click"&&{onClick($){r(!1,$.nativeEvent,"reference-press")}}}}),[P,r,m,g]),Z=v.useMemo(()=>({onKeyDown:P,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[gL[p]]:()=>{s.current.insideReactTree=!0}}),[P,p,s]);return v.useMemo(()=>c?{reference:J,floating:Z}:{},[c,J,Z])}function yL(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=y_(),s=v.useRef({}),[c]=v.useState(()=>lL()),d=Mb()!=null,[f,p]=v.useState(r.reference),m=So((b,S,j)=>{s.current.openEvent=b?S:void 0,c.emit("openchange",{open:b,event:S,reason:j,nested:d}),n?.(b,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 zb(e){e===void 0&&(e={});const{nodeId:t}=e,n=yL({...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=Lb();Co(()=>{m&&(g.current=m)},[m]);const b=Z9({...e,elements:{...o,...d&&{reference:d}}}),S=v.useCallback(T=>{const _=wn(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;f(_),b.refs.setReference(_)},[b.refs]),j=v.useCallback(T=>{(wn(T)||T===null)&&(g.current=T,c(T)),(wn(b.refs.reference.current)||b.refs.reference.current===null||T!==null&&!wn(T))&&b.refs.setReference(T)},[b.refs]),C=v.useMemo(()=>({...b.refs,setReference:j,setPositionReference:S,domReference:g}),[b.refs,j,S]),R=v.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),E=v.useMemo(()=>({...b,...r,refs:C,elements:R,nodeId:t}),[b,C,R,t,r]);return Co(()=>{r.dataRef.current.floatingContext=E;const T=y?.nodesRef.current.find(_=>_.id===t);T&&(T.context=E)}),v.useMemo(()=>({...b,context:E,refs:C,elements:R}),[b,C,R,E])}function zy(){return r9()&&n9()}function xL(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 b=Kr(c.domReference);function S(){!n&&di(c.domReference)&&c.domReference===CE(nl(c.domReference))&&(p.current=!0)}function j(){g.current=!0}function C(){g.current=!1}return b.addEventListener("blur",S),zy()&&(b.addEventListener("keydown",j,!0),b.addEventListener("pointerdown",C,!0)),()=>{b.removeEventListener("blur",S),zy()&&(b.removeEventListener("keydown",j,!0),b.removeEventListener("pointerdown",C,!0))}},[c.domReference,n,d]),v.useEffect(()=>{if(!d)return;function b(S){let{reason:j}=S;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return o.on("openchange",b),()=>{o.off("openchange",b)}},[o,d]),v.useEffect(()=>()=>{Ri(m)},[]);const y=v.useMemo(()=>({onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const S=Ac(b.nativeEvent);if(f&&wn(S)){if(zy()&&!b.relatedTarget){if(!g.current&&!s9(S))return}else if(!l9(S))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const S=b.relatedTarget,j=b.nativeEvent,C=wn(S)&&S.hasAttribute(Ib("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var R;const E=CE(c.domReference?c.domReference.ownerDocument:document);!S&&E===c.domReference||Ed((R=s.current.floatingContext)==null?void 0:R.refs.floating.current,E)||Ed(c.domReference,E)||C||r(!1,j,"focus")})}}),[s,c.domReference,r,f]);return v.useMemo(()=>d?{reference:y}:{},[d,y])}function $y(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[OE]:c,[ME]:d,...f}=e;s=f}return{...n==="floating"&&{tabIndex:-1,[rL]:""},...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&&[OE,ME].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,b=arguments.length,S=new Array(b),j=0;j<b;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 bL(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=>$y(d,e,"reference"),t),s=v.useCallback(d=>$y(d,e,"floating"),n),c=v.useCallback(d=>$y(d,e,"item"),r);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c}),[o,s,c])}const SL=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function wL(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=y_(),m=((n=s.domReference)==null?void 0:n.id)||p,g=v.useMemo(()=>{var E;return((E=c9(s.floating))==null?void 0:E.id)||c},[s.floating,c]),y=(r=SL.get(f))!=null?r:f,S=Mb()!=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 E={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?E:{...E,...y==="menu"&&{"aria-labelledby":m}}},[y,g,m,f]),R=v.useCallback(E=>{let{active:T,selected:_}=E;const k={role:"option",...T&&{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:R}:{},[d,j,C,R])}const[jL,Mi]=jr("ScrollArea.Root component was not found in tree");function Uc(e,t){const n=Js(t);Jc(()=>{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 CL=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Mi(),[s,c]=v.useState(0),[d,f]=v.useState(0),p=!!(s&&d);return Uc(o.scrollbarX,()=>{const m=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(m),f(m)}),Uc(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}),EL=v.forwardRef((e,t)=>{const n=Mi(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(CL,{...e,ref:t}):null}),TL={scrollHideDelay:1e3,type:"hover"},b_=v.forwardRef((e,t)=>{const{type:n,scrollHideDelay:r,scrollbars:o,getStyles:s,...c}=ie("ScrollAreaRoot",TL,e),[d,f]=v.useState(null),[p,m]=v.useState(null),[g,y]=v.useState(null),[b,S]=v.useState(null),[j,C]=v.useState(null),[R,E]=v.useState(0),[T,_]=v.useState(0),[k,I]=v.useState(!1),[A,P]=v.useState(!1),z=Bn(t,B=>f(B));return a.jsx(jL,{value:{type:n,scrollHideDelay:r,scrollArea:d,viewport:p,onViewportChange:m,content:g,onContentChange:y,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:k,onScrollbarXEnabledChange:I,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:A,onScrollbarYEnabledChange:P,onCornerWidthChange:E,onCornerHeightChange:_,getStyles:s},children:a.jsx(ce,{...c,ref:z,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${R}px`,"--sa-corner-height":o!=="xy"?"0px":`${T}px`}})})});b_.displayName="@mantine/core/ScrollAreaRoot";function S_(e,t){const n=e/t;return Number.isNaN(n)?0:n}function lm(e){const t=S_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function w_(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 RL(e,[t,n]){return Math.min(n,Math.max(t,e))}function UE(e,t,n="ltr"){const r=lm(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=RL(e,f);return w_([0,c],[0,d])(p)}function _L(e,t,n,r="ltr"){const o=lm(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 w_([f,p],g)(e)}function j_(e,t){return e>0&&e<t}function hs(e){return e?parseInt(e,10):0}function cl(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}const[AL,C_]=jr("ScrollAreaScrollbar was not found in tree"),E_=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=Mi(),[b,S]=v.useState(null),j=Bn(t,P=>S(P)),C=v.useRef(null),R=v.useRef(""),{viewport:E}=y,T=n.content-n.viewport,_=Js(p),k=Js(d),I=Zp(m,10),A=P=>{if(C.current){const z=P.clientX-C.current.left,B=P.clientY-C.current.top;f({x:z,y:B})}};return v.useEffect(()=>{const P=z=>{const B=z.target;b?.contains(B)&&_(z,T)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[E,b,T,_]),v.useEffect(k,[n,k]),Uc(b,I),Uc(y.content,I),a.jsx(AL,{value:{scrollbar:b,hasThumb:r,onThumbChange:Js(o),onThumbPointerUp:Js(s),onThumbPositionChange:k,onThumbPointerDown:Js(c)},children:a.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:cl(e.onPointerDown,P=>{P.preventDefault(),P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=b.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A(P))}),onPointerMove:cl(e.onPointerMove,A),onPointerUp:cl(e.onPointerUp,P=>{const z=P.target;z.hasPointerCapture(P.pointerId)&&(P.preventDefault(),z.releasePointerCapture(P.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=R.current,C.current=null}})})}),T_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=Mi(),[d,f]=v.useState(),p=v.useRef(null),m=Bn(t,p,c.onScrollbarXChange);return v.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),a.jsx(E_,{"data-orientation":"horizontal",...s,ref:m,sizes:n,style:{...o,"--sa-thumb-width":`${lm(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,y)=>{if(c.viewport){const b=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),j_(b,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:hs(d.paddingLeft),paddingEnd:hs(d.paddingRight)}})}})});T_.displayName="@mantine/core/ScrollAreaScrollbarX";const R_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...s}=e,c=Mi(),[d,f]=v.useState(),p=v.useRef(null),m=Bn(t,p,c.onScrollbarYChange);return v.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),a.jsx(E_,{...s,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${lm(n)}px`,...o},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,y)=>{if(c.viewport){const b=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),j_(b,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:hs(d.paddingTop),paddingEnd:hs(d.paddingBottom)}})}})});R_.displayName="@mantine/core/ScrollAreaScrollbarY";const cm=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=ws(),s=Mi(),c=v.useRef(null),d=v.useRef(0),[f,p]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=S_(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{d.current=0},onThumbPointerDown:b=>{d.current=b}},y=(b,S)=>_L(b,d.current,f,S);return n==="horizontal"?a.jsx(T_,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollLeft,S=UE(b,f,o);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollLeft=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollLeft=y(b,o))}}):n==="vertical"?a.jsx(R_,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollTop,S=UE(b,f);f.scrollbar.size===0?c.current.style.setProperty("--thumb-opacity","0"):c.current.style.setProperty("--thumb-opacity","1"),c.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=y(b))}}):null});cm.displayName="@mantine/core/ScrollAreaScrollbarVisible";const $b=v.forwardRef((e,t)=>{const n=Mi(),{forceMount:r,...o}=e,[s,c]=v.useState(!1),d=e.orientation==="horizontal",f=Zp(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?p:m)}},10);return Uc(n.viewport,f),Uc(n.content,f),r||s?a.jsx(cm,{"data-state":s?"visible":"hidden",...o,ref:t}):null});$b.displayName="@mantine/core/ScrollAreaScrollbarAuto";const __=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Mi(),[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($b,{"data-state":s?"visible":"hidden",...r,ref:t}):null});__.displayName="@mantine/core/ScrollAreaScrollbarHover";const DL=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Mi(),s=e.orientation==="horizontal",[c,d]=v.useState("hidden"),f=Zp(()=>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 b=p[m];g!==b&&(d("scrolling"),f()),g=b};return p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[o.viewport,s,f]),n||c!=="hidden"?a.jsx(cm,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:cl(e.onPointerEnter,()=>d("interacting")),onPointerLeave:cl(e.onPointerLeave,()=>d("idle"))}):null}),Nx=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Mi(),{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(__,{...r,ref:t,forceMount:n}):o.type==="scroll"?a.jsx(DL,{...r,ref:t,forceMount:n}):o.type==="auto"?a.jsx($b,{...r,ref:t,forceMount:n}):o.type==="always"?a.jsx(cm,{...r,ref:t}):null});Nx.displayName="@mantine/core/ScrollAreaScrollbar";function kL(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 A_=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Mi(),s=C_(),{onThumbPositionChange:c}=s,d=Bn(t,m=>s.onThumbChange(m)),f=v.useRef(void 0),p=Zp(()=>{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=kL(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:cl(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),b=m.clientX-y.left,S=m.clientY-y.top;s.onThumbPointerDown({x:b,y:S})}),onPointerUp:cl(e.onPointerUp,s.onThumbPointerUp)})});A_.displayName="@mantine/core/ScrollAreaThumb";const Ox=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=C_();return n||o.hasThumb?a.jsx(A_,{ref:t,...r}):null});Ox.displayName="@mantine/core/ScrollAreaThumb";const D_=v.forwardRef(({children:e,style:t,...n},r)=>{const o=Mi(),s=Bn(r,o.onViewportChange);return a.jsx(ce,{...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})})});D_.displayName="@mantine/core/ScrollAreaViewport";var Ub={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const k_={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},PL=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Jr=ge((e,t)=>{const n=ie("ScrollArea",k_,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:y,viewportRef:b,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:R,onBottomReached:E,onTopReached:T,overscrollBehavior:_,attributes:k,...I}=n,[A,P]=v.useState(!1),[z,B]=v.useState(!1),[Y,J]=v.useState(!1),Z=Le({name:"ScrollArea",props:n,classes:Ub,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:k,vars:p,varsResolver:PL}),$=v.useRef(null),Q=v_([b,$]);return v.useEffect(()=>{if(!$.current||C!=="present")return;const M=$.current,L=new ResizeObserver(()=>{const{scrollHeight:U,clientHeight:V,scrollWidth:K,clientWidth:O}=M;B(U>V),J(K>O)});return L.observe(M),()=>L.disconnect()},[$,C]),a.jsxs(b_,{getStyles:Z,type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:R,...Z("root"),...I,children:[a.jsx(D_,{...y,...Z("viewport",{style:y?.style}),ref:Q,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":R||void 0,"data-horizontal-hidden":C==="present"&&!Y?"true":void 0,"data-vertical-hidden":C==="present"&&!z?"true":void 0,onScroll:M=>{y?.onScroll?.(M),S?.({x:M.currentTarget.scrollLeft,y:M.currentTarget.scrollTop});const{scrollTop:L,scrollHeight:U,clientHeight:V}=M.currentTarget;L-(U-V)>=-.6&&E?.(),L===0&&T?.()},children:j}),(R==="xy"||R==="x")&&a.jsx(Nx,{...Z("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!Y?!0:void 0,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:a.jsx(Ox,{...Z("thumb")})}),(R==="xy"||R==="y")&&a.jsx(Nx,{...Z("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!z?!0:void 0,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:a.jsx(Ox,{...Z("thumb")})}),a.jsx(EL,{...Z("corner"),"data-hovered":A||void 0,"data-hidden":m==="never"||void 0})]})});Jr.displayName="@mantine/core/ScrollArea";const um=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:b,viewportProps:S,scrollbars:j,style:C,vars:R,onBottomReached:E,onTopReached:T,onOverflowChange:_,...k}=ie("ScrollAreaAutosize",k_,e),I=v.useRef(null),A=v_([m,I]),[P,z]=v.useState(!1),B=v.useRef(!1);return v.useEffect(()=>{if(!_)return;const Y=I.current;if(!Y)return;const J=()=>{const $=Y.scrollHeight>Y.clientHeight;$!==P&&(B.current?_?.($):(B.current=!0,$&&_?.(!0)),z($))};J();const Z=new ResizeObserver(J);return Z.observe(Y),()=>Z.disconnect()},[_,P]),a.jsx(ce,{...k,ref:t,style:[{display:"flex",overflow:"hidden"},C],children:a.jsx(ce,{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:A,onScrollPositionChange:g,unstyled:y,variant:b,viewportProps:S,vars:R,scrollbars:j,onBottomReached:E,onTopReached:T,"data-autosize":"true",children:n})})})});Jr.classes=Ub;um.displayName="@mantine/core/ScrollAreaAutosize";um.classes=Ub;Jr.Autosize=um;var P_={root:"m_87cf2631"};const NL={__staticSelector:"UnstyledButton"},An=sr((e,t)=>{const n=ie("UnstyledButton",NL,e),{className:r,component:o="button",__staticSelector:s,unstyled:c,classNames:d,styles:f,style:p,attributes:m,...g}=n,y=Le({name:s,props:n,classes:P_,className:r,style:p,classNames:d,styles:f,unstyled:c,attributes:m});return a.jsx(ce,{...y("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...g})});An.classes=P_;An.displayName="@mantine/core/UnstyledButton";var N_={root:"m_515a97f8"};const Bb=ge((e,t)=>{const n=ie("VisuallyHidden",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,attributes:p,...m}=n,g=Le({name:"VisuallyHidden",classes:N_,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:p});return a.jsx(ce,{component:"span",ref:t,...g("root"),...m})});Bb.classes=N_;Bb.displayName="@mantine/core/VisuallyHidden";var O_={root:"m_1b7284a3"};const OL=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Ft(t),"--paper-shadow":xb(n)}}),Or=sr((e,t)=>{const n=ie("Paper",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,withBorder:f,vars:p,radius:m,shadow:g,variant:y,mod:b,attributes:S,...j}=n,C=Le({name:"Paper",props:n,classes:O_,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:p,varsResolver:OL});return a.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...C("root"),variant:y,...j})});Or.classes=O_;Or.displayName="@mantine/core/Paper";function BE(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function VE(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 ML={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function LL({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",[ML[f]]:r},g=-t/2;return f==="left"?{...m,...BE(p,c,n,o),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...BE(p,c,n,o),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...VE(p,s,n,o,d),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...VE(p,s,n,o,d),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Ep=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}=ws();return s?a.jsx("div",{...p,ref:m,style:{...f,...LL({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:g,arrowX:c,arrowY:d})}}):null});Ep.displayName="@mantine/core/FloatingArrow";function M_(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 L_={root:"m_9814e45f"};const IL={zIndex:zr("modal")},zL=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&_i(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${le(o)})`:void 0,"--overlay-radius":s===void 0?void 0:Ft(s),"--overlay-z-index":c?.toString()}}),Bc=sr((e,t)=>{const n=ie("Overlay",IL,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,fixed:p,center:m,children:g,radius:y,zIndex:b,gradient:S,blur:j,color:C,backgroundOpacity:R,mod:E,attributes:T,..._}=n,k=Le({name:"Overlay",props:n,classes:L_,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:T,vars:f,varsResolver:zL});return a.jsx(ce,{ref:t,...k("root"),mod:[{center:m,fixed:p},E],..._,children:g})});Bc.classes=L_;Bc.displayName="@mantine/core/Overlay";function Uy(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 $L({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Uy(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const o=Uy(n);return o.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(o),o}return Uy(n)}const UL={reuseTargetNode:!0},I_=ge((e,t)=>{const{children:n,target:r,reuseTargetNode:o,...s}=ie("Portal",UL,e),[c,d]=v.useState(!1),f=v.useRef(null);return Jc(()=>(d(!0),f.current=$L({target:r,reuseTargetNode:o,...s}),wd(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:Rb.createPortal(a.jsx(a.Fragment,{children:n}),f.current)});I_.displayName="@mantine/core/Portal";const va=ge(({withinPortal:e=!0,children:t,...n},r)=>nm()==="test"||!e?a.jsx(a.Fragment,{children:t}):a.jsx(I_,{ref:r,...n,children:t}));va.displayName="@mantine/core/OptionalPortal";const ad=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),qh={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:{...ad("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...ad("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...ad("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...ad("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...ad("top"),common:{transformOrigin:"top right"}}},FE={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function BL({transition:e,state:t,duration:n,timingFunction:r}){const o={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in qh?{transitionProperty:qh[e].transitionProperty,...o,...qh[e].common,...qh[e][FE[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[FE[t]]}}function VL({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:c,onExited:d,enterDelay:f,exitDelay:p}){const m=gn(),g=Sb(),y=m.respectReducedMotion?g:!1,[b,S]=v.useState(y?0:e),[j,C]=v.useState(r?"entered":"exited"),R=v.useRef(-1),E=v.useRef(-1),T=v.useRef(-1);function _(){window.clearTimeout(R.current),window.clearTimeout(E.current),cancelAnimationFrame(T.current)}const k=A=>{_();const P=A?o:s,z=A?c:d,B=y?0:A?e:t;S(B),B===0?(typeof P=="function"&&P(),typeof z=="function"&&z(),C(A?"entered":"exited")):T.current=requestAnimationFrame(()=>{hd.flushSync(()=>{C(A?"pre-entering":"pre-exiting")}),T.current=requestAnimationFrame(()=>{typeof P=="function"&&P(),C(A?"entering":"exiting"),R.current=window.setTimeout(()=>{typeof z=="function"&&z(),C(A?"entered":"exited")},B)})})},I=A=>{if(_(),typeof(A?f:p)!="number"){k(A);return}E.current=window.setTimeout(()=>{k(A)},A?f:p)};return gs(()=>{I(r)},[r]),v.useEffect(()=>()=>{_()},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function Zi({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 b=nm(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=VL({mounted:o,exitDuration:r,duration:n,timingFunction:c,onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:y});return S===0||b==="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(BL({transition:t,duration:S,state:j,timingFunction:C}))})}Zi.displayName="@mantine/core/Transition";const[FL,z_]=jr("Popover component was not found in the tree");function dm({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=n4(t),s=Bn(o,r);return Lo(e)?v.cloneElement(e,{[n]:s}):e}function $_(e){return a.jsx(Bb,{tabIndex:-1,"data-autofocus":!0,...e})}dm.displayName="@mantine/core/FocusTrap";$_.displayName="@mantine/core/FocusTrapInitialFocus";dm.InitialFocus=$_;var U_={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const Vb=ge((e,t)=>{const n=ie("PopoverDropdown",null,e),{className:r,style:o,vars:s,children:c,onKeyDownCapture:d,variant:f,classNames:p,styles:m,...g}=n,y=z_(),b=U2({opened:y.opened,shouldReturnFocus:y.returnFocus}),S=y.withRoles?{"aria-labelledby":y.getTargetId(),id:y.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=Bn(t,y.floating);return y.disabled?null:a.jsx(va,{...y.portalProps,withinPortal:y.withinPortal,children:a.jsx(Zi,{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(dm,{active:y.trapFocus&&y.opened,innerRef:j,children:a.jsxs(ce,{...S,...g,variant:f,onKeyDownCapture:FM(()=>{y.onClose?.(),y.onDismiss?.()},{active:y.closeOnEscape,onTrigger:b,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:le(y.width),...y.referenceHidden?{display:"none"}:null},y.resolvedStyles.dropdown,m?.dropdown,o]}),children:[c,a.jsx(Ep,{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})})]})})})})});Vb.classes=U_;Vb.displayName="@mantine/core/PopoverDropdown";const HL={refProp:"ref",popupType:"dialog"},B_=ge((e,t)=>{const{children:n,refProp:r,popupType:o,...s}=ie("PopoverTarget",HL,e);if(!Lo(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=s,d=z_(),f=Bn(d.reference,em(n),t),p=d.withRoles?{"aria-haspopup":o,"aria-expanded":d.opened,"aria-controls":d.getDropdownId(),id:d.getTargetId()}:{};return v.cloneElement(n,{...c,...p,...d.targetProps,className:Ut(d.targetProps.className,c.className,n.props.className),[r]:f,...d.controlled?null:{onClick:()=>{d.onToggle(),n.props.onClick?.()}}})});B_.displayName="@mantine/core/PopoverTarget";function qL(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 GL(e,t,n){const r=qL(e.middlewares),o=[m_(e.offset),nL()];return e.dropdownVisible&&n!=="test"&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.shift&&o.push(Ob(typeof r.shift=="boolean"?{limiter:NE(),padding:5}:{limiter:NE(),padding:5,...r.shift})),r.flip&&o.push(typeof r.flip=="boolean"?Cp():Cp(r.flip)),r.inline&&o.push(typeof r.inline=="boolean"?yd():yd(r.inline)),o.push(g_({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width==="target")&&o.push(tL({...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 QL(e){const t=nm(),[n,r]=rr({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=zb({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:GL(e,()=>d,t),whileElementsMounted:e.keepMounted?void 0:kx});return v.useEffect(()=>{if(!(!d.refs.reference.current||!d.refs.floating.current)&&n)return kx(d.refs.reference.current,d.refs.floating.current,d.update)},[n,d.update]),gs(()=>{e.onPositionChange?.(d.placement),e.positionRef.current=d.placement},[d.placement,e.preventPositionChangeWhenVisible]),gs(()=>{n!==o.current&&(n?e.onOpen?.():e.onClose?.()),o.current=n},[n,e.onClose,e.onOpen]),gs(()=>{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 WL={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"},YL=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ft(t),"--popover-shadow":xb(n)}});function Zr(e){const t=ie("Popover",WL,e),{children:n,position:r,offset:o,onPositionChange:s,positionDependencies:c,opened:d,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:y,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,unstyled:E,classNames:T,styles:_,closeOnClickOutside:k,withinPortal:I,portalProps:A,closeOnEscape:P,clickOutsideEvents:z,trapFocus:B,onClose:Y,onDismiss:J,onOpen:Z,onChange:$,zIndex:Q,radius:M,shadow:L,id:U,defaultOpened:V,__staticSelector:K,withRoles:O,disabled:F,returnFocus:ae,variant:ue,keepMounted:be,vars:we,floatingStrategy:Ce,withOverlay:nt,overlayProps:De,hideDetached:ft,attributes:ot,preventPositionChangeWhenVisible:ht,...st}=t,yt=Le({name:K,props:t,classes:U_,classNames:T,styles:_,unstyled:E,attributes:ot,rootSelector:"dropdown",vars:we,varsResolver:YL}),{resolvedStyles:mt}=Cl({classNames:T,styles:_,props:t}),[It,Te]=v.useState(d??V??!1),Re=v.useRef(r),Ie=v.useRef(null),[Oe,ct]=v.useState(null),[tt,lt]=v.useState(null),{dir:pe}=ws(),qe=nm(),je=mr(U),Ae=QL({middlewares:y,width:g,position:M_(pe,r),offset:typeof o=="number"?o+(b?S/2:0):o,arrowRef:Ie,arrowOffset:j,onPositionChange:s,positionDependencies:c,opened:d,defaultOpened:V,onChange:$,onOpen:Z,onClose:Y,onDismiss:J,strategy:Ce,dropdownVisible:It,setDropdownVisible:Te,positionRef:Re,disabled:F,preventPositionChangeWhenVisible:ht,keepMounted:be});QM(()=>{k&&(Ae.onClose(),J?.())},z,[Oe,tt]);const _t=v.useCallback(yn=>{ct(yn),Ae.floating.refs.setReference(yn)},[Ae.floating.refs.setReference]),Zn=v.useCallback(yn=>{lt(yn),Ae.floating.refs.setFloating(yn)},[Ae.floating.refs.setFloating]),vn=v.useCallback(()=>{f?.onExited?.(),p?.(),Te(!1),ht||(Re.current=r)},[f?.onExited,p,ht,r]),Pn=v.useCallback(()=>{f?.onEntered?.(),m?.()},[f?.onEntered,m]);return a.jsxs(FL,{value:{returnFocus:ae,disabled:F,controlled:Ae.controlled,reference:_t,floating:Zn,x:Ae.floating.x,y:Ae.floating.y,arrowX:Ae.floating?.middlewareData?.arrow?.x,arrowY:Ae.floating?.middlewareData?.arrow?.y,opened:Ae.opened,arrowRef:Ie,transitionProps:{...f,onExited:vn,onEntered:Pn},width:g,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,placement:Ae.floating.placement,trapFocus:B,withinPortal:I,portalProps:A,zIndex:Q,radius:M,shadow:L,closeOnEscape:P,onDismiss:J,onClose:Ae.onClose,onToggle:Ae.onToggle,getTargetId:()=>`${je}-target`,getDropdownId:()=>`${je}-dropdown`,withRoles:O,targetProps:st,__staticSelector:K,classNames:T,styles:_,unstyled:E,variant:ue,keepMounted:be,getStyles:yt,resolvedStyles:mt,floatingStrategy:Ce,referenceHidden:ft&&qe!=="test"?Ae.floating.middlewareData.hide?.referenceHidden:!1},children:[n,nt&&a.jsx(Zi,{transition:"fade",mounted:Ae.opened,duration:f?.duration||250,exitDuration:f?.exitDuration||250,children:yn=>a.jsx(va,{withinPortal:I,children:a.jsx(Bc,{...De,...yt("overlay",{className:De?.className,style:[yn,De?.style]})})})})]})}Zr.Target=B_;Zr.Dropdown=Vb;Zr.displayName="@mantine/core/Popover";Zr.extend=e=>e;var Yi={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 V_=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:Ut(Yi.barsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Yi.bar}),a.jsx("span",{className:Yi.bar}),a.jsx("span",{className:Yi.bar})]}));V_.displayName="@mantine/core/Bars";const F_=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:Ut(Yi.dotsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Yi.dot}),a.jsx("span",{className:Yi.dot}),a.jsx("span",{className:Yi.dot})]}));F_.displayName="@mantine/core/Dots";const H_=v.forwardRef(({className:e,...t},n)=>a.jsx(ce,{component:"span",className:Ut(Yi.ovalLoader,e),...t,ref:n}));H_.displayName="@mantine/core/Oval";const q_={bars:V_,oval:H_,dots:F_},KL={loaders:q_,type:"oval"},XL=(e,{size:t,color:n})=>({root:{"--loader-size":it(t,"loader-size"),"--loader-color":n?Wt(n,e):void 0}}),Ir=ge((e,t)=>{const n=ie("Loader",KL,e),{size:r,color:o,type:s,vars:c,className:d,style:f,classNames:p,styles:m,unstyled:g,loaders:y,variant:b,children:S,attributes:j,...C}=n,R=Le({name:"Loader",props:n,classes:Yi,className:d,style:f,classNames:p,styles:m,unstyled:g,attributes:j,vars:c,varsResolver:XL});return S?a.jsx(ce,{...R("root"),ref:t,...C,children:S}):a.jsx(ce,{...R("root"),ref:t,component:y[s],variant:b,size:r,...C})});Ir.defaultLoaders=q_;Ir.classes=Yi;Ir.displayName="@mantine/core/Loader";var nu={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const HE={orientation:"horizontal"},JL=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Fb=ge((e,t)=>{const n=ie("ActionIconGroup",HE,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,attributes:b,...S}=ie("ActionIconGroup",HE,e),j=Le({name:"ActionIconGroup",props:n,classes:nu,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:b,vars:p,varsResolver:JL,rootSelector:"group"});return a.jsx(ce,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...S})});Fb.classes=nu;Fb.displayName="@mantine/core/ActionIconGroup";const ZL=(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":it(c,"section-height"),"--section-padding-x":it(c,"section-padding-x"),"--section-fz":Qn(c),"--section-radius":t===void 0?void 0:Ft(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},Hb=ge((e,t)=>{const n=ie("ActionIconGroupSection",null,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,attributes:b,...S}=n,j=Le({name:"ActionIconGroupSection",props:n,classes:nu,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:ZL,rootSelector:"groupSection"});return a.jsx(ce,{...j("groupSection"),ref:t,variant:p,...S})});Hb.classes=nu;Hb.displayName="@mantine/core/ActionIconGroupSection";const eI=(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":it(t,"ai-size"),"--ai-radius":n===void 0?void 0:Ft(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}}},Dn=sr((e,t)=>{const n=ie("ActionIcon",null,e),{className:r,unstyled:o,variant:s,classNames:c,styles:d,style:f,loading:p,loaderProps:m,size:g,color:y,radius:b,__staticSelector:S,gradient:j,vars:C,children:R,disabled:E,"data-disabled":T,autoContrast:_,mod:k,attributes:I,...A}=n,P=Le({name:["ActionIcon",S],props:n,className:r,style:f,classes:nu,classNames:c,styles:d,unstyled:o,attributes:I,vars:C,varsResolver:eI});return a.jsxs(An,{...P("root",{active:!E&&!p&&!T}),...A,unstyled:o,variant:s,size:g,disabled:E||p,ref:t,mod:[{loading:p,disabled:E||T},k],children:[typeof p=="boolean"&&a.jsx(Zi,{mounted:p,transition:"slide-down",duration:150,children:z=>a.jsx(ce,{component:"span",...P("loader",{style:z}),"aria-hidden":!0,children:a.jsx(Ir,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),a.jsx(ce,{component:"span",mod:{loading:p},...P("icon"),children:R})]})});Dn.classes=nu;Dn.displayName="@mantine/core/ActionIcon";Dn.Group=Fb;Dn.GroupSection=Hb;const G_=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"})}));G_.displayName="@mantine/core/CloseIcon";var Q_={root:"m_86a44da5","root--subtle":"m_220c80f2"};const tI={variant:"subtle"},nI=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":it(t,"cb-size"),"--cb-radius":n===void 0?void 0:Ft(n),"--cb-icon-size":le(r)}}),js=sr((e,t)=>{const n=ie("CloseButton",tI,e),{iconSize:r,children:o,vars:s,radius:c,className:d,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":y,disabled:b,variant:S,icon:j,mod:C,attributes:R,__staticSelector:E,...T}=n,_=Le({name:E||"CloseButton",props:n,className:d,style:p,classes:Q_,classNames:f,styles:m,unstyled:g,attributes:R,vars:s,varsResolver:nI});return a.jsxs(An,{ref:t,...T,unstyled:g,variant:S,disabled:b,mod:[{disabled:b||y},C],..._("root",{variant:S,active:!b&&!y}),children:[j||a.jsx(G_,{}),o]})});js.classes=Q_;js.displayName="@mantine/core/CloseButton";function rI(e){return v.Children.toArray(e).filter(Boolean)}var W_={root:"m_4081bf90"};const iI={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},oI=(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}}),ye=ge((e,t)=>{const n=ie("Group",iI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,children:f,gap:p,align:m,justify:g,wrap:y,grow:b,preventGrowOverflow:S,vars:j,variant:C,__size:R,mod:E,attributes:T,..._}=n,k=rI(f),I=k.length,A=Gn(p??"md"),z={childWidth:`calc(${100/I}% - (${A} - ${A} / ${I}))`},B=Le({name:"Group",props:n,stylesCtx:z,className:o,style:s,classes:W_,classNames:r,styles:c,unstyled:d,attributes:T,vars:j,varsResolver:oI});return a.jsx(ce,{...B("root"),ref:t,variant:C,mod:[{grow:b},E],size:R,..._,children:k})});ye.classes=W_;ye.displayName="@mantine/core/Group";const[aI,Ca]=jr("ModalBase component was not found in tree");function sI({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),o=v.useRef(-1),c=Sb()?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 lI({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:s,returnFocus:c}){const d=mr(e),[f,p]=v.useState(!1),[m,g]=v.useState(!1),y=typeof t?.duration=="number"?t?.duration:200,b=sI({opened:n,transitionDuration:y});return H2("keydown",S=>{S.key==="Escape"&&o&&!S.isComposing&&n&&S.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&s()},{capture:!0}),U2({opened:n,shouldReturnFocus:r&&c}),{_id:d,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const Y_=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:b,children:S,zIndex:j,shadow:C,padding:R,__vars:E,unstyled:T,removeScrollProps:_,...k},I)=>{const{_id:A,titleMounted:P,bodyMounted:z,shouldLockScroll:B,setTitleMounted:Y,setBodyMounted:J}=lI({id:r,transitionProps:o,opened:t,trapFocus:d,closeOnEscape:f,onClose:n,returnFocus:p}),{key:Z,...$}=_||{};return a.jsx(va,{...y,withinPortal:g,children:a.jsx(aI,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:s,onEnterTransitionEnd:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${A}-title`,getBodyId:()=>`${A}-body`,titleMounted:P,bodyMounted:z,setTitleMounted:Y,setBodyMounted:J,trapFocus:d,closeOnEscape:f,zIndex:j,unstyled:T},children:a.jsx(dl,{enabled:B&&b,...$,children:a.jsx(ce,{ref:I,...k,__vars:{...E,"--mb-z-index":(j||zr("modal")).toString(),"--mb-shadow":xb(C),"--mb-padding":Gn(R)},children:S})},Z)})})});Y_.displayName="@mantine/core/ModalBase";function cI(){const e=Ca();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Vc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const K_=v.forwardRef(({className:e,...t},n)=>{const r=cI(),o=Ca();return a.jsx(ce,{ref:n,...t,id:r,className:Ut({[Vc.body]:!o.unstyled},e)})});K_.displayName="@mantine/core/ModalBaseBody";const X_=v.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Ca();return a.jsx(js,{ref:r,...n,onClick:s=>{o.onClose(),t?.(s)},className:Ut({[Vc.close]:!o.unstyled},e),unstyled:o.unstyled})});X_.displayName="@mantine/core/ModalBaseCloseButton";const J_=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...s},c)=>{const d=Ca();return a.jsx(Zi,{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({[Vc.inner]:!d.unstyled},n.className),children:a.jsx(dm,{active:d.opened&&d.trapFocus,innerRef:c,children:a.jsx(Or,{...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({[Vc.content]:!d.unstyled},t),unstyled:d.unstyled,children:s.children})})})})});J_.displayName="@mantine/core/ModalBaseContent";const Z_=v.forwardRef(({className:e,...t},n)=>{const r=Ca();return a.jsx(ce,{component:"header",ref:n,className:Ut({[Vc.header]:!r.unstyled},e),...t})});Z_.displayName="@mantine/core/ModalBaseHeader";const uI={duration:200,timingFunction:"ease",transition:"fade"};function dI(e){const t=Ca();return{...uI,...t.transitionProps,...e}}const eA=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...o},s)=>{const c=Ca(),d=dI(t);return a.jsx(Zi,{mounted:r!==void 0?r:c.opened,...d,transition:"fade",children:f=>a.jsx(Bc,{ref:s,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e?.(p),c.closeOnClickOutside&&c.onClose()},...o})})});eA.displayName="@mantine/core/ModalBaseOverlay";function fI(){const e=Ca();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const tA=v.forwardRef(({className:e,...t},n)=>{const r=fI(),o=Ca();return a.jsx(ce,{component:"h2",ref:n,className:Ut({[Vc.title]:!o.unstyled},e),...t,id:r})});tA.displayName="@mantine/core/ModalBaseTitle";function hI({children:e}){return a.jsx(a.Fragment,{children:e})}const[pI,mI]=Io({size:"sm"}),nA=ge((e,t)=>{const n=ie("InputClearButton",null,e),{size:r,variant:o,vars:s,classNames:c,styles:d,...f}=n,p=mI(),{resolvedClassNames:m,resolvedStyles:g}=Cl({classNames:c,styles:d,props:n});return a.jsx(js,{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})});nA.displayName="@mantine/core/InputClearButton";const gI={xs:7,sm:8,md:10,lg:12,xl:15};function vI({__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:gI[o]},children:[s,n||r]}):n===null?null:n||s||r}const[yI,ru]=Io({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Li={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 xI=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Qn(t)} - ${le(2)})`}}),fm=ge((e,t)=>{const n=ie("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:b,...S}=ie("InputDescription",null,n),j=ru(),C=Le({name:["InputWrapper",m],props:n,classes:Li,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:y,rootSelector:"description",vars:f,varsResolver:xI}),R=g&&j?.getStyles||C;return a.jsx(ce,{component:"p",ref:t,variant:b,size:p,...R("description",j?.getStyles?{className:o,style:s}:void 0),...S})});fm.classes=Li;fm.displayName="@mantine/core/InputDescription";const bI=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Qn(t)} - ${le(2)})`}}),hm=ge((e,t)=>{const n=ie("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:b,...S}=n,j=Le({name:["InputWrapper",g],props:n,classes:Li,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:m,rootSelector:"error",vars:f,varsResolver:bI}),C=ru(),R=y&&C?.getStyles||j;return a.jsx(ce,{component:"p",ref:t,variant:b,size:p,...R("error",C?.getStyles?{className:o,style:s}:void 0),...S})});hm.classes=Li;hm.displayName="@mantine/core/InputError";const qE={labelElement:"label"},SI=(e,{size:t})=>({label:{"--input-label-size":Qn(t),"--input-asterisk-color":void 0}}),Gd=ge((e,t)=>{const n=ie("InputLabel",qE,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,labelElement:p,size:m,required:g,htmlFor:y,onMouseDown:b,children:S,__staticSelector:j,variant:C,mod:R,attributes:E,...T}=ie("InputLabel",qE,n),_=Le({name:["InputWrapper",j],props:n,classes:Li,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:E,rootSelector:"label",vars:f,varsResolver:SI}),k=ru(),I=k?.getStyles||_;return a.jsxs(ce,{...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},R],onMouseDown:A=>{b?.(A),!A.defaultPrevented&&A.detail>1&&A.preventDefault()},...T,children:[S,g&&a.jsx("span",{...I("required"),"aria-hidden":!0,children:" *"})]})});Gd.classes=Li;Gd.displayName="@mantine/core/InputLabel";const qb=ge((e,t)=>{const n=ie("InputPlaceholder",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,__staticSelector:p,variant:m,error:g,mod:y,attributes:b,...S}=n,j=Le({name:["InputPlaceholder",p],props:n,classes:Li,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,rootSelector:"placeholder"});return a.jsx(ce,{...j("placeholder"),mod:[{error:!!g},y],component:"span",variant:m,ref:t,...S})});qb.classes=Li;qb.displayName="@mantine/core/InputPlaceholder";function wI(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 jI={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},CI=(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)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Qn(t)} - ${le(2)})`}}),Qd=ge((e,t)=>{const n=ie("InputWrapper",jI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:y,inputWrapperOrder:b,label:S,error:j,description:C,labelProps:R,descriptionProps:E,errorProps:T,labelElement:_,children:k,withAsterisk:I,id:A,required:P,__stylesApiProps:z,mod:B,attributes:Y,...J}=n,Z=Le({name:["InputWrapper",g],props:z||n,classes:Li,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:Y,vars:f,varsResolver:CI}),$={size:p,variant:m,__staticSelector:g},Q=mr(A),M=typeof I=="boolean"?I:P,L=T?.id||`${Q}-error`,U=E?.id||`${Q}-description`,V=Q,K=!!j&&typeof j!="boolean",O=!!C,F=`${K?L:""} ${O?U:""}`,ae=F.trim().length>0?F.trim():void 0,ue=R?.id||`${Q}-label`,be=S&&a.jsx(Gd,{labelElement:_,id:ue,htmlFor:V,required:M,...$,...R,children:S},"label"),we=O&&a.jsx(fm,{...E,...$,size:E?.size||$.size,id:E?.id||U,children:C},"description"),Ce=a.jsx(v.Fragment,{children:y(k)},"input"),nt=K&&v.createElement(hm,{...T,...$,size:T?.size||$.size,key:"error",id:T?.id||L},j),De=b.map(ft=>{switch(ft){case"label":return be;case"input":return Ce;case"description":return we;case"error":return nt;default:return null}});return a.jsx(yI,{value:{getStyles:Z,describedBy:ae,inputId:V,labelId:ue,...wI(b,{hasDescription:O,hasError:K})},children:a.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},B],...Z("root"),...J,children:De})})});Qd.classes=Li;Qd.displayName="@mantine/core/InputWrapper";const EI={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},TI=(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":it(t.size,"input-height"),"--input-fz":Qn(t.size),"--input-radius":t.radius===void 0?void 0:Ft(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?le(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?le(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?it(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),hn=sr((e,t)=>{const n=ie("Input",EI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:y,error:b,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:R,rightSection:E,rightSectionProps:T,rightSectionWidth:_,rightSectionPointerEvents:k,leftSectionPointerEvents:I,variant:A,vars:P,pointer:z,multiline:B,radius:Y,id:J,withAria:Z,withErrorStyles:$,mod:Q,inputSize:M,attributes:L,__clearSection:U,__clearable:V,__defaultRightSection:K,...O}=n,{styleProps:F,rest:ae}=ja(O),ue=ru(),be={offsetBottom:ue?.offsetBottom,offsetTop:ue?.offsetTop},we=Le({name:["Input",p],props:m||n,classes:Li,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:L,stylesCtx:be,rootSelector:"wrapper",vars:P,varsResolver:TI}),Ce=Z?{required:f,disabled:S,"aria-invalid":!!b,"aria-describedby":ue?.describedBy,id:ue?.inputId||J}:{},nt=vI({__clearable:V,__clearSection:U,rightSection:E,__defaultRightSection:K,size:g});return a.jsx(pI,{value:{size:g||"sm"},children:a.jsxs(ce,{...we("wrapper"),...F,...y,mod:[{error:!!b&&$,pointer:z,disabled:S,multiline:B,"data-with-right-section":!!nt,"data-with-left-section":!!j},Q],variant:A,size:g,children:[j&&a.jsx("div",{...C,"data-position":"left",...we("section",{className:C?.className,style:C?.style}),children:j}),a.jsx(ce,{component:"input",...ae,...Ce,ref:t,required:f,mod:{disabled:S,error:!!b&&$},variant:A,__size:M,...we("input")}),nt&&a.jsx("div",{...T,"data-position":"right",...we("section",{className:T?.className,style:T?.style}),children:nt})]})})});hn.classes=Li;hn.Wrapper=Qd;hn.Label=Gd;hn.Error=hm;hn.Description=fm;hn.Placeholder=qb;hn.ClearButton=nA;hn.displayName="@mantine/core/Input";function RI(e,t,n){const r=ie(e,t,n),{label:o,description:s,error:c,required:d,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:y,__stylesApiProps:b,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:R,id:E,size:T,style:_,inputContainer:k,inputWrapperOrder:I,withAsterisk:A,variant:P,vars:z,mod:B,attributes:Y,...J}=r,{styleProps:Z,rest:$}=ja(J),Q={label:o,description:s,error:c,required:d,classNames:f,className:m,__staticSelector:y,__stylesApiProps:b||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:T,style:_,inputContainer:k,inputWrapperOrder:I,withAsterisk:A,variant:P,id:E,mod:B,attributes:Y,...R};return{...$,classNames:f,styles:p,unstyled:g,wrapperProps:{...Q,...Z},inputProps:{required:d,classNames:f,styles:p,unstyled:g,size:T,__staticSelector:y,__stylesApiProps:b||r,error:c,variant:P,id:E,attributes:Y}}}const _I={__staticSelector:"InputBase",withAria:!0,size:"sm"},$r=sr((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=RI("InputBase",_I,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 AI={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 rA={root:"m_8bffd616"};const eo=sr((e,t)=>{const n=ie("Flex",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,gap:p,rowGap:m,columnGap:g,align:y,justify:b,wrap:S,direction:j,attributes:C,...R}=n,E=Le({name:"Flex",classes:rA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f}),T=gn(),_=Hd(),k=X2({styleProps:{gap:p,rowGap:m,columnGap:g,align:y,justify:b,wrap:S,direction:j},theme:T,data:AI});return a.jsxs(a.Fragment,{children:[k.hasResponsiveStyles&&a.jsx(Tl,{selector:`.${_}`,styles:k.styles,media:k.media}),a.jsx(ce,{ref:t,...E("root",{className:_,style:Ss(k.inlineStyles)}),...R})]})});eo.classes=rA;eo.displayName="@mantine/core/Flex";function DI(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 kI({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 b=e.getBoundingClientRect(),S=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),R=hs(j.borderTopWidth)+hs(C.borderTopWidth),E=hs(j.borderLeftWidth)+hs(C.borderLeftWidth),T={top:b.top-S.top-R,left:b.left-S.left-E,width:b.width,height:b.height};n.current.style.transform=`translateY(${T.top}px) translateX(${T.left}px)`,n.current.style.width=`${T.width}px`,n.current.style.height=`${T.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 b=S=>{DI(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),y4(()=>{q2()!=="test"&&c(!0)},20,{autoInvoke:!0}),x4(b=>{b.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:d}}var iA={root:"m_96b553a6"};const PI=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Gb=ge((e,t)=>{const n=ie("FloatingIndicator",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,target:p,parent:m,transitionDuration:g,mod:y,displayAfterTransitionEnd:b,attributes:S,...j}=n,C=Le({name:"FloatingIndicator",classes:iA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:PI}),R=v.useRef(null),{initialized:E,hidden:T}=kI({target:p,parent:m,ref:R,displayAfterTransitionEnd:b}),_=Bn(t,R);return!p||!m?null:a.jsx(ce,{ref:_,mod:[{initialized:E,hidden:T},y],...C("root"),...j})});Gb.displayName="@mantine/core/FloatingIndicator";Gb.classes=iA;function oA({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 aA({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:le(t),height:le(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"})})}aA.displayName="@mantine/core/AccordionChevron";var sA={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 NI=(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:Ft(t),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},$o=ge((e,t)=>{const n=ie("Alert",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,title:g,children:y,id:b,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:R,variant:E,autoContrast:T,role:_,attributes:k,...I}=n,A=Le({name:"Alert",classes:sA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:k,vars:f,varsResolver:NI}),P=mr(b),z=g&&`${P}-title`||void 0,B=`${P}-body`;return a.jsx(ce,{id:P,...A("root",{variant:E}),variant:E,ref:t,role:_||"alert",...I,"aria-describedby":y?B:void 0,"aria-labelledby":g?z:void 0,children:a.jsxs("div",{...A("wrapper"),children:[S&&a.jsx("div",{...A("icon"),children:S}),a.jsxs("div",{...A("body"),children:[g&&a.jsx("div",{...A("title"),"data-with-close-button":j||void 0,children:a.jsx("span",{id:z,...A("label"),children:g})}),y&&a.jsx("div",{id:B,...A("message"),"data-variant":E,children:y})]}),j&&a.jsx(js,{...A("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":R,unstyled:d})]})})});$o.classes=sA;$o.displayName="@mantine/core/Alert";var lA={root:"m_b6d8b162"};function OI(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const MI={inherit:!1},LI=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:s})=>({root:{"--text-fz":Qn(o),"--text-lh":I2(o),"--text-gradient":t==="gradient"?jx(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Wt(s,e):void 0}}),Ee=sr((e,t)=>{const n=ie("Text",MI,e),{lineClamp:r,truncate:o,inline:s,inherit:c,gradient:d,span:f,__staticSelector:p,vars:m,className:g,style:y,classNames:b,styles:S,unstyled:j,variant:C,mod:R,size:E,attributes:T,..._}=n,k=Le({name:["Text",p],props:n,classes:lA,className:g,style:y,classNames:b,styles:S,unstyled:j,attributes:T,vars:m,varsResolver:LI});return a.jsx(ce,{...k("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":OI(o),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":c},R],size:E,..._})});Ee.classes=lA;Ee.displayName="@mantine/core/Text";var cA={root:"m_849cf0da"};const II={underline:"hover"},Mt=sr((e,t)=>{const{underline:n,className:r,unstyled:o,mod:s,...c}=ie("Anchor",II,e);return a.jsx(Ee,{component:"a",ref:t,className:Ut({[cA.root]:!o},r),...c,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:o})});Mt.classes=cA;Mt.displayName="@mantine/core/Anchor";const[zI,iu]=jr("AppShell was not found in tree");var Cs={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const Qb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=ie("AppShellAside",null,e),y=iu();return y.disabled?null:a.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("aside",{className:Ut({[dl.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-aside-z-index":`calc(${p??y.zIndex} + 1)`}})});Qb.classes=Cs;Qb.displayName="@mantine/core/AppShellAside";const Wb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=ie("AppShellFooter",null,e),y=iu();return y.disabled?null:a.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("footer",{className:Ut({[dl.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-footer-z-index":(p??y.zIndex)?.toString()}})});Wb.classes=Cs;Wb.displayName="@mantine/core/AppShellFooter";const Yb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=ie("AppShellHeader",null,e),y=iu();return y.disabled?null:a.jsx(ce,{component:"header",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("header",{className:Ut({[dl.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:s,style:o}),...g,__vars:{"--app-shell-header-z-index":(p??y.zIndex)?.toString()}})});Yb.classes=Cs;Yb.displayName="@mantine/core/AppShellHeader";const Kb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=ie("AppShellMain",null,e),f=iu();return a.jsx(ce,{component:"main",ref:t,...f.getStyles("main",{className:r,style:o,classNames:n,styles:s}),...d})});Kb.classes=Cs;Kb.displayName="@mantine/core/AppShellMain";function Wd(e){return typeof e=="object"?e.base:e}function Yd(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 Kd(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function $I({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"),Yd(s)){const f=le(Wd(s));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Kd(s)&&(typeof s.base<"u"&&(e["--app-shell-aside-width"]=le(s.base),e["--app-shell-aside-offset"]=le(s.base)),dn(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=le(s[f]),t[f]["--app-shell-aside-offset"]=le(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=bb(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 UI({baseStyles:e,minMediaStyles:t,footer:n}){const r=n?.height,o="translateY(var(--app-shell-footer-height))",s=n?.offset??!0;if(Yd(r)){const c=le(Wd(r));e["--app-shell-footer-height"]=c,s&&(e["--app-shell-footer-offset"]=c)}Kd(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),s&&(e["--app-shell-footer-offset"]=le(r.base))),dn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),s&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function BI({baseStyles:e,minMediaStyles:t,header:n}){const r=n?.height,o="translateY(calc(var(--app-shell-header-height) * -1))",s=n?.offset??!0;if(Yd(r)){const c=le(Wd(r));e["--app-shell-header-height"]=c,s&&(e["--app-shell-header-offset"]=c)}Kd(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),s&&(e["--app-shell-header-offset"]=le(r.base))),dn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),s&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function VI({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"),Yd(s)){const f=le(Wd(s));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Kd(s)&&(typeof s.base<"u"&&(e["--app-shell-navbar-width"]=le(s.base),e["--app-shell-navbar-offset"]=le(s.base)),dn(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=le(s[f]),t[f]["--app-shell-navbar-offset"]=le(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=bb(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 By(e){return Number(e)===0?"0px":Gn(e)}function FI({padding:e,baseStyles:t,minMediaStyles:n}){Yd(e)&&(t["--app-shell-padding"]=By(Wd(e))),Kd(e)&&(e.base&&(t["--app-shell-padding"]=By(e.base)),dn(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=By(e[r]))}))}function HI({navbar:e,header:t,footer:n,aside:r,padding:o,theme:s}){const c={},d={},f={};VI({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,navbar:e,theme:s}),$I({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,aside:r,theme:s}),BI({baseStyles:f,minMediaStyles:c,header:t}),UI({baseStyles:f,minMediaStyles:c,footer:n}),FI({baseStyles:f,minMediaStyles:c,padding:o});const p=Sd(dn(c),s.breakpoints).map(y=>({query:`(min-width: ${vp(y.px)})`,styles:c[y.value]})),m=Sd(dn(d),s.breakpoints).map(y=>({query:`(max-width: ${vp(y.px)})`,styles:d[y.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function qI({navbar:e,header:t,aside:n,footer:r,padding:o}){const s=gn(),c=Sa(),{media:d,baseStyles:f}=HI({navbar:e,header:t,footer:r,aside:n,padding:o,theme:s});return a.jsx(Tl,{media:d,styles:f,selector:c.cssVariablesSelector})}const Xb=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=ie("AppShellNavbar",null,e),y=iu();return y.disabled?null:a.jsx(ce,{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)`}})});Xb.classes=Cs;Xb.displayName="@mantine/core/AppShellNavbar";const Jb=sr((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,grow:d,mod:f,...p}=ie("AppShellSection",null,e),m=iu();return a.jsx(ce,{ref:t,mod:[{grow:d},f],...m.getStyles("section",{className:r,style:o,classNames:n,styles:s}),...p})});Jb.classes=Cs;Jb.displayName="@mantine/core/AppShellSection";function GI({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),o=v.useRef(-1),s=v.useRef(-1);return H2("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),Jc(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const QI={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:zr("app")},WI=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),br=ge((e,t)=>{const n=ie("AppShell",QI,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:y,transitionTimingFunction:b,header:S,zIndex:j,layout:C,disabled:R,aside:E,footer:T,offsetScrollbars:_=!0,mod:k,attributes:I,...A}=n,P=Le({name:"AppShell",classes:Cs,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:I,vars:f,varsResolver:WI}),z=GI({disabled:R,transitionDuration:y});return a.jsxs(zI,{value:{getStyles:P,withBorder:m,zIndex:j,disabled:R,offsetScrollbars:_},children:[a.jsx(qI,{navbar:p,header:S,aside:E,footer:T,padding:g}),a.jsx(ce,{ref:t,...P("root"),mod:[{resizing:z,layout:C,disabled:R},k],...A})]})});br.classes=Cs;br.displayName="@mantine/core/AppShell";br.Navbar=Xb;br.Header=Yb;br.Main=Kb;br.Aside=Qb;br.Footer=Wb;br.Section=Jb;function uA(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=>uA(t))}:e}function dA(e){return e?e.map(t=>uA(t)):[]}function fA(e){return e.reduce((t,n)=>"group"in n?{...t,...fA(n.items)}:(t[n.value]=n,t),{})}var Mr={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 YI={error:null},KI=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":it(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Wt(n,e):void 0}}),pm=ge((e,t)=>{const n=ie("ComboboxChevron",YI,e),{size:r,error:o,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,mod:g,...y}=n,b=Le({name:"ComboboxChevron",classes:Mr,props:n,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,varsResolver:KI,rootSelector:"chevron"});return a.jsx(ce,{component:"svg",...y,...b("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"})})});pm.classes=Mr;pm.displayName="@mantine/core/ComboboxChevron";const[XI,Ii]=jr("Combobox component was not found in tree"),hA=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)}}));hA.displayName="@mantine/core/ComboboxClearButton";const Zb=ge((e,t)=>{const{classNames:n,styles:r,className:o,style:s,hidden:c,...d}=ie("ComboboxDropdown",null,e),f=Ii();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})})});Zb.classes=Mr;Zb.displayName="@mantine/core/ComboboxDropdown";const JI={refProp:"ref"},pA=ge((e,t)=>{const{children:n,refProp:r}=ie("ComboboxDropdownTarget",JI,e);if(Ii(),!Lo(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})});pA.displayName="@mantine/core/ComboboxDropdownTarget";const e0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=ie("ComboboxEmpty",null,e),f=Ii();return a.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:s,style:o}),...d})});e0.classes=Mr;e0.displayName="@mantine/core/ComboboxEmpty";function t0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:s}){const c=Ii(),[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 ZI={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},mA=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=ie("ComboboxEventsTarget",ZI,e);if(!Lo(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=Ii(),g=t0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return v.cloneElement(n,{...g,...p,[r]:Bn(t,m.store.targetRef,em(n))})});mA.displayName="@mantine/core/ComboboxEventsTarget";const n0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=ie("ComboboxFooter",null,e),f=Ii();return a.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:o,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});n0.classes=Mr;n0.displayName="@mantine/core/ComboboxFooter";const r0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,children:d,label:f,id:p,...m}=ie("ComboboxGroup",null,e),g=Ii(),y=mr(p);return a.jsxs(ce,{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]})});r0.classes=Mr;r0.displayName="@mantine/core/ComboboxGroup";const i0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=ie("ComboboxHeader",null,e),f=Ii();return a.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:o,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});i0.classes=Mr;i0.displayName="@mantine/core/ComboboxHeader";function gA({value:e,valuesDivider:t=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}gA.displayName="@mantine/core/ComboboxHiddenInput";const o0=ge((e,t)=>{const n=ie("ComboboxOption",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:y,disabled:b,selected:S,mod:j,...C}=n,R=Ii(),E=v.useId(),T=p||E;return a.jsx(ce,{...R.getStyles("option",{className:o,classNames:r,styles:c,style:s}),...C,ref:t,id:T,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":S},j],role:"option",onClick:_=>{b?_.preventDefault():(R.onOptionSubmit?.(n.value,n),f?.(_))},onMouseDown:_=>{_.preventDefault(),g?.(_)},onMouseOver:_=>{R.resetSelectionOnOptionHover&&R.store.resetSelectedOption(),y?.(_)}})});o0.classes=Mr;o0.displayName="@mantine/core/ComboboxOption";const a0=ge((e,t)=>{const n=ie("ComboboxOptions",null,e),{classNames:r,className:o,style:s,styles:c,id:d,onMouseDown:f,labelledBy:p,...m}=n,g=Ii(),y=mr(d);return v.useEffect(()=>{g.store.setListId(y)},[y]),a.jsx(ce,{ref:t,...g.getStyles("options",{className:o,style:s,classNames:r,styles:c}),...m,id:y,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f?.(b)}})});a0.classes=Mr;a0.displayName="@mantine/core/ComboboxOptions";const e7={withAriaAttributes:!0,withKeyboardNavigation:!0},s0=ge((e,t)=>{const n=ie("ComboboxSearch",e7,e),{classNames:r,styles:o,unstyled:s,vars:c,withAriaAttributes:d,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,y=Ii(),b=y.getStyles("search"),S=t0({targetType:"input",withAriaAttributes:d,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return a.jsx(hn,{ref:Bn(t,y.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},o],size:m||y.size,...S,...g,__staticSelector:"Combobox"})});s0.classes=Mr;s0.displayName="@mantine/core/ComboboxSearch";const t7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},vA=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=ie("ComboboxTarget",t7,e);if(!Lo(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=Ii(),g=t0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),y=v.cloneElement(n,{...g,...p});return a.jsx(Zr.Target,{ref:Bn(t,m.store.targetRef),children:y})});vA.displayName="@mantine/core/ComboboxTarget";function n7(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 r7(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 i7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Rl({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:s=!0,scrollBehavior:c="instant"}={}){const[d,f]=rr({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=v.useRef(null),m=v.useRef(-1),g=v.useRef(null),y=v.useRef(null),b=v.useRef(-1),S=v.useRef(-1),j=v.useRef(-1),C=v.useCallback((M="unknown")=>{d||(f(!0),o?.(M))},[f,o,d]),R=v.useCallback((M="unknown")=>{d&&(f(!1),r?.(M))},[f,r,d]),E=v.useCallback((M="unknown")=>{d?R(M):C(M)},[R,C,d]),T=v.useCallback(()=>{const M=os(y.current),L=ap(`#${p.current} [data-combobox-selected]`,M);L?.removeAttribute("data-combobox-selected"),L?.removeAttribute("aria-selected")},[]),_=v.useCallback(M=>{const L=os(y.current),U=ap(`#${p.current}`,L),V=U?ss("[data-combobox-option]",U):null;if(!V)return null;const K=M>=V.length?0:M<0?V.length-1:M;return m.current=K,V?.[K]&&!V[K].hasAttribute("data-combobox-disabled")?(T(),V[K].setAttribute("data-combobox-selected","true"),V[K].setAttribute("aria-selected","true"),V[K].scrollIntoView({block:"nearest",behavior:c}),V[K].id):null},[c,T]),k=v.useCallback(()=>{const M=os(y.current),L=ap(`#${p.current} [data-combobox-active]`,M);if(L){const V=ss(`#${p.current} [data-combobox-option]`,M).findIndex(K=>K===L);return _(V)}return _(0)},[_]),I=v.useCallback(()=>{const M=os(y.current),L=ss(`#${p.current} [data-combobox-option]`,M);return _(r7(m.current,L,s))},[_,s]),A=v.useCallback(()=>{const M=os(y.current),L=ss(`#${p.current} [data-combobox-option]`,M);return _(n7(m.current,L,s))},[_,s]),P=v.useCallback(()=>{const M=os(y.current),L=ss(`#${p.current} [data-combobox-option]`,M);return _(i7(L))},[_]),z=v.useCallback((M="selected",L)=>{j.current=window.setTimeout(()=>{const U=os(y.current),V=ss(`#${p.current} [data-combobox-option]`,U),K=V.findIndex(O=>O.hasAttribute(`data-combobox-${M}`));m.current=K,L?.scrollIntoView&&V[K]?.scrollIntoView({block:"nearest",behavior:c})},0)},[]),B=v.useCallback(()=>{m.current=-1,T()},[T]),Y=v.useCallback(()=>{const M=os(y.current);ss(`#${p.current} [data-combobox-option]`,M)?.[m.current]?.click()},[]),J=v.useCallback(M=>{p.current=M},[]),Z=v.useCallback(()=>{b.current=window.setTimeout(()=>g.current?.focus(),0)},[]),$=v.useCallback(()=>{S.current=window.setTimeout(()=>y.current?.focus(),0)},[]),Q=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(S.current),window.clearTimeout(j.current)},[]),{dropdownOpened:d,openDropdown:C,closeDropdown:R,toggleDropdown:E,selectedOptionIndex:m.current,getSelectedOptionIndex:Q,selectOption:_,selectFirstOption:P,selectActiveOption:k,selectNextOption:I,selectPreviousOption:A,resetSelectedOption:B,updateSelectedOptionIndex:z,listId:p.current,setListId:J,clickSelectedOption:Y,searchRef:g,focusSearchInput:Z,targetRef:y,focusTarget:$}}const o7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},a7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Qn(t),"--combobox-option-padding":it(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":Qn(t),"--combobox-option-padding":it(t,"combobox-option-padding")}});function Xe(e){const t=ie("Combobox",o7,e),{classNames:n,styles:r,unstyled:o,children:s,store:c,vars:d,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:y,__staticSelector:b,readOnly:S,attributes:j,...C}=t,R=Rl(),E=c||R,T=Le({name:b||"Combobox",classes:Mr,props:t,classNames:n,styles:r,unstyled:o,attributes:j,vars:d,varsResolver:a7}),_=()=>{p?.(),E.closeDropdown()};return a.jsx(XI,{value:{getStyles:T,store:E,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:y,readOnly:S},children:a.jsx(Zr,{opened:E.dropdownOpened,preventPositionChangeWhenVisible:!0,...C,onChange:k=>!k&&_(),withRoles:!1,unstyled:o,children:s})})}const s7=e=>e;Xe.extend=s7;Xe.classes=Mr;Xe.displayName="@mantine/core/Combobox";Xe.Target=vA;Xe.Dropdown=Zb;Xe.Options=a0;Xe.Option=o0;Xe.Search=s0;Xe.Empty=e0;Xe.Chevron=pm;Xe.Footer=n0;Xe.Header=i0;Xe.EventsTarget=mA;Xe.DropdownTarget=pA;Xe.Group=r0;Xe.ClearButton=hA;Xe.HiddenInput=gA;var yA={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const xA=yA,mm=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:b="left",bodyElement:S="div",labelElement:j="label",variant:C,style:R,vars:E,mod:T,attributes:_,...k},I)=>{const A=Le({name:e,props:t,className:n,style:R,classes:yA,classNames:r,styles:o,unstyled:s,attributes:_});return a.jsx(ce,{...A("root"),ref:I,__vars:{"--label-fz":Qn(y),"--label-lh":it(y,"label-lh")},mod:[{"label-position":b},T],variant:C,size:y,...k,children:a.jsxs(ce,{component:S,htmlFor:S==="label"?p:void 0,...A("body"),children:[c,a.jsxs("div",{...A("labelWrapper"),"data-disabled":m||void 0,children:[d&&a.jsx(ce,{component:j,htmlFor:j==="label"?p:void 0,...A("label"),"data-disabled":m||void 0,children:d}),f&&a.jsx(hn.Description,{size:y,__inheritStyles:!1,...A("description"),children:f}),g&&typeof g!="boolean"&&a.jsx(hn.Error,{size:y,__inheritStyles:!1,...A("error"),children:g})]})]})})});mm.displayName="@mantine/core/InlineInput";const bA=v.createContext(null),l7=bA.Provider,SA=()=>v.useContext(bA),[c7,u7]=Io();var wA={card:"m_26775b0a"};const d7={withBorder:!0},f7=(e,{radius:t})=>({card:{"--card-radius":Ft(t)}}),l0=ge((e,t)=>{const n=ie("CheckboxCard",d7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:b,defaultChecked:S,onChange:j,attributes:C,...R}=n,E=Le({name:"CheckboxCard",classes:wA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:f7,rootSelector:"card"}),T=SA(),_=typeof p=="boolean"?p:T?T.value.includes(y||""):void 0,[k,I]=rr({value:_,defaultValue:S,finalValue:!1,onChange:j});return a.jsx(c7,{value:{checked:k},children:a.jsx(An,{ref:t,mod:[{"with-border":g,checked:k},m],...E("card"),...R,role:"checkbox","aria-checked":k,onClick:A=>{b?.(A),T?.onChange(y||""),I(!k)}})})});l0.displayName="@mantine/core/CheckboxCard";l0.classes=wA;function c0({children:e,role:t}){const n=ru();return n?a.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):a.jsx(a.Fragment,{children:e})}const u0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,readOnly:f,disabled:p,...m}=ie("CheckboxGroup",null,e),[g,y]=rr({value:n,defaultValue:r,finalValue:[],onChange:o}),b=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(l7,{value:{value:g,onChange:b,size:s,disabled:p},children:a.jsx(hn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"CheckboxGroup",children:a.jsx(c0,{role:"group",children:d})})})});u0.classes=hn.Wrapper.classes;u0.displayName="@mantine/core/CheckboxGroup";function Xd({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(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 jA({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(Xd,{...t})}var CA={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const h7={icon:jA,variant:"filled"},p7=(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":it(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ft(t),"--checkbox-color":s==="outline"?f:Wt(n,e),"--checkbox-icon-color":o?Wt(o,e):El(c,e)?wa({color:n,theme:e,autoContrast:c}):void 0}}},d0=ge((e,t)=>{const n=ie("CheckboxIndicator",h7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,icon:p,indeterminate:m,radius:g,color:y,iconColor:b,autoContrast:S,checked:j,mod:C,variant:R,disabled:E,attributes:T,..._}=n,k=Le({name:"CheckboxIndicator",classes:CA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:T,vars:f,varsResolver:p7,rootSelector:"indicator"}),I=u7(),A=typeof j=="boolean"||typeof m=="boolean"?j||m:I?.checked||!1;return a.jsx(ce,{ref:t,...k("indicator",{variant:R}),variant:R,mod:[{checked:A,disabled:E},C],..._,children:a.jsx(p,{indeterminate:m,...k("icon")})})});d0.displayName="@mantine/core/CheckboxIndicator";d0.classes=CA;var EA={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const m7={labelPosition:"right",icon:jA,variant:"filled"},g7=(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":it(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ft(t),"--checkbox-color":s==="outline"?f:Wt(n,e),"--checkbox-icon-color":o?Wt(o,e):El(c,e)?wa({color:n,theme:e,autoContrast:c}):void 0}}},$n=ge((e,t)=>{const n=ie("Checkbox",m7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,id:g,size:y,radius:b,wrapperProps:S,checked:j,labelPosition:C,description:R,error:E,disabled:T,variant:_,indeterminate:k,icon:I,rootRef:A,iconColor:P,onChange:z,autoContrast:B,mod:Y,attributes:J,...Z}=n,$=SA(),Q=y||$?.size,M=Le({name:"Checkbox",props:n,classes:EA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:J,vars:f,varsResolver:g7}),{styleProps:L,rest:U}=ja(Z),V=mr(g),K={checked:$?.value.includes(U.value)??j,onChange:ae=>{$?.onChange(ae),z?.(ae)},disabled:$?.disabled??T},O=v.useRef(null),F=t||O;return v.useEffect(()=>{F&&"current"in F&&F.current&&(F.current.indeterminate=k||!1,k?F.current.setAttribute("data-indeterminate","true"):F.current.removeAttribute("data-indeterminate"))},[k,F]),a.jsx(mm,{...M("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:V,size:Q,labelPosition:C,label:m,description:R,error:E,disabled:K.disabled,classNames:r,styles:c,unstyled:d,"data-checked":K.checked||j||void 0,variant:_,ref:A,mod:Y,...L,...S,children:a.jsxs(ce,{...M("inner"),mod:{"data-label-position":C},children:[a.jsx(ce,{component:"input",id:V,ref:F,mod:{error:!!E},...M("input",{focusable:!0,variant:_}),...U,...K,type:"checkbox"}),a.jsx(I,{indeterminate:k,...M("icon")})]})})});$n.classes={...EA,...xA};$n.displayName="@mantine/core/Checkbox";$n.Group=u0;$n.Indicator=d0;$n.Card=l0;function Fc(e){return"group"in e}function TA({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;Fc(c)&&o.push({group:c.group,items:TA({options:c.items,search:t,limit:n-o.length})}),Fc(c)||c.label.toLowerCase().includes(r)&&o.push(c)}return o}function v7(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 RA(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Fc(n))RA(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 y7(e,t){return Array.isArray(e)?e.includes(t):e===t}function _A({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:o,unstyled:s,renderOption:c}){if(!Fc(e)){const f=y7(r,e.value),p=t&&(f?a.jsx(Xd,{className:Mr.optionsDropdownCheckIcon}):n?a.jsx("div",{className:Mr.optionsDropdownCheckPlaceholder}):null),m=a.jsxs(a.Fragment,{children:[o==="left"&&p,a.jsx("span",{children:e.label}),o==="right"&&p]});return a.jsx(Xe.Option,{value:e.value,disabled:e.disabled,className:Ut({[Mr.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(_A,{data:f,value:r,unstyled:s,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:o,renderOption:c},f.value));return a.jsx(Xe.Group,{label:e.group,children:d})}function x7({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:b,unstyled:S,labelId:j,renderOption:C,scrollAreaProps:R,"aria-label":E}){RA(e);const _=typeof o=="string"?(r||TA)({options:e,search:f?o:"",limit:s??1/0}):e,k=v7(_),I=_.map(A=>a.jsx(_A,{data:A,withCheckIcon:p,withAlignedLabels:m,value:g,checkIconPosition:y,unstyled:S,renderOption:C},Fc(A)?A.group:A.value));return a.jsx(Xe.Dropdown,{hidden:t||n&&k,"data-composed":!0,children:a.jsxs(Xe.Options,{labelledBy:j,"aria-label":E,children:[d?a.jsx(Jr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...R,children:I}):I,k&&b&&a.jsx(Xe.Empty,{children:b})]})})}const AA=v.createContext(null),b7=AA.Provider;function S7(){return{withinGroup:!!v.useContext(AA)}}var gm={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const w7=(e,{spacing:t})=>({group:{"--ag-spacing":Gn(t)}}),f0=ge((e,t)=>{const n=ie("AvatarGroup",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,spacing:p,attributes:m,...g}=n,y=Le({name:"AvatarGroup",classes:gm,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:m,vars:f,varsResolver:w7,rootSelector:"group"});return a.jsx(b7,{value:!0,children:a.jsx(ce,{ref:t,...y("group"),...g})})});f0.classes=gm;f0.displayName="@mantine/core/AvatarGroup";function j7(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 C7(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 E7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function T7(e,t=E7){const n=C7(e),r=Math.abs(n)%t.length;return t[r]}function R7(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 _7=(e,{size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:c,name:d,allowedInitialsColors:f})=>{const p=s==="initials"&&typeof d=="string"?T7(d,f):s,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":it(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Ft(n),"--avatar-bg":p||r?m.background:void 0,"--avatar-color":p||r?m.color:void 0,"--avatar-bd":p||r?m.border:void 0}}},hl=sr((e,t)=>{const n=ie("Avatar",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,src:p,alt:m,radius:g,color:y,gradient:b,imageProps:S,children:j,autoContrast:C,mod:R,name:E,allowedInitialsColors:T,attributes:_,...k}=n,I=S7(),[A,P]=v.useState(!p),z=Le({name:"Avatar",props:n,classes:gm,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:_,vars:f,varsResolver:_7});return v.useEffect(()=>P(!p),[p]),a.jsx(ce,{...z("root"),mod:[{"within-group":I.withinGroup},R],ref:t,...k,children:A||!p?a.jsx("span",{...z("placeholder"),title:m,children:j||typeof E=="string"&&R7(E)||a.jsx(j7,{})}):a.jsx("img",{...S,...z("image"),src:p,alt:m,onError:B=>{P(!0),S?.onError?.(B)}})})});hl.classes=gm;hl.displayName="@mantine/core/Avatar";hl.Group=f0;var DA={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const A7=(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":it(s,"badge-height"),"--badge-padding-x":it(s,"badge-padding-x"),"--badge-fz":it(s,"badge-fz"),"--badge-radius":d||t===void 0?void 0:Ft(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"?Wt(n,e):void 0}}},vm=sr((e,t)=>{const n=ie("Badge",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,gradient:g,leftSection:y,rightSection:b,children:S,variant:j,fullWidth:C,autoContrast:R,circle:E,mod:T,attributes:_,...k}=n,I=Le({name:"Badge",props:n,classes:DA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:_,vars:f,varsResolver:A7});return a.jsxs(ce,{variant:j,mod:[{block:C,circle:E,"with-right-section":!!b,"with-left-section":!!y},T],...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}),b&&a.jsx("span",{...I("section"),"data-position":"right",children:b})]})});vm.classes=DA;vm.displayName="@mantine/core/Badge";var kA={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const D7={iconSize:48},k7=(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":_i(s.value,.07),"--bq-bg-dark":_i(o.value,.06),"--bq-bd":Wt(t,e),"--bq-icon-size":le(n),"--bq-radius":Ft(r)}}},h0=ge((e,t)=>{const n=ie("Blockquote",D7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,icon:m,iconSize:g,cite:y,attributes:b,...S}=n,j=Le({name:"Blockquote",classes:kA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:k7});return a.jsxs(ce,{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})]})});h0.classes=kA;h0.displayName="@mantine/core/Blockquote";var ou={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const GE={orientation:"horizontal"},P7=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),p0=ge((e,t)=>{const n=ie("ButtonGroup",GE,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,attributes:b,...S}=ie("ButtonGroup",GE,e),j=Le({name:"ButtonGroup",props:n,classes:ou,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:b,vars:p,varsResolver:P7,rootSelector:"group"});return a.jsx(ce,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...S})});p0.classes=ou;p0.displayName="@mantine/core/ButtonGroup";const N7=(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":it(c,"section-height"),"--section-padding-x":it(c,"section-padding-x"),"--section-fz":c?.includes("compact")?Qn(c.replace("compact-","")):Qn(c),"--section-radius":t===void 0?void 0:Ft(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},m0=ge((e,t)=>{const n=ie("ButtonGroupSection",null,e),{className:r,style:o,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,attributes:b,...S}=n,j=Le({name:"ButtonGroupSection",props:n,classes:ou,className:r,style:o,classNames:s,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:N7,rootSelector:"groupSection"});return a.jsx(ce,{...j("groupSection"),ref:t,variant:p,...S})});m0.classes=ou;m0.displayName="@mantine/core/ButtonGroupSection";const O7={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},M7=(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":it(s,"button-height"),"--button-padding-x":it(s,"button-padding-x"),"--button-fz":s?.includes("compact")?Qn(s.replace("compact-","")):Qn(s),"--button-radius":t===void 0?void 0:Ft(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}}},Pe=sr((e,t)=>{const n=ie("Button",null,e),{style:r,vars:o,className:s,color:c,disabled:d,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:y,radius:b,loading:S,loaderProps:j,gradient:C,classNames:R,styles:E,unstyled:T,"data-disabled":_,autoContrast:k,mod:I,attributes:A,...P}=n,z=Le({name:"Button",props:n,classes:ou,className:s,style:r,classNames:R,styles:E,unstyled:T,attributes:A,vars:o,varsResolver:M7}),B=!!p,Y=!!m;return a.jsxs(An,{ref:t,...z("root",{active:!d&&!S&&!_}),unstyled:T,variant:y,disabled:d||S,mod:[{disabled:d||_,loading:S,block:g,"with-left-section":B,"with-right-section":Y},I],...P,children:[typeof S=="boolean"&&a.jsx(Zi,{mounted:S,transition:O7,duration:150,children:J=>a.jsx(ce,{component:"span",...z("loader",{style:J}),"aria-hidden":!0,children:a.jsx(Ir,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),a.jsxs("span",{...z("inner"),children:[p&&a.jsx(ce,{component:"span",...z("section"),mod:{position:"left"},children:p}),a.jsx(ce,{component:"span",mod:{loading:S},...z("label"),children:f}),m&&a.jsx(ce,{component:"span",...z("section"),mod:{position:"right"},children:m})]})]})});Pe.classes=ou;Pe.displayName="@mantine/core/Button";Pe.Group=p0;Pe.GroupSection=m0;var PA={root:"m_4451eb3a"};const hr=sr((e,t)=>{const n=ie("Center",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,inline:p,mod:m,attributes:g,...y}=n,b=Le({name:"Center",props:n,classes:PA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:g,vars:f});return a.jsx(ce,{ref:t,mod:[{inline:p},m],...b("root"),...y})});hr.classes=PA;hr.displayName="@mantine/core/Center";const[L7,I7]=Io();function NA(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:s}=ie("ChipGroup",null,e),[c,d]=rr({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(L7,{value:{isChipSelected:f,onChange:p,multiple:o},children:s})}NA.displayName="@mantine/core/ChipGroup";var OA={root:"m_f59ffda3",label:"m_be049a53","label--outline":"m_3904c1af","label--filled":"m_fa109255","label--light":"m_f7e165c3",iconWrapper:"m_9ac86df9",checkIcon:"m_d6d72580",input:"m_bde07329"};const z7={type:"checkbox"},$7=(e,{size:t,radius:n,variant:r,color: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":it(t,"chip-size"),"--chip-radius":n===void 0?void 0:Ft(n),"--chip-checked-padding":it(t,"chip-checked-padding"),"--chip-padding":it(t,"chip-padding"),"--chip-icon-size":it(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":it(t,"chip-spacing")}}},Rd=ge((e,t)=>{const n=ie("Chip",z7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,id:p,checked:m,defaultChecked:g,onChange:y,value:b,wrapperProps:S,type:j,disabled:C,children:R,size:E,variant:T,icon:_,rootRef:k,autoContrast:I,mod:A,attributes:P,...z}=n,B=Le({name:"Chip",classes:OA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:P,vars:f,varsResolver:$7}),Y=I7(),J=mr(p),{styleProps:Z,rest:$}=ja(z),[Q,M]=rr({value:m,defaultValue:g,finalValue:!1,onChange:y}),L=Y?{checked:Y.isChipSelected(b),onChange:V=>{Y.onChange(V),y?.(V.currentTarget.checked)},type:Y.multiple?"checkbox":"radio"}:{},U=L.checked||Q;return a.jsxs(ce,{size:E,variant:T,ref:k,mod:A,...B("root"),...Z,...S,children:[a.jsx("input",{type:j,...B("input"),checked:U,onChange:V=>M(V.currentTarget.checked),id:J,disabled:C,ref:t,value:b,...L,...$}),a.jsxs("label",{htmlFor:J,"data-checked":U||void 0,"data-disabled":C||void 0,...B("label",{variant:T||"filled"}),children:[U&&_!==null&&_!==!1&&a.jsx("span",{...B("iconWrapper"),children:_===void 0?a.jsx(Xd,{...B("checkIcon")}):_}),a.jsx("span",{children:R})]})]})});Rd.classes=OA;Rd.displayName="@mantine/core/Chip";Rd.Group=NA;var MA={root:"m_b183c0a2"};const U7=(e,{color:t})=>({root:{"--code-bg":t?Wt(t,e):void 0}}),Jd=ge((e,t)=>{const n=ie("Code",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,block:m,variant:g,mod:y,attributes:b,...S}=n,j=Le({name:"Code",props:n,classes:MA,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:U7});return a.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},y],...j("root"),...S,dir:"ltr"})});Jd.classes=MA;Jd.displayName="@mantine/core/Code";var LA={root:"m_7485cace"};const B7=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:it(t,"container-size")}}),Zd=ge((e,t)=>{const n=ie("Container",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,fluid:p,mod:m,attributes:g,strategy:y,...b}=n,S=Le({name:"Container",classes:LA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:B7});return a.jsx(ce,{ref:t,mod:[{fluid:p,strategy:y||"block"},m],...S("root"),...b})});Zd.classes=LA;Zd.displayName="@mantine/core/Container";const V7={timeout:1e3};function g0(e){const{children:t,timeout:n,value:r,...o}=ie("CopyButton",V7,e),s=z2({timeout:n}),c=()=>s.copy(r);return a.jsx(a.Fragment,{children:t({copy:c,copied:s.copied,...o})})}g0.displayName="@mantine/core/CopyButton";var IA={root:"m_3eebeb36",label:"m_9e365f20"};const F7={orientation:"horizontal"},H7=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Wt(t,e):void 0,"--divider-border-style":n,"--divider-size":it(r,"divider-size")}}),_n=ge((e,t)=>{const n=ie("Divider",F7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,orientation:m,label:g,labelPosition:y,mod:b,attributes:S,...j}=n,C=Le({name:"Divider",classes:IA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:H7});return a.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...C("root"),...j,role:"separator",children:g&&a.jsx(ce,{component:"span",mod:{position:y},...C("label"),children:g})})});_n.classes=IA;_n.displayName="@mantine/core/Divider";const[QE,zA]=jr("Grid component was not found in tree"),Mx=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,WE=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Mx(e,t),YE=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},KE=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function q7({span:e,order:t,offset:n,selector:r}){const o=gn(),s=zA(),c=s.breakpoints||o.breakpoints,f=Qi(e)===void 0?12:Qi(e),p=Ss({"--col-order":Qi(t)?.toString(),"--col-flex-grow":YE(f,s.grow),"--col-flex-basis":Mx(f,s.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":WE(f,s.columns,s.grow),"--col-offset":KE(Qi(n),s.columns)}),m=dn(c).reduce((b,S)=>(b[S]||(b[S]={}),typeof t=="object"&&t[S]!==void 0&&(b[S]["--col-order"]=t[S]?.toString()),typeof e=="object"&&e[S]!==void 0&&(b[S]["--col-flex-grow"]=YE(e[S],s.grow),b[S]["--col-flex-basis"]=Mx(e[S],s.columns),b[S]["--col-width"]=e[S]==="content"?"auto":void 0,b[S]["--col-max-width"]=WE(e[S],s.columns,s.grow)),typeof n=="object"&&n[S]!==void 0&&(b[S]["--col-offset"]=KE(n[S],s.columns)),b),{}),y=Sd(dn(m),c).filter(b=>dn(m[b.value]).length>0).map(b=>({query:s.type==="container"?`mantine-grid (min-width: ${c[b.value]})`:`(min-width: ${c[b.value]})`,styles:m[b.value]}));return a.jsx(Tl,{styles:p,media:s.type==="container"?void 0:y,container:s.type==="container"?y:void 0,selector:r})}var v0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const G7={span:12},y0=ge((e,t)=>{const n=ie("GridCol",G7,e),{classNames:r,className:o,style:s,styles:c,vars:d,span:f,order:p,offset:m,...g}=n,y=zA(),b=Hd();return a.jsxs(a.Fragment,{children:[a.jsx(q7,{selector:`.${b}`,span:f,order:p,offset:m}),a.jsx(ce,{ref:t,...y.getStyles("col",{className:Ut(o,b),style:s,classNames:r,styles:c}),...g})]})});y0.classes=v0;y0.displayName="@mantine/core/GridCol";function XE({gutter:e,selector:t,breakpoints:n,type:r}){const o=gn(),s=n||o.breakpoints,c=Ss({"--grid-gutter":Gn(Qi(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=Sd(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(Tl,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const Q7={gutter:"md",grow:!1,columns:12},W7=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),Sr=ge((e,t)=>{const n=ie("Grid",Q7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,grow:p,gutter:m,columns:g,align:y,justify:b,children:S,breakpoints:j,type:C,attributes:R,...E}=n,T=Le({name:"Grid",classes:v0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:R,vars:f,varsResolver:W7}),_=Hd();return C==="container"&&j?a.jsxs(QE,{value:{getStyles:T,grow:p,columns:g,breakpoints:j,type:C},children:[a.jsx(XE,{selector:`.${_}`,...n}),a.jsx("div",{...T("container"),children:a.jsx(ce,{ref:t,...T("root",{className:_}),...E,children:a.jsx("div",{...T("inner"),children:S})})})]}):a.jsxs(QE,{value:{getStyles:T,grow:p,columns:g,breakpoints:j,type:C},children:[a.jsx(XE,{selector:`.${_}`,...n}),a.jsx(ce,{ref:t,...T("root",{className:_}),...E,children:a.jsx("div",{...T("inner"),children:S})})]})});Sr.classes=v0;Sr.displayName="@mantine/core/Grid";Sr.Col=y0;function JE({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 $A={root:"m_bcb3f3c2"};const Y7={color:"yellow"},K7=(e,{color:t})=>({root:{"--mark-bg-dark":JE({color:t,theme:e,defaultShade:5}),"--mark-bg-light":JE({color:t,theme:e,defaultShade:2})}}),x0=ge((e,t)=>{const n=ie("Mark",Y7,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,variant:m,attributes:g,...y}=n,b=Le({name:"Mark",props:n,className:o,style:s,classes:$A,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:K7});return a.jsx(ce,{component:"mark",ref:t,variant:m,...b("root"),...y})});x0.classes=$A;x0.displayName="@mantine/core/Mark";function ZE(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")}function X7(e,t){if(t==null)return[{chunk:e,highlighted:!1}];const n=Array.isArray(t)?t.map(ZE):ZE(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 b0=sr((e,t)=>{const{unstyled:n,children:r,highlight:o,highlightStyles:s,color:c,...d}=ie("Highlight",null,e),f=X7(r,o);return a.jsx(Ee,{unstyled:n,ref:t,...d,__staticSelector:"Highlight",children:f.map(({chunk:p,highlighted:m},g)=>m?a.jsx(x0,{unstyled:n,color:c,style:s,"data-highlight":p,children:p},g):a.jsx("span",{children:p},g))})});b0.classes=Ee.classes;b0.displayName="@mantine/core/Highlight";function Tp(){return Tp=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},Tp.apply(null,arguments)}function S0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var J7=v.useLayoutEffect,Z7=function(t){var n=Mn.useRef(t);return J7(function(){n.current=t}),n},eT=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},e6=function(t,n){var r=Mn.useRef();return Mn.useCallback(function(o){t.current=o,r.current&&eT(r.current,null),r.current=n,n&&eT(n,o)},[n])},tT={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},t6=function(t){Object.keys(tT).forEach(function(n){t.style.setProperty(n,tT[n],"important")})},nT=t6,Dr=null,rT=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function n6(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Dr||(Dr=document.createElement("textarea"),Dr.setAttribute("tabindex","-1"),Dr.setAttribute("aria-hidden","true"),nT(Dr)),Dr.parentNode===null&&document.body.appendChild(Dr);var o=e.paddingSize,s=e.borderSize,c=e.sizingStyle,d=c.boxSizing;Object.keys(c).forEach(function(y){var b=y;Dr.style[b]=c[b]}),nT(Dr),Dr.value=t;var f=rT(Dr,e);Dr.value=t,f=rT(Dr,e),Dr.value="x";var p=Dr.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 iT=function(){},r6=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},i6=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],o6=!!document.documentElement.currentStyle,a6=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=r6(i6,n),o=r.boxSizing;if(o==="")return null;o6&&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}},s6=a6;function w0(e,t,n){var r=Z7(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 l6=function(t,n){w0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},c6=function(t){w0(window,"resize",t)},u6=function(t){w0(document.fonts,"loadingdone",t)},d6=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],f6=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,s=t.minRows,c=t.onChange,d=c===void 0?iT:c,f=t.onHeightChange,p=f===void 0?iT:f,m=S0(t,d6),g=m.value!==void 0,y=v.useRef(null),b=e6(y,n),S=v.useRef(0),j=v.useRef(),C=function(){var T=y.current,_=r&&j.current?j.current:s6(T);if(_){j.current=_;var k=n6(_,T.value||T.placeholder||"x",s,o),I=k[0],A=k[1];S.current!==I&&(S.current=I,T.style.setProperty("height",I+"px","important"),p(I,{rowHeight:A}))}},R=function(T){g||C(),d(T)};return v.useLayoutEffect(C),l6(y,function(){if(!g){var E=y.current.value;requestAnimationFrame(function(){var T=y.current;T&&E!==T.value&&C()})}}),c6(C),u6(C),v.createElement("textarea",Tp({},m,{onChange:R,ref:b}))},h6=v.forwardRef(f6);const p6={size:"sm"},_l=ge((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:s,resize:c,...d}=ie("Textarea",p6,e),f=n&&q2()!=="test",p=f?{maxRows:r,minRows:o}:{};return a.jsx($r,{component:f?h6:"textarea",ref:t,...d,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});_l.classes=$r.classes;_l.displayName="@mantine/core/Textarea";function oT(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const m6={serialize:JSON.stringify,deserialize:JSON.parse,size:"sm"},au=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,...b}=ie("JsonInput",m6,e),[S,j]=rr({value:n,defaultValue:r,finalValue:"",onChange:o}),[C,R]=v.useState(oT(S,f)),E=_=>{p?.(_),R(!0)},T=_=>{typeof m=="function"&&m(_);const k=oT(_.currentTarget.value,f);s&&!g&&k&&_.currentTarget.value.trim()!==""&&j(d(f(_.currentTarget.value),null,2)),R(k)};return a.jsx(_l,{value:S,onChange:_=>j(_.currentTarget.value),onFocus:E,onBlur:T,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?y:c||!0,"data-monospace":!0})});au.classes=$r.classes;au.displayName="@mantine/core/JsonInput";const[g6,v6]=jr("List component was not found in tree");var j0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const C0=ge((e,t)=>{const n=ie("ListItem",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,icon:f,children:p,mod:m,...g}=n,y=v6(),b=f||y.icon,S={classNames:r,styles:c};return a.jsx(ce,{...y.getStyles("item",{...S,className:o,style:s}),component:"li",mod:[{"with-icon":!!b,centered:y.center},m],ref:t,...g,children:a.jsxs("div",{...y.getStyles("itemWrapper",S),children:[b&&a.jsx("span",{...y.getStyles("itemIcon",S),children:b}),a.jsx("span",{...y.getStyles("itemLabel",S),children:p})]})})});C0.classes=j0;C0.displayName="@mantine/core/ListItem";const y6={type:"unordered"},x6=(e,{size:t,spacing:n})=>({root:{"--list-fz":Qn(t),"--list-lh":I2(t),"--list-spacing":Gn(n)}}),Nr=ge((e,t)=>{const n=ie("List",y6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,type:m,withPadding:g,icon:y,spacing:b,center:S,listStyleType:j,mod:C,attributes:R,...E}=n,T=Le({name:"List",classes:j0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:R,vars:f,varsResolver:x6});return a.jsx(g6,{value:{center:S,icon:y,getStyles:T},children:a.jsx(ce,{...T("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g,type:j},C],ref:t,...E,children:p})})});Nr.classes=j0;Nr.displayName="@mantine/core/List";Nr.Item=C0;var UA={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const aT={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:zr("overlay")},b6=(e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}}),ym=ge((e,t)=>{const n=ie("LoadingOverlay",aT,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:y,zIndex:b,attributes:S,...j}=n,C=gn(),R=Le({name:"LoadingOverlay",classes:UA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:b6}),E={...aT.overlayProps,...g};return a.jsx(Zi,{transition:"fade",...p,mounted:!!y,children:T=>a.jsxs(ce,{...R("root",{style:T}),ref:t,...j,children:[a.jsx(Ir,{...R("loader"),unstyled:d,...m}),a.jsx(Bc,{...E,...R("overlay"),darkHidden:!0,unstyled:d,color:g?.color||C.white}),a.jsx(Bc,{...E,...R("overlay"),lightHidden:!0,unstyled:d,color:g?.color||C.colors.dark[5]})]})})});ym.classes=UA;ym.displayName="@mantine/core/LoadingOverlay";const[S6,Es]=jr("Menu component was not found in the tree");var Ts={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const E0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=ie("MenuDivider",null,e),f=Es();return a.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:o,styles:s,classNames:n}),...d})});E0.classes=Ts;E0.displayName="@mantine/core/MenuDivider";const T0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=ie("MenuDropdown",null,e),y=v.useRef(null),b=Es(),S=ar(p,R=>{(R.key==="ArrowUp"||R.key==="ArrowDown")&&(R.preventDefault(),y.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),j=ar(d,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=ar(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return a.jsxs(Zr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Bn(t,y),...b.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[b.withInitialFocusPlaceholder&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});T0.classes=Ts;T0.displayName="@mantine/core/MenuDropdown";const[w6,xm]=Io(),R0=sr((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":b,...S}=ie("MenuItem",null,e),j=Es(),C=xm(),R=gn(),{dir:E}=ws(),T=v.useRef(null),_=S,k=ar(_.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),I=d?R.variantColorResolver({color:d,theme:R,variant:"light"}):void 0,A=d?Xr({color:d,theme:R}):null,P=ar(_.onKeyDown,z=>{z.key==="ArrowLeft"&&C&&(C.close(),C.focusParentItem())});return a.jsxs(An,{onMouseDown:z=>z.preventDefault(),...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:Bn(T,t),role:"menuitem",disabled:y,"data-menu-item":!0,"data-disabled":y||b||void 0,"data-mantine-stop-propagation":!0,onClick:k,onKeyDown:yb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:E,orientation:"vertical",onKeyDown:P}),__vars:{"--menu-item-color":A?.isThemeColor&&A?.shade===void 0?`var(--mantine-color-${A.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})]})});R0.classes=Ts;R0.displayName="@mantine/core/MenuItem";const _0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,...d}=ie("MenuLabel",null,e),f=Es();return a.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:o,styles:s,classNames:n}),...d})});_0.classes=Ts;_0.displayName="@mantine/core/MenuLabel";const A0=ge((e,t)=>{const{classNames:n,className:r,style:o,styles:s,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=ie("MenuSubDropdown",null,e),y=v.useRef(null),b=Es(),S=xm(),j=ar(d,S?.open),C=ar(f,S?.close);return a.jsx(Zr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Bn(t,y),...b.getStyles("dropdown",{className:r,style:o,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:m})});A0.classes=Ts;A0.displayName="@mantine/core/MenuSubDropdown";const D0=sr((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:b,...S}=ie("MenuSubItem",null,e),j=Es(),C=xm(),R=gn(),{dir:E}=ws(),T=v.useRef(null),_=S,k=d?R.variantColorResolver({color:d,theme:R,variant:"light"}):void 0,I=d?Xr({color:d,theme:R}):null,A=ar(_.onKeyDown,Y=>{Y.key==="ArrowRight"&&(C?.open(),C?.focusFirstItem()),Y.key==="ArrowLeft"&&C?.parentContext&&(C.parentContext.close(),C.parentContext.focusParentItem())}),P=ar(_.onClick,()=>{!y&&b&&j.closeDropdownImmediately()}),z=ar(_.onMouseEnter,C?.open),B=ar(_.onMouseLeave,C?.close);return a.jsxs(An,{onMouseDown:Y=>Y.preventDefault(),...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:s,classNames:n}),ref:Bn(T,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:z,onMouseLeave:B,onClick:P,onKeyDown:yb({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:E,orientation:"vertical",onKeyDown:A}),__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(aA,{...j.getStyles("chevron"),size:14})})]})});D0.classes=Ts;D0.displayName="@mantine/core/MenuSubItem";function BA({children:e,refProp:t}){if(!Lo(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 Es(),a.jsx(Zr.Target,{refProp:t,popupType:"menu",children:e})}BA.displayName="@mantine/core/MenuSubTarget";const j6={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function su(e){const{children:t,closeDelay:n,openDelay:r,...o}=ie("MenuSub",j6,e),s=mr(),[c,{open:d,close:f}]=Zc(!1),p=xm(),{openDropdown:m,closeDropdown:g}=oA({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),b=()=>window.setTimeout(()=>{document.getElementById(`${s}-target`)?.focus()},16);return a.jsx(w6,{value:{opened:c,close:g,open:m,focusFirstItem:y,focusParentItem:b,parentContext:p},children:a.jsx(Zr,{opened:c,withinPortal:!1,withArrow:!1,id:s,...o,children:t})})}su.extend=e=>e;su.displayName="@mantine/core/MenuSub";su.Target=BA;su.Dropdown=A0;su.Item=D0;const C6={refProp:"ref"},VA=v.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=ie("MenuTarget",C6,e);if(!Lo(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const s=Es(),c=n.props,d=ar(c.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),f=ar(c.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),p=ar(c.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return a.jsx(Zr.Target,{refProp:r,popupType:"menu",ref:t,...o,children:v.cloneElement(n,{onClick:d,onMouseEnter:f,onMouseLeave:p,"data-expanded":s.opened?!0:void 0})})});VA.displayName="@mantine/core/MenuTarget";const E6={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function xe(e){const t=ie("Menu",E6,e),{children:n,onOpen:r,onClose:o,opened:s,defaultOpened:c,trapFocus:d,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:y,openDelay:b,closeDelay:S,classNames:j,styles:C,unstyled:R,variant:E,vars:T,menuItemTabIndex:_,keepMounted:k,withInitialFocusPlaceholder:I,attributes:A,...P}=t,z=Le({name:"Menu",classes:Ts,props:t,classNames:j,styles:C,unstyled:R,attributes:A}),[B,Y]=rr({value:s,defaultValue:c,finalValue:!1,onChange:f}),[J,Z]=v.useState(!1),$=()=>{Y(!1),Z(!1),B&&o?.()},Q=()=>{Y(!0),!B&&r?.()},M=()=>{B?$():Q()},{openDropdown:L,closeDropdown:U}=oA({open:Q,close:$,closeDelay:S,openDelay:b}),V=F=>HM("[data-menu-item]","[data-menu-dropdown]",F),{resolvedClassNames:K,resolvedStyles:O}=Cl({classNames:j,styles:C,props:t});return a.jsx(S6,{value:{getStyles:z,opened:B,toggleDropdown:M,getItemIndex:V,openedViaClick:J,setOpenedViaClick:Z,closeOnItemClick:p,closeDropdown:y==="click"?$:U,openDropdown:y==="click"?Q:L,closeDropdownImmediately:$,loop:m,trigger:y,unstyled:R,menuItemTabIndex:_,withInitialFocusPlaceholder:I},children:a.jsx(Zr,{...P,opened:B,onChange:M,defaultOpened:c,trapFocus:k?!1:d,closeOnEscape:g,__staticSelector:"Menu",classNames:K,styles:O,unstyled:R,variant:E,keepMounted:k,children:n})})}xe.extend=e=>e;xe.withProps=k5(xe);xe.classes=Ts;xe.displayName="@mantine/core/Menu";xe.Item=R0;xe.Label=_0;xe.Dropdown=T0;xe.Target=VA;xe.Divider=E0;xe.Sub=su;const[T6,lu]=jr("Modal component was not found in tree");var Ea={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const bm=ge((e,t)=>{const n=ie("ModalBody",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(K_,{ref:t,...p.getStyles("body",{classNames:r,style:s,styles:c,className:o}),...f})});bm.classes=Ea;bm.displayName="@mantine/core/ModalBody";const Sm=ge((e,t)=>{const n=ie("ModalCloseButton",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(X_,{ref:t,...p.getStyles("close",{classNames:r,style:s,styles:c,className:o}),...f})});Sm.classes=Ea;Sm.displayName="@mantine/core/ModalCloseButton";const wm=ge((e,t)=>{const n=ie("ModalContent",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,children:f,__hidden:p,...m}=n,g=lu(),y=g.scrollAreaComponent||hI;return a.jsx(J_,{...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 - (${le(g.yOffset)} * 2))`},children:f})})});wm.classes=Ea;wm.displayName="@mantine/core/ModalContent";const jm=ge((e,t)=>{const n=ie("ModalHeader",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(Z_,{ref:t,...p.getStyles("header",{classNames:r,style:s,styles:c,className:o}),...f})});jm.classes=Ea;jm.displayName="@mantine/core/ModalHeader";const Cm=ge((e,t)=>{const n=ie("ModalOverlay",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(eA,{ref:t,...p.getStyles("overlay",{classNames:r,style:s,styles:c,className:o}),...f})});Cm.classes=Ea;Cm.displayName="@mantine/core/ModalOverlay";const R6={__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"},_6=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:Ft(t),"--modal-size":it(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(o)}}),Em=ge((e,t)=>{const n=ie("ModalRoot",R6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:y,centered:b,xOffset:S,__staticSelector:j,attributes:C,...R}=n,E=Le({name:j,classes:Ea,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:_6});return a.jsx(T6,{value:{yOffset:p,scrollAreaComponent:m,getStyles:E,fullScreen:y},children:a.jsx(Y_,{ref:t,...E("root"),"data-full-screen":y||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Jr.Autosize||void 0,unstyled:d,...R})})});Em.classes=Ea;Em.displayName="@mantine/core/ModalRoot";const[A6,D6]=Io();function FA({children:e}){const[t,n]=v.useState([]),[r,o]=v.useState(zr("modal"));return a.jsx(A6,{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})}FA.displayName="@mantine/core/ModalStack";const Tm=ge((e,t)=>{const n=ie("ModalTitle",null,e),{classNames:r,className:o,style:s,styles:c,vars:d,...f}=n,p=lu();return a.jsx(tA,{ref:t,...p.getStyles("title",{classNames:r,style:s,styles:c,className:o}),...f})});Tm.classes=Ea;Tm.displayName="@mantine/core/ModalTitle";const k6={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},Vn=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}=ie("Modal",k6,e),b=D6(),S=!!n||s,j=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:p;return v.useEffect(()=>{b&&m&&(p?b.addModal(m,g||zr("modal")):b.removeModal(m))},[p,m,g]),a.jsxs(Em,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...y,...j,children:[r&&a.jsx(Cm,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...o}),a.jsxs(wm,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[S&&a.jsxs(jm,{children:[n&&a.jsx(Tm,{children:n}),s&&a.jsx(Sm,{...c})]}),a.jsx(bm,{children:d})]})]})});Vn.classes=Ea;Vn.displayName="@mantine/core/Modal";Vn.Root=Em;Vn.Overlay=Cm;Vn.Content=wm;Vn.Body=bm;Vn.Header=jm;Vn.Title=Tm;Vn.CloseButton=Sm;Vn.Stack=FA;const[P6,k0]=Io(),[N6,O6]=Io();var Rm={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const M6=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?it(t):it(n,"pg-gap")}}),P0=ge((e,t)=>{const n=ie("PillGroup",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,disabled:m,attributes:g,...y}=n,S=k0()?.size||p||void 0,j=Le({name:"PillGroup",classes:Rm,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:M6,stylesCtx:{size:S},rootSelector:"group"});return a.jsx(N6,{value:{size:S,disabled:m},children:a.jsx(ce,{ref:t,size:S,...j("group"),...y})})});P0.classes=Rm;P0.displayName="@mantine/core/PillGroup";const L6={variant:"default"},I6=(e,{radius:t},{size:n})=>({root:{"--pill-fz":it(n,"pill-fz"),"--pill-height":it(n,"pill-height"),"--pill-radius":t===void 0?void 0:Ft(t)}}),ya=ge((e,t)=>{const n=ie("Pill",L6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:y,removeButtonProps:b,radius:S,size:j,disabled:C,mod:R,attributes:E,...T}=n,_=O6(),k=k0(),I=j||_?.size||void 0,A=k?.variant==="filled"?"contrast":p||"default",P=Le({name:"Pill",classes:Rm,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:E,vars:f,varsResolver:I6,stylesCtx:{size:I}});return a.jsxs(ce,{component:"span",ref:t,variant:A,size:I,...P("root",{variant:A}),mod:[{"with-remove":g&&!C,disabled:C||_?.disabled},R],...T,children:[a.jsx("span",{...P("label"),children:m}),g&&a.jsx(js,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:d,...b,...P("remove",{className:b?.className,style:b?.style}),onMouseDown:z=>{z.preventDefault(),z.stopPropagation(),b?.onMouseDown?.(z)},onClick:z=>{z.stopPropagation(),y?.(),b?.onClick?.(z)}})]})});ya.classes=Rm;ya.displayName="@mantine/core/Pill";ya.Group=P0;var HA={field:"m_45c4369d"};const z6={type:"visible"},N0=ge((e,t)=>{const n=ie("PillsInputField",z6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,type:p,disabled:m,id:g,pointer:y,mod:b,attributes:S,...j}=n,C=k0(),R=ru(),E=Le({name:"PillsInputField",classes:HA,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,rootSelector:"field"}),T=m||C?.disabled;return a.jsx(ce,{component:"input",ref:Bn(t,C?.fieldRef),"data-type":p,disabled:T,mod:[{disabled:T,pointer:y},b],...E("field"),...j,id:R?.inputId||g,"aria-invalid":C?.hasError,"aria-describedby":R?.describedBy,type:"text",onMouseDown:_=>!y&&_.stopPropagation()})});N0.classes=HA;N0.displayName="@mantine/core/PillsInputField";const $6={size:"sm"},ys=ge((e,t)=>{const n=ie("PillsInput",$6,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(P6,{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:b=>{b.preventDefault(),o?.(b),y.current?.focus()},onClick:b=>{b.preventDefault(),b.currentTarget.closest("fieldset")?.disabled||(y.current?.focus(),s?.(b))},...g,multiline:!0,disabled:d,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});ys.displayName="@mantine/core/PillsInput";ys.Field=N0;function U6({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,s)=>(Fc(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 B6={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:",",clearSearchOnChange:!0,size:"sm"},_m=ge((e,t)=>{const n=ie("MultiSelect",B6,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,size:p,value:m,defaultValue:g,onChange:y,onKeyDown:b,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:R,onDropdownOpen:E,onDropdownClose:T,selectFirstOptionOnChange:_,onOptionSubmit:k,comboboxProps:I,filter:A,limit:P,withScrollArea:z,maxDropdownHeight:B,searchValue:Y,defaultSearchValue:J,onSearchChange:Z,readOnly:$,disabled:Q,onFocus:M,onBlur:L,radius:U,rightSection:V,rightSectionWidth:K,rightSectionPointerEvents:O,rightSectionProps:F,leftSection:ae,leftSectionWidth:ue,leftSectionPointerEvents:be,leftSectionProps:we,inputContainer:Ce,inputWrapperOrder:nt,withAsterisk:De,labelProps:ft,descriptionProps:ot,errorProps:ht,wrapperProps:st,description:yt,label:mt,error:It,maxValues:Te,searchable:Re,nothingFoundMessage:Ie,withCheckIcon:Oe,withAlignedLabels:ct,checkIconPosition:tt,hidePickedOptions:lt,withErrorStyles:pe,name:qe,form:je,id:Ae,clearable:_t,clearButtonProps:Zn,hiddenInputProps:vn,placeholder:Pn,hiddenInputValuesDivider:yn,required:En,mod:Nn,renderOption:lr,onRemove:Tn,onClear:Ho,scrollAreaProps:ao,chevronColor:so,attributes:mi,clearSearchOnChange:lo,...qo}=n,Ur=mr(Ae),co=dA(j),ir=fA(co),Go=v.useRef({}),Fn=Rl({opened:C,defaultOpened:R,onDropdownOpen:E,onDropdownClose:()=>{T?.(),Fn.resetSelectedOption()}}),{styleProps:ka,rest:{type:Pa,autoComplete:mu,...H}}=ja(qo),[W,oe]=rr({value:m,defaultValue:g,finalValue:[],onChange:y}),[Se,ke]=rr({value:Y,defaultValue:J,finalValue:"",onChange:Z}),We=at=>{ke(at),Fn.resetSelectedOption()},Ye=Le({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:d,attributes:mi}),{resolvedClassNames:Be,resolvedStyles:Me}=Cl({props:n,styles:c,classNames:r}),Ve=at=>{b?.(at),at.key===" "&&!Re&&(at.preventDefault(),Fn.toggleDropdown()),at.key==="Backspace"&&Se.length===0&&W.length>0&&(Tn?.(W[W.length-1]),oe(W.slice(0,W.length-1)))},Ke=W.map((at,rn)=>{const qt=ir[at]||Go.current[at];return a.jsx(ya,{withRemoveButton:!$&&!ir[at]?.disabled,onRemove:()=>{oe(W.filter(zt=>at!==zt)),Tn?.(at)},unstyled:d,disabled:Q,...Ye("pill"),children:qt?.label||at},`${at}-${rn}`)});v.useEffect(()=>{_&&Fn.selectFirstOption()},[_,Se]),v.useEffect(()=>{W.forEach(at=>{at in ir&&(Go.current[at]=ir[at])})},[ir,W]);const et=a.jsx(Xe.ClearButton,{...Zn,onClear:()=>{Ho?.(),oe([]),We("")}}),Et=U6({data:co,value:W}),Xt=_t&&W.length>0&&!Q&&!$;return a.jsxs(a.Fragment,{children:[a.jsxs(Xe,{store:Fn,classNames:Be,styles:Me,unstyled:d,size:p,readOnly:$,__staticSelector:"MultiSelect",attributes:mi,onOptionSubmit:at=>{k?.(at),lo&&We(""),Fn.updateSelectedOptionIndex("selected"),W.includes(ir[at].value)?(oe(W.filter(rn=>rn!==ir[at].value)),Tn?.(ir[at].value)):W.length<Te&&oe([...W,ir[at].value])},...I,children:[a.jsx(Xe.DropdownTarget,{children:a.jsx(ys,{...ka,__staticSelector:"MultiSelect",classNames:Be,styles:Me,unstyled:d,size:p,className:o,style:s,variant:S,disabled:Q,radius:U,__defaultRightSection:a.jsx(Xe.Chevron,{size:p,error:It,unstyled:d,color:so}),__clearSection:et,__clearable:Xt,rightSection:V,rightSectionPointerEvents:O||"none",rightSectionWidth:K,rightSectionProps:F,leftSection:ae,leftSectionWidth:ue,leftSectionPointerEvents:be,leftSectionProps:we,inputContainer:Ce,inputWrapperOrder:nt,withAsterisk:De,labelProps:ft,descriptionProps:ot,errorProps:ht,wrapperProps:st,description:yt,label:mt,error:It,withErrorStyles:pe,__stylesApiProps:{...n,rightSectionPointerEvents:O||(Xt?"all":"none"),multiline:!0},pointer:!Re,onClick:()=>Re?Fn.openDropdown():Fn.toggleDropdown(),"data-expanded":Fn.dropdownOpened||void 0,id:Ur,required:En,mod:Nn,attributes:mi,children:a.jsxs(ya.Group,{attributes:mi,disabled:Q,unstyled:d,...Ye("pillsList"),children:[Ke,a.jsx(Xe.EventsTarget,{autoComplete:mu,children:a.jsx(ys.Field,{...H,ref:t,id:Ur,placeholder:Pn,type:!Re&&!Pn?"hidden":"visible",...Ye("inputField"),unstyled:d,onFocus:at=>{M?.(at),Re&&Fn.openDropdown()},onBlur:at=>{L?.(at),Fn.closeDropdown(),We("")},onKeyDown:Ve,value:Se,onChange:at=>{We(at.currentTarget.value),Re&&Fn.openDropdown(),_&&Fn.selectFirstOption()},disabled:Q,readOnly:$||!Re,pointer:!Re})})]})})}),a.jsx(x7,{data:lt?Et:co,hidden:$||Q,filter:A,search:Se,limit:P,hiddenWhenEmpty:!Ie,withScrollArea:z,maxDropdownHeight:B,filterOptions:Re,value:W,checkIconPosition:tt,withCheckIcon:Oe,withAlignedLabels:ct,nothingFoundMessage:Ie,unstyled:d,labelId:mt?`${Ur}-label`:void 0,"aria-label":mt?void 0:qo["aria-label"],renderOption:lr,scrollAreaProps:ao})]}),a.jsx(Xe.HiddenInput,{name:qe,valuesDivider:yn,value:W,form:je,disabled:Q,...vn})]})});_m.classes={...$r.classes,...Xe.classes};_m.displayName="@mantine/core/MultiSelect";function V6(e){return"group"in e}function O0({data:e}){if(V6(e)){const o=e.items.map(s=>a.jsx(O0,{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)}O0.displayName="@mantine/core/NativeSelectOption";const F6={rightSectionPointerEvents:"none"},fn=ge((e,t)=>{const{data:n,children:r,size:o,error:s,rightSection:c,unstyled:d,...f}=ie("NativeSelect",F6,e),p=dA(n).map((m,g)=>a.jsx(O0,{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(pm,{size:o,error:s,unstyled:d}),children:r||p})});fn.classes=$r.classes;fn.displayName="@mantine/core/NativeSelect";var qA={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const H6={withCloseButton:!0},q6=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Ft(t),"--notification-color":n?Wt(n,e):void 0}}),M0=ge((e,t)=>{const n=ie("Notification",H6,e),{className:r,color:o,radius:s,loading:c,withCloseButton:d,withBorder:f,title:p,icon:m,children:g,onClose:y,closeButtonProps:b,classNames:S,style:j,styles:C,unstyled:R,variant:E,vars:T,mod:_,loaderProps:k,role:I,attributes:A,...P}=n,z=Le({name:"Notification",classes:qA,props:n,className:r,style:j,classNames:S,styles:C,unstyled:R,attributes:A,vars:T,varsResolver:q6});return a.jsxs(ce,{...z("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},_],ref:t,variant:E,role:I||"alert",...P,children:[m&&!c&&a.jsx("div",{...z("icon"),children:m}),c&&a.jsx(Ir,{size:28,color:o,...k,...z("loader")}),a.jsxs("div",{...z("body"),children:[p&&a.jsx("div",{...z("title"),children:p}),a.jsx(ce,{...z("description"),mod:{"data-with-title":!!p},children:g})]}),d&&a.jsx(js,{iconSize:16,color:"gray",...b,unstyled:R,onClick:y,...z("closeButton")})]})});M0.classes=qA;M0.displayName="@mantine/core/Notification";function GA(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 _d;(function(e){e.event="event",e.props="prop"})(_d||(_d={}));function us(){}function G6(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 Ad(e){return!!(e||"").match(/\d/)}function Mc(e){return e==null}function Q6(e){return typeof e=="number"&&isNaN(e)}function QA(e){return Mc(e)||Q6(e)||typeof e=="number"&&!isFinite(e)}function WA(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function W6(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Y6(e,t,n){var r=W6(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 K6(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 L0(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 X6(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 YA(e,t,n){for(var r="",o=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||o;return r}function sT(e,t){return Array(t+1).join(e)}function KA(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."+sT("0",Math.abs(c))+o:c>=d?o=o+sT("0",c-d):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function lT(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=L0(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,R){return j.length>R?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var y=YA(m[1]||"",t,n),b=d?"-":"",S=r?".":"";return""+b+g+S+y}function Zs(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 XA=G6(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}}}),J6=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function Z6(e,t,n){return Math.min(Math.max(e,t),n)}function Vy(e){return Math.max(e.selectionStart,e.selectionEnd)}function ez(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function tz(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function nz(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=nz);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),b=0;b<p;b++){y[b]=-1;for(var S=0,j=m;S<j;S++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:S});if(C&&g[S]!==!0){y[b]=S,g[S]=!0;break}}}for(var R=r;R<p&&(y[R]===-1||!s(n[R]));)R++;var E=R===p||y[R]===-1?m:y[R];for(R=r-1;R>0&&y[R]===-1;)R--;var T=R===-1||y[R]===-1?0:y[R]+1;return T>E?E:r-T<E-r?T:E}function cT(e,t,n,r){var o=e.length;if(t=Z6(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 iz(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(Ad(e[n])||Ad(e[n-1]));return t}function JA(e,t,n,r,o,s){s===void 0&&(s=us);var c=K6(function(S,j){var C,R;return QA(S)?(R="",C=""):typeof S=="number"||j?(R=typeof S=="number"?KA(S):S,C=r(R)):(R=o(S,void 0),C=r(R)),{formattedValue:C,numAsString:R}}),d=v.useState(function(){return c(Mc(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;Mc(e)&&(g=f.numAsString,y=!0);var b=c(g,y);return v.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function oz(e){return e.replace(/[^0-9]/g,"")}function az(e){return e}function sz(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=oz);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,y=e.onChange;y===void 0&&(y=us);var b=e.onKeyDown;b===void 0&&(b=us);var S=e.onMouseUp;S===void 0&&(S=us);var j=e.onFocus;j===void 0&&(j=us);var C=e.onBlur;C===void 0&&(C=us);var R=e.value,E=e.getCaretBoundary;E===void 0&&(E=iz);var T=e.isValidInputCharacter;T===void 0&&(T=Ad);var _=e.isCharacterSame,k=GA(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),I=JA(R,f,!!p,c,d,m),A=I[0],P=A.formattedValue,z=A.numAsString,B=I[1],Y=v.useRef(),J=v.useRef({formattedValue:P,numAsString:z}),Z=function(Te,Re){J.current={formattedValue:Te.formattedValue,numAsString:Te.value},B(Te,Re)},$=v.useState(!1),Q=$[0],M=$[1],L=v.useRef(null),U=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return M(!0),function(){clearTimeout(U.current.setCaretTimeout),clearTimeout(U.current.focusTimeout)}},[]);var V=c,K=function(Te,Re){var Ie=parseFloat(Re);return{formattedValue:Te,value:Re,floatValue:isNaN(Ie)?void 0:Ie}},O=function(Te,Re,Ie){Te.selectionStart===0&&Te.selectionEnd===Te.value.length||(Zs(Te,Re),U.current.setCaretTimeout=setTimeout(function(){Te.value===Ie&&Te.selectionStart!==Re&&Zs(Te,Re)},0))},F=function(Te,Re,Ie){return cT(Te,Re,E(Te),Ie)},ae=function(Te,Re,Ie){var Oe=E(Re),ct=rz(Re,P,Te,Ie,Oe,T,_);return ct=cT(Re,ct,Oe),ct},ue=function(Te){var Re=Te.formattedValue;Re===void 0&&(Re="");var Ie=Te.input,Oe=Te.source,ct=Te.event,tt=Te.numAsString,lt;if(Ie){var pe=Te.inputValue||Ie.value,qe=Vy(Ie);Ie.value=Re,lt=ae(pe,Re,qe),lt!==void 0&&O(Ie,lt,Re)}Re!==P&&Z(K(Re,tt),{event:ct,source:Oe})};v.useEffect(function(){var Te=J.current,Re=Te.formattedValue,Ie=Te.numAsString;(P!==Re||z!==Ie)&&Z(K(P,z),{event:void 0,source:_d.props})},[P,z]);var be=L.current?Vy(L.current):void 0,we=typeof window<"u"?v.useLayoutEffect:v.useEffect;we(function(){var Te=L.current;if(P!==J.current.formattedValue&&Te){var Re=ae(J.current.formattedValue,P,be);Te.value=P,O(Te,Re,P)}},[P]);var Ce=function(Te,Re,Ie){var Oe=Re.target,ct=Y.current?J6(Y.current,Oe.selectionEnd):XA(P,Te),tt=Object.assign(Object.assign({},ct),{lastValue:P}),lt=d(Te,tt),pe=V(lt);if(lt=d(pe,void 0),g&&!g(K(pe,lt))){var qe=Re.target,je=Vy(qe),Ae=ae(Te,P,je);return qe.value=P,O(qe,Ae,P),!1}return ue({formattedValue:pe,numAsString:lt,inputValue:Te,event:Re,source:Ie,input:Re.target}),!0},nt=function(Te,Re){Re===void 0&&(Re=0);var Ie=Te.selectionStart,Oe=Te.selectionEnd;Y.current={selectionStart:Ie,selectionEnd:Oe+Re}},De=function(Te){var Re=Te.target,Ie=Re.value,Oe=Ce(Ie,Te,_d.event);Oe&&y(Te),Y.current=void 0},ft=function(Te){var Re=Te.target,Ie=Te.key,Oe=Re.selectionStart,ct=Re.selectionEnd,tt=Re.value;tt===void 0&&(tt="");var lt;Ie==="ArrowLeft"||Ie==="Backspace"?lt=Math.max(Oe-1,0):Ie==="ArrowRight"?lt=Math.min(Oe+1,tt.length):Ie==="Delete"&&(lt=Oe);var pe=0;Ie==="Delete"&&Oe===ct&&(pe=1);var qe=Ie==="ArrowLeft"||Ie==="ArrowRight";if(lt===void 0||Oe!==ct&&!qe){b(Te),nt(Re,pe);return}var je=lt;if(qe){var Ae=Ie==="ArrowLeft"?"left":"right";je=F(tt,lt,Ae),je!==lt&&Te.preventDefault()}else Ie==="Delete"&&!T(tt[lt])?je=F(tt,lt,"right"):Ie==="Backspace"&&!T(tt[lt])&&(je=F(tt,lt,"left"));je!==lt&&O(Re,je,tt),b(Te),nt(Re,pe)},ot=function(Te){var Re=Te.target,Ie=function(){var Oe=Re.selectionStart,ct=Re.selectionEnd,tt=Re.value;if(tt===void 0&&(tt=""),Oe===ct){var lt=F(tt,Oe);lt!==Oe&&O(Re,lt,tt)}};Ie(),requestAnimationFrame(function(){Ie()}),S(Te),nt(Re)},ht=function(Te){Te.persist&&Te.persist();var Re=Te.target,Ie=Te.currentTarget;L.current=Re,U.current.focusTimeout=setTimeout(function(){var Oe=Re.selectionStart,ct=Re.selectionEnd,tt=Re.value;tt===void 0&&(tt="");var lt=F(tt,Oe);lt!==Oe&&!(Oe===0&&ct===tt.length)&&O(Re,lt,tt),j(Object.assign(Object.assign({},Te),{currentTarget:Ie}))},0)},st=function(Te){L.current=null,clearTimeout(U.current.focusTimeout),clearTimeout(U.current.setCaretTimeout),C(Te)},yt=Q&&ez()?"numeric":void 0,mt=Object.assign({inputMode:yt},k,{type:t,value:P,onChange:De,onKeyDown:ft,onMouseUp:ot,onFocus:ht,onBlur:st});if(n==="text")return o?Mn.createElement(Mn.Fragment,null,o(P,k)||null):Mn.createElement("span",Object.assign({},k,{ref:s}),P);if(r){var It=r;return Mn.createElement(It,Object.assign({},mt,{ref:s}))}return Mn.createElement("input",Object.assign({},mt,{ref:s}))}function uT(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=Am(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,y=L0(e,c),b=y.beforeDecimal,S=y.afterDecimal,j=y.addNegation;return n!==void 0&&(S=YA(S,n,!!r)),p&&(b=Y6(b,p,d)),o&&(b=o+b),s&&(S=S+s),j&&(b="-"+b),e=b+(g&&m||"")+S,e}function Am(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 lz(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 cz(e,t){return new RegExp("(^-)|[0-9]|"+WA(e),"g")}function uz(e,t,n){return e===""?!0:!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function dz(e,t,n){var r;t===void 0&&(t=tz(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=Am(n),b=y.allowedDecimalSeparators,S=y.decimalSeparator,j=e[g]===S;if(Ad(e)&&(e===s||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=d===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var R=function(L,U,V){var K=!1,O=!1;s.startsWith("-")?K=!1:L.startsWith("--")?(K=!1,O=!0):c.startsWith("-")&&L.length===c.length?K=!1:L[0]==="-"&&(K=!0);var F=K?1:0;return O&&(F=2),F&&(L=L.substring(F),U-=F,V-=F),{value:L,start:U,end:V,hasNegation:K}},E=R(e,m,g),T=E.hasNegation;r=E,e=r.value,m=r.start,g=r.end;var _=R(t.lastValue,f.start,f.end),k=_.start,I=_.end,A=_.value,P=e.substring(m,g);e.length&&A.length&&(k>A.length-c.length||I<s.length)&&!(P&&c.startsWith(P))&&(e=A);var z=0;e.startsWith(s)?z+=s.length:m<s.length&&(z=m),e=e.substring(z),g-=z;var B=e.length,Y=e.length-c.length;e.endsWith(c)?B=Y:(g>Y||g>e.length-c.length)&&(B=g),e=e.substring(0,B),e=lz(T?"-"+e:e,o),e=(e.match(cz(S))||[]).join("");var J=e.indexOf(S);e=e.replace(new RegExp(WA(S),"g"),function(L,U){return U===J?".":""});var Z=L0(e,o),$=Z.beforeDecimal,Q=Z.afterDecimal,M=Z.addNegation;return p.end-p.start<f.end-f.start&&$===""&&j&&!parseFloat(Q)&&(e=M?"-":""),e}function fz(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 hz(e){var t=Am(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(`
|
|
49
|
-
Decimal separator can't be same as thousand separator.
|
|
50
|
-
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
51
|
-
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
52
|
-
`);return o.startsWith("-")&&s&&(console.error(`
|
|
53
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
54
|
-
prefix: `+o+`
|
|
55
|
-
allowNegative: `+s+`
|
|
56
|
-
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function pz(e){e=hz(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=us);var s=e.onBlur;s===void 0&&(s=us);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,b=e.onValueChange,S=GA(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Am(e),C=j.decimalSeparator,R=j.allowedDecimalSeparators,E=function(M){return uT(M,e)},T=function(M,L){return dz(M,L,e)},_=Mc(g)?m:g,k=y??uz(_,p,t);Mc(g)?Mc(m)||(k=k||typeof m=="number"):k=k||typeof g=="number";var I=function(M){return QA(M)?M:(typeof M=="number"&&(M=KA(M)),k&&typeof d=="number"?lT(M,d,!!f):M)},A=JA(I(g),I(m),!!k,E,T,b),P=A[0],z=P.numAsString,B=P.formattedValue,Y=A[1],J=function(M){var L=M.target,U=M.key,V=L.selectionStart,K=L.selectionEnd,O=L.value;if(O===void 0&&(O=""),(U==="Backspace"||U==="Delete")&&K<p.length){M.preventDefault();return}if(V!==K){o(M);return}U==="Backspace"&&O[0]==="-"&&V===p.length+1&&n&&Zs(L,1),d&&f&&(U==="Backspace"&&O[V-1]===C?(Zs(L,V-1),M.preventDefault()):U==="Delete"&&O[V]===C&&M.preventDefault()),R?.includes(U)&&O[V]===C&&Zs(L,V+1);var F=c===!0?",":c;U==="Backspace"&&O[V-1]===F&&Zs(L,V-1),U==="Delete"&&O[V]===F&&Zs(L,V+1),o(M)},Z=function(M){var L=z;if(L.match(/\d/g)||(L=""),r||(L=X6(L)),f&&d&&(L=lT(L,d,f)),L!==z){var U=uT(L,e);Y({formattedValue:U,value:L,floatValue:parseFloat(L)},{event:M,source:_d.event})}s(M)},$=function(M){return M===C?!0:Ad(M)},Q=function(M){var L=M.currentValue,U=M.lastValue,V=M.formattedValue,K=M.currentValueIndex,O=M.formattedValueIndex,F=L[K],ae=V[O],ue=XA(U,L),be=ue.to,we=function(Ce){return T(Ce).indexOf(".")+p.length};return g===0&&f&&d&&L[be.start]===C&&we(L)<K&&we(V)>O?!1:K>=be.start&&K<be.end&&R&&R.includes(F)&&ae===C?!0:F===ae};return Object.assign(Object.assign({},S),{value:B,valueIsNumericString:!1,isValidInputCharacter:$,isCharacterSame:Q,onValueChange:Y,format:E,removeFormatting:T,getCaretBoundary:function(M){return fz(M,e)},onKeyDown:J,onBlur:Z})}function mz(e){var t=pz(e);return Mn.createElement(sz,Object.assign({},t))}function dT({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 Lx={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const gz=/^(0\.0*|-0(\.0*)?)$/,vz=/^-?0\d+(\.\d+)?\.?$/,yz=/\.\d*0$/;function Ix(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function Fy(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Ix(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function xz(e){return e.toString().replace(".","").length}function bz(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&xz(t)<14&&t!==""}function fT(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 Sz={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[".",","]},wz=(e,{size:t})=>({controls:{"--ni-chevron-size":it(t,"ni-chevron-size")}});function jz(e,t,n){const r=e.toString().replace(/^0+(?=\d)/,""),o=parseFloat(r);return Number.isNaN(o)?r:o>Number.MAX_SAFE_INTEGER?t!==void 0?t:r:vd(o,n,t)}const Hc=ge((e,t)=>{const n=ie("NumberInput",Sz,e),{className:r,classNames:o,styles:s,unstyled:c,vars:d,onChange:f,onValueChange:p,value:m,defaultValue:g,max:y,min:b,step:S,hideControls:j,rightSection:C,isAllowed:R,clampBehavior:E,onBlur:T,allowDecimal:_,decimalScale:k,onKeyDown:I,onKeyDownCapture:A,handlersRef:P,startValue:z,disabled:B,rightSectionPointerEvents:Y,allowNegative:J,readOnly:Z,size:$,rightSectionWidth:Q,stepHoldInterval:M,stepHoldDelay:L,allowLeadingZeros:U,withKeyboardEvents:V,trimLeadingZeroesOnBlur:K,allowedDecimalSeparators:O,attributes:F,...ae}=n,ue=Le({name:"NumberInput",classes:Lx,props:n,classNames:o,styles:s,unstyled:c,attributes:F,vars:d,varsResolver:wz}),{resolvedClassNames:be,resolvedStyles:we}=Cl({classNames:o,styles:s,props:n}),[Ce,nt]=rr({value:m,defaultValue:g,finalValue:"",onChange:f}),De=L!==void 0&&M!==void 0,ft=v.useRef(null),ot=v.useRef(null),ht=v.useRef(0),st=(je,Ae)=>{Ae.source==="event"&&nt(bz(je.floatValue,je.value)&&!gz.test(je.value)&&!(U&&vz.test(je.value))&&!yz.test(je.value)?je.floatValue:je.value),p?.(je,Ae)},yt=je=>{const Ae=String(je).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Ae?Math.max(0,(Ae[1]?Ae[1].length:0)-(Ae[2]?+Ae[2]:0)):0},mt=je=>{ft.current&&typeof je<"u"&&ft.current.setSelectionRange(je,je)},It=v.useRef(xp);It.current=()=>{if(!Fy(Ce))return;let je;const Ae=yt(Ce),_t=yt(S),Zn=Math.max(Ae,_t),vn=10**Zn;if(!Ix(Ce)&&(typeof Ce!="number"||Number.isNaN(Ce)))je=vd(z,b,y);else if(y!==void 0){const yn=(Math.round(Number(Ce)*vn)+Math.round(S*vn))/vn;je=yn<=y?yn:y}else je=(Math.round(Number(Ce)*vn)+Math.round(S*vn))/vn;const Pn=je.toFixed(Zn);nt(parseFloat(Pn)),p?.({floatValue:parseFloat(Pn),formattedValue:Pn,value:Pn},{source:"increment"}),setTimeout(()=>mt(ft.current?.value.length),0)};const Te=v.useRef(xp);Te.current=()=>{if(!Fy(Ce))return;let je;const Ae=b!==void 0?b:J?Number.MIN_SAFE_INTEGER:0,_t=yt(Ce),Zn=yt(S),vn=Math.max(_t,Zn),Pn=10**vn;if(!Ix(Ce)&&typeof Ce!="number"||Number.isNaN(Ce))je=vd(z,Ae,y);else{const En=(Math.round(Number(Ce)*Pn)-Math.round(S*Pn))/Pn;je=Ae!==void 0&&En<Ae?Ae:En}const yn=je.toFixed(vn);nt(parseFloat(yn)),p?.({floatValue:parseFloat(yn),formattedValue:yn,value:yn},{source:"decrement"}),setTimeout(()=>mt(ft.current?.value.length),0)};const Re=je=>{I?.(je),!(Z||!V)&&(je.key==="ArrowUp"&&(je.preventDefault(),It.current?.()),je.key==="ArrowDown"&&(je.preventDefault(),Te.current?.()))},Ie=je=>{if(A?.(je),je.key==="Backspace"){const Ae=ft.current;Ae&&Ae.selectionStart===0&&Ae.selectionStart===Ae.selectionEnd&&(je.preventDefault(),window.setTimeout(()=>mt(0),0))}},Oe=je=>{let Ae=Ce;E==="blur"&&typeof Ae=="number"&&(Ae=vd(Ae,b,y)),K&&typeof Ae=="string"&&yt(Ae)<15&&(Ae=jz(Ae,y,b)),Ce!==Ae&&nt(Ae),T?.(je)};wd(P,{increment:It.current,decrement:Te.current});const ct=je=>{je?It.current?.():Te.current?.(),ht.current+=1},tt=je=>{if(ct(je),De){const Ae=typeof M=="number"?M:M(ht.current);ot.current=window.setTimeout(()=>tt(je),Ae)}},lt=(je,Ae)=>{je.preventDefault(),ft.current?.focus(),ct(Ae),De&&(ot.current=window.setTimeout(()=>tt(Ae),L))},pe=()=>{ot.current&&window.clearTimeout(ot.current),ot.current=null,ht.current=0},qe=a.jsxs("div",{...ue("controls"),children:[a.jsx(An,{...ue("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof Ce=="number"&&y!==void 0&&Ce>=y,mod:{direction:"up"},onMouseDown:je=>je.preventDefault(),onPointerDown:je=>{lt(je,!0)},onPointerUp:pe,onPointerLeave:pe,children:a.jsx(dT,{direction:"up"})}),a.jsx(An,{...ue("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof Ce=="number"&&b!==void 0&&Ce<=b,mod:{direction:"down"},onMouseDown:je=>je.preventDefault(),onPointerDown:je=>{lt(je,!1)},onPointerUp:pe,onPointerLeave:pe,children:a.jsx(dT,{direction:"down"})})]});return a.jsx($r,{component:mz,allowNegative:J,className:Ut(Lx.root,r),size:$,inputMode:"decimal",...ae,readOnly:Z,disabled:B,value:Ce,getInputRef:Bn(t,ft),onValueChange:st,rightSection:j||Z||!Fy(Ce)?C:C||qe,classNames:be,styles:we,unstyled:c,__staticSelector:"NumberInput",decimalScale:_?k:0,onKeyDown:Re,onKeyDownCapture:Ie,rightSectionPointerEvents:Y??(B?"none":void 0),rightSectionWidth:Q??`var(--ni-right-section-width-${$||"sm"})`,allowLeadingZeros:U,allowedDecimalSeparators:O,onBlur:Oe,attributes:F,isAllowed:je=>E==="strict"?R?R(je)&&fT(je.floatValue,b,y):fT(je.floatValue,b,y):R?R(je):!0})});Hc.classes={...$r.classes,...Lx};Hc.displayName="@mantine/core/NumberInput";const[Cz,Dm]=jr("Pagination.Root component was not found in tree");var ef={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const Ez={withPadding:!0},tf=ge((e,t)=>{const n=ie("PaginationControl",Ez,e),{classNames:r,className:o,style:s,styles:c,vars:d,active:f,disabled:p,withPadding:m,mod:g,...y}=n,b=Dm(),S=p||b.disabled;return a.jsx(An,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...b.getStyles("control",{className:o,style:s,classNames:r,styles:c,active:!S}),...y})});tf.classes=ef;tf.displayName="@mantine/core/PaginationControl";function nf({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 Tz=e=>a.jsx(nf,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),Rz=e=>a.jsx(nf,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),_z=e=>a.jsx(nf,{...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"}),Az=e=>a.jsx(nf,{...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"}),Dz=e=>a.jsx(nf,{...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"}),kz={icon:Dz},km=ge((e,t)=>{const n=ie("PaginationDots",kz,e),{classNames:r,className:o,style:s,styles:c,vars:d,icon:f,...p}=n,m=Dm();return a.jsx(ce,{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)"}})})});km.classes=ef;km.displayName="@mantine/core/PaginationDots";function Pm({icon:e,name:t,action:n,type:r}){const o={icon:e},s=v.forwardRef((c,d)=>{const{icon:f,...p}=ie(t,o,c),m=Dm(),g=r==="next"?m.active===m.total:m.active===1;return a.jsx(tf,{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 ZA=Pm({icon:Tz,name:"PaginationNext",action:"onNext",type:"next"}),eD=Pm({icon:Rz,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),tD=Pm({icon:_z,name:"PaginationFirst",action:"onFirst",type:"previous"}),nD=Pm({icon:Az,name:"PaginationLast",action:"onLast",type:"next"});function I0({dotsIcon:e}){const t=Dm(),n=t.range.map((r,o)=>r==="dots"?a.jsx(km,{icon:e},o):a.jsx(tf,{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})}I0.displayName="@mantine/core/PaginationItems";const Pz={siblings:1,boundaries:1},Nz=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:Ft(n),"--pagination-control-size":it(t,"pagination-control-size"),"--pagination-control-fz":Qn(t),"--pagination-active-bg":r?Wt(r,e):void 0,"--pagination-active-color":El(o,e)?wa({color:r,theme:e,autoContrast:o}):void 0}}),Nm=ge((e,t)=>{const n=ie("PaginationRoot",Pz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,total:p,value:m,defaultValue:g,onChange:y,disabled:b,siblings:S,boundaries:j,color:C,radius:R,onNextPage:E,onPreviousPage:T,onFirstPage:_,onLastPage:k,getItemProps:I,autoContrast:A,attributes:P,...z}=n,B=Le({name:"Pagination",classes:ef,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:P,vars:f,varsResolver:Nz}),{range:Y,setPage:J,next:Z,previous:$,active:Q,first:M,last:L}=l4({page:m,initialPage:g,onChange:y,total:p,siblings:S,boundaries:j}),U=ar(E,Z),V=ar(T,$),K=ar(_,M),O=ar(k,L);return a.jsx(Cz,{value:{total:p,range:Y,active:Q,disabled:b,getItemProps:I,onChange:J,onNext:U,onPrevious:V,onFirst:K,onLast:O,getStyles:B},children:a.jsx(ce,{ref:t,...B("root"),...z})})});Nm.classes=ef;Nm.displayName="@mantine/core/PaginationRoot";const Oz={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},zi=ge((e,t)=>{const n=ie("Pagination",Oz,e),{withEdges:r,withControls:o,getControlProps:s,nextIcon:c,previousIcon:d,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:y,hideWithOnePage:b,withPages:S,...j}=n;return g<=0||b&&g===1?null:a.jsx(Nm,{ref:t,total:g,...j,children:a.jsxs(ye,{gap:y,children:[r&&a.jsx(tD,{icon:p,...s?.("first")}),o&&a.jsx(eD,{icon:d,...s?.("previous")}),S&&a.jsx(I0,{dotsIcon:m}),o&&a.jsx(ZA,{icon:c,...s?.("next")}),r&&a.jsx(nD,{icon:f,...s?.("last")})]})})});zi.classes=ef;zi.displayName="@mantine/core/Pagination";zi.Root=Nm;zi.Control=tf;zi.Dots=km;zi.First=tD;zi.Last=nD;zi.Next=ZA;zi.Previous=eD;zi.Items=I0;const Mz=({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 zx={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const Lz={visibilityToggleIcon:Mz},Iz=(e,{size:t})=>({root:{"--psi-icon-size":it(t,"psi-icon-size"),"--psi-button-size":it(t,"psi-button-size")}}),Ki=ge((e,t)=>{const n=ie("PasswordInput",Lz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,required:p,error:m,leftSection:g,disabled:y,id:b,variant:S,inputContainer:j,description:C,label:R,size:E,errorProps:T,descriptionProps:_,labelProps:k,withAsterisk:I,inputWrapperOrder:A,wrapperProps:P,radius:z,rightSection:B,rightSectionWidth:Y,rightSectionPointerEvents:J,leftSectionWidth:Z,visible:$,defaultVisible:Q,onVisibilityChange:M,visibilityToggleIcon:L,visibilityToggleButtonProps:U,rightSectionProps:V,leftSectionProps:K,leftSectionPointerEvents:O,withErrorStyles:F,mod:ae,attributes:ue,...be}=n,we=mr(b),[Ce,nt]=rr({value:$,defaultValue:Q,finalValue:!1,onChange:M}),De=()=>nt(!Ce),ft=Le({name:"PasswordInput",classes:zx,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:ue,vars:f,varsResolver:Iz}),{resolvedClassNames:ot,resolvedStyles:ht}=Cl({classNames:r,styles:c,props:n}),{styleProps:st,rest:yt}=ja(be),mt=T?.id||`${we}-error`,It=_?.id||`${we}-description`,Ie=`${!!m&&typeof m!="boolean"?mt:""} ${!!C?It:""}`,Oe=Ie.trim().length>0?Ie.trim():void 0,ct=a.jsx(Dn,{...ft("visibilityToggle"),disabled:y,radius:z,"aria-hidden":!U,"aria-pressed":Ce,tabIndex:-1,...U,variant:U?.variant??"subtle",color:"gray",unstyled:d,onTouchEnd:tt=>{tt.preventDefault(),U?.onTouchEnd?.(tt),De()},onMouseDown:tt=>{tt.preventDefault(),U?.onMouseDown?.(tt),De()},onKeyDown:tt=>{U?.onKeyDown?.(tt),tt.key===" "&&(tt.preventDefault(),De())},children:a.jsx(L,{reveal:Ce})});return a.jsx(hn.Wrapper,{required:p,id:we,label:R,error:m,description:C,size:E,classNames:ot,styles:ht,__staticSelector:"PasswordInput",unstyled:d,withAsterisk:I,inputWrapperOrder:A,inputContainer:j,variant:S,labelProps:{...k,htmlFor:we},descriptionProps:{..._,id:It},errorProps:{...T,id:mt},mod:ae,attributes:ue,...ft("root"),...st,...P,children:a.jsx(hn,{component:"div",error:m,leftSection:g,size:E,classNames:{...ot,input:Ut(zx.input,ot.input)},styles:ht,radius:z,disabled:y,__staticSelector:"PasswordInput",rightSectionWidth:Y,rightSection:B??ct,variant:S,unstyled:d,leftSectionWidth:Z,rightSectionPointerEvents:J||"all",rightSectionProps:V,leftSectionProps:K,leftSectionPointerEvents:O,withAria:!1,withErrorStyles:F,attributes:ue,children:a.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...ft("innerInput"),disabled:y,id:we,ref:t,...yt,"aria-describedby":Oe,autoComplete:yt.autoComplete||"off",type:Ce?"text":"password"})})})});Ki.classes={...$r.classes,...zx};Ki.displayName="@mantine/core/PasswordInput";const[zz,rD]=Io(),[$z,Uz]=Io();var iD={card:"m_9dc8ae12"};const Bz={withBorder:!0},Vz=(e,{radius:t})=>({card:{"--card-radius":Ft(t)}}),z0=ge((e,t)=>{const n=ie("RadioCard",Bz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:b,name:S,onKeyDown:j,attributes:C,...R}=n,E=Le({name:"RadioCard",classes:iD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:Vz,rootSelector:"card"}),{dir:T}=ws(),_=rD(),k=typeof p=="boolean"?p:_?.value===y||!1,I=S||_?.name,A=P=>{if(j?.(P),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(P.nativeEvent.code)){P.preventDefault();const z=Array.from(document.querySelectorAll(`[role="radio"][name="${I||"__mantine"}"]`)),B=z.findIndex(Z=>Z===P.target),Y=B+1>=z.length?0:B+1,J=B-1<0?z.length-1:B-1;P.nativeEvent.code==="ArrowDown"&&(z[Y].focus(),z[Y].click()),P.nativeEvent.code==="ArrowUp"&&(z[J].focus(),z[J].click()),P.nativeEvent.code==="ArrowLeft"&&(z[T==="ltr"?J:Y].focus(),z[T==="ltr"?J:Y].click()),P.nativeEvent.code==="ArrowRight"&&(z[T==="ltr"?Y:J].focus(),z[T==="ltr"?Y:J].click())}};return a.jsx($z,{value:{checked:k},children:a.jsx(An,{ref:t,mod:[{"with-border":g,checked:k},m],...E("card"),...R,role:"radio","aria-checked":k,name:I,onClick:P=>{b?.(P),_?.onChange(y||"")},onKeyDown:A})})});z0.displayName="@mantine/core/RadioCard";z0.classes=iD;const $0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,name:f,readOnly:p,disabled:m,...g}=ie("RadioGroup",null,e),y=mr(f),[b,S]=rr({value:n,defaultValue:r,finalValue:"",onChange:o}),j=C=>!p&&S(typeof C=="string"?C:C.currentTarget.value);return a.jsx(zz,{value:{value:b,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(c0,{role:"radiogroup",children:d})})})});$0.classes=hn.Wrapper.classes;$0.displayName="@mantine/core/RadioGroup";function oD({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:le(e),height:le(e),...t},"aria-hidden":!0,...n,children:a.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var aD={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const Fz={icon:oD},Hz=(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":it(r,"radio-size"),"--radio-radius":t===void 0?void 0:Ft(t),"--radio-color":s==="outline"?f:Wt(n,e),"--radio-icon-size":it(r,"radio-icon-size"),"--radio-icon-color":o?Wt(o,e):El(c,e)?wa({color:n,theme:e,autoContrast:c}):void 0}}},U0=ge((e,t)=>{const n=ie("RadioIndicator",Fz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,icon:p,radius:m,color:g,iconColor:y,autoContrast:b,checked:S,mod:j,variant:C,disabled:R,attributes:E,...T}=n,_=Le({name:"RadioIndicator",classes:aD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:E,vars:f,varsResolver:Hz,rootSelector:"indicator"}),k=Uz(),I=typeof S=="boolean"?S:k?.checked||!1;return a.jsx(ce,{ref:t,..._("indicator",{variant:C}),variant:C,mod:[{checked:I,disabled:R},j],...T,children:a.jsx(p,{..._("icon")})})});U0.displayName="@mantine/core/RadioIndicator";U0.classes=aD;var sD={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const qz={labelPosition:"right"},Gz=(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":it(t,"radio-size"),"--radio-radius":n===void 0?void 0:Ft(n),"--radio-color":s==="outline"?f:Wt(r,e),"--radio-icon-color":o?Wt(o,e):El(c,e)?wa({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":it(t,"radio-icon-size")}}},vr=ge((e,t)=>{const n=ie("Radio",qz,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,id:p,size:m,label:g,labelPosition:y,description:b,error:S,radius:j,color:C,variant:R,disabled:E,wrapperProps:T,icon:_=oD,rootRef:k,iconColor:I,onChange:A,mod:P,attributes:z,checked:B,...Y}=n,J=Le({name:"Radio",classes:sD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:z,vars:f,varsResolver:Gz}),Z=rD(),$=Z?.size??m,Q=n.size?m:$,{styleProps:M,rest:L}=ja(Y),U=mr(p),V=Z?Z.value===L.value:void 0,K={checked:V??B,name:Z?.name??L.name,onChange:O=>{Z?.onChange(O),A?.(O)},disabled:Z?.disabled??E};return a.jsx(mm,{...J("root"),__staticSelector:"Radio",__stylesApiProps:n,id:U,size:Q,labelPosition:y,label:g,description:b,error:S,disabled:K.disabled,classNames:r,styles:c,unstyled:d,"data-checked":(V??B)||void 0,variant:R,ref:k,mod:P,...M,...T,children:a.jsxs(ce,{...J("inner"),mod:{"label-position":y},children:[a.jsx(ce,{...J("radio",{focusable:!0,variant:R}),...L,...K,component:"input",mod:{error:!!S},ref:t,id:U,type:"radio"}),a.jsx(_,{...J("icon"),"aria-hidden":!0})]})})});vr.classes=sD;vr.displayName="@mantine/core/Radio";vr.Group=$0;vr.Card=z0;vr.Indicator=U0;const Qz={duration:100,transition:"fade"};function hT(e,t){return{...Qz,...t,...e}}function Wz({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}=zb({placement:t,middleware:[Ob({crossAxis:!0,padding:5,rootBoundary:"document"})]}),y=g.includes("right")?e:t.includes("left")?e*-1:0,b=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+b,right:j,bottom:C}}})},[f.reference]);return v.useEffect(()=>{if(p.floating.current){const j=s.current;j.addEventListener("mousemove",S);const C=ma(p.floating.current);return C.forEach(R=>{R.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(R=>{R.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:d,opened:r,setOpened:o,boundaryRef:s,floating:p.setFloating}}var Om={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const Yz={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:zr("popover")},Kz=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ft(t),"--tooltip-bg":n?Wt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),B0=ge((e,t)=>{const n=ie("TooltipFloating",Yz,e),{children:r,refProp:o,withinPortal:s,style:c,className:d,classNames:f,styles:p,unstyled:m,radius:g,color:y,label:b,offset:S,position:j,multiline:C,zIndex:R,disabled:E,defaultOpened:T,variant:_,vars:k,portalProps:I,attributes:A,...P}=n,z=gn(),B=Le({name:"TooltipFloating",props:n,classes:Om,className:d,style:c,classNames:f,styles:p,unstyled:m,attributes:A,rootSelector:"tooltip",vars:k,varsResolver:Kz}),{handleMouseMove:Y,x:J,y:Z,opened:$,boundaryRef:Q,floating:M,setOpened:L}=Wz({offset:S,position:j,defaultOpened:T});if(!Lo(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const U=Bn(Q,em(r),t),V=r.props,K=F=>{V.onMouseEnter?.(F),Y(F),L(!0)},O=F=>{V.onMouseLeave?.(F),L(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(va,{...I,withinPortal:s,children:a.jsx(ce,{...P,...B("tooltip",{style:{...J2(c,z),zIndex:R,display:!E&&$?"block":"none",top:(Z&&Math.round(Z))??"",left:(J&&Math.round(J))??""}}),variant:_,ref:M,mod:{multiline:C},children:b})}),v.cloneElement(r,{...V,[o]:U,onMouseEnter:K,onMouseLeave:O})]})});B0.classes=Om;B0.displayName="@mantine/core/TooltipFloating";const lD=v.createContext(!1),Xz=lD.Provider,Jz=()=>v.useContext(lD),Zz={openDelay:0,closeDelay:0};function V0(e){const{openDelay:t,closeDelay:n,children:r}=ie("TooltipGroup",Zz,e);return a.jsx(Xz,{value:!0,children:a.jsx(hL,{delay:{open:t,close:n},children:r})})}V0.displayName="@mantine/core/TooltipGroup";V0.extend=e=>e;function e$(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 t$(e){const t=e$(e.middlewares),n=[m_(e.offset)];return t.shift&&n.push(Ob(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Cp():Cp(t.flip)),n.push(g_({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?yd():yd(t.inline)):e.inline&&n.push(yd()),n}function n$(e){const[t,n]=v.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,s=Jz(),c=mr(),d=v.useCallback(k=>{n(k),k&&R(c)},[c]),{x:f,y:p,context:m,refs:g,placement:y,middlewareData:{arrow:{x:b,y:S}={}}}=zb({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:t$(e),whileElementsMounted:kx}),{delay:j,currentId:C,setCurrentId:R}=pL(m,{id:c}),{getReferenceProps:E,getFloatingProps:T}=bL([dL(m,{enabled:e.events?.hover,delay:s?j:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),xL(m,{enabled:e.events?.focus,visibleOnly:!0}),wL(m,{role:"tooltip"}),vL(m,{enabled:typeof e.opened>"u"})]);gs(()=>{e.onPositionChange?.(y)},[y]);const _=o&&C&&C!==c;return{x:f,y:p,arrowX:b,arrowY:S,reference:g.setReference,floating:g.setFloating,getFloatingProps:T,getReferenceProps:E,isGroupPhase:_,opened:o,placement:y}}const pT={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:Ft(t),"--tooltip-bg":n?s.background:void 0,"--tooltip-color":n?s.color:void 0}}},to=ge((e,t)=>{const n=ie("Tooltip",pT,e),{children:r,position:o,refProp:s,label:c,openDelay:d,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:y,radius:b,color:S,classNames:j,styles:C,unstyled:R,style:E,className:T,withArrow:_,arrowSize:k,arrowOffset:I,arrowRadius:A,arrowPosition:P,offset:z,transitionProps:B,multiline:Y,events:J,zIndex:Z,disabled:$,positionDependencies:Q,onClick:M,onMouseEnter:L,onMouseLeave:U,inline:V,variant:K,keepMounted:O,vars:F,portalProps:ae,mod:ue,floatingStrategy:be,middlewares:we,autoContrast:Ce,attributes:nt,target:De,...ft}=ie("Tooltip",pT,n),{dir:ot}=ws(),ht=v.useRef(null),st=n$({position:M_(ot,o),closeDelay:f,openDelay:d,onPositionChange:p,opened:m,defaultOpened:g,events:J,arrowRef:ht,arrowOffset:I,offset:typeof z=="number"?z+(_?k/2:0):z,positionDependencies:[...Q,De??r],inline:V,strategy:be,middlewares:we});v.useEffect(()=>{const Ie=De instanceof HTMLElement?De:typeof De=="string"?document.querySelector(De):De?.current||null;Ie&&st.reference(Ie)},[De,st]);const yt=Le({name:"Tooltip",props:n,classes:Om,className:T,style:E,classNames:j,styles:C,unstyled:R,attributes:nt,rootSelector:"tooltip",vars:F,varsResolver:r$});if(!De&&!Lo(r))return null;if(De){const Ie=hT(B,{duration:100,transition:"fade"});return a.jsx(a.Fragment,{children:a.jsx(va,{...ae,withinPortal:y,children:a.jsx(Zi,{...Ie,keepMounted:O,mounted:!$&&!!st.opened,duration:st.isGroupPhase?10:Ie.duration,children:Oe=>a.jsxs(ce,{...ft,"data-fixed":be==="fixed"||void 0,variant:K,mod:[{multiline:Y},ue],...st.getFloatingProps({ref:st.floating,className:yt("tooltip").className,style:{...yt("tooltip").style,...Oe,zIndex:Z,top:st.y??0,left:st.x??0}}),children:[c,a.jsx(Ep,{ref:ht,arrowX:st.arrowX,arrowY:st.arrowY,visible:_,position:st.placement,arrowSize:k,arrowOffset:I,arrowRadius:A,arrowPosition:P,...yt("arrow")})]})})})})}const mt=r,It=mt.props,Te=Bn(st.reference,em(mt),t),Re=hT(B,{duration:100,transition:"fade"});return a.jsxs(a.Fragment,{children:[a.jsx(va,{...ae,withinPortal:y,children:a.jsx(Zi,{...Re,keepMounted:O,mounted:!$&&!!st.opened,duration:st.isGroupPhase?10:Re.duration,children:Ie=>a.jsxs(ce,{...ft,"data-fixed":be==="fixed"||void 0,variant:K,mod:[{multiline:Y},ue],...st.getFloatingProps({ref:st.floating,className:yt("tooltip").className,style:{...yt("tooltip").style,...Ie,zIndex:Z,top:st.y??0,left:st.x??0}}),children:[c,a.jsx(Ep,{ref:ht,arrowX:st.arrowX,arrowY:st.arrowY,visible:_,position:st.placement,arrowSize:k,arrowOffset:I,arrowRadius:A,arrowPosition:P,...yt("arrow")})]})})}),v.cloneElement(mt,st.getReferenceProps({onClick:M,onMouseEnter:L,onMouseLeave:U,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:Ut(T,It.className),...It,[s]:Te}))]})});to.classes=Om;to.displayName="@mantine/core/Tooltip";to.Floating=B0;to.Group=V0;function i$({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 cD({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=gn();return a.jsx(to.Floating,{disabled:!f,label:f,children:a.jsx(ce,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Wt(c,y):void 0},fill:"none",strokeLinecap:d?"round":"butt",...i$({sum:r,size:e,thickness:o,value:t,offset:n,root:s})})})}cD.displayName="@mantine/core/Curve";function o$({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 uD={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 s$={size:120,thickness:12},l$=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":le(t),"--rp-label-offset":le(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Mm=ge((e,t)=>{const n=ie("RingProgress",s$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,label:p,sections:m,size:g,thickness:y,roundCaps:b,rootColor:S,transitionDuration:j,attributes:C,...R}=n,E=Le({name:"RingProgress",classes:uD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:l$}),T=a$(y,g),_=o$({size:g,thickness:T,sections:m,renderRoundedLineCaps:b,rootColor:S}).map(({data:k,sum:I,root:A,lineRoundCaps:P,offset:z},B)=>v.createElement(cD,{...k,key:B,size:g,thickness:T,sum:I,offset:z,color:k?.color,root:A,lineRoundCaps:P,getStyles:E}));return a.jsxs(ce,{...E("root"),size:g,ref:t,...R,children:[a.jsx("svg",{...E("svg"),children:_}),p&&a.jsx("div",{...E("label"),children:p})]})});Mm.classes=uD;Mm.displayName="@mantine/core/RingProgress";var dD={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const c$={withItemsBorders:!0},u$=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:s})=>({root:{"--sc-radius":t===void 0?void 0:Ft(t),"--sc-color":n?Wt(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":s,"--sc-padding":it(o,"sc-padding"),"--sc-font-size":Qn(o)}}),qc=ge((e,t)=>{const n=ie("SegmentedControl",c$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,data:p,value:m,defaultValue:g,onChange:y,size:b,name:S,disabled:j,readOnly:C,fullWidth:R,orientation:E,radius:T,color:_,transitionDuration:k,transitionTimingFunction:I,variant:A,autoContrast:P,withItemsBorders:z,mod:B,attributes:Y,...J}=n,Z=Le({name:"SegmentedControl",props:n,classes:dD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:Y,vars:f,varsResolver:u$}),$=gn(),Q=p.map(De=>typeof De=="string"?{label:De,value:De}:De),M=b4(),[L,U]=v.useState(bp()),[V,K]=v.useState(null),[O,F]=v.useState({}),ae=(De,ft)=>{O[ft]=De,F(O)},[ue,be]=rr({value:m,defaultValue:g,finalValue:Array.isArray(p)?Q.find(De=>!De.disabled)?.value??p[0]?.value??null:null,onChange:y}),we=mr(S),Ce=Q.map(De=>v.createElement(ce,{...Z("control"),mod:{active:ue===De.value,orientation:E},key:De.value},v.createElement("input",{...Z("input"),disabled:j||De.disabled,type:"radio",name:we,value:De.value,id:`${we}-${De.value}`,checked:ue===De.value,onChange:()=>!C&&be(De.value),"data-focus-ring":$.focusRing,key:`${De.value}-input`}),v.createElement(ce,{component:"label",...Z("label"),mod:{active:ue===De.value&&!(j||De.disabled),disabled:j||De.disabled,"read-only":C},htmlFor:`${we}-${De.value}`,ref:ft=>ae(ft,De.value),__vars:{"--sc-label-color":_!==void 0?wa({color:_,theme:$,autoContrast:P}):void 0},key:`${De.value}-label`},a.jsx("span",{...Z("innerLabel"),children:De.label})))),nt=Bn(t,De=>K(De));return d4(()=>{U(bp())},[p.length]),p.length===0?null:a.jsxs(ce,{...Z("root"),variant:A,size:b,ref:nt,mod:[{"full-width":R,orientation:E,initialized:M,"with-items-borders":z},B],...J,role:"radiogroup","data-disabled":j,children:[typeof ue=="string"&&a.jsx(Gb,{target:O[ue],parent:V,component:"span",transitionDuration:"var(--sc-transition-duration)",...Z("indicator")},L),Ce]})});qc.classes=dD;qc.displayName="@mantine/core/SegmentedControl";function d$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=gn(),s=t===void 0?e:t,c=Ss({"--sg-spacing-x":Gn(Qi(e)),"--sg-spacing-y":Gn(Qi(s)),"--sg-cols":Qi(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=Sd(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(Tl,{styles:c,media:p,selector:r})}function Hy(e){return typeof e=="object"&&e!==null?dn(e):[]}function f$(e){return e.sort((t,n)=>bd(t)-bd(n))}function h$({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Hy(e),...Hy(t),...Hy(n)]));return f$(r)}function p$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=t===void 0?e:t,s=Ss({"--sg-spacing-x":Gn(Qi(e)),"--sg-spacing-y":Gn(Qi(o)),"--sg-cols":Qi(n)?.toString()}),c=h$({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(Tl,{styles:s,container:f,selector:r})}var fD={container:"m_925c2d2c",root:"m_2415a157"};const m$={cols:1,spacing:"md",type:"media"},Lm=ge((e,t)=>{const n=ie("SimpleGrid",m$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,cols:p,verticalSpacing:m,spacing:g,type:y,attributes:b,...S}=n,j=Le({name:"SimpleGrid",classes:fD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,vars:f}),C=Hd();return y==="container"?a.jsxs(a.Fragment,{children:[a.jsx(p$,{...n,selector:`.${C}`}),a.jsx("div",{...j("container"),children:a.jsx(ce,{ref:t,...j("root",{className:C}),...S})})]}):a.jsxs(a.Fragment,{children:[a.jsx(d$,{...n,selector:`.${C}`}),a.jsx(ce,{ref:t,...j("root",{className:C}),...S})]})});Lm.classes=fD;Lm.displayName="@mantine/core/SimpleGrid";const Im=ge((e,t)=>{const{w:n,h:r,miw:o,mih:s,...c}=ie("Space",null,e);return a.jsx(ce,{ref:t,...c,w:n,miw:o??n,h:r,mih:s??r})});Im.displayName="@mantine/core/Space";var hD={root:"m_6d731127"};const g$={gap:"md",align:"stretch",justify:"flex-start"},v$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Gn(t),"--stack-align":n,"--stack-justify":r}}),Ue=ge((e,t)=>{const n=ie("Stack",g$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,align:p,justify:m,gap:g,variant:y,attributes:b,...S}=n,j=Le({name:"Stack",props:n,classes:hD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:v$});return a.jsx(ce,{ref:t,...j("root"),variant:y,...S})});Ue.classes=hD;Ue.displayName="@mantine/core/Stack";const[y$,x$]=jr("Stepper component was not found in tree"),Rp=()=>null;Rp.displayName="@mantine/core/StepperCompleted";var F0={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 Gh=(e,t)=>typeof e=="function"?a.jsx(e,{step:t||0}):e,b$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},H0=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:b,description:S,withIcon:j,iconSize:C,loading:R,allowStepClick:E,allowStepSelect:T,iconPosition:_,orientation:k,mod:I,...A}=ie("StepperStep",b$,e),P=x$(),z=gn(),B={classNames:n,styles:s},Y=f==="stepCompleted"?null:f==="stepProgress"?y:m,J={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return a.jsxs(An,{...P.getStyles("step",{className:r,style:o,variant:P.orientation,...B}),mod:[{"icon-position":_||P.iconPosition,"allow-click":E},I],ref:t,...J,...A,__vars:{"--step-color":p?Wt(p,z):void 0},tabIndex:E?0:-1,children:[j&&a.jsxs("span",{...P.getStyles("stepWrapper",B),children:[a.jsxs("span",{...P.getStyles("stepIcon",B),...J,children:[a.jsx(Zi,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:Z=>a.jsx("span",{...P.getStyles("stepCompletedIcon",{style:Z,...B}),children:R?a.jsx(Ir,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...P.getStyles("stepLoader",B)}):Gh(g,d)||a.jsx(Xd,{size:"60%"})})}),f!=="stepCompleted"?R?a.jsx(Ir,{...P.getStyles("stepLoader",B),size:"calc(var(--stepper-icon-size) / 2)",color:p}):Gh(Y||m,d):null]}),k==="vertical"&&a.jsx("span",{...P.getStyles("verticalSeparator",B),"data-active":f==="stepCompleted"||void 0})]}),(b||S)&&a.jsxs("span",{...P.getStyles("stepBody",B),"data-orientation":P.orientation,"data-icon-position":_||P.iconPosition,children:[b&&a.jsx("span",{...P.getStyles("stepLabel",B),children:Gh(b,d)}),S&&a.jsx("span",{...P.getStyles("stepDescription",B),children:Gh(S,d)})]})]})});H0.classes=F0;H0.displayName="@mantine/core/StepperStep";const S$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},w$=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:s,autoContrast:c})=>({root:{"--stepper-color":t?Wt(t,e):void 0,"--stepper-icon-color":El(c,e)?wa({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?it(r,"stepper-icon-size"):le(n),"--stepper-content-padding":Gn(o),"--stepper-radius":s===void 0?void 0:Ft(s),"--stepper-fz":Qn(r),"--stepper-spacing":Gn(r)}}),Gc=ge((e,t)=>{const n=ie("Stepper",S$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,onStepClick:m,active:g,icon:y,completedIcon:b,progressIcon:S,color:j,iconSize:C,contentPadding:R,orientation:E,iconPosition:T,size:_,radius:k,allowNextStepsSelect:I,wrap:A,autoContrast:P,attributes:z,...B}=n,Y=Le({name:"Stepper",classes:F0,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:z,vars:f,varsResolver:w$}),J=v.Children.toArray(p),Z=J.filter(V=>V.type!==Rp),$=J.find(V=>V.type===Rp),Q=Z.reduce((V,K,O)=>{const F=g===O?"stepProgress":g>O?"stepCompleted":"stepInactive",ue=typeof m!="function"?!1:typeof K.props.allowStepSelect=="boolean"?K.props.allowStepSelect:F==="stepCompleted"||I;return V.push(v.cloneElement(K,{icon:K.props.icon||y||O+1,key:O,step:O,state:F,onClick:()=>ue&&m?.(O),allowStepClick:ue,completedIcon:K.props.completedIcon||b,progressIcon:K.props.progressIcon||S,color:K.props.color||j,iconSize:C,iconPosition:K.props.iconPosition||T,orientation:E})),E==="horizontal"&&O!==Z.length-1&&V.push(v.createElement("div",{...Y("separator"),"data-active":O<g||void 0,"data-orientation":E,key:`separator-${O}`})),V},[]),M=Z[g]?.props?.children,L=$?.props?.children,U=g>Z.length-1?L:M;return a.jsx(y$,{value:{getStyles:Y,orientation:E,iconPosition:T},children:a.jsxs(ce,{...Y("root"),ref:t,size:_,...B,children:[a.jsx(ce,{...Y("steps"),mod:{orientation:E,"icon-position":T,wrap:A&&E!=="vertical"},children:Q}),U&&a.jsx("div",{...Y("content"),children:U})]})})});Gc.classes=F0;Gc.displayName="@mantine/core/Stepper";Gc.Completed=Rp;Gc.Step=H0;const pD=v.createContext(null),j$=pD.Provider,C$=()=>v.useContext(pD),q0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:s,wrapperProps:c,children:d,readOnly:f,disabled:p,...m}=ie("SwitchGroup",null,e),[g,y]=rr({value:n,defaultValue:r,finalValue:[],onChange:o}),b=S=>{const j=S.currentTarget.value;!f&&y(g.includes(j)?g.filter(C=>C!==j):[...g,j])};return a.jsx(j$,{value:{value:g,onChange:b,size:s,disabled:p},children:a.jsx(hn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"SwitchGroup",children:a.jsx(c0,{role:"group",children:d})})})});q0.classes=hn.Wrapper.classes;q0.displayName="@mantine/core/SwitchGroup";var mD={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const E$={labelPosition:"right",withThumbIndicator:!0},T$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Ft(t),"--switch-height":it(r,"switch-height"),"--switch-width":it(r,"switch-width"),"--switch-thumb-size":it(r,"switch-thumb-size"),"--switch-label-font-size":it(r,"switch-label-font-size"),"--switch-track-label-padding":it(r,"switch-track-label-padding"),"--switch-color":n?Wt(n,e):void 0}}),rf=ge((e,t)=>{const n=ie("Switch",E$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,offLabel:g,onLabel:y,id:b,size:S,radius:j,wrapperProps:C,thumbIcon:R,checked:E,defaultChecked:T,onChange:_,labelPosition:k,description:I,error:A,disabled:P,variant:z,rootRef:B,mod:Y,withThumbIndicator:J,attributes:Z,...$}=n,Q=C$(),M=S||Q?.size,L=Le({name:"Switch",props:n,classes:mD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:Z,vars:f,varsResolver:T$}),{styleProps:U,rest:V}=ja($),K=mr(b),O={checked:Q?.value.includes(V.value)??E,onChange:ue=>{Q?.onChange(ue),_?.(ue)},disabled:Q?.disabled??P},[F,ae]=rr({value:O.checked??E,defaultValue:T,finalValue:!1});return a.jsxs(mm,{...L("root"),__staticSelector:"Switch",__stylesApiProps:n,id:K,size:M,labelPosition:k,label:m,description:I,error:A,disabled:O.disabled,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:d,"data-checked":O.checked,variant:z,ref:B,mod:Y,...U,...C,children:[a.jsx("input",{...V,...O,checked:F,"data-checked":O.checked,onChange:ue=>{O.onChange?.(ue),ae(ue.currentTarget.checked)},id:K,ref:t,type:"checkbox",role:"switch",...L("input")}),a.jsxs(ce,{"aria-hidden":"true",component:"span",mod:{error:A,"label-position":k,"without-labels":!y&&!g},...L("track"),children:[a.jsx(ce,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":J&&!R},...L("thumb"),children:R}),a.jsx("span",{...L("trackLabel"),children:F?y:g})]})]})});rf.classes={...mD,...xA};rf.displayName="@mantine/core/Switch";rf.Group=q0;const[R$,_$]=jr("Table component was not found in the tree");var of={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 A$(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 Al(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ge((o,s)=>{const c=ie(n,{},o),{classNames:d,className:f,style:p,styles:m,...g}=c,y=_$();return a.jsx(ce,{component:e,ref:s,...A$(y,t),...y.getStyles(e,{className:f,classNames:d,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=of,r}const $x=Al("th",{columnBorder:!0}),gD=Al("td",{columnBorder:!0}),up=Al("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),vD=Al("thead",{stickyHeader:!0}),yD=Al("tbody"),xD=Al("tfoot"),bD=Al("caption",{captionSide:!0});function G0({data:e}){return a.jsxs(a.Fragment,{children:[e.caption&&a.jsx(bD,{children:e.caption}),e.head&&a.jsx(vD,{children:a.jsx(up,{children:e.head.map((t,n)=>a.jsx($x,{children:t},n))})}),e.body&&a.jsx(yD,{children:e.body.map((t,n)=>a.jsx(up,{children:t.map((r,o)=>a.jsx(gD,{children:r},o))},n))}),e.foot&&a.jsx(xD,{children:a.jsx(up,{children:e.foot.map((t,n)=>a.jsx($x,{children:t},n))})})]})}G0.displayName="@mantine/core/TableDataRenderer";const D$={type:"scrollarea"},k$=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":le(t),"--table-max-height":le(n),"--table-overflow":r==="native"?"auto":void 0}}),Q0=ge((e,t)=>{const n=ie("TableScrollContainer",D$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,children:p,minWidth:m,maxHeight:g,type:y,scrollAreaProps:b,attributes:S,...j}=n,C=Le({name:"TableScrollContainer",classes:of,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:S,vars:f,varsResolver:k$,rootSelector:"scrollContainer"});return a.jsx(ce,{component:y==="scrollarea"?Jr:"div",...y==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...C("scrollContainer"),...j,children:a.jsx("div",{...C("scrollContainerInner"),children:p})})});Q0.classes=of;Q0.displayName="@mantine/core/TableScrollContainer";const P$={withRowBorders:!0,verticalSpacing:7},N$=(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?Wt(s,e):void 0,"--table-striped-color":f&&c?Wt(c,e):void 0,"--table-highlight-on-hover-color":p&&d?Wt(d,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),de=ge((e,t)=>{const n=ie("Table",P$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:y,highlightOnHoverColor:b,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,withTableBorder:E,borderColor:T,layout:_,variant:k,data:I,children:A,stickyHeader:P,stickyHeaderOffset:z,mod:B,tabularNums:Y,attributes:J,...Z}=n,$=Le({name:"Table",props:n,className:o,style:s,classes:of,classNames:r,styles:c,unstyled:d,attributes:J,rootSelector:"table",vars:f,varsResolver:N$});return a.jsx(R$,{value:{getStyles:$,stickyHeader:P,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,captionSide:g||"bottom"},children:a.jsx(ce,{component:"table",variant:k,ref:t,mod:[{"data-with-table-border":E,"data-tabular-nums":Y},B],...$("table"),...Z,children:A||!!I&&a.jsx(G0,{data:I})})})});de.classes=of;de.displayName="@mantine/core/Table";de.Td=gD;de.Th=$x;de.Tr=up;de.Thead=vD;de.Tbody=yD;de.Tfoot=xD;de.Caption=bD;de.ScrollContainer=Q0;de.DataRenderer=G0;const[O$,W0]=jr("Tabs component was not found in the tree");var af={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 Y0=ge((e,t)=>{const n=ie("TabsList",null,e),{children:r,className:o,grow:s,justify:c,classNames:d,styles:f,style:p,mod:m,...g}=n,y=W0();return a.jsx(ce,{...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})});Y0.classes=af;Y0.displayName="@mantine/core/TabsList";const K0=ge((e,t)=>{const n=ie("TabsPanel",null,e),{children:r,className:o,value:s,classNames:c,styles:d,style:f,mod:p,keepMounted:m,...g}=n,y=W0(),b=y.value===s,S=y.keepMounted||m||b?r:null;return a.jsx(ce,{...y.getStyles("panel",{className:o,classNames:c,styles:d,style:[f,b?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})});K0.classes=af;K0.displayName="@mantine/core/TabsPanel";const X0=ge((e,t)=>{const n=ie("TabsTab",null,e),{className:r,children:o,rightSection:s,leftSection:c,value:d,onClick:f,onKeyDown:p,disabled:m,color:g,style:y,classNames:b,styles:S,vars:j,mod:C,tabIndex:R,...E}=n,T=gn(),{dir:_}=ws(),k=W0(),I=d===k.value,A=z=>{k.onChange(k.allowTabDeactivation&&d===k.value?null:d),f?.(z)},P={classNames:b,styles:S,props:n};return a.jsxs(An,{...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:R!==void 0?R:I||k.value===null?0:-1,"aria-controls":k.getPanelId(d),onClick:A,__vars:{"--tabs-color":g?Wt(g,T):void 0},onKeyDown:yb({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:k.activateTabWithKeyboard,loop:k.loop,orientation:k.orientation||"horizontal",dir:_,onKeyDown:p}),...E,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})]})});X0.classes=af;X0.displayName="@mantine/core/TabsTab";const mT="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",M$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},L$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Ft(t),"--tabs-color":Wt(n,e),"--tabs-text-color":El(r,e)?wa({color:n,theme:e,autoContrast:r}):void 0}}),Pt=ge((e,t)=>{const n=ie("Tabs",M$,e),{defaultValue:r,value:o,onChange:s,orientation:c,children:d,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:y,color:b,radius:S,inverted:j,placement:C,keepMounted:R,classNames:E,styles:T,unstyled:_,className:k,style:I,vars:A,autoContrast:P,mod:z,attributes:B,...Y}=n,J=mr(p),[Z,$]=rr({value:o,defaultValue:r,finalValue:null,onChange:s}),Q=Le({name:"Tabs",props:n,classes:af,className:k,style:I,classNames:E,styles:T,unstyled:_,attributes:B,vars:A,varsResolver:L$});return a.jsx(O$,{value:{placement:C,value:Z,orientation:c,id:J,loop:f,activateTabWithKeyboard:m,getTabId:lE(`${J}-tab`,mT),getPanelId:lE(`${J}-panel`,mT),onChange:$,allowTabDeactivation:g,variant:y,color:b,radius:S,inverted:j,keepMounted:R,unstyled:_,getStyles:Q},children:a.jsx(ce,{ref:t,id:J,variant:y,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},z],...Q("root"),...Y,children:d})})});Pt.classes=af;Pt.displayName="@mantine/core/Tabs";Pt.Tab=X0;Pt.Panel=K0;Pt.List=Y0;const He=ge((e,t)=>{const n=ie("TextInput",null,e);return a.jsx($r,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});He.classes=$r.classes;He.displayName="@mantine/core/TextInput";var SD={root:"m_7341320d"};const I$=(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":it(t,"ti-size"),"--ti-radius":n===void 0?void 0:Ft(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}}},J0=ge((e,t)=>{const n=ie("ThemeIcon",null,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,autoContrast:p,attributes:m,...g}=n,y=Le({name:"ThemeIcon",classes:SD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:m,vars:f,varsResolver:I$});return a.jsx(ce,{ref:t,...y("root"),...g})});J0.classes=SD;J0.displayName="@mantine/core/ThemeIcon";const z$=["h1","h2","h3","h4","h5","h6"],$$=["xs","sm","md","lg","xl"];function U$(e,t){const n=t!==void 0?t:`h${e}`;return z$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:$$.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:le(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var wD={root:"m_8a5d1357"};const B$={order:1},V$=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const s=U$(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}}},ze=ge((e,t)=>{const n=ie("Title",B$,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,order:f,vars:p,size:m,variant:g,lineClamp:y,textWrap:b,mod:S,attributes:j,...C}=n,R=Le({name:"Title",props:n,classes:wD,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:j,vars:p,varsResolver:V$});return[1,2,3,4,5,6].includes(f)?a.jsx(ce,{...R("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof y=="number"},S],size:m,...C}):null});ze.classes=wD;ze.displayName="@mantine/core/Title";function jD(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 CD(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function F$(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 H$=()=>jD({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Dl=H$(),q$=(e=Dl)=>CD(e);function cu(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=F$(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Ne(e,t=Dl){const n=e.id||bp();return cu(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function ED(e,t=Dl){return cu(t,n=>n.filter(r=>r.id===e?(r.onClose?.(r),!1):!0)),e}function rl(e,t=Dl){return cu(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function G$(e=Dl){cu(e,()=>[])}function Q$(e=Dl){cu(e,t=>t.slice(0,e.getState().limit))}const Di={show:Ne,hide:ED,update:rl,clean:G$,cleanQueue:Q$,updateState:cu};function Ux(e,t){return Ux=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ux(e,t)}function TD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ux(e,t)}var qy={exports:{}},Gy,gT;function W$(){if(gT)return Gy;gT=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Gy=e,Gy}var Qy,vT;function Y$(){if(vT)return Qy;vT=1;var e=W$();function t(){}function n(){}return n.resetWarningCache=t,Qy=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},Qy}var yT;function K$(){return yT||(yT=1,qy.exports=Y$()()),qy.exports}var X$=K$();const un=Xp(X$),xT={disabled:!1},_p=Mn.createContext(null);var J$=function(t){return t.scrollTop},pd="unmounted",Ks="exited",Xs="entering",Dc="entered",Bx="exiting",Ta=(function(e){TD(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=Ks,s.appearStatus=Xs):f=Dc:r.unmountOnExit||r.mountOnEnter?f=pd:f=Ks,s.state={status:f},s.nextCallback=null,s}t.getDerivedStateFromProps=function(o,s){var c=o.in;return c&&s.status===pd?{status:Ks}: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!==Xs&&c!==Dc&&(s=Xs):(c===Xs||c===Dc)&&(s=Bx)}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===Xs){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:hd.findDOMNode(this);c&&J$(c)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ks&&this.setState({status:pd})},n.performEnter=function(o){var s=this,c=this.props.enter,d=this.context?this.context.isMounting:o,f=this.props.nodeRef?[d]:[hd.findDOMNode(this),d],p=f[0],m=f[1],g=this.getTimeouts(),y=d?g.appear:g.enter;if(!o&&!c||xT.disabled){this.safeSetState({status:Dc},function(){s.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:Xs},function(){s.props.onEntering(p,m),s.onTransitionEnd(y,function(){s.safeSetState({status:Dc},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:hd.findDOMNode(this);if(!s||xT.disabled){this.safeSetState({status:Ks},function(){o.props.onExited(d)});return}this.props.onExit(d),this.safeSetState({status:Bx},function(){o.props.onExiting(d),o.onTransitionEnd(c.exit,function(){o.safeSetState({status:Ks},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:hd.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===pd)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=S0(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Mn.createElement(_p.Provider,{value:null},typeof c=="function"?c(o,d):Mn.cloneElement(Mn.Children.only(c),d))},t})(Mn.Component);Ta.contextType=_p;Ta.propTypes={};function wc(){}Ta.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:wc,onEntering:wc,onEntered:wc,onExit:wc,onExiting:wc,onExited:wc};Ta.UNMOUNTED=pd;Ta.EXITED=Ks;Ta.ENTERING=Xs;Ta.ENTERED=Dc;Ta.EXITING=Bx;function Z$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z0(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 e8(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 il(e,t,n){return n[t]!=null?n[t]:e.props[t]}function t8(e,t){return Z0(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:il(n,"appear",e),enter:il(n,"enter",e),exit:il(n,"exit",e)})})}function n8(e,t,n){var r=Z0(e.children),o=e8(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:il(c,"exit",e),enter:il(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:il(c,"exit",e),enter:il(c,"enter",e)}))}}),o}var r8=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},i8={component:"div",childFactory:function(t){return t}},ls=(function(e){TD(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var c=s.handleExited.bind(Z$(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?t8(o,d):n8(o,c,d),firstRender:!1}},n.handleExited=function(o,s){var c=Z0(this.props.children);o.key in c||(o.props.onExited&&o.props.onExited(s),this.mounted&&this.setState(function(d){var f=Tp({},d.children);return delete f[o.key],{children:f}}))},n.render=function(){var o=this.props,s=o.component,c=o.childFactory,d=S0(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?Mn.createElement(_p.Provider,{value:f},p):Mn.createElement(_p.Provider,{value:f},Mn.createElement(s,d,p))},t})(Mn.Component);ls.propTypes={};ls.defaultProps=i8;const RD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function o8(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),RD.reduce((n,r)=>(n[r]=[],n),{}))}const bT={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 s8({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:bT[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:bT[c]};return{...d,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function l8(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const _D=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:s,message:c,...d}=e,f=l8(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(M0,{...r,...d,onClose:g,ref:o,onMouseEnter:m,onMouseLeave:y,children:c})});_D.displayName="@mantine/notifications/NotificationContainer";var AD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const c8=Ta,u8={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:zr("overlay"),store:Dl,withinPortal:!0},d8=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":le(n)}}),Ra=ge((e,t)=>{const n=ie("Notifications",u8,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:y,notificationMaxHeight:b,limit:S,zIndex:j,store:C,portalProps:R,withinPortal:E,...T}=n,_=gn(),k=q$(C),I=i4(),A=Sb(),P=v.useRef({}),z=v.useRef(0),Y=(_.respectReducedMotion?A:!1)?1:g,J=Le({name:"Notifications",classes:AD,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:d8});v.useEffect(()=>{C?.updateState(Q=>({...Q,limit:S||5,defaultPosition:p}))},[S,p]),gs(()=>{k.notifications.length>z.current&&setTimeout(()=>I(),0),z.current=k.notifications.length},[k.notifications]);const Z=o8(k.notifications,p),$=RD.reduce((Q,M)=>(Q[M]=Z[M].map(({style:L,...U})=>a.jsx(c8,{timeout:Y,onEnter:()=>P.current[U.id].offsetHeight,nodeRef:{current:P.current[U.id]},children:V=>a.jsx(_D,{ref:K=>{K&&(P.current[U.id]=K)},data:U,onHide:K=>ED(K,C),autoClose:m,...J("notification",{style:{...s8({state:V,position:M,transitionDuration:Y,maxHeight:b}),...L}})})},U.id)),Q),{});return a.jsxs(va,{withinPortal:E,...R,children:[a.jsx(ce,{...J("root"),"data-position":"top-center",ref:t,...T,children:a.jsx(ls,{children:$["top-center"]})}),a.jsx(ce,{...J("root"),"data-position":"top-left",...T,children:a.jsx(ls,{children:$["top-left"]})}),a.jsx(ce,{...J("root",{className:dl.classNames.fullWidth}),"data-position":"top-right",...T,children:a.jsx(ls,{children:$["top-right"]})}),a.jsx(ce,{...J("root",{className:dl.classNames.fullWidth}),"data-position":"bottom-right",...T,children:a.jsx(ls,{children:$["bottom-right"]})}),a.jsx(ce,{...J("root"),"data-position":"bottom-left",...T,children:a.jsx(ls,{children:$["bottom-left"]})}),a.jsx(ce,{...J("root"),"data-position":"bottom-center",...T,children:a.jsx(ls,{children:$["bottom-center"]})})]})});Ra.classes=AD;Ra.displayName="@mantine/notifications/Notifications";Ra.show=Di.show;Ra.hide=Di.hide;Ra.update=Di.update;Ra.clean=Di.clean;Ra.cleanQueue=Di.cleanQueue;Ra.updateState=Di.updateState;class f8{operator;child;constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class sf{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 h8{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 p8(t,this.prefixParselets,this.infixParselets)}}class p8{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 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 Error("Cant consume unknown more tokens.");if(t&&this.peek()?.id!==t){const r=this.peek();throw 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 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 DD{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 io="http://hl7.org",kD="ok",m8="created",g8="gone",v8="not-modified",y8="not-found",x8="unauthorized",b8="forbidden",S8="accepted",w8={resourceType:"OperationOutcome",id:kD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},j8={resourceType:"OperationOutcome",id:y8,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},Dd={resourceType:"OperationOutcome",id:x8,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},C8={...Dd,issue:[...Dd.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},ST={...Dd,issue:[...Dd.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},lf={resourceType:"OperationOutcome",id:b8,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Eo(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 E8(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function T8(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 zm(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function PD(e){return e.id===kD||e.id===m8||e.id===v8||e.id===S8}function R8(e){return e.id===g8}class vt extends Error{outcome;constructor(t,n){super(ND(t),n),this.name="OperationOutcomeError",this.outcome=t}}function Yt(e){return e instanceof vt?e.outcome:zm(e)?e:Eo(Qe(e))}function Qe(e){return e?typeof e=="string"?e:T8(e)?e.message:zm(e)?ND(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function ND(e){const t=e.issue?.map(OD)??[];return t.length>0?t.join("; "):"Unknown error"}function OD(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 _8(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 A8(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,_8(o,s)])),constraints:[],innerTypes:[]};return t}const D8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},k8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},P8={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"}]}}},N8={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"}]}}},O8={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"}]}}},M8={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"}]}}},L8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},I8={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"}]}}},z8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},$8={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"}]}}},U8={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"}]}}},B8={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"}]}}},V8={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"}]}}},F8={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"}]}}},H8={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"}]}}},q8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},G8={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"}]}}},Q8={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"]}]}}},W8={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"]}]}}},Y8={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"}]}}},K8={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"}]}}},X8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},J8={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"}]}}},Z8={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"}]}}},eU={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"}]}}},tU={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"}]}}},nU={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"]}]}}},iU={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"}]}}},oU={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"}]}}},sU={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"}]}}},lU={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"]}]}}},cU={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"}]}}},uU={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"}]}}},dU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},fU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},hU={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"]}]}}},pU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},mU={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"}]}}},gU={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"}]}}},vU={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"}]}}},yU={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"}]}}},xU={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"]}]}}},bU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},SU={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"}]}}},wU={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"]}]}}},jU={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"}]}}},CU={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"}]}}},EU={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"}]}}},TU={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},RU={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"}]}}},_U={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"}]}}},AU={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"}]}}},DU={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"]}]}}},kU={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"}]}}},PU={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"}]}}},NU={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"}]}}},OU={Element:D8,BackboneElement:k8,Address:P8,Age:N8,Annotation:O8,Attachment:M8,CodeableConcept:L8,Coding:I8,ContactDetail:z8,ContactPoint:$8,Contributor:U8,Count:B8,DataRequirement:V8,DataRequirementCodeFilter:F8,DataRequirementDateFilter:H8,DataRequirementSort:q8,Distance:G8,Dosage:Q8,DosageDoseAndRate:W8,Duration:Y8,ElementDefinition:K8,ElementDefinitionSlicingDiscriminator:X8,ElementDefinitionSlicing:J8,ElementDefinitionBase:Z8,ElementDefinitionType:eU,ElementDefinitionExample:tU,ElementDefinitionConstraint:nU,ElementDefinitionBinding:rU,ElementDefinitionMapping:iU,Expression:oU,Extension:aU,HumanName:sU,Identifier:lU,MarketingStatus:cU,Meta:uU,Money:dU,Narrative:fU,ParameterDefinition:hU,Period:pU,Population:mU,ProdCharacteristic:gU,ProductShelfLife:vU,Quantity:yU,Range:xU,Ratio:bU,Reference:SU,RelatedArtifact:wU,SampledData:jU,Signature:CU,SubstanceAmount:EU,SubstanceAmountReferenceRange:TU,Timing:RU,TimingRepeat:_U,TriggerDefinition:AU,UsageContext:DU,MoneyQuantity:kU,SimpleQuantity:PU,IdentityProvider:NU};function MU(e){return new IU(e).parse()}const Ap=A8(OU),eS=Object.create(null),wT=Object.create(null),LU={"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 MD(e){let t;return t=wT[e],t||(t=wT[e]=Object.create(null)),t}function jT(e){const n=(Array.isArray(e)?e:e.entry?.map(r=>r.resource)??[]).filter(r=>r?.resourceType==="StructureDefinition");TB(n);for(const r of n)LD(r)}function LD(e){if(!e?.name)throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=MU(e),n=LU[e.url];let r,o;n?(r=Ap,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=Ap,o=e.type):(r=MD(e.url),o=e.type),r[o]=t;for(const s of t.innerTypes)s.parentType=t,r[s.name]=s;eS[e.url]=t}function ID(e){return!!Ap[e]}function $m(e,t){if(t){const n=MD(t)[e];if(n)return n}return Ap[e]}function zD(e,t){const n=$m(e,t);if(!n)throw new vt(Eo("Unknown data type: "+e));return n}function tS(e){return!!eS[e]}function uu(e){return eS[e]}class IU{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:UU(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=Wy(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[Wy(t,r.path)]=n;break}r=r.parent}if(!r){const o=Wy(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&&!jc(this.slicingContext.path,t?.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){for(;this.backboneContext&&!jc(this.backboneContext?.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=kT(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:jc(this.backboneContext?.path,t.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(t,n){$U(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&&!jc(this.backboneContext.path,t?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!jc(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!!(jc(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=kT(t)),r||(r=Uo(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=CT(t.max),r=t.base?.max?CT(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:ET(kd(o,"fixed[x]")),pattern:ET(kd(o,"pattern[x]")),binding:t.binding}}}function CT(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Wy(e,t=""){return zU(e.path,t)}function zU(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function jc(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function ET(e){return Array.isArray(e)&&e.length>0?e[0]:Cn(e)?void 0:e}function $U(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 UU(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 BU(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n?.withPath?$D:kd,[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 $D(e,t,n){const r=e.path;return VU(kd(e,t,n),r,t)}function VU(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 UD={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 FU(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 iS(e,o.pattern);if(o.fixed)return ko(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 Ze(e){return[{type:ne.boolean,value:e}]}function fi(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:ne.integer,value:e}:typeof e=="number"?{type:ne.decimal,value:e}:typeof e=="boolean"?{type:ne.boolean,value:e}:typeof e=="string"?{type:ne.string,value:e}:ki(e)?{type:ne.Quantity,value:e}:Bo(e)?{type:e.resourceType,value:e}:JD(e)?{type:ne.CodeableConcept,value:e}:XD(e)?{type:ne.Coding,value:e}:{type:ne.BackboneElement,value:e}}function wo(e){return e.length===0?!1:!!e[0].value}function xa(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 kd(e,t,n){if(!e.value)return;const r=_s(e.type,t,n?.profileUrl);return r?BD(e,t,r):cf(e,t)}function BD(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]=Yy(s[m],d[m])}else if(!s&&Array.isArray(d)){s=d.slice();for(let m=0;m<d.length;m++)s[m]=Yy(void 0,d[m])}else s=Yy(s,d);if(!Cn(s))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(s)?s.map(m=>TT(m,c)):TT(s,c)}function TT(e,t){return t==="Resource"&&Bo(e)&&(t=e.resourceType),{type:t,value:e}}function cf(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(fi):r=fi(o)}else{const o=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(ne)){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 VD(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(wo(Um(n,o))){r=!0;break}r||t.push(n)}return t}function HU(e){return Ze(!wo(e))}function qU(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!1):Ze(e.every((n,r)=>wo(Um(n,t[r]))))}function GU(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!0):Ze(e.some((n,r)=>!wo(Um(n,t[r]))))}function Um(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?Ze(Math.abs(n-r)<1e-8):ki(n)&&ki(r)?Ze(WD(n,r)):Ze(typeof n=="object"&&typeof r=="object"?nS(e,t):n===r)}function FD(e,t){return e.length===0&&t.length===0?Ze(!0):e.length!==t.length?Ze(!1):(e.sort(RT),t.sort(RT),Ze(e.every((n,r)=>wo(QU(n,t[r])))))}function QU(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"?Ze(Math.abs(c-d)<.01):ki(c)&&ki(d)?Ze(WD(c,d)):Ze(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"?nS({...c,id:void 0},{...d,id:void 0}):typeof c=="string"&&typeof d=="string"?c.toLowerCase()===d.toLowerCase():c===d)}function RT(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 HD(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 qD(n);case"DateTime":return Pd(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return GD(n);case"Quantity":return ki(n);default:return e.type===r||typeof n=="object"&&n?.resourceType===r}}function qD(e){return typeof e=="string"&&!!UD.date.exec(e)}function Pd(e){return typeof e=="string"&&!!UD.dateTime.exec(e)}function GD(e){return!!(e&&typeof e=="object"&&("start"in e&&Pd(e.start)||"end"in e&&Pd(e.end)))}function QD(e){if(e){if(qD(e)||Pd(e))return{start:Qh(e,"0000-01-01T00:00:00.000"),end:Qh(e,"xxxx-12-31T23:59:59.999")};if(GD(e))return{start:e.start?Qh(e.start,"0000-01-01T00:00:00.000"):void 0,end:e.end?Qh(e.end,"xxxx-12-31T23:59:59.999"):void 0}}}function Qh(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 ki(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function WD(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 nS(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(_T(s)&&_T(c)){if(!nS(s,c))return!1}else if(s!==c)return!1}return!0}function _T(e){return e!==null&&typeof e=="object"}function Yy(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return WU(e??{},t)}return e}function WU(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function YD(e,t){return Bo(e,t)&&"id"in e&&typeof e.id=="string"}function Qt(e){const t=Ot(e)??"undefined/undefined",n=ba(e);return n===t?{reference:t}:{reference:t,display:n}}function Ot(e){if(_a(e))return e.reference;if(YD(e))return`${e.resourceType}/${e.id}`}function pl(e){if(e)return _a(e)?e.reference.split("/")[1]:e.id}function YU(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function ba(e){if(YU(e)){const t=KU(e);if(t)return t}if(e.resourceType==="Device"){const t=XU(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return xs(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]),JD(t))return xs(t);if(lB(t))return t.text}return Ot(e)??""}function KU(e){const t=e.name;if(t&&t.length>0)return Rs(t[0])}function XU(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function JU(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=AT(n);if(r)return r}else return AT(t)}function AT(e){if(e.url&&e.contentType?.startsWith("image/"))return e.url}function KD(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 ZU(e,t){const{years:n,months:r,days:o}=KD(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 Uo(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 no(e,t){const n=rS(e);return JSON.stringify(n,null,t?2:void 0)??""}function rS(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?eB(e):tB(e):e}function eB(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=rS(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 tB(e){let t,n=0;for(const r in e){const o=e[r],s=rS(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"?!Ln(e):!1}function Ln(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 nB(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 ko(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:pr(e)&&pr(t)?iB(e,t,n):(pr(e)||pr(t),!1)}function rB(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ko(e[n],t[n]))return!1;return!0}function iB(e,t,n){const r=new Set;Object.keys(e).forEach(o=>r.add(o)),Object.keys(t).forEach(o=>r.add(o)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const o of r){const s=e[o],c=t[o];if(!ko(s,c,o))return!1}return!0}function iS(e,t){return Cn(e)?!0:Cn(t)?!1:Array.isArray(e)&&Array.isArray(t)?oB(e,t):Array.isArray(e)||Array.isArray(t)?!1:pr(e)&&pr(t)?aB(e,t):pr(e)||pr(t)?!1:e===t}function oB(e,t){return t.every(n=>e.some(r=>iS(r,n)))}function aB(e,t){return Object.entries(t).every(([n,r])=>n in e&&iS(e[n],r))}function hi(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function oS(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 pr(e){return e!==null&&typeof e=="object"}function sB(e){return typeof e=="string"}function XD(e){return pr(e)&&"code"in e&&typeof e.code=="string"}function JD(e){return pr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(XD)}function lB(e){return pr(e)&&"text"in e&&typeof e.text=="string"}const ZD=[];for(let e=0;e<256;e++)ZD.push(e.toString(16).padStart(2,"0"));function cB(e){const t=ek(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=ZD[n[o]];return r.join("")}function uB(e){const t=ek(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=String.fromCharCode(n[o]);return window.btoa(r.join(""))}function ek(e){return ArrayBuffer.isView(e)?e.buffer:e}function Wn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function aS(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function ol(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function dB(e,t){return e.coding?.find(n=>n.system===t)?.code}function fB(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const DT=e=>new Promise(t=>{setTimeout(t,e)});function Vx(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 hB(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function sd(e,t){return e?(e.push(t),e):[t]}function Qc(e){return e.sort((t,n)=>t.localeCompare(n))}function sS(e){return e.endsWith("/")?e:e+"/"}function pB(e){return e.startsWith("/")?e.slice(1):e}function vo(e,t){return new URL(pB(t),sS(e.toString())).toString()}function mB(e,t){return vo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function gB(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 tk(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 vB(e,t){if(e?.meta?.profile?.includes(t)){const n=e.meta.profile.indexOf(t);e.meta.profile.splice(n,1)}return e}function ml(e){if(!e)return"";switch(e.type){case"Address":return nk(e.value);case"CodeableConcept":return xs(e.value);case"Coding":return uf(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Rs(e.value);case"Quantity":return al(e.value);case"Reference":return yB(e.value);default:return e.value?.toString()??""}}function yB(e){return e?e.display??e.reference??no(e):""}function nk(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 Rs(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=Od(e.text);if(r)return r}return n.join(" ").trim()}function Bm(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function xB(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Bm(r)?r.toLocaleTimeString(t,n):""}function wr(e,t,n){if(!e)return"";const r=new Date(e);return Bm(r)?r.toLocaleString(t,n):""}function bB(e,t,n){return!e||!e.start&&!e.end?"":wr(e.start,t,n)+" - "+wr(e.end,t,n)}const SB={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},wB={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},jB={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function rk(e){if(!e)return"";const t=[];return CB(t,e.repeat),e.event&&t.push(e.event.map(n=>wr(n)).join(", ")),Wn(t.join(" ").trim())}function CB(e,t){if(!t?.periodUnit)return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(SB[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+wB[o]):e.push("per "+r+" "+jB[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Wn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>xB(s)).join(", "))}function Nd(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?`>= ${al(r)}`:r?.value===void 0&&o?.value!==void 0?`<= ${al(o)}`:(r?.unit===o?.unit&&delete r?.unit,`${al(r)} - ${al(o)}`)}function al(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 EB(e){return e?.value===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function xs(e){if(!e)return"";const t=Od(e.text);return t||(e.coding?e.coding.map(n=>uf(n)).join(", "):"")}function uf(e,t){const n=Od(e?.display);return n?`${n}`:Od(e?.code)??""}function ik(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(al(e.valueQuantity));else if(e.valueCodeableConcept)t.push(xs(e.valueCodeableConcept));else{const n=Od(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>ik(n)).join(" / ")),t.join(" / ").trim()}function Od(e){return typeof e=="string"?e:void 0}const ne={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 TB(e){const t=Array.isArray(e)?e:e.entry?.map(n=>n.resource)??[];for(const n of t)n?.resourceType==="StructureDefinition"&&n.kind==="resource"&&ok(n.type)}function ok(e){let t=Po.types[e];return t||(t={searchParamsDetails:{}},Po.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 RB(e){for(const t of e.base??[]){const n=ok(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function kT(e){const t=e.type?.[0]?.code;return t==="BackboneElement"||t==="Element"?_B((e.base?.path??e.path)?.split(".")):t}function _B(e){return e.length===1?e[0]:e.map(Wn).join("")}function lS(e){return Po.types[e]?.searchParams}function AB(e,t){return Po.types[e]?.searchParams?.[t]}function gl(e){const t=e.replaceAll("[x]","").split(".").pop();return ak(t)}function ak(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(kB).join(" ").replace("_"," ").replaceAll(/\s+/g," ")}const DB=new Set(["CDS","ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function kB(e){const t=e.toUpperCase();return e===t?e:DB.has(t)?t:t.charAt(0)+e.slice(1)}function _s(e,t,n){const r=$m(e,n);if(r)return PB(r.elements,t)}function PB(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 Bo(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function _a(e,t){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Po={types:{}};function dp(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 ua=()=>[],Yr={empty:(e,t)=>Ze(t.every(n=>Cn(n.value))),hasValue:(e,t)=>Ze(t.length!==0),exists:(e,t,n)=>Ze(n?t.some(r=>wo(n.eval(e,[r]))):t.length>0&&t.every(r=>!Cn(r.value))),all:(e,t,n)=>Ze(t.every(r=>wo(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Ze(!1);return Ze(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Ze(!0);return Ze(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Ze(!1);return Ze(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Ze(!0);return Ze(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Ze(!0);const r=n.eval(e,Ws(e));return r.length===0?Ze(!1):Ze(t.every(o=>r.some(s=>s.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Ws(e));return r.length===0?Ze(!0):t.length===0?Ze(!1):Ze(r.every(o=>t.some(s=>s.value===o.value)))},count:(e,t)=>[{type:ne.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)=>Ze(t.length===Yr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>wo(n.eval(e,[r]))),select:(e,t,n)=>t.flatMap(r=>n.eval({parent:e,variables:{$this:r}},[r])),repeat:ua,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,Ws(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,Ws(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,Ws(e));return VD([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ws(e));return[...t,...r]},htmlChecks:(e,t,n)=>[fi(!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 wo(s)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=yo(t,1);if(typeof n=="boolean")return[{type:ne.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Ze(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Ze(!0);if(["false","f","no","n","0","0.0"].includes(r))return Ze(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Ze(Yr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=yo(t,1);return typeof n=="number"?[{type:ne.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:ne.integer,value:Number.parseInt(n,10)}]:typeof n=="boolean"?[{type:ne.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Ze(Yr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=yo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ne.date,value:dp(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Ze(Yr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=yo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ne.dateTime,value:dp(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Ze(Yr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=yo(t,1);return typeof n=="number"?[{type:ne.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:ne.decimal,value:Number.parseFloat(n)}]:typeof n=="boolean"?[{type:ne.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Ze(Yr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=yo(t,1);return ki(n)?[{type:ne.Quantity,value:n}]:typeof n=="number"?[{type:ne.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:ne.Quantity,value:{value:Number.parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:ne.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Ze(Yr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=yo(t,1);return n==null?[]:ki(n)?[{type:ne.string,value:`${n.value} '${n.unit}'`}]:[{type:ne.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Ze(Yr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=yo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:ne.time,value:dp("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Ze(Yr.toTime(e,t).length===1),indexOf:(e,t,n)=>Ti((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>Ti((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)=>Ti((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>Ti((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>Ti((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>Ti(n=>n.toUpperCase(),e,t),lower:(e,t)=>Ti(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>Ti((o,s,c)=>o.replaceAll(s,c),e,t,n,r),matches:(e,t,n)=>Ti((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>Ti((o,s,c)=>o.replaceAll(new RegExp(s,"g"),c.replaceAll(/\$\{(\w+)\}/g,"$<$1>")),e,t,n,r),length:(e,t)=>Ti(n=>n.length,e,t),toChars:(e,t)=>Ti(n=>n?n.split(""):void 0,e,t),encode:ua,decode:ua,escape:ua,unescape:ua,trim:ua,split:ua,join:(e,t,n)=>{const r=n?.eval(e,Ws(e))[0]?.value??"";if(typeof r!="string")throw new TypeError("Separator must be a string.");return[{type:ne.string,value:t.map(o=>o.value?.toString()??"").join(r)}]},abs:(e,t)=>mo(Math.abs,e,t),ceiling:(e,t)=>mo(Math.ceil,e,t),exp:(e,t)=>mo(Math.exp,e,t),floor:(e,t)=>mo(Math.floor,e,t),ln:(e,t)=>mo(Math.log,e,t),log:(e,t,n)=>mo((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>mo(Math.pow,e,t,n),round:(e,t,...n)=>mo((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)=>mo(Math.sqrt,e,t),truncate:(e,t)=>mo(n=>Math.trunc(n),e,t),children:ua,descendants:ua,trace:(e,t,n)=>t,now:()=>[{type:ne.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:ne.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:ne.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{const s=Yr.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const c=Yr.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=KD(s[0].value,c[0].value);return[{type:ne.Quantity,value:{value:f[d],unit:d}}]},is:(e,t,n)=>{let r="";return n instanceof Md?r=n.name:n instanceof Vm&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:ne.boolean,value:HD(o,r)})):[]},not:(e,t)=>Yr.toBoolean(e,t).map(n=>({type:ne.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 fi(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:ne.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:ne.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:ne.BackboneElement,value:{namespace:"System",name:"Integer"}}:Bo(n)?{type:ne.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:ne.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:ne.boolean,value:s.value?.resourceType===o}))},getResourceKey:(e,t)=>{const n=t[0].value;return n?.id?[{type:ne.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!r?.reference)return[];let o="";return n instanceof Md&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:ne.id,value:pl(r)}]},extension:(e,t,n)=>{const r=n.eval(e,t)[0].value,o=t?.[0]?.value;if(o){const s=Uo(o,r);if(s)return[{type:ne.Extension,value:s}]}return[]}};function Ti(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=yo(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(fi):[fi(c)]}function mo(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=yo(n,1),s=ki(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?ne.Quantity:n[0].type,p=s?{...o,value:d}:d;return[{type:f,value:p}]}function yo(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 Ws(e){let t=e;for(;t.parent?.variables.$this;)t=t.parent;return[t.variables.$this]}class cS{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 Cc{value;constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Md{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 Bo(n,this.name)?t:$D(t,this.name)}toString(){return this.name}}class NB{eval(){return[]}toString(){return"{}"}}class OB extends f8{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 Dp extends sf{constructor(t,n){super("as",t,n)}eval(t,n){return Yr.ofType(t,this.left.eval(t,n),this.right)}}class ei extends sf{}class qi 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=ki(s)?s.value:s,f=ki(c)?c.value:c,p=this.impl(d,f);return typeof p=="boolean"?Ze(p):ki(s)?[{type:ne.Quantity,value:{...s,value:p}}]:[fi(p)]}}class MB extends sf{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:ne.string,value:s.map(c=>c.value).join("")}]:s}}class LB 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 Ze(r.some(s=>s.value===o[0].value))}}class IB extends ei{constructor(t,n){super("in",t,n)}eval(t,n){const r=xa(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Ze(o.some(s=>Um(r,s)[0].value)):[]}}class Vm extends sf{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 uS extends sf{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return VD([...r,...o])}}class zB 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 qU(r,o)}}class $B 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 GU(r,o)}}class UB 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 FD(r,o)}}class BB 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 HU(FD(r,o))}}class dS 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 Ze(HD(r[0],o))}}class VB extends ei{constructor(t,n){super("and",t,n)}eval(t,n){const r=xa(this.left.eval(t,n),"boolean"),o=xa(this.right.eval(t,n),"boolean");return r?.value===!0&&o?.value===!0?Ze(!0):r?.value===!1||o?.value===!1?Ze(!1):[]}}class FB extends ei{constructor(t,n){super("or",t,n)}eval(t,n){const r=xa(this.left.eval(t,n),"boolean"),o=xa(this.right.eval(t,n),"boolean");return r?.value===!1&&o?.value===!1?Ze(!1):r?.value||o?.value?Ze(!0):[]}}class HB extends ei{constructor(t,n){super("xor",t,n)}eval(t,n){const r=xa(this.left.eval(t,n),"boolean"),o=xa(this.right.eval(t,n),"boolean");return!r||!o?[]:Ze(r.value!==o.value)}}class qB extends ei{constructor(t,n){super("implies",t,n)}eval(t,n){const r=xa(this.left.eval(t,n),"boolean"),o=xa(this.right.eval(t,n),"boolean");return o?.value===!0||r?.value===!1?Ze(!0):!r||!o?[]:Ze(!1)}}class fS{name;args;constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Yr[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 hS{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 GB=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"],QB={"'":"'",'"':'"',"`":"`",r:"\r",n:`
|
|
57
|
-
`,t:" ",f:"\f","\\":"\\"};class WB{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()!==`
|
|
58
|
-
`))}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=QB[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()===" "&&YB(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()===`
|
|
59
|
-
`?(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 YB(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&GB.includes(e.value)))}const KB=["true","false"],XB=["!=","!~","<=",">=","{}","->"];function JB(e){return new WB(e,KB,XB).tokenize()}const tn={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},ZB={parse(e){const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+e.peek()?.value+"`");return t}},eV={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new hS(t,n)},precedence:tn.Indexer},tV={parse(e,t){if(!(t instanceof Md))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new fS(t.name,n)},precedence:tn.FunctionCall};function nV(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 rV(){return new h8().registerPrefix("String",{parse:(e,t)=>new Cc({type:ne.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Cc({type:ne.dateTime,value:dp(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Cc({type:ne.Quantity,value:nV(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Cc({type:t.value.includes(".")?ne.decimal:ne.integer,value:Number.parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Cc({type:ne.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Cc({type:ne.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Md(t.value)}).registerPrefix("{}",{parse:()=>new NB}).registerPrefix("(",ZB).registerInfix("[",eV).registerInfix("(",tV).prefix("+",tn.UnaryAdd,(e,t)=>new OB("+",t,n=>n)).prefix("-",tn.UnarySubtract,(e,t)=>new qi("-",t,t,(n,r)=>-r)).infixLeft(".",tn.Dot,(e,t,n)=>new Vm(e,n)).infixLeft("/",tn.Divide,(e,t,n)=>new qi("/",e,n,(r,o)=>r/o)).infixLeft("*",tn.Multiply,(e,t,n)=>new qi("*",e,n,(r,o)=>r*o)).infixLeft("+",tn.Add,(e,t,n)=>new qi("+",e,n,(r,o)=>r+o)).infixLeft("-",tn.Subtract,(e,t,n)=>new qi("-",e,n,(r,o)=>r-o)).infixLeft("|",tn.Union,(e,t,n)=>new uS(e,n)).infixLeft("=",tn.Equals,(e,t,n)=>new zB(e,n)).infixLeft("!=",tn.NotEquals,(e,t,n)=>new $B(e,n)).infixLeft("~",tn.Equivalent,(e,t,n)=>new UB(e,n)).infixLeft("!~",tn.NotEquivalent,(e,t,n)=>new BB(e,n)).infixLeft("<",tn.LessThan,(e,t,n)=>new qi("<",e,n,(r,o)=>r<o)).infixLeft("<=",tn.LessThanOrEquals,(e,t,n)=>new qi("<=",e,n,(r,o)=>r<=o)).infixLeft(">",tn.GreaterThan,(e,t,n)=>new qi(">",e,n,(r,o)=>r>o)).infixLeft(">=",tn.GreaterThanOrEquals,(e,t,n)=>new qi(">=",e,n,(r,o)=>r>=o)).infixLeft("&",tn.Ampersand,(e,t,n)=>new MB(e,n)).infixLeft("and",tn.And,(e,t,n)=>new VB(e,n)).infixLeft("as",tn.As,(e,t,n)=>new Dp(e,n)).infixLeft("contains",tn.Contains,(e,t,n)=>new LB(e,n)).infixLeft("div",tn.Divide,(e,t,n)=>new qi("div",e,n,(r,o)=>Math.trunc(r/o))).infixLeft("in",tn.In,(e,t,n)=>new IB(e,n)).infixLeft("is",tn.Is,(e,t,n)=>new dS(e,n)).infixLeft("mod",tn.Modulo,(e,t,n)=>new qi("mod",e,n,(r,o)=>r%o)).infixLeft("or",tn.Or,(e,t,n)=>new FB(e,n)).infixLeft("xor",tn.Xor,(e,t,n)=>new HB(e,n)).infixLeft("implies",tn.Implies,(e,t,n)=>new qB(e,n))}const iV=rV();function pS(e){return new cS(e,iV.construct(JB(e)).consumeAndParse())}function oV(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]=fi(n[r]))}return bs(e,n).map(r=>r.value)}function bs(e,t,n={},r=void 0){let o;if(typeof e=="string"){const s=r?.get(e);o=s??pS(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 aV(e){const t=[];for(const n of e){const r=QD(n.value);r&&t.push(r)}return t}function sV(e){const t=new Set;for(const n of e){const r=ml(n);r&&t.add(r)}return Array.from(t)}function lV(e){const t=new Set;for(const n of e){const{value:r}=n;r&&(sB(r)?t.add(r):_a(r)?t.add(r.reference):YD(r)?t.add(Ot(r)):typeof r.identifier=="object"&&t.add(`identifier:${r.identifier.system}|${r.identifier.value}`))}return Array.from(t)}function cV(e,t={}){const n=[];for(const r of e)uV(t,n,r);return n}function uV(e,t,n){const{type:r,value:o}=n;switch(r){case ne.Identifier:dV(t,e,o);break;case ne.CodeableConcept:fV(t,e,o);break;case ne.Coding:sk(t,e,o);break;case ne.ContactPoint:hV(t,e,o);break;default:vl(t,e,void 0,o?.toString())}}function dV(e,t,n){n?.type?.text&&vl(e,t,t.textSearchSystem,n.type.text),vl(e,t,n?.system,n?.value)}function fV(e,t,n){if(n?.text&&vl(e,t,t.textSearchSystem,n.text),n?.coding)for(const r of n.coding)sk(e,t,r)}function sk(e,t,n){n&&(n.display&&vl(e,t,t.textSearchSystem,n.display),vl(e,t,n.system,n.code))}function hV(e,t,n){n&&vl(e,t,n.system,n.value?.toLocaleLowerCase())}function vl(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 Fm=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"},lk={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},mS={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 ck(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()),pV(o,s)}function pV(e,t){const n={resourceType:e};for(const[r,o]of t)mV(n,r,o);return n}function mV(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=sd(e.filters,{code:t,operator:he.EQUALS,value:n});return}switch(r){case"_sort":gV(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=PT(n);o==="iterate"&&(c.modifier=he.ITERATE),e.include=sd(e.include,c);break}case"_revinclude":{const c=PT(n);o==="iterate"&&(c.modifier=he.ITERATE),e.revInclude=sd(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=Po.types[e.resourceType]?.searchParams?.[r];c?e.filters=sd(e.filters,yV(c,o,n)):e.filters=sd(e.filters,xV(r,o,n))}}}}function gV(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 vV=[he.MISSING,he.PRESENT];function yV(e,t,n){if(vV.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=bV(n,t||he.EQUALS);if(!NT(e,o))throw new vt(Eo(`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(!NT(e,n))throw new vt(Eo(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:SV(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function xV(e,t,n){let r=he.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in mS&&(n.length===2||n.at(2)?.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function bV(e,t){const n=e.substring(0,2),r=mS[n];return r?{operator:r,value:e.substring(2)}:{operator:t,value:e}}function SV(e){return lk[e]??he.EQUALS}function PT(e){const t=e.split(":");if(t.includes("*"))throw new vt(Eo("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new vt(Eo(`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 vt(Eo(`Invalid include value '${e}'`))}function NT(e,t){switch(e.type){case"date":return Pd(t);default:return!0}}function ps(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(wV(n))),e.sortRules&&e.sortRules.length>0&&t.push(jV(e.sortRules)),e.cursor!==void 0&&t.push("_cursor="+encodeURIComponent(e.cursor)),e.offset!==void 0&&e.offset!==0&&t.push("_offset="+e.offset),e.count!==void 0&&t.push("_count="+e.count),e.total!==void 0&&t.push("_total="+e.total),e.types&&e.types.length>0&&t.push("_type="+e.types.join(",")),e.include&&e.include.forEach(n=>t.push(OT("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(OT("_revinclude",n))),t.length===0?"":(Qc(t),"?"+t.join("&"))}function wV(e){const t=e.operator in lk?":"+e.operator:"",n=e.operator!==he.EQUALS&&e.operator in mS?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function jV(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function OT(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Hm(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 CV(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!EV(e,t,n))return!1}return!0}function EV(e,t,n){const r=Po.types[t.resourceType]?.searchParams?.[n.code];if(!r)return!1;const o=bs(r.expression,[fi(e)]);if(n.operator===he.MISSING||n.operator===he.PRESENT)return TV(o,n);switch(r.type){case"reference":return RV(o,n);case"string":case"uri":return DV(o,n);case"token":return _V(o,n);case"date":return PV(o,n);default:return!1}}function TV(e,t){const n=e.length>0;return(t.operator===he.MISSING&&t.value==="false"||t.operator===he.PRESENT&&t.value==="true")===n}function RV(e,t){const n=qm(t.operator);if(t.value===""&&e.length===0)return t.operator===he.EQUALS;const r=lV(e);for(const o of Hm(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 _V(e,t){const n=cV(e),r=Hm(t.value),o=qm(t.operator);for(const s of n)for(const c of r)if(AV(s,c))return!o;return o}function AV(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 DV(e,t){const n=sV(e),r=Hm(t.value),o=qm(t.operator);for(const s of n)for(const c of r)if(kV(s,c))return!o;return o}function kV(e,t){return e.toLowerCase().includes(t.toLowerCase())}function PV(e,t){const n=aV(e),r=Hm(t.value),o=qm(t.operator);for(const s of n)for(const c of r)if(NV(s,t.operator,c))return!o;return o}function NV(e,t,n){if(!e)return!1;const r=QD(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 qm(e){return e===he.NOT_EQUALS||e===he.NOT}const OV={resourceType:"*"},MV=["DomainConfiguration","JsonWebKey","Login"],LV=["UserSecurityRequest","Project","ProjectMembership","User"],sl={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},IV=[sl.READ,sl.VREAD,sl.HISTORY,sl.SEARCH];function zV(e,t){return MV.includes(t)?!1:$V(e,sl.UPDATE,t)}function $V(e,t,n){return!!e.resource?.some(r=>dk(r,n,t))}function uk(e,t,n){return n?n.resource?.find(r=>UV(e,t,r)):OV}function UV(e,t,n){const r=e.resourceType;return dk(n,r,t)?r==="Binary"?!0:!(n.compartment&&!e.meta?.compartment?.some(o=>o.reference===n.compartment?.reference)||n.criteria&&!CV(e,ck(n.criteria))):!1}function dk(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||LV.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||IV.includes(n)}function xo(){return typeof window<"u"}function fk(){return typeof Buffer<"u"?Buffer:void 0}const nr={assign(e){xo()&&globalThis.location.assign(e)},reload(){xo()&&globalThis.location.reload()},getSearch(){return xo()?globalThis.location.search:""},getPathname(){return xo()?globalThis.location.pathname:""},getLocation(){return xo()?globalThis.location.toString():""},getOrigin(){return xo()?globalThis.location.protocol+"//"+globalThis.location.host+"/":""}};function BV(e){if(xo()){const n=window.atob(e),r=Uint8Array.from(n,o=>o.charCodeAt(0));return new window.TextDecoder().decode(r)}const t=fk();if(t)return t.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function MT(e){if(xo()){const n=new window.TextEncoder().encode(e),r=String.fromCharCode.apply(null,n);return window.btoa(r)}const t=fk();if(t)return t.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function VV(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replaceAll("-","+").replaceAll("_","/");return BV(t)}function LT(){const e=new Uint32Array(28);return crypto.getRandomValues(e),cB(e.buffer)}async function FV(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function hk(){return"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 pk(e){const t={};e=hi(e);for(const o of e.entry||[]){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]=hk(),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)=>HV(o,s,t),2);return qV(JSON.parse(r))}function HV(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 qV(e){const t=QV(e),{sorted:n,cycles:r}=GV(t),o={},s=[];for(const d of e.entry??[])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 Ec={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function GV(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=Ec.NotVisited;function o(s,c){if(n[s]===Ec.Visited)return!0;if(n[s]===Ec.Visiting){const f=c.lastIndexOf(s);return f!==-1&&r.push(c.slice(f)),!0}n[s]=Ec.Visiting,c.push(s);let d=!1;for(const f of e[s])o(f,c)||(d=!0);return n[s]=Ec.Visited,c.pop(),t.unshift(s),!d}for(const s in e)n[s]===Ec.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(_a(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else mk(r,t)}}function QV(e){const t={};for(const n of e.entry||[])n.fullUrl&&(t[n.fullUrl]=[]);for(const n of e.entry||[]){const r=n.fullUrl;n.resource&&mk(n.resource,o=>{t[o]&&t[o].push(r)})}return t}const nn={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 WV=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];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}listenerCount(t){return this.listeners[t]?.length??0}};class Gm{emitter=new WV;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 Fx={"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"},YV=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],gS=["DiagnosticReport-update"];function KV(e){return gS.includes(e)}function XV(e){if(gS.includes(e))throw new vt(jn(`'context.version' is required for '${e}'.`))}const JV={"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 ZV(e){return YV.includes(e)}function gk(e){return!!e.endpoint}function IT(e){if(!vS(e))throw new vt(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 gk(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function vS(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(!Fx[s])return!1;return!(gk(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function eF(e,t,n,r){if(typeof t!="object")throw new vt(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 vt(jn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new vt(jn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!ZV(t.resourceType))throw new vt(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 vt(jn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function tF(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),r.reference){if(!_a(t.reference))throw new vt(jn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else eF(e,t.resource,n,r)}function nF(e,t){const n=new Map,r=JV[e];for(let o=0;o<t.length;o++){const s=t[o].key;if(!r[s])throw new vt(jn(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));tF(e,t[o],o,r[s],n)}for(const[o,s]of Object.entries(r)){if(!(s.optional||n.has(o)))throw new vt(jn(`Missing required key '${o}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(o)??0)>1)throw new vt(jn(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function zT(e,t,n,r){if(!(e&&typeof e=="string"))throw new vt(jn("Must provide a topic."));if(!Fx[t])throw new vt(jn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Fx).join(", ")}`));if(typeof n!="object")throw new vt(jn("context must be a context object or array of context objects."));if(gS.includes(t)&&!r)throw new vt(jn(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return nF(t,o),{timestamp:new Date().toISOString(),id:hk(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class rF extends Gm{subRequest;websocket;constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new vt(jn("Subscription request should contain an endpoint."));if(!vS(t))throw new vt(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 iF(e){return JSON.parse(VV(e))}function oF(e){return e.split(".").length===3}function yS(e){const[t,n,r]=e.split(".");return iF(n)}function aF(e){try{return typeof yS(e).login_id=="string"}catch{return!1}}function sF(e){try{const n=yS(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class lF{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,nn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}class Gi{[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 cF{storage;prefix="";constructor(t,n=""){this.storage=t??globalThis.localStorage??new uF,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?no(n):void 0)}}class uF{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 Lc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let $T=!1;function dF(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");Lc.Event=globalThis.Event,Lc.ErrorEvent=class extends Event{message;error;constructor(t,n){super("error",n),this.message=t.message,this.error=t}},Lc.CloseEvent=class extends Event{code;reason;wasClean=!0;constructor(t=1e3,n="",r){super("close",r),this.code=t,this.reason=n}}}function fF(e,t){if(!e)throw new Error(t)}function Wh(e){return new e.constructor(e.type,e)}const Ys={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let UT=!1;class cs extends Gm{_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={}){$T||(dF(),$T=!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 cs.CONNECTING}get OPEN(){return cs.OPEN}get CLOSING(){return cs.CLOSING}get CLOSED(){return cs.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?cs.CLOSED:cs.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&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=Ys.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=Ys.reconnectionDelayGrowFactor,minReconnectionDelay:n=Ys.minReconnectionDelay,maxReconnectionDelay:r=Ys.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=Ys.maxRetries,connectionTimeout:n=Ys.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"&&!UT&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),UT=!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 Lc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Lc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new Lc.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");const{minUptime:n=Ys.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),n),fF(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(Wh(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(Wh(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(Wh(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(Wh(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 hF=5e3;class Hx extends Gm{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 pF{criteria;emitter;refCount;subscriptionProps;subscriptionId;token;connecting=!1;constructor(t,n){this.criteria=t,this.emitter=new Hx(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class mF{medplum;ws;masterSubEmitter;criteriaEntries;criteriaEntriesBySubscriptionId;wsClosed;pingTimer=void 0;pingIntervalMs;waitingForPong=!1;currentProfile;constructor(t,n,r){if(!(t instanceof yk))throw new vt(jn("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new vt(jn("Not a valid URL"))}const s=r?.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger}):new cs(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new Hx,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=r?.pingIntervalMs??hF,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=pl(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(pl(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 vt(E8(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 ${Ot(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 vt(jn("Failed to get token"));if(!s)throw new vt(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(ko(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!ko(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 pF(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 Hx(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const vk="5.0.7-0dd9d93",gF=nn.FHIR_JSON+", */*; q=0.1",vF="https://api.medplum.com/",yF=1e3,xF=6e4,bF=0,SF=3e5,wF="Binary/",BT={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},Tc={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"},jF={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},CF={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class yk extends Gm{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;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??EF(),this.storage=t?.storage??new cF(void 0,t?.storagePrefix),this.createPdfImpl=t?.createPdf,this.baseUrl=sS(t?.baseUrl??vF),this.fhirBaseUrl=vo(this.baseUrl,t?.fhirUrlPath??"fhir/R4"),this.authorizeUrl=vo(this.baseUrl,t?.authorizeUrl??"oauth2/authorize"),this.tokenUrl=vo(this.baseUrl,t?.tokenUrl??"oauth2/token"),this.logoutUrl=vo(this.baseUrl,t?.logoutUrl??"oauth2/logout"),this.fhircastHubUrl=vo(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??SF,this.cacheTime=t?.cacheTime??(xo()?xF:bF),this.cacheTime>0?this.requestCache=new DD(t?.resourceCacheSize??yF):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}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(),xo()&&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=vo(this.fhirBaseUrl,t);if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!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 Gi(o);return this.setCacheEntry(t,s),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,nn.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(nr.getSearch()).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){nr.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,o,s=!0){let c=o;s&&(c=await this.ensureCodeChallenge(o)),nr.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:Tc.TokenExchange,subject_token_type:jF.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(vo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=gB(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),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 Gi(this.search(t,o.searchParams,r).then(f=>f.entry?.[0]?.resource));return this.setCacheEntry(s,d),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 Gi(this.search(t,n,r).then(FT));return this.setCacheEntry(s,d),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 FT(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 BT;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 Gi(Promise.reject(new Error("Missing reference")));if(r==="system")return new Gi(Promise.resolve(BT));const[o,s]=r.split("/");return!o||!s?new Gi(Promise.reject(new Error("Invalid reference"))):this.readResource(o,s,n)}requestSchema(t){if(ID(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Gi((async()=>{const s=`{
|
|
60
|
-
StructureDefinitionList(_filter: "name eq ${t}") {
|
|
61
|
-
resourceType,
|
|
62
|
-
name,
|
|
63
|
-
kind,
|
|
64
|
-
description,
|
|
65
|
-
type,
|
|
66
|
-
url,
|
|
67
|
-
snapshot {
|
|
68
|
-
element {
|
|
69
|
-
id,
|
|
70
|
-
path,
|
|
71
|
-
definition,
|
|
72
|
-
min,
|
|
73
|
-
max,
|
|
74
|
-
base {
|
|
75
|
-
path,
|
|
76
|
-
min,
|
|
77
|
-
max
|
|
78
|
-
},
|
|
79
|
-
contentReference,
|
|
80
|
-
type {
|
|
81
|
-
code,
|
|
82
|
-
profile,
|
|
83
|
-
targetProfile
|
|
84
|
-
},
|
|
85
|
-
binding {
|
|
86
|
-
strength,
|
|
87
|
-
valueSet
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
SearchParameterList(base: "${t}", _count: 100) {
|
|
93
|
-
base,
|
|
94
|
-
code,
|
|
95
|
-
type,
|
|
96
|
-
expression,
|
|
97
|
-
target
|
|
98
|
-
}
|
|
99
|
-
}`.replaceAll(/\s+/g," "),c=await this.graphql(s);jT(c.data.StructureDefinitionList);for(const d of c.data.SearchParameterList)RB(d)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!n?.expandProfile&&tS(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 Gi((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(),{});jT(d)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}LD(c)}})());return this.setCacheEntry(r,s),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),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),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async createAttachment(t,n,r,o,s){let c=HT(t,n,r,o);if(c.contentType===nn.XML){const p=c.data;let m;p instanceof Blob?m=await new Promise((g,y)=>{const b=new FileReader;b.onload=()=>{if(!b.result){y(new Error("Failed to load file"));return}g(b.result)},b.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?m=new TextDecoder().decode(p):m=p,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:nn.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=HT(t,n,r,o),d=s??(typeof n=="object"?n:{}),{data:f,contentType:p,filename:m,securityContext:g,onProgress:y}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g?.reference&&this.setRequestHeader(d,"X-Security-Context",g.reference),y?this.uploadwithProgress(b,f,p,y,d):this.post(b,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 vt(Yt(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,b]of Object.entries(g))f.setRequestHeader(y,b)}f.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const s=_F(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=Qt(t),c=t.subject),t.resourceType==="ServiceRequest"&&(s=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=Qt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Qt(t)],encounter:s,subject:c,sender:o?Qt(o):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,o){const s=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(s),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,nn.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},nn.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",pl(t),"$push"),{destination:typeof n=="string"?n:Ot(n),body:r,contentType:o,waitForResponse:s,...d!==void 0?{waitTimeout:d}:void 0},nn.FHIR_JSON,f)}getCdsServices(t){return this.get("/cds-services",t)}callCdsService(t,n,r){return this.post(`/cds-services/${t}`,n,nn.JSON,r)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){(!this.sessionDetails?.profile||Ot(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=sF(t),this.medplumServer=aF(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(wF)&&(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=Qt(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=Qt(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 lF(this)),this.keyValueClient}getBundle(t,n){return new Gi((async()=>{const r=await this.get(t,n);if(r.entry)for(const o of r.entry)this.cacheResource(o.resource);return r})())}getCacheEntry(t,n){if(!this.requestCache||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){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t){t?.id&&!t.meta?.tag?.some(n=>n.code==="SUBSETTED")&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Gi(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},o={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const 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 vt(j8);const f=await this.parseBody(s,d);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const p=await VT(s,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const m=await VT(s,f)??o.statusUrl;if(m)return this.pollStatus(m,r,o)}if(s.status>=400)throw new vt(Yt(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=vo(this.baseUrl,t));const r=n?.maxRetries??2;for(let o=0;o<=r;o++)try{this.options.verbose&&this.logRequest(t,n);const s=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(s),this.setCurrentRateLimit(s),o>=r||!AF(s))return s;const c=this.getRetryDelay(o),d=n.maxRetryTime??2e3;if(c>d)return s;await DT(c)}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}`),n.headers){const r=n.headers;for(const o of Qc(Object.keys(r)))console.log(`> ${o}: ${r[o]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}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 DT(s),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,vo(this.fhirBaseUrl,o.url),o.options))}catch(s){o.reject(new vt(Yt(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&&!PD(c.response.outcome)?s.reject(new vt(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",gF,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",nn.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,o=!1){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):pr(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 vt(Dd)}async startPkce(){const t=LT();sessionStorage.setItem("pkceState",t);const n=LT().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await FV(n);return{codeChallengeMethod:"S256",codeChallenge:uB(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??nr.getOrigin()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),nr.assign(r.toString())}processCode(t,n){const r={grant_type:Tc.AuthorizationCode,code:t,client_id:n?.clientId??this.clientId??"",redirect_uri:n?.redirectUri??nr.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:Tc.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:Tc.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:Tc.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:Tc.ClientCredentials,client_assertion_type:CF.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=MT(t+":"+n)}setVerbose(t){this.options.verbose=t}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new vt(jn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new vt(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,IT(r),nn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!vS(t))throw new vt(jn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new vt(jn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,IT(t),nn.FORM_URL_ENCODED)}fhircastConnect(t){return new rF(t)}async fhircastPublish(t,n,r,o){return KV(n)?this.post(this.fhircastHubUrl,zT(t,n,r,o),nn.JSON):(XV(n),this.post(this.fhircastHubUrl,zT(t,n,r),nn.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`,{cache:"no-cache"})}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":nn.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 ${MT(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}if(!s.ok){this.clearActiveLogin(),this.onUnauthenticated?.();try{const d=await s.json();throw new vt(Eo(d.error_description))}catch(d){throw new vt(Eo("Failed to fetch tokens"),{cause:d})}}const c=await s.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(oF(n)){const r=yS(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new vt(C8);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new vt(ST)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new vt(ST)}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)nr.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)?nr.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new mF(this,mB(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 EF(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}async function VT(e,t){const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(zm(t)&&t.issue?.[0]?.diagnostics)return t.issue[0].diagnostics}function FT(e){const t=e.entry?.map(n=>n.resource)??[];return Object.assign(t,{bundle:e})}function TF(e){return pr(e)&&"data"in e&&"contentType"in e}function HT(e,t,n,r){return TF(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function RF(e){return pr(e)&&"docDefinition"in e}function _F(e,t,n,r){return RF(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function AF(e){return e.status===429||e.status>=500}function Wc({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=DF(t,n,e,!!o);const d=Vx(t,".",2)[1];c=kF(c,s,d),c=PF(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=Vx(g,".",2)[1];if(y){if(!m[y]){const b=kp(y,s?.hiddenFields);m[y]={hidden:b,readonly:b||kp(y,s?.readonlyFields)}}return m[y]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??e?.profileUrl,debugMode:o,getExtendedProps:p,accessPolicyResource:s}}function DF(e,t,n,r){const o=Object.create(null);if(n)for(const[c,d]of Object.entries(n.elementsByPath)){const f=ol(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 kF(e,t,n){if(!t?.hiddenFields?.length)return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!kp(r+o,t.hiddenFields)))}function PF(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))kp(o+s,t.readonlyFields)?r[s]={...c,readonly:!0}:r[s]=c;return r}function kp(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 xk(e){return e.type!==void 0&&e.type.length>0}function NF(e,t,n,r){const o=BU(e,t.path,{profileUrl:r});if(o){const s=n.typeSchema?.elements??n.elements;return o.some(c=>FU(c,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function bk(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=>NF(s,c,o,o.typeSchema?.url??r)))return o.name}}class OF{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=Wc({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(!Ln(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=MF(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);Ln(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(!xk(s))continue;const c=s.type.find(d=>Ln(d.profile))?.profile?.[0];if(Ln(c)){const d=uu(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;Ln(c)&&(s=Wc({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 MF(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 Ky="__sliceName";function LF(e,t){const n=new IF(e,e.resourceType,"resource");return new OF(t,n).crawlResource(),n.getDefaultValue()}function qT(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Pp(e,r,o,t);continue}const s=ol(n,r);s!==void 0&&Pp(e,s,o,t)}return e}class IF{rootValue;schemaStack;valueStack;constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=hi(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=ol(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=ol(r.path,s),m=Array.isArray(f)?f:[f];for(const g of m){zF(g,c,n,r.elements,p),Pp(g,c,n,r.elements);const y=Gx(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=ol(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=ol(r.path,this.value.path);for(const d of this.value.values){const f=Gx(d,s,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];Ln(m)||f.splice(p,1)}Cn(f)&&qx(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[Ky]??bk(s,[n],r.discriminator,this.schema.url))===n.name&&o.push(s);for(let s=o.length;s<n.min;s++)if(aS(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];Ky in o&&delete o[Ky]}}getDefaultValue(){return this.rootValue}}function zF(e,t,n,r,o){const s=Gx(e,t,r,o);n.min>0&&s===void 0&&aS(n.type[0].code)&&(n.isArray?qx(e,[Object.create(null)],t,n):qx(e,Object.create(null),t,n))}function qx(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 Gx(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(pr(s)){if(s[f]===void 0)return;s=s[f]}else return}return c}function Pp(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(d=>Pp(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]=Sk(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 Sk(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return(e?.length??0)>0?e:hi(t);if(pr(t)&&(pr(e)&&!Array.isArray(e)||e===void 0)){const n=hi(e)??Object.create(null);for(const r of Object.keys(t))n[r]=Sk(n[r],t[r]);return n}return e}function $F(e){return e.match(/^\((.+)\)\.identifier$/)?.[1]}function UF(e,t){return new cS(e,new Vm(t,new Md("identifier")))}const yr={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Qm(e,t){let n=Po.types[e]?.searchParamsDetails?.[t.code];return n||(n=VF(e,t)),n}function BF(e,t,n){let r=Po.types[e];r||(r={},Po.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function VF(e,t){const n=t.code,r=t.expression,o=GF(e,r),s={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const f of o){const p=fp(f),m=hB(()=>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")):wk(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=$F(r);if(f===void 0)throw new Error(`Unexpected expression for derived identifier search parameter: ${r}`);const p=GT(e,f);c=UF(r,p)}else c=GT(e,r);const d={type:qF(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 BF(e,n,d),d}function wk(e,t,n,r){const o=t[r];if(o instanceof Dp){e.propertyTypes.add(o.right.toString());return}if(o instanceof fS){FF(e,o);return}const s=o.toString(),c=_s(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 hS&&(d=!0,f++);const p=t[f];if(c.isArray&&!d&&(e.array=!0),f===t.length-1&&p instanceof Dp){e.elementDefinitions.push(c),e.propertyTypes.add(p.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type)e.propertyTypes.add(m.code);return}for(const m of c.type){let g=m.code;HF(g)&&(g=c.type[0].code),wk(e,t,g,f)}}function FF(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 dS){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function HF(e){return e==="Element"||e==="BackboneElement"}function qF(e,t){switch(e.type){case"date":return t.size===1&&t.has(ne.date)?yr.DATE:yr.DATETIME;case"number":return yr.NUMBER;case"quantity":return yr.QUANTITY;case"reference":return t.has(ne.canonical)?yr.CANONICAL:yr.REFERENCE;case"token":return t.size===1&&t.has(ne.boolean)?yr.BOOLEAN:yr.TEXT;default:return yr.TEXT}}function GF(e,t){const n=[],r=pS(t);return Np(e,r.child,n),n}function GT(e,t){const n=[],r=pS(t);if(Np(e,r.child,n),n.length===0)return r;let o=n[0];for(let s=1;s<n.length;s++)o=new uS(o,n[s]);return new cS("<original-not-available>",o)}function Np(e,t,n){t instanceof uS?(Np(e,t.left,n),Np(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function fp(e){if(e instanceof Dp||e instanceof hS)return[fp(e.left),e].flat();if(e instanceof ei)return[e];if(e instanceof Vm)return[fp(e.left),fp(e.right)].flat();if(e instanceof fS){if(e.name==="where"&&!(e.args[0]instanceof dS))return[];if(e.name==="last")return[]}return[e]}const QF="https://meta.medplum.com/releases",Xy=new Map;function WF(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 YF(e,t,n){let r=Xy.get("latest");if(!r){const o="latest",s=new URL(`${QF}/${o}.json`);s.searchParams.set("a",e),s.searchParams.set("c",vk);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();WF(d),r=d,Xy.set("latest",r),Xy.set(r.tag_name.slice(1),r)}return r}async function KF(e){const t=await YF(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 jk=v.createContext(void 0);function Wm(){return v.useContext(jk)}function _e(){return Wm().medplum}function df(){return Wm().navigate}function ff(){return Wm().profile}const QT=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function XF(e){const t=e.medplum,n=e.navigate??JF,[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 QT)t.addEventListener(d,c);return()=>{for(const d of QT)t.removeEventListener(d,c)}},[t]);const s=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(jk.Provider,{value:s,children:e.children})}function JF(e){window.location.assign(e)}const WT=new Map,Ck=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=WT.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 WT.set(t,e),e},[e]);function Kt(e,t){const n=_e(),[r,o]=v.useState(()=>YT(n,e)),s=v.useCallback(c=>{ko(c,r)||o(c)},[r]);return v.useEffect(()=>{let c=!0;const d=YT(n,e);return!d&&_a(e)?n.readReference(e).then(f=>{c&&s(f)}).catch(f=>{c&&(s(void 0),t&&t(Yt(f)))}):s(d),(()=>c=!1)},[n,e,s,t]),r}function YT(e,t){if(t){if(Bo(t))return t;if(_a(t))return e.getCachedReference(t)}}const Ct={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"},xS=`${io}/fhir/StructureDefinition/questionnaire-itemControl`,ZF=`${io}/fhir/StructureDefinition/questionnaire-referenceFilter`,Qx=`${io}/fhir/StructureDefinition/questionnaire-referenceResource`,eH=`${io}/fhir/StructureDefinition/questionnaire-validationError`,tH=`${io}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,nH=`${io}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,rH=`${io}/fhir/StructureDefinition/questionnaire-signatureRequired`,hp=`${io}/fhir/StructureDefinition/questionnaireresponse-signature`;function iH(e){return e.type==="choice"||e.type==="open-choice"}function oH(e,t){const n=aH(e,t);return n!==void 0?n:sH(e,t)}function aH(e,t){const n=Uo(e,tH);if(t&&n){const r=n.valueExpression?.expression;if(r){const o=fi(t),s=bs(r,[o],{"%resource":o});return wo(s)}}}function sH(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=Rk(t?.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!o?.length){if(n==="any")return!0;continue}const{anyMatch:s,allMatch:c}=hH(r,o,n);if(n==="any"&&s)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function Ek(e,t,n=t.item){for(const r of e){const o=n?.find(s=>s.linkId===r.linkId);o&&(lH(t,r,o),r.item&&o.item&&Ek(r.item,t,o.item))}}function lH(e,t,n){try{const r=dH(t,e);if(!r)return;const o=uH(t,r);if(!o)return;n.answer=[o]}catch(r){n.extension=[{url:eH,valueString:`Expression evaluation failed: ${Qe(r)}`}]}}const cH={[Ct.boolean]:[ne.boolean],[Ct.date]:[ne.date],[Ct.dateTime]:[ne.dateTime],[Ct.time]:[ne.time],[Ct.url]:[ne.string,ne.uri,ne.url],[Ct.attachment]:[ne.Attachment],[Ct.reference]:[ne.Reference],[Ct.quantity]:[ne.Quantity],[Ct.decimal]:[ne.decimal,ne.integer],[Ct.integer]:[ne.decimal,ne.integer]};function uH(e,t){if(!e.type)return;if(e.type===Ct.choice||e.type===Ct.openChoice)return{[`value${Wn(t.type)}`]:t.value};if(e.type===Ct.string||e.type===Ct.text)return typeof t.value=="string"?{valueString:t.value}:void 0;if(cH[e.type]?.includes(t.type))return{[`value${Wn(e.type)}`]:t.value}}function dH(e,t){if(!t)return;const n=Uo(e,nH);if(n){const r=n.valueExpression?.expression;if(r){const o=fi(t),s=bs(r,[o],{"%resource":o});return s.length!==0?s[0]:void 0}}}function Tk(e,t,n){const r=[];for(const o of e){const s=n.answerOption?.find(c=>ml(No(c))===o);if(s){const c=No(s);c&&r.push({[t]:c.value})}}return r}function Rk(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=Rk(n.item,t);if(r)return r}}}function fH(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n?.replace("=","~"):n,[{value:o}]=bs(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function hH(e,t,n){const r=t||[],o=gH(e);let s=!1,c=!0;for(const d of r){const f=vH(d),{operator:p}=e;if(fH(f,o,p)?s=!0:c=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:c}}function _k(e){const t=Uo(e,Qx);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return t.valueCodeableConcept?.coding?.map(n=>n.code)}}function Jy(e,t){const n=hi(e);let r=Uo(n,Qx);return!t||t.length===0?(r&&(n.extension=n.extension?.filter(o=>o!==r)),n):(r||(n.extension??=[],r={url:Qx},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 pH(e,t,n){const r=Uo(e,ZF);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]=Vx(d,"=",2);s[f]=p}return s}function KT(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??Ot(e),item:bS(e.item,t?.item),status:"in-progress"}}function bS(e,t){if(!e)return;const n=[];for(const r of e){if(r.type===Ct.display)continue;const o=t?.filter(s=>s.linkId===r.linkId);if(o&&o?.length>0)for(const s of o)s.id=s.id??Dk(),s.text=s.text??r.text,s.item=bS(r.item,s.item),s.answer=kk(r,s),n.push(s);else n.push(Ak(r))}return n}function Ak(e){return{id:Dk(),linkId:e.linkId,text:e.text,item:bS(e.item,void 0),answer:kk(e)}}let mH=1;function Dk(){return"id-"+mH++}function kk(e,t){if(!(e.type===Ct.display||e.type===Ct.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 SS(e){return cf({value:e},"value")}function No(e){return cf({value:e},"value")}function gH(e){return cf({value:e},"answer")}function vH(e){return cf({value:e},"value")}function yH(e){const t=Kt(e.questionnaire),n=Kt(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:xH(t)),t&&e.defaultValue&&n&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=KT(t,n),b()),t&&!e.defaultValue&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=KT(t),b()),!o.current.questionnaire||!o.current.questionnaireResponse)return{loading:!0};function s(S,j){let C=o.current.questionnaireResponse;for(const R of S)C=C?.item?.find(E=>R.id?E.id===R.id:E.linkId===R.linkId);return j&&(C=C?.item?.find(R=>R.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(Ak(j)),b())}function p(S,j){const C=s(S,j);C&&(C.answer??=[],C.answer.push({}),b())}function m(S,j,C){const R=s(S,j);R&&(R.answer=C,b())}function g(S){const j=o.current.questionnaireResponse;j&&(S?(j.extension=j.extension??[],j.extension=j.extension.filter(C=>C.url!==hp),j.extension.push({url:hp,valueSignature:S})):j.extension=j.extension?.filter(C=>C.url!==hp),b())}function y(){const S=o.current.questionnaire;if(S?.item){const j=o.current.questionnaireResponse;Ek(S.item,j)}}function b(){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:bH(o.current.questionnaire,o.current.pages,o.current.activePage),responseItems:SH(o.current.questionnaireResponse,o.current.pages,o.current.activePage),onNextPage:c,onPrevPage:d,onAddGroup:f,onAddAnswer:p,onChangeAnswer:m,onChangeSignature:g}}function xH(e){if(!(!e?.item||Uo(e?.item?.[0],xS)?.valueCodeableConcept?.coding?.[0]?.code!=="page"))return e.item.map((n,r)=>({linkId:n.linkId,title:n.text??`Page ${r+1}`,group:n}))}function bH(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function SH(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function wH(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 jH=250;function CH(e,t,n){return Pk("searchOne",e,t)}function Yc(e,t,n){return Pk("searchResources",e,t)}function Pk(e,t,n,r){const o=_e(),[s,c]=v.useState(),[d,f]=v.useState(!0),[p,m]=v.useState(),[g,y]=v.useState(),b=o.fhirSearchUrl(t,n).toString(),[S]=wH(b,jH,{leading:!0});return v.useEffect(()=>{S!==s&&(c(S),o[e](t,n).then(j=>{f(!1),m(j),y(w8)}).catch(j=>{f(!1),m(void 0),y(Yt(j))}))},[o,e,t,n,s,S]),[p,d,g]}function EH(e){const t=e.value;return t?a.jsx(a.Fragment,{children:nk(t)}):null}const Nk=["meta","implicitRules","contained","extension","modifierExtension"],Ok=["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 wS=["extension","modifierExtension"],TH=["id",...Nk].filter(e=>!wS.includes(e));function RH(e){return Object.entries(e).filter(([n,r])=>!Ln(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||wS.includes(n)&&!Ln(r.slicing?.slices)||TH.includes(n)?!1:!(Ok.includes(n)&&r.path.split(".").length===2||n.includes(".")))}function XT(e,t){return e.line&&e.line.length>t?e.line[t]:""}function JT(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:nB(r)}}function _H(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 b(_){y({...r.current,use:_})}function S(_){y({...r.current,type:_})}function j(_){y(JT(r.current||{},0,_))}function C(_){y(JT(r.current||{},1,_))}function R(_){y({...r.current,city:_})}function E(_){y({...r.current,state:_})}function T(_){y({...r.current,postalCode:_})}return a.jsxs(ye,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(fn,{disabled:e.disabled||s?.readonly,"data-testid":"address-use",defaultValue:t.use,onChange:_=>b(_.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:XT(t,0),onChange:_=>j(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Line 2",defaultValue:XT(t,1),onChange:_=>C(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||p?.readonly,placeholder:"City",defaultValue:t.city,onChange:_=>R(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||m?.readonly,placeholder:"State",defaultValue:t.state,onChange:_=>E(_.currentTarget.value)}),a.jsx(He,{disabled:e.disabled||g?.readonly,placeholder:"Postal Code",defaultValue:t.postalCode,onChange:_=>T(_.currentTarget.value)})]})}function AH(e){const t=ff(),[n,r]=v.useState(e.defaultValue||{});function o(s){const c=s?{text:s,authorReference:t&&Qt(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 DH={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 Fe=(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,...DH[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(([b,S])=>v.createElement(b,S)),...Array.isArray(m)?m:[m]]));return o.displayName=`${n}`,o};const kH=[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]],PH=Fe("outline","adjustments-horizontal","AdjustmentsHorizontal",kH);const NH=[["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=Fe("outline","alert-circle","AlertCircle",NH);const OH=[["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"}]],MH=Fe("outline","arrow-down","ArrowDown",OH);const LH=[["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"}]],IH=Fe("outline","arrow-up","ArrowUp",LH);const zH=[["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"}]],$H=Fe("outline","bleach-off","BleachOff",zH);const UH=[["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"}]],BH=Fe("outline","bleach","Bleach",UH);const VH=[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]],FH=Fe("outline","box-multiple","BoxMultiple",VH);const HH=[["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"}]],qH=Fe("outline","brackets-contain","BracketsContain",HH);const GH=[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]],QH=Fe("outline","brand-asana","BrandAsana",GH);const WH=[["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"}]],YH=Fe("outline","bucket-off","BucketOff",WH);const KH=[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]],XH=Fe("outline","bucket","Bucket",KH);const JH=[["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"}]],ZH=Fe("outline","building","Building",JH);const eq=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],as=Fe("outline","calendar","Calendar",eq);const tq=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Vo=Fe("outline","check","Check",tq);const nq=[["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"}]],rq=Fe("outline","checkbox","Checkbox",nq);const iq=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],jS=Fe("outline","chevron-down","ChevronDown",iq);const oq=[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]],aq=Fe("outline","circle-check","CircleCheck",oq);const sq=[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]],Op=Fe("outline","circle-minus","CircleMinus",sq);const lq=[["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"}]],Mp=Fe("outline","circle-plus","CirclePlus",lq);const cq=[["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"}]],CS=Fe("outline","cloud-upload","CloudUpload",cq);const uq=[["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"}]],dq=Fe("outline","columns","Columns",uq);const fq=[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],ES=Fe("outline","copy","Copy",fq);const hq=[["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"}]],pq=Fe("outline","currency-dollar","CurrencyDollar",hq);const mq=[["path",{d:"M12 6m-8 0a8 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"}]],gq=Fe("outline","database","Database",mq);const vq=[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]],yq=Fe("outline","device-floppy","DeviceFloppy",vq);const xq=[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],bq=Fe("outline","dots","Dots",xq);const Sq=[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]],Mk=Fe("outline","edit","Edit",Sq);const wq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],hf=Fe("outline","equal-not","EqualNot",wq);const jq=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],pf=Fe("outline","equal","Equal",jq);const Cq=[["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"}]],Eq=Fe("outline","eye-off","EyeOff",Cq);const Tq=[["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"}]],Rq=Fe("outline","eye","Eye",Tq);const _q=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]],ZT=Fe("outline","file-alert","FileAlert",_q);const Aq=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]],Dq=Fe("outline","file-plus","FilePlus",Aq);const kq=[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]],Pq=Fe("outline","filter","Filter",kq);const Nq=[["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"}]],Oq=Fe("outline","forms","Forms",Nq);const Mq=[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 8l2 0",key:"svg-2"}],["path",{d:"M15 12l2 0",key:"svg-3"}],["path",{d:"M7 16l10 0",key:"svg-4"}]],Lq=Fe("outline","id","Id",Mq);const Iq=[["path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M9 4l0 16",key:"svg-1"}]],zq=Fe("outline","layout-sidebar","LayoutSidebar",Iq);const $q=[["path",{d:"M13 5h8",key:"svg-0"}],["path",{d:"M13 9h5",key:"svg-1"}],["path",{d:"M13 15h8",key:"svg-2"}],["path",{d:"M13 19h5",key:"svg-3"}],["path",{d:"M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-5"}]],eR=Fe("outline","list-details","ListDetails",$q);const Uq=[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M8 11m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]],Bq=Fe("outline","lock-access","LockAccess",Uq);const Vq=[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]],Fq=Fe("outline","lock","Lock",Vq);const Hq=[["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"}]],qq=Fe("outline","logout","Logout",Hq);const Gq=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],Lk=Fe("outline","math-greater","MathGreater",Gq);const Qq=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],Ik=Fe("outline","math-lower","MathLower",Qq);const Wq=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]],Yq=Fe("outline","message","Message",Wq);const Kq=[["path",{d:"M5 21h14",key:"svg-0"}],["path",{d:"M6 18h2",key:"svg-1"}],["path",{d:"M7 18v3",key:"svg-2"}],["path",{d:"M9 11l3 3l6 -6l-3 -3z",key:"svg-3"}],["path",{d:"M10.5 12.5l-1.5 1.5",key:"svg-4"}],["path",{d:"M17 3l3 3",key:"svg-5"}],["path",{d:"M12 21a6 6 0 0 0 3.715 -10.712",key:"svg-6"}]],Xq=Fe("outline","microscope","Microscope",Kq);const Jq=[["path",{d:"M5 12l14 0",key:"svg-0"}]],Zq=Fe("outline","minus","Minus",Jq);const eG=[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-0"}],["path",{d:"M2 13.5v5.5l5 3",key:"svg-1"}],["path",{d:"M7 16.545l5 -3.03",key:"svg-2"}],["path",{d:"M17 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-3"}],["path",{d:"M12 19l5 3",key:"svg-4"}],["path",{d:"M17 16.5l5 -3",key:"svg-5"}],["path",{d:"M12 13.5v-5.5l-5 -3l5 -3l5 3v5.5",key:"svg-6"}],["path",{d:"M7 5.03v5.455",key:"svg-7"}],["path",{d:"M12 8l5 -3",key:"svg-8"}]],tG=Fe("outline","packages","Packages",eG);const nG=[["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"}]],rG=Fe("outline","pin","Pin",nG);const iG=[["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"}]],oG=Fe("outline","pinned-off","PinnedOff",iG);const aG=[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]],sG=Fe("outline","player-play","PlayerPlay",aG);const lG=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],zk=Fe("outline","plus","Plus",lG);const cG=[["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"}]],uG=Fe("outline","receipt","Receipt",cG);const dG=[["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"}]],$k=Fe("outline","refresh","Refresh",dG);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=Fe("outline","repeat","Repeat",fG);const pG=[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]],mG=Fe("outline","report-medical","ReportMedical",pG);const gG=[["path",{d:"M3 13m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17l0 .01",key:"svg-1"}],["path",{d:"M13 17l0 .01",key:"svg-2"}],["path",{d:"M15 13l0 -2",key:"svg-3"}],["path",{d:"M11.75 8.75a4 4 0 0 1 6.5 0",key:"svg-4"}],["path",{d:"M8.5 6.5a8 8 0 0 1 13 0",key:"svg-5"}]],vG=Fe("outline","router","Router",gG);const yG=[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],TS=Fe("outline","search","Search",yG);const xG=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],Wx=Fe("outline","settings","Settings",xG);const bG=[["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"}]],RS=Fe("outline","sort-ascending","SortAscending",bG);const SG=[["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"}]],_S=Fe("outline","sort-descending","SortDescending",SG);const wG=[["path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}]],jG=Fe("outline","square","Square",wG);const CG=[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z",key:"svg-0"}]],EG=Fe("outline","star","Star",CG);const TG=[["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"}]],RG=Fe("outline","switch-horizontal","SwitchHorizontal",TG);const _G=[["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"}]],AG=Fe("outline","table-export","TableExport",_G);const DG=[["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"}]],kG=Fe("outline","text-recognition","TextRecognition",DG);const PG=[["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"}]],Ym=Fe("outline","trash","Trash",PG);const NG=[["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"}]],tR=Fe("outline","upload","Upload",NG);const OG=[["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"}]],MG=Fe("outline","webhook","Webhook",OG);const LG=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],yl=Fe("outline","x","X",LG);const IG=[["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"}]],zG=Fe("filled","circle-filled","CircleFilled",IG);class AS extends v.Component{state;constructor(t){super(t),this.state={lastLocation:nr.getLocation()}}static getDerivedStateFromError(t){return{error:t,lastLocation:nr.getLocation()}}componentDidUpdate(t,n){nr.getLocation()!==this.state.lastLocation&&this.setState({lastLocation:nr.getLocation(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==nr.getLocation())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx($o,{icon:a.jsx(As,{size:16}),title:"Something went wrong",color:"red",children:Qe(this.state.error)}):this.props.children}}function Ni(){return a.jsx(hr,{style:{width:"100%",height:"100vh"},children:a.jsx(Ir,{})})}const $G="_main_6f7o5_1",UG={main:$G};function mn(e){e.preventDefault(),e.stopPropagation()}function Uk(e){return e.button===1||e.ctrlKey||e.metaKey}function Bk(e){if(nR(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&nR(t[0]))return!0}return!1}function nR(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function xd(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 Vk(e,t){const n=new Blob([e],{type:nn.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 jt(e){const t=df(),{to:n,suffix:r,label:o,onClick:s,children:c,...d}=e;let f=BG(n);return r&&(f+="/"+r),a.jsx(Mt,{href:f,"aria-label":o,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),s?(p.preventDefault(),s(p)):n&&(Uk(p)||(p.preventDefault(),t(f)))},...d,children:c})}function BG(e){if(e){if(typeof e=="string")return VG(e);if(Bo(e))return FG(e);if(_a(e))return HG(e)}return"#"}function VG(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function FG(e){return`/${e.resourceType}/${e.id}`}function HG(e){return`/${e.reference}`}function qG(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 Aa(e){const t=Kt(e.value),n=t?ba(t):e.alt??"",r=qG(n),o=(t&&JU(t))??e.src,s=Ck(o??void 0),c=e.radius??"xl",d={...e,value:void 0,link:void 0};return e.link?a.jsx(jt,{to:t,children:a.jsx(hl,{src:s,alt:n,radius:c,...d,children:r})}):a.jsx(hl,{src:s,alt:n,radius:c,...d,children:r})}const GG="_logoButton_799cf_1",QG="_user_799cf_11",WG="_userName_799cf_25",Zy={logoButton:GG,user:QG,userName:WG};function DS(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Rs(t,e.options)}):null}function Fk(){return"Medplum"}function Hk(e){const t=Wm(),{medplum:n,profile:r,navigate:o}=t,s=n.getLogins(),{colorScheme:c,setColorScheme:d}=u5(),[f]=v.useState(localStorage.appShellLayoutVersion??"v1");function p(m){localStorage.appShellLayoutVersion=m,nr.reload()}return a.jsxs(a.Fragment,{children:[a.jsxs(Ue,{align:"center",p:"xl",children:[a.jsx(Aa,{size:"xl",radius:100,value:t.profile}),a.jsx(DS,{value:t.profile?.name?.[0]}),a.jsx(Ee,{c:"dimmed",size:"xs",children:n.getActiveLogin()?.project.display})]}),s.length>1&&a.jsx(xe.Divider,{}),s.map(m=>m.profile.reference!==Ot(t.profile)&&a.jsx(xe.Item,{onClick:()=>{n.setActiveLogin(m).then(()=>nr.reload()).catch(console.log)},children:a.jsxs(ye,{children:[a.jsx(hl,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Ee,{size:"sm",fw:500,children:m.profile.display}),a.jsx(Ee,{c:"dimmed",size:"xs",children:m.project.display})]})]})},m.profile.reference)),a.jsx(xe.Divider,{}),a.jsxs(ye,{justify:"center",children:[a.jsx(qc,{size:"xs",value:c,onChange:m=>d(m),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]}),a.jsx(qc,{size:"xs",value:f,onChange:m=>p(m),data:[{label:"v1",value:"v1"},{label:"v2",value:"v2"}]})]}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(RG,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),a.jsx(xe.Item,{leftSection:a.jsx(Wx,{size:14,stroke:1.5}),onClick:()=>o(`/${Ot(r)}`),children:"Account settings"}),a.jsx(xe.Item,{leftSection:a.jsx(qq,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsxs(Ee,{size:"xs",c:"dimmed",my:"sm",ta:"center",children:[Fk()," ",e.version]})]})}const rR={selectedItems:"selected-items",options:"options"};function kS(e){const t=Rl({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:b,creatable:S,clearable:j,required:C,placeholder:R,leftSection:E,maxValues:T,optionsDropdownMaxHeight:_=320,minInputLength:k=0,...I}=e,A=I.disabled,P=YG(c),[z,B]=v.useState(""),[Y,J]=v.useState(),[Z,$]=v.useState(),[Q,M]=v.useState(),[L,U]=v.useState(P.map(d)),[V,K]=v.useState([]),O=p??KG,F=m??XG,ae=g??JG,ue=v.useRef(z);ue.current=z;const be=v.useRef(void 0),we=v.useRef(void 0),Ce=v.useRef(Y);Ce.current=Y;const nt=v.useRef(Z);nt.current=Z;const De=v.useRef(Q);De.current=Q;const ft=v.useRef(V);ft.current=V;const ot=v.useCallback(()=>{if(J(void 0),ue.current===we.current&&f===be.current||(ue.current?.length??0)<k)return;we.current=ue.current,be.current=f;const Oe=new AbortController;$(Oe),f(ue.current??"",Oe.signal).then(ct=>{Oe.signal.aborted||(K(ct.map(d)),De.current?(ct.length>0&&y(ct.slice(0,1)),M(!1)):ct.length>0&&t.openDropdown())}).catch(ct=>{Oe.signal.aborted||ct.message.includes("aborted")||Ne({color:"red",message:Qe(ct)})}).finally(()=>{Oe.signal.aborted||$(void 0)})},[t,f,y,d,k]),ht=v.useCallback(Oe=>{(V&&V.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),B(Oe.currentTarget.value),nt.current&&(nt.current.abort(),$(void 0)),Ce.current!==void 0&&window.clearTimeout(Ce.current);const ct=window.setTimeout(()=>ot(),100);J(ct)},[t,V,S,ot]),st=v.useCallback(Oe=>{const ct=L.some(pe=>pe.value===Oe),tt=ct?L.filter(pe=>pe.value!==Oe):[...L];let lt=V?.find(pe=>pe.value===Oe);if(!lt&&S!==!1&&b){const pe=b(Oe);lt=d(pe)}if(lt){if(T===0){y([lt.resource]),L.length>0&&U([]);return}ct||tt.push(lt)}if(T!==void 0)for(;tt.length>T;)tt.shift();y(tt.map(pe=>pe.resource)),U(tt)},[S,V,L,T,y,b,d]),yt=v.useMemo(()=>{if(!A)return Oe=>{A||(T===1&&(B(""),K([]),t.closeDropdown()),we.current=void 0,Oe==="$create"?(B(""),st(z)):st(Oe))}},[st,t,A,T,z]),mt=v.useCallback(Oe=>{const ct=L.filter(tt=>tt.value!==Oe.value);y(ct.map(tt=>tt.resource)),U(ct)},[L,y]),It=v.useCallback(Oe=>{Oe.key==="Enter"?(Y||Z)&&M(!0):Oe.key==="Backspace"&&z.length===0&&(mn(Oe),mt(L[L.length-1]))},[Z,mt,z.length,L,Y]);v.useEffect(()=>()=>{nt.current&&nt.current.abort()},[]);const Te=!A&&j&&L.length>0&&a.jsx(Xe.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{B(""),U([]),y([]),t.closeDropdown()}}),Re=S&&z.trim().length>0,Ie=V.length>0||Re;return a.jsxs(Xe,{store:t,onOptionSubmit:yt,withinPortal:!0,shadow:"xl",...I,children:[a.jsx(Xe.DropdownTarget,{children:a.jsx(ys,{label:r,description:o,error:s,className:e.className,leftSection:E,rightSection:Z?a.jsx(Ir,{size:16}):Te,required:C,disabled:A,children:a.jsxs(ya.Group,{"data-testid":rR.selectedItems,children:[L.map(Oe=>a.jsx(F,{item:Oe,disabled:A,onRemove:()=>mt(Oe)},Oe.value)),!A&&(T===void 0||T===0||L.length<T)&&a.jsx(Xe.EventsTarget,{children:a.jsx(ys.Field,{role:"searchbox",name:n,value:z,placeholder:R,onFocus:ht,onBlur:()=>{t.closeDropdown(),B("")},onKeyDown:It,onChange:ht})})]})})}),a.jsx(Xe.Dropdown,{hidden:!Ie,"data-testid":rR.options,children:a.jsx(Xe.Options,{children:a.jsxs(um,{type:"scroll",mah:_,children:[V.map(Oe=>{const ct=L.some(tt=>tt.value===Oe.value);return a.jsx(Xe.Option,{value:Oe.value,active:ct,children:a.jsx(O,{...Oe,active:ct})},Oe.value)}),Re&&a.jsxs(Xe.Option,{value:"$create",children:["+ Create ",z]}),!S&&z.trim().length>0&&V.length===0&&a.jsx(ae,{search:z})]})})})]})}function YG(e){return e?Array.isArray(e)?e:[e]:[]}function KG(e){return a.jsxs(ye,{gap:"xs",children:[e.active&&a.jsx(Vo,{size:12}),a.jsx("span",{children:e.label})]})}function XG({item:e,disabled:t,onRemove:n}){return a.jsx(ya,{withRemoveButton:!t,onRemove:n,children:e.label})}function JG(){return a.jsx(Xe.Empty,{children:"Nothing found"})}const ZG="_searchInput_dick8_1",eQ={searchInput:ZG};function tQ(e){return{value:e.id,label:ba(e),resource:e}}function nQ(e){const t=df(),n=_e(),r=v.useCallback(async(s,c)=>{const d=iQ(s),f={signal:c},p=await n.graphql(d,void 0,void 0,f);return oQ(p,s)},[n]),o=v.useCallback(s=>{s.length>0&&t(`/${Ot(s[0])}`)},[t]);return a.jsx(kS,{size:"sm",radius:"md",className:eQ.searchInput,leftSection:a.jsx(TS,{size:16}),placeholder:"Search",itemComponent:rQ,toOption:tQ,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const rQ=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(ye,{wrap:"nowrap",children:[a.jsx(Aa,{value:e}),a.jsxs("div",{children:[a.jsx(Ee,{children:ba(e)}),a.jsx(Ee,{size:"xs",c:"dimmed",children:o})]})]})})});function iQ(e){const t=JSON.stringify(e);return oS(e)?`{
|
|
100
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
101
|
-
resourceType
|
|
102
|
-
id
|
|
103
|
-
identifier {
|
|
104
|
-
system
|
|
105
|
-
value
|
|
106
|
-
}
|
|
107
|
-
name {
|
|
108
|
-
given
|
|
109
|
-
family
|
|
110
|
-
}
|
|
111
|
-
birthDate
|
|
112
|
-
}
|
|
113
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
114
|
-
resourceType
|
|
115
|
-
id
|
|
116
|
-
identifier {
|
|
117
|
-
system
|
|
118
|
-
value
|
|
119
|
-
}
|
|
120
|
-
subject {
|
|
121
|
-
display
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}`.replaceAll(/\s+/g," "):`{
|
|
125
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
126
|
-
resourceType
|
|
127
|
-
id
|
|
128
|
-
identifier {
|
|
129
|
-
system
|
|
130
|
-
value
|
|
131
|
-
}
|
|
132
|
-
name {
|
|
133
|
-
given
|
|
134
|
-
family
|
|
135
|
-
}
|
|
136
|
-
birthDate
|
|
137
|
-
}
|
|
138
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
139
|
-
resourceType
|
|
140
|
-
id
|
|
141
|
-
identifier {
|
|
142
|
-
system
|
|
143
|
-
value
|
|
144
|
-
}
|
|
145
|
-
name {
|
|
146
|
-
given
|
|
147
|
-
family
|
|
148
|
-
}
|
|
149
|
-
birthDate
|
|
150
|
-
}
|
|
151
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
152
|
-
resourceType
|
|
153
|
-
id
|
|
154
|
-
identifier {
|
|
155
|
-
system
|
|
156
|
-
value
|
|
157
|
-
}
|
|
158
|
-
subject {
|
|
159
|
-
display
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}`.replaceAll(/\s+/g," ")}function oQ(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),sQ(aQ(n),t).slice(0,5)}function aQ(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 sQ(e,t){return e.sort((n,r)=>iR(r,t)-iR(n,t))}function iR(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,oR(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,oR(Rs(r),t));return n}function oR(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function lQ(e){const t=ff(),[n,r]=v.useState(!1);return a.jsx(br.Header,{p:8,style:{zIndex:101},children:a.jsxs(ye,{justify:"space-between",children:[a.jsxs(ye,{gap:"xs",children:[a.jsx(An,{className:Zy.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(ye,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(xe,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"fade-down"},opened:n,onClose:()=>r(!1),children:[a.jsx(xe.Target,{children:a.jsx(An,{className:Zy.user,"aria-label":"User menu","data-active":n||void 0,onClick:()=>r(o=>!o),children:a.jsxs(ye,{gap:7,children:[a.jsx(Aa,{value:t,radius:"xl",size:24}),a.jsx(Ee,{size:"sm",className:Zy.userName,children:Rs(t?.name?.[0])}),a.jsx(jS,{size:12,stroke:1.5})]})})}),a.jsx(xe.Dropdown,{children:a.jsx(Hk,{version:e.version})})]})]})]})})}const cQ=()=>jD({opened:!1,empty:!1,selected:-1,listId:"",query:"",registeredActions:new Set}),uQ=e=>CD(e);function Kc(e,t){const n=t.getState();t.setState({...n,...e(t.getState())})}function qk(e){Kc(()=>({opened:!0,selected:-1}),e)}function Gk(e){Kc(()=>({opened:!1}),e)}function Qk(e){Kc(t=>({opened:!t.opened,selected:t.opened?t.selected:-1}),e)}function Wk(e,t){t.updateState(n=>({...n,selected:e}))}function dQ(e,t){t.updateState(n=>({...n,listId:e}))}function Lp(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=Lp(e,s.shadowRoot);if(d)return d}const c=Lp(e,s);if(c)return c}return null}function Km(e,t){const n=t.getState(),r=n.listId?Lp(`#${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=vd(c,0,s.length-1);return o?.removeAttribute("data-selected"),s[d]?.scrollIntoView({block:"nearest"}),s[d]?.setAttribute("data-selected","true"),Wk(d,t),d}function fQ(e){return Km(e.getState().selected+1,e)}function hQ(e){return Km(e.getState().selected-1,e)}function pQ(e){const t=e.getState();Lp(`#${t.listId} [data-selected]`)?.click()}function mQ(e,t){const n=t.getState();return n.registeredActions.add(e),()=>{n.registeredActions.delete(e)}}function gQ(e,t){Kc(()=>({query:e}),t),Promise.resolve().then(()=>{Km(0,t),Kc(n=>({empty:n.query.trim().length>0&&n.registeredActions.size===0||!1}),t)})}function vQ({clearQuery:e},t){t.updateState(n=>({...n,selected:-1,query:e?"":n.query,empty:e?!1:n.empty}))}const To={open:qk,close:Gk,toggle:Qk,updateState:Kc,setSelectedAction:Wk,setListId:dQ,selectAction:Km,selectNextAction:fQ,selectPreviousAction:hQ,triggerSelectedAction:pQ,registerAction:mQ,setQuery:gQ,clearSpotlightState:vQ};function yQ(){const e=cQ();return[e,{open:()=>qk(e),close:()=>Gk(e),toggle:()=>Qk(e)}]}const[Yk,mf]=yQ(),{open:toe,close:noe,toggle:roe}=mf;function Kk(e){const t=e;return t.group!==void 0&&Array.isArray(t.actions)}function xQ(e){return Array.isArray(e)?e.map(t=>t.trim()).join(",").toLowerCase().trim():typeof e=="string"?e.toLowerCase().trim():""}function bQ(e){return e.reduce((t,n)=>"actions"in n?[...t,...n.actions.map(r=>({...r,group:n.group}))]:[...t,n],[])}function SQ(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 wQ=(e,t)=>{const n=e.trim().toLowerCase(),r=[[],[]];return bQ(t).forEach(s=>{s.label?.toLowerCase().includes(n)?r[0].push(s):(s.description?.toLowerCase().includes(n)||xQ(s.keywords).includes(n))&&r[1].push(s)}),SQ(r.flat())};function Xk(e,t){if(!Array.isArray(e))return[];let n=0;return e.reduce((r,o)=>{if(n>=t)return r;if(Kk(o)){const s=Xk(o.actions,t-n);r.push({group:o.group,actions:s}),n+=s.length}else r.push(o),n+=1;return r},[])}const[jQ,du]=jr("Spotlight component was not found in tree");var Oo={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 CQ={dimmedSections:!0,highlightQuery:!1},Ld=ge((e,t)=>{const n=ie("SpotlightAction",CQ,e),{className:r,style:o,classNames:s,styles:c,id:d,description:f,label:p,leftSection:m,rightSection:g,children:y,dimmedSections:b,highlightQuery:S,highlightColor:j,closeSpotlightOnTrigger:C,onClick:R,onMouseDown:E,keywords:T,vars:_,...k}=n,I=du(),A={classNames:s,styles:c},P=S&&typeof p=="string"?a.jsx(b0,{component:"span",highlight:I.query,color:j,...I.getStyles("actionLabel",A),children:p}):a.jsx("span",{...I.getStyles("actionLabel",A),children:p});return a.jsx(An,{ref:t,"data-action":!0,...I.getStyles("action",{className:r,style:o,...A}),...k,onMouseDown:z=>{z.preventDefault(),E?.(z)},onClick:z=>{R?.(z),(C??I.closeOnActionTrigger)&&To.close(I.store)},tabIndex:-1,children:y||a.jsxs(a.Fragment,{children:[m&&a.jsx(ce,{component:"span",mod:{position:"left",dimmed:b},...I.getStyles("actionSection",A),children:m}),a.jsxs("span",{...I.getStyles("actionBody",A),children:[P,a.jsx("span",{...I.getStyles("actionDescription",A),children:f})]}),g&&a.jsx(ce,{component:"span",mod:{position:"right",dimmed:b},...I.getStyles("actionSection",A),children:g})]})})});Ld.classes=Oo;Ld.displayName="@mantine/spotlight/SpotlightAction";const Xm=ge((e,t)=>{const{className:n,style:r,styles:o,classNames:s,label:c,children:d,...f}=ie("SpotlightActionsGroup",null,e),p=du();return a.jsx(ce,{...p.getStyles("actionsGroup",{className:n,style:r,classNames:s,styles:o}),ref:t,...f,__vars:{"--spotlight-label":`'${c?.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`},children:d})});Xm.classes=Oo;Xm.displayName="@mantine/core/SpotlightActionsGroup";const Jm=ge((e,t)=>{const{className:n,style:r,id:o,children:s,vars:c,classNames:d,styles:f,...p}=ie("SpotlightActionsList",null,e),m=du(),g=`mantine-${v.useId().replace(/:/g,"")}`,y=o||g;return v.useEffect(()=>(To.setListId(y,m.store),()=>To.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})});Jm.classes=Oo;Jm.displayName="@mantine/spotlight/SpotlightActionsList";const Zm=ge((e,t)=>{const{className:n,style:r,classNames:o,styles:s,...c}=ie("SpotlightEmpty",null,e),d=du();return a.jsx(ce,{ref:t,...d.getStyles("empty",{classNames:o,styles:s,className:n,style:r}),...c})});Zm.classes=Oo;Zm.displayName="@mantine/spotlight/SpotlightEmpty";const PS=ge((e,t)=>{const{className:n,style:r,classNames:o,styles:s,...c}=ie("SpotlightFooter",null,e),d=du();return a.jsx(ce,{ref:t,...d.getStyles("footer",{className:n,classNames:o,style:r,styles:s}),...c})});PS.classes=Oo;PS.displayName="@mantine/spotlight/SpotlightFooter";function EQ(e,t){if(!e)return[];const n=()=>To.open(t);return Array.isArray(e)?e.map(r=>[r,n]):[[e,n]]}const TQ={size:600,yOffset:80,zIndex:zr("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"},store:Yk,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K",maxHeight:400},eg=ge((e,t)=>{const n=ie("SpotlightRoot",TQ,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,store:p,children:m,query:g,onQueryChange:y,transitionProps:b,clearQueryOnClose:S,shortcut:j,tagsToIgnore:C,triggerOnContentEditable:R,disabled:E,onSpotlightOpen:T,onSpotlightClose:_,forceOpened:k,closeOnActionTrigger:I,maxHeight:A,scrollable:P,attributes:z,...B}=n,Y=gn(),{opened:J,query:Z}=uQ(p),$=typeof g=="string"?g:Z,Q=L=>{y?.(L),To.setQuery(L,p)},M=Le({name:"Spotlight",classes:Oo,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:z});return v4(EQ(j,p),C,R),gs(()=>{J?T?.():_?.()},[J]),E?null:a.jsx(jQ,{value:{getStyles:M,query:$,setQuery:Q,store:p,closeOnActionTrigger:I},children:a.jsx(Vn,{ref:t,...B,withCloseButton:!1,opened:J||!!k,padding:0,onClose:()=>To.close(p),className:o,style:s,classNames:Fd({theme:Y,classNames:[Oo,r],props:n,stylesCtx:void 0}),styles:jd({theme:Y,styles:c,props:n,stylesCtx:void 0}),transitionProps:{...b,onExited:()=>{S&&Q(""),To.clearSpotlightState({clearQuery:S},p),b?.onExited?.()}},__vars:{"--spotlight-max-height":P?le(A):void 0},__staticSelector:"Spotlight","data-scrollable":P||void 0,children:m})})});eg.classes=Oo;eg.displayName="@mantine/spotlight/SpotlightRoot";const RQ={size:"lg"},tg=ge((e,t)=>{const{classNames:n,styles:r,onKeyDown:o,onChange:s,vars:c,value:d,...f}=ie("SpotlightSearch",RQ,e),p=du(),m=p.getStyles("search"),[g,y]=v.useState(!1),b=S=>{o?.(S),!g&&(S.nativeEvent.code==="ArrowDown"&&(S.preventDefault(),To.selectNextAction(p.store)),S.nativeEvent.code==="ArrowUp"&&(S.preventDefault(),To.selectPreviousAction(p.store)),(S.nativeEvent.code==="Enter"||S.nativeEvent.code==="NumpadEnter")&&(S.preventDefault(),To.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:b,onCompositionStart:()=>y(!0),onCompositionEnd:()=>y(!1)})});tg.classes=Oo;tg.displayName="@mantine/spotlight/SpotlightSearch";const _Q={size:600,yOffset:80,limit:1/0,zIndex:zr("max"),overlayProps:{backgroundOpacity:.35,blur:7},transitionProps:{duration:200,transition:"pop"},store:Yk,filter:wQ,clearQueryOnClose:!0,closeOnActionTrigger:!0,shortcut:"mod + K"},pi=ge((e,t)=>{const n=ie("Spotlight",_Q,e),{searchProps:r,filter:o,query:s,onQueryChange:c,actions:d,nothingFound:f,highlightQuery:p,limit:m,scrollAreaProps:g,...y}=n,[b,S]=rr({value:s,defaultValue:"",finalValue:"",onChange:c}),j=Xk(o(b,d),m).map(C=>{if(Kk(C)){const R=C.actions.map(({id:E,...T})=>a.jsx(Ld,{highlightQuery:p,...T},E));return a.jsx(Xm,{label:C.group,children:R},C.group)}return a.jsx(Ld,{highlightQuery:p,...C},C.id)});return a.jsxs(eg,{...y,query:b,onQueryChange:S,ref:t,children:[a.jsx(tg,{...r}),a.jsxs(Jm,{...g,children:[j,j.length===0&&f&&a.jsx(Zm,{children:f})]})]})});pi.classes=Oo;pi.displayName="@mantine/spotlight/Spotlight";pi.Search=tg;pi.ActionsList=Jm;pi.Action=Ld;pi.Empty=Zm;pi.ActionsGroup=Xm;pi.Footer=PS;pi.Root=eg;pi.open=mf.open;pi.close=mf.close;pi.toggle=mf.toggle;const NS=v.createContext({submitting:!1});NS.displayName="FormContext";function AQ(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?DQ(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&kQ(t,n);return t}function DQ(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function kQ(e,t){e[t.name]=t.value}function pt(e){const[t,n]=v.useState(!1);return a.jsx(NS.Provider,{value:{submitting:t},children:a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const o=AQ(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(NS);return a.jsx(Pe,{type:"submit",loading:r,...n,children:t})}function PQ(e){const t=_e(),n=t.getUserConfiguration();function r(o){const{menuname:s,bookmarkname:c}=o,d=`${e.pathname}?${e.searchParams.toString()}`,f=hi(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"}),Ne({color:"green",message:"Success"}),e.onOk()}).catch(m=>{Ne({color:"red",message:Qe(m)})})}return a.jsx(Vn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(pt,{onSubmit:r,children:a.jsxs(Ue,{children:[a.jsx(NQ,{config:n}),a.jsx(He,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Cr,{mt:"sm",children:"OK"})})]})})})}function NQ(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 Jk(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function OQ(e){return typeof e.display=="string"?e.display:Jk(e)}function MQ(e){return{value:Jk(e),label:OQ(e),resource:e}}function LQ(e){return{code:e,display:e}}function gf(e){const t=_e(),{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??[],b=[];for(const S of y)S.code&&!b.some(j=>j.code===S.code)&&b.push(S);return b},[t,s,n]);return a.jsx(kS,{...d,creatable:r??!0,clearable:o??!0,toOption:MQ,loadOptions:f,onCreate:LQ,itemComponent:c?IQ:void 0})}const IQ=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(ye,{wrap:"nowrap",gap:"xs",children:[n&&a.jsx(Vo,{size:12}),a.jsxs("div",{children:[a.jsx(Ee,{children:e}),a.jsx(Ee,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function Zk(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[s,c]=v.useState(t);function d(f){const p=f[0],m=$Q(p);c(m),n&&n(m)}return a.jsx(gf,{defaultValue:zQ(s),onChange:d,withHelpText:r??!0,...o})}function zQ(e){return e?{code:e}:void 0}function $Q(e){return e?.code}function OS(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,o=v.useCallback(s=>{n(s),r&&r(s)},[r]);return a.jsx(Zk,{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 UQ="_navbar_50pih_1",BQ="_logoButton_50pih_6",VQ="_menuTitle_50pih_17",FQ="_link_50pih_29",HQ="_toggleButton_50pih_77",el={navbar:UQ,logoButton:BQ,menuTitle:VQ,link:FQ,toggleButton:HQ};function qQ(){const e=_e(),t=df(),[n,r]=v.useState("Type to search..."),[o,s]=v.useState([]),c=d=>{if(!d){r("Type to search..."),s([]);return}r("Searching...");const f=GQ(d);e.graphql(f).then(p=>{const m=QQ(p),g=YQ(m,t);s(g)}).catch(p=>{console.error("GraphQL query failed:",p)}).finally(()=>{r("No results found")})};return a.jsx(pi,{actions:o,nothingFound:n,highlightQuery:!0,searchProps:{leftSection:a.jsx(TS,{size:20,stroke:1.5}),placeholder:"Search..."},onQueryChange:c})}function GQ(e){const t=JSON.stringify(e);return oS(e)?`{
|
|
163
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
164
|
-
resourceType
|
|
165
|
-
id
|
|
166
|
-
identifier {
|
|
167
|
-
system
|
|
168
|
-
value
|
|
169
|
-
}
|
|
170
|
-
name {
|
|
171
|
-
given
|
|
172
|
-
family
|
|
173
|
-
}
|
|
174
|
-
birthDate
|
|
175
|
-
}
|
|
176
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
177
|
-
resourceType
|
|
178
|
-
id
|
|
179
|
-
identifier {
|
|
180
|
-
system
|
|
181
|
-
value
|
|
182
|
-
}
|
|
183
|
-
subject {
|
|
184
|
-
display
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}`.replaceAll(/\s+/g," "):`{
|
|
188
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
189
|
-
resourceType
|
|
190
|
-
id
|
|
191
|
-
identifier {
|
|
192
|
-
system
|
|
193
|
-
value
|
|
194
|
-
}
|
|
195
|
-
name {
|
|
196
|
-
given
|
|
197
|
-
family
|
|
198
|
-
}
|
|
199
|
-
birthDate
|
|
200
|
-
}
|
|
201
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
202
|
-
resourceType
|
|
203
|
-
id
|
|
204
|
-
identifier {
|
|
205
|
-
system
|
|
206
|
-
value
|
|
207
|
-
}
|
|
208
|
-
name {
|
|
209
|
-
given
|
|
210
|
-
family
|
|
211
|
-
}
|
|
212
|
-
birthDate
|
|
213
|
-
}
|
|
214
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
215
|
-
resourceType
|
|
216
|
-
id
|
|
217
|
-
identifier {
|
|
218
|
-
system
|
|
219
|
-
value
|
|
220
|
-
}
|
|
221
|
-
subject {
|
|
222
|
-
display
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}`.replaceAll(/\s+/g," ")}function QQ(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),WQ(t)}function WQ(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 YQ(e,t){const n=[],r=[];for(const s of e)s.resourceType==="Patient"?n.push({id:s.id,label:s.name?Rs(s.name[0]):s.id,description:s.birthDate,onClick:()=>t(`/Patient/${s.id}`)}):s.resourceType==="ServiceRequest"&&r.push({id:s.id,label:s.id,description:s.subject?.display,onClick:()=>t(`/ServiceRequest/${s.id}`)});const o=[];return n.length>0&&o.push({group:"Patients",actions:n}),r.length>0&&o.push({group:"Service Requests",actions:r}),o}function aR(e){const t=df(),n=ff(),r=KQ(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(br.Navbar,{id:"navbar",className:el.navbar,children:[e.logo&&a.jsx(br.Section,{px:"sm",py:"xs",children:a.jsx(An,{className:el.logoButton,onClick:e.navbarToggle,"aria-expanded":m,"aria-controls":"navbar",children:e.logo})}),a.jsx(Jr,{px:"sm",py:"xs",h:"100%",children:a.jsxs(br.Section,{grow:!0,children:[e.spotlightEnabled&&a.jsx(sR,{active:!1,onClick:mf.open,icon:a.jsx(TS,{size:"1.2rem"}),label:"Search",opened:m}),e.spotlightEnabled&&a.jsx(qQ,{}),!e.resourceTypeSearchDisabled&&a.jsx(br.Section,{mb:"sm",children:a.jsx(OS,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:g=>p(g)},window.location.pathname)}),e.menus?.map(g=>a.jsxs(v.Fragment,{children:[m?a.jsx(Ee,{className:el.menuTitle,children:g.title}):a.jsx(Im,{h:41}),g.links?.map(y=>a.jsx(sR,{active:y.href===r?.href,onClick:b=>f(b,y.href),icon:y.icon,label:y.label??"",opened:m},y.href))]},`menu-${g.title}`)),e.displayAddBookmark&&a.jsx(Pe,{variant:"subtle",size:"xs",mt:"xl",leftSection:a.jsx(zk,{size:"0.75rem"}),onClick:()=>d(!0),children:"Add Bookmark"})]})}),e.userMenuEnabled&&a.jsxs(br.Section,{px:"sm",py:"xs",children:[a.jsx(to,{label:"Toggle navbar",position:"right",transitionProps:{duration:0},children:a.jsx(An,{className:el.toggleButton,"aria-label":"Toggle navbar",onClick:e.navbarToggle,"aria-expanded":m,"aria-controls":"navbar",children:a.jsx(zq,{})})}),a.jsxs(xe,{width:260,shadow:"xl",position:"top-start",transitionProps:{transition:"fade-up"},opened:o,onClose:()=>s(!1),children:[a.jsx(xe.Target,{children:a.jsxs(An,{className:el.link,"aria-label":"User menu","data-active":o||void 0,onClick:()=>s(g=>!g),children:[a.jsx(Aa,{value:n,radius:"xl",size:18}),m&&a.jsx("span",{children:Rs(n?.name?.[0])})]})}),a.jsx(xe.Dropdown,{children:a.jsx(Hk,{version:e.version})})]})]})]}),e.pathname&&e.searchParams&&a.jsx(PQ,{pathname:e.pathname,searchParams:e.searchParams,visible:c,onOk:()=>d(!1),onCancel:()=>d(!1)})]})}function sR(e){const{icon:t,label:n,onClick:r,active:o}=e;return e.opened?a.jsxs(An,{onClick:r,className:el.link,"data-active":o||void 0,children:[t,a.jsx("span",{children:n})]}):a.jsx(to,{label:n,position:"right",transitionProps:{duration:0},children:a.jsx(An,{onClick:r,className:el.link,"data-active":o||void 0,children:t})})}function KQ(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=XQ(e,t,c.href);d>o&&(o=d,r=c)}return r}function XQ(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 lR=250,JQ=70;function ZQ(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),[r]=v.useState(e.layoutVersion??localStorage.appShellLayoutVersion??"v1"),o=_e(),s=ff();function c(b){localStorage.navbarOpen=b.toString(),n(b)}function d(){c(!1)}function f(){c(!t)}if(o.isLoading())return a.jsx(Ni,{});let p,m,g,y;return r==="v2"?(p={height:0},m={width:t?lR:JQ,breakpoint:0,collapsed:{desktop:!s,mobile:!s}},g=void 0,y=s?a.jsx(aR,{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,userMenuEnabled:!0}):void 0):(p={height:60},m={width:lR,breakpoint:"sm",collapsed:{desktop:!s||!t,mobile:!s||!t}},g=s&&a.jsx(lQ,{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(aR,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,navbarToggle:f,closeNavbar:d,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0),a.jsxs(br,{header:p,navbar:m,padding:0,children:[g,y,a.jsx(br.Main,{className:UG.main,children:a.jsx(AS,{children:a.jsx(v.Suspense,{fallback:a.jsx(Ni,{}),children:e.children})})})]})}const eW="https://ccda.medplum.com",tW="https://ccda-validator.medplum.com/";function nW(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&&(xd(o.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{f(!0);const b=await(await fetch(t)).text(),S=new FormData;S.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${tW}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(j,{method:"POST",body:S,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const R=await C.json();c(R)}catch(y){c(void 0),console.error("CCDA validation error:",y)}finally{f(!1)}},m=()=>{if(!s)return;const y=JSON.stringify(s,null,2);Vk(y,"ccda-validation-results")},g=()=>s?s.resultsMetaData.resultMetaData.filter(y=>y?.type.includes("Error")).reduce((y,b)=>y+(b.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:eW,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),a.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[a.jsx(Pe,{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(Pe,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function vf(e){const{contentType:t,url:n,title:r}=e.value??{},o=Ck(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===nn.CDA_XML&&a.jsx(nW,{url:o}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(Mt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:rW(r),children:r||"Download"})})]}):null}function rW(e){return e?.includes(".")?e:void 0}const iW="_root_1bd5a_1",oW="_compact_1bd5a_19",cR={root:iW,compact:oW};function yf(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:Ut(cR.root,{[cR.compact]:n}),children:t})}function Lr(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function aW(e){const t=e.values?.map((r,o)=>a.jsx("div",{children:a.jsx(vf,{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(!Ln(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const r=e.path.split(".").pop();n=a.jsx(Lr,{term:gl(r),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function MS(e){const t=_e(),n=v.useRef(null);function r(c){mn(c),n.current?.click()}function o(c){mn(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(Yt(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 sW(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(vf,{value:s,maxWidth:200})}),a.jsx("td",{children:a.jsx(Dn,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:d=>{mn(d);const f=t.slice();f.splice(c,1),o(f)},children:a.jsx(Op,{})})})]},`${c}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(MS,{disabled:e.disabled,onUpload:s=>{o([...r.current,s])},children:s=>a.jsx(Dn,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:a.jsx(CS,{})})})})]})]})]})}function eP(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(vf,{value:t,maxWidth:200}),a.jsx(Pe,{disabled:e.disabled,onClick:o=>{mn(o),r(void 0)},children:"Remove"})]}):a.jsx(MS,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(Pe,{...o,children:"Upload..."})})}function $i(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 Ip(e){const[t,n]=v.useState();return a.jsx(pt,{onSubmit:r=>{n(void 0),e.onSubmit(r)?.catch(o=>n(Qe(o)))},children:a.jsxs(Ue,{children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(ze,{children:e.title})]}),t&&a.jsx($o,{icon:a.jsx(As,{size:16}),title:"Error",color:"red",children:t}),e.qrCodeUrl&&a.jsxs(Ue,{align:"center",children:[a.jsx(Ee,{children:"Scan this QR code with your authenticator app."}),a.jsx("img",{src:e.qrCodeUrl,alt:"Multi Factor Auth QR Code"})]}),a.jsx(Ue,{children:a.jsx(He,{name:"token",label:"MFA code",autoComplete:"one-time-code",required:!0,autoFocus:!0})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Cr,{children:e.buttonText})})]})})}const lW="_root_1vii2_1",cW={root:lW};function fu(e){const{children:t,...n}=e;return a.jsx(Zd,{className:cW.root,...n,children:t})}const uW="_paper_1igaj_1",dW="_fill_1igaj_20",uR={paper:uW,fill:dW};function kl(e){const{width:t,fill:n,className:r,children:o,...s}=e,c=t?{maxWidth:t}:void 0;return a.jsx(Or,{className:Ut(uR.paper,n&&uR.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...s,children:o})}function dt(e){const{children:t,...n}=e;return a.jsx(fu,{children:a.jsx(kl,{...n,children:t})})}function Lt(e,t){return e?.issue?.filter(n=>tP(n.expression?.[0],t))?.map(n=>n.details?.text)?.join(`
|
|
226
|
-
`)}function hu(e,t){return e?.issue?.filter(n=>tP(n.expression?.[0],t))}const Yh=/\[\d+\]/;function tP(e,t){const n=typeof e=="string"&&Yh.test(e),r=typeof t=="string"&&Yh.test(t);if(n!==r&&(e=e?.replace(Yh,""),t=t?.replace(Yh,"")),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 nP(e){const t=_e(),[n,r]=v.useState();return a.jsxs(pt,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(s){r(Yt(s))}},children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(ze,{children:"Create project"})]}),a.jsxs(Ue,{gap:"xl",children:[a.jsx(He,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Lt(n,"projectName")}),a.jsxs(Ee,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Mt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Mt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Cr,{children:"Create project"})})]})}function rP(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 iP(e){const t=_e(),{googleClientId:n,handleGoogleCredential:r}=e,o=v.useRef(null),[s,c]=v.useState(typeof google<"u"),[d,f]=v.useState(!1),[p,m]=v.useState(!1);return v.useEffect(()=>{if(typeof google>"u"){rP("https://accounts.google.com/gsi/client",()=>c(!0));return}d||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),o.current&&!p&&(google.accounts.id.renderButton(o.current,{}),m(!0))},[t,n,d,s,o,p,r]),n?a.jsx("div",{ref:o}):null}function oP(e){if(e)return e;const t=nr.getOrigin();if(t&&[].includes(t))return"__GOOGLE_CLIENT_ID__"}function Er(e){const t=e.outcome?.issue||e.issues;return!t||t.length===0?null:a.jsx($o,{icon:a.jsx(As,{size:16}),color:"red",children:t.map(n=>a.jsx("div",{"data-testid":"text-field-error",children:OD(n)},n.details?.text))})}function aP(e){typeof grecaptcha>"u"&&rP("https://www.google.com/recaptcha/api.js?render="+e)}function sP(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function fW(e){const t=oP(e.googleClientId),n=e.recaptchaSiteKey,r=_e(),[o,s]=v.useState(),c=hu(o,void 0);return v.useEffect(()=>{n&&aP(n)},[n]),a.jsxs(pt,{onSubmit:async d=>{s(void 0);try{let f="";n&&(f=await sP(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(Yt(f))}},children:[a.jsx(hr,{style:{flexDirection:"column"},children:e.children}),a.jsx(Er,{issues:c}),t&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(iP,{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(Yt(f))}}})}),a.jsx(_n,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Ue,{gap:"xl",children:[a.jsx(He,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Lt(o,"firstName")}),a.jsx(He,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Lt(o,"lastName")}),a.jsx(He,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Lt(o,"email")}),a.jsx(Ki,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Lt(o,"password")}),a.jsxs(Ee,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Mt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Mt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(Ee,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Mt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Mt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(ye,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx($n,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(Cr,{children:"Create account"})]})]})}function hW(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,onSuccess:c}=e,d=_e(),[f,p]=v.useState(),[m,g]=v.useState();v.useEffect(()=>{t==="patient"&&f&&d.startNewPatient({login:f,projectId:n}).then(b=>d.processCode(b.code)).then(()=>c()).catch(b=>g(Yt(b)))},[d,t,n,f,c]);function y(b){b.code?d.processCode(b.code).then(()=>c()).catch(console.log):b.login&&p(b.login)}return a.jsxs(dt,{width:450,children:[m&&a.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&a.jsx(fW,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:s,handleAuthResponse:y,children:e.children}),f&&t==="project"&&a.jsx(nP,{login:f,handleAuthResponse:y})]})}const pW="_userNotice_1iefq_1",mW={userNotice:pW};function gW(e){const[t,n]=v.useState();return t?a.jsx(yW,{email:t,resetEmail:()=>n(void 0),...e}):a.jsx(vW,{setEmail:n,...e})}function vW(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:s,...c}=e,d=_e(),f=!e.disableGoogleAuth&&oP(e.googleClientId),[p,m]=v.useState(),g=hu(p,void 0),y=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await d.ensureCodeChallenge(c),domain:j.domain}),R=new URL(j.authorizeUrl);return R.searchParams.set("state",C),nr.assign(R.toString()),!0},[d,c]),b=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(Yt(C))}},[d,c,y,r]);return a.jsxs(pt,{onSubmit:b,children:[a.jsx(hr,{style:{flexDirection:"column"},children:o}),a.jsx(Er,{issues:g}),f&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(iP,{googleClientId:f,handleGoogleCredential:S})}),!s&&a.jsx(_n,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&a.jsx(He,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Lt(p,"email"),"data-testid":"auth.email"}),a.jsxs(ye,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.jsx(Mt,{component:"button",type:"button",c:"dimmed",onClick:n,size:"xs","data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:"Register"})}),!s&&a.jsx(Cr,{children:"Next"})]})]})}function yW(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,s=_e(),[c,d]=v.useState(),f=hu(c,void 0),p=v.useCallback(m=>{s.startLogin({...o,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>d(Yt(g)))},[s,o,n]);return a.jsxs(pt,{onSubmit:p,children:[a.jsx(hr,{style:{flexDirection:"column"},children:r}),a.jsx(Er,{issues:f}),a.jsxs(Ue,{gap:"sm",children:[a.jsx(Ki,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Lt(c,"password"),"data-testid":"auth.password"}),a.jsxs(eo,{className:mW.userNotice,justify:"space-between",align:"center",px:"xs",bdrs:"sm",children:[a.jsxs(Ee,{size:"xs",children:["Logging in as ",a.jsx("em",{children:e.email})]}),a.jsx(Pe,{variant:"transparent",onClick:e.resetEmail,size:"compact-xs",children:"Change"})]})]}),a.jsxs(ye,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(Mt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),a.jsx($n,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(Cr,{children:"Sign in"})]})]})}function xW(e){const t=_e(),n=Rl(),[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(Yt(y)))}const m=e.memberships.filter(f).slice(0,10).map(g=>a.jsx(Xe.Option,{value:g.id,children:a.jsx(SW,{...g})},g.id));return a.jsxs(Ue,{children:[a.jsxs(eo,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx($i,{size:32}),a.jsx(ze,{order:3,children:"Choose profile"})]}),a.jsx(Er,{outcome:s}),a.jsxs(Xe,{store:n,onOptionSubmit:p,children:[a.jsx(Xe.EventsTarget,{children:a.jsx(He,{placeholder:"Search",value:r,onChange:g=>{o(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(Xe.Options,{children:m.length>0?m:a.jsx(Xe.Empty,{children:"Nothing found..."})})})]})]})}function bW(e){return e.identifier?.find(t=>t.system==="https://medplum.com/identifier/label")?.value}function SW(e){const t=bW(e);return a.jsxs(ye,{children:[a.jsx(hl,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(Ee,{fz:"sm",fw:500,children:e.profile?.display}),a.jsxs(Ee,{fz:"xs",opacity:.6,children:[e.project?.display," ",t?` - ${t}`:""]})]})]})}const wW=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,jW="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",CW="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",EW="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",TW=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,RW="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",_W="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",AW="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",DW="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",kW="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",PW="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function NW(e){const t=_e();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(Ue,{children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(ze,{children:"Choose scope"})]}),a.jsx(Ue,{children:(e.scope??"openid").split(" ").map(n=>{let r;return wW.test(n)?r=[n+jW,n+CW,n+EW]:TW.test(n)&&(r=[n+RW,n+_W,n+AW,n+DW,n+kW,n+PW]),a.jsxs(a.Fragment,{children:[a.jsx($n,{id:n,name:n,label:n,defaultChecked:!0},n),r?.map(o=>a.jsx($n,{id:o,name:o,label:o},o))]},n+"_group")})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Cr,{children:"Set scope"})})]})})}function lP(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:s,onCode:c,...d}=e,f=_e(),[p,m]=v.useState(),g=v.useRef(!1),[y,b]=v.useState(!1),[S,j]=v.useState(),[C,R]=v.useState(!1),[E,T]=v.useState(),_=v.useCallback(A=>{c?c(A):f.processCode(A).then(()=>{r&&r()}).catch(P=>Ne({color:"red",message:Qe(P)}))},[f,c,r]),k=v.useCallback(A=>{b(!!A.mfaEnrollRequired),j(A.enrollQrCode),R(!!A.mfaRequired),A.login&&m(A.login),A.memberships&&T(A.memberships),A.code&&(n?T(void 0):_(A.code))},[n,_]),I=v.useCallback(A=>{_(A.code)},[_]);return v.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(k).catch(A=>Ne({color:"red",message:Qe(A)})))},[f,t,g,p,k]),a.jsx(dt,{width:450,px:"sm",py:"md",children:p?y&&S?a.jsx(Ip,{title:"Enroll in MFA",buttonText:"Enroll",qrCodeUrl:S,onSubmit:async A=>{const P=await f.post("auth/mfa/login-enroll",{login:p,token:A.token});k(P)}}):C?a.jsx(Ip,{title:"Enter MFA code",buttonText:"Submit code",onSubmit:async A=>{const P=await f.post("auth/mfa/verify",{login:p,token:A.token});k(P)}}):E?a.jsx(xW,{login:p,memberships:E,handleAuthResponse:k}):e.projectId==="new"?a.jsx(nP,{login:p,handleAuthResponse:k}):e.chooseScopes?a.jsx(NW,{login:p,scope:e.scope,handleAuthResponse:I}):a.jsx("div",{children:"Success"}):a.jsx(gW,{onForgotPassword:o,onRegister:s,handleAuthResponse:k,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...d,children:e.children})})}function Ro(e){return a.jsx(a.Fragment,{children:xs(e.value)})}function OW(e){return a.jsx(a.Fragment,{children:uf(e.value)})}function cP(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 MW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",t.telecom?.map(n=>a.jsx(cP,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function ng(e,t,n){const r=kd(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 LW(e,t,n){const r=BD(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function IW(e){const{elementDefinitionType:t}=e,n=_e(),r=v.useContext(pn),[o,s]=v.useState(zD("Extension")),c=v.useMemo(()=>{if(Ln(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=uu(c);f(!1),g&&s(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(d||!tS(c)))return a.jsx("div",{children:"Loading..."});if(o.elements["value[x]"]?.max!==0){const[g,y]=ng({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return a.jsx(ro,{propertyType:y,value:g})}return a.jsx($p,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function zW(e){return a.jsxs("div",{children:[e.value?.system,": ",e.value?.value]})}function $W(e){return a.jsx(a.Fragment,{children:EB(e.value)})}function Id(e){return a.jsx(a.Fragment,{children:al(e.value)})}function LS(e){return a.jsx(a.Fragment,{children:Nd(e.value)})}function UW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(Id,{value:t.numerator})," / ",a.jsx(Id,{value:t.denominator})]}):null}function zp(e){if(!e.value)return null;const t=e.value.display||e.value.reference||no(e.value);return e.link!==!1&&e.value.reference?a.jsx(jt,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function uP(e,t,n,r){if(!Ln(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=bk(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 dP({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(!xk(d)){console.debug("Unsupported slice definition",d);continue}let f;Ln(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=uu(p);f.typeSchema=m}}n(o)}).catch(r)})}function rg(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function BW(e){const{slice:t,property:n}=e,r=t.typeSchema?.elements??t.elements,o=v.useContext(pn),s=v.useMemo(()=>{if(Ln(r))return Wc({parentContext:o,elements:r,path:e.path,profileUrl:t.typeSchema?.url})},[o,e.path,t.typeSchema?.url,r]);return rg(pn.Provider,s,a.jsx(a.Fragment,{children:e.value.map((c,d)=>a.jsx("div",{children:a.jsx(ro,{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 dR=50;function VW(e){const{property:t,propertyType:n}=e,r=_e(),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),b=v.useContext(pn);if(v.useEffect(()=>{dP({medplum:r,property:t}).then(C=>{y(o.length),f(C);const R=o.slice(0,dR),E=uP(R,C,t.slicing,b.profileUrl);m(E),c(!1)}).catch(C=>{console.error(C),c(!1)})},[r,t,b.profileUrl,m,o]),s)return a.jsx("div",{children:"Loading..."});let S;if(t.type[0]?.code!=="Extension"){const C=p[d.length],R=C.map((E,T)=>a.jsx("div",{children:a.jsx(ro,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:E,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${T}-${C.length}`));if(e.includeDescriptionListEntry){if(!Ln(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const E=e.path.split(".").pop();S=a.jsx(Lr,{term:gl(E),children:R})}else S=a.jsx(a.Fragment,{children:R})}return a.jsxs(a.Fragment,{children:[d.map((C,R)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let E=a.jsx(BW,{path:e.path,slice:C,property:t,value:p[R],ignoreMissingValues:e.ignoreMissingValues,link:e.link},C.name);return e.includeDescriptionListEntry&&(E=a.jsx(Lr,{term:gl(C.name),children:E},C.name)),E}),S,g>dR&&a.jsx(ye,{justify:"right",children:a.jsxs(Ee,{children:["... ",g," total values"]})})]})}function ro(e){const{property:t,propertyType:n,value:r}=e;if(t?.path?.endsWith(".id"))return a.jsxs(eo,{gap:3,align:"center",children:[r,!Cn(r)&&a.jsx(g0,{value:r,timeout:2e3,children:({copied:s,copy:c})=>a.jsx(to,{label:s?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(Dn,{variant:"subtle",color:s?"teal":"gray",onClick:c,children:s?a.jsx(Vo,{size:"1rem"}):a.jsx(ES,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===ne.Attachment?a.jsx(aW,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(VW,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case ne.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case ne.SystemString:case ne.string:return e.property?.path?.toLowerCase().includes("secret")?a.jsx(FW,{value:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case ne.code:case ne.date:case ne.decimal:case ne.id:case ne.integer:case ne.positiveInt:case ne.unsignedInt:case ne.uri:case ne.url:case ne.xhtml:return a.jsx(a.Fragment,{children:r});case ne.canonical:return a.jsx(zp,{value:{reference:r},link:e.link});case ne.dateTime:case ne.instant:return a.jsx(a.Fragment,{children:wr(r)});case ne.markdown:return a.jsx("pre",{children:r});case ne.Address:return a.jsx(EH,{value:r});case ne.Annotation:return a.jsx(a.Fragment,{children:r?.text});case ne.Attachment:return a.jsx(vf,{value:r,maxWidth:e.maxWidth});case ne.CodeableConcept:return a.jsx(Ro,{value:r});case ne.Coding:return a.jsx(OW,{value:r});case ne.ContactDetail:return a.jsx(MW,{value:r});case ne.ContactPoint:return a.jsx(cP,{value:r});case ne.HumanName:return a.jsx(DS,{value:r});case ne.Identifier:return a.jsx(zW,{value:r});case ne.Money:return a.jsx($W,{value:r});case ne.Period:return a.jsx(a.Fragment,{children:bB(r)});case ne.Quantity:case ne.Duration:return a.jsx(Id,{value:r});case ne.Range:return a.jsx(LS,{value:r});case ne.Ratio:return a.jsx(UW,{value:r});case ne.Reference:return a.jsx(zp,{value:r,link:e.link});case ne.Timing:return a.jsx(a.Fragment,{children:rk(r)});case ne.Dosage:case ne.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx($p,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case ne.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(IW,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx($p,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function FW(e){const[t,n]=v.useState(!1),r=e.value??"",o=!Cn(r),s="•".repeat(8);return a.jsxs(eo,{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(g0,{value:e.value,timeout:2e3,children:({copied:c,copy:d})=>a.jsx(to,{label:c?"Copied":"Copy secret",withArrow:!0,position:"right",children:a.jsx(Dn,{variant:"subtle",color:c?"teal":"gray",onClick:d,"aria-label":c?"Copied":"Copy secret",children:c?a.jsx(Vo,{size:"1rem"}):a.jsx(ES,{size:"1rem"})})})}),a.jsx(to,{label:t?"Hide secret":"Show secret",withArrow:!0,position:"right",children:a.jsx(Dn,{variant:"subtle",color:"gray",onClick:()=>n(!t),"aria-label":t?"Hide secret":"Show secret",children:t?a.jsx(Eq,{size:"1rem"}):a.jsx(Rq,{size:"1rem"})})})]})]})}const fP=["extension","modifierExtension"],HW=Nk.filter(e=>!fP.includes(e));function $p(e){const t=e.value,{value:n,type:r}=t,o=v.useContext(pn),s=e.profileUrl??o?.profileUrl,c=v.useMemo(()=>$m(r,s),[s,r]),d=v.useMemo(()=>{if(c)return Wc({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 rg(pn.Provider,d,a.jsx(yf,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{if(fP.includes(p)&&Cn(m.slicing?.slices))return null;if(HW.includes(p))return null;if(Ok.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,y]=ng(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Cn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,S=a.jsx(ro,{property:m,propertyType:y,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?S:a.jsx(Lr,{term:gl(p),children:S},p)})}))}const qW="_dimmed_11me5_1",GW="_preserveBreaks_11me5_5",Yx={dimmed:qW,preserveBreaks:GW},hP="Read Only";function pP(e,t){return e?a.jsx(to.Floating,{label:e,children:t}):t}function mP(e){const{debugMode:t}=v.useContext(pn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,pP(e?.readonly?hP:void 0,a.jsxs(ye,{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?Yx.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function $t(e){const{debugMode:t}=v.useContext(pn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,pP(e?.readonly?hP:void 0,a.jsx(hn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:Ut({[Yx.dimmed]:e?.readonly},Yx.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Lt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function QW(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 WW(e){return!!e&&!Cn(e.url)&&!Cn(e.name)}function YW(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=XW(g);p(y),n&&n(y)}return a.jsx(gf,{defaultValue:f&&KW(f),onChange:m,withHelpText:r??!0,...d})}function KW(e){return e.coding?.map(t=>({system:t.system,code:t.code,display:t.display}))}function XW(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function JW(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&&eY(m);d(g),n&&n(g)}return a.jsx(gf,{defaultValue:c?ZW(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...s})}function ZW(e){return{system:e.system,code:e.code,display:e.display}}function eY(e){return{system:e.system,code:e.code,display:e.display}}function gP(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(T=>r[t+"."+T]),[r,t]),[g,y,b]=v.useMemo(()=>["system","use","value"].map(T=>o(t+"."+T)),[o,t]);function S(T){T&&Object.keys(T).length===0&&(T=void 0),c(T),e.onChange&&e.onChange(T)}function j(T){const _={...d.current,system:T};T||delete _.system,S(_)}function C(T){const _={...d.current,use:T};T||delete _.use,S(_)}function R(T){const _={...d.current,value:T};T||delete _.value,S(_)}const E=e.valuePath??t;return a.jsxs(ye,{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:T=>j(T.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Lt(n,E+".system")}),a.jsx(fn,{disabled:e.disabled||y?.readonly,"data-testid":"use",defaultValue:s?.use,required:(p?.min??0)>0,onChange:T=>C(T.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Lt(n,E+".use")}),a.jsx(He,{disabled:e.disabled||b?.readonly,placeholder:"Value",defaultValue:s?.value,required:(m?.min??0)>0,onChange:T=>R(T.currentTarget.value),error:Lt(n,E+".value")})]})}function tY(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(ye,{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(gP,{disabled:e.disabled||c?.readonly,name:e.name+"-telecom",path:e.path+".telecom",defaultValue:t?.telecom?.[0],onChange:p,outcome:e.outcome})]})}function nY(e){if(!e)return"";const t=new Date(e);return Bm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function IS(e){if(!e)return"";const t=new Date(e);return Bm(t)?t.toISOString():""}function _o(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:rY(),step:1,defaultValue:nY(e.defaultValue),autoFocus:e.autoFocus,error:Lt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(IS(n))}}})}function rY(){return"datetime-local"}function iY(e){const{propertyType:t}=e,n=_e(),r=v.useMemo(()=>{if(Ln(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||!tS(r))?a.jsx("div",{children:"Loading..."}):a.jsx(BS,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function oY(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(E=>s(e.path+"."+E)),[s,e.path]);function g(E){o(E),e.onChange&&e.onChange(E)}function y(E){g({...r,use:E||void 0})}function b(E){g({...r,prefix:E?E.split(" "):void 0})}function S(E){g({...r,given:E?E.split(" "):void 0})}function j(E){g({...r,family:E||void 0})}function C(E){g({...r,suffix:E?E.split(" "):void 0})}const R=e.valuePath??n;return a.jsxs(ye,{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:E=>y(E.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Lt(t,R+".use")}),a.jsx(He,{disabled:e.disabled||d?.readonly,placeholder:"Prefix",name:e.name+"-prefix",defaultValue:r?.prefix?.join(" "),onChange:E=>b(E.currentTarget.value),error:Lt(t,R+".prefix")}),a.jsx(He,{disabled:e.disabled||f?.readonly,placeholder:"Given",name:e.name+"-given",defaultValue:r?.given?.join(" "),onChange:E=>S(E.currentTarget.value),error:Lt(t,R+".given")}),a.jsx(He,{disabled:e.disabled||p?.readonly,name:e.name+"-family",placeholder:"Family",defaultValue:r?.family,onChange:E=>j(E.currentTarget.value),error:Lt(t,R+".family")}),a.jsx(He,{disabled:e.disabled||m?.readonly,placeholder:"Suffix",name:e.name+"-suffix",defaultValue:r?.suffix?.join(" "),onChange:E=>C(E.currentTarget.value),error:Lt(t,R+".suffix")})]})}function aY(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(ye,{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:Lt(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:Lt(e.outcome,m+".value")})]})}const sY=["USD","EUR","CAD","GBP","AUD"];function lY(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:sY,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(pq,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function cY(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(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(_o,{disabled:e.disabled||o?.readonly,name:e.name+".start",placeholder:"Start",defaultValue:t?.start,onChange:d=>c({...t,start:d})}),a.jsx(_o,{disabled:e.disabled||s?.readonly,name:e.name+".end",placeholder:"End",defaultValue:t?.end,onChange:d=>c({...t,end:d})})]})}function xl(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(ye,{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:uY(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 uY(e){if(e)return Number.parseFloat(e)}function zS(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(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(xl,{path:e.path+".low",disabled:e.disabled||o?.readonly,name:e.name+"-low",defaultValue:t?.low,onChange:d=>c({...t,low:d})}),a.jsx(xl,{path:e.path+".high",disabled:e.disabled||s?.readonly,name:e.name+"-high",defaultValue:t?.high,onChange:d=>c({...t,high:d})})]})}function dY(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(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(xl,{path:e.path+".numerator",disabled:e.disabled||o?.readonly,name:e.name+"-numerator",defaultValue:t?.numerator,onChange:d=>c({...t,numerator:d})}),a.jsx(xl,{path:e.path+".denominator",disabled:e.disabled||s?.readonly,name:e.name+"-denominator",defaultValue:t?.denominator,onChange:d=>c({...t,denominator:d})})]})}const fY={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},hY=["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 pY(e){return{value:Ot(e)??"",label:ba(e),resource:e}}function Pl(e){const t=_e(),{resourceType:n,searchCriteria:r}=e,[o,s]=v.useState(),c=Kt(e.defaultValue,s),d=e.itemComponent??mY,f=e.onChange,p=v.useCallback(async(g,y)=>{const b=gY(n),S=new URLSearchParams({[b]: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 Ln(e.defaultValue)&&!o&&!c?null:a.jsx(kS,{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:pY,loadOptions:p,onChange:m,clearable:!0})}const mY=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(ye,{wrap:"nowrap",children:[a.jsx(Aa,{value:t}),a.jsxs("div",{children:[a.jsx(Ee,{children:e}),a.jsx(Ee,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function gY(e){return fY[e]??(hY.includes(e)?"name":"_id")}function vs(e){const{onChange:t}=e,n=_e(),[r,o]=v.useState(e.defaultValue),[s,c]=v.useState(()=>vY(e.targetTypes)),[d,f]=v.useState(()=>yY(e.defaultValue,s)),p=v.useRef(new DD),m=v.useMemo(()=>d?.type==="profile"?{...e.searchCriteria,_profile:d.value}:e.searchCriteria,[e.searchCriteria,d]);v.useEffect(()=>{let b=!1;const S=s?.map(j=>{if(!bY(j))return Promise.resolve(j);b=!0;const C=j.value,R=p.current.get(C);if(R)return R;const E=xY(n,j.value).then(_=>{const k={...j};return _?Ln(_.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:_})),T=new Gi(E);return p.current.set(C,T),T});!S||!b||Promise.all(S).then(j=>{if(c(j),!d)return;const C=j.findIndex(R=>R.value===d.value||R.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(b=>{const S=b?Qt(b):void 0;o(S),t&&t(S)},[t]),y=v.useMemo(()=>s?s.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[s]);return a.jsxs(a.Fragment,{children:[e.name&&a.jsx("input",{type:"hidden",name:e.name,value:r?.reference??""}),a.jsxs(ye,{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:b=>{const S=b.currentTarget.value,j=s.find(C=>C.value===S);f(j)},data:y}),!s&&a.jsx(OS,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:d?.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(Pl,{resourceType:d?.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function vY(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 yY(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 xY(e,t){const n=uu(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
227
|
-
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
228
|
-
type,
|
|
229
|
-
name,
|
|
230
|
-
title,
|
|
231
|
-
}
|
|
232
|
-
}`.replaceAll(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function bY(e){return e.type==="profile"&&!e?.error&&Cn(e.resourceType)}function SY(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const wY="_indented_ldk1d_1",vP={indented:wY};function $S({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(Pe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(Mp,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(Dn,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(Mp,{size:"1.25rem"})})}function yP({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(Dn,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(Op,{size:"1.25rem"})})}function jY(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(Ln(s))return Wc({parentContext:c,elements:s,path:e.path,profileUrl:t.typeSchema?.url})},[c,e.path,t.typeSchema?.url,s]);function f(b){o(b),e.onChange&&e.onChange(b)}const p=t.min>0,m=Cn(t.elements),g=ak(t.name),y=e.property.readonly&&r.length===0;return rg(pn.Provider,d,a.jsx($t,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:y?a.jsx(Ee,{c:"dimmed",children:"(empty)"}):a.jsxs(Ue,{className:m?vP.indented:void 0,children:[r.map((b,S)=>a.jsxs(ye,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${S}`,children:a.jsx(US,{elementDefinitionType:t.type[0],name:t.name,defaultValue:b,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(yP,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${S}`,onClick:j=>{mn(j);const C=[...r];C.splice(S,1),f(C)}})]},`${S}-${r.length}`)),!e.property.readonly&&r.length<t.max&&a.jsx(ye,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx($S,{propertyDisplayName:g,onClick:b=>{mn(b);const S=[...r,void 0];f(S)},testId:e.testId&&`${e.testId}-add`})})]})}))}function CY(e){const{property:t}=e,n=_e(),[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(()=>{dP({medplum:n,property:t}).then(E=>{c(E);const T=uP(d,E,t.slicing,m.profileUrl);EY(T,E),p(T),o(!1)}).catch(E=>{console.error(E),o(!1)})},[n,t,d,m.profileUrl,p]);function y(E,T){const _=[...f];if(_[T]=E,p(_),e.onChange){const k=_.flat().filter(I=>I!==void 0);e.onChange(k)}}if(r)return a.jsx("div",{children:"Loading..."});const b=s.length,S=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&s.length>0)),C=gl(t.path),R=e.property.readonly&&s.length===0&&d.length===0;return a.jsxs(Ue,{className:e.indent?vP.indented:void 0,children:[R&&a.jsx(Ee,{c:"dimmed",children:"(empty)"}),s.map((E,T)=>a.jsx(jY,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[T],onChange:_=>{y(_,T)},testId:`slice-${E.name}`},E.name)),j&&S.map((E,T)=>a.jsxs(ye,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(xf,{arrayElement:!0,property:e.property,name:e.name+"."+T,path:e.path,valuePath:SY(e.path,e.valuePath,T),defaultValue:E,onChange:_=>{const k=[...S];k[T]=_,y(k,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&a.jsx(yP,{propertyDisplayName:C,testId:`nonsliced-remove-${T}`,onClick:_=>{mn(_);const k=[...S];k.splice(T,1),y(k,b)}})]},`${T}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&a.jsx(ye,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx($S,{propertyDisplayName:C,onClick:E=>{mn(E);const T=[...S];T.push(void 0),y(T,b)},testId:"nonsliced-add"})})]})}function EY(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 TY(e){const[t,n]=v.useState(!1),r=z2(),o=v.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),a.jsxs(eo,{gap:"xs",children:[a.jsx(_l,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(Dn,{title:"Copy secret",onClick:()=>{r.copy(o.current?.value),Ne({color:"green",message:"Copied"})},children:a.jsx(ES,{})})]})}const RY=["sun","mon","tue","wed","thu","fri","sat"];function _Y(e){const[t,n]=v.useState(e.defaultValue),[r,o]=v.useState(!e.disabled&&(e.defaultModalOpen??!1)),s=v.useRef(t);return s.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:rk(s.current)||"No repeat"}),a.jsx(Pe,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&a.jsx(AY,{path:e.path,visible:r,defaultValue:s.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),o(!1)},onCancel:()=>o(!1)})]})}const fR={repeat:{period:1,periodUnit:"d"}};function AY(e){const[t,n]=v.useState(e.defaultValue||fR),{getExtendedProps:r}=v.useContext(pn),[o,s,c,d,f]=v.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(j=>r(e.path+"."+j)),[r,e.path]),p=v.useRef(t);p.current=t;function m(j){n({...p.current,event:[j]})}function g(j){n({...p.current,repeat:j})}function y(j){g({...p.current?.repeat,period:j})}function b(j){g({...p.current?.repeat,periodUnit:j})}function S(j){g({...p.current?.repeat,dayOfWeek:j})}return a.jsx(Vn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Ue,{children:[a.jsx($t,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(_o,{disabled:o?.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),a.jsx(rf,{disabled:s?.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?fR.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx($t,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(He,{disabled:c?.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:j=>y(Number.parseInt(j.currentTarget.value,10)||1)}),a.jsx(fn,{disabled:d?.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:j=>b(j.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($t,{title:"Repeat on",children:a.jsx(Rd.Group,{multiple:!0,onChange:S,children:a.jsx(ye,{justify:"space-between",mt:"md",gap:"xs",children:RY.map(j=>a.jsx(Rd,{value:j,size:"xs",radius:"xl",disabled:f?.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Pe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function xf(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===ne.Attachment)return a.jsx(sW,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const d=c[0]?.code!==ne.Extension;return a.jsx(CY,{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(DY,{elementDefinitionTypes:c,...e}):a.jsx(US,{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 DY(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(ye,{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(US,{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 US(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(!aS(p)||!Cn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)qT(S,m.elements);else{const j=ol(m.path,e.path);if(j===void 0)return e.defaultValue;qT(S,m.elements,j)}return Ln(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 b(){const S=Lt(e.outcome,c??s);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:d}}switch(p){case ne.SystemString:case ne.canonical:case ne.string:case ne.time:case ne.uri:case ne.url:return e.path==="Project.secret.value[x]"?a.jsx(TY,{...b(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):a.jsx(He,{...b(),onChange:S=>{n&&n(S.currentTarget.value)}});case ne.date:return a.jsx(He,{...b(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case ne.dateTime:case ne.instant:return a.jsx(_o,{...b(),onChange:n,outcome:r});case ne.decimal:case ne.integer:case ne.positiveInt:case ne.unsignedInt:return a.jsx(He,{...b(),type:"number",step:p===ne.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case ne.code:return a.jsx(Zk,{...b(),error:void 0,onChange:n,binding:o?.valueSet,creatable:!0,maxValues:1});case ne.boolean:return a.jsx($n,{...b(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case ne.base64Binary:case ne.markdown:case ne.xhtml:return a.jsx(_l,{...b(),spellCheck:p!==ne.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case ne.Address:return a.jsx(_H,{...y()});case ne.Annotation:return a.jsx(AH,{...y()});case ne.Attachment:return a.jsx(eP,{...y()});case ne.CodeableConcept:return a.jsx(YW,{binding:o?.valueSet,...y()});case ne.Coding:return a.jsx(JW,{binding:o?.valueSet,...y()});case ne.ContactDetail:return a.jsx(tY,{...y()});case ne.ContactPoint:return a.jsx(gP,{...y()});case ne.Extension:return a.jsx(iY,{...y(),propertyType:e.elementDefinitionType});case ne.HumanName:return a.jsx(oY,{...y()});case ne.Identifier:return a.jsx(aY,{...y()});case ne.Money:return a.jsx(lY,{...y()});case ne.Period:return a.jsx(cY,{...y()});case ne.Duration:case ne.Quantity:return a.jsx(xl,{...y()});case ne.Range:return a.jsx(zS,{...y()});case ne.Ratio:return a.jsx(dY,{...y()});case ne.Reference:return a.jsx(vs,{...y(),targetTypes:PY(e.elementDefinitionType)});case ne.Timing:return a.jsx(_Y,{...y()});case ne.Dosage:case ne.UsageContext:default:return a.jsx(BS,{...y(),typeName:p})}}const kY=[`${io}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function PY(e){return e?.targetProfile?.map(t=>{const n=kY.find(r=>t.startsWith(r));return n?t.slice(n.length):t})}function NY(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(pn),o=v.useMemo(()=>RH(r.elements),[r.elements]);function s(d){n(d),e.onChange&&e.onChange(d)}const c={type:e.type,value:t};return a.jsx(Ue,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([d,f])=>{const[p,m]=LW(c,d,f),g=f.min!==void 0&&f.min>0,y=e.valuePath?e.valuePath+"."+d:void 0,b=a.jsx(xf,{property:f,name:d,path:e.path+"."+d,valuePath:y,defaultValue:p,defaultPropertyType:m,onChange:(S,j)=>{s(QW({...t},d,j??d,f,S))},outcome:e.outcome},d);return e.type==="Extension"||wS.includes(d)?b:f.type.length===1&&f.type[0].code==="boolean"?a.jsx(mP,{title:gl(d),description:f.description,htmlFor:d,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},d):a.jsx($t,{title:gl(d),description:f.description,withAsterisk:g,htmlFor:d,outcome:e.outcome,fhirPath:f.path,errorExpression:y,readonly:f.readonly,children:b},d)})})}const OY="_nested_1ya4k_1",MY={nested:OY};function BS(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(pn),r=e.profileUrl??n?.profileUrl,o=v.useMemo(()=>$m(e.typeName,r),[e.typeName,r]),s=o?.type??e.typeName,c=v.useMemo(()=>{if(o)return Wc({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 rg(pn.Provider,c,a.jsx(ce,{className:Ut({[MY.nested]:d}),children:a.jsx(NY,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})}))}const LY="_noteCite_10swh_5",IY="_noteRoot_10swh_10",hR={noteCite:LY,noteRoot:IY};function xP({value:e}){return e?a.jsx(Ue,{justify:"flex-start",gap:"xs",children:e.map(t=>t.text&&a.jsx(h0,{classNames:{cite:hR.noteCite,root:hR.noteRoot},cite:t.authorReference?.display||t.authorString,icon:null,children:t.text},`note-${t.text}`))}):null}function Nl(e){const{value:t,link:n,...r}=e,[o,s]=v.useState(),c=Kt(t,s);let d;if(o&&!PD(o))d=`[${Qe(o)}]`;else if(c)d=ba(c);else return null;return n?a.jsx(jt,{to:t,...r,children:d}):a.jsx(Ee,{component:"span",...r,children:d})}function Ic(e){return a.jsxs(ye,{gap:"xs",children:[a.jsx(Aa,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(Nl,{value:e.value,link:e.link})]})}const zY={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 ig(e){const{status:t,...n}=e;return a.jsx(vm,{color:e.color||zY[t],...n,children:t.replaceAll("-"," ")})}const $Y="_table_pe9td_1",UY="_criticalRow_pe9td_12",bP={table:$Y,criticalRow:UY};VS.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function VS(e){const t=_e(),n=Kt(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(Ue,{children:[a.jsx(ze,{children:"Diagnostic Report"}),a.jsx(BY,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&VY(r),n.result&&a.jsx(FY,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&a.jsx(xP,{value:s})]})}function BY({value:e,hideSubject:t=!1}){return a.jsxs(ye,{mt:"md",gap:30,children:[e.subject&&!t&&a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(Ic,{value:e.subject,link:!0})]}),e.resultsInterpreter?.map(n=>a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(Ic,{value:n,link:!0})]},n.reference)),e.performer?.map(n=>a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(Ic,{value:n,link:!0})]},n.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(Ee,{children:wr(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(Ee,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(ig,{status:e.status})]})]})}function VY(e){return a.jsxs(Ue,{gap:"xs",children:[a.jsx(ze,{order:2,size:"h6",children:"Specimens"}),a.jsx(Nr,{type:"ordered",children:e?.map(t=>a.jsx(Nr.Item,{ml:"sm",children:a.jsxs(ye,{gap:20,children:[a.jsxs(ye,{gap:5,children:[a.jsx(Ee,{fw:500,children:"Collected:"})," ",wr(t.collection?.collectedDateTime)]}),a.jsxs(ye,{gap:5,children:[a.jsx(Ee,{fw:500,children:"Received:"})," ",wr(t.receivedTime)]})]})},`specimen-${t.id}`))})]})}function FY(e){return a.jsxs("table",{className:bP.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(SP,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function SP(e){return a.jsx(a.Fragment,{children:e.value?.map(t=>a.jsx(HY,{value:t,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${_a(t)?t.reference:t.id}`))})}function HY(e){const t=Kt(e.value);if(!t||e.ancestorIds?.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=QY(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:Ut({[bP.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(jt,{to:t,children:a.jsx(Ro,{value:t.code})})}),a.jsx("td",{children:a.jsx(qY,{value:t})}),a.jsx("td",{children:a.jsx(GY,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(Ro,{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(Ro,{value:o})},`category-${xs(o)}`))})}),a.jsx("td",{children:t.performer?.map(o=>a.jsx(zp,{value:o},o.reference))}),a.jsx("td",{children:t.status&&a.jsx(ig,{status:t.status})})]}),t.hasMember&&a.jsx(SP,{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(xP,{value:t.note})})})]})}function qY(e){const t=e.value;return a.jsx(a.Fragment,{children:ik(t)})}function GY(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(LS,{value:t}):null}function QY(e){const t=e.interpretation?.[0]?.coding?.[0]?.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var ex={},da={},pR;function wP(){if(pR)return da;pR=1,Object.defineProperty(da,"__esModule",{value:!0}),da.Pointer=da.escapeToken=da.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}da.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}da.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 da.Pointer=n,da}var Sn={},tx={},mR;function jP(){return mR||(mR=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})(tx)),tx}var kr={},gR;function CP(){if(gR)return kr;gR=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.diffAny=kr.diffObjects=kr.diffArrays=kr.intersection=kr.subtract=kr.isDestructive=void 0;var e=jP();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}kr.isDestructive=t;function n(m,g){var y={};for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&(y[b]=1);for(var S in g)e.hasOwnProperty.call(g,S)&&g[S]!==void 0&&delete y[S];return Object.keys(y)}kr.subtract=n;function r(m){for(var g=m.length,y={},b=0;b<g;b++){var S=m[b];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)}kr.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,b){b===void 0&&(b=p);var S={"0,0":{operations:[],cost:0}};function j(_,k){var I="".concat(_,",").concat(k),A=S[I];if(A===void 0){if(_>0&&k>0&&!b(m[_-1],g[k-1],y.add(String(_-1))).length)A=j(_-1,k-1);else{var P=[];if(_>0){var z=j(_-1,k),B={op:"remove",index:_-1};P.push(c(z,B))}if(k>0){var Y=j(_,k-1),J={op:"add",index:_-1,value:g[k-1]};P.push(c(Y,J))}if(_>0&&k>0){var Z=j(_-1,k-1),$={op:"replace",index:_-1,original:m[_-1],value:g[k-1]};P.push(c(Z,$))}var Q=P.sort(function(M,L){return M.cost-L.cost})[0];A=Q}S[I]=A}return A}var C=isNaN(m.length)||m.length<=0?0:m.length,R=isNaN(g.length)||g.length<=0?0:g.length,E=j(C,R).operations,T=E.reduce(function(_,k){var I=_[0],A=_[1];if(o(k)){var P=k.index+1+A,z=P<C+A?String(P):"-",B={op:k.op,path:y.add(z).toString(),value:k.value};return[I.concat(B),A+1]}else if(s(k)){var B={op:k.op,path:y.add(String(k.index+A)).toString()};return[I.concat(B),A-1]}else{var Y=y.add(String(k.index+A)),J=b(k.original,k.value,Y);return[I.concat.apply(I,J),A]}},[[],0])[0];return T}kr.diffArrays=d;function f(m,g,y,b){b===void 0&&(b=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,b(m[j],g[j],y.add(j)))}),S}kr.diffObjects=f;function p(m,g,y,b){if(b===void 0&&(b=p),m===g)return[];var S=(0,e.objectType)(m),j=(0,e.objectType)(g);return S=="array"&&j=="array"?d(m,g,y,b):S=="object"&&j=="object"?f(m,g,y,b):[{op:"replace",path:y.toString(),value:g}]}return kr.diffAny=p,kr}var vR;function WY(){if(vR)return Sn;vR=1;var e=Sn&&Sn.__extends||(function(){var C=function(R,E){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,_){T.__proto__=_}||function(T,_){for(var k in _)Object.prototype.hasOwnProperty.call(_,k)&&(T[k]=_[k])},C(R,E)};return function(R,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");C(R,E);function T(){this.constructor=R}R.prototype=E===null?Object.create(E):(T.prototype=E.prototype,new T)}})();Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.apply=Sn.InvalidOperationError=Sn.test=Sn.copy=Sn.move=Sn.replace=Sn.remove=Sn.add=Sn.TestError=Sn.MissingError=void 0;var t=wP(),n=jP(),r=CP(),o=(function(C){e(R,C);function R(E){var T=C.call(this,"Value required at path: ".concat(E))||this;return T.path=E,T.name="MissingError",T}return R})(Error);Sn.MissingError=o;var s=(function(C){e(R,C);function R(E,T){var _=C.call(this,"Test failed: ".concat(E," != ").concat(T))||this;return _.actual=E,_.expected=T,_.name="TestError",_}return R})(Error);Sn.TestError=s;function c(C,R,E){if(Array.isArray(C))if(R=="-")C.push(E);else{var T=parseInt(R,10);C.splice(T,0,E)}else C[R]=E}function d(C,R){if(Array.isArray(C)){var E=parseInt(R,10);C.splice(E,1)}else delete C[R]}function f(C,R){var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.parent===void 0?new o(R.path):(c(E.parent,E.key,(0,n.clone)(R.value)),null)}Sn.add=f;function p(C,R){var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.value===void 0?new o(R.path):(d(E.parent,E.key),null)}Sn.remove=p;function m(C,R){var E=t.Pointer.fromJSON(R.path).evaluate(C);if(E.parent===null)return new o(R.path);if(Array.isArray(E.parent)){if(parseInt(E.key,10)>=E.parent.length)return new o(R.path)}else if(E.value===void 0)return new o(R.path);return E.parent[E.key]=(0,n.clone)(R.value),null}Sn.replace=m;function g(C,R){var E=t.Pointer.fromJSON(R.from).evaluate(C);if(E.value===void 0)return new o(R.from);var T=t.Pointer.fromJSON(R.path).evaluate(C);return T.parent===void 0?new o(R.path):(d(E.parent,E.key),c(T.parent,T.key,E.value),null)}Sn.move=g;function y(C,R){var E=t.Pointer.fromJSON(R.from).evaluate(C);if(E.value===void 0)return new o(R.from);var T=t.Pointer.fromJSON(R.path).evaluate(C);return T.parent===void 0?new o(R.path):(c(T.parent,T.key,(0,n.clone)(E.value)),null)}Sn.copy=y;function b(C,R){var E=t.Pointer.fromJSON(R.path).evaluate(C);return(0,r.diffAny)(E.value,R.value,new t.Pointer).length?new s(E.value,R.value):null}Sn.test=b;var S=(function(C){e(R,C);function R(E){var T=C.call(this,"Invalid operation: ".concat(E.op))||this;return T.operation=E,T.name="InvalidOperationError",T}return R})(Error);Sn.InvalidOperationError=S;function j(C,R){switch(R.op){case"add":return f(C,R);case"remove":return p(C,R);case"replace":return m(C,R);case"move":return g(C,R);case"copy":return y(C,R);case"test":return b(C,R)}return new S(R)}return Sn.apply=j,Sn}var yR;function YY(){return yR||(yR=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=wP();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=WY(),r=CP();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,b){var S=p(g,y,b);return Array.isArray(S)?S:(0,r.diffAny)(g,y,b,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 b=d(p,y.path);if(b&&g.push(b),"from"in y){var S=d(p,y.from);S&&g.push(S)}}),g}e.createTests=f})(ex)),ex}var EP=YY();const KY="_removed_el5zk_1",XY="_added_el5zk_6",xR={removed:KY,added:XY};function JY(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(de.Tr,{children:[a.jsx(de.Td,{children:t}),a.jsx(de.Td,{className:xR.removed,children:o&&a.jsx(ro,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})}),a.jsx(de.Td,{className:xR.added,children:s&&a.jsx(ro,{path:n,property:r,propertyType:s.type,value:s.value,ignoreMissingValues:!0})})]})}):a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:t}),a.jsx(de.Td,{colSpan:2,style:{textAlign:"right"},children:a.jsx(Pe,{onClick:p,variant:"light",children:"Expand"})})]})})}const ZY="_root_15xvr_1",eK={root:ZY};function tK(e){const t=_e(),{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=[fi(n)],f=[fi(r)],p=[],m=nK(EP.createPatch(n,r));for(const g of m){const y=g.path,b=rK(y),S=iK(n.resourceType,b),j=g.op==="add"?void 0:bs(b,d),C=g.op==="remove"?void 0:bs(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${Wn(g.op)} ${b}`,path:S?.path??n.resourceType+"."+b,property:S,originalValue:bR(S,j),revisedValue:bR(S,C)})}return p},[o,n,r]);return c?a.jsxs(de,{className:eK.root,children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[a.jsx(de.Th,{}),a.jsx(de.Th,{children:"Before"}),a.jsx(de.Th,{children:"After"})]})}),a.jsx(de.Tbody,{children:c.map(d=>{const{key:f,...p}=d;return a.jsx(JY,{...p},f)})})]}):null}function nK(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 rK(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 iK(e,t){try{return Qm(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 bR(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:oK(t,!!e?.isArray)}}function oK(e,t){const n=fB(e).flatMap(r=>r.value);return t?n:n[0]}function FS(e){const{profileUrl:t}=e,n=_e(),r=n.getAccessPolicy(),o=Kt(e.value),[s,c]=v.useState(!1);v.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{uu(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&&uk(o,sl.READ,r),[r,o]);return!s||!o?null:a.jsx($p,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:d})}const aK="_item_5q6yx_1",sK="_itemPadding_5q6yx_5",SR={item:aK,itemPadding:sK};function lK(e){return a.jsx(fu,{children:e.children})}function bl(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(kl,{"data-testid":"timeline-item",fill:!0,...s,children:[a.jsxs(ye,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(Aa,{value:c,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Ee,{size:"sm",children:a.jsx(Nl,{c:"dark",fw:500,value:c,link:!0})}),a.jsxs(Ee,{size:"xs",children:[a.jsx(jt,{c:"dimmed",to:e.resource,children:wr(d)}),a.jsx(Ee,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(jt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(xe,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(xe.Target,{children:a.jsx(Dn,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Ot(e.resource)}`,children:a.jsx(bq,{})})}),o]})]}),a.jsx(AS,{children:a.jsx("div",{className:Ut(SR.item,{[SR.itemPadding]:r}),children:e.children})})]})}function TP(e,t){e.sort((n,r)=>{const o=wR(n,t),s=wR(r,t);return o>s?1:o<s?-1:jR(n,t)-jR(r,t)})}function wR(e,t){if(!RP(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function jR(e,t){if(!RP(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 RP(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const cK="_pinnedComment_u08s5_1",uK={pinnedComment:cK};function og(e){const t=_e(),n=t.getProfile(),r=v.useRef(null),o=Kt(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 b=v.useCallback(A=>{TP(A,o),A.reverse(),f(A)},[o]),S=v.useCallback(A=>{const P=[];for(const z of A){if(z.status!=="fulfilled")continue;const B=z.value;if(B.type==="history"&&c(B),B.entry)for(const Y of B.entry)P.push(Y.resource)}b(P)},[b]),j=v.useCallback(A=>b([...y.current,A]),[b]),C=v.useCallback(()=>{let A,P;"resourceType"in e.value?(A=e.value.resourceType,P=e.value.id):[A,P]=e.value.reference?.split("/"),g(t,A,P).then(S).catch(console.error)},[t,e.value,g,S]);v.useEffect(()=>C(),[C]);function R(A){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,A)).then(P=>j(P)).catch(console.error)}function E(A){!o||!e.createMedia||t.createResource(e.createMedia(o,n,A)).then(P=>j(P)).then(()=>rl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(Vo,{size:16}),autoClose:2e3})).catch(P=>rl({id:"upload-notification",color:"red",title:"Upload error",message:Qe(P),icon:a.jsx(ZT,{size:16}),autoClose:2e3}))}function T(){Ne({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(A){rl({id:"upload-notification",loading:!0,title:"Uploading...",message:vK(A),autoClose:!1,withCloseButton:!1})}function k(A){rl({id:"upload-notification",color:"red",title:"Upload error",message:Qe(A),icon:a.jsx(ZT,{size:16}),autoClose:2e3})}if(!o)return a.jsx(hr,{style:{width:"100%",height:"100%"},children:a.jsx(Ir,{})});const I=d.filter(A=>A).slice(0,p);return a.jsxs(lK,{children:[e.createCommunication&&a.jsx(kl,{children:a.jsx(pt,{testid:"timeline-form",onSubmit:A=>{R(A.text);const P=r.current;P&&(P.value="",P.focus())},children:a.jsxs(ye,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(Aa,{value:n}),a.jsx(He,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(Dn,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(Yq,{size:16})}),a.jsx(MS,{securityContext:Qt(o),onUpload:E,onUploadStart:T,onUploadProgress:_,onUploadError:k,children:A=>a.jsx(Dn,{...A,radius:"xl",color:"blue",variant:"filled",children:a.jsx(CS,{size:16})})})]})})}),I.map(A=>{const P=`${A.resourceType}/${A.id}/${A.meta?.versionId}`,z=e.getMenu?e.getMenu({primaryResource:o,currentResource:A,reloadTimeline:C}):void 0;if(A.resourceType===o.resourceType&&A.id===o.id)return a.jsx(dK,{history:s,resource:A,popupMenuItems:z},P);switch(A.resourceType){case"AuditEvent":return a.jsx(mK,{resource:A,popupMenuItems:z},P);case"Communication":return a.jsx(hK,{resource:A,popupMenuItems:z},P);case"DiagnosticReport":return a.jsx(gK,{resource:A,popupMenuItems:z},P);case"Media":return a.jsx(pK,{resource:A,popupMenuItems:z},P);default:return a.jsx(bl,{resource:A,padding:!0,children:a.jsx(FS,{value:A,ignoreMissingValues:!0})},P)}}),p<d.length&&a.jsx(ye,{justify:"center",pb:"lg",children:a.jsx(Pe,{onClick:()=>m(p+10),children:"Show More"})})]})}function dK(e){const{history:t,resource:n,...r}=e,o=fK(t,n);return o?a.jsx(bl,{resource:n,padding:!0,...r,children:a.jsx(tK,{original:o,revised:e.resource})}):a.jsxs(bl,{resource:n,padding:!0,...r,children:[a.jsx("h3",{children:"Created"}),a.jsx(FS,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function fK(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 hK(e){const n=!e.resource.priority||e.resource.priority==="routine"?void 0:uK.pinnedComment;return a.jsx(bl,{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 pK(e){const t=e.resource.content?.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(bl,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:a.jsx(vf,{value:e.resource.content})})}function mK(e){return a.jsx(bl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Jr,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function gK(e){return a.jsx(bl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(VS,{value:e.resource})})}function vK(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${nx(e.loaded)} / ${nx(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${nx(e.loaded)}`}function nx(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 yK(e){const{resource:t,...n}=e;return a.jsx(og,{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 xK(e){const{encounter:t,...n}=e;return a.jsx(og,{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:Qt(r),subject:r.subject,sender:Qt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",encounter:Qt(r),subject:r.subject,operator:Qt(o),issued:new Date().toISOString(),content:s}),...n})}function bK(e){let t;try{t=oV(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(ro,{value:t[0]||"",propertyType:e.propertyType})}function SK(e){return a.jsxs(Vn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(CR,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(CR,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(Ee,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function CR(e){return a.jsx(Pe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const wK={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]},jK={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 HS(e,t){return{...e,filters:t,offset:0,name:void 0}}function _P(e,t){return HS(e,(e.filters??[]).filter(n=>n.code!==t))}function ag(e,t,n,r,o){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),HS(e,s)}function CK(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function EK(e,t){return qS(e,t,-1)}function TK(e,t){return qS(e,t,0)}function RK(e,t){return qS(e,t,1)}function qS(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),sg(e,t,r,o)}function _K(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return sg(e,t,n,r)}function AK(e,t){return GS(e,t,-1)}function DK(e,t){return GS(e,t,0)}function kK(e,t){return GS(e,t,1)}function GS(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),sg(e,t,r,o)}function PK(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),sg(e,t,n,new Date)}function sg(e,t,n,r){return e=_P(e,t),e=ER(e,t,he.GREATER_THAN_OR_EQUALS,n),e=ER(e,t,he.LESS_THAN_OR_EQUALS,r),e}function ER(e,t,n,r){return ag(e,t,n,r.toISOString())}function TR(e,t,n=!0){return ag(e,t,he.MISSING,n.toString())}function NK(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function OK(e,t){const n=e.count??Fm,r=(t-1)*n;return NK(e,r)}function MK(e,t,n){return t===LK(e)&&n!==void 0&&n===IK(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function LK(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function IK(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function zK(e){return wK[e.type]}function AP(e){return jK[e]??""}function Sl(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 $K(e,t){const n=t.name;return n==="id"?a.jsx(jt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?e.meta?.versionId:n==="_lastUpdated"?wr(e.meta?.lastUpdated):`${e.resourceType}.${t.name}`===t.elementDefinition?.path?UK(e,t.elementDefinition):t.searchParams?.length===1&&t.name===t.searchParams[0].code?BK(e,t.searchParams[0]):null}function UK(e,t){const n=t.path?.split(".")?.pop()?.replaceAll("[x]","")??"",[r,o]=ng({type:e.resourceType,value:e},n);return r?a.jsx(ro,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function BK(e,t){const n=bs(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(ro,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function VK(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(no(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=zD(f),m=lS(f);return Qc(FK(p,m)).map(g=>({value:g,label:Sl(g)}))},[e.visible,e.search.resourceType]);function d(f){r({search:{...n.search,fields:f}})}return a.jsx(Vn,{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(Ue,{children:[a.jsx(_m,{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(ye,{justify:"flex-end",children:a.jsx(Pe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function FK(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(Sl(s));if(t)for(const s of Object.keys(t)){const c=Sl(s);!r.has(s)&&!o.has(c)&&(n.push(s),r.add(s),o.add(c))}return n}function DP(e){const t=Qm(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case yr.REFERENCE:return a.jsx(vs,{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 yr.BOOLEAN:return a.jsx($n,{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 yr.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 yr.DATETIME:return a.jsx(_o,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case yr.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 yr.QUANTITY:return a.jsx(xl,{name:n,path:"",defaultValue:HK(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 HK(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:Number.parseFloat(t),system:n,unit:r}}}function qK(e){const[t,n]=v.useState(hi(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(hi(e.search))},[e.search]);function o(f){n(ag(r.current,f.code,f.operator,f.value))}const s=e.search.resourceType,c=lS(s)??{},d=t.filters||[];return a.jsx(Vn,{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(GK,{id:`filter-${p}-row`,resourceType:s,searchParams:c,value:f,onChange:m=>{const g=[...d];g[p]=m,n(HS(r.current,g))},onDelete:()=>n(CK(r.current,p))},`filter-${p}-row`))})]}),a.jsx($S,{propertyDisplayName:"Filter",onClick:()=>o({})})]}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Cr,{children:"OK"})})]})})}function GK(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&&zK(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:Sl(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:AP(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),a.jsx("td",{children:c&&t.operator&&a.jsx(DP,{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(Dn,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:a.jsx(yl,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function QK(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(Vn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(pt,{onSubmit:r,children:a.jsxs(Sr,{children:[a.jsx(Sr.Col,{span:10,children:a.jsx(DP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(Sr.Col,{span:2,children:a.jsx(Pe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function WK(e){const{resourceType:t,filter:n}=e,r=Po.types[t].searchParams?.[n.code];if(r){if(r.type==="reference"&&(n.operator===he.EQUALS||n.operator===he.NOT_EQUALS))return a.jsx(Nl,{value:{reference:n.value}});const o=Qm(t,r);if(n.code==="_lastUpdated"||o.type===yr.DATETIME)return a.jsx(a.Fragment,{children:wr(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function YK(e){if(!e.searchParams)return null;function t(s,c){o(MK(e.search,s.code,c))}function n(s){o(_P(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(KK,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(xe.Dropdown,{children:e.searchParams.map(s=>a.jsx(xe.Item,{children:Sl(s.code)},s.code))})}function KK(e){switch(e.searchParam.type){case"date":return a.jsx(XK,{...e});case"number":case"quantity":return a.jsx(JK,{...e});case"reference":return a.jsx(ZK,{...e});case"string":return a.jsx(eX,{...e});case"token":case"uri":return a.jsx(tX,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function XK(e){const{searchParam:t}=e,n=t.code;return a.jsxs(xe.Dropdown,{children:[a.jsx(xe.Item,{leftSection:a.jsx(RS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(xe.Item,{leftSection:a.jsx(_S,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(xe.Item,{leftSection:a.jsx(hf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT_EQUALS),children:"Does not equal..."}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(Ik,{size:14}),onClick:()=>e.onPrompt(t,he.ENDS_BEFORE),children:"Before..."}),a.jsx(xe.Item,{leftSection:a.jsx(Lk,{size:14}),onClick:()=>e.onPrompt(t,he.STARTS_AFTER),children:"After..."}),a.jsx(xe.Item,{leftSection:a.jsx(qH,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Between..."}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(as,{size:14}),onClick:()=>e.onChange(RK(e.search,n)),children:"Tomorrow"}),a.jsx(xe.Item,{leftSection:a.jsx(as,{size:14}),onClick:()=>e.onChange(TK(e.search,n)),children:"Today"}),a.jsx(xe.Item,{leftSection:a.jsx(as,{size:14}),onClick:()=>e.onChange(EK(e.search,n)),children:"Yesterday"}),a.jsx(xe.Item,{leftSection:a.jsx(as,{size:14}),onClick:()=>e.onChange(_K(e.search,n)),children:"Next 24 Hours"}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(as,{size:14}),onClick:()=>e.onChange(kK(e.search,n)),children:"Next Month"}),a.jsx(xe.Item,{leftSection:a.jsx(as,{size:14}),onClick:()=>e.onChange(DK(e.search,n)),children:"This Month"}),a.jsx(xe.Item,{leftSection:a.jsx(as,{size:14}),onClick:()=>e.onChange(AK(e.search,n)),children:"Last Month"}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(as,{size:14}),onClick:()=>e.onChange(PK(e.search,n)),children:"Year to date"}),a.jsx(bf,{...e})]})}function JK(e){const{searchParam:t}=e;return a.jsxs(xe.Dropdown,{children:[a.jsx(xe.Item,{leftSection:a.jsx(RS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(xe.Item,{leftSection:a.jsx(_S,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(xe.Item,{leftSection:a.jsx(hf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT_EQUALS),children:"Does not equal..."}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(Lk,{size:14}),onClick:()=>e.onPrompt(t,he.GREATER_THAN),children:"Greater than..."}),a.jsx(xe.Item,{leftSection:a.jsx(Wx,{size:14}),onClick:()=>e.onPrompt(t,he.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(xe.Item,{leftSection:a.jsx(Ik,{size:14}),onClick:()=>e.onPrompt(t,he.LESS_THAN),children:"Less than..."}),a.jsx(xe.Item,{leftSection:a.jsx(Wx,{size:14}),onClick:()=>e.onPrompt(t,he.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(bf,{...e})]})}function ZK(e){const{searchParam:t}=e;return a.jsxs(xe.Dropdown,{children:[a.jsx(xe.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(xe.Item,{leftSection:a.jsx(hf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(bf,{...e})]})}function eX(e){const{searchParam:t}=e;return a.jsxs(xe.Dropdown,{children:[a.jsx(xe.Item,{leftSection:a.jsx(RS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(xe.Item,{leftSection:a.jsx(_S,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(xe.Item,{leftSection:a.jsx(hf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(XH,{size:14}),onClick:()=>e.onPrompt(t,he.CONTAINS),children:"Contains..."}),a.jsx(xe.Item,{leftSection:a.jsx(YH,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Does not contain..."}),a.jsx(bf,{...e})]})}function tX(e){const{searchParam:t}=e;return a.jsxs(xe.Dropdown,{children:[a.jsx(xe.Item,{leftSection:a.jsx(pf,{size:14}),onClick:()=>e.onPrompt(t,he.EQUALS),children:"Equals..."}),a.jsx(xe.Item,{leftSection:a.jsx(hf,{size:14}),onClick:()=>e.onPrompt(t,he.NOT),children:"Does not equal..."}),a.jsx(bf,{...e})]})}function bf(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(BH,{size:14}),onClick:()=>e.onChange(TR(e.search,n)),children:"Missing"}),a.jsx(xe.Item,{leftSection:a.jsx($H,{size:14}),onClick:()=>e.onChange(TR(e.search,n,!1)),children:"Not missing"}),a.jsx(xe.Divider,{}),a.jsx(xe.Item,{leftSection:a.jsx(yl,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function kP(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 nX="_root_vlout_1",rX="_table_vlout_8",iX="_tr_vlout_12",oX="_control_vlout_22",aX="_icon_vlout_31",ld={root:nX,table:rX,tr:iX,control:oX,icon:aX};function sX(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(lX(t,r));return n}function lX(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=_s(e,t),r=AB(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=lS(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=Qm(e,r);return{name:t,elementDefinition:o.elementDefinitions?.[0],searchParams:[r]}}return{name:t}}class cX extends Event{definition;constructor(t){super("change"),this.definition=t}}class uX extends Event{response;constructor(t){super("load"),this.response=t}}class Up extends Event{resource;browserEvent;constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function pu(e){const t=_e(),[n,r]=v.useState(),{search:o,onLoad:s}=e,[c,d]=v.useState(o);ko(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($=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,ps({...c,total:g,fields:void 0}),$)).then(Q=>{p({...m.current,searchResponse:Q}),s&&s(new uX(Q))}).catch(Q=>{p({...m.current,searchResponse:void 0}),r(Yt(Q))})},[t,c,g,s]),b=v.useCallback(()=>{p({...m.current,searchResponse:void 0}),y({cache:"reload"})},[y]);v.useEffect(()=>{y()},[y]);function S($,Q){$.stopPropagation();const L=$.target.checked,U={...m.current.selected};L?U[Q]=!0:delete U[Q],p({...m.current,selected:U})}function j($){$.stopPropagation();const M=$.target.checked,L={},U=m.current.searchResponse;M&&U?.entry&&U.entry.forEach(V=>{V.resource?.id&&(L[V.resource.id]=!0)}),p({...m.current,selected:L})}function C(){const $=m.current;if(!$.searchResponse?.entry||$.searchResponse.entry.length===0)return!1;for(const Q of $.searchResponse.entry)if(Q.resource?.id&&!$.selected[Q.resource.id])return!1;return!0}function R($){e.onChange&&e.onChange(new cX($))}function E($,Q){if(Bk($.target)||$.button===2)return;mn($);const M=Uk($);!M&&e.onClick&&e.onClick(new Up(Q,$)),M&&e.onAuxClick&&e.onAuxClick(new Up(Q,$))}function T(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return a.jsx(Er,{outcome:n});if(!ID(c.resourceType))return a.jsx(hr,{style:{width:"100%",height:"100%"},children:a.jsx(Ir,{})});const _=e.checkboxesEnabled,k=sX(c),I=c.resourceType,A=f.searchResponse,z=A?.entry?.map($=>$.resource),B="subtle",Y="gray",J=16,Z=window.innerWidth<768;return a.jsxs("div",{className:ld.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(ye,{justify:"space-between",mb:"xl",children:[a.jsxs(ye,{gap:2,children:[a.jsx(Pe,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(dq,{size:J}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),a.jsx(Pe,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(Pq,{size:J}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&a.jsx(Pe,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(Dq,{size:J}),onClick:e.onNew,children:"New..."}),!Z&&T()&&a.jsx(Pe,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(AG,{size:J}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!Z&&e.onDelete&&a.jsx(Pe,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(Ym,{size:J}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!Z&&e.onBulk&&a.jsx(Pe,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(FH,{size:J}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),a.jsxs(ye,{gap:2,children:[A&&a.jsxs(Ee,{size:"xs",c:"dimmed","data-testid":"count-display",children:[PP(c,A).toLocaleString(),"-",pX(c,A).toLocaleString(),A.total!==void 0&&` of ${c.total==="estimate"?"~":""}${A.total?.toLocaleString()}`]}),a.jsx(Dn,{variant:B,color:Y,title:"Refresh",onClick:b,children:a.jsx($k,{size:J})})]})]}),a.jsxs(de,{className:ld.table,children:[a.jsxs(de.Thead,{children:[a.jsxs(de.Tr,{children:[_&&a.jsx(de.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:$=>j($)})}),k.map($=>a.jsx(de.Th,{children:a.jsxs(xe,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(xe.Target,{children:a.jsx(An,{className:ld.control,p:2,children:a.jsxs(ye,{justify:"space-between",wrap:"nowrap",children:[a.jsx(Ee,{fw:500,children:Sl($.name)}),a.jsx(hr,{className:ld.icon,children:a.jsx(PH,{size:14,stroke:1.5})})]})})}),a.jsx(YK,{search:c,searchParams:$.searchParams,onPrompt:(Q,M)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:Q,filterDialogFilter:M,dialogOpenTime:Date.now()})},onChange:Q=>{R(Q)}})]})},$.name))]}),!e.hideFilters&&a.jsxs(de.Tr,{children:[_&&a.jsx(de.Th,{}),k.map($=>a.jsx(de.Th,{children:$.searchParams&&a.jsx(dX,{resourceType:I,searchParams:$.searchParams,filters:c.filters})},$.name))]})]}),a.jsx(de.Tbody,{children:z?.map($=>$&&a.jsxs(de.Tr,{className:ld.tr,"data-testid":"search-control-row",onClick:Q=>E(Q,$),onAuxClick:Q=>E(Q,$),children:[_&&a.jsx(de.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${$.id}`,checked:!!f.selected[$.id],onChange:Q=>S(Q,$.id)})}),k.map(Q=>a.jsx(de.Td,{children:$K($,Q)},Q.name))]},$.id))})]}),!z?.length&&a.jsx(fu,{children:a.jsx(hr,{style:{height:150},children:a.jsx(Ee,{size:"xl",c:"dimmed",children:"No results"})})}),A&&a.jsx(hr,{m:"md",p:"md",children:a.jsx(zi,{value:fX(c),total:hX(c,A),onChange:$=>R(OK(c,$)),getControlProps:kP})}),a.jsx(VK,{search:c,visible:m.current.fieldEditorVisible,onOk:$=>{R($),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),a.jsx(qK,{search:c,visible:m.current.filterEditorVisible,onOk:$=>{R($),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),a.jsx(SK,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),a.jsx(QK,{visible:m.current.filterDialogVisible,title:f.filterDialogSearchParam?.code?Sl(f.filterDialogSearchParam.code):"",resourceType:I,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:$=>{R(ag(c,$.code,$.operator,$.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}function dX(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:[AP(n.operator)," ",a.jsx(WK,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function fX(e){return Math.floor((e.offset??0)/(e.count??Fm))+1}function hX(e,t){const n=e.count??Fm,r=NP(e,t);return Math.ceil(r/n)}function PP(e,t){return Math.min(NP(e,t),(e.offset??0)+1)}function pX(e,t){return Math.max(PP(e,t)+(t.entry?.length??0)-1,0)}function NP(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 mX(e){const t=_e(),[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 b=v.useRef({});b.current=m,v.useEffect(()=>{s(void 0),t.graphql(c).then(p).catch(T=>s(Yt(T)))},[t,c]);function S(T,_){T.stopPropagation();const I=T.target.checked,A={...b.current};I?A[_]=!0:delete A[_],g(A)}function j(T){T.stopPropagation();const k=T.target.checked,I={},A=y.current?.data.ResourceList;k&&A&&A.forEach(P=>{P.id&&(I[P.id]=!0)}),g(I)}function C(){const T=y.current?.data.ResourceList;if(!T||T.length===0)return!1;for(const _ of T)if(_.id&&!b.current[_.id])return!1;return!0}function R(T,_){Bk(T.target)||(mn(T),T.button!==1&&e.onClick&&e.onClick(new Up(_,T)),T.button===1&&e.onAuxClick&&e.onAuxClick(new Up(_,T)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(Ir,{});const E=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:T=>mn(T),"data-testid":"search-control",children:[a.jsxs(de,{children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[E&&a.jsx(de.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:T=>j(T)})}),d.map(T=>a.jsx(de.Th,{children:T.name},T.name))]})}),a.jsx(de.Tbody,{children:f?.data.ResourceList.map(T=>T&&a.jsxs(de.Tr,{"data-testid":"search-control-row",onClick:_=>R(_,T),onAuxClick:_=>R(_,T),children:[E&&a.jsx(de.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${T.id}`,checked:!!m[T.id],onChange:_=>S(_,T.id)})}),d.map(_=>a.jsx(de.Td,{children:a.jsx(bK,{propertyType:_.propertyType,path:_.fhirPath,resource:T})},_.name))]},T.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(Pe,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const gX=v.memo(mX),vX="_root_1fbwr_1",yX="_entry_1fbwr_8",xX="_key_1fbwr_13",bX="_value_1fbwr_20",lg={root:vX,entry:yX,key:xX,value:bX};function xt(e){return a.jsx(Jr,{children:a.jsx("div",{className:lg.root,children:e.children})})}xt.Entry=function(t){return a.jsx("div",{className:lg.entry,children:t.children})};xt.Key=function(t){return a.jsx("div",{className:lg.key,children:t.children})};xt.Value=function(t){return a.jsx("div",{className:lg.value,children:t.children})};function SX(e){const{group:t}=e;return a.jsx(Or,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(ye,{children:[t.measureScore&&a.jsx(CX,{group:t}),!t.measureScore&&a.jsx(jX,{group:t})]})})}function wX(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(Ee,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(Ee,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function jX(e){const{group:t}=e,n=t.population,r=n?.find(f=>xs(f.code)==="numerator"),o=n?.find(f=>xs(f.code)==="denominator"),s=r?.count,c=o?.count;if(c===0)return a.jsxs(ce,{children:[a.jsx(ze,{order:3,children:"Not Applicable"}),a.jsx(Ee,{children:`Denominator: ${c}`})]});if(s===void 0||c===void 0)return a.jsxs(ce,{children:[a.jsx(ze,{order:3,children:"Insufficient Data"}),a.jsx(Ee,{children:`Numerator: ${s}`}),a.jsx(Ee,{children:`Denominator: ${c}`})]});const d=s/c*100;return a.jsx(Mm,{size:120,thickness:12,roundCaps:!0,sections:[{value:d,color:OP(d)}],label:a.jsx(eo,{justify:"center",children:a.jsxs(Ee,{fw:700,fz:18,children:[s," / ",c]})})})}function CX(e){const{group:t}=e,n=t.measureScore?.unit??t.measureScore?.code;return a.jsx(a.Fragment,{children:n==="%"?a.jsx(Mm,{size:120,thickness:12,roundCaps:!0,sections:[{value:EX(t),color:OP(t?.measureScore?.value??0)}],label:a.jsx(eo,{justify:"center",children:a.jsx(Ee,{fw:700,fz:18,children:a.jsx(Id,{value:t.measureScore})})})}):a.jsx(eo,{h:120,align:"center",children:a.jsx(ze,{order:3,children:a.jsx(Id,{value:t.measureScore})})})})}function EX(e){const t=e.measureScore?.value,n=e.measureScore?.unit;return t?t<=1&&n==="%"?t*100:t:0}function OP(e){return e<=33?"red":e<=67?"yellow":"green"}function TX(e){const t=Kt(e.measureReport),[n]=CH("Measure",{url:t?.measure});return t?a.jsxs(ce,{children:[n&&a.jsx(wX,{measure:n}),a.jsx(Lm,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:t.group?.map((r,o)=>a.jsx(SX,{group:r},r.id??o))})]}):null}const rx="patient-export",ix="Patient Export",RX={everything:{operation:"$everything",extension:"json",contentType:nn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:nn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:nn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:nn.CDA_XML}};function _X(e){const t=_e(),{patient:n}=e,r=v.useCallback(async o=>{const s=pl(n),c=o.format,{operation:d,type:f,contentType:p,extension:m}=RX[c],g=t.fhirUrl("Patient",s,d),y={};f&&(y.type=f),o.author&&(y.author={reference:o.author}),o.authoredOn&&(y.authoredOn=IS(o.authoredOn)),o.startDate&&(y.start=o.startDate),o.endDate&&(y.end=o.endDate),Di.show({id:rx,title:ix,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,y,void 0,{cache:"no-cache",headers:{Accept:p}}),S=`Patient-export-${s}-${new Date().toISOString().replaceAll(":","-")}.${m}`;AX(b,S,p),Di.update({id:rx,title:ix,color:"green",message:"Done",icon:a.jsx(Vo,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){Di.update({id:rx,title:ix,color:"red",message:Qe(b),icon:a.jsx(yl,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return a.jsx(pt,{onSubmit:r,children:a.jsxs(Ue,{children:[a.jsx($t,{title:"Export Format",description:"Required",withAsterisk:!0,children:a.jsx(qc,{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($t,{title:"Author",description:"Optional author for composition. Default value is current user.",children:a.jsx(vs,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),a.jsx($t,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:a.jsx(_o,{name:"authoredOn",placeholder:"Authored on"})}),a.jsx($t,{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(_o,{name:"startDate",placeholder:"Start date"})}),a.jsx($t,{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(_o,{name:"endDate",placeholder:"End date"})}),a.jsx(ye,{justify:"right",children:a.jsx(Cr,{children:"Request Export"})})]})})}function AX(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 DX(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function MP(e){const t=Kt(e.patient);return t?a.jsxs(xt,{children:[a.jsx(Aa,{value:t,size:"lg",color:DX(t)}),a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"Name"}),a.jsx(xt.Value,{children:a.jsx(jt,{to:t,fw:500,children:t.name?a.jsx(DS,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"DoB"}),a.jsx(xt.Value,{children:t.birthDate})]}),a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"Age"}),a.jsx(xt.Value,{children:ZU(t.birthDate)})]})]}),t.gender&&a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"Gender"}),a.jsx(xt.Value,{children:t.gender})]}),t.address&&a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"State"}),a.jsx(xt.Value,{children:t.address[0]?.state})]}),t.identifier?.map(n=>a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:n?.system}),a.jsx(xt.Value,{children:n?.value})]},`${n?.system}-${n?.value}`))]}):null}function kX(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(og,{value:t,loadTimelineResources:r,createCommunication:(o,s,c)=>({resourceType:"Communication",status:"completed",subject:Qt(o),sender:Qt(s),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(o,s,c)=>({resourceType:"Media",status:"completed",subject:Qt(o),operator:Qt(s),issued:new Date().toISOString(),content:c}),...n})}const PX="_section_pqpwm_1",NX="_hovering_pqpwm_7",Kx={section:PX,hovering:NX};function OX(e){const t=_e(),n=Kt(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 b=v.useRef(p);if(b.current=p,v.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(m($X(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({...b.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(MX,{actions:p.action||[],selectedKey:s,setSelectedKey:c,hoverKey:d,setHoverKey:f,onChange:j=>S("action",j)}),a.jsx(Cr,{children:"Save"})]})})}function MX(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(Ue,{gap:"md",className:Kx.section,children:[e.actions.map(s=>a.jsx(LX,{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(Pe,{variant:"outline",onClick:s=>{mn(s),r({id:LP()})},children:"Add action"})})]})}function LX(e){const{action:t}=e,n=zX(t);function r(s){s.stopPropagation(),e.setSelectedKey(e.action.id)}function o(s){mn(s),e.setHoverKey(e.action.id)}return a.jsx("div",{onClick:r,onMouseOver:o,onFocus:o,children:a.jsx(IX,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function IX(e){const{action:t}=e,[n,r]=v.useState(e.actionType),o=e.selectedKey===e.action.id,s=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const d=Ut(Kx.section,{[Kx.hovering]:s&&!o});return a.jsxs(Or,{"data-testid":t.id,className:d,p:0,radius:"sm",withBorder:!0,children:[a.jsxs(eo,{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:f=>c("title",f.currentTarget.value)}),a.jsx(js,{"data-testid":"close-button",onClick:e.onRemove})]}),o&&a.jsxs(Ue,{gap:"xl",p:"md",children:[a.jsx(ce,{children:a.jsx(He,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),a.jsx(ce,{children:a.jsx(fn,{label:"Type of Action",value:n,onChange:f=>{const p=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(p),e.onChange({...e.action,definitionCanonical:p==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&a.jsxs(Ue,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(Ee,{fw:600,children:"Select questionnaire"}),a.jsx(Ee,{c:"red",children:"*"})]}),a.jsxs(Ee,{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(Mt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),a.jsx(RR,{resourceType:"Questionnaire",action:t,onChange:e.onChange,placeholder:"Search for questionnaire"})]}),n==="activitydefinition"&&a.jsxs(Ue,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(Ee,{fw:600,children:"Select activity definition"}),a.jsx(Ee,{c:"red",children:"*"})]}),a.jsxs(Ee,{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(Mt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),a.jsx(RR,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange,placeholder:"Search for activity definition"})]})]})]})}function RR(e){const{id:t,definitionCanonical:n}=e.action,r=n?.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(Pl,{name:t,placeholder:e.placeholder,resourceType:e.resourceType,defaultValue:r,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:"url"in o?o.url:void 0,definitionUri:"url"in o?void 0:Ot(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function zX(e){return e.definitionCanonical?.startsWith("Questionnaire")?"questionnaire":e.definitionCanonical?.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let ox=1;function LP(e){if(e){if(e.startsWith("id-")){const t=Number.parseInt(e.substring(3),10);Number.isNaN(t)||(ox=Math.max(ox,t+1))}return e}return"id-"+ox++}function $X(e){return{...e,action:IP(e.action)}}function IP(e){if(e)return e.map(t=>({...t,id:LP(t.id),action:IP(t.action)}))}const ul=30,Bp=50;function Vp(e){const t=e.formState,n=e.item,r=e.responseItem;function o(g){t&&e.context&&t.onChangeAnswer(e.context,e.item,g)}const s=n.type;if(!s)return null;const c=n.linkId;if(!c)return null;let d;n.initial&&n.initial.length>0?d=n.initial[0]:n.answerOption&&n.answerOption.length>0&&(d=n.answerOption.find(g=>g.initialSelected));const f=WS(r,e.index)??SS(d),p=Uo(r,`${io}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(s){case Ct.display:m=a.jsx("p",{children:e.item.text},e.item.linkId);break;case Ct.boolean:m=a.jsx(mP,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx($n,{id:e.item.linkId,name:e.item.linkId,required:e.required??n.required,defaultChecked:f?.value,onChange:g=>o([{valueBoolean:g.currentTarget.checked}])})},e.item.linkId);break;case Ct.decimal:m=a.jsx(He,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueDecimal:g.currentTarget.valueAsNumber}])});break;case Ct.integer:m=a.jsx(He,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueInteger:g.currentTarget.valueAsNumber}])});break;case Ct.date:m=a.jsx(He,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDate:g.currentTarget.value}])});break;case Ct.dateTime:m=a.jsx(_o,{name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDateTime:g}])});break;case Ct.time:m=a.jsx(He,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueTime:g.currentTarget.value}])});break;case Ct.string:case Ct.url:m=a.jsx(He,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const y=g.currentTarget.value;o(y===""?[]:[{valueString:y}])}});break;case Ct.text:m=a.jsx(_l,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const y=g.currentTarget.value;o(y===""?[]:[{valueString:y}])}});break;case Ct.attachment:m=a.jsx(ye,{py:4,children:a.jsx(eP,{path:"",name:c,defaultValue:f?.value,onChange:g=>o([{valueAttachment:g}])})});break;case Ct.reference:m=a.jsx(vs,{name:c,required:e.required??n.required,targetTypes:_k(n),searchCriteria:pH(n,t?.subject,t?.encounter),defaultValue:f?.value,onChange:g=>o([{valueReference:g}])});break;case Ct.quantity:m=a.jsx(xl,{path:"",name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueQuantity:g}]),disableWheel:!0});break;case Ct.choice:case Ct.openChoice:GX(n)?m=a.jsx(FX,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):qX(n)||n.answerValueSet&&!QX(n)?m=a.jsx(UX,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):m=a.jsx(VX,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)});break;default:return null}return a.jsxs(a.Fragment,{children:[m,p?.valueString&&a.jsx(Ee,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function UX(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e;if(!n.answerOption?.length&&!n.answerValueSet)return a.jsx(QS,{});const d=SS(o),f=WS(c)??d,p=UP(c),m=n.repeats||WX(n);if(n.answerValueSet)return a.jsx(gf,{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}=YX(n);return a.jsx(_m,{data:y,placeholder:"Select items",searchable:!0,defaultValue:p||[ml(d)],required:r,onChange:b=>{if(b.length===0)s([{}]);else{const S=Tk(b,g,n);s(S)}}})}else{const g=[""];if(n.answerOption)for(const y of n.answerOption){const b=No(y);g.push(ml(b))}return a.jsx(fn,{id:t,name:t,required:r,onChange:y=>{const b=y.currentTarget.selectedIndex;if(b===0){s([{}]);return}const S=n.answerOption[b-1],j=No(S),C="value"+Wn(j.type);s([{[C]:j.value}])},defaultValue:uf(f?.value)||f?.value,data:g})}}function BX(e,t){return e?t.valueSetExpand({url:e,count:ul+1}).then(n=>n.expansion?.contains??[]):Promise.resolve([])}function zP(e){const t=_e(),[n,r]=v.useState([]),[o,s]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){s(!0);try{const d=await BX(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 $P(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 VX(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:s,response:c}=e,d=_s("QuestionnaireItemAnswerOption","value[x]"),f=SS(o),[p,m]=zP(n.answerValueSet),g=[];let y;if(n.answerValueSet)g.push(...$P(p,t));else if(n.answerOption){const C=n.answerOption.slice(0,Bp).map((R,E)=>{const T=`${t}-option-${E}`,_=No(R);return _?.value?(f&&no(_)===no(f)&&(y=T),[T,_]):null}).filter(R=>R!==null);g.push(...C)}const b=WS(c),S=HX(g,b);if(m)return a.jsx(Ee,{children:"Loading options..."});if(g.length===0)return a.jsx(QS,{});const j=g.slice(0,ul);return a.jsxs(a.Fragment,{children:[a.jsx(vr.Group,{name:t,value:S??y,required:r,onChange:C=>{const R=g.find(E=>E[0]===C);if(R){const E=R[1],T="value"+Wn(E.type);s([{[T]:E.value}])}},children:j.map(([C,R])=>a.jsx(vr,{id:C,value:C,py:4,required:r,label:a.jsx(ro,{property:d,propertyType:R.type,value:R.value})},C))}),(n.answerValueSet&&g.length>ul||n.answerOption&&g.length>Bp)&&a.jsxs(Ee,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",ul," options"]})]})}function FX(e){const{name:t,item:n,onChangeAnswer:r,response:o}=e,s=_s("QuestionnaireItemAnswerOption","value[x]"),[c,d]=zP(n.answerValueSet),f=n.answerValueSet?(o?.answer?.map(S=>S.valueCoding)||[]).filter(S=>S!==void 0):UP(o),[p,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...$P(c,t));else if(n.answerOption){const S=n.answerOption.slice(0,Bp).map((j,C)=>{const R=`${t}-option-${C}`,E=No(j);return E?.value?[R,E]:null}).filter(j=>j!==null);g.push(...S)}if(d)return a.jsx(Ee,{children:"Loading options..."});if(g.length===0)return a.jsx(QS,{});const y=g.slice(0,ul),b=(S,j)=>{if(n.answerValueSet){const C=p;let R;j?R=[...C,S.value]:R=C.filter(E=>!ko(E,S.value)),m(R),R.length===0?r([{}]):r(R.map(E=>({valueCoding:E})))}else{const C=p,R=ml(S);let E;if(j?E=[...C,R]:E=C.filter(T=>T!==R),m(E),E.length===0)r([{}]);else{const T=Tk(E,"value"+Wn(S.type),n);r(T)}}};return a.jsxs(ye,{style:{flexDirection:"column",alignItems:"flex-start"},children:[y.map(([S,j])=>{const C=ml(j),R=n.answerValueSet?p.some(E=>ko(E,j.value)):p.includes(C);return a.jsx($n,{id:S,label:a.jsx(ro,{property:s,propertyType:j.type,value:j.value}),checked:R,onChange:E=>b(j,E.currentTarget.checked)},S)}),(n.answerValueSet&&g.length>ul||n.answerOption&&g.length>Bp)&&a.jsxs(Ee,{size:"sm",c:"dimmed",children:["Showing first ",ul," options"]})]})}function QS(){return a.jsx(He,{disabled:!0,placeholder:"No Answers Defined"})}function WS(e,t=0){return No(e?.answer?.[t]??{})}function UP(e){const t=e?.answer;return t?t.map(r=>No(r)).map(r=>uf(r?.value)||r?.value).filter(Boolean):[]}function HX(e,t){return e.find(n=>ko(n[1].value,t?.value))?.[0]}function cg(e,t){return!!e.extension?.some(n=>n.url===xS&&n.valueCodeableConcept?.coding?.[0]?.code===t)}function qX(e){return cg(e,"drop-down")}function GX(e){return cg(e,"check-box")}function QX(e){return cg(e,"radio-button")}function WX(e){return cg(e,"multi-select")}function YX(e){if(e.answerOption?.length===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=No(t),r="value"+Wn(n.type),o=(e.answerOption??[]).map(s=>{const c=No(s),d=ml(c);return{value:d,label:d}});return{propertyName:r,data:o}}const KX="_section_my8o4_1",XX="_hovering_my8o4_10",JX="_editing_my8o4_14",ZX="_questionBody_my8o4_20",eJ="_topActions_my8o4_24",tJ="_bottomActions_my8o4_33",nJ="_movementActions_my8o4_44",rJ="_movementIcons_my8o4_56",iJ="_columnAlignment_my8o4_60",oJ="_linkIdInput_my8o4_65",aJ="_typeSelect_my8o4_70",sJ="_preserveBreaks_my8o4_74",ci={section:KX,hovering:XX,editing:JX,questionBody:ZX,topActions:eJ,bottomActions:tJ,movementActions:nJ,movementIcons:rJ,columnAlignment:iJ,linkIdInput:oJ,typeSelect:aJ,preserveBreaks:sJ};function lJ(e){const t=_e(),n=Kt(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(fJ(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]);const b=(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(BP,{item:s,selectedKey:d,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),a.jsx(Cr,{children:"Save"})]})})}function BP(e){const t=e.item,n=e.item,r=Bo(e.item),o=r||n.type===Ct.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(T){mn(T),e.setSelectedKey(e.item.id)}function m(T){mn(T),e.setHoverKey(e.item.id)}function g(T){const _=f.current;e.onChange({..._,item:_.item?.map(k=>k.id===T.id?T:k)})}function y(T,_){e.onChange({...e.item,item:[...e.item.item??[],T]},_)}function b(T){e.onChange({...e.item,item:e.item.item?.filter(_=>_!==T)})}function S(T,_){e.onChange({...f.current,[T]:_})}function j(T){e.onChange({...e.item,...T})}function C(T){e.onChange({...e.item,item:e.item.item?.map(_=>_===T?{..._,repeats:!_.repeats}:_)})}function R(T,_){const k=mJ(e.item.item,T,_);e.onChange({...e.item,item:k})}const E=Ut(ci.section,{[ci.editing]:c,[ci.hovering]:d&&!c});return a.jsxs("div",{"data-testid":n.linkId,className:E,onClick:p,onMouseOver:m,onFocus:m,children:[a.jsx("div",{className:ci.questionBody,children:c?a.jsxs(a.Fragment,{children:[r&&a.jsx(He,{size:"xl",defaultValue:t.title,onBlur:T=>S("title",T.currentTarget.value)}),!r&&a.jsx(_l,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:T=>S("text",T.currentTarget.value)}),n.type==="reference"&&a.jsx(dJ,{item:n,onChange:j}),iH(n)&&a.jsx(cJ,{item:n,onChange:T=>j(T)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(ze,{children:t.title}),n.text&&a.jsx("div",{className:ci.preserveBreaks,children:n.text}),!o&&a.jsx(Vp,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),n.item?.map((T,_)=>a.jsx("div",{children:a.jsx(BP,{item:T,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(T),onRepeatable:C,onMoveUp:()=>R(_,-1),onMoveDown:()=>R(_,1)})},T.id)),!o&&a.jsx("div",{className:ci.topActions,children:c?a.jsxs(a.Fragment,{children:[a.jsx(He,{size:"xs",className:ci.linkIdInput,defaultValue:n.linkId,onBlur:T=>S("linkId",T.currentTarget.value)}),!o&&a.jsx(fn,{size:"xs",className:ci.typeSelect,defaultValue:n.type,onChange:T=>S("type",T.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):a.jsx("div",{children:s})}),!r&&a.jsx(ce,{className:ci.movementActions,children:a.jsxs(ce,{className:ci.columnAlignment,children:[!e.isFirst&&a.jsx(Mt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(IH,{"data-testid":"up-button",size:15,className:ci.movementIcons})}),!e.isLast&&a.jsx(Mt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(MH,{"data-testid":"down-button",size:15,className:ci.movementIcons})})]})}),a.jsxs("div",{className:ci.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Mt,{href:"#",onClick:T=>{T.preventDefault(),y({id:wl(),linkId:Zx("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Mt,{href:"#",onClick:T=>{T.preventDefault(),y({id:wl(),linkId:Zx("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Mt,{href:"#",onClick:T=>{T.preventDefault(),y(pJ(),!0)},children:"Add Page"}),c&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Mt,{href:"#",onClick:T=>{T.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Mt,{href:"#",onClick:T=>{T.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function cJ(e){const t=_s("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(uJ,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(ce,{display:"flex",children:[a.jsx(Mt,{href:"#",onClick:r=>{mn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:wl()}]})},children:"Add choice"}),a.jsx(Im,{w:"lg"}),a.jsx(Mt,{href:"#",onClick:r=>{mn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function uJ(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=ng({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(xf,{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(Mt,{href:"#",onClick:o=>{mn(o),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function dJ(e){const t=_k(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(ye,{children:[a.jsx(OS,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(Jy(e.item,t.map(s=>s===n?o:s)))}}),a.jsx(Mt,{href:"#",onClick:o=>{mn(o),e.onChange(Jy(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Mt,{href:"#",onClick:n=>{mn(n),e.onChange(Jy(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Xx=1,Jx=1;function Zx(e){return e+Xx++}function wl(){return"id-"+Jx++}function fJ(e){return{...e,id:e.id||wl(),item:VP(e.item)}}function VP(e){if(e)return e.forEach(t=>{t.id?.match(/^id-\d+$/)&&(Jx=Math.max(Jx,Number.parseInt(t.id.substring(3),10)+1)),t.linkId?.match(/^q\d+$/)&&(Xx=Math.max(Xx,Number.parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||wl(),item:VP(t.item),answerOption:hJ(t.answerOption)}))}function hJ(e){if(e)return e.map(t=>({...t,id:t.id||wl()}))}function pJ(){return{id:wl(),linkId:Zx("s"),type:"group",text:"New Page",extension:[{url:xS,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function mJ(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 Fp=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}},gJ=class FP{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 FP(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,b=f.y-p.y,S=m+g==0?0:g/(m+g),j={x:p.x+y*S,y:p.y+b*S},C=n.x-j.x,R=n.y-j.y;return{c1:new Fp(f.x+C,f.y+R),c2:new Fp(p.x+C,p.y+R)}}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}},vJ=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 yJ(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 xJ=class eb extends vJ{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?yJ(eb.prototype._strokeUpdate,this.throttle):eb.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){switch(t){case"image/svg+xml":return typeof n!="object"&&(n=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(n))}`;default:return 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";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.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 Fp(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=gJ.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 b=y*t.startPoint.x;b+=3*g*d*t.control1.x,b+=3*m*f*t.control2.x,b+=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(b,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 Fp(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,b=this._dataUrlOptions?.xOffset||0,S=this._dataUrlOptions?.yOffset||0,j=document.createElement("image");j.setAttribute("x",b.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 b=`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",b),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:b,maxWidth:S})=>{const j=document.createElement("circle"),C=y>0?y:(b+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 bJ(e){const t=_e(),{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:io+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:s??Qt(t.getProfile()),data:p.current?.toDataURL().split(",")[1]})}if(f.current){const b=new xJ(f.current);o?.data&&b.fromDataURL(o.data).catch(console.error),b.addEventListener("endStroke",y),p.current=b}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(Or,{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(Pe,{onClick:g,"aria-label":"Clear signature",pos:"absolute",top:0,right:0,size:"xs",leftSection:a.jsx(Ym,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function HP(e){const t=[...e.context,e.responseItem];return a.jsxs("div",{children:[e.item.text&&a.jsx(ze,{order:3,mb:"md",children:e.item.text}),a.jsx(tb,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function SJ(e){return a.jsxs(a.Fragment,{children:[e.responseItems.map(t=>a.jsx(HP,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),a.jsx(Mt,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function wJ(e){const{formState:t,context:n,item:r,responseItem:o}=e,s=r.type!==Ct.choice&&r.type!==Ct.openChoice,c=o.answer&&o.answer.length>0?o.answer:[{}];return a.jsxs($t,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[a.jsx(Ue,{gap:"xs",children:c?.map((d,f)=>a.jsx(Vp,{formState:t,context:n,item:r,responseItem:o,index:f},`${r.linkId}-${f}`))}),s&&a.jsx(Mt,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function tb(e){const{formState:t,context:n,items:r,responseItems:o}=e;return a.jsx(Ue,{children:r.map((s,c)=>{if(!oH(s,t.questionnaireResponse))return null;if(s.type===Ct.display)return a.jsx("p",{children:s.text},`display-${s.id}-${c}`);const d=o.filter(f=>f.linkId===s.linkId);return s.type===Ct.group&&s.repeats?a.jsx(SJ,{formState:t,context:n,item:s,responseItems:d},`repeating-group-${s.id}-${c}`):s.type===Ct.group?a.jsx(HP,{formState:t,context:n,item:s,responseItem:d[0]},`group-${s.id}-${c}`):s.type===Ct.boolean?a.jsx(Vp,{formState:t,context:n,item:s,responseItem:d[0],index:0},`boolean-item-${s.id}-${c}`):s.repeats?a.jsx(wJ,{formState:t,context:n,item:s,responseItem:d[0]},`repeating-item-${s.id}-${c}`):a.jsx($t,{htmlFor:s.linkId,title:s.text,withAsterisk:s.required,children:a.jsx(Vp,{formState:t,context:n,item:s,responseItem:d[0],index:0})},`repeating-item-${s.id}-${c}`)})})}function jJ(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(Gc,{active:c,allowNextStepsSelect:!1,p:6,children:s.map((m,g)=>a.jsx(Gc.Step,{label:m.title,children:g===c&&o},m.linkId))}),!r&&a.jsxs(ye,{justify:"flex-end",mt:"xl",gap:"xs",children:[d&&a.jsx(Pe,{onClick:t.onPrevPage,children:"Back"}),f&&a.jsx(Pe,{onClick:m=>{m.currentTarget.closest("form").reportValidity()&&t.onNextPage()},children:"Next"}),p&&a.jsx(Cr,{children:n??"Submit"})]})]})}function qP(e){const t=_e(),[n,r]=v.useState(!1),o=v.useRef(e);o.current=e;const s=v.useCallback(g=>{r(!1),o.current.onChange?.(g)},[]),c=yH({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:!!Uo(c.questionnaire,rH),[c]),p=v.useMemo(()=>c.loading?!1:!!c.questionnaireResponse.extension?.find(g=>g.url===hp),[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 b=g.questionnaire,S=g.questionnaireResponse,j=o.current.subject;let C=o.current.source;if(!C){const R=t.getProfile();R&&(C=Qt(R))}y({...S,questionnaire:b.url??Ot(b),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(ze,{children:c.questionnaire.title}),c.pagination?a.jsx(jJ,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:a.jsx(tb,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):a.jsxs(a.Fragment,{children:[a.jsx(tb,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&a.jsxs(Ue,{mt:"md",gap:0,children:[a.jsx(Ee,{size:"sm",fw:500,children:"Signature"}),a.jsx(bJ,{onChange:c.onChangeSignature}),!p&&n&&a.jsx(Ee,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&a.jsx(ye,{justify:"flex-end",mt:"xl",gap:"xs",children:a.jsx(Cr,{children:e.submitButtonText??"Submit"})})]})]})}const CJ="_section_4m5it_1",EJ={section:CJ},TJ=["gender","age","gestationalAge","context","appliesTo","category"],RJ={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function _J(e){e=Object.assign(RJ,e);const t=e.definition,[n,r]=v.useState([]),[o,s]=v.useState(1),[c,d]=v.useState(1);return v.useEffect(()=>{const S=kJ(t,d);r(PJ(S.qualifiedInterval||[],s))},[t]),a.jsxs(pt,{testid:"reference-range-editor",onSubmit:f,children:[a.jsx(Ue,{children:n.map(S=>a.jsx(AJ,{unit:OJ(t.quantitativeDetails?.unit),onChange:g,onAdd:y,onRemove:b,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`))}),a.jsx(Dn,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{mn(S),p({id:`group-id-${o}`,filters:{},intervals:[]}),s(j=>j+1)},children:a.jsx(Mp,{})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Cr,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!MJ(j));e.onSubmit({...t,qualifiedInterval:S})}function p(S){r(j=>[...j,S])}function m(S){r(j=>j.filter(C=>C.id!==S.id))}function g(S,j){r(C=>{C=[...C];const R=C.find(T=>T.id===S),E=R?.intervals.findIndex(T=>T.id===j.id);return E!==void 0&&R?.intervals[E]&&(R.intervals[E]=j),C})}function y(S,j){j.id===void 0&&(j.id=`id-${c}`,d(C=>C+1)),r(C=>{C=[...C];const R=C.findIndex(E=>E.id===S);if(R!==-1){const E={...C[R]};j={...j,...E.filters},E.intervals=[...E.intervals,j],C[R]=E}return C})}function b(S,j){r(C=>{C=[...C];const R=C.find(E=>E.id===S);return R&&(R.intervals=R.intervals.filter(E=>E.id!==j.id)),C})}}function AJ(e){const{intervalGroup:t,unit:n}=e;return a.jsx(fu,{"data-testid":t.id,className:EJ.section,children:a.jsxs(Ue,{gap:"lg",children:[a.jsx(ye,{justify:"flex-end",children:a.jsx(Dn,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{mn(r),e.onRemoveGroup(t)},children:a.jsx(Op,{})},`remove-group-button-${t.id}`)}),a.jsx(DJ,{intervalGroup:t,onChange:e.onChange}),a.jsx(_n,{}),t.intervals.map(r=>a.jsxs(Ue,{gap:"xs",children:[a.jsxs(ye,{children:[a.jsx(He,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{mn(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(Dn,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{mn(o),e.onRemove(t.id,r)},children:a.jsx(Op,{})},`remove-interval-${r.id}`)]}),a.jsx(zS,{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(Dn,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{mn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(Mp,{})})]})})}function DJ(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(Ue,{style:{maxWidth:"50%"},children:[a.jsx(ye,{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(ye,{gap:"xs",children:[a.jsx(Ee,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(zS,{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 kJ(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 PJ(e,t){let n=1;const r={};for(const o of e){const s=NJ(o);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(TJ.map(c=>[c,o[c]])),intervals:[]}),r[s].intervals.push(o)}return t(n),Object.values(r)}function NJ(e){return[`gender=${e.gender}`,`age=${Nd(e.age)}`,`gestationalAge=${Nd(e.gestationalAge)}`,`context=${e.context?.text}`,`appliesTo=${e.appliesTo?.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function OJ(e){return e&&(dB(e,"http://unitsofmeasure.org")||e.text)}function MJ(e){return e.range?.low?.value===void 0&&e.range?.high?.value===void 0}function LJ(e){const t=_e(),n=Kt(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(Sr,{children:n.action?.map((p,m)=>{const g=p.resource&&f(p.resource),y=g?.input?.[0]?.valueReference,b=g?.output?.[0]?.valueReference;return a.jsxs(v.Fragment,{children:[a.jsx(Sr.Col,{span:1,p:"md",children:g?.status==="completed"?a.jsx(rq,{}):a.jsx(jG,{color:"gray"})}),a.jsxs(Sr.Col,{span:9,p:"xs",children:[a.jsx(Ee,{fw:500,children:p.title}),p.description&&a.jsx("div",{children:p.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(Nl,{value:g?.meta?.author})," on ",wr(g?.meta?.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(ig,{status:g?.status||"unknown"})]})]}),a.jsxs(Sr.Col,{span:2,p:"md",children:[y&&!b&&a.jsx(Pe,{onClick:()=>e.onStart(g,y),children:"Start"}),y&&b&&a.jsx(Pe,{onClick:()=>e.onEdit(g,y,b),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===Ot(m.resource))return m.resource}}function GP(e,t){const n=IJ(e,t);return zJ(n,e,t)}function IJ(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,b=d[g],S=d[y];let j,C=0;p===-f||p!==f&&S.i<b.i?(C=b.i,j=b):(C=S.i+1,j=S),d[y]=void 0;let R=C-p,E={i:C,j:R,prev:$J(j),snake:!1};for(;C<n&&R<r&&e[C]===t[R];)C++,R++;if(C>E.i&&(E={i:C,j:R,prev:E,snake:!0}),d[m]=E,C>=n&&R>=r)return d[m]}d[c+f-1]=void 0}}function zJ(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 $J(e){return e&&!e.snake&&e.prev?e.prev:e}function UJ(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>({meta:r.resource?.meta,lines:no(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 BJ(n,t),VJ(n),n}function BJ(e,t){for(let n=1;n<t.length;n++){const r=GP(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 VJ(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 FJ="_container_1tyf3_1",HJ="_root_1tyf3_5",qJ="_startRow_1tyf3_20",GJ="_normalRow_1tyf3_25",QJ="_author_1tyf3_30",WJ="_dateTime_1tyf3_34",YJ="_lineNumber_1tyf3_40",KJ="_line_1tyf3_40",XJ="_pre_1tyf3_55",fa={container:FJ,root:HJ,startRow:qJ,normalRow:GJ,author:QJ,dateTime:WJ,lineNumber:YJ,line:KJ,pre:XJ};function JJ(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function ZJ(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Rc(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Rc(r,"month");const o=Math.floor(t/86400);if(o>0)return Rc(o,"day");const s=Math.floor(t/3600);if(s>0)return Rc(s,"hour");const c=Math.floor(t/60);return c>0?Rc(c,"minute"):Rc(t,"second")}function Rc(e,t){return`${e} ${e===1?t:t+"s"} ago`}function eZ(e){const t=_e(),[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=UJ(n);return a.jsx("div",{className:fa.container,children:a.jsx("table",{className:fa.root,children:a.jsx("tbody",{children:s.map((c,d)=>a.jsxs("tr",{className:c.span>0?fa.startRow:fa.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:fa.author,rowSpan:c.span,children:a.jsx(Nl,{value:c.meta.author,link:!0,fz:"xs"})}),a.jsx("td",{className:fa.dateTime,rowSpan:c.span,children:a.jsx(jt,{to:JJ(o,c.meta.versionId),fz:"xs",children:ZJ(c.meta.lastUpdated)})})]}),a.jsx("td",{className:fa.lineNumber,children:d+1}),a.jsx("td",{className:fa.line,children:a.jsx("pre",{className:fa.pre,children:c.value})})]},"row-"+d))})})})}const tZ="_removed_el5zk_1",nZ="_added_el5zk_6",_R={removed:tZ,added:nZ};function rZ(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=no(t,!0).match(/[^\r\n]+/g),o=no(n,!0).match(/[^\r\n]+/g),s=GP(r,o);return a.jsx("pre",{style:{color:"gray"},children:s.map((c,d)=>a.jsx(iZ,{delta:c},"delta"+d))})}function iZ(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:_R.removed,children:e.delta.original.lines.join(`
|
|
233
|
-
`)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:_R.added,children:e.delta.revised.lines.join(`
|
|
234
|
-
`)}),"...",a.jsx("br",{})]})}const oZ="_splitButton_1i0gi_1",aZ="_menuControl_1i0gi_6",AR={splitButton:oZ,menuControl:aZ};function Hp(e){const{outcome:t}=e,n=_e(),r=Kt(e.defaultValue),o=r?.resourceType,[s,c]=v.useState(!1),[d,f]=v.useState(),p=n.getAccessPolicy(),m=gn();v.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=uu(b);if(S){c(!0);const j=LF(r,S);f(j)}else console.error(`Schema not found for ${b}`)}).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&&uk(r,sl.READ,p),[p,r]),y=v.useMemo(()=>n.isSuperAdmin()||!p||!Ln(d?.resourceType)?!0:zV(p,d?.resourceType),[n,p,d?.resourceType]);return!s||!d?a.jsx("div",{children:"Loading..."}):y?a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(d)},children:[a.jsxs(Ue,{mb:"xl",children:[a.jsx($t,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(He,{name:"resourceType",defaultValue:d.resourceType,disabled:!0})}),a.jsx($t,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(He,{name:"id",defaultValue:d.id,disabled:!0})})]}),a.jsx(BS,{path:d.resourceType,valuePath:d.resourceType,typeName:o,defaultValue:d,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),a.jsxs(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[a.jsx(Pe,{type:"submit",className:Ut((e.onPatch||e.onDelete)&&AR.splitButton),children:r?.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&a.jsxs(xe,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[a.jsx(xe.Target,{children:a.jsx(Dn,{variant:"filled",color:m.primaryColor,size:36,className:AR.menuControl,"aria-label":"More actions",children:a.jsx(jS,{size:14,stroke:1.5})})}),a.jsxs(xe.Dropdown,{children:[e.onPatch&&a.jsx(xe.Item,{leftSection:a.jsx(Mk,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(d)},children:"Patch"}),e.onDelete&&a.jsx(xe.Item,{color:"red",leftSection:a.jsx(Ym,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(d)},children:"Delete"})]})]})]})]}):a.jsxs($o,{color:"red",title:"Permission denied",icon:a.jsx(As,{}),children:["Your access level prevents you from editing and creating ",d.resourceType," resources."]})}function sZ(e){const t=_e(),[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(de,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[a.jsx(de.Th,{children:"Author"}),a.jsx(de.Th,{children:"Date"}),a.jsx(de.Th,{children:"Version"})]})}),a.jsx(de.Tbody,{children:n.entry?.map((o,s)=>a.jsx(lZ,{entry:o},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function lZ(e){const{response:t,resource:n}=e.entry;return n?a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:a.jsx(Ic,{value:n.meta?.author,link:!0})}),a.jsx(de.Td,{children:wr(n.meta?.lastUpdated)}),a.jsx(de.Td,{children:a.jsx(jt,{to:cZ(n),children:n.meta?.versionId})})]}):a.jsx(de.Tr,{children:a.jsx(de.Td,{colSpan:3,children:Qe(t?.outcome)})})}function cZ(e){return`/${e.resourceType}/${e.id}/_history/${e.meta?.versionId}`}function uZ(e){const{serviceRequest:t,...n}=e;return a.jsx(og,{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:[Qt(r)],subject:r.subject,sender:Qt(o),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,o,s)=>({resourceType:"Media",status:"completed",basedOn:[Qt(r)],subject:r.subject,operator:Qt(o),issued:new Date().toISOString(),content:s}),...n})}function dZ(e){const t=_e(),{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",sS(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),nr.assign(p.toString())}).catch(f=>Ne({color:"red",message:Qe(f),autoClose:!1}))}return a.jsx(Mt,{onClick:()=>d(),...c,children:s})}var ax={exports:{}},cd={},sx={exports:{}},lx={};var DR;function fZ(){return DR||(DR=1,(function(e){function t(M,L){var U=M.length;M.push(L);e:for(;0<U;){var V=U-1>>>1,K=M[V];if(0<o(K,L))M[V]=L,M[U]=K,U=V;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],U=M.pop();if(U!==L){M[0]=U;e:for(var V=0,K=M.length,O=K>>>1;V<O;){var F=2*(V+1)-1,ae=M[F],ue=F+1,be=M[ue];if(0>o(ae,U))ue<K&&0>o(be,ae)?(M[V]=be,M[ue]=U,V=ue):(M[V]=ae,M[F]=U,V=F);else if(ue<K&&0>o(be,U))M[V]=be,M[ue]=U,V=ue;else break e}}return L}function o(M,L){var U=M.sortIndex-L.sortIndex;return U!==0?U: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,b=!1,S=!1,j=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=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,J());else{var L=n(p);L!==null&&Q(k,L.startTime-M)}}var I=!1,A=-1,P=5,z=-1;function B(){return C?!0:!(e.unstable_now()-z<P)}function Y(){if(C=!1,I){var M=e.unstable_now();z=M;var L=!0;try{e:{S=!1,j&&(j=!1,E(A),A=-1),b=!0;var U=y;try{t:{for(_(M),g=n(f);g!==null&&!(g.expirationTime>M&&B());){var V=g.callback;if(typeof V=="function"){g.callback=null,y=g.priorityLevel;var K=V(g.expirationTime<=M);if(M=e.unstable_now(),typeof K=="function"){g.callback=K,_(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&&Q(k,O.startTime-M),L=!1}}break e}finally{g=null,y=U,b=!1}L=void 0}}finally{L?J():I=!1}}}var J;if(typeof T=="function")J=function(){T(Y)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,$=Z.port2;Z.port1.onmessage=Y,J=function(){$.postMessage(null)}}else J=function(){R(Y,0)};function Q(M,L){A=R(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 U=y;y=L;try{return M()}finally{y=U}},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 U=y;y=M;try{return L()}finally{y=U}},e.unstable_scheduleCallback=function(M,L,U){var V=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?V+U:V):U=V,M){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=U+K,M={id:m++,callback:L,priorityLevel:M,startTime:U,expirationTime:K,sortIndex:-1},U>V?(M.sortIndex=U,t(p,M),n(f)===null&&M===n(p)&&(j?(E(A),A=-1):j=!0,Q(k,U-V))):(M.sortIndex=K,t(f,M),S||b||(S=!0,I||(I=!0,J()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var L=y;return function(){var U=y;y=L;try{return M.apply(this,arguments)}finally{y=U}}}})(lx)),lx}var kR;function hZ(){return kR||(kR=1,sx.exports=fZ()),sx.exports}var PR;function pZ(){if(PR)return cd;PR=1;var e=hZ(),t=gb(),n=r_();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 x=u.return;if(x===null)break;var w=x.alternate;if(w===null){if(h=x.return,h!==null){u=h;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===u)return f(x),i;if(w===h)return f(x),l;w=w.sibling}throw Error(r(188))}if(u.return!==h.return)u=x,h=w;else{for(var D=!1,N=x.child;N;){if(N===u){D=!0,u=x,h=w;break}if(N===h){D=!0,h=x,u=w;break}N=N.sibling}if(!D){for(N=w.child;N;){if(N===u){D=!0,u=w,h=x;break}if(N===h){D=!0,h=w,u=x;break}N=N.sibling}if(!D)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"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function J(i){return i===null||typeof i!="object"?null:(i=Y&&i[Y]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Symbol.for("react.client.reference");function $(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 R:return"Profiler";case C:return"StrictMode";case k:return"Suspense";case I:return"SuspenseList";case z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case T:return i.displayName||"Context";case E: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 A:return l=i.displayName||null,l!==null?l:$(i.type)||"Memo";case P:l=i._payload,i=i._init;try{return $(i(l))}catch{}}return null}var Q=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,U={pending:!1,data:null,method:null,action:null},V=[],K=-1;function O(i){return{current:i}}function F(i){0>K||(i.current=V[K],V[K]=null,K--)}function ae(i,l){K++,V[K]=i.current,i.current=l}var ue=O(null),be=O(null),we=O(null),Ce=O(null);function nt(i,l){switch(ae(we,l),ae(be,i),ae(ue,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?SC(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=SC(l),i=wC(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}F(ue),ae(ue,i)}function De(){F(ue),F(be),F(we)}function ft(i){i.memoizedState!==null&&ae(Ce,i);var l=ue.current,u=wC(l,i.type);l!==u&&(ae(be,i),ae(ue,u))}function ot(i){be.current===i&&(F(ue),F(be)),Ce.current===i&&(F(Ce),Zu._currentValue=U)}var ht,st;function yt(i){if(ht===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);ht=l&&l[1]||"",st=-1<u.stack.indexOf(`
|
|
235
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
236
|
-
`+ht+i+st}var mt=!1;function It(i,l){if(!i||mt)return"";mt=!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(se){var re=se}Reflect.construct(i,[],ve)}else{try{ve.call()}catch(se){re=se}i.call(ve.prototype)}}else{try{throw Error()}catch(se){re=se}(ve=i())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(se){if(se&&re&&typeof se.stack=="string")return[se.stack,re.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),D=w[0],N=w[1];if(D&&N){var q=D.split(`
|
|
237
|
-
`),te=N.split(`
|
|
238
|
-
`);for(x=h=0;h<q.length&&!q[h].includes("DetermineComponentFrameRoot");)h++;for(;x<te.length&&!te[x].includes("DetermineComponentFrameRoot");)x++;if(h===q.length||x===te.length)for(h=q.length-1,x=te.length-1;1<=h&&0<=x&&q[h]!==te[x];)x--;for(;1<=h&&0<=x;h--,x--)if(q[h]!==te[x]){if(h!==1||x!==1)do if(h--,x--,0>x||q[h]!==te[x]){var fe=`
|
|
239
|
-
`+q[h].replace(" at new "," at ");return i.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",i.displayName)),fe}while(1<=h&&0<=x);break}}}finally{mt=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?yt(u):""}function Te(i,l){switch(i.tag){case 26:case 27:case 5:return yt(i.type);case 16:return yt("Lazy");case 13:return i.child!==l&&l!==null?yt("Suspense Fallback"):yt("Suspense");case 19:return yt("SuspenseList");case 0:case 15:return It(i.type,!1);case 11:return It(i.type.render,!1);case 1:return It(i.type,!0);case 31:return yt("Activity");default:return""}}function Re(i){try{var l="",u=null;do l+=Te(i,u),u=i,i=i.return;while(i);return l}catch(h){return`
|
|
240
|
-
Error generating stack: `+h.message+`
|
|
241
|
-
`+h.stack}}var Ie=Object.prototype.hasOwnProperty,Oe=e.unstable_scheduleCallback,ct=e.unstable_cancelCallback,tt=e.unstable_shouldYield,lt=e.unstable_requestPaint,pe=e.unstable_now,qe=e.unstable_getCurrentPriorityLevel,je=e.unstable_ImmediatePriority,Ae=e.unstable_UserBlockingPriority,_t=e.unstable_NormalPriority,Zn=e.unstable_LowPriority,vn=e.unstable_IdlePriority,Pn=e.log,yn=e.unstable_setDisableYieldValue,En=null,Nn=null;function lr(i){if(typeof Pn=="function"&&yn(i),Nn&&typeof Nn.setStrictMode=="function")try{Nn.setStrictMode(En,i)}catch{}}var Tn=Math.clz32?Math.clz32:so,Ho=Math.log,ao=Math.LN2;function so(i){return i>>>=0,i===0?32:31-(Ho(i)/ao|0)|0}var mi=256,lo=262144,qo=4194304;function Ur(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 co(i,l,u){var h=i.pendingLanes;if(h===0)return 0;var x=0,w=i.suspendedLanes,D=i.pingedLanes;i=i.warmLanes;var N=h&134217727;return N!==0?(h=N&~w,h!==0?x=Ur(h):(D&=N,D!==0?x=Ur(D):u||(u=N&~i,u!==0&&(x=Ur(u))))):(N=h&~w,N!==0?x=Ur(N):D!==0?x=Ur(D):u||(u=h&~i,u!==0&&(x=Ur(u)))),x===0?0:l!==0&&l!==x&&(l&w)===0&&(w=x&-x,u=l&-l,w>=u||w===32&&(u&4194048)!==0)?l:x}function ir(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function Go(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 Fn(){var i=qo;return qo<<=1,(qo&62914560)===0&&(qo=4194304),i}function ka(i){for(var l=[],u=0;31>u;u++)l.push(i);return l}function Pa(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function mu(i,l,u,h,x,w){var D=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,te=i.hiddenUpdates;for(u=D&~u;0<u;){var fe=31-Tn(u),ve=1<<fe;N[fe]=0,q[fe]=-1;var re=te[fe];if(re!==null)for(te[fe]=null,fe=0;fe<re.length;fe++){var se=re[fe];se!==null&&(se.lane&=-536870913)}u&=~ve}h!==0&&H(i,h,0),w!==0&&x===0&&i.tag!==0&&(i.suspendedLanes|=w&~(D&~l))}function H(i,l,u){i.pendingLanes|=l,i.suspendedLanes&=~l;var h=31-Tn(l);i.entangledLanes|=l,i.entanglements[h]=i.entanglements[h]|1073741824|u&261930}function W(i,l){var u=i.entangledLanes|=l;for(i=i.entanglements;u;){var h=31-Tn(u),x=1<<h;x&l|i[h]&l&&(i[h]|=l),u&=~x}}function oe(i,l){var u=l&-l;return u=(u&42)!==0?1:Se(u),(u&(i.suspendedLanes|l))!==0?0:u}function Se(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 ke(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function We(){var i=L.p;return i!==0?i:(i=window.event,i===void 0?32:qC(i.type))}function Ye(i,l){var u=L.p;try{return L.p=i,l()}finally{L.p=u}}var Be=Math.random().toString(36).slice(2),Me="__reactFiber$"+Be,Ve="__reactProps$"+Be,Ke="__reactContainer$"+Be,et="__reactEvents$"+Be,Et="__reactListeners$"+Be,Xt="__reactHandles$"+Be,at="__reactResources$"+Be,rn="__reactMarker$"+Be;function qt(i){delete i[Me],delete i[Ve],delete i[et],delete i[Et],delete i[Xt]}function zt(i){var l=i[Me];if(l)return l;for(var u=i.parentNode;u;){if(l=u[Ke]||u[Me]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(i=AC(i);i!==null;){if(u=i[Me])return u;i=AC(i)}return l}i=u,u=i.parentNode}return null}function Br(i){if(i=i[Me]||i[Ke]){var l=i.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return i}return null}function Ui(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function Tr(i){var l=i[at];return l||(l=i[at]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Jt(i){i[rn]=!0}var Ll=new Set,Na={};function Rr(i,l){Bi(i,l),Bi(i+"Capture",l)}function Bi(i,l){for(Na[i]=l,i=0;i<l.length;i++)Ll.add(l[i])}var Il=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]*$"),At={},er={};function Oa(i){return Ie.call(er,i)?!0:Ie.call(At,i)?!1:Il.test(i)?er[i]=!0:(At[i]=!0,!1)}function gi(i,l,u){if(Oa(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 ln(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 Vr(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 _r(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Tf(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function HN(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 x=h.get,w=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return x.call(this)},set:function(D){u=""+D,w.call(this,D)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(D){u=""+D},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function pg(i){if(!i._valueTracker){var l=Tf(i)?"checked":"value";i._valueTracker=HN(i,l,""+i[l])}}function p1(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return i&&(h=Tf(i)?i.checked?"true":"false":i.value),i=h,i!==u?(l.setValue(i),!0):!1}function Rf(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 qN=/[\n"\\]/g;function vi(i){return i.replace(qN,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function mg(i,l,u,h,x,w,D,N){i.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?i.type=D:i.removeAttribute("type"),l!=null?D==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+_r(l)):i.value!==""+_r(l)&&(i.value=""+_r(l)):D!=="submit"&&D!=="reset"||i.removeAttribute("value"),l!=null?gg(i,D,_r(l)):u!=null?gg(i,D,_r(u)):h!=null&&i.removeAttribute("value"),x==null&&w!=null&&(i.defaultChecked=!!w),x!=null&&(i.checked=x&&typeof x!="function"&&typeof x!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+_r(N):i.removeAttribute("name")}function m1(i,l,u,h,x,w,D,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)){pg(i);return}u=u!=null?""+_r(u):"",l=l!=null?""+_r(l):u,N||l===i.value||(i.value=l),i.defaultValue=l}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=N?i.checked:!!h,i.defaultChecked=!!h,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(i.name=D),pg(i)}function gg(i,l,u){l==="number"&&Rf(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function zl(i,l,u,h){if(i=i.options,l){l={};for(var x=0;x<u.length;x++)l["$"+u[x]]=!0;for(u=0;u<i.length;u++)x=l.hasOwnProperty("$"+i[u].value),i[u].selected!==x&&(i[u].selected=x),x&&h&&(i[u].defaultSelected=!0)}else{for(u=""+_r(u),l=null,x=0;x<i.length;x++){if(i[x].value===u){i[x].selected=!0,h&&(i[x].defaultSelected=!0);return}l!==null||i[x].disabled||(l=i[x])}l!==null&&(l.selected=!0)}}function g1(i,l,u){if(l!=null&&(l=""+_r(l),l!==i.value&&(i.value=l),u==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=u!=null?""+_r(u):""}function v1(i,l,u,h){if(l==null){if(h!=null){if(u!=null)throw Error(r(92));if(Q(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),l=u}u=_r(l),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h),pg(i)}function $l(i,l){if(l){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=l;return}}i.textContent=l}var GN=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 y1(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||GN.has(l)?l==="float"?i.cssFloat=u:i[l]=(""+u).trim():i[l]=u+"px"}function x1(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 x in l)h=l[x],l.hasOwnProperty(x)&&u[x]!==h&&y1(i,x,h)}else for(var w in l)l.hasOwnProperty(w)&&y1(i,w,l[w])}function vg(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 QN=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"]]),WN=/^[\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 WN.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Qo(){}var yg=null;function xg(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ul=null,Bl=null;function b1(i){var l=Br(i);if(l&&(i=l.stateNode)){var u=i[Ve]||null;e:switch(i=l.stateNode,l.type){case"input":if(mg(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="'+vi(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==i&&h.form===i.form){var x=h[Ve]||null;if(!x)throw Error(r(90));mg(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<u.length;l++)h=u[l],h.form===i.form&&p1(h)}break e;case"textarea":g1(i,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&zl(i,!!u.multiple,l,!1)}}}var bg=!1;function S1(i,l,u){if(bg)return i(l,u);bg=!0;try{var h=i(l);return h}finally{if(bg=!1,(Ul!==null||Bl!==null)&&(mh(),Ul&&(l=Ul,i=Bl,Bl=Ul=null,b1(l),i)))for(l=0;l<i.length;l++)b1(i[l])}}function gu(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 Wo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sg=!1;if(Wo)try{var vu={};Object.defineProperty(vu,"passive",{get:function(){Sg=!0}}),window.addEventListener("test",vu,vu),window.removeEventListener("test",vu,vu)}catch{Sg=!1}var Ma=null,wg=null,Af=null;function w1(){if(Af)return Af;var i,l=wg,u=l.length,h,x="value"in Ma?Ma.value:Ma.textContent,w=x.length;for(i=0;i<u&&l[i]===x[i];i++);var D=u-i;for(h=1;h<=D&&l[u-h]===x[w-h];h++);return Af=x.slice(i,1<h?1-h:void 0)}function Df(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 kf(){return!0}function j1(){return!1}function Fr(i){function l(u,h,x,w,D){this._reactName=u,this._targetInst=x,this.type=h,this.nativeEvent=w,this.target=D,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)?kf:j1,this.isPropagationStopped=j1,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=kf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=kf)},persist:function(){},isPersistent:kf}),l}var Ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pf=Fr(Ps),yu=g({},Ps,{view:0,detail:0}),YN=Fr(yu),jg,Cg,xu,Nf=g({},yu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tg,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!==xu&&(xu&&i.type==="mousemove"?(jg=i.screenX-xu.screenX,Cg=i.screenY-xu.screenY):Cg=jg=0,xu=i),jg)},movementY:function(i){return"movementY"in i?i.movementY:Cg}}),C1=Fr(Nf),KN=g({},Nf,{dataTransfer:0}),XN=Fr(KN),JN=g({},yu,{relatedTarget:0}),Eg=Fr(JN),ZN=g({},Ps,{animationName:0,elapsedTime:0,pseudoElement:0}),eO=Fr(ZN),tO=g({},Ps,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),nO=Fr(tO),rO=g({},Ps,{data:0}),E1=Fr(rO),iO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oO={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"},aO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sO(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=aO[i])?!!l[i]:!1}function Tg(){return sO}var lO=g({},yu,{key:function(i){if(i.key){var l=iO[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Df(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?oO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tg,charCode:function(i){return i.type==="keypress"?Df(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Df(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),cO=Fr(lO),uO=g({},Nf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),T1=Fr(uO),dO=g({},yu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tg}),fO=Fr(dO),hO=g({},Ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),pO=Fr(hO),mO=g({},Nf,{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}),gO=Fr(mO),vO=g({},Ps,{newState:0,oldState:0}),yO=Fr(vO),xO=[9,13,27,32],Rg=Wo&&"CompositionEvent"in window,bu=null;Wo&&"documentMode"in document&&(bu=document.documentMode);var bO=Wo&&"TextEvent"in window&&!bu,R1=Wo&&(!Rg||bu&&8<bu&&11>=bu),_1=" ",A1=!1;function D1(i,l){switch(i){case"keyup":return xO.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function k1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Vl=!1;function SO(i,l){switch(i){case"compositionend":return k1(l);case"keypress":return l.which!==32?null:(A1=!0,_1);case"textInput":return i=l.data,i===_1&&A1?null:i;default:return null}}function wO(i,l){if(Vl)return i==="compositionend"||!Rg&&D1(i,l)?(i=w1(),Af=wg=Ma=null,Vl=!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 R1&&l.locale!=="ko"?null:l.data;default:return null}}var jO={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 P1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!jO[i.type]:l==="textarea"}function N1(i,l,u,h){Ul?Bl?Bl.push(h):Bl=[h]:Ul=h,l=wh(l,"onChange"),0<l.length&&(u=new Pf("onChange","change",null,u,h),i.push({event:u,listeners:l}))}var Su=null,wu=null;function CO(i){mC(i,0)}function Of(i){var l=Ui(i);if(p1(l))return i}function O1(i,l){if(i==="change")return l}var M1=!1;if(Wo){var _g;if(Wo){var Ag="oninput"in document;if(!Ag){var L1=document.createElement("div");L1.setAttribute("oninput","return;"),Ag=typeof L1.oninput=="function"}_g=Ag}else _g=!1;M1=_g&&(!document.documentMode||9<document.documentMode)}function I1(){Su&&(Su.detachEvent("onpropertychange",z1),wu=Su=null)}function z1(i){if(i.propertyName==="value"&&Of(wu)){var l=[];N1(l,wu,i,xg(i)),S1(CO,l)}}function EO(i,l,u){i==="focusin"?(I1(),Su=l,wu=u,Su.attachEvent("onpropertychange",z1)):i==="focusout"&&I1()}function TO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Of(wu)}function RO(i,l){if(i==="click")return Of(l)}function _O(i,l){if(i==="input"||i==="change")return Of(l)}function AO(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var ni=typeof Object.is=="function"?Object.is:AO;function ju(i,l){if(ni(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 x=u[h];if(!Ie.call(l,x)||!ni(i[x],l[x]))return!1}return!0}function $1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function U1(i,l){var u=$1(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=$1(u)}}function B1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?B1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function V1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=Rf(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=Rf(i.document)}return l}function Dg(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 DO=Wo&&"documentMode"in document&&11>=document.documentMode,Fl=null,kg=null,Cu=null,Pg=!1;function F1(i,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Pg||Fl==null||Fl!==Rf(h)||(h=Fl,"selectionStart"in h&&Dg(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}),Cu&&ju(Cu,h)||(Cu=h,h=wh(kg,"onSelect"),0<h.length&&(l=new Pf("onSelect","select",null,l,u),i.push({event:l,listeners:h}),l.target=Fl)))}function Ns(i,l){var u={};return u[i.toLowerCase()]=l.toLowerCase(),u["Webkit"+i]="webkit"+l,u["Moz"+i]="moz"+l,u}var Hl={animationend:Ns("Animation","AnimationEnd"),animationiteration:Ns("Animation","AnimationIteration"),animationstart:Ns("Animation","AnimationStart"),transitionrun:Ns("Transition","TransitionRun"),transitionstart:Ns("Transition","TransitionStart"),transitioncancel:Ns("Transition","TransitionCancel"),transitionend:Ns("Transition","TransitionEnd")},Ng={},H1={};Wo&&(H1=document.createElement("div").style,"AnimationEvent"in window||(delete Hl.animationend.animation,delete Hl.animationiteration.animation,delete Hl.animationstart.animation),"TransitionEvent"in window||delete Hl.transitionend.transition);function Os(i){if(Ng[i])return Ng[i];if(!Hl[i])return i;var l=Hl[i],u;for(u in l)if(l.hasOwnProperty(u)&&u in H1)return Ng[i]=l[u];return i}var q1=Os("animationend"),G1=Os("animationiteration"),Q1=Os("animationstart"),kO=Os("transitionrun"),PO=Os("transitionstart"),NO=Os("transitioncancel"),W1=Os("transitionend"),Y1=new Map,Og="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(" ");Og.push("scrollEnd");function Vi(i,l){Y1.set(i,l),Rr(l,[i])}var Mf=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)},yi=[],ql=0,Mg=0;function Lf(){for(var i=ql,l=Mg=ql=0;l<i;){var u=yi[l];yi[l++]=null;var h=yi[l];yi[l++]=null;var x=yi[l];yi[l++]=null;var w=yi[l];if(yi[l++]=null,h!==null&&x!==null){var D=h.pending;D===null?x.next=x:(x.next=D.next,D.next=x),h.pending=x}w!==0&&K1(u,x,w)}}function If(i,l,u,h){yi[ql++]=i,yi[ql++]=l,yi[ql++]=u,yi[ql++]=h,Mg|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function Lg(i,l,u,h){return If(i,l,u,h),zf(i)}function Ms(i,l){return If(i,null,null,l),zf(i)}function K1(i,l,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var x=!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||(x=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,x&&l!==null&&(x=31-Tn(u),i=w.hiddenUpdates,h=i[x],h===null?i[x]=[l]:h.push(l),l.lane=u|536870912),w):null}function zf(i){if(50<Gu)throw Gu=0,qv=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var Gl={};function OO(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 ri(i,l,u,h){return new OO(i,l,u,h)}function Ig(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Yo(i,l){var u=i.alternate;return u===null?(u=ri(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 X1(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 $f(i,l,u,h,x,w){var D=0;if(h=i,typeof i=="function")Ig(i)&&(D=1);else if(typeof i=="string")D=$3(i,u,ue.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case z:return i=ri(31,u,l,x),i.elementType=z,i.lanes=w,i;case j:return Ls(u.children,x,w,l);case C:D=8,x|=24;break;case R:return i=ri(12,u,l,x|2),i.elementType=R,i.lanes=w,i;case k:return i=ri(13,u,l,x),i.elementType=k,i.lanes=w,i;case I:return i=ri(19,u,l,x),i.elementType=I,i.lanes=w,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case T:D=10;break e;case E:D=9;break e;case _:D=11;break e;case A:D=14;break e;case P:D=16,h=null;break e}D=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return l=ri(D,u,l,x),l.elementType=i,l.type=h,l.lanes=w,l}function Ls(i,l,u,h){return i=ri(7,i,h,l),i.lanes=u,i}function zg(i,l,u){return i=ri(6,i,null,l),i.lanes=u,i}function J1(i){var l=ri(18,null,null,0);return l.stateNode=i,l}function $g(i,l,u){return l=ri(4,i.children!==null?i.children:[],i.key,l),l.lanes=u,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var Z1=new WeakMap;function xi(i,l){if(typeof i=="object"&&i!==null){var u=Z1.get(i);return u!==void 0?u:(l={value:i,source:l,stack:Re(l)},Z1.set(i,l),l)}return{value:i,source:l,stack:Re(l)}}var Ql=[],Wl=0,Uf=null,Eu=0,bi=[],Si=0,La=null,uo=1,fo="";function Ko(i,l){Ql[Wl++]=Eu,Ql[Wl++]=Uf,Uf=i,Eu=l}function ew(i,l,u){bi[Si++]=uo,bi[Si++]=fo,bi[Si++]=La,La=i;var h=uo;i=fo;var x=32-Tn(h)-1;h&=~(1<<x),u+=1;var w=32-Tn(l)+x;if(30<w){var D=x-x%5;w=(h&(1<<D)-1).toString(32),h>>=D,x-=D,uo=1<<32-Tn(l)+x|u<<x|h,fo=w+i}else uo=1<<w|u<<x|h,fo=i}function Ug(i){i.return!==null&&(Ko(i,1),ew(i,1,0))}function Bg(i){for(;i===Uf;)Uf=Ql[--Wl],Ql[Wl]=null,Eu=Ql[--Wl],Ql[Wl]=null;for(;i===La;)La=bi[--Si],bi[Si]=null,fo=bi[--Si],bi[Si]=null,uo=bi[--Si],bi[Si]=null}function tw(i,l){bi[Si++]=uo,bi[Si++]=fo,bi[Si++]=La,uo=l.id,fo=l.overflow,La=i}var cr=null,xn=null,Nt=!1,Ia=null,wi=!1,Vg=Error(r(519));function za(i){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tu(xi(l,i)),Vg}function nw(i){var l=i.stateNode,u=i.type,h=i.memoizedProps;switch(l[Me]=i,l[Ve]=h,u){case"dialog":Rt("cancel",l),Rt("close",l);break;case"iframe":case"object":case"embed":Rt("load",l);break;case"video":case"audio":for(u=0;u<Wu.length;u++)Rt(Wu[u],l);break;case"source":Rt("error",l);break;case"img":case"image":case"link":Rt("error",l),Rt("load",l);break;case"details":Rt("toggle",l);break;case"input":Rt("invalid",l),m1(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Rt("invalid",l);break;case"textarea":Rt("invalid",l),v1(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||xC(l.textContent,u)?(h.popover!=null&&(Rt("beforetoggle",l),Rt("toggle",l)),h.onScroll!=null&&Rt("scroll",l),h.onScrollEnd!=null&&Rt("scrollend",l),h.onClick!=null&&(l.onclick=Qo),l=!0):l=!1,l||za(i,!0)}function rw(i){for(cr=i.return;cr;)switch(cr.tag){case 5:case 31:case 13:wi=!1;return;case 27:case 3:wi=!0;return;default:cr=cr.return}}function Yl(i){if(i!==cr)return!1;if(!Nt)return rw(i),Nt=!0,!1;var l=i.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||ay(i.type,i.memoizedProps)),u=!u),u&&xn&&za(i),rw(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));xn=_C(i)}else if(l===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));xn=_C(i)}else l===27?(l=xn,Ja(i.type)?(i=dy,dy=null,xn=i):xn=l):xn=cr?Ci(i.stateNode.nextSibling):null;return!0}function Is(){xn=cr=null,Nt=!1}function Fg(){var i=Ia;return i!==null&&(Qr===null?Qr=i:Qr.push.apply(Qr,i),Ia=null),i}function Tu(i){Ia===null?Ia=[i]:Ia.push(i)}var Hg=O(null),zs=null,Xo=null;function $a(i,l,u){ae(Hg,l._currentValue),l._currentValue=u}function Jo(i){i._currentValue=Hg.current,F(Hg)}function qg(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 Gg(i,l,u,h){var x=i.child;for(x!==null&&(x.return=i);x!==null;){var w=x.dependencies;if(w!==null){var D=x.child;w=w.firstContext;e:for(;w!==null;){var N=w;w=x;for(var q=0;q<l.length;q++)if(N.context===l[q]){w.lanes|=u,N=w.alternate,N!==null&&(N.lanes|=u),qg(w.return,u,i),h||(D=null);break e}w=N.next}}else if(x.tag===18){if(D=x.return,D===null)throw Error(r(341));D.lanes|=u,w=D.alternate,w!==null&&(w.lanes|=u),qg(D,u,i),D=null}else D=x.child;if(D!==null)D.return=x;else for(D=x;D!==null;){if(D===i){D=null;break}if(x=D.sibling,x!==null){x.return=D.return,D=x;break}D=D.return}x=D}}function Kl(i,l,u,h){i=null;for(var x=l,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var D=x.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var N=x.type;ni(x.pendingProps.value,D.value)||(i!==null?i.push(N):i=[N])}}else if(x===Ce.current){if(D=x.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(i!==null?i.push(Zu):i=[Zu])}x=x.return}i!==null&&Gg(l,i,u,h),l.flags|=262144}function Bf(i){for(i=i.firstContext;i!==null;){if(!ni(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function $s(i){zs=i,Xo=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ur(i){return iw(zs,i)}function Vf(i,l){return zs===null&&$s(i),iw(i,l)}function iw(i,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},Xo===null){if(i===null)throw Error(r(308));Xo=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else Xo=Xo.next=l;return u}var MO=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()})}},LO=e.unstable_scheduleCallback,IO=e.unstable_NormalPriority,Yn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qg(){return{controller:new MO,data:new Map,refCount:0}}function Ru(i){i.refCount--,i.refCount===0&&LO(IO,function(){i.controller.abort()})}var _u=null,Wg=0,Xl=0,Jl=null;function zO(i,l){if(_u===null){var u=_u=[];Wg=0,Xl=Xv(),Jl={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Wg++,l.then(ow,ow),l}function ow(){if(--Wg===0&&_u!==null){Jl!==null&&(Jl.status="fulfilled");var i=_u;_u=null,Xl=0,Jl=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function $O(i,l){var u=[],h={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return i.then(function(){h.status="fulfilled",h.value=l;for(var x=0;x<u.length;x++)(0,u[x])(l)},function(x){for(h.status="rejected",h.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),h}var aw=M.S;M.S=function(i,l){Fj=pe(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&zO(i,l),aw!==null&&aw(i,l)};var Us=O(null);function Yg(){var i=Us.current;return i!==null?i:cn.pooledCache}function Ff(i,l){l===null?ae(Us,Us.current):ae(Us,l.pool)}function sw(){var i=Yg();return i===null?null:{parent:Yn._currentValue,pool:i}}var Zl=Error(r(460)),Kg=Error(r(474)),Hf=Error(r(542)),qf={then:function(){}};function lw(i){return i=i.status,i==="fulfilled"||i==="rejected"}function cw(i,l,u){switch(u=i[u],u===void 0?i.push(l):u!==l&&(l.then(Qo,Qo),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,dw(i),i;default:if(typeof l.status=="string")l.then(Qo,Qo);else{if(i=cn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(h){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=h}},function(h){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,dw(i),i}throw Vs=l,Zl}}function Bs(i){try{var l=i._init;return l(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Vs=u,Zl):u}}var Vs=null;function uw(){if(Vs===null)throw Error(r(459));var i=Vs;return Vs=null,i}function dw(i){if(i===Zl||i===Hf)throw Error(r(483))}var ec=null,Au=0;function Gf(i){var l=Au;return Au+=1,ec===null&&(ec=[]),cw(ec,i,l)}function Du(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function Qf(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 fw(i){function l(X,G){if(i){var ee=X.deletions;ee===null?(X.deletions=[G],X.flags|=16):ee.push(G)}}function u(X,G){if(!i)return null;for(;G!==null;)l(X,G),G=G.sibling;return null}function h(X){for(var G=new Map;X!==null;)X.key!==null?G.set(X.key,X):G.set(X.index,X),X=X.sibling;return G}function x(X,G){return X=Yo(X,G),X.index=0,X.sibling=null,X}function w(X,G,ee){return X.index=ee,i?(ee=X.alternate,ee!==null?(ee=ee.index,ee<G?(X.flags|=67108866,G):ee):(X.flags|=67108866,G)):(X.flags|=1048576,G)}function D(X){return i&&X.alternate===null&&(X.flags|=67108866),X}function N(X,G,ee,me){return G===null||G.tag!==6?(G=zg(ee,X.mode,me),G.return=X,G):(G=x(G,ee),G.return=X,G)}function q(X,G,ee,me){var rt=ee.type;return rt===j?fe(X,G,ee.props.children,me,ee.key):G!==null&&(G.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===P&&Bs(rt)===G.type)?(G=x(G,ee.props),Du(G,ee),G.return=X,G):(G=$f(ee.type,ee.key,ee.props,null,X.mode,me),Du(G,ee),G.return=X,G)}function te(X,G,ee,me){return G===null||G.tag!==4||G.stateNode.containerInfo!==ee.containerInfo||G.stateNode.implementation!==ee.implementation?(G=$g(ee,X.mode,me),G.return=X,G):(G=x(G,ee.children||[]),G.return=X,G)}function fe(X,G,ee,me,rt){return G===null||G.tag!==7?(G=Ls(ee,X.mode,me,rt),G.return=X,G):(G=x(G,ee),G.return=X,G)}function ve(X,G,ee){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=zg(""+G,X.mode,ee),G.return=X,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return ee=$f(G.type,G.key,G.props,null,X.mode,ee),Du(ee,G),ee.return=X,ee;case S:return G=$g(G,X.mode,ee),G.return=X,G;case P:return G=Bs(G),ve(X,G,ee)}if(Q(G)||J(G))return G=Ls(G,X.mode,ee,null),G.return=X,G;if(typeof G.then=="function")return ve(X,Gf(G),ee);if(G.$$typeof===T)return ve(X,Vf(X,G),ee);Qf(X,G)}return null}function re(X,G,ee,me){var rt=G!==null?G.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return rt!==null?null:N(X,G,""+ee,me);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===rt?q(X,G,ee,me):null;case S:return ee.key===rt?te(X,G,ee,me):null;case P:return ee=Bs(ee),re(X,G,ee,me)}if(Q(ee)||J(ee))return rt!==null?null:fe(X,G,ee,me,null);if(typeof ee.then=="function")return re(X,G,Gf(ee),me);if(ee.$$typeof===T)return re(X,G,Vf(X,ee),me);Qf(X,ee)}return null}function se(X,G,ee,me,rt){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return X=X.get(ee)||null,N(G,X,""+me,rt);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return X=X.get(me.key===null?ee:me.key)||null,q(G,X,me,rt);case S:return X=X.get(me.key===null?ee:me.key)||null,te(G,X,me,rt);case P:return me=Bs(me),se(X,G,ee,me,rt)}if(Q(me)||J(me))return X=X.get(ee)||null,fe(G,X,me,rt,null);if(typeof me.then=="function")return se(X,G,ee,Gf(me),rt);if(me.$$typeof===T)return se(X,G,ee,Vf(G,me),rt);Qf(G,me)}return null}function Ge(X,G,ee,me){for(var rt=null,Bt=null,Je=G,wt=G=0,kt=null;Je!==null&&wt<ee.length;wt++){Je.index>wt?(kt=Je,Je=null):kt=Je.sibling;var Vt=re(X,Je,ee[wt],me);if(Vt===null){Je===null&&(Je=kt);break}i&&Je&&Vt.alternate===null&&l(X,Je),G=w(Vt,G,wt),Bt===null?rt=Vt:Bt.sibling=Vt,Bt=Vt,Je=kt}if(wt===ee.length)return u(X,Je),Nt&&Ko(X,wt),rt;if(Je===null){for(;wt<ee.length;wt++)Je=ve(X,ee[wt],me),Je!==null&&(G=w(Je,G,wt),Bt===null?rt=Je:Bt.sibling=Je,Bt=Je);return Nt&&Ko(X,wt),rt}for(Je=h(Je);wt<ee.length;wt++)kt=se(Je,X,wt,ee[wt],me),kt!==null&&(i&&kt.alternate!==null&&Je.delete(kt.key===null?wt:kt.key),G=w(kt,G,wt),Bt===null?rt=kt:Bt.sibling=kt,Bt=kt);return i&&Je.forEach(function(rs){return l(X,rs)}),Nt&&Ko(X,wt),rt}function ut(X,G,ee,me){if(ee==null)throw Error(r(151));for(var rt=null,Bt=null,Je=G,wt=G=0,kt=null,Vt=ee.next();Je!==null&&!Vt.done;wt++,Vt=ee.next()){Je.index>wt?(kt=Je,Je=null):kt=Je.sibling;var rs=re(X,Je,Vt.value,me);if(rs===null){Je===null&&(Je=kt);break}i&&Je&&rs.alternate===null&&l(X,Je),G=w(rs,G,wt),Bt===null?rt=rs:Bt.sibling=rs,Bt=rs,Je=kt}if(Vt.done)return u(X,Je),Nt&&Ko(X,wt),rt;if(Je===null){for(;!Vt.done;wt++,Vt=ee.next())Vt=ve(X,Vt.value,me),Vt!==null&&(G=w(Vt,G,wt),Bt===null?rt=Vt:Bt.sibling=Vt,Bt=Vt);return Nt&&Ko(X,wt),rt}for(Je=h(Je);!Vt.done;wt++,Vt=ee.next())Vt=se(Je,X,wt,Vt.value,me),Vt!==null&&(i&&Vt.alternate!==null&&Je.delete(Vt.key===null?wt:Vt.key),G=w(Vt,G,wt),Bt===null?rt=Vt:Bt.sibling=Vt,Bt=Vt);return i&&Je.forEach(function(K3){return l(X,K3)}),Nt&&Ko(X,wt),rt}function sn(X,G,ee,me){if(typeof ee=="object"&&ee!==null&&ee.type===j&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var rt=ee.key;G!==null;){if(G.key===rt){if(rt=ee.type,rt===j){if(G.tag===7){u(X,G.sibling),me=x(G,ee.props.children),me.return=X,X=me;break e}}else if(G.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===P&&Bs(rt)===G.type){u(X,G.sibling),me=x(G,ee.props),Du(me,ee),me.return=X,X=me;break e}u(X,G);break}else l(X,G);G=G.sibling}ee.type===j?(me=Ls(ee.props.children,X.mode,me,ee.key),me.return=X,X=me):(me=$f(ee.type,ee.key,ee.props,null,X.mode,me),Du(me,ee),me.return=X,X=me)}return D(X);case S:e:{for(rt=ee.key;G!==null;){if(G.key===rt)if(G.tag===4&&G.stateNode.containerInfo===ee.containerInfo&&G.stateNode.implementation===ee.implementation){u(X,G.sibling),me=x(G,ee.children||[]),me.return=X,X=me;break e}else{u(X,G);break}else l(X,G);G=G.sibling}me=$g(ee,X.mode,me),me.return=X,X=me}return D(X);case P:return ee=Bs(ee),sn(X,G,ee,me)}if(Q(ee))return Ge(X,G,ee,me);if(J(ee)){if(rt=J(ee),typeof rt!="function")throw Error(r(150));return ee=rt.call(ee),ut(X,G,ee,me)}if(typeof ee.then=="function")return sn(X,G,Gf(ee),me);if(ee.$$typeof===T)return sn(X,G,Vf(X,ee),me);Qf(X,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,G!==null&&G.tag===6?(u(X,G.sibling),me=x(G,ee),me.return=X,X=me):(u(X,G),me=zg(ee,X.mode,me),me.return=X,X=me),D(X)):u(X,G)}return function(X,G,ee,me){try{Au=0;var rt=sn(X,G,ee,me);return ec=null,rt}catch(Je){if(Je===Zl||Je===Hf)throw Je;var Bt=ri(29,Je,null,X.mode);return Bt.lanes=me,Bt.return=X,Bt}finally{}}}var Fs=fw(!0),hw=fw(!1),Ua=!1;function Xg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jg(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 Ba(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Va(i,l,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(Gt&2)!==0){var x=h.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),h.pending=l,l=zf(i),K1(i,null,u),l}return If(i,h,l,u),zf(i)}function ku(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,W(i,u)}}function Zg(i,l){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var x=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var D={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?x=w=D:w=w.next=D,u=u.next}while(u!==null);w===null?x=w=l:w=w.next=l}else x=w=l;u={baseState:h.baseState,firstBaseUpdate:x,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 ev=!1;function Pu(){if(ev){var i=Jl;if(i!==null)throw i}}function Nu(i,l,u,h){ev=!1;var x=i.updateQueue;Ua=!1;var w=x.firstBaseUpdate,D=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var q=N,te=q.next;q.next=null,D===null?w=te:D.next=te,D=q;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,N=fe.lastBaseUpdate,N!==D&&(N===null?fe.firstBaseUpdate=te:N.next=te,fe.lastBaseUpdate=q))}if(w!==null){var ve=x.baseState;D=0,fe=te=q=null,N=w;do{var re=N.lane&-536870913,se=re!==N.lane;if(se?(Dt&re)===re:(h&re)===re){re!==0&&re===Xl&&(ev=!0),fe!==null&&(fe=fe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Ge=i,ut=N;re=l;var sn=u;switch(ut.tag){case 1:if(Ge=ut.payload,typeof Ge=="function"){ve=Ge.call(sn,ve,re);break e}ve=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=ut.payload,re=typeof Ge=="function"?Ge.call(sn,ve,re):Ge,re==null)break e;ve=g({},ve,re);break e;case 2:Ua=!0}}re=N.callback,re!==null&&(i.flags|=64,se&&(i.flags|=8192),se=x.callbacks,se===null?x.callbacks=[re]:se.push(re))}else se={lane:re,tag:N.tag,payload:N.payload,callback:N.callback,next:null},fe===null?(te=fe=se,q=ve):fe=fe.next=se,D|=re;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;se=N,N=se.next,se.next=null,x.lastBaseUpdate=se,x.shared.pending=null}}while(!0);fe===null&&(q=ve),x.baseState=q,x.firstBaseUpdate=te,x.lastBaseUpdate=fe,w===null&&(x.shared.lanes=0),Qa|=D,i.lanes=D,i.memoizedState=ve}}function pw(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function mw(i,l){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)pw(u[i],l)}var tc=O(null),Wf=O(0);function gw(i,l){i=sa,ae(Wf,i),ae(tc,l),sa=i|l.baseLanes}function tv(){ae(Wf,sa),ae(tc,tc.current)}function nv(){sa=Wf.current,F(tc),F(Wf)}var ii=O(null),ji=null;function Fa(i){var l=i.alternate;ae(Hn,Hn.current&1),ae(ii,i),ji===null&&(l===null||tc.current!==null||l.memoizedState!==null)&&(ji=i)}function rv(i){ae(Hn,Hn.current),ae(ii,i),ji===null&&(ji=i)}function vw(i){i.tag===22?(ae(Hn,Hn.current),ae(ii,i),ji===null&&(ji=i)):Ha()}function Ha(){ae(Hn,Hn.current),ae(ii,ii.current)}function oi(i){F(ii),ji===i&&(ji=null),F(Hn)}var Hn=O(0);function Yf(i){for(var l=i;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||cy(u)||uy(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 Zo=0,bt=null,on=null,Kn=null,Kf=!1,nc=!1,Hs=!1,Xf=0,Ou=0,rc=null,UO=0;function In(){throw Error(r(321))}function iv(i,l){if(l===null)return!1;for(var u=0;u<l.length&&u<i.length;u++)if(!ni(i[u],l[u]))return!1;return!0}function ov(i,l,u,h,x,w){return Zo=w,bt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=i===null||i.memoizedState===null?ej:bv,Hs=!1,w=u(h,x),Hs=!1,nc&&(w=xw(l,u,h,x)),yw(i),w}function yw(i){M.H=Iu;var l=on!==null&&on.next!==null;if(Zo=0,Kn=on=bt=null,Kf=!1,Ou=0,rc=null,l)throw Error(r(300));i===null||Xn||(i=i.dependencies,i!==null&&Bf(i)&&(Xn=!0))}function xw(i,l,u,h){bt=i;var x=0;do{if(nc&&(rc=null),Ou=0,nc=!1,25<=x)throw Error(r(301));if(x+=1,Kn=on=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=tj,w=l(u,h)}while(nc);return w}function BO(){var i=M.H,l=i.useState()[0];return l=typeof l.then=="function"?Mu(l):l,i=i.useState()[0],(on!==null?on.memoizedState:null)!==i&&(bt.flags|=1024),l}function av(){var i=Xf!==0;return Xf=0,i}function sv(i,l,u){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~u}function lv(i){if(Kf){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}Kf=!1}Zo=0,Kn=on=bt=null,nc=!1,Ou=Xf=0,rc=null}function Ar(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?bt.memoizedState=Kn=i:Kn=Kn.next=i,Kn}function qn(){if(on===null){var i=bt.alternate;i=i!==null?i.memoizedState:null}else i=on.next;var l=Kn===null?bt.memoizedState:Kn.next;if(l!==null)Kn=l,on=i;else{if(i===null)throw bt.alternate===null?Error(r(467)):Error(r(310));on=i,i={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},Kn===null?bt.memoizedState=Kn=i:Kn=Kn.next=i}return Kn}function Jf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mu(i){var l=Ou;return Ou+=1,rc===null&&(rc=[]),i=cw(rc,i,l),l=bt,(Kn===null?l.memoizedState:Kn.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?ej:bv),i}function Zf(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Mu(i);if(i.$$typeof===T)return ur(i)}throw Error(r(438,String(i)))}function cv(i){var l=null,u=bt.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var h=bt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=Jf(),bt.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 ea(i,l){return typeof l=="function"?l(i):l}function eh(i){var l=qn();return uv(l,on,i)}function uv(i,l,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var x=i.baseQueue,w=h.pending;if(w!==null){if(x!==null){var D=x.next;x.next=w.next,w.next=D}l.baseQueue=x=w,h.pending=null}if(w=i.baseState,x===null)i.memoizedState=w;else{l=x.next;var N=D=null,q=null,te=l,fe=!1;do{var ve=te.lane&-536870913;if(ve!==te.lane?(Dt&ve)===ve:(Zo&ve)===ve){var re=te.revertLane;if(re===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ve===Xl&&(fe=!0);else if((Zo&re)===re){te=te.next,re===Xl&&(fe=!0);continue}else ve={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},q===null?(N=q=ve,D=w):q=q.next=ve,bt.lanes|=re,Qa|=re;ve=te.action,Hs&&u(w,ve),w=te.hasEagerState?te.eagerState:u(w,ve)}else re={lane:ve,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},q===null?(N=q=re,D=w):q=q.next=re,bt.lanes|=ve,Qa|=ve;te=te.next}while(te!==null&&te!==l);if(q===null?D=w:q.next=N,!ni(w,i.memoizedState)&&(Xn=!0,fe&&(u=Jl,u!==null)))throw u;i.memoizedState=w,i.baseState=D,i.baseQueue=q,h.lastRenderedState=w}return x===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function dv(i){var l=qn(),u=l.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,x=u.pending,w=l.memoizedState;if(x!==null){u.pending=null;var D=x=x.next;do w=i(w,D.action),D=D.next;while(D!==x);ni(w,l.memoizedState)||(Xn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),u.lastRenderedState=w}return[w,h]}function bw(i,l,u){var h=bt,x=qn(),w=Nt;if(w){if(u===void 0)throw Error(r(407));u=u()}else u=l();var D=!ni((on||x).memoizedState,u);if(D&&(x.memoizedState=u,Xn=!0),x=x.queue,pv(jw.bind(null,h,x,i),[i]),x.getSnapshot!==l||D||Kn!==null&&Kn.memoizedState.tag&1){if(h.flags|=2048,ic(9,{destroy:void 0},ww.bind(null,h,x,u,l),null),cn===null)throw Error(r(349));w||(Zo&127)!==0||Sw(h,l,u)}return u}function Sw(i,l,u){i.flags|=16384,i={getSnapshot:l,value:u},l=bt.updateQueue,l===null?(l=Jf(),bt.updateQueue=l,l.stores=[i]):(u=l.stores,u===null?l.stores=[i]:u.push(i))}function ww(i,l,u,h){l.value=u,l.getSnapshot=h,Cw(l)&&Ew(i)}function jw(i,l,u){return u(function(){Cw(l)&&Ew(i)})}function Cw(i){var l=i.getSnapshot;i=i.value;try{var u=l();return!ni(i,u)}catch{return!0}}function Ew(i){var l=Ms(i,2);l!==null&&Wr(l,i,2)}function fv(i){var l=Ar();if(typeof i=="function"){var u=i;if(i=u(),Hs){lr(!0);try{u()}finally{lr(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:i},l}function Tw(i,l,u,h){return i.baseState=u,uv(i,on,typeof h=="function"?h:ea)}function VO(i,l,u,h,x){if(rh(i))throw Error(r(485));if(i=l.action,i!==null){var w={payload:x,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){w.listeners.push(D)}};M.T!==null?u(!0):w.isTransition=!1,h(w),u=l.pending,u===null?(w.next=l.pending=w,Rw(l,w)):(w.next=u.next,l.pending=u.next=w)}}function Rw(i,l){var u=l.action,h=l.payload,x=i.state;if(l.isTransition){var w=M.T,D={};M.T=D;try{var N=u(x,h),q=M.S;q!==null&&q(D,N),_w(i,l,N)}catch(te){hv(i,l,te)}finally{w!==null&&D.types!==null&&(w.types=D.types),M.T=w}}else try{w=u(x,h),_w(i,l,w)}catch(te){hv(i,l,te)}}function _w(i,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){Aw(i,l,h)},function(h){return hv(i,l,h)}):Aw(i,l,u)}function Aw(i,l,u){l.status="fulfilled",l.value=u,Dw(l),i.state=u,l=i.pending,l!==null&&(u=l.next,u===l?i.pending=null:(u=u.next,l.next=u,Rw(i,u)))}function hv(i,l,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,Dw(l),l=l.next;while(l!==h)}i.action=null}function Dw(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function kw(i,l){return l}function Pw(i,l){if(Nt){var u=cn.formState;if(u!==null){e:{var h=bt;if(Nt){if(xn){t:{for(var x=xn,w=wi;x.nodeType!==8;){if(!w){x=null;break t}if(x=Ci(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){xn=Ci(x.nextSibling),h=x.data==="F!";break e}}za(h)}h=!1}h&&(l=u[0])}}return u=Ar(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kw,lastRenderedState:l},u.queue=h,u=Xw.bind(null,bt,h),h.dispatch=u,h=fv(!1),w=xv.bind(null,bt,!1,h.queue),h=Ar(),x={state:l,dispatch:null,action:i,pending:null},h.queue=x,u=VO.bind(null,bt,x,w,u),x.dispatch=u,h.memoizedState=i,[l,u,!1]}function Nw(i){var l=qn();return Ow(l,on,i)}function Ow(i,l,u){if(l=uv(i,l,kw)[0],i=eh(ea)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=Mu(l)}catch(D){throw D===Zl?Hf:D}else h=l;l=qn();var x=l.queue,w=x.dispatch;return u!==l.memoizedState&&(bt.flags|=2048,ic(9,{destroy:void 0},FO.bind(null,x,u),null)),[h,w,i]}function FO(i,l){i.action=l}function Mw(i){var l=qn(),u=on;if(u!==null)return Ow(l,u,i);qn(),l=l.memoizedState,u=qn();var h=u.queue.dispatch;return u.memoizedState=i,[l,h,!1]}function ic(i,l,u,h){return i={tag:i,create:u,deps:h,inst:l,next:null},l=bt.updateQueue,l===null&&(l=Jf(),bt.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 Lw(){return qn().memoizedState}function th(i,l,u,h){var x=Ar();bt.flags|=i,x.memoizedState=ic(1|l,{destroy:void 0},u,h===void 0?null:h)}function nh(i,l,u,h){var x=qn();h=h===void 0?null:h;var w=x.memoizedState.inst;on!==null&&h!==null&&iv(h,on.memoizedState.deps)?x.memoizedState=ic(l,w,u,h):(bt.flags|=i,x.memoizedState=ic(1|l,w,u,h))}function Iw(i,l){th(8390656,8,i,l)}function pv(i,l){nh(2048,8,i,l)}function HO(i){bt.flags|=4;var l=bt.updateQueue;if(l===null)l=Jf(),bt.updateQueue=l,l.events=[i];else{var u=l.events;u===null?l.events=[i]:u.push(i)}}function zw(i){var l=qn().memoizedState;return HO({ref:l,nextImpl:i}),function(){if((Gt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function $w(i,l){return nh(4,2,i,l)}function Uw(i,l){return nh(4,4,i,l)}function Bw(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 Vw(i,l,u){u=u!=null?u.concat([i]):null,nh(4,4,Bw.bind(null,l,i),u)}function mv(){}function Fw(i,l){var u=qn();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&iv(l,h[1])?h[0]:(u.memoizedState=[i,l],i)}function Hw(i,l){var u=qn();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&iv(l,h[1]))return h[0];if(h=i(),Hs){lr(!0);try{i()}finally{lr(!1)}}return u.memoizedState=[h,l],h}function gv(i,l,u){return u===void 0||(Zo&1073741824)!==0&&(Dt&261930)===0?i.memoizedState=l:(i.memoizedState=u,i=qj(),bt.lanes|=i,Qa|=i,u)}function qw(i,l,u,h){return ni(u,l)?u:tc.current!==null?(i=gv(i,u,h),ni(i,l)||(Xn=!0),i):(Zo&42)===0||(Zo&1073741824)!==0&&(Dt&261930)===0?(Xn=!0,i.memoizedState=u):(i=qj(),bt.lanes|=i,Qa|=i,l)}function Gw(i,l,u,h,x){var w=L.p;L.p=w!==0&&8>w?w:8;var D=M.T,N={};M.T=N,xv(i,!1,l,u);try{var q=x(),te=M.S;if(te!==null&&te(N,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var fe=$O(q,h);Lu(i,l,fe,li(i))}else Lu(i,l,h,li(i))}catch(ve){Lu(i,l,{then:function(){},status:"rejected",reason:ve},li())}finally{L.p=w,D!==null&&N.types!==null&&(D.types=N.types),M.T=D}}function qO(){}function vv(i,l,u,h){if(i.tag!==5)throw Error(r(476));var x=Qw(i).queue;Gw(i,x,l,U,u===null?qO:function(){return Ww(i),u(h)})}function Qw(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:U},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:u},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function Ww(i){var l=Qw(i);l.next===null&&(l=i.alternate.memoizedState),Lu(i,l.next.queue,{},li())}function yv(){return ur(Zu)}function Yw(){return qn().memoizedState}function Kw(){return qn().memoizedState}function GO(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var u=li();i=Ba(u);var h=Va(l,i,u);h!==null&&(Wr(h,l,u),ku(h,l,u)),l={cache:Qg()},i.payload=l;return}l=l.return}}function QO(i,l,u){var h=li();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},rh(i)?Jw(l,u):(u=Lg(i,l,u,h),u!==null&&(Wr(u,i,h),Zw(u,l,h)))}function Xw(i,l,u){var h=li();Lu(i,l,u,h)}function Lu(i,l,u,h){var x={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(rh(i))Jw(l,x);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var D=l.lastRenderedState,N=w(D,u);if(x.hasEagerState=!0,x.eagerState=N,ni(N,D))return If(i,l,x,0),cn===null&&Lf(),!1}catch{}finally{}if(u=Lg(i,l,x,h),u!==null)return Wr(u,i,h),Zw(u,l,h),!0}return!1}function xv(i,l,u,h){if(h={lane:2,revertLane:Xv(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},rh(i)){if(l)throw Error(r(479))}else l=Lg(i,u,h,2),l!==null&&Wr(l,i,2)}function rh(i){var l=i.alternate;return i===bt||l!==null&&l===bt}function Jw(i,l){nc=Kf=!0;var u=i.pending;u===null?l.next=l:(l.next=u.next,u.next=l),i.pending=l}function Zw(i,l,u){if((u&4194048)!==0){var h=l.lanes;h&=i.pendingLanes,u|=h,l.lanes=u,W(i,u)}}var Iu={readContext:ur,use:Zf,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};Iu.useEffectEvent=In;var ej={readContext:ur,use:Zf,useCallback:function(i,l){return Ar().memoizedState=[i,l===void 0?null:l],i},useContext:ur,useEffect:Iw,useImperativeHandle:function(i,l,u){u=u!=null?u.concat([i]):null,th(4194308,4,Bw.bind(null,l,i),u)},useLayoutEffect:function(i,l){return th(4194308,4,i,l)},useInsertionEffect:function(i,l){th(4,2,i,l)},useMemo:function(i,l){var u=Ar();l=l===void 0?null:l;var h=i();if(Hs){lr(!0);try{i()}finally{lr(!1)}}return u.memoizedState=[h,l],h},useReducer:function(i,l,u){var h=Ar();if(u!==void 0){var x=u(l);if(Hs){lr(!0);try{u(l)}finally{lr(!1)}}}else x=l;return h.memoizedState=h.baseState=x,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:x},h.queue=i,i=i.dispatch=QO.bind(null,bt,i),[h.memoizedState,i]},useRef:function(i){var l=Ar();return i={current:i},l.memoizedState=i},useState:function(i){i=fv(i);var l=i.queue,u=Xw.bind(null,bt,l);return l.dispatch=u,[i.memoizedState,u]},useDebugValue:mv,useDeferredValue:function(i,l){var u=Ar();return gv(u,i,l)},useTransition:function(){var i=fv(!1);return i=Gw.bind(null,bt,i.queue,!0,!1),Ar().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,u){var h=bt,x=Ar();if(Nt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=l(),cn===null)throw Error(r(349));(Dt&127)!==0||Sw(h,l,u)}x.memoizedState=u;var w={value:u,getSnapshot:l};return x.queue=w,Iw(jw.bind(null,h,w,i),[i]),h.flags|=2048,ic(9,{destroy:void 0},ww.bind(null,h,w,u,l),null),u},useId:function(){var i=Ar(),l=cn.identifierPrefix;if(Nt){var u=fo,h=uo;u=(h&~(1<<32-Tn(h)-1)).toString(32)+u,l="_"+l+"R_"+u,u=Xf++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=UO++,l="_"+l+"r_"+u.toString(32)+"_";return i.memoizedState=l},useHostTransitionStatus:yv,useFormState:Pw,useActionState:Pw,useOptimistic:function(i){var l=Ar();l.memoizedState=l.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=xv.bind(null,bt,!0,u),u.dispatch=l,[i,l]},useMemoCache:cv,useCacheRefresh:function(){return Ar().memoizedState=GO.bind(null,bt)},useEffectEvent:function(i){var l=Ar(),u={impl:i};return l.memoizedState=u,function(){if((Gt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},bv={readContext:ur,use:Zf,useCallback:Fw,useContext:ur,useEffect:pv,useImperativeHandle:Vw,useInsertionEffect:$w,useLayoutEffect:Uw,useMemo:Hw,useReducer:eh,useRef:Lw,useState:function(){return eh(ea)},useDebugValue:mv,useDeferredValue:function(i,l){var u=qn();return qw(u,on.memoizedState,i,l)},useTransition:function(){var i=eh(ea)[0],l=qn().memoizedState;return[typeof i=="boolean"?i:Mu(i),l]},useSyncExternalStore:bw,useId:Yw,useHostTransitionStatus:yv,useFormState:Nw,useActionState:Nw,useOptimistic:function(i,l){var u=qn();return Tw(u,on,i,l)},useMemoCache:cv,useCacheRefresh:Kw};bv.useEffectEvent=zw;var tj={readContext:ur,use:Zf,useCallback:Fw,useContext:ur,useEffect:pv,useImperativeHandle:Vw,useInsertionEffect:$w,useLayoutEffect:Uw,useMemo:Hw,useReducer:dv,useRef:Lw,useState:function(){return dv(ea)},useDebugValue:mv,useDeferredValue:function(i,l){var u=qn();return on===null?gv(u,i,l):qw(u,on.memoizedState,i,l)},useTransition:function(){var i=dv(ea)[0],l=qn().memoizedState;return[typeof i=="boolean"?i:Mu(i),l]},useSyncExternalStore:bw,useId:Yw,useHostTransitionStatus:yv,useFormState:Mw,useActionState:Mw,useOptimistic:function(i,l){var u=qn();return on!==null?Tw(u,on,i,l):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:cv,useCacheRefresh:Kw};tj.useEffectEvent=zw;function Sv(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 wv={enqueueSetState:function(i,l,u){i=i._reactInternals;var h=li(),x=Ba(h);x.payload=l,u!=null&&(x.callback=u),l=Va(i,x,h),l!==null&&(Wr(l,i,h),ku(l,i,h))},enqueueReplaceState:function(i,l,u){i=i._reactInternals;var h=li(),x=Ba(h);x.tag=1,x.payload=l,u!=null&&(x.callback=u),l=Va(i,x,h),l!==null&&(Wr(l,i,h),ku(l,i,h))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var u=li(),h=Ba(u);h.tag=2,l!=null&&(h.callback=l),l=Va(i,h,u),l!==null&&(Wr(l,i,u),ku(l,i,u))}};function nj(i,l,u,h,x,w,D){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,w,D):l.prototype&&l.prototype.isPureReactComponent?!ju(u,h)||!ju(x,w):!0}function rj(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&&wv.enqueueReplaceState(l,l.state,null)}function qs(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 x in i)u[x]===void 0&&(u[x]=i[x])}return u}function ij(i){Mf(i)}function oj(i){console.error(i)}function aj(i){Mf(i)}function ih(i,l){try{var u=i.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function sj(i,l,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function jv(i,l,u){return u=Ba(u),u.tag=3,u.payload={element:null},u.callback=function(){ih(i,l)},u}function lj(i){return i=Ba(i),i.tag=3,i}function cj(i,l,u,h){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var w=h.value;i.payload=function(){return x(w)},i.callback=function(){sj(l,u,h)}}var D=u.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(i.callback=function(){sj(l,u,h),typeof x!="function"&&(Wa===null?Wa=new Set([this]):Wa.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})})}function WO(i,l,u,h,x){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&Kl(l,u,x,!0),u=ii.current,u!==null){switch(u.tag){case 31:case 13:return ji===null?gh():u.alternate===null&&zn===0&&(zn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,h===qf?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([h]):l.add(h),Wv(i,h,x)),!1;case 22:return u.flags|=65536,h===qf?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)),Wv(i,h,x)),!1}throw Error(r(435,u.tag))}return Wv(i,h,x),gh(),!1}if(Nt)return l=ii.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,h!==Vg&&(i=Error(r(422),{cause:h}),Tu(xi(i,u)))):(h!==Vg&&(l=Error(r(423),{cause:h}),Tu(xi(l,u))),i=i.current.alternate,i.flags|=65536,x&=-x,i.lanes|=x,h=xi(h,u),x=jv(i.stateNode,h,x),Zg(i,x),zn!==4&&(zn=2)),!1;var w=Error(r(520),{cause:h});if(w=xi(w,u),qu===null?qu=[w]:qu.push(w),zn!==4&&(zn=2),l===null)return!0;h=xi(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,i=x&-x,u.lanes|=i,i=jv(u.stateNode,h,i),Zg(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"&&(Wa===null||!Wa.has(w))))return u.flags|=65536,x&=-x,u.lanes|=x,x=lj(x),cj(x,i,u,h),Zg(u,x),!1}u=u.return}while(u!==null);return!1}var Cv=Error(r(461)),Xn=!1;function dr(i,l,u,h){l.child=i===null?hw(l,null,u,h):Fs(l,i.child,u,h)}function uj(i,l,u,h,x){u=u.render;var w=l.ref;if("ref"in h){var D={};for(var N in h)N!=="ref"&&(D[N]=h[N])}else D=h;return $s(l),h=ov(i,l,u,D,w,x),N=av(),i!==null&&!Xn?(sv(i,l,x),ta(i,l,x)):(Nt&&N&&Ug(l),l.flags|=1,dr(i,l,h,x),l.child)}function dj(i,l,u,h,x){if(i===null){var w=u.type;return typeof w=="function"&&!Ig(w)&&w.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=w,fj(i,l,w,h,x)):(i=$f(u.type,null,h,l,l.mode,x),i.ref=l.ref,i.return=l,l.child=i)}if(w=i.child,!Pv(i,x)){var D=w.memoizedProps;if(u=u.compare,u=u!==null?u:ju,u(D,h)&&i.ref===l.ref)return ta(i,l,x)}return l.flags|=1,i=Yo(w,h),i.ref=l.ref,i.return=l,l.child=i}function fj(i,l,u,h,x){if(i!==null){var w=i.memoizedProps;if(ju(w,h)&&i.ref===l.ref)if(Xn=!1,l.pendingProps=h=w,Pv(i,x))(i.flags&131072)!==0&&(Xn=!0);else return l.lanes=i.lanes,ta(i,l,x)}return Ev(i,l,u,h,x)}function hj(i,l,u,h){var x=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,x=0;h!==null;)x=x|h.lanes|h.childLanes,h=h.sibling;h=x&~w}else h=0,l.child=null;return pj(i,l,w,u,h)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&Ff(l,w!==null?w.cachePool:null),w!==null?gw(l,w):tv(),vw(l);else return h=l.lanes=536870912,pj(i,l,w!==null?w.baseLanes|u:u,u,h)}else w!==null?(Ff(l,w.cachePool),gw(l,w),Ha(),l.memoizedState=null):(i!==null&&Ff(l,null),tv(),Ha());return dr(i,l,x,u),l.child}function zu(i,l){return i!==null&&i.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function pj(i,l,u,h,x){var w=Yg();return w=w===null?null:{parent:Yn._currentValue,pool:w},l.memoizedState={baseLanes:u,cachePool:w},i!==null&&Ff(l,null),tv(),vw(l),i!==null&&Kl(i,l,h,!0),l.childLanes=x,null}function oh(i,l){return l=sh({mode:l.mode,children:l.children},i.mode),l.ref=i.ref,i.child=l,l.return=i,l}function mj(i,l,u){return Fs(l,i.child,null,u),i=oh(l,l.pendingProps),i.flags|=2,oi(l),l.memoizedState=null,i}function YO(i,l,u){var h=l.pendingProps,x=(l.flags&128)!==0;if(l.flags&=-129,i===null){if(Nt){if(h.mode==="hidden")return i=oh(l,h),l.lanes=536870912,zu(null,i);if(rv(l),(i=xn)?(i=RC(i,wi),i=i!==null&&i.data==="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:La!==null?{id:uo,overflow:fo}:null,retryLane:536870912,hydrationErrors:null},u=J1(i),u.return=l,l.child=u,cr=l,xn=null)):i=null,i===null)throw za(l);return l.lanes=536870912,null}return oh(l,h)}var w=i.memoizedState;if(w!==null){var D=w.dehydrated;if(rv(l),x)if(l.flags&256)l.flags&=-257,l=mj(i,l,u);else if(l.memoizedState!==null)l.child=i.child,l.flags|=128,l=null;else throw Error(r(558));else if(Xn||Kl(i,l,u,!1),x=(u&i.childLanes)!==0,Xn||x){if(h=cn,h!==null&&(D=oe(h,u),D!==0&&D!==w.retryLane))throw w.retryLane=D,Ms(i,D),Wr(h,i,D),Cv;gh(),l=mj(i,l,u)}else i=w.treeContext,xn=Ci(D.nextSibling),cr=l,Nt=!0,Ia=null,wi=!1,i!==null&&tw(l,i),l=oh(l,h),l.flags|=4096;return l}return i=Yo(i.child,{mode:h.mode,children:h.children}),i.ref=l.ref,l.child=i,i.return=l,i}function ah(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 Ev(i,l,u,h,x){return $s(l),u=ov(i,l,u,h,void 0,x),h=av(),i!==null&&!Xn?(sv(i,l,x),ta(i,l,x)):(Nt&&h&&Ug(l),l.flags|=1,dr(i,l,u,x),l.child)}function gj(i,l,u,h,x,w){return $s(l),l.updateQueue=null,u=xw(l,h,u,x),yw(i),h=av(),i!==null&&!Xn?(sv(i,l,w),ta(i,l,w)):(Nt&&h&&Ug(l),l.flags|=1,dr(i,l,u,w),l.child)}function vj(i,l,u,h,x){if($s(l),l.stateNode===null){var w=Gl,D=u.contextType;typeof D=="object"&&D!==null&&(w=ur(D)),w=new u(h,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=wv,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=h,w.state=l.memoizedState,w.refs={},Xg(l),D=u.contextType,w.context=typeof D=="object"&&D!==null?ur(D):Gl,w.state=l.memoizedState,D=u.getDerivedStateFromProps,typeof D=="function"&&(Sv(l,u,D,h),w.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(D=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),D!==w.state&&wv.enqueueReplaceState(w,w.state,null),Nu(l,h,w,x),Pu(),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=qs(u,N);w.props=q;var te=w.context,fe=u.contextType;D=Gl,typeof fe=="object"&&fe!==null&&(D=ur(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||te!==D)&&rj(l,w,h,D),Ua=!1;var re=l.memoizedState;w.state=re,Nu(l,h,w,x),Pu(),te=l.memoizedState,N||re!==te||Ua?(typeof ve=="function"&&(Sv(l,u,ve,h),te=l.memoizedState),(q=Ua||nj(l,u,q,h,re,te,D))?(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=te),w.props=h,w.state=te,w.context=D,h=q):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{w=l.stateNode,Jg(i,l),D=l.memoizedProps,fe=qs(u,D),w.props=fe,ve=l.pendingProps,re=w.context,te=u.contextType,q=Gl,typeof te=="object"&&te!==null&&(q=ur(te)),N=u.getDerivedStateFromProps,(te=typeof N=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(D!==ve||re!==q)&&rj(l,w,h,q),Ua=!1,re=l.memoizedState,w.state=re,Nu(l,h,w,x),Pu();var se=l.memoizedState;D!==ve||re!==se||Ua||i!==null&&i.dependencies!==null&&Bf(i.dependencies)?(typeof N=="function"&&(Sv(l,u,N,h),se=l.memoizedState),(fe=Ua||nj(l,u,fe,h,re,se,q)||i!==null&&i.dependencies!==null&&Bf(i.dependencies))?(te||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,se,q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,se,q)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||D===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=se),w.props=h,w.state=se,w.context=q,h=fe):(typeof w.componentDidUpdate!="function"||D===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),h=!1)}return w=h,ah(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=Fs(l,i.child,null,x),l.child=Fs(l,null,u,x)):dr(i,l,u,x),l.memoizedState=w.state,i=l.child):i=ta(i,l,x),i}function yj(i,l,u,h){return Is(),l.flags|=256,dr(i,l,u,h),l.child}var Tv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rv(i){return{baseLanes:i,cachePool:sw()}}function _v(i,l,u){return i=i!==null?i.childLanes&~u:0,l&&(i|=si),i}function xj(i,l,u){var h=l.pendingProps,x=!1,w=(l.flags&128)!==0,D;if((D=w)||(D=i!==null&&i.memoizedState===null?!1:(Hn.current&2)!==0),D&&(x=!0,l.flags&=-129),D=(l.flags&32)!==0,l.flags&=-33,i===null){if(Nt){if(x?Fa(l):Ha(),(i=xn)?(i=RC(i,wi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:La!==null?{id:uo,overflow:fo}:null,retryLane:536870912,hydrationErrors:null},u=J1(i),u.return=l,l.child=u,cr=l,xn=null)):i=null,i===null)throw za(l);return uy(i)?l.lanes=32:l.lanes=536870912,null}var N=h.children;return h=h.fallback,x?(Ha(),x=l.mode,N=sh({mode:"hidden",children:N},x),h=Ls(h,x,u,null),N.return=l,h.return=l,N.sibling=h,l.child=N,h=l.child,h.memoizedState=Rv(u),h.childLanes=_v(i,D,u),l.memoizedState=Tv,zu(null,h)):(Fa(l),Av(l,N))}var q=i.memoizedState;if(q!==null&&(N=q.dehydrated,N!==null)){if(w)l.flags&256?(Fa(l),l.flags&=-257,l=Dv(i,l,u)):l.memoizedState!==null?(Ha(),l.child=i.child,l.flags|=128,l=null):(Ha(),N=h.fallback,x=l.mode,h=sh({mode:"visible",children:h.children},x),N=Ls(N,x,u,null),N.flags|=2,h.return=l,N.return=l,h.sibling=N,l.child=h,Fs(l,i.child,null,u),h=l.child,h.memoizedState=Rv(u),h.childLanes=_v(i,D,u),l.memoizedState=Tv,l=zu(null,h));else if(Fa(l),uy(N)){if(D=N.nextSibling&&N.nextSibling.dataset,D)var te=D.dgst;D=te,h=Error(r(419)),h.stack="",h.digest=D,Tu({value:h,source:null,stack:null}),l=Dv(i,l,u)}else if(Xn||Kl(i,l,u,!1),D=(u&i.childLanes)!==0,Xn||D){if(D=cn,D!==null&&(h=oe(D,u),h!==0&&h!==q.retryLane))throw q.retryLane=h,Ms(i,h),Wr(D,i,h),Cv;cy(N)||gh(),l=Dv(i,l,u)}else cy(N)?(l.flags|=192,l.child=i.child,l=null):(i=q.treeContext,xn=Ci(N.nextSibling),cr=l,Nt=!0,Ia=null,wi=!1,i!==null&&tw(l,i),l=Av(l,h.children),l.flags|=4096);return l}return x?(Ha(),N=h.fallback,x=l.mode,q=i.child,te=q.sibling,h=Yo(q,{mode:"hidden",children:h.children}),h.subtreeFlags=q.subtreeFlags&65011712,te!==null?N=Yo(te,N):(N=Ls(N,x,u,null),N.flags|=2),N.return=l,h.return=l,h.sibling=N,l.child=h,zu(null,h),h=l.child,N=i.child.memoizedState,N===null?N=Rv(u):(x=N.cachePool,x!==null?(q=Yn._currentValue,x=x.parent!==q?{parent:q,pool:q}:x):x=sw(),N={baseLanes:N.baseLanes|u,cachePool:x}),h.memoizedState=N,h.childLanes=_v(i,D,u),l.memoizedState=Tv,zu(i.child,h)):(Fa(l),u=i.child,i=u.sibling,u=Yo(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,i!==null&&(D=l.deletions,D===null?(l.deletions=[i],l.flags|=16):D.push(i)),l.child=u,l.memoizedState=null,u)}function Av(i,l){return l=sh({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function sh(i,l){return i=ri(22,i,null,l),i.lanes=0,i}function Dv(i,l,u){return Fs(l,i.child,null,u),i=Av(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function bj(i,l,u){i.lanes|=l;var h=i.alternate;h!==null&&(h.lanes|=l),qg(i.return,l,u)}function kv(i,l,u,h,x,w){var D=i.memoizedState;D===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:x,treeForkCount:w}:(D.isBackwards=l,D.rendering=null,D.renderingStartTime=0,D.last=h,D.tail=u,D.tailMode=x,D.treeForkCount=w)}function Sj(i,l,u){var h=l.pendingProps,x=h.revealOrder,w=h.tail;h=h.children;var D=Hn.current,N=(D&2)!==0;if(N?(D=D&1|2,l.flags|=128):D&=1,ae(Hn,D),dr(i,l,h,u),h=Nt?Eu:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&bj(i,u,l);else if(i.tag===19)bj(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(x){case"forwards":for(u=l.child,x=null;u!==null;)i=u.alternate,i!==null&&Yf(i)===null&&(x=u),u=u.sibling;u=x,u===null?(x=l.child,l.child=null):(x=u.sibling,u.sibling=null),kv(l,!1,x,u,w,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=l.child,l.child=null;x!==null;){if(i=x.alternate,i!==null&&Yf(i)===null){l.child=x;break}i=x.sibling,x.sibling=u,u=x,x=i}kv(l,!0,u,null,w,h);break;case"together":kv(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function ta(i,l,u){if(i!==null&&(l.dependencies=i.dependencies),Qa|=l.lanes,(u&l.childLanes)===0)if(i!==null){if(Kl(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=Yo(i,i.pendingProps),l.child=u,u.return=l;i.sibling!==null;)i=i.sibling,u=u.sibling=Yo(i,i.pendingProps),u.return=l;u.sibling=null}return l.child}function Pv(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&Bf(i)))}function KO(i,l,u){switch(l.tag){case 3:nt(l,l.stateNode.containerInfo),$a(l,Yn,i.memoizedState.cache),Is();break;case 27:case 5:ft(l);break;case 4:nt(l,l.stateNode.containerInfo);break;case 10:$a(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,rv(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Fa(l),l.flags|=128,null):(u&l.child.childLanes)!==0?xj(i,l,u):(Fa(l),i=ta(i,l,u),i!==null?i.sibling:null);Fa(l);break;case 19:var x=(i.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(Kl(i,l,u,!1),h=(u&l.childLanes)!==0),x){if(h)return Sj(i,l,u);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ae(Hn,Hn.current),h)break;return null;case 22:return l.lanes=0,hj(i,l,u,l.pendingProps);case 24:$a(l,Yn,i.memoizedState.cache)}return ta(i,l,u)}function wj(i,l,u){if(i!==null)if(i.memoizedProps!==l.pendingProps)Xn=!0;else{if(!Pv(i,u)&&(l.flags&128)===0)return Xn=!1,KO(i,l,u);Xn=(i.flags&131072)!==0}else Xn=!1,Nt&&(l.flags&1048576)!==0&&ew(l,Eu,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(i=Bs(l.elementType),l.type=i,typeof i=="function")Ig(i)?(h=qs(i,h),l.tag=1,l=vj(null,l,i,h,u)):(l.tag=0,l=Ev(null,l,i,h,u));else{if(i!=null){var x=i.$$typeof;if(x===_){l.tag=11,l=uj(null,l,i,h,u);break e}else if(x===A){l.tag=14,l=dj(null,l,i,h,u);break e}}throw l=$(i)||i,Error(r(306,l,""))}}return l;case 0:return Ev(i,l,l.type,l.pendingProps,u);case 1:return h=l.type,x=qs(h,l.pendingProps),vj(i,l,h,x,u);case 3:e:{if(nt(l,l.stateNode.containerInfo),i===null)throw Error(r(387));h=l.pendingProps;var w=l.memoizedState;x=w.element,Jg(i,l),Nu(l,h,null,u);var D=l.memoizedState;if(h=D.cache,$a(l,Yn,h),h!==w.cache&&Gg(l,[Yn],u,!0),Pu(),h=D.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:D.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=yj(i,l,h,u);break e}else if(h!==x){x=xi(Error(r(424)),l),Tu(x),l=yj(i,l,h,u);break e}else{switch(i=l.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(xn=Ci(i.firstChild),cr=l,Nt=!0,Ia=null,wi=!0,u=hw(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Is(),h===x){l=ta(i,l,u);break e}dr(i,l,h,u)}l=l.child}return l;case 26:return ah(i,l),i===null?(u=NC(l.type,null,l.pendingProps,null))?l.memoizedState=u:Nt||(u=l.type,i=l.pendingProps,h=jh(we.current).createElement(u),h[Me]=l,h[Ve]=i,fr(h,u,i),Jt(h),l.stateNode=h):l.memoizedState=NC(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return ft(l),i===null&&Nt&&(h=l.stateNode=DC(l.type,l.pendingProps,we.current),cr=l,wi=!0,x=xn,Ja(l.type)?(dy=x,xn=Ci(h.firstChild)):xn=x),dr(i,l,l.pendingProps.children,u),ah(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&Nt&&((x=h=xn)&&(h=T3(h,l.type,l.pendingProps,wi),h!==null?(l.stateNode=h,cr=l,xn=Ci(h.firstChild),wi=!1,x=!0):x=!1),x||za(l)),ft(l),x=l.type,w=l.pendingProps,D=i!==null?i.memoizedProps:null,h=w.children,ay(x,w)?h=null:D!==null&&ay(x,D)&&(l.flags|=32),l.memoizedState!==null&&(x=ov(i,l,BO,null,null,u),Zu._currentValue=x),ah(i,l),dr(i,l,h,u),l.child;case 6:return i===null&&Nt&&((i=u=xn)&&(u=R3(u,l.pendingProps,wi),u!==null?(l.stateNode=u,cr=l,xn=null,i=!0):i=!1),i||za(l)),null;case 13:return xj(i,l,u);case 4:return nt(l,l.stateNode.containerInfo),h=l.pendingProps,i===null?l.child=Fs(l,null,h,u):dr(i,l,h,u),l.child;case 11:return uj(i,l,l.type,l.pendingProps,u);case 7:return dr(i,l,l.pendingProps,u),l.child;case 8:return dr(i,l,l.pendingProps.children,u),l.child;case 12:return dr(i,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,$a(l,l.type,h.value),dr(i,l,h.children,u),l.child;case 9:return x=l.type._context,h=l.pendingProps.children,$s(l),x=ur(x),h=h(x),l.flags|=1,dr(i,l,h,u),l.child;case 14:return dj(i,l,l.type,l.pendingProps,u);case 15:return fj(i,l,l.type,l.pendingProps,u);case 19:return Sj(i,l,u);case 31:return YO(i,l,u);case 22:return hj(i,l,u,l.pendingProps);case 24:return $s(l),h=ur(Yn),i===null?(x=Yg(),x===null&&(x=cn,w=Qg(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=u),x=w),l.memoizedState={parent:h,cache:x},Xg(l),$a(l,Yn,x)):((i.lanes&u)!==0&&(Jg(i,l),Nu(l,null,null,u),Pu()),x=i.memoizedState,w=l.memoizedState,x.parent!==h?(x={parent:h,cache:h},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),$a(l,Yn,h)):(h=w.cache,$a(l,Yn,h),h!==x.cache&&Gg(l,[Yn],u,!0))),dr(i,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function na(i){i.flags|=4}function Nv(i,l,u,h,x){if((l=(i.mode&32)!==0)&&(l=!1),l){if(i.flags|=16777216,(x&335544128)===x)if(i.stateNode.complete)i.flags|=8192;else if(Yj())i.flags|=8192;else throw Vs=qf,Kg}else i.flags&=-16777217}function jj(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!zC(l))if(Yj())i.flags|=8192;else throw Vs=qf,Kg}function lh(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?Fn():536870912,i.lanes|=l,lc|=l)}function $u(i,l){if(!Nt)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 bn(i){var l=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(l)for(var x=i.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=h,i.childLanes=u,l}function XO(i,l,u){var h=l.pendingProps;switch(Bg(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bn(l),null;case 1:return bn(l),null;case 3:return u=l.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Jo(Yn),De(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Yl(l)?na(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Fg())),bn(l),null;case 26:var x=l.type,w=l.memoizedState;return i===null?(na(l),w!==null?(bn(l),jj(l,w)):(bn(l),Nv(l,x,null,h,u))):w?w!==i.memoizedState?(na(l),bn(l),jj(l,w)):(bn(l),l.flags&=-16777217):(i=i.memoizedProps,i!==h&&na(l),bn(l),Nv(l,x,i,h,u)),null;case 27:if(ot(l),u=we.current,x=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&na(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return bn(l),null}i=ue.current,Yl(l)?nw(l):(i=DC(x,h,u),l.stateNode=i,na(l))}return bn(l),null;case 5:if(ot(l),x=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&na(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return bn(l),null}if(w=ue.current,Yl(l))nw(l);else{var D=jh(we.current);switch(w){case 1:w=D.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:w=D.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":w=D.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":w=D.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":w=D.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof h.is=="string"?D.createElement("select",{is:h.is}):D.createElement("select"),h.multiple?w.multiple=!0:h.size&&(w.size=h.size);break;default:w=typeof h.is=="string"?D.createElement(x,{is:h.is}):D.createElement(x)}}w[Me]=l,w[Ve]=h;e:for(D=l.child;D!==null;){if(D.tag===5||D.tag===6)w.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===l)break e;for(;D.sibling===null;){if(D.return===null||D.return===l)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}l.stateNode=w;e:switch(fr(w,x,h),x){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&na(l)}}return bn(l),Nv(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,u),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==h&&na(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(i=we.current,Yl(l)){if(i=l.stateNode,u=l.memoizedProps,h=null,x=cr,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}i[Me]=l,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||xC(i.nodeValue,u)),i||za(l,!0)}else i=jh(i).createTextNode(h),i[Me]=l,l.stateNode=i}return bn(l),null;case 31:if(u=l.memoizedState,i===null||i.memoizedState!==null){if(h=Yl(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[Me]=l}else Is(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;bn(l),i=!1}else u=Fg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return l.flags&256?(oi(l),l):(oi(l),null);if((l.flags&128)!==0)throw Error(r(558))}return bn(l),null;case 13:if(h=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(x=Yl(l),h!==null&&h.dehydrated!==null){if(i===null){if(!x)throw Error(r(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[Me]=l}else Is(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;bn(l),x=!1}else x=Fg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(oi(l),l):(oi(l),null)}return oi(l),(l.flags&128)!==0?(l.lanes=u,l):(u=h!==null,i=i!==null&&i.memoizedState!==null,u&&(h=l.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool),w=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==x&&(h.flags|=2048)),u!==i&&u&&(l.child.flags|=8192),lh(l,l.updateQueue),bn(l),null);case 4:return De(),i===null&&ty(l.stateNode.containerInfo),bn(l),null;case 10:return Jo(l.type),bn(l),null;case 19:if(F(Hn),h=l.memoizedState,h===null)return bn(l),null;if(x=(l.flags&128)!==0,w=h.rendering,w===null)if(x)$u(h,!1);else{if(zn!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(w=Yf(i),w!==null){for(l.flags|=128,$u(h,!1),i=w.updateQueue,l.updateQueue=i,lh(l,i),l.subtreeFlags=0,i=u,u=l.child;u!==null;)X1(u,i),u=u.sibling;return ae(Hn,Hn.current&1|2),Nt&&Ko(l,h.treeForkCount),l.child}i=i.sibling}h.tail!==null&&pe()>hh&&(l.flags|=128,x=!0,$u(h,!1),l.lanes=4194304)}else{if(!x)if(i=Yf(w),i!==null){if(l.flags|=128,x=!0,i=i.updateQueue,l.updateQueue=i,lh(l,i),$u(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!Nt)return bn(l),null}else 2*pe()-h.renderingStartTime>hh&&u!==536870912&&(l.flags|=128,x=!0,$u(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,ae(Hn,x?u&1|2:u&1),Nt&&Ko(l,h.treeForkCount),i):(bn(l),null);case 22:case 23:return oi(l),nv(),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&&(bn(l),l.subtreeFlags&6&&(l.flags|=8192)):bn(l),u=l.updateQueue,u!==null&&lh(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&&F(Us),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),Jo(Yn),bn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function JO(i,l){switch(Bg(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Jo(Yn),De(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return ot(l),null;case 31:if(l.memoizedState!==null){if(oi(l),l.alternate===null)throw Error(r(340));Is()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 13:if(oi(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Is()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return F(Hn),null;case 4:return De(),null;case 10:return Jo(l.type),null;case 22:case 23:return oi(l),nv(),i!==null&&F(Us),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return Jo(Yn),null;case 25:return null;default:return null}}function Cj(i,l){switch(Bg(l),l.tag){case 3:Jo(Yn),De();break;case 26:case 27:case 5:ot(l);break;case 4:De();break;case 31:l.memoizedState!==null&&oi(l);break;case 13:oi(l);break;case 19:F(Hn);break;case 10:Jo(l.type);break;case 22:case 23:oi(l),nv(),i!==null&&F(Us);break;case 24:Jo(Yn)}}function Uu(i,l){try{var u=l.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var x=h.next;u=x;do{if((u.tag&i)===i){h=void 0;var w=u.create,D=u.inst;h=w(),D.destroy=h}u=u.next}while(u!==x)}}catch(N){en(l,l.return,N)}}function qa(i,l,u){try{var h=l.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var w=x.next;h=w;do{if((h.tag&i)===i){var D=h.inst,N=D.destroy;if(N!==void 0){D.destroy=void 0,x=l;var q=u,te=N;try{te()}catch(fe){en(x,q,fe)}}}h=h.next}while(h!==w)}}catch(fe){en(l,l.return,fe)}}function Ej(i){var l=i.updateQueue;if(l!==null){var u=i.stateNode;try{mw(l,u)}catch(h){en(i,i.return,h)}}}function Tj(i,l,u){u.props=qs(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){en(i,l,h)}}function Bu(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(x){en(i,l,x)}}function ho(i,l){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(x){en(i,l,x)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){en(i,l,x)}else u.current=null}function Rj(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(x){en(i,i.return,x)}}function Ov(i,l,u){try{var h=i.stateNode;b3(h,i.type,u,l),h[Ve]=l}catch(x){en(i,i.return,x)}}function _j(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ja(i.type)||i.tag===4}function Mv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||_j(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&&Ja(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 Lv(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=Qo));else if(h!==4&&(h===27&&Ja(i.type)&&(u=i.stateNode,l=null),i=i.child,i!==null))for(Lv(i,l,u),i=i.sibling;i!==null;)Lv(i,l,u),i=i.sibling}function ch(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&&Ja(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(ch(i,l,u),i=i.sibling;i!==null;)ch(i,l,u),i=i.sibling}function Aj(i){var l=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);fr(l,h,u),l[Me]=i,l[Ve]=u}catch(w){en(i,i.return,w)}}var ra=!1,Jn=!1,Iv=!1,Dj=typeof WeakSet=="function"?WeakSet:Set,or=null;function ZO(i,l){if(i=i.containerInfo,iy=Dh,i=V1(i),Dg(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 x=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var D=0,N=-1,q=-1,te=0,fe=0,ve=i,re=null;t:for(;;){for(var se;ve!==u||x!==0&&ve.nodeType!==3||(N=D+x),ve!==w||h!==0&&ve.nodeType!==3||(q=D+h),ve.nodeType===3&&(D+=ve.nodeValue.length),(se=ve.firstChild)!==null;)re=ve,ve=se;for(;;){if(ve===i)break t;if(re===u&&++te===x&&(N=D),re===w&&++fe===h&&(q=D),(se=ve.nextSibling)!==null)break;ve=re,re=ve.parentNode}ve=se}u=N===-1||q===-1?null:{start:N,end:q}}else u=null}u=u||{start:0,end:0}}else u=null;for(oy={focusedElem:i,selectionRange:u},Dh=!1,or=l;or!==null;)if(l=or,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,or=i;else for(;or!==null;){switch(l=or,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++)x=i[u],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&w!==null){i=void 0,u=l,x=w.memoizedProps,w=w.memoizedState,h=u.stateNode;try{var Ge=qs(u.type,x);i=h.getSnapshotBeforeUpdate(Ge,w),h.__reactInternalSnapshotBeforeUpdate=i}catch(ut){en(u,u.return,ut)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,u=i.nodeType,u===9)ly(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":ly(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,or=i;break}or=l.return}}function kj(i,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:oa(i,u),h&4&&Uu(5,u);break;case 1:if(oa(i,u),h&4)if(i=u.stateNode,l===null)try{i.componentDidMount()}catch(D){en(u,u.return,D)}else{var x=qs(u.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(x,l,i.__reactInternalSnapshotBeforeUpdate)}catch(D){en(u,u.return,D)}}h&64&&Ej(u),h&512&&Bu(u,u.return);break;case 3:if(oa(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{mw(i,l)}catch(D){en(u,u.return,D)}}break;case 27:l===null&&h&4&&Aj(u);case 26:case 5:oa(i,u),l===null&&h&4&&Rj(u),h&512&&Bu(u,u.return);break;case 12:oa(i,u);break;case 31:oa(i,u),h&4&&Oj(i,u);break;case 13:oa(i,u),h&4&&Mj(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=l3.bind(null,u),_3(i,u))));break;case 22:if(h=u.memoizedState!==null||ra,!h){l=l!==null&&l.memoizedState!==null||Jn,x=ra;var w=Jn;ra=h,(Jn=l)&&!w?aa(i,u,(u.subtreeFlags&8772)!==0):oa(i,u),ra=x,Jn=w}break;case 30:break;default:oa(i,u)}}function Pj(i){var l=i.alternate;l!==null&&(i.alternate=null,Pj(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&qt(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 Rn=null,Hr=!1;function ia(i,l,u){for(u=u.child;u!==null;)Nj(i,l,u),u=u.sibling}function Nj(i,l,u){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(En,u)}catch{}switch(u.tag){case 26:Jn||ho(u,l),ia(i,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Jn||ho(u,l);var h=Rn,x=Hr;Ja(u.type)&&(Rn=u.stateNode,Hr=!1),ia(i,l,u),Ku(u.stateNode),Rn=h,Hr=x;break;case 5:Jn||ho(u,l);case 6:if(h=Rn,x=Hr,Rn=null,ia(i,l,u),Rn=h,Hr=x,Rn!==null)if(Hr)try{(Rn.nodeType===9?Rn.body:Rn.nodeName==="HTML"?Rn.ownerDocument.body:Rn).removeChild(u.stateNode)}catch(w){en(u,l,w)}else try{Rn.removeChild(u.stateNode)}catch(w){en(u,l,w)}break;case 18:Rn!==null&&(Hr?(i=Rn,EC(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),gc(i)):EC(Rn,u.stateNode));break;case 4:h=Rn,x=Hr,Rn=u.stateNode.containerInfo,Hr=!0,ia(i,l,u),Rn=h,Hr=x;break;case 0:case 11:case 14:case 15:qa(2,u,l),Jn||qa(4,u,l),ia(i,l,u);break;case 1:Jn||(ho(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&Tj(u,l,h)),ia(i,l,u);break;case 21:ia(i,l,u);break;case 22:Jn=(h=Jn)||u.memoizedState!==null,ia(i,l,u),Jn=h;break;default:ia(i,l,u)}}function Oj(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{gc(i)}catch(u){en(l,l.return,u)}}}function Mj(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{gc(i)}catch(u){en(l,l.return,u)}}function e3(i){switch(i.tag){case 31:case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new Dj),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new Dj),l;default:throw Error(r(435,i.tag))}}function uh(i,l){var u=e3(i);l.forEach(function(h){if(!u.has(h)){u.add(h);var x=c3.bind(null,i,h);h.then(x,x)}})}function qr(i,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var x=u[h],w=i,D=l,N=D;e:for(;N!==null;){switch(N.tag){case 27:if(Ja(N.type)){Rn=N.stateNode,Hr=!1;break e}break;case 5:Rn=N.stateNode,Hr=!1;break e;case 3:case 4:Rn=N.stateNode.containerInfo,Hr=!0;break e}N=N.return}if(Rn===null)throw Error(r(160));Nj(w,D,x),Rn=null,Hr=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)Lj(l,i),l=l.sibling}var Fi=null;function Lj(i,l){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:qr(l,i),Gr(i),h&4&&(qa(3,i,i.return),Uu(3,i),qa(5,i,i.return));break;case 1:qr(l,i),Gr(i),h&512&&(Jn||u===null||ho(u,u.return)),h&64&&ra&&(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 x=Fi;if(qr(l,i),Gr(i),h&512&&(Jn||u===null||ho(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,x=x.ownerDocument||x;t:switch(h){case"title":w=x.getElementsByTagName("title")[0],(!w||w[rn]||w[Me]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(h),x.head.insertBefore(w,x.querySelector("head > title"))),fr(w,h,u),w[Me]=i,Jt(w),h=w;break e;case"link":var D=LC("link","href",x).get(h+(u.href||""));if(D){for(var N=0;N<D.length;N++)if(w=D[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)){D.splice(N,1);break t}}w=x.createElement(h),fr(w,h,u),x.head.appendChild(w);break;case"meta":if(D=LC("meta","content",x).get(h+(u.content||""))){for(N=0;N<D.length;N++)if(w=D[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)){D.splice(N,1);break t}}w=x.createElement(h),fr(w,h,u),x.head.appendChild(w);break;default:throw Error(r(468,h))}w[Me]=i,Jt(w),h=w}i.stateNode=h}else IC(x,i.type,i.stateNode);else i.stateNode=MC(x,h,i.memoizedProps);else w!==h?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,h===null?IC(x,i.type,i.stateNode):MC(x,h,i.memoizedProps)):h===null&&i.stateNode!==null&&Ov(i,i.memoizedProps,u.memoizedProps)}break;case 27:qr(l,i),Gr(i),h&512&&(Jn||u===null||ho(u,u.return)),u!==null&&h&4&&Ov(i,i.memoizedProps,u.memoizedProps);break;case 5:if(qr(l,i),Gr(i),h&512&&(Jn||u===null||ho(u,u.return)),i.flags&32){x=i.stateNode;try{$l(x,"")}catch(Ge){en(i,i.return,Ge)}}h&4&&i.stateNode!=null&&(x=i.memoizedProps,Ov(i,x,u!==null?u.memoizedProps:x)),h&1024&&(Iv=!0);break;case 6:if(qr(l,i),Gr(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(Ge){en(i,i.return,Ge)}}break;case 3:if(Th=null,x=Fi,Fi=Ch(l.containerInfo),qr(l,i),Fi=x,Gr(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{gc(l.containerInfo)}catch(Ge){en(i,i.return,Ge)}Iv&&(Iv=!1,Ij(i));break;case 4:h=Fi,Fi=Ch(i.stateNode.containerInfo),qr(l,i),Gr(i),Fi=h;break;case 12:qr(l,i),Gr(i);break;case 31:qr(l,i),Gr(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,uh(i,h)));break;case 13:qr(l,i),Gr(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(fh=pe()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,uh(i,h)));break;case 22:x=i.memoizedState!==null;var q=u!==null&&u.memoizedState!==null,te=ra,fe=Jn;if(ra=te||x,Jn=fe||q,qr(l,i),Jn=fe,ra=te,Gr(i),h&8192)e:for(l=i.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(u===null||q||ra||Jn||Gs(i)),u=null,l=i;;){if(l.tag===5||l.tag===26){if(u===null){q=u=l;try{if(w=q.stateNode,x)D=w.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{N=q.stateNode;var ve=q.memoizedProps.style,re=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;N.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Ge){en(q,q.return,Ge)}}}else if(l.tag===6){if(u===null){q=l;try{q.stateNode.nodeValue=x?"":q.memoizedProps}catch(Ge){en(q,q.return,Ge)}}}else if(l.tag===18){if(u===null){q=l;try{var se=q.stateNode;x?TC(se,!0):TC(q.stateNode,!1)}catch(Ge){en(q,q.return,Ge)}}}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,uh(i,u))));break;case 19:qr(l,i),Gr(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,uh(i,h)));break;case 30:break;case 21:break;default:qr(l,i),Gr(i)}}function Gr(i){var l=i.flags;if(l&2){try{for(var u,h=i.return;h!==null;){if(_j(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var x=u.stateNode,w=Mv(i);ch(i,w,x);break;case 5:var D=u.stateNode;u.flags&32&&($l(D,""),u.flags&=-33);var N=Mv(i);ch(i,N,D);break;case 3:case 4:var q=u.stateNode.containerInfo,te=Mv(i);Lv(i,te,q);break;default:throw Error(r(161))}}catch(fe){en(i,i.return,fe)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function Ij(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;Ij(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function oa(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)kj(i,l.alternate,l),l=l.sibling}function Gs(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:qa(4,l,l.return),Gs(l);break;case 1:ho(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&Tj(l,l.return,u),Gs(l);break;case 27:Ku(l.stateNode);case 26:case 5:ho(l,l.return),Gs(l);break;case 22:l.memoizedState===null&&Gs(l);break;case 30:Gs(l);break;default:Gs(l)}i=i.sibling}}function aa(i,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,x=i,w=l,D=w.flags;switch(w.tag){case 0:case 11:case 15:aa(x,w,u),Uu(4,w);break;case 1:if(aa(x,w,u),h=w,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(te){en(h,h.return,te)}if(h=w,x=h.updateQueue,x!==null){var N=h.stateNode;try{var q=x.shared.hiddenCallbacks;if(q!==null)for(x.shared.hiddenCallbacks=null,x=0;x<q.length;x++)pw(q[x],N)}catch(te){en(h,h.return,te)}}u&&D&64&&Ej(w),Bu(w,w.return);break;case 27:Aj(w);case 26:case 5:aa(x,w,u),u&&h===null&&D&4&&Rj(w),Bu(w,w.return);break;case 12:aa(x,w,u);break;case 31:aa(x,w,u),u&&D&4&&Oj(x,w);break;case 13:aa(x,w,u),u&&D&4&&Mj(x,w);break;case 22:w.memoizedState===null&&aa(x,w,u),Bu(w,w.return);break;case 30:break;default:aa(x,w,u)}l=l.sibling}}function zv(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&&Ru(u))}function $v(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Ru(i))}function Hi(i,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)zj(i,l,u,h),l=l.sibling}function zj(i,l,u,h){var x=l.flags;switch(l.tag){case 0:case 11:case 15:Hi(i,l,u,h),x&2048&&Uu(9,l);break;case 1:Hi(i,l,u,h);break;case 3:Hi(i,l,u,h),x&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Ru(i)));break;case 12:if(x&2048){Hi(i,l,u,h),i=l.stateNode;try{var w=l.memoizedProps,D=w.id,N=w.onPostCommit;typeof N=="function"&&N(D,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){en(l,l.return,q)}}else Hi(i,l,u,h);break;case 31:Hi(i,l,u,h);break;case 13:Hi(i,l,u,h);break;case 23:break;case 22:w=l.stateNode,D=l.alternate,l.memoizedState!==null?w._visibility&2?Hi(i,l,u,h):Vu(i,l):w._visibility&2?Hi(i,l,u,h):(w._visibility|=2,oc(i,l,u,h,(l.subtreeFlags&10256)!==0||!1)),x&2048&&zv(D,l);break;case 24:Hi(i,l,u,h),x&2048&&$v(l.alternate,l);break;default:Hi(i,l,u,h)}}function oc(i,l,u,h,x){for(x=x&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var w=i,D=l,N=u,q=h,te=D.flags;switch(D.tag){case 0:case 11:case 15:oc(w,D,N,q,x),Uu(8,D);break;case 23:break;case 22:var fe=D.stateNode;D.memoizedState!==null?fe._visibility&2?oc(w,D,N,q,x):Vu(w,D):(fe._visibility|=2,oc(w,D,N,q,x)),x&&te&2048&&zv(D.alternate,D);break;case 24:oc(w,D,N,q,x),x&&te&2048&&$v(D.alternate,D);break;default:oc(w,D,N,q,x)}l=l.sibling}}function Vu(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=i,h=l,x=h.flags;switch(h.tag){case 22:Vu(u,h),x&2048&&zv(h.alternate,h);break;case 24:Vu(u,h),x&2048&&$v(h.alternate,h);break;default:Vu(u,h)}l=l.sibling}}var Fu=8192;function ac(i,l,u){if(i.subtreeFlags&Fu)for(i=i.child;i!==null;)$j(i,l,u),i=i.sibling}function $j(i,l,u){switch(i.tag){case 26:ac(i,l,u),i.flags&Fu&&i.memoizedState!==null&&U3(u,Fi,i.memoizedState,i.memoizedProps);break;case 5:ac(i,l,u);break;case 3:case 4:var h=Fi;Fi=Ch(i.stateNode.containerInfo),ac(i,l,u),Fi=h;break;case 22:i.memoizedState===null&&(h=i.alternate,h!==null&&h.memoizedState!==null?(h=Fu,Fu=16777216,ac(i,l,u),Fu=h):ac(i,l,u));break;default:ac(i,l,u)}}function Uj(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 Hu(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];or=h,Vj(h,i)}Uj(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Bj(i),i=i.sibling}function Bj(i){switch(i.tag){case 0:case 11:case 15:Hu(i),i.flags&2048&&qa(9,i,i.return);break;case 3:Hu(i);break;case 12:Hu(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,dh(i)):Hu(i);break;default:Hu(i)}}function dh(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];or=h,Vj(h,i)}Uj(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:qa(8,l,l.return),dh(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,dh(l));break;default:dh(l)}i=i.sibling}}function Vj(i,l){for(;or!==null;){var u=or;switch(u.tag){case 0:case 11:case 15:qa(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:Ru(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,or=h;else e:for(u=i;or!==null;){h=or;var x=h.sibling,w=h.return;if(Pj(h),h===u){or=null;break e}if(x!==null){x.return=w,or=x;break e}or=w}}}var t3={getCacheForType:function(i){var l=ur(Yn),u=l.data.get(i);return u===void 0&&(u=i(),l.data.set(i,u)),u},cacheSignal:function(){return ur(Yn).controller.signal}},n3=typeof WeakMap=="function"?WeakMap:Map,Gt=0,cn=null,Tt=null,Dt=0,Zt=0,ai=null,Ga=!1,sc=!1,Uv=!1,sa=0,zn=0,Qa=0,Qs=0,Bv=0,si=0,lc=0,qu=null,Qr=null,Vv=!1,fh=0,Fj=0,hh=1/0,ph=null,Wa=null,tr=0,Ya=null,cc=null,la=0,Fv=0,Hv=null,Hj=null,Gu=0,qv=null;function li(){return(Gt&2)!==0&&Dt!==0?Dt&-Dt:M.T!==null?Xv():We()}function qj(){if(si===0)if((Dt&536870912)===0||Nt){var i=lo;lo<<=1,(lo&3932160)===0&&(lo=262144),si=i}else si=536870912;return i=ii.current,i!==null&&(i.flags|=32),si}function Wr(i,l,u){(i===cn&&(Zt===2||Zt===9)||i.cancelPendingCommit!==null)&&(uc(i,0),Ka(i,Dt,si,!1)),Pa(i,u),((Gt&2)===0||i!==cn)&&(i===cn&&((Gt&2)===0&&(Qs|=u),zn===4&&Ka(i,Dt,si,!1)),po(i))}function Gj(i,l,u){if((Gt&6)!==0)throw Error(r(327));var h=!u&&(l&127)===0&&(l&i.expiredLanes)===0||ir(i,l),x=h?o3(i,l):Qv(i,l,!0),w=h;do{if(x===0){sc&&!h&&Ka(i,l,0,!1);break}else{if(u=i.current.alternate,w&&!r3(u)){x=Qv(i,l,!1),w=!1;continue}if(x===2){if(w=l,i.errorRecoveryDisabledLanes&w)var D=0;else D=i.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){l=D;e:{var N=i;x=qu;var q=N.current.memoizedState.isDehydrated;if(q&&(uc(N,D).flags|=256),D=Qv(N,D,!1),D!==2){if(Uv&&!q){N.errorRecoveryDisabledLanes|=w,Qs|=w,x=4;break e}w=Qr,Qr=x,w!==null&&(Qr===null?Qr=w:Qr.push.apply(Qr,w))}x=D}if(w=!1,x!==2)continue}}if(x===1){uc(i,0),Ka(i,l,0,!0);break}e:{switch(h=i,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ka(h,l,si,!Ga);break e;case 2:Qr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=fh+300-pe(),10<x)){if(Ka(h,l,si,!Ga),co(h,0,!0)!==0)break e;la=l,h.timeoutHandle=jC(Qj.bind(null,h,u,Qr,ph,Vv,l,si,Qs,lc,Ga,w,"Throttled",-0,0),x);break e}Qj(h,u,Qr,ph,Vv,l,si,Qs,lc,Ga,w,null,-0,0)}}break}while(!0);po(i)}function Qj(i,l,u,h,x,w,D,N,q,te,fe,ve,re,se){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:Qo},$j(l,w,ve);var Ge=(w&62914560)===w?fh-pe():(w&4194048)===w?Fj-pe():0;if(Ge=B3(ve,Ge),Ge!==null){la=w,i.cancelPendingCommit=Ge(tC.bind(null,i,l,w,u,h,x,D,N,q,fe,ve,null,re,se)),Ka(i,w,D,!te);return}}tC(i,l,w,u,h,x,D,N,q)}function r3(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 x=u[h],w=x.getSnapshot;x=x.value;try{if(!ni(w(),x))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 Ka(i,l,u,h){l&=~Bv,l&=~Qs,i.suspendedLanes|=l,i.pingedLanes&=~l,h&&(i.warmLanes|=l),h=i.expirationTimes;for(var x=l;0<x;){var w=31-Tn(x),D=1<<w;h[w]=-1,x&=~D}u!==0&&H(i,u,l)}function mh(){return(Gt&6)===0?(Qu(0),!1):!0}function Gv(){if(Tt!==null){if(Zt===0)var i=Tt.return;else i=Tt,Xo=zs=null,lv(i),ec=null,Au=0,i=Tt;for(;i!==null;)Cj(i.alternate,i),i=i.return;Tt=null}}function uc(i,l){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,j3(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),la=0,Gv(),cn=i,Tt=u=Yo(i.current,null),Dt=l,Zt=0,ai=null,Ga=!1,sc=ir(i,l),Uv=!1,lc=si=Bv=Qs=Qa=zn=0,Qr=qu=null,Vv=!1,(l&8)!==0&&(l|=l&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=l;0<h;){var x=31-Tn(h),w=1<<x;l|=i[x],h&=~w}return sa=l,Lf(),u}function Wj(i,l){bt=null,M.H=Iu,l===Zl||l===Hf?(l=uw(),Zt=3):l===Kg?(l=uw(),Zt=4):Zt=l===Cv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,ai=l,Tt===null&&(zn=1,ih(i,xi(l,i.current)))}function Yj(){var i=ii.current;return i===null?!0:(Dt&4194048)===Dt?ji===null:(Dt&62914560)===Dt||(Dt&536870912)!==0?i===ji:!1}function Kj(){var i=M.H;return M.H=Iu,i===null?Iu:i}function Xj(){var i=M.A;return M.A=t3,i}function gh(){zn=4,Ga||(Dt&4194048)!==Dt&&ii.current!==null||(sc=!0),(Qa&134217727)===0&&(Qs&134217727)===0||cn===null||Ka(cn,Dt,si,!1)}function Qv(i,l,u){var h=Gt;Gt|=2;var x=Kj(),w=Xj();(cn!==i||Dt!==l)&&(ph=null,uc(i,l)),l=!1;var D=zn;e:do try{if(Zt!==0&&Tt!==null){var N=Tt,q=ai;switch(Zt){case 8:Gv(),D=6;break e;case 3:case 2:case 9:case 6:ii.current===null&&(l=!0);var te=Zt;if(Zt=0,ai=null,dc(i,N,q,te),u&&sc){D=0;break e}break;default:te=Zt,Zt=0,ai=null,dc(i,N,q,te)}}i3(),D=zn;break}catch(fe){Wj(i,fe)}while(!0);return l&&i.shellSuspendCounter++,Xo=zs=null,Gt=h,M.H=x,M.A=w,Tt===null&&(cn=null,Dt=0,Lf()),D}function i3(){for(;Tt!==null;)Jj(Tt)}function o3(i,l){var u=Gt;Gt|=2;var h=Kj(),x=Xj();cn!==i||Dt!==l?(ph=null,hh=pe()+500,uc(i,l)):sc=ir(i,l);e:do try{if(Zt!==0&&Tt!==null){l=Tt;var w=ai;t:switch(Zt){case 1:Zt=0,ai=null,dc(i,l,w,1);break;case 2:case 9:if(lw(w)){Zt=0,ai=null,Zj(l);break}l=function(){Zt!==2&&Zt!==9||cn!==i||(Zt=7),po(i)},w.then(l,l);break e;case 3:Zt=7;break e;case 4:Zt=5;break e;case 7:lw(w)?(Zt=0,ai=null,Zj(l)):(Zt=0,ai=null,dc(i,l,w,7));break;case 5:var D=null;switch(Tt.tag){case 26:D=Tt.memoizedState;case 5:case 27:var N=Tt;if(D?zC(D):N.stateNode.complete){Zt=0,ai=null;var q=N.sibling;if(q!==null)Tt=q;else{var te=N.return;te!==null?(Tt=te,vh(te)):Tt=null}break t}}Zt=0,ai=null,dc(i,l,w,5);break;case 6:Zt=0,ai=null,dc(i,l,w,6);break;case 8:Gv(),zn=6;break e;default:throw Error(r(462))}}a3();break}catch(fe){Wj(i,fe)}while(!0);return Xo=zs=null,M.H=h,M.A=x,Gt=u,Tt!==null?0:(cn=null,Dt=0,Lf(),zn)}function a3(){for(;Tt!==null&&!tt();)Jj(Tt)}function Jj(i){var l=wj(i.alternate,i,sa);i.memoizedProps=i.pendingProps,l===null?vh(i):Tt=l}function Zj(i){var l=i,u=l.alternate;switch(l.tag){case 15:case 0:l=gj(u,l,l.pendingProps,l.type,void 0,Dt);break;case 11:l=gj(u,l,l.pendingProps,l.type.render,l.ref,Dt);break;case 5:lv(l);default:Cj(u,l),l=Tt=X1(l,sa),l=wj(u,l,sa)}i.memoizedProps=i.pendingProps,l===null?vh(i):Tt=l}function dc(i,l,u,h){Xo=zs=null,lv(l),ec=null,Au=0;var x=l.return;try{if(WO(i,x,l,u,Dt)){zn=1,ih(i,xi(u,i.current)),Tt=null;return}}catch(w){if(x!==null)throw Tt=x,w;zn=1,ih(i,xi(u,i.current)),Tt=null;return}l.flags&32768?(Nt||h===1?i=!0:sc||(Dt&536870912)!==0?i=!1:(Ga=i=!0,(h===2||h===9||h===3||h===6)&&(h=ii.current,h!==null&&h.tag===13&&(h.flags|=16384))),eC(l,i)):vh(l)}function vh(i){var l=i;do{if((l.flags&32768)!==0){eC(l,Ga);return}i=l.return;var u=XO(l.alternate,l,sa);if(u!==null){Tt=u;return}if(l=l.sibling,l!==null){Tt=l;return}Tt=l=i}while(l!==null);zn===0&&(zn=5)}function eC(i,l){do{var u=JO(i.alternate,i);if(u!==null){u.flags&=32767,Tt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(i=i.sibling,i!==null)){Tt=i;return}Tt=i=u}while(i!==null);zn=6,Tt=null}function tC(i,l,u,h,x,w,D,N,q){i.cancelPendingCommit=null;do yh();while(tr!==0);if((Gt&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=Mg,mu(i,u,w,D,N,q),i===cn&&(Tt=cn=null,Dt=0),cc=l,Ya=i,la=u,Fv=w,Hv=x,Hj=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,u3(_t,function(){return aC(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=M.T,M.T=null,x=L.p,L.p=2,D=Gt,Gt|=4;try{ZO(i,l,u)}finally{Gt=D,L.p=x,M.T=h}}tr=1,nC(),rC(),iC()}}function nC(){if(tr===1){tr=0;var i=Ya,l=cc,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 x=Gt;Gt|=4;try{Lj(l,i);var w=oy,D=V1(i.containerInfo),N=w.focusedElem,q=w.selectionRange;if(D!==N&&N&&N.ownerDocument&&B1(N.ownerDocument.documentElement,N)){if(q!==null&&Dg(N)){var te=q.start,fe=q.end;if(fe===void 0&&(fe=te),"selectionStart"in N)N.selectionStart=te,N.selectionEnd=Math.min(fe,N.value.length);else{var ve=N.ownerDocument||document,re=ve&&ve.defaultView||window;if(re.getSelection){var se=re.getSelection(),Ge=N.textContent.length,ut=Math.min(q.start,Ge),sn=q.end===void 0?ut:Math.min(q.end,Ge);!se.extend&&ut>sn&&(D=sn,sn=ut,ut=D);var X=U1(N,ut),G=U1(N,sn);if(X&&G&&(se.rangeCount!==1||se.anchorNode!==X.node||se.anchorOffset!==X.offset||se.focusNode!==G.node||se.focusOffset!==G.offset)){var ee=ve.createRange();ee.setStart(X.node,X.offset),se.removeAllRanges(),ut>sn?(se.addRange(ee),se.extend(G.node,G.offset)):(ee.setEnd(G.node,G.offset),se.addRange(ee))}}}}for(ve=[],se=N;se=se.parentNode;)se.nodeType===1&&ve.push({element:se,left:se.scrollLeft,top:se.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}}Dh=!!iy,oy=iy=null}finally{Gt=x,L.p=h,M.T=u}}i.current=l,tr=2}}function rC(){if(tr===2){tr=0;var i=Ya,l=cc,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 x=Gt;Gt|=4;try{kj(i,l.alternate,l)}finally{Gt=x,L.p=h,M.T=u}}tr=3}}function iC(){if(tr===4||tr===3){tr=0,lt();var i=Ya,l=cc,u=la,h=Hj;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?tr=5:(tr=0,cc=Ya=null,oC(i,i.pendingLanes));var x=i.pendingLanes;if(x===0&&(Wa=null),ke(u),l=l.stateNode,Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(En,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=M.T,x=L.p,L.p=2,M.T=null;try{for(var w=i.onRecoverableError,D=0;D<h.length;D++){var N=h[D];w(N.value,{componentStack:N.stack})}}finally{M.T=l,L.p=x}}(la&3)!==0&&yh(),po(i),x=i.pendingLanes,(u&261930)!==0&&(x&42)!==0?i===qv?Gu++:(Gu=0,qv=i):Gu=0,Qu(0)}}function oC(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Ru(l)))}function yh(){return nC(),rC(),iC(),aC()}function aC(){if(tr!==5)return!1;var i=Ya,l=Fv;Fv=0;var u=ke(la),h=M.T,x=L.p;try{L.p=32>u?32:u,M.T=null,u=Hv,Hv=null;var w=Ya,D=la;if(tr=0,cc=Ya=null,la=0,(Gt&6)!==0)throw Error(r(331));var N=Gt;if(Gt|=4,Bj(w.current),zj(w,w.current,D,u),Gt=N,Qu(0,!1),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(En,w)}catch{}return!0}finally{L.p=x,M.T=h,oC(i,l)}}function sC(i,l,u){l=xi(u,l),l=jv(i.stateNode,l,2),i=Va(i,l,2),i!==null&&(Pa(i,2),po(i))}function en(i,l,u){if(i.tag===3)sC(i,i,u);else for(;l!==null;){if(l.tag===3){sC(l,i,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Wa===null||!Wa.has(h))){i=xi(u,i),u=lj(2),h=Va(l,u,2),h!==null&&(cj(u,h,l,i),Pa(h,2),po(h));break}}l=l.return}}function Wv(i,l,u){var h=i.pingCache;if(h===null){h=i.pingCache=new n3;var x=new Set;h.set(l,x)}else x=h.get(l),x===void 0&&(x=new Set,h.set(l,x));x.has(u)||(Uv=!0,x.add(u),i=s3.bind(null,i,l,u),l.then(i,i))}function s3(i,l,u){var h=i.pingCache;h!==null&&h.delete(l),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,cn===i&&(Dt&u)===u&&(zn===4||zn===3&&(Dt&62914560)===Dt&&300>pe()-fh?(Gt&2)===0&&uc(i,0):Bv|=u,lc===Dt&&(lc=0)),po(i)}function lC(i,l){l===0&&(l=Fn()),i=Ms(i,l),i!==null&&(Pa(i,l),po(i))}function l3(i){var l=i.memoizedState,u=0;l!==null&&(u=l.retryLane),lC(i,u)}function c3(i,l){var u=0;switch(i.tag){case 31:case 13:var h=i.stateNode,x=i.memoizedState;x!==null&&(u=x.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),lC(i,u)}function u3(i,l){return Oe(i,l)}var xh=null,fc=null,Yv=!1,bh=!1,Kv=!1,Xa=0;function po(i){i!==fc&&i.next===null&&(fc===null?xh=fc=i:fc=fc.next=i),bh=!0,Yv||(Yv=!0,f3())}function Qu(i,l){if(!Kv&&bh){Kv=!0;do for(var u=!1,h=xh;h!==null;){if(i!==0){var x=h.pendingLanes;if(x===0)var w=0;else{var D=h.suspendedLanes,N=h.pingedLanes;w=(1<<31-Tn(42|i)+1)-1,w&=x&~(D&~N),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,fC(h,w))}else w=Dt,w=co(h,h===cn?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||ir(h,w)||(u=!0,fC(h,w));h=h.next}while(u);Kv=!1}}function d3(){cC()}function cC(){bh=Yv=!1;var i=0;Xa!==0&&w3()&&(i=Xa);for(var l=pe(),u=null,h=xh;h!==null;){var x=h.next,w=uC(h,l);w===0?(h.next=null,u===null?xh=x:u.next=x,x===null&&(fc=u)):(u=h,(i!==0||(w&3)!==0)&&(bh=!0)),h=x}tr!==0&&tr!==5||Qu(i),Xa!==0&&(Xa=0)}function uC(i,l){for(var u=i.suspendedLanes,h=i.pingedLanes,x=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var D=31-Tn(w),N=1<<D,q=x[D];q===-1?((N&u)===0||(N&h)!==0)&&(x[D]=Go(N,l)):q<=l&&(i.expiredLanes|=N),w&=~N}if(l=cn,u=Dt,u=co(i,i===l?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===l&&(Zt===2||Zt===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&ct(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||ir(i,u)){if(l=u&-u,l===i.callbackPriority)return l;switch(h!==null&&ct(h),ke(u)){case 2:case 8:u=Ae;break;case 32:u=_t;break;case 268435456:u=vn;break;default:u=_t}return h=dC.bind(null,i),u=Oe(u,h),i.callbackPriority=l,i.callbackNode=u,l}return h!==null&&h!==null&&ct(h),i.callbackPriority=2,i.callbackNode=null,2}function dC(i,l){if(tr!==0&&tr!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(yh()&&i.callbackNode!==u)return null;var h=Dt;return h=co(i,i===cn?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(Gj(i,h,l),uC(i,pe()),i.callbackNode!=null&&i.callbackNode===u?dC.bind(null,i):null)}function fC(i,l){if(yh())return null;Gj(i,l,!0)}function f3(){C3(function(){(Gt&6)!==0?Oe(je,d3):cC()})}function Xv(){if(Xa===0){var i=Xl;i===0&&(i=mi,mi<<=1,(mi&261888)===0&&(mi=256)),Xa=i}return Xa}function hC(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:_f(""+i)}function pC(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 h3(i,l,u,h,x){if(l==="submit"&&u&&u.stateNode===x){var w=hC((x[Ve]||null).action),D=h.submitter;D&&(l=(l=D[Ve]||null)?hC(l.formAction):D.getAttribute("formAction"),l!==null&&(w=l,D=null));var N=new Pf("action","action",null,h,x);i.push({event:N,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Xa!==0){var q=D?pC(x,D):new FormData(x);vv(u,{pending:!0,data:q,method:x.method,action:w},null,q)}}else typeof w=="function"&&(N.preventDefault(),q=D?pC(x,D):new FormData(x),vv(u,{pending:!0,data:q,method:x.method,action:w},w,q))},currentTarget:x}]})}}for(var Jv=0;Jv<Og.length;Jv++){var Zv=Og[Jv],p3=Zv.toLowerCase(),m3=Zv[0].toUpperCase()+Zv.slice(1);Vi(p3,"on"+m3)}Vi(q1,"onAnimationEnd"),Vi(G1,"onAnimationIteration"),Vi(Q1,"onAnimationStart"),Vi("dblclick","onDoubleClick"),Vi("focusin","onFocus"),Vi("focusout","onBlur"),Vi(kO,"onTransitionRun"),Vi(PO,"onTransitionStart"),Vi(NO,"onTransitionCancel"),Vi(W1,"onTransitionEnd"),Bi("onMouseEnter",["mouseout","mouseover"]),Bi("onMouseLeave",["mouseout","mouseover"]),Bi("onPointerEnter",["pointerout","pointerover"]),Bi("onPointerLeave",["pointerout","pointerover"]),Rr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Rr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Rr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Rr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Rr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Rr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wu="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(" "),g3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wu));function mC(i,l){l=(l&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],x=h.event;h=h.listeners;e:{var w=void 0;if(l)for(var D=h.length-1;0<=D;D--){var N=h[D],q=N.instance,te=N.currentTarget;if(N=N.listener,q!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=te;try{w(x)}catch(fe){Mf(fe)}x.currentTarget=null,w=q}else for(D=0;D<h.length;D++){if(N=h[D],q=N.instance,te=N.currentTarget,N=N.listener,q!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=te;try{w(x)}catch(fe){Mf(fe)}x.currentTarget=null,w=q}}}}function Rt(i,l){var u=l[et];u===void 0&&(u=l[et]=new Set);var h=i+"__bubble";u.has(h)||(gC(l,i,2,!1),u.add(h))}function ey(i,l,u){var h=0;l&&(h|=4),gC(u,i,h,l)}var Sh="_reactListening"+Math.random().toString(36).slice(2);function ty(i){if(!i[Sh]){i[Sh]=!0,Ll.forEach(function(u){u!=="selectionchange"&&(g3.has(u)||ey(u,!1,i),ey(u,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Sh]||(l[Sh]=!0,ey("selectionchange",!1,l))}}function gC(i,l,u,h){switch(qC(l)){case 2:var x=H3;break;case 8:x=q3;break;default:x=gy}u=x.bind(null,l,u,i),x=void 0,!Sg||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),h?x!==void 0?i.addEventListener(l,u,{capture:!0,passive:x}):i.addEventListener(l,u,!0):x!==void 0?i.addEventListener(l,u,{passive:x}):i.addEventListener(l,u,!1)}function ny(i,l,u,h,x){var w=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var D=h.tag;if(D===3||D===4){var N=h.stateNode.containerInfo;if(N===x)break;if(D===4)for(D=h.return;D!==null;){var q=D.tag;if((q===3||q===4)&&D.stateNode.containerInfo===x)return;D=D.return}for(;N!==null;){if(D=zt(N),D===null)return;if(q=D.tag,q===5||q===6||q===26||q===27){h=w=D;continue e}N=N.parentNode}}h=h.return}S1(function(){var te=w,fe=xg(u),ve=[];e:{var re=Y1.get(i);if(re!==void 0){var se=Pf,Ge=i;switch(i){case"keypress":if(Df(u)===0)break e;case"keydown":case"keyup":se=cO;break;case"focusin":Ge="focus",se=Eg;break;case"focusout":Ge="blur",se=Eg;break;case"beforeblur":case"afterblur":se=Eg;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":se=C1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=XN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=fO;break;case q1:case G1:case Q1:se=eO;break;case W1:se=pO;break;case"scroll":case"scrollend":se=YN;break;case"wheel":se=gO;break;case"copy":case"cut":case"paste":se=nO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=T1;break;case"toggle":case"beforetoggle":se=yO}var ut=(l&4)!==0,sn=!ut&&(i==="scroll"||i==="scrollend"),X=ut?re!==null?re+"Capture":null:re;ut=[];for(var G=te,ee;G!==null;){var me=G;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||X===null||(me=gu(G,X),me!=null&&ut.push(Yu(G,me,ee))),sn)break;G=G.return}0<ut.length&&(re=new se(re,Ge,null,u,fe),ve.push({event:re,listeners:ut}))}}if((l&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",se=i==="mouseout"||i==="pointerout",re&&u!==yg&&(Ge=u.relatedTarget||u.fromElement)&&(zt(Ge)||Ge[Ke]))break e;if((se||re)&&(re=fe.window===fe?fe:(re=fe.ownerDocument)?re.defaultView||re.parentWindow:window,se?(Ge=u.relatedTarget||u.toElement,se=te,Ge=Ge?zt(Ge):null,Ge!==null&&(sn=s(Ge),ut=Ge.tag,Ge!==sn||ut!==5&&ut!==27&&ut!==6)&&(Ge=null)):(se=null,Ge=te),se!==Ge)){if(ut=C1,me="onMouseLeave",X="onMouseEnter",G="mouse",(i==="pointerout"||i==="pointerover")&&(ut=T1,me="onPointerLeave",X="onPointerEnter",G="pointer"),sn=se==null?re:Ui(se),ee=Ge==null?re:Ui(Ge),re=new ut(me,G+"leave",se,u,fe),re.target=sn,re.relatedTarget=ee,me=null,zt(fe)===te&&(ut=new ut(X,G+"enter",Ge,u,fe),ut.target=ee,ut.relatedTarget=sn,me=ut),sn=me,se&&Ge)t:{for(ut=v3,X=se,G=Ge,ee=0,me=X;me;me=ut(me))ee++;me=0;for(var rt=G;rt;rt=ut(rt))me++;for(;0<ee-me;)X=ut(X),ee--;for(;0<me-ee;)G=ut(G),me--;for(;ee--;){if(X===G||G!==null&&X===G.alternate){ut=X;break t}X=ut(X),G=ut(G)}ut=null}else ut=null;se!==null&&vC(ve,re,se,ut,!1),Ge!==null&&sn!==null&&vC(ve,sn,Ge,ut,!0)}}e:{if(re=te?Ui(te):window,se=re.nodeName&&re.nodeName.toLowerCase(),se==="select"||se==="input"&&re.type==="file")var Bt=O1;else if(P1(re))if(M1)Bt=_O;else{Bt=TO;var Je=EO}else se=re.nodeName,!se||se.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?te&&vg(te.elementType)&&(Bt=O1):Bt=RO;if(Bt&&(Bt=Bt(i,te))){N1(ve,Bt,u,fe);break e}Je&&Je(i,re,te),i==="focusout"&&te&&re.type==="number"&&te.memoizedProps.value!=null&&gg(re,"number",re.value)}switch(Je=te?Ui(te):window,i){case"focusin":(P1(Je)||Je.contentEditable==="true")&&(Fl=Je,kg=te,Cu=null);break;case"focusout":Cu=kg=Fl=null;break;case"mousedown":Pg=!0;break;case"contextmenu":case"mouseup":case"dragend":Pg=!1,F1(ve,u,fe);break;case"selectionchange":if(DO)break;case"keydown":case"keyup":F1(ve,u,fe)}var wt;if(Rg)e:{switch(i){case"compositionstart":var kt="onCompositionStart";break e;case"compositionend":kt="onCompositionEnd";break e;case"compositionupdate":kt="onCompositionUpdate";break e}kt=void 0}else Vl?D1(i,u)&&(kt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(kt="onCompositionStart");kt&&(R1&&u.locale!=="ko"&&(Vl||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Vl&&(wt=w1()):(Ma=fe,wg="value"in Ma?Ma.value:Ma.textContent,Vl=!0)),Je=wh(te,kt),0<Je.length&&(kt=new E1(kt,i,null,u,fe),ve.push({event:kt,listeners:Je}),wt?kt.data=wt:(wt=k1(u),wt!==null&&(kt.data=wt)))),(wt=bO?SO(i,u):wO(i,u))&&(kt=wh(te,"onBeforeInput"),0<kt.length&&(Je=new E1("onBeforeInput","beforeinput",null,u,fe),ve.push({event:Je,listeners:kt}),Je.data=wt)),h3(ve,i,te,u,fe)}mC(ve,l)})}function Yu(i,l,u){return{instance:i,listener:l,currentTarget:u}}function wh(i,l){for(var u=l+"Capture",h=[];i!==null;){var x=i,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=gu(i,u),x!=null&&h.unshift(Yu(i,x,w)),x=gu(i,l),x!=null&&h.push(Yu(i,x,w))),i.tag===3)return h;i=i.return}return[]}function v3(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function vC(i,l,u,h,x){for(var w=l._reactName,D=[];u!==null&&u!==h;){var N=u,q=N.alternate,te=N.stateNode;if(N=N.tag,q!==null&&q===h)break;N!==5&&N!==26&&N!==27||te===null||(q=te,x?(te=gu(u,w),te!=null&&D.unshift(Yu(u,te,q))):x||(te=gu(u,w),te!=null&&D.push(Yu(u,te,q)))),u=u.return}D.length!==0&&i.push({event:l,listeners:D})}var y3=/\r\n?/g,x3=/\u0000|\uFFFD/g;function yC(i){return(typeof i=="string"?i:""+i).replace(y3,`
|
|
242
|
-
`).replace(x3,"")}function xC(i,l){return l=yC(l),yC(i)===l}function an(i,l,u,h,x,w){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||$l(i,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&$l(i,""+h);break;case"className":ln(i,"class",h);break;case"tabIndex":ln(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ln(i,u,h);break;case"style":x1(i,h,w);break;case"data":if(l!=="object"){ln(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"&&an(i,l,"name",x.name,x,null),an(i,l,"formEncType",x.formEncType,x,null),an(i,l,"formMethod",x.formMethod,x,null),an(i,l,"formTarget",x.formTarget,x,null)):(an(i,l,"encType",x.encType,x,null),an(i,l,"method",x.method,x,null),an(i,l,"target",x.target,x,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=Qo);break;case"onScroll":h!=null&&Rt("scroll",i);break;case"onScrollEnd":h!=null&&Rt("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(x.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":Rt("beforetoggle",i),Rt("toggle",i),gi(i,"popover",h);break;case"xlinkActuate":Vr(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Vr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Vr(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Vr(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Vr(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Vr(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Vr(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Vr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Vr(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":gi(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=QN.get(u)||u,gi(i,u,h))}}function ry(i,l,u,h,x,w){switch(u){case"style":x1(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(x.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof h=="string"?$l(i,h):(typeof h=="number"||typeof h=="bigint")&&$l(i,""+h);break;case"onScroll":h!=null&&Rt("scroll",i);break;case"onScrollEnd":h!=null&&Rt("scrollend",i);break;case"onClick":h!=null&&(i.onclick=Qo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Na.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),l=u.slice(2,x?u.length-7:void 0),w=i[Ve]||null,w=w!=null?w[u]:null,typeof w=="function"&&i.removeEventListener(l,w,x),typeof h=="function")){typeof w!="function"&&w!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(l,h,x);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):gi(i,u,h)}}}function fr(i,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",i),Rt("load",i);var h=!1,x=!1,w;for(w in u)if(u.hasOwnProperty(w)){var D=u[w];if(D!=null)switch(w){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:an(i,l,w,D,u,null)}}x&&an(i,l,"srcSet",u.srcSet,u,null),h&&an(i,l,"src",u.src,u,null);return;case"input":Rt("invalid",i);var N=w=D=x=null,q=null,te=null;for(h in u)if(u.hasOwnProperty(h)){var fe=u[h];if(fe!=null)switch(h){case"name":x=fe;break;case"type":D=fe;break;case"checked":q=fe;break;case"defaultChecked":te=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:an(i,l,h,fe,u,null)}}m1(i,w,N,q,te,D,x,!1);return;case"select":Rt("invalid",i),h=D=w=null;for(x in u)if(u.hasOwnProperty(x)&&(N=u[x],N!=null))switch(x){case"value":w=N;break;case"defaultValue":D=N;break;case"multiple":h=N;default:an(i,l,x,N,u,null)}l=w,u=D,i.multiple=!!h,l!=null?zl(i,!!h,l,!1):u!=null&&zl(i,!!h,u,!0);return;case"textarea":Rt("invalid",i),w=x=h=null;for(D in u)if(u.hasOwnProperty(D)&&(N=u[D],N!=null))switch(D){case"value":h=N;break;case"defaultValue":x=N;break;case"children":w=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:an(i,l,D,N,u,null)}v1(i,h,x,w);return;case"option":for(q in u)if(u.hasOwnProperty(q)&&(h=u[q],h!=null))switch(q){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:an(i,l,q,h,u,null)}return;case"dialog":Rt("beforetoggle",i),Rt("toggle",i),Rt("cancel",i),Rt("close",i);break;case"iframe":case"object":Rt("load",i);break;case"video":case"audio":for(h=0;h<Wu.length;h++)Rt(Wu[h],i);break;case"image":Rt("error",i),Rt("load",i);break;case"details":Rt("toggle",i);break;case"embed":case"source":case"link":Rt("error",i),Rt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(h=u[te],h!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:an(i,l,te,h,u,null)}return;default:if(vg(l)){for(fe in u)u.hasOwnProperty(fe)&&(h=u[fe],h!==void 0&&ry(i,l,fe,h,u,void 0));return}}for(N in u)u.hasOwnProperty(N)&&(h=u[N],h!=null&&an(i,l,N,h,u,null))}function b3(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 x=null,w=null,D=null,N=null,q=null,te=null,fe=null;for(se in u){var ve=u[se];if(u.hasOwnProperty(se)&&ve!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":q=ve;default:h.hasOwnProperty(se)||an(i,l,se,null,h,ve)}}for(var re in h){var se=h[re];if(ve=u[re],h.hasOwnProperty(re)&&(se!=null||ve!=null))switch(re){case"type":w=se;break;case"name":x=se;break;case"checked":te=se;break;case"defaultChecked":fe=se;break;case"value":D=se;break;case"defaultValue":N=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,l));break;default:se!==ve&&an(i,l,re,se,h,ve)}}mg(i,D,N,q,te,fe,w,x);return;case"select":se=D=N=re=null;for(w in u)if(q=u[w],u.hasOwnProperty(w)&&q!=null)switch(w){case"value":break;case"multiple":se=q;default:h.hasOwnProperty(w)||an(i,l,w,null,h,q)}for(x in h)if(w=h[x],q=u[x],h.hasOwnProperty(x)&&(w!=null||q!=null))switch(x){case"value":re=w;break;case"defaultValue":N=w;break;case"multiple":D=w;default:w!==q&&an(i,l,x,w,h,q)}l=N,u=D,h=se,re!=null?zl(i,!!u,re,!1):!!h!=!!u&&(l!=null?zl(i,!!u,l,!0):zl(i,!!u,u?[]:"",!1));return;case"textarea":se=re=null;for(N in u)if(x=u[N],u.hasOwnProperty(N)&&x!=null&&!h.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:an(i,l,N,null,h,x)}for(D in h)if(x=h[D],w=u[D],h.hasOwnProperty(D)&&(x!=null||w!=null))switch(D){case"value":re=x;break;case"defaultValue":se=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&an(i,l,D,x,h,w)}g1(i,re,se);return;case"option":for(var Ge in u)if(re=u[Ge],u.hasOwnProperty(Ge)&&re!=null&&!h.hasOwnProperty(Ge))switch(Ge){case"selected":i.selected=!1;break;default:an(i,l,Ge,null,h,re)}for(q in h)if(re=h[q],se=u[q],h.hasOwnProperty(q)&&re!==se&&(re!=null||se!=null))switch(q){case"selected":i.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:an(i,l,q,re,h,se)}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 ut in u)re=u[ut],u.hasOwnProperty(ut)&&re!=null&&!h.hasOwnProperty(ut)&&an(i,l,ut,null,h,re);for(te in h)if(re=h[te],se=u[te],h.hasOwnProperty(te)&&re!==se&&(re!=null||se!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,l));break;default:an(i,l,te,re,h,se)}return;default:if(vg(l)){for(var sn in u)re=u[sn],u.hasOwnProperty(sn)&&re!==void 0&&!h.hasOwnProperty(sn)&&ry(i,l,sn,void 0,h,re);for(fe in h)re=h[fe],se=u[fe],!h.hasOwnProperty(fe)||re===se||re===void 0&&se===void 0||ry(i,l,fe,re,h,se);return}}for(var X in u)re=u[X],u.hasOwnProperty(X)&&re!=null&&!h.hasOwnProperty(X)&&an(i,l,X,null,h,re);for(ve in h)re=h[ve],se=u[ve],!h.hasOwnProperty(ve)||re===se||re==null&&se==null||an(i,l,ve,re,h,se)}function bC(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function S3(){if(typeof performance.getEntriesByType=="function"){for(var i=0,l=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var x=u[h],w=x.transferSize,D=x.initiatorType,N=x.duration;if(w&&N&&bC(D)){for(D=0,N=x.responseEnd,h+=1;h<u.length;h++){var q=u[h],te=q.startTime;if(te>N)break;var fe=q.transferSize,ve=q.initiatorType;fe&&bC(ve)&&(q=q.responseEnd,D+=fe*(q<N?1:(N-te)/(q-te)))}if(--h,l+=8*(w+D)/(x.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 iy=null,oy=null;function jh(i){return i.nodeType===9?i:i.ownerDocument}function SC(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 wC(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 ay(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 sy=null;function w3(){var i=window.event;return i&&i.type==="popstate"?i===sy?!1:(sy=i,!0):(sy=null,!1)}var jC=typeof setTimeout=="function"?setTimeout:void 0,j3=typeof clearTimeout=="function"?clearTimeout:void 0,CC=typeof Promise=="function"?Promise:void 0,C3=typeof queueMicrotask=="function"?queueMicrotask:typeof CC<"u"?function(i){return CC.resolve(null).then(i).catch(E3)}:jC;function E3(i){setTimeout(function(){throw i})}function Ja(i){return i==="head"}function EC(i,l){var u=l,h=0;do{var x=u.nextSibling;if(i.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(h===0){i.removeChild(x),gc(l);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Ku(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Ku(u);for(var w=u.firstChild;w;){var D=w.nextSibling,N=w.nodeName;w[rn]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=D}}else u==="body"&&Ku(i.ownerDocument.body);u=x}while(u);gc(l)}function TC(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 ly(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":ly(u),qt(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function T3(i,l,u,h){for(;i.nodeType===1;){var x=u;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[rn])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(w=i.getAttribute("rel"),w==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(w!==x.rel||i.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||i.getAttribute("title")!==(x.title==null?null:x.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(x.src==null?null:x.src)||i.getAttribute("type")!==(x.type==null?null:x.type)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=Ci(i.nextSibling),i===null)break}return null}function R3(i,l,u){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Ci(i.nextSibling),i===null))return null;return i}function RC(i,l){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Ci(i.nextSibling),i===null))return null;return i}function cy(i){return i.data==="$?"||i.data==="$~"}function uy(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function _3(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 Ci(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 dy=null;function _C(i){i=i.nextSibling;for(var l=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(l===0)return Ci(i.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}i=i.nextSibling}return null}function AC(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 DC(i,l,u){switch(l=jh(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 Ku(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);qt(i)}var Ei=new Map,kC=new Set;function Ch(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var ca=L.d;L.d={f:A3,r:D3,D:k3,C:P3,L:N3,m:O3,X:L3,S:M3,M:I3};function A3(){var i=ca.f(),l=mh();return i||l}function D3(i){var l=Br(i);l!==null&&l.tag===5&&l.type==="form"?Ww(l):ca.r(i)}var hc=typeof document>"u"?null:document;function PC(i,l,u){var h=hc;if(h&&typeof l=="string"&&l){var x=vi(l);x='link[rel="'+i+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),kC.has(x)||(kC.add(x),i={rel:i,crossOrigin:u,href:l},h.querySelector(x)===null&&(l=h.createElement("link"),fr(l,"link",i),Jt(l),h.head.appendChild(l)))}}function k3(i){ca.D(i),PC("dns-prefetch",i,null)}function P3(i,l){ca.C(i,l),PC("preconnect",i,l)}function N3(i,l,u){ca.L(i,l,u);var h=hc;if(h&&i&&l){var x='link[rel="preload"][as="'+vi(l)+'"]';l==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+vi(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+vi(u.imageSizes)+'"]')):x+='[href="'+vi(i)+'"]';var w=x;switch(l){case"style":w=pc(i);break;case"script":w=mc(i)}Ei.has(w)||(i=g({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:i,as:l},u),Ei.set(w,i),h.querySelector(x)!==null||l==="style"&&h.querySelector(Xu(w))||l==="script"&&h.querySelector(Ju(w))||(l=h.createElement("link"),fr(l,"link",i),Jt(l),h.head.appendChild(l)))}}function O3(i,l){ca.m(i,l);var u=hc;if(u&&i){var h=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+vi(h)+'"][href="'+vi(i)+'"]',w=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=mc(i)}if(!Ei.has(w)&&(i=g({rel:"modulepreload",href:i},l),Ei.set(w,i),u.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ju(w)))return}h=u.createElement("link"),fr(h,"link",i),Jt(h),u.head.appendChild(h)}}}function M3(i,l,u){ca.S(i,l,u);var h=hc;if(h&&i){var x=Tr(h).hoistableStyles,w=pc(i);l=l||"default";var D=x.get(w);if(!D){var N={loading:0,preload:null};if(D=h.querySelector(Xu(w)))N.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":l},u),(u=Ei.get(w))&&fy(i,u);var q=D=h.createElement("link");Jt(q),fr(q,"link",i),q._p=new Promise(function(te,fe){q.onload=te,q.onerror=fe}),q.addEventListener("load",function(){N.loading|=1}),q.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Eh(D,l,h)}D={type:"stylesheet",instance:D,count:1,state:N},x.set(w,D)}}}function L3(i,l){ca.X(i,l);var u=hc;if(u&&i){var h=Tr(u).hoistableScripts,x=mc(i),w=h.get(x);w||(w=u.querySelector(Ju(x)),w||(i=g({src:i,async:!0},l),(l=Ei.get(x))&&hy(i,l),w=u.createElement("script"),Jt(w),fr(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function I3(i,l){ca.M(i,l);var u=hc;if(u&&i){var h=Tr(u).hoistableScripts,x=mc(i),w=h.get(x);w||(w=u.querySelector(Ju(x)),w||(i=g({src:i,async:!0,type:"module"},l),(l=Ei.get(x))&&hy(i,l),w=u.createElement("script"),Jt(w),fr(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function NC(i,l,u,h){var x=(x=we.current)?Ch(x):null;if(!x)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=pc(u.href),u=Tr(x).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=pc(u.href);var w=Tr(x).hoistableStyles,D=w.get(i);if(D||(x=x.ownerDocument||x,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,D),(w=x.querySelector(Xu(i)))&&!w._p&&(D.instance=w,D.state.loading=5),Ei.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},Ei.set(i,u),w||z3(x,i,u,D.state))),l&&h===null)throw Error(r(528,""));return D}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=mc(u),u=Tr(x).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 pc(i){return'href="'+vi(i)+'"'}function Xu(i){return'link[rel="stylesheet"]['+i+"]"}function OC(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function z3(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}),fr(l,"link",u),Jt(l),i.head.appendChild(l))}function mc(i){return'[src="'+vi(i)+'"]'}function Ju(i){return"script[async]"+i}function MC(i,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=i.querySelector('style[data-href~="'+vi(u.href)+'"]');if(h)return l.instance=h,Jt(h),h;var x=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),Jt(h),fr(h,"style",x),Eh(h,u.precedence,i),l.instance=h;case"stylesheet":x=pc(u.href);var w=i.querySelector(Xu(x));if(w)return l.state.loading|=4,l.instance=w,Jt(w),w;h=OC(u),(x=Ei.get(x))&&fy(h,x),w=(i.ownerDocument||i).createElement("link"),Jt(w);var D=w;return D._p=new Promise(function(N,q){D.onload=N,D.onerror=q}),fr(w,"link",h),l.state.loading|=4,Eh(w,u.precedence,i),l.instance=w;case"script":return w=mc(u.src),(x=i.querySelector(Ju(w)))?(l.instance=x,Jt(x),x):(h=u,(x=Ei.get(w))&&(h=g({},u),hy(h,x)),i=i.ownerDocument||i,x=i.createElement("script"),Jt(x),fr(x,"link",h),i.head.appendChild(x),l.instance=x);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,Eh(h,u.precedence,i));return l.instance}function Eh(i,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,w=x,D=0;D<h.length;D++){var N=h[D];if(N.dataset.precedence===l)w=N;else if(w!==x)break}w?w.parentNode.insertBefore(i,w.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(i,l.firstChild))}function fy(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function hy(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Th=null;function LC(i,l,u){if(Th===null){var h=new Map,x=Th=new Map;x.set(u,h)}else x=Th,h=x.get(u),h||(h=new Map,x.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),x=0;x<u.length;x++){var w=u[x];if(!(w[rn]||w[Me]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var D=w.getAttribute(l)||"";D=i+D;var N=h.get(D);N?N.push(w):h.set(D,[w])}}return h}function IC(i,l,u){i=i.ownerDocument||i,i.head.insertBefore(u,l==="title"?i.querySelector("head > title"):null)}function $3(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;switch(l.rel){case"stylesheet":return i=l.disabled,typeof l.precedence=="string"&&i==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function zC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function U3(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 x=pc(h.href),w=l.querySelector(Xu(x));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(i.count++,i=Rh.bind(i),l.then(i,i)),u.state.loading|=4,u.instance=w,Jt(w);return}w=l.ownerDocument||l,h=OC(h),(x=Ei.get(x))&&fy(h,x),w=w.createElement("link"),Jt(w);var D=w;D._p=new Promise(function(N,q){D.onload=N,D.onerror=q}),fr(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=Rh.bind(i),l.addEventListener("load",u),l.addEventListener("error",u))}}var py=0;function B3(i,l){return i.stylesheets&&i.count===0&&Ah(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var h=setTimeout(function(){if(i.stylesheets&&Ah(i,i.stylesheets),i.unsuspend){var w=i.unsuspend;i.unsuspend=null,w()}},6e4+l);0<i.imgBytes&&py===0&&(py=62500*S3());var x=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Ah(i,i.stylesheets),i.unsuspend)){var w=i.unsuspend;i.unsuspend=null,w()}},(i.imgBytes>py?50:800)+l);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(h),clearTimeout(x)}}:null}function Rh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ah(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var _h=null;function Ah(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,_h=new Map,l.forEach(V3,i),_h=null,Rh.call(i))}function V3(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 x=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var D=x[w];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(u.set(D.dataset.precedence,D),h=D)}h&&u.set(null,h)}x=l.instance,D=x.getAttribute("data-precedence"),w=u.get(D)||h,w===h&&u.set(null,x),u.set(D,x),this.count++,h=Rh.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),w?w.parentNode.insertBefore(x,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(x,i.firstChild)),l.state.loading|=4}}var Zu={$$typeof:T,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function F3(i,l,u,h,x,w,D,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=ka(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ka(0),this.hiddenUpdates=ka(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function $C(i,l,u,h,x,w,D,N,q,te,fe,ve){return i=new F3(i,l,u,D,q,te,fe,ve,N),l=1,w===!0&&(l|=24),w=ri(3,null,null,l),i.current=w,w.stateNode=i,l=Qg(),l.refCount++,i.pooledCache=l,l.refCount++,w.memoizedState={element:h,isDehydrated:u,cache:l},Xg(w),i}function UC(i){return i?(i=Gl,i):Gl}function BC(i,l,u,h,x,w){x=UC(x),h.context===null?h.context=x:h.pendingContext=x,h=Ba(l),h.payload={element:u},w=w===void 0?null:w,w!==null&&(h.callback=w),u=Va(i,h,l),u!==null&&(Wr(u,i,l),ku(u,i,l))}function VC(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<l?u:l}}function my(i,l){VC(i,l),(i=i.alternate)&&VC(i,l)}function FC(i){if(i.tag===13||i.tag===31){var l=Ms(i,67108864);l!==null&&Wr(l,i,67108864),my(i,67108864)}}function HC(i){if(i.tag===13||i.tag===31){var l=li();l=Se(l);var u=Ms(i,l);u!==null&&Wr(u,i,l),my(i,l)}}var Dh=!0;function H3(i,l,u,h){var x=M.T;M.T=null;var w=L.p;try{L.p=2,gy(i,l,u,h)}finally{L.p=w,M.T=x}}function q3(i,l,u,h){var x=M.T;M.T=null;var w=L.p;try{L.p=8,gy(i,l,u,h)}finally{L.p=w,M.T=x}}function gy(i,l,u,h){if(Dh){var x=vy(h);if(x===null)ny(i,l,h,kh,u),GC(i,h);else if(Q3(x,i,l,u,h))h.stopPropagation();else if(GC(i,h),l&4&&-1<G3.indexOf(i)){for(;x!==null;){var w=Br(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var D=Ur(w.pendingLanes);if(D!==0){var N=w;for(N.pendingLanes|=2,N.entangledLanes|=2;D;){var q=1<<31-Tn(D);N.entanglements[1]|=q,D&=~q}po(w),(Gt&6)===0&&(hh=pe()+500,Qu(0))}}break;case 31:case 13:N=Ms(w,2),N!==null&&Wr(N,w,2),mh(),my(w,2)}if(w=vy(h),w===null&&ny(i,l,h,kh,u),w===x)break;x=w}x!==null&&h.stopPropagation()}else ny(i,l,h,null,u)}}function vy(i){return i=xg(i),yy(i)}var kh=null;function yy(i){if(kh=null,i=zt(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 kh=i,null}function qC(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 je:return 2;case Ae:return 8;case _t:case Zn:return 32;case vn:return 268435456;default:return 32}default:return 32}}var xy=!1,Za=null,es=null,ts=null,ed=new Map,td=new Map,ns=[],G3="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 GC(i,l){switch(i){case"focusin":case"focusout":Za=null;break;case"dragenter":case"dragleave":es=null;break;case"mouseover":case"mouseout":ts=null;break;case"pointerover":case"pointerout":ed.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":td.delete(l.pointerId)}}function nd(i,l,u,h,x,w){return i===null||i.nativeEvent!==w?(i={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:w,targetContainers:[x]},l!==null&&(l=Br(l),l!==null&&FC(l)),i):(i.eventSystemFlags|=h,l=i.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),i)}function Q3(i,l,u,h,x){switch(l){case"focusin":return Za=nd(Za,i,l,u,h,x),!0;case"dragenter":return es=nd(es,i,l,u,h,x),!0;case"mouseover":return ts=nd(ts,i,l,u,h,x),!0;case"pointerover":var w=x.pointerId;return ed.set(w,nd(ed.get(w)||null,i,l,u,h,x)),!0;case"gotpointercapture":return w=x.pointerId,td.set(w,nd(td.get(w)||null,i,l,u,h,x)),!0}return!1}function QC(i){var l=zt(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(){HC(u)});return}}else if(l===31){if(l=d(u),l!==null){i.blockedOn=l,Ye(i.priority,function(){HC(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 Ph(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var u=vy(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);yg=h,u.target.dispatchEvent(h),yg=null}else return l=Br(u),l!==null&&FC(l),i.blockedOn=u,!1;l.shift()}return!0}function WC(i,l,u){Ph(i)&&u.delete(l)}function W3(){xy=!1,Za!==null&&Ph(Za)&&(Za=null),es!==null&&Ph(es)&&(es=null),ts!==null&&Ph(ts)&&(ts=null),ed.forEach(WC),td.forEach(WC)}function Nh(i,l){i.blockedOn===l&&(i.blockedOn=null,xy||(xy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,W3)))}var Oh=null;function YC(i){Oh!==i&&(Oh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Oh===i&&(Oh=null);for(var l=0;l<i.length;l+=3){var u=i[l],h=i[l+1],x=i[l+2];if(typeof h!="function"){if(yy(h||u)===null)continue;break}var w=Br(u);w!==null&&(i.splice(l,3),l-=3,vv(w,{pending:!0,data:x,method:u.method,action:h},h,x))}}))}function gc(i){function l(q){return Nh(q,i)}Za!==null&&Nh(Za,i),es!==null&&Nh(es,i),ts!==null&&Nh(ts,i),ed.forEach(l),td.forEach(l);for(var u=0;u<ns.length;u++){var h=ns[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<ns.length&&(u=ns[0],u.blockedOn===null);)QC(u),u.blockedOn===null&&ns.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var x=u[h],w=u[h+1],D=x[Ve]||null;if(typeof w=="function")D||YC(u);else if(D){var N=null;if(w&&w.hasAttribute("formAction")){if(x=w,D=w[Ve]||null)N=D.formAction;else if(yy(x)!==null)continue}else N=D.action;typeof N=="function"?u[h+1]=N:(u.splice(h,3),h-=3),YC(u)}}}function KC(){function i(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(D){return x=D})},focusReset:"manual",scroll:"manual"})}function l(){x!==null&&(x(),x=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,x=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),x!==null&&(x(),x=null)}}}function by(i){this._internalRoot=i}Mh.prototype.render=by.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var u=l.current,h=li();BC(u,h,i,l,null,null)},Mh.prototype.unmount=by.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;BC(i.current,2,null,i,null,null),mh(),l[Ke]=null}};function Mh(i){this._internalRoot=i}Mh.prototype.unstable_scheduleHydration=function(i){if(i){var l=We();i={blockedOn:null,target:i,priority:l};for(var u=0;u<ns.length&&l!==0&&l<ns[u].priority;u++);ns.splice(u,0,i),u===0&&QC(i)}};var XC=t.version;if(XC!=="19.2.0")throw Error(r(527,XC,"19.2.0"));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.0",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lh.isDisabled&&Lh.supportsFiber)try{En=Lh.inject(Y3),Nn=Lh}catch{}}return cd.createRoot=function(i,l){if(!o(i))throw Error(r(299));var u=!1,h="",x=ij,w=oj,D=aj;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(D=l.onRecoverableError)),l=$C(i,1,!1,null,null,u,h,null,x,w,D,KC),i[Ke]=l.current,ty(i),new by(l)},cd.hydrateRoot=function(i,l,u){if(!o(i))throw Error(r(299));var h=!1,x="",w=ij,D=oj,N=aj,q=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(D=u.onCaughtError),u.onRecoverableError!==void 0&&(N=u.onRecoverableError),u.formState!==void 0&&(q=u.formState)),l=$C(i,1,!0,l,u??null,h,x,q,w,D,N,KC),l.context=UC(null),u=l.current,h=li(),h=Se(h),x=Ba(h),x.callback=null,Va(u,x,h),u=h,l.current.lanes=u,Pa(l,u),po(l),i[Ke]=l.current,ty(i),new Mh(l)},cd.version="19.2.0",cd}var NR;function mZ(){if(NR)return ax.exports;NR=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(),ax.exports=pZ(),ax.exports}var gZ=mZ();var QP=e=>{throw TypeError(e)},vZ=(e,t,n)=>t.has(e)||QP("Cannot "+n),cx=(e,t,n)=>(vZ(e,t,"read from private field"),n?n.call(e):t.get(e)),yZ=(e,t,n)=>t.has(e)?QP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),OR="popstate";function xZ(e={}){function t(r,o){let{pathname:s,search:c,hash:d}=r.location;return zd("",{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:Mo(o)}return SZ(t,n,null,e)}function St(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Un(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function bZ(){return Math.random().toString(36).substring(2,10)}function MR(e,t){return{usr:e.state,key:e.key,idx:t}}function zd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Da(t):t,state:n,key:t&&t.key||r||bZ()}}function Mo({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 Da(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 SZ(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(),R=C==null?null:C-p;p=C,f&&f({action:d,location:j.location,delta:R})}function y(C,R){d="PUSH";let E=zd(j.location,C,R);p=m()+1;let T=MR(E,p),_=j.createHref(E);try{c.pushState(T,"",_)}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 b(C,R){d="REPLACE";let E=zd(j.location,C,R);p=m();let T=MR(E,p),_=j.createHref(E);c.replaceState(T,"",_),s&&f&&f({action:d,location:j.location,delta:0})}function S(C){return WP(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(OR,g),f=C,()=>{o.removeEventListener(OR,g),f=null}},createHref(C){return t(o,C)},createURL:S,encodeLocation(C){let R=S(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:y,replace:b,go(C){return c.go(C)}};return j}function WP(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),St(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Mo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var md,LR=class{constructor(e){if(yZ(this,md,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(cx(this,md).has(e))return cx(this,md).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){cx(this,md).set(e,t)}};md=new WeakMap;var wZ=new Set(["lazy","caseSensitive","path","id","index","children"]);function jZ(e){return wZ.has(e)}var CZ=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function EZ(e){return CZ.has(e)}function TZ(e){return e.index===!0}function $d(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(St(s.index!==!0||!s.children,"Cannot specify children on an index route"),St(o||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),TZ(s)){let p={...s,id:f};return r[f]=IR(p,t(p)),p}else{let p={...s,id:f,children:void 0};return r[f]=IR(p,t(p)),s.children&&(p.children=$d(s.children,t,d,r,o)),p}})}function IR(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ds(e,t,n="/"){return gd(e,t,n,!1)}function gd(e,t,n,r){let o=typeof t=="string"?Da(t):t,s=Oi(o.pathname||"/",n);if(s==null)return null;let c=YP(e);_Z(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let p=$Z(s);d=IZ(c[f],p,r)}return d}function RZ(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 YP(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;St(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=Ao([r,m.relativePath]),y=n.concat(m);c.children&&c.children.length>0&&(St(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),YP(c.children,t,y,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:MZ(g,c.index),routesMeta:y})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))s(c,d);else for(let f of KP(c.path))s(c,d,!0,f)}),t}function KP(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=KP(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 _Z(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:LZ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var AZ=/^:[\w-]+$/,DZ=3,kZ=2,PZ=1,NZ=10,OZ=-2,zR=e=>e==="*";function MZ(e,t){let n=e.split("/"),r=n.length;return n.some(zR)&&(r+=OZ),t&&(r+=kZ),n.filter(o=>!zR(o)).reduce((o,s)=>o+(AZ.test(s)?DZ:s===""?PZ:NZ),r)}function LZ(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 IZ(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=qp({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),y=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=qp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(o,g.params),c.push({params:o,pathname:Ao([s,g.pathname]),pathnameBase:FZ(Ao([s,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(s=Ao([s,g.pathnameBase]))}return c}function qp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=zZ(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 b=d[y];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:c,pattern:e}}function zZ(e,t=!1,n=!0){Un(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 $Z(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Un(!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 Oi(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 UZ({basename:e,pathname:t}){return t==="/"?e:Ao([e,t])}var BZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ug=e=>BZ.test(e);function VZ(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Da(e):e,s;if(n)if(ug(n))s=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Un(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?s=$R(n.substring(1),"/"):s=$R(n,t)}else s=t;return{pathname:s,search:HZ(r),hash:qZ(o)}}function $R(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 ux(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 XP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function YS(e){let t=XP(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function KS(e,t,n,r=!1){let o;typeof e=="string"?o=Da(e):(o={...e},St(!o.pathname||!o.pathname.includes("?"),ux("?","pathname","search",o)),St(!o.pathname||!o.pathname.includes("#"),ux("#","pathname","hash",o)),St(!o.search||!o.search.includes("#"),ux("#","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=VZ(o,d),p=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var Ao=e=>e.join("/").replace(/\/\/+/g,"/"),FZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),HZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qZ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Gp=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 Ud(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function XS(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ms=Symbol("Uninstrumented");function GZ(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=Pc(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=Pc(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[ms]??s,d=Pc(n[o],c,(...f)=>UR(f[0]));d&&(d[ms]=c,r[o]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(o=>{let s=o[ms]??o,c=Pc(n.middleware,s,(...d)=>UR(d[0]));return c?(c[ms]=s,c):o})),r}function QZ(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[ms]??e.navigate,o=Pc(n.navigate,r,(...s)=>{let[c,d]=s;return{to:typeof c=="number"||typeof c=="string"?c:c?Mo(c):".",...BR(e,d??{})}});o&&(o[ms]=r,e.navigate=o)}if(n.fetch.length>0){let r=e.fetch[ms]??e.fetch,o=Pc(n.fetch,r,(...s)=>{let[c,,d,f]=s;return{href:d??".",fetcherKey:c,...BR(e,f??{})}});o&&(o[ms]=r,e.fetch=o)}return e}function Pc(e,t,n){return e.length===0?null:async(...r)=>{let o=await JP(e,n(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function JP(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=JP(e,t,n,r-1),s=await c,St(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 UR(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:WZ(t),params:{...r},unstable_pattern:o,context:YZ(n)}}function BR(e,t){return{currentUrl:Mo(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 WZ(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function YZ(e){if(XZ(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var KZ=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function XZ(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")===KZ}var ZP=["POST","PUT","PATCH","DELETE"],JZ=new Set(ZP),ZZ=["GET",...ZP],eee=new Set(ZZ),tee=new Set([301,302,303,307,308]),nee=new Set([307,308]),dx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ree={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ud={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},iee=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),eN="remix-router-transitions",tN=Symbol("ResetLoaderData");function oee(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";St(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||iee,s=o;if(e.unstable_instrumentations){let H=e.unstable_instrumentations;s=W=>({...o(W),...GZ(H.map(oe=>oe.route).filter(Boolean),W)})}let c={},d=$d(e.routes,s,void 0,c),f,p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let m=e.dataStrategy||uee,g={...e.future},y=null,b=new Set,S=null,j=null,C=null,R=e.hydrationData!=null,E=ds(d,e.history.location,p),T=!1,_=null,k;if(E==null&&!e.patchRoutesOnNavigation){let H=Ai(404,{pathname:e.history.location.pathname}),{matches:W,route:oe}=Kh(d);k=!0,E=W,_={[oe.id]:H}}else if(E&&!e.hydrationData&&Go(E,d,e.history.location.pathname).active&&(E=null),E)if(E.some(H=>H.route.lazy))k=!1;else if(!E.some(H=>JS(H.route)))k=!0;else{let H=e.hydrationData?e.hydrationData.loaderData:null,W=e.hydrationData?e.hydrationData.errors:null;if(W){let oe=E.findIndex(Se=>W[Se.route.id]!==void 0);k=E.slice(0,oe+1).every(Se=>!rb(Se.route,H,W))}else k=E.every(oe=>!rb(oe.route,H,W))}else{k=!1,E=[];let H=Go(null,d,e.history.location.pathname);H.active&&H.matches&&(T=!0,E=H.matches)}let I,A={historyAction:e.history.action,location:e.history.location,matches:E,initialized:k,navigation:dx,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",z=!1,B,Y=!1,J=new Map,Z=null,$=!1,Q=!1,M=new Set,L=new Map,U=0,V=-1,K=new Map,O=new Set,F=new Map,ae=new Map,ue=new Set,be=new Map,we,Ce=null;function nt(){if(y=e.history.listen(({action:H,location:W,delta:oe})=>{if(we){we(),we=void 0;return}Un(be.size===0||oe!=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 Se=mi({currentLocation:A.location,nextLocation:W,historyAction:H});if(Se&&oe!=null){let ke=new Promise(We=>{we=We});e.history.go(oe*-1),so(Se,{state:"blocked",location:W,proceed(){so(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:W}),ke.then(()=>e.history.go(oe))},reset(){let We=new Map(A.blockers);We.set(Se,ud),ot({blockers:We})}});return}return mt(H,W)}),n){Eee(t,J);let H=()=>Tee(t,J);t.addEventListener("pagehide",H),Z=()=>t.removeEventListener("pagehide",H)}return A.initialized||mt("POP",A.location,{initialHydration:!0}),I}function De(){y&&y(),Z&&Z(),b.clear(),B&&B.abort(),A.fetchers.forEach((H,W)=>Pn(W)),A.blockers.forEach((H,W)=>ao(W))}function ft(H){return b.add(H),()=>b.delete(H)}function ot(H,W={}){H.matches&&(H.matches=H.matches.map(ke=>{let We=c[ke.route.id],Ye=ke.route;return Ye.element!==We.element||Ye.errorElement!==We.errorElement||Ye.hydrateFallbackElement!==We.hydrateFallbackElement?{...ke,route:We}:ke})),A={...A,...H};let oe=[],Se=[];A.fetchers.forEach((ke,We)=>{ke.state==="idle"&&(ue.has(We)?oe.push(We):Se.push(We))}),ue.forEach(ke=>{!A.fetchers.has(ke)&&!L.has(ke)&&oe.push(ke)}),[...b].forEach(ke=>ke(A,{deletedFetchers:oe,viewTransitionOpts:W.viewTransitionOpts,flushSync:W.flushSync===!0})),oe.forEach(ke=>Pn(ke)),Se.forEach(ke=>A.fetchers.delete(ke))}function ht(H,W,{flushSync:oe}={}){let Se=A.actionData!=null&&A.navigation.formMethod!=null&&Pr(A.navigation.formMethod)&&A.navigation.state==="loading"&&H.state?._isRedirect!==!0,ke;W.actionData?Object.keys(W.actionData).length>0?ke=W.actionData:ke=null:Se?ke=A.actionData:ke=null;let We=W.loaderData?XR(A.loaderData,W.loaderData,W.matches||[],W.errors):A.loaderData,Ye=A.blockers;Ye.size>0&&(Ye=new Map(Ye),Ye.forEach((Ke,et)=>Ye.set(et,ud)));let Be=$?!1:ir(H,W.matches||A.matches),Me=z===!0||A.navigation.formMethod!=null&&Pr(A.navigation.formMethod)&&H.state?._isRedirect!==!0;f&&(d=f,f=void 0),$||P==="POP"||(P==="PUSH"?e.history.push(H,H.state):P==="REPLACE"&&e.history.replace(H,H.state));let Ve;if(P==="POP"){let Ke=J.get(A.location.pathname);Ke&&Ke.has(H.pathname)?Ve={currentLocation:A.location,nextLocation:H}:J.has(H.pathname)&&(Ve={currentLocation:H,nextLocation:A.location})}else if(Y){let Ke=J.get(A.location.pathname);Ke?Ke.add(H.pathname):(Ke=new Set([H.pathname]),J.set(A.location.pathname,Ke)),Ve={currentLocation:A.location,nextLocation:H}}ot({...W,actionData:ke,loaderData:We,historyAction:P,location:H,initialized:!0,navigation:dx,revalidation:"idle",restoreScrollPosition:Be,preventScrollReset:Me,blockers:Ye},{viewTransitionOpts:Ve,flushSync:oe===!0}),P="POP",z=!1,Y=!1,$=!1,Q=!1,Ce?.resolve(),Ce=null}async function st(H,W){if(typeof H=="number"){e.history.go(H);return}let oe=nb(A.location,A.matches,p,H,W?.fromRouteId,W?.relative),{path:Se,submission:ke,error:We}=VR(!1,oe,W),Ye=A.location,Be=zd(A.location,Se,W&&W.state);Be={...Be,...e.history.encodeLocation(Be)};let Me=W&&W.replace!=null?W.replace:void 0,Ve="PUSH";Me===!0?Ve="REPLACE":Me===!1||ke!=null&&Pr(ke.formMethod)&&ke.formAction===A.location.pathname+A.location.search&&(Ve="REPLACE");let Ke=W&&"preventScrollReset"in W?W.preventScrollReset===!0:void 0,et=(W&&W.flushSync)===!0,Et=mi({currentLocation:Ye,nextLocation:Be,historyAction:Ve});if(Et){so(Et,{state:"blocked",location:Be,proceed(){so(Et,{state:"proceeding",proceed:void 0,reset:void 0,location:Be}),st(H,W)},reset(){let Xt=new Map(A.blockers);Xt.set(Et,ud),ot({blockers:Xt})}});return}await mt(Ve,Be,{submission:ke,pendingError:We,preventScrollReset:Ke,replace:W&&W.replace,enableViewTransition:W&&W.viewTransition,flushSync:et})}function yt(){Ce||(Ce=Ree()),je(),ot({revalidation:"loading"});let H=Ce.promise;return A.navigation.state==="submitting"?H:A.navigation.state==="idle"?(mt(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),H):(mt(P||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:Y===!0}),H)}async function mt(H,W,oe){B&&B.abort(),B=null,P=H,$=(oe&&oe.startUninterruptedRevalidation)===!0,co(A.location,A.matches),z=(oe&&oe.preventScrollReset)===!0,Y=(oe&&oe.enableViewTransition)===!0;let Se=f||d,ke=oe&&oe.overrideNavigation,We=oe?.initialHydration&&A.matches&&A.matches.length>0&&!T?A.matches:ds(Se,W,p),Ye=(oe&&oe.flushSync)===!0;if(We&&A.initialized&&!Q&&yee(A.location,W)&&!(oe&&oe.submission&&Pr(oe.submission.formMethod))){ht(W,{matches:We},{flushSync:Ye});return}let Be=Go(We,Se,W.pathname);if(Be.active&&Be.matches&&(We=Be.matches),!We){let{error:rn,notFoundMatches:qt,route:zt}=lo(W.pathname);ht(W,{matches:qt,loaderData:{},errors:{[zt.id]:rn}},{flushSync:Ye});return}B=new AbortController;let Me=kc(e.history,W,B.signal,oe&&oe.submission),Ve=e.getContext?await e.getContext():new LR,Ke;if(oe&&oe.pendingError)Ke=[fs(We).route.id,{type:"error",error:oe.pendingError}];else if(oe&&oe.submission&&Pr(oe.submission.formMethod)){let rn=await It(Me,W,oe.submission,We,Ve,Be.active,oe&&oe.initialHydration===!0,{replace:oe.replace,flushSync:Ye});if(rn.shortCircuited)return;if(rn.pendingActionResult){let[qt,zt]=rn.pendingActionResult;if(ui(zt)&&Ud(zt.error)&&zt.error.status===404){B=null,ht(W,{matches:rn.matches,loaderData:{},errors:{[qt]:zt.error}});return}}We=rn.matches||We,Ke=rn.pendingActionResult,ke=fx(W,oe.submission),Ye=!1,Be.active=!1,Me=kc(e.history,Me.url,Me.signal)}let{shortCircuited:et,matches:Et,loaderData:Xt,errors:at}=await Te(Me,W,We,Ve,Be.active,ke,oe&&oe.submission,oe&&oe.fetcherSubmission,oe&&oe.replace,oe&&oe.initialHydration===!0,Ye,Ke);et||(B=null,ht(W,{matches:Et||We,...JR(Ke),loaderData:Xt,errors:at}))}async function It(H,W,oe,Se,ke,We,Ye,Be={}){je();let Me=jee(W,oe);if(ot({navigation:Me},{flushSync:Be.flushSync===!0}),We){let et=await Fn(Se,W.pathname,H.signal);if(et.type==="aborted")return{shortCircuited:!0};if(et.type==="error"){if(et.partialMatches.length===0){let{matches:Xt,route:at}=Kh(d);return{matches:Xt,pendingActionResult:[at.id,{type:"error",error:et.error}]}}let Et=fs(et.partialMatches).route.id;return{matches:et.partialMatches,pendingActionResult:[Et,{type:"error",error:et.error}]}}else if(et.matches)Se=et.matches;else{let{notFoundMatches:Et,error:Xt,route:at}=lo(W.pathname);return{matches:Et,pendingActionResult:[at.id,{type:"error",error:Xt}]}}}let Ve,Ke=pp(Se,W);if(!Ke.route.action&&!Ke.route.lazy)Ve={type:"error",error:Ai(405,{method:H.method,pathname:W.pathname,routeId:Ke.route.id})};else{let et=zc(s,c,H,Se,Ke,Ye?[]:r,ke),Et=await pe(H,et,ke,null);if(Ve=Et[Ke.route.id],!Ve){for(let Xt of Se)if(Et[Xt.route.id]){Ve=Et[Xt.route.id];break}}if(H.signal.aborted)return{shortCircuited:!0}}if(ll(Ve)){let et;return Be&&Be.replace!=null?et=Be.replace:et=WR(Ve.response.headers.get("Location"),new URL(H.url),p)===A.location.pathname+A.location.search,await lt(H,Ve,!0,{submission:oe,replace:et}),{shortCircuited:!0}}if(ui(Ve)){let et=fs(Se,Ke.route.id);return(Be&&Be.replace)!==!0&&(P="PUSH"),{matches:Se,pendingActionResult:[et.route.id,Ve,Ke.route.id]}}return{matches:Se,pendingActionResult:[Ke.route.id,Ve]}}async function Te(H,W,oe,Se,ke,We,Ye,Be,Me,Ve,Ke,et){let Et=We||fx(W,Ye),Xt=Ye||Be||e2(Et),at=!$&&!Ve;if(ke){if(at){let er=Re(et);ot({navigation:Et,...er!==void 0?{actionData:er}:{}},{flushSync:Ke})}let At=await Fn(oe,W.pathname,H.signal);if(At.type==="aborted")return{shortCircuited:!0};if(At.type==="error"){if(At.partialMatches.length===0){let{matches:Oa,route:gi}=Kh(d);return{matches:Oa,loaderData:{},errors:{[gi.id]:At.error}}}let er=fs(At.partialMatches).route.id;return{matches:At.partialMatches,loaderData:{},errors:{[er]:At.error}}}else if(At.matches)oe=At.matches;else{let{error:er,notFoundMatches:Oa,route:gi}=lo(W.pathname);return{matches:Oa,loaderData:{},errors:{[gi.id]:er}}}}let rn=f||d,{dsMatches:qt,revalidatingFetchers:zt}=FR(H,Se,s,c,e.history,A,oe,Xt,W,Ve?[]:r,Ve===!0,Q,M,ue,F,O,rn,p,e.patchRoutesOnNavigation!=null,et);if(V=++U,!e.dataStrategy&&!qt.some(At=>At.shouldLoad)&&!qt.some(At=>At.route.middleware&&At.route.middleware.length>0)&&zt.length===0){let At=lr();return ht(W,{matches:oe,loaderData:{},errors:et&&ui(et[1])?{[et[0]]:et[1].error}:null,...JR(et),...At?{fetchers:new Map(A.fetchers)}:{}},{flushSync:Ke}),{shortCircuited:!0}}if(at){let At={};if(!ke){At.navigation=Et;let er=Re(et);er!==void 0&&(At.actionData=er)}zt.length>0&&(At.fetchers=Ie(zt)),ot(At,{flushSync:Ke})}zt.forEach(At=>{En(At.key),At.controller&&L.set(At.key,At.controller)});let Br=()=>zt.forEach(At=>En(At.key));B&&B.signal.addEventListener("abort",Br);let{loaderResults:Ui,fetcherResults:Tr}=await qe(qt,zt,H,Se);if(H.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",Br),zt.forEach(At=>L.delete(At.key));let Jt=Xh(Ui);if(Jt)return await lt(H,Jt.result,!0,{replace:Me}),{shortCircuited:!0};if(Jt=Xh(Tr),Jt)return O.add(Jt.key),await lt(H,Jt.result,!0,{replace:Me}),{shortCircuited:!0};let{loaderData:Ll,errors:Na}=KR(A,oe,Ui,et,zt,Tr);Ve&&A.errors&&(Na={...A.errors,...Na});let Rr=lr(),Bi=Tn(V),Il=Rr||Bi||zt.length>0;return{matches:oe,loaderData:Ll,errors:Na,...Il?{fetchers:new Map(A.fetchers)}:{}}}function Re(H){if(H&&!ui(H[1]))return{[H[0]]:H[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Ie(H){return H.forEach(W=>{let oe=A.fetchers.get(W.key),Se=dd(void 0,oe?oe.data:void 0);A.fetchers.set(W.key,Se)}),new Map(A.fetchers)}async function Oe(H,W,oe,Se){En(H);let ke=(Se&&Se.flushSync)===!0,We=f||d,Ye=nb(A.location,A.matches,p,oe,W,Se?.relative),Be=ds(We,Ye,p),Me=Go(Be,We,Ye);if(Me.active&&Me.matches&&(Be=Me.matches),!Be){_t(H,W,Ai(404,{pathname:Ye}),{flushSync:ke});return}let{path:Ve,submission:Ke,error:et}=VR(!0,Ye,Se);if(et){_t(H,W,et,{flushSync:ke});return}let Et=e.getContext?await e.getContext():new LR,Xt=(Se&&Se.preventScrollReset)===!0;if(Ke&&Pr(Ke.formMethod)){await ct(H,W,Ve,Be,Et,Me.active,ke,Xt,Ke);return}F.set(H,{routeId:W,path:Ve}),await tt(H,W,Ve,Be,Et,Me.active,ke,Xt,Ke)}async function ct(H,W,oe,Se,ke,We,Ye,Be,Me){je(),F.delete(H);let Ve=A.fetchers.get(H);Ae(H,Cee(Me,Ve),{flushSync:Ye});let Ke=new AbortController,et=kc(e.history,oe,Ke.signal,Me);if(We){let ln=await Fn(Se,new URL(et.url).pathname,et.signal,H);if(ln.type==="aborted")return;if(ln.type==="error"){_t(H,W,ln.error,{flushSync:Ye});return}else if(ln.matches)Se=ln.matches;else{_t(H,W,Ai(404,{pathname:oe}),{flushSync:Ye});return}}let Et=pp(Se,oe);if(!Et.route.action&&!Et.route.lazy){let ln=Ai(405,{method:Me.formMethod,pathname:oe,routeId:W});_t(H,W,ln,{flushSync:Ye});return}L.set(H,Ke);let Xt=U,at=zc(s,c,et,Se,Et,r,ke),rn=await pe(et,at,ke,H),qt=rn[Et.route.id];if(!qt){for(let ln of at)if(rn[ln.route.id]){qt=rn[ln.route.id];break}}if(et.signal.aborted){L.get(H)===Ke&&L.delete(H);return}if(ue.has(H)){if(ll(qt)||ui(qt)){Ae(H,ha(void 0));return}}else{if(ll(qt))if(L.delete(H),V>Xt){Ae(H,ha(void 0));return}else return O.add(H),Ae(H,dd(Me)),lt(et,qt,!1,{fetcherSubmission:Me,preventScrollReset:Be});if(ui(qt)){_t(H,W,qt.error);return}}let zt=A.navigation.location||A.location,Br=kc(e.history,zt,Ke.signal),Ui=f||d,Tr=A.navigation.state!=="idle"?ds(Ui,A.navigation.location,p):A.matches;St(Tr,"Didn't find any matches after fetcher action");let Jt=++U;K.set(H,Jt);let Ll=dd(Me,qt.data);A.fetchers.set(H,Ll);let{dsMatches:Na,revalidatingFetchers:Rr}=FR(Br,ke,s,c,e.history,A,Tr,Me,zt,r,!1,Q,M,ue,F,O,Ui,p,e.patchRoutesOnNavigation!=null,[Et.route.id,qt]);Rr.filter(ln=>ln.key!==H).forEach(ln=>{let Vr=ln.key,_r=A.fetchers.get(Vr),Tf=dd(void 0,_r?_r.data:void 0);A.fetchers.set(Vr,Tf),En(Vr),ln.controller&&L.set(Vr,ln.controller)}),ot({fetchers:new Map(A.fetchers)});let Bi=()=>Rr.forEach(ln=>En(ln.key));Ke.signal.addEventListener("abort",Bi);let{loaderResults:Il,fetcherResults:At}=await qe(Na,Rr,Br,ke);if(Ke.signal.aborted)return;if(Ke.signal.removeEventListener("abort",Bi),K.delete(H),L.delete(H),Rr.forEach(ln=>L.delete(ln.key)),A.fetchers.has(H)){let ln=ha(qt.data);A.fetchers.set(H,ln)}let er=Xh(Il);if(er)return lt(Br,er.result,!1,{preventScrollReset:Be});if(er=Xh(At),er)return O.add(er.key),lt(Br,er.result,!1,{preventScrollReset:Be});let{loaderData:Oa,errors:gi}=KR(A,Tr,Il,void 0,Rr,At);Tn(Jt),A.navigation.state==="loading"&&Jt>V?(St(P,"Expected pending action"),B&&B.abort(),ht(A.navigation.location,{matches:Tr,loaderData:Oa,errors:gi,fetchers:new Map(A.fetchers)})):(ot({errors:gi,loaderData:XR(A.loaderData,Oa,Tr,gi),fetchers:new Map(A.fetchers)}),Q=!1)}async function tt(H,W,oe,Se,ke,We,Ye,Be,Me){let Ve=A.fetchers.get(H);Ae(H,dd(Me,Ve?Ve.data:void 0),{flushSync:Ye});let Ke=new AbortController,et=kc(e.history,oe,Ke.signal);if(We){let zt=await Fn(Se,new URL(et.url).pathname,et.signal,H);if(zt.type==="aborted")return;if(zt.type==="error"){_t(H,W,zt.error,{flushSync:Ye});return}else if(zt.matches)Se=zt.matches;else{_t(H,W,Ai(404,{pathname:oe}),{flushSync:Ye});return}}let Et=pp(Se,oe);L.set(H,Ke);let Xt=U,at=zc(s,c,et,Se,Et,r,ke),qt=(await pe(et,at,ke,H))[Et.route.id];if(L.get(H)===Ke&&L.delete(H),!et.signal.aborted){if(ue.has(H)){Ae(H,ha(void 0));return}if(ll(qt))if(V>Xt){Ae(H,ha(void 0));return}else{O.add(H),await lt(et,qt,!1,{preventScrollReset:Be});return}if(ui(qt)){_t(H,W,qt.error);return}Ae(H,ha(qt.data))}}async function lt(H,W,oe,{submission:Se,fetcherSubmission:ke,preventScrollReset:We,replace:Ye}={}){W.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let Be=W.response.headers.get("Location");St(Be,"Expected a Location header on the redirect Response"),Be=WR(Be,new URL(H.url),p);let Me=zd(A.location,Be,{_isRedirect:!0});if(n){let at=!1;if(W.response.headers.has("X-Remix-Reload-Document"))at=!0;else if(ug(Be)){const rn=WP(Be,!0);at=rn.origin!==t.location.origin||Oi(rn.pathname,p)==null}if(at){Ye?t.location.replace(Be):t.location.assign(Be);return}}B=null;let Ve=Ye===!0||W.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ke,formAction:et,formEncType:Et}=A.navigation;!Se&&!ke&&Ke&&et&&Et&&(Se=e2(A.navigation));let Xt=Se||ke;if(nee.has(W.response.status)&&Xt&&Pr(Xt.formMethod))await mt(Ve,Me,{submission:{...Xt,formAction:Be},preventScrollReset:We||z,enableViewTransition:oe?Y:void 0});else{let at=fx(Me,Se);await mt(Ve,Me,{overrideNavigation:at,fetcherSubmission:ke,preventScrollReset:We||z,enableViewTransition:oe?Y:void 0})}}async function pe(H,W,oe,Se){let ke,We={};try{ke=await fee(m,H,W,Se,oe,!1)}catch(Ye){return W.filter(Be=>Be.shouldLoad).forEach(Be=>{We[Be.route.id]={type:"error",error:Ye}}),We}if(H.signal.aborted)return We;for(let[Ye,Be]of Object.entries(ke))if(See(Be)){let Me=Be.result;We[Ye]={type:"redirect",response:gee(Me,H,Ye,W,p)}}else We[Ye]=await mee(Be);return We}async function qe(H,W,oe,Se){let ke=pe(oe,H,Se,null),We=Promise.all(W.map(async Me=>{if(Me.matches&&Me.match&&Me.request&&Me.controller){let Ke=(await pe(Me.request,Me.matches,Se,Me.key))[Me.match.route.id];return{[Me.key]:Ke}}else return Promise.resolve({[Me.key]:{type:"error",error:Ai(404,{pathname:Me.path})}})})),Ye=await ke,Be=(await We).reduce((Me,Ve)=>Object.assign(Me,Ve),{});return{loaderResults:Ye,fetcherResults:Be}}function je(){Q=!0,F.forEach((H,W)=>{L.has(W)&&M.add(W),En(W)})}function Ae(H,W,oe={}){A.fetchers.set(H,W),ot({fetchers:new Map(A.fetchers)},{flushSync:(oe&&oe.flushSync)===!0})}function _t(H,W,oe,Se={}){let ke=fs(A.matches,W);Pn(H),ot({errors:{[ke.route.id]:oe},fetchers:new Map(A.fetchers)},{flushSync:(Se&&Se.flushSync)===!0})}function Zn(H){return ae.set(H,(ae.get(H)||0)+1),ue.has(H)&&ue.delete(H),A.fetchers.get(H)||ree}function vn(H,W){En(H,W?.reason),Ae(H,ha(null))}function Pn(H){let W=A.fetchers.get(H);L.has(H)&&!(W&&W.state==="loading"&&K.has(H))&&En(H),F.delete(H),K.delete(H),O.delete(H),ue.delete(H),M.delete(H),A.fetchers.delete(H)}function yn(H){let W=(ae.get(H)||0)-1;W<=0?(ae.delete(H),ue.add(H)):ae.set(H,W),ot({fetchers:new Map(A.fetchers)})}function En(H,W){let oe=L.get(H);oe&&(oe.abort(W),L.delete(H))}function Nn(H){for(let W of H){let oe=Zn(W),Se=ha(oe.data);A.fetchers.set(W,Se)}}function lr(){let H=[],W=!1;for(let oe of O){let Se=A.fetchers.get(oe);St(Se,`Expected fetcher: ${oe}`),Se.state==="loading"&&(O.delete(oe),H.push(oe),W=!0)}return Nn(H),W}function Tn(H){let W=[];for(let[oe,Se]of K)if(Se<H){let ke=A.fetchers.get(oe);St(ke,`Expected fetcher: ${oe}`),ke.state==="loading"&&(En(oe),K.delete(oe),W.push(oe))}return Nn(W),W.length>0}function Ho(H,W){let oe=A.blockers.get(H)||ud;return be.get(H)!==W&&be.set(H,W),oe}function ao(H){A.blockers.delete(H),be.delete(H)}function so(H,W){let oe=A.blockers.get(H)||ud;St(oe.state==="unblocked"&&W.state==="blocked"||oe.state==="blocked"&&W.state==="blocked"||oe.state==="blocked"&&W.state==="proceeding"||oe.state==="blocked"&&W.state==="unblocked"||oe.state==="proceeding"&&W.state==="unblocked",`Invalid blocker state transition: ${oe.state} -> ${W.state}`);let Se=new Map(A.blockers);Se.set(H,W),ot({blockers:Se})}function mi({currentLocation:H,nextLocation:W,historyAction:oe}){if(be.size===0)return;be.size>1&&Un(!1,"A router only supports one blocker at a time");let Se=Array.from(be.entries()),[ke,We]=Se[Se.length-1],Ye=A.blockers.get(ke);if(!(Ye&&Ye.state==="proceeding")&&We({currentLocation:H,nextLocation:W,historyAction:oe}))return ke}function lo(H){let W=Ai(404,{pathname:H}),oe=f||d,{matches:Se,route:ke}=Kh(oe);return{notFoundMatches:Se,route:ke,error:W}}function qo(H,W,oe){if(S=H,C=W,j=oe||null,!R&&A.navigation===dx){R=!0;let Se=ir(A.location,A.matches);Se!=null&&ot({restoreScrollPosition:Se})}return()=>{S=null,C=null,j=null}}function Ur(H,W){return j&&j(H,W.map(Se=>RZ(Se,A.loaderData)))||H.key}function co(H,W){if(S&&C){let oe=Ur(H,W);S[oe]=C()}}function ir(H,W){if(S){let oe=Ur(H,W),Se=S[oe];if(typeof Se=="number")return Se}return null}function Go(H,W,oe){if(e.patchRoutesOnNavigation)if(H){if(Object.keys(H[0].params).length>0)return{active:!0,matches:gd(W,oe,p,!0)}}else return{active:!0,matches:gd(W,oe,p,!0)||[]};return{active:!1,matches:null}}async function Fn(H,W,oe,Se){if(!e.patchRoutesOnNavigation)return{type:"success",matches:H};let ke=H;for(;;){let We=f==null,Ye=f||d,Be=c;try{await e.patchRoutesOnNavigation({signal:oe,path:W,matches:ke,fetcherKey:Se,patch:(Ke,et)=>{oe.aborted||HR(Ke,et,Ye,Be,s,!1)}})}catch(Ke){return{type:"error",error:Ke,partialMatches:ke}}finally{We&&!oe.aborted&&(d=[...d])}if(oe.aborted)return{type:"aborted"};let Me=ds(Ye,W,p),Ve=null;if(Me){if(Object.keys(Me[0].params).length===0)return{type:"success",matches:Me};if(Ve=gd(Ye,W,p,!0),!(Ve&&ke.length<Ve.length&&ka(ke,Ve.slice(0,ke.length))))return{type:"success",matches:Me}}if(Ve||(Ve=gd(Ye,W,p,!0)),!Ve||ka(ke,Ve))return{type:"success",matches:null};ke=Ve}}function ka(H,W){return H.length===W.length&&H.every((oe,Se)=>oe.route.id===W[Se].route.id)}function Pa(H){c={},f=$d(H,s,void 0,c)}function mu(H,W,oe=!1){let Se=f==null;HR(H,W,f||d,c,s,oe),Se&&(d=[...d],ot({}))}return I={get basename(){return p},get future(){return g},get state(){return A},get routes(){return d},get window(){return t},initialize:nt,subscribe:ft,enableScrollRestoration:qo,navigate:st,fetch:Oe,revalidate:yt,createHref:H=>e.history.createHref(H),encodeLocation:H=>e.history.encodeLocation(H),getFetcher:Zn,resetFetcher:vn,deleteFetcher:yn,dispose:De,getBlocker:Ho,deleteBlocker:ao,patchRoutes:mu,_internalFetchControllers:L,_internalSetRoutes:Pa,_internalSetStateDoNotUseOrYouWillBreakYourApp(H){ot(H)}},e.unstable_instrumentations&&(I=QZ(I,e.unstable_instrumentations.map(H=>H.router).filter(Boolean))),I}function aee(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function nb(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=KS(r||".",YS(c),Oi(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=ZS(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(b=>b).forEach(b=>m.append("index",b));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=UZ({basename:n,pathname:f.pathname})),Mo(f)}function VR(e,t,n){if(!n||!aee(n))return{path:t};if(n.formMethod&&!wee(n.formMethod))return{path:t,error:Ai(405,{method:n.formMethod})};let r=()=>({path:t,error:Ai(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=sN(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Pr(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,[b,S])=>`${y}${b}=${S}
|
|
243
|
-
`,""):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(!Pr(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()}}}St(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=ob(n.formData),f=n.formData;else if(n.body instanceof FormData)d=ob(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=YR(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=YR(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(Pr(p.formMethod))return{path:t,submission:p};let m=Da(t);return e&&m.search&&ZS(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Mo(m),submission:p}}function FR(e,t,n,r,o,s,c,d,f,p,m,g,y,b,S,j,C,R,E,T){let _=T?ui(T[1])?T[1].error:T[1].data:void 0,k=o.createURL(s.location),I=o.createURL(f),A;if(m&&s.errors){let $=Object.keys(s.errors)[0];A=c.findIndex(Q=>Q.route.id===$)}else if(T&&ui(T[1])){let $=T[0];A=c.findIndex(Q=>Q.route.id===$)-1}let P=T?T[1].statusCode:void 0,z=P&&P>=400,B={currentUrl:k,currentParams:s.matches[0]?.params||{},nextUrl:I,nextParams:c[0].params,...d,actionResult:_,actionStatus:P},Y=XS(c.map($=>$.route.path)),J=c.map(($,Q)=>{let{route:M}=$,L=null;if(A!=null&&Q>A?L=!1:M.lazy?L=!0:JS(M)?m?L=rb(M,s.loaderData,s.errors):see(s.loaderData,s.matches[Q],$)&&(L=!0):L=!1,L!==null)return ib(n,r,e,Y,$,p,t,L);let U=z?!1:g||k.pathname+k.search===I.pathname+I.search||k.search!==I.search||lee(s.matches[Q],$),V={...B,defaultShouldRevalidate:U},K=Qp($,V);return ib(n,r,e,Y,$,p,t,K,V)}),Z=[];return S.forEach(($,Q)=>{if(m||!c.some(ae=>ae.route.id===$.routeId)||b.has(Q))return;let M=s.fetchers.get(Q),L=M&&M.state!=="idle"&&M.data===void 0,U=ds(C,$.path,R);if(!U){if(E&&L)return;Z.push({key:Q,routeId:$.routeId,path:$.path,matches:null,match:null,request:null,controller:null});return}if(j.has(Q))return;let V=pp(U,$.path),K=new AbortController,O=kc(o,$.path,K.signal),F=null;if(y.has(Q))y.delete(Q),F=zc(n,r,O,U,V,p,t);else if(L)g&&(F=zc(n,r,O,U,V,p,t));else{let ae={...B,defaultShouldRevalidate:z?!1:g};Qp(V,ae)&&(F=zc(n,r,O,U,V,p,t,ae))}F&&Z.push({key:Q,routeId:$.routeId,path:$.path,matches:F,match:V,request:O,controller:K})}),{dsMatches:J,revalidatingFetchers:Z}}function JS(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function rb(e,t,n){if(e.lazy)return!0;if(!JS(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 see(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function lee(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Qp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function HR(e,t,n,r,o,s){let c;if(e){let p=r[e];St(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=>nN(p,g));m?f.push({existingRoute:m,newRoute:p}):d.push(p)}),d.length>0){let p=$d(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,[b]=$d([g],o,[],{},!0);Object.assign(y,{element:b.element?b.element:y.element,errorElement:b.errorElement?b.errorElement:y.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:y.hydrateFallbackElement})}}function nN(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=>nN(n,o))):!1}var qR=new WeakMap,rN=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(St(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let s=o.lazy[e];if(!s)return;let c=qR.get(o);c||(c={},qR.set(o,c));let d=c[e];if(d)return d;let f=(async()=>{let p=jZ(e),g=o[e]!==void 0&&e!=="hasErrorBoundary";if(p)Un(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Un(!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},GR=new WeakMap;function cee(e,t,n,r,o){let s=n[e.id];if(St(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=GR.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{St(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),b={};for(let S in y){let j=y[S];if(j===void 0)continue;let C=EZ(S),E=s[S]!==void 0&&S!=="hasErrorBoundary";C?Un(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?Un(!E,`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.`):b[S]=j}Object.assign(s,b),Object.assign(s,{...r(s),lazy:void 0})})();return GR.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=rN({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 QR(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 uee(e){return e.matches.some(t=>t.route.middleware)?iN(e,()=>QR(e)):QR(e)}function iN(e,t){return dee(e,t,r=>r,xee,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.unstable_shouldCallHandler()),0)),f=fs(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function dee(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(b=>[y.route.id,b]):[]);return await oN({request:c,params:d,context:f,unstable_pattern:p},m,t,n,r,o)}async function oN(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 oN(e,t,n,r,o,s,c+1)},g.value}catch(b){return g={value:await s(b,p,g)},g.value}};try{let b=await m(e,y),S=b!=null?r(b):void 0;return o(S)?S:g?S??g.value:(g={value:await y()},g.value)}catch(b){return await s(b,p,g)}}function aN(e,t,n,r,o){let s=rN({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=cee(r.route,Pr(n.method)?"action":"loader",t,e,o);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function ib(e,t,n,r,o,s,c,d,f=null){let p=!1,m=aN(e,t,n,o,s);return{...o,_lazyPromises:m,shouldLoad:d,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(g){return p=!0,f?typeof g=="boolean"?Qp(o,{...f,defaultShouldRevalidate:g}):Qp(o,f):d},resolve(g){let{lazy:y,loader:b,middleware:S}=o.route,j=p||d||g&&!Pr(n.method)&&(y||b),C=S&&S.length>0&&!b&&!y;return j&&(Pr(n.method)||!C)?hee({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:m?.handler,lazyRoutePromise:m?.route,handlerOverride:g,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function zc(e,t,n,r,o,s,c,d=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:aN(e,t,n,f,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ib(e,t,n,XS(r.map(p=>p.route.path)),f,s,c,!0,d))}async function fee(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:XS(n.map(p=>p.route.path)),params:n[0].params,context:o,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:p=>{let m=c;return iN(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 hee({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:s,scopedContext:c}){let d,f,p=Pr(e.method),m=p?"action":"loader",g=y=>{let b,S=new Promise((R,E)=>b=E);f=()=>b(),e.signal.addEventListener("abort",f);let j=R=>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},...R!==void 0?[R]:[]),C=(async()=>{try{return{type:"data",result:await(s?s(E=>j(E)):j())}}catch(R){return{type:"error",result:R}}})();return Promise.race([C,S])};try{let y=p?n.route.action:n.route.loader;if(r||o)if(y){let b,[S]=await Promise.all([g(y).catch(j=>{b=j}),r,o]);if(b!==void 0)throw b;d=S}else{await r;let b=p?n.route.action:n.route.loader;if(b)[d]=await Promise.all([g(b),o]);else if(m==="action"){let S=new URL(e.url),j=S.pathname+S.search;throw Ai(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 b=new URL(e.url),S=b.pathname+b.search;throw Ai(404,{pathname:S})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return d}async function pee(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 mee(e){let{result:t,type:n}=e;if(lN(t)){let r;try{r=await pee(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new Gp(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?ZR(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:new Gp(t.init?.status||500,void 0,t.data),statusCode:Ud(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ud(t)?t.status:void 0}:ZR(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 gee(e,t,n,r,o){let s=e.headers.get("Location");if(St(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!ug(s)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);s=nb(new URL(t.url),c,o,s),e.headers.set("Location",s)}return e}function WR(e,t,n){if(ug(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=Oi(o.pathname,n)!=null;if(o.origin===t.origin&&s)return o.pathname+o.search+o.hash}return e}function kc(e,t,n,r){let o=e.createURL(sN(t)).toString(),s={signal:n};if(r&&Pr(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=ob(r.formData):s.body=r.formData}return new Request(o,s)}function ob(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function YR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function vee(e,t,n,r=!1,o=!1){let s={},c=null,d,f=!1,p={},m=n&&ui(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let y=g.route.id,b=t[y];if(St(!ll(b),"Cannot handle redirect results in processLoaderData"),ui(b)){let S=b.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},o)c[y]=S;else{let j=fs(e,y);c[j.route.id]==null&&(c[j.route.id]=S)}r||(s[y]=tN),f||(f=!0,d=Ud(b.error)?b.error.status:500),b.headers&&(p[y]=b.headers)}else s[y]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(d=b.statusCode),b.headers&&(p[y]=b.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 KR(e,t,n,r,o,s){let{loaderData:c,errors:d}=vee(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(St(y,"Did not find corresponding fetcher result"),ui(y)){let b=fs(e.matches,m?.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:y.error}),e.fetchers.delete(p)}else if(ll(y))St(!1,"Unhandled fetcher revalidation redirect");else{let b=ha(y.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:d}}function XR(e,t,n,r){let o=Object.entries(t).filter(([,s])=>s!==tN).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 JR(e){return e?ui(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function fs(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 Kh(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 Ai(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 Gp(e||500,c,new Error(d),!0)}function Xh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(ll(o))return{key:r,result:o}}}function sN(e){let t=typeof e=="string"?Da(e):e;return Mo({...t,hash:""})}function yee(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function xee(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&bee(n))}function bee(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function See(e){return lN(e.result)&&tee.has(e.result.status)}function ui(e){return e.type==="error"}function ll(e){return(e&&e.type)==="redirect"}function ZR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function lN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function wee(e){return eee.has(e.toUpperCase())}function Pr(e){return JZ.has(e.toUpperCase())}function ZS(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function pp(e,t){let n=typeof t=="string"?Da(t).search:t.search;if(e[e.length-1].route.index&&ZS(n||""))return e[e.length-1];let r=XP(e);return r[r.length-1]}function e2(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 fx(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 jee(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 dd(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 Cee(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 ha(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 Eee(e,t){try{let n=e.sessionStorage.getItem(eN);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 Tee(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(eN,JSON.stringify(n))}catch(r){Un(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function Ree(){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 Ol=v.createContext(null);Ol.displayName="DataRouter";var Sf=v.createContext(null);Sf.displayName="DataRouterState";v.createContext(!1);var e1=v.createContext({isTransitioning:!1});e1.displayName="ViewTransition";var cN=v.createContext(new Map);cN.displayName="Fetchers";var _ee=v.createContext(null);_ee.displayName="Await";var Fo=v.createContext(null);Fo.displayName="Navigation";var wf=v.createContext(null);wf.displayName="Location";var oo=v.createContext({outlet:null,matches:[],isDataRoute:!1});oo.displayName="Route";var t1=v.createContext(null);t1.displayName="RouteError";function Aee(e,{relative:t}={}){St(jf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Fo),{hash:o,pathname:s,search:c}=Cf(e,{relative:t}),d=s;return n!=="/"&&(d=s==="/"?n:Ao([n,s])),r.createHref({pathname:d,search:c,hash:o})}function jf(){return v.useContext(wf)!=null}function ti(){return St(jf(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(wf).location}var uN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function dN(e){v.useContext(Fo).static||v.useLayoutEffect(e)}function kn(){let{isDataRoute:e}=v.useContext(oo);return e?Hee():Dee()}function Dee(){St(jf(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Ol),{basename:t,navigator:n}=v.useContext(Fo),{matches:r}=v.useContext(oo),{pathname:o}=ti(),s=JSON.stringify(YS(r)),c=v.useRef(!1);return dN(()=>{c.current=!0}),v.useCallback((f,p={})=>{if(Un(c.current,uN),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=KS(f,JSON.parse(s),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ao([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,o,e])}var kee=v.createContext(null);function Pee(e){let t=v.useContext(oo).outlet;return v.useMemo(()=>t&&v.createElement(kee.Provider,{value:e},t),[t,e])}function Ht(){let{matches:e}=v.useContext(oo),t=e[e.length-1];return t?t.params:{}}function Cf(e,{relative:t}={}){let{matches:n}=v.useContext(oo),{pathname:r}=ti(),o=JSON.stringify(YS(n));return v.useMemo(()=>KS(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function Nee(e,t){return fN(e,t)}function fN(e,t,n,r,o){St(jf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(Fo),{matches:c}=v.useContext(oo),d=c[c.length-1],f=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let E=g&&g.path||"";hN(p,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
244
|
-
|
|
245
|
-
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=ti(),b;if(t){let E=typeof t=="string"?Da(t):t;St(m==="/"||E.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 "${E.pathname}" was given in the \`location\` prop.`),b=E}else b=y;let S=b.pathname||"/",j=S;if(m!=="/"){let E=m.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(E.length).join("/")}let C=ds(e,{pathname:j});Un(g||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Un(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let R=zee(C&&C.map(E=>Object.assign({},E,{params:Object.assign({},f,E.params),pathname:Ao([m,s.encodeLocation?s.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:Ao([m,s.encodeLocation?s.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),c,n,r,o);return t&&R?v.createElement(wf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},R):R}function Oee(){let e=Fee(),t=Ud(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 Mee=v.createElement(Oee,null),Lee=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(){return this.state.error!==void 0?v.createElement(oo.Provider,{value:this.props.routeContext},v.createElement(t1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Iee({routeContext:e,match:t,children:n}){let r=v.useContext(Ol);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(oo.Provider,{value:e},n)}function zee(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);St(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:b}=n,S=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!b||b[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??{},errorInfo:g})}:void 0;return s.reduceRight((m,g,y)=>{let b,S=!1,j=null,C=null;n&&(b=c&&g.route.id?c[g.route.id]:void 0,j=g.route.errorElement||Mee,d&&(f<0&&y===0?(hN("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 R=t.concat(s.slice(0,y+1)),E=()=>{let T;return b?T=j:S?T=C:g.route.Component?T=v.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=m,v.createElement(Iee,{match:g,routeContext:{outlet:m,matches:R,isDataRoute:n!=null},children:T})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?v.createElement(Lee,{location:n.location,revalidation:n.revalidation,component:j,error:b,children:E(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:p}):E()},null)}function n1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $ee(e){let t=v.useContext(Ol);return St(t,n1(e)),t}function Uee(e){let t=v.useContext(Sf);return St(t,n1(e)),t}function Bee(e){let t=v.useContext(oo);return St(t,n1(e)),t}function r1(e){let t=Bee(e),n=t.matches[t.matches.length-1];return St(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Vee(){return r1("useRouteId")}function Fee(){let e=v.useContext(t1),t=Uee("useRouteError"),n=r1("useRouteError");return e!==void 0?e:t.errors?.[n]}function Hee(){let{router:e}=$ee("useNavigate"),t=r1("useNavigate"),n=v.useRef(!1);return dN(()=>{n.current=!0}),v.useCallback(async(o,s={})=>{Un(n.current,uN),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var t2={};function hN(e,t,n){!t&&!t2[e]&&(t2[e]=!0,Un(!1,n))}var n2={};function r2(e,t){!e&&!n2[t]&&(n2[t]=!0,console.warn(t))}function qee(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Un(!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&&Un(!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&&Un(!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 Gee=["HydrateFallback","hydrateFallbackElement"],Qee=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 Wee({router:e,flushSync:t,unstable_onError:n}){let[r,o]=v.useState(e.state),[s,c]=v.useState(),[d,f]=v.useState({isTransitioning:!1}),[p,m]=v.useState(),[g,y]=v.useState(),[b,S]=v.useState(),j=v.useRef(new Map),C=v.useCallback(k=>{o(I=>(k.errors&&n&&Object.entries(k.errors).forEach(([A,P])=>{I.errors?.[A]!==P&&n(P,{location:k.location,params:k.matches[0]?.params??{}})}),k))},[n]),R=v.useCallback((k,{deletedFetchers:I,flushSync:A,viewTransitionOpts:P})=>{k.fetchers.forEach((B,Y)=>{B.data!==void 0&&j.current.set(Y,B.data)}),I.forEach(B=>j.current.delete(B)),r2(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let z=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(r2(P==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."),!P||!z){t&&A?t(()=>C(k)):v.startTransition(()=>C(k));return}if(t&&A){t(()=>{g&&(p&&p.resolve(),g.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let B=e.window.document.startViewTransition(()=>{t(()=>C(k))});B.finished.finally(()=>{t(()=>{m(void 0),y(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>y(B));return}g?(p&&p.resolve(),g.skipTransition(),S({state:k,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(c(k),f({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[e.window,t,g,p,C]);v.useLayoutEffect(()=>e.subscribe(R),[e,R]),v.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new Qee)},[d]),v.useEffect(()=>{if(p&&s&&e.window){let k=s,I=p.promise,A=e.window.document.startViewTransition(async()=>{v.startTransition(()=>C(k)),await I});A.finished.finally(()=>{m(void 0),y(void 0),c(void 0),f({isTransitioning:!1})}),y(A)}},[s,p,e.window,C]),v.useEffect(()=>{p&&s&&r.location.key===s.location.key&&p.resolve()},[p,g,r.location,s]),v.useEffect(()=>{!d.isTransitioning&&b&&(c(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),S(void 0))},[d.isTransitioning,b]);let E=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:k=>e.navigate(k),push:(k,I,A)=>e.navigate(k,{state:I,preventScrollReset:A?.preventScrollReset}),replace:(k,I,A)=>e.navigate(k,{replace:!0,state:I,preventScrollReset:A?.preventScrollReset})}),[e]),T=e.basename||"/",_=v.useMemo(()=>({router:e,navigator:E,static:!1,basename:T,unstable_onError:n}),[e,E,T,n]);return v.createElement(v.Fragment,null,v.createElement(Ol.Provider,{value:_},v.createElement(Sf.Provider,{value:r},v.createElement(cN.Provider,{value:j.current},v.createElement(e1.Provider,{value:d},v.createElement(Xee,{basename:T,location:r.location,navigationType:r.historyAction,navigator:E},v.createElement(Yee,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var Yee=v.memo(Kee);function Kee({routes:e,future:t,state:n,unstable_onError:r}){return fN(e,void 0,n,r,t)}function i1(e){return Pee(e.context)}function $e(e){St(!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 Xee({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){St(!jf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=v.useMemo(()=>({basename:c,navigator:o,static:s,future:{}}),[c,o,s]);typeof n=="string"&&(n=Da(n));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:y="default"}=n,b=v.useMemo(()=>{let S=Oi(f,c);return S==null?null:{location:{pathname:S,search:p,hash:m,state:g,key:y},navigationType:r}},[c,f,p,m,g,y,r]);return Un(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:v.createElement(Fo.Provider,{value:d},v.createElement(wf.Provider,{children:t,value:b}))}function Jee({children:e,location:t}){return Nee(ab(e),t)}function ab(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,ab(r.props.children,s));return}St(r.type===$e,`[${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>`),St(!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=ab(r.props.children,s)),n.push(c)}),n}var mp="get",gp="application/x-www-form-urlencoded";function dg(e){return e!=null&&typeof e.tagName=="string"}function Zee(e){return dg(e)&&e.tagName.toLowerCase()==="button"}function ete(e){return dg(e)&&e.tagName.toLowerCase()==="form"}function tte(e){return dg(e)&&e.tagName.toLowerCase()==="input"}function nte(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rte(e,t){return e.button===0&&(!t||t==="_self")&&!nte(e)}function sb(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 ite(e,t){let n=sb(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}var Jh=null;function ote(){if(Jh===null)try{new FormData(document.createElement("form"),0),Jh=!1}catch{Jh=!0}return Jh}var ate=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function hx(e){return e!=null&&!ate.has(e)?(Un(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${gp}"`),null):e}function ste(e,t){let n,r,o,s,c;if(ete(e)){let d=e.getAttribute("action");r=d?Oi(d,t):null,n=e.getAttribute("method")||mp,o=hx(e.getAttribute("enctype"))||gp,s=new FormData(e)}else if(Zee(e)||tte(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?Oi(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||mp,o=hx(e.getAttribute("formenctype"))||hx(d.getAttribute("enctype"))||gp,s=new FormData(d,e),!ote()){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(dg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=mp,r=null,o=gp,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 o1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function lte(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&Oi(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function cte(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 ute(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 dte(e,t,n){let r=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let c=await cte(s,n);return c.links?c.links():[]}return[]}));return mte(r.flat(1).filter(ute).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function i2(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 fte(e,t,{includeHydrateFallback:n}={}){return hte(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 hte(e){return[...new Set(e)]}function pte(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function mte(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let s=JSON.stringify(pte(o));return n.has(s)||(n.add(s),r.push({key:s,link:o})),r},[])}function pN(){let e=v.useContext(Ol);return o1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gte(){let e=v.useContext(Sf);return o1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var a1=v.createContext(void 0);a1.displayName="FrameworkContext";function mN(){let e=v.useContext(a1);return o1(e,"You must render this element inside a <HydratedRouter> element"),e}function vte(e,t){let n=v.useContext(a1),[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=R=>{R.forEach(E=>{c(E.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 b=()=>{o(!0)},S=()=>{o(!1),c(!1)};return n?e!=="intent"?[s,y,{}]:[s,y,{onFocus:fd(d,b),onBlur:fd(f,S),onMouseEnter:fd(p,b),onMouseLeave:fd(m,S),onTouchStart:fd(g,b)}]:[!1,y,{}]}function fd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yte({page:e,...t}){let{router:n}=pN(),r=v.useMemo(()=>ds(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(bte,{page:e,matches:r,...t}):null}function xte(e){let{manifest:t,routeModules:n}=mN(),[r,o]=v.useState([]);return v.useEffect(()=>{let s=!1;return dte(e,t,n).then(c=>{s||o(c)}),()=>{s=!0}},[e,t,n]),r}function bte({page:e,matches:t,...n}){let r=ti(),{manifest:o,routeModules:s}=mN(),{basename:c}=pN(),{loaderData:d,matches:f}=gte(),p=v.useMemo(()=>i2(e,t,f,o,r,"data"),[e,t,f,o,r]),m=v.useMemo(()=>i2(e,t,f,o,r,"assets"),[e,t,f,o,r]),g=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,j=!1;if(t.forEach(R=>{let E=o.routes[R.route.id];!E||!E.hasLoader||(!p.some(T=>T.route.id===R.route.id)&&R.route.id in d&&s[R.route.id]?.shouldRevalidate||E.hasClientLoader?j=!0:S.add(R.route.id))}),S.size===0)return[];let C=lte(e,c,"data");return j&&S.size>0&&C.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[c,d,r,o,p,t,e,s]),y=v.useMemo(()=>fte(m,o),[m,o]),b=xte(m);return v.createElement(v.Fragment,null,g.map(S=>v.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),y.map(S=>v.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),b.map(({key:S,link:j})=>v.createElement("link",{key:S,nonce:n.nonce,...j})))}function Ste(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var gN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{gN&&(window.__reactRouterVersion="7.9.6")}catch{}function wte(e,t){return oee({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:xZ({window:t?.window}),hydrationData:jte(),routes:e,mapRouteProperties:qee,hydrationRouteProperties:Gee,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function jte(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Cte(e.errors)}),e}function Cte(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 Gp(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 vN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yN=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,...y},b){let{basename:S}=v.useContext(Fo),j=typeof p=="string"&&vN.test(p),C,R=!1;if(typeof p=="string"&&j&&(C=p,gN))try{let z=new URL(window.location.href),B=p.startsWith("//")?new URL(z.protocol+p):new URL(p),Y=Oi(B.pathname,S);B.origin===z.origin&&Y!=null?p=Y+B.search+B.hash:R=!0}catch{Un(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=Aee(p,{relative:o}),[T,_,k]=vte(r,y),I=_te(p,{replace:c,state:d,target:f,preventScrollReset:m,relative:o,viewTransition:g});function A(z){t&&t(z),z.defaultPrevented||I(z)}let P=v.createElement("a",{...y,...k,href:C||E,onClick:R||s?t:A,ref:Ste(b,_),target:f,"data-discover":!j&&n==="render"?"true":void 0});return T&&!j?v.createElement(v.Fragment,null,P,v.createElement(yte,{page:E})):P});yN.displayName="Link";var Ete=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=Cf(c,{relative:p.relative}),y=ti(),b=v.useContext(Sf),{navigator:S,basename:j}=v.useContext(Fo),C=b!=null&&Nte(g)&&d===!0,R=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,E=y.pathname,T=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(E=E.toLowerCase(),T=T?T.toLowerCase():null,R=R.toLowerCase()),T&&j&&(T=Oi(T,j)||T);const _=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let k=E===R||!o&&E.startsWith(R)&&E.charAt(_)==="/",I=T!=null&&(T===R||!o&&T.startsWith(R)&&T.charAt(R.length)==="/"),A={isActive:k,isPending:I,isTransitioning:C},P=k?t:void 0,z;typeof r=="function"?z=r(A):z=[r,k?"active":null,I?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let B=typeof s=="function"?s(A):s;return v.createElement(yN,{...p,"aria-current":P,className:z,ref:m,style:B,to:c,viewTransition:d},typeof f=="function"?f(A):f)});Ete.displayName="NavLink";var Tte=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:c=mp,action:d,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...y},b)=>{let S=kte(),j=Pte(d,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&vN.test(d),E=T=>{if(f&&f(T),T.defaultPrevented)return;T.preventDefault();let _=T.nativeEvent.submitter,k=_?.getAttribute("formmethod")||c;S(_||T.currentTarget,{fetcherKey:t,method:k,navigate:n,replace:o,state:s,relative:p,preventScrollReset:m,viewTransition:g})};return v.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:E,...y,"data-discover":!R&&e==="render"?"true":void 0})});Tte.displayName="Form";function Rte(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xN(e){let t=v.useContext(Ol);return St(t,Rte(e)),t}function _te(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:c}={}){let d=kn(),f=ti(),p=Cf(e,{relative:s});return v.useCallback(m=>{if(rte(m,t)){m.preventDefault();let g=n!==void 0?n:Mo(f)===Mo(p);d(e,{replace:g,state:r,preventScrollReset:o,relative:s,viewTransition:c})}},[f,d,p,n,r,t,e,o,s,c])}function s1(e){Un(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(sb(e)),n=v.useRef(!1),r=ti(),o=v.useMemo(()=>ite(r.search,n.current?null:t.current),[r.search]),s=kn(),c=v.useCallback((d,f)=>{const p=sb(typeof d=="function"?d(new URLSearchParams(o)):d);n.current=!0,s("?"+p,f)},[s,o]);return[o,c]}var Ate=0,Dte=()=>`__${String(++Ate)}__`;function kte(){let{router:e}=xN("useSubmit"),{basename:t}=v.useContext(Fo),n=Vee();return v.useCallback(async(r,o={})=>{let{action:s,method:c,encType:d,formData:f,body:p}=ste(r,t);if(o.navigate===!1){let m=o.fetcherKey||Dte();await e.fetch(m,n,o.action||s,{preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await e.navigate(o.action||s,{preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function Pte(e,{relative:t}={}){let{basename:n}=v.useContext(Fo),r=v.useContext(oo);St(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Cf(e||".",{relative:t})},c=ti();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:Ao([n,s.pathname])),Mo(s)}function Nte(e,{relative:t}={}){let n=v.useContext(e1);St(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=xN("useViewTransitionState"),o=Cf(e,{relative:t});if(!n.isTransitioning)return!1;let s=Oi(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Oi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return qp(o.pathname,c)!=null||qp(o.pathname,s)!=null}function l1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function Ote(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 Ds(e){return pl(e.getActiveLogin()?.project)}function fg(e){const t=_e(),n=Ds(t),r=kn(),[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(pu,{search:o,onClick:c=>r(`/admin/members/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})}function Mte(){return a.jsxs(a.Fragment,{children:[a.jsx(ze,{children:"Bots"}),a.jsx(fg,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(jt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function Lte(){return a.jsxs(a.Fragment,{children:[a.jsx(ze,{children:"Clients"}),a.jsx(fg,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(jt,{to:"/admin/clients/new",children:"Create new client"})})]})}function hg(e){return a.jsx(Pl,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Bo(t)?e.onChange(Qt(t)):e.onChange(void 0)}})}function Ite(){const e=_e(),t=Ds(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(ze,{children:"Create new Bot"}),a.jsxs(pt,{onSubmit:()=>{const y={name:n,description:o,accessPolicy:c};e.post("admin/projects/"+t+"/bot",y).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),Ne({color:"green",message:"Bot created"})}).catch(b=>{Ne({color:"red",message:Qe(b),autoClose:!1}),p(Yt(b))})},children:[!m&&a.jsxs(Ue,{children:[a.jsx($t,{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:Lt(f,"name")})}),a.jsx($t,{title:"Description",htmlFor:"description",outcome:f,children:a.jsx(He,{id:"description",name:"description",onChange:y=>s(y.currentTarget.value),error:Lt(f,"description")})}),a.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(hg,{name:"accessPolicy",onChange:d})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Pe,{type:"submit",children:"Create Bot"})})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Ee,{children:"Bot created"}),a.jsxs(Nr,{children:[a.jsx(Nr.Item,{children:a.jsx(jt,{to:m,children:"Go to new bot"})}),a.jsx(Nr.Item,{children:a.jsx(jt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function zte(){const e=_e(),t=Ds(e),[n,r]=v.useState(""),[o,s]=v.useState(""),[c,d]=v.useState(""),[f,p]=v.useState(),[m,g]=v.useState(),[y,b]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(ze,{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"),b(j),Ne({color:"green",message:"Client created"})}).catch(j=>{Ne({color:"red",message:Qe(j),autoClose:!1}),g(Yt(j))})},children:[!y&&a.jsxs(Ue,{children:[a.jsx($t,{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:Lt(m,"name")})}),a.jsx($t,{title:"Description",htmlFor:"description",outcome:m,children:a.jsx(He,{id:"description",name:"description",onChange:S=>s(S.currentTarget.value),error:Lt(m,"description")})}),a.jsx($t,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:a.jsx(He,{id:"redirectUri",name:"redirectUri",onChange:S=>d(S.currentTarget.value),error:Lt(m,"redirectUri")})}),a.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:a.jsx(hg,{name:"accessPolicy",onChange:p})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Pe,{type:"submit",children:"Create Client"})})]}),y&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Ee,{children:"Client created"}),a.jsxs(Nr,{children:[a.jsx(Nr.Item,{children:a.jsx(jt,{to:y,children:"Go to new client"})}),a.jsx(Nr.Item,{children:a.jsx(jt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function c1(e,t,n,r){const o=Date.now().toString();Ne({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(jt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&c.issue?.[0]?.details?.text&&(d=a.jsx(Ee,{children:c.issue[0].details.text})),Di.update({id:o,color:"green",title:t,message:d,icon:a.jsx(Vo,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw Di.update({id:o,color:"red",title:t,message:Qe(c),icon:a.jsx(yl,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function _c(e,t,n,r){c1(e,t,n,r).catch(()=>{})}const $te=8;function Ute({pillInputProps:e,inputProps:t,data:n,onChange:r}){const o=Rl({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(ya,{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]),b=v.useMemo(()=>{const S=new Array(Math.min(y.length,$te));for(let j=0;j<S.length;j++){const C=y[j];S[j]=a.jsx(Xe.Option,{value:C,active:d.includes(C),children:a.jsxs(ye,{gap:"sm",children:[d.includes(C)?a.jsx(Xd,{size:12}):null,a.jsx("span",{children:C})]})},C)}return S},[y,d]);return a.jsxs(Xe,{store:o,onOptionSubmit:p,withinPortal:!1,children:[a.jsx(Xe.DropdownTarget,{children:a.jsx(ys,{onClick:()=>o.openDropdown(),...e,children:a.jsxs(ya.Group,{children:[g,a.jsx(Xe.EventsTarget,{children:a.jsx(ys.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(Xe.Dropdown,{children:a.jsx(Xe.Options,{children:b.length>0?b:a.jsx(Xe.Empty,{children:"Nothing found..."})})})]})}function Bte({defaultGinPendingListLimit:e,availableTables:t,onResponse:n}){const r=_e(),[o,s]=v.useState(!1),[c,d]=v.useState([]),[f,p]=v.useState("unspecified"),[m,g]=v.useState("unspecified"),[y,b]=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),c1(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(Ue,{gap:"sm",maw:"800",children:[a.jsx(Qd,{label:"Table(s)",children:a.jsx(Ute,{data:t,onChange:j=>d(j),inputProps:{name:"tables",placeholder:"e.g. Observation"}})}),a.jsx(vr.Group,{name:"fastUpdate",label:"fastupdate",value:f,onChange:j=>p(j),children:a.jsxs(ye,{h:"36",children:[a.jsx(vr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(vr,{size:"sm",value:"reset",label:"reset to default (on)"}),a.jsx(vr,{size:"sm",value:"off",label:"off"}),a.jsx(vr,{size:"sm",value:"on",label:"on"})]})}),a.jsx(vr.Group,{name:"ginPendingListLimit",label:"gin_pending_list_limit",value:m,onChange:j=>{g(j),j!=="set"&&b(void 0)},children:a.jsxs(ye,{h:"36",children:[a.jsx(vr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(vr,{size:"sm",value:"reset",label:`reset to default (${e}kB)`}),a.jsxs(ye,{children:[a.jsx(vr,{size:"sm",value:"set",label:"Set to (kB)"}),a.jsx(Hc,{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=>{b(typeof j=="number"?j:void 0)}})]})]})}),a.jsx(ye,{justify:"center",children:a.jsx(Cr,{size:"sm",loading:o,children:"Update"})})]})})}const Vte=8;function Fte({inputProps:e,data:t,onChange:n}){const r=Rl({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,Vte));for(let g=0;g<m.length;g++){const y=f[g];m[g]=a.jsx(Xe.Option,{value:y,children:y},y)}return m},[f]);return a.jsxs(Xe,{store:r,withinPortal:!1,onOptionSubmit:m=>{n&&n(m),s(m),d(m),r.closeDropdown()},children:[a.jsx(Xe.Target,{children:a.jsx($r,{rightSection:a.jsx(Xe.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(Xe.Dropdown,{children:a.jsx(Xe.Options,{children:p.length>0?p:a.jsx(Xe.Empty,{children:"Nothing found"})})})]})}function Hte(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=Qc(t),t}function bN(e){return typeof e=="string"?e.length>50?e.substring(0,50)+"...":e:typeof e=="boolean"?e.toString().toLocaleUpperCase():e}function qte(){const e=_e(),[t,{open:n,close:r}]=Zc(!1),[o,s]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(void 0),[m,g]=v.useState(0),[y,b]=v.useState(!1),[S,j]=v.useState(void 0),[C,R]=v.useState([]),[E,T]=v.useState(0);v.useEffect(()=>{async function A(){return(await e.valueSetExpand({url:"https://medplum.com/fhir/ValueSet/resource-types",count:200})).expansion?.contains?.map(z=>z.code).filter(z=>z!==void 0)??[]}A().then(P=>{R(Hte(P))}).catch(console.error)},[e]),v.useEffect(()=>{b(!0),e.get("fhir/R4/$db-indexes?tableName="+encodeURIComponent(f??""),{cache:"no-cache"}).then(A=>{const P=A.parameter?.find(B=>B.name==="defaultGinPendingListLimit")?.valueInteger??0;g(P);const z=A.parameter?.filter(B=>B.name==="index");j(z??[])}).finally(()=>{b(!1)}).catch(A=>{Ne({color:"red",message:A.message})})},[e,f,E]);const _=A=>{s("Configure results"),d(a.jsx("pre",{children:JSON.stringify(A,null,2)})),n(),T(P=>(P+1)%100)},k={onClick:A=>{s("Details"),d(a.jsx("pre",{children:A})),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(Ue,{gap:"sm",children:[a.jsx("h2",{children:"Configure GIN indexes"}),a.jsx(ye,{children:a.jsx(Bte,{defaultGinPendingListLimit:m,availableTables:C,onResponse:_})}),a.jsx("h2",{children:"GIN index stats"}),a.jsxs(ye,{children:[a.jsx(Fte,{data:C,inputProps:{placeholder:"Table name",inputSize:"50"},onChange:A=>{p(A)}}),a.jsx(Pe,{loading:y,onClick:()=>T(A=>(A+1)%100),disabled:!f,children:"Refresh"})]}),a.jsx(de.ScrollContainer,{minWidth:500,children:a.jsxs(de,{striped:!0,highlightOnHover:!0,children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[a.jsx(de.Th,{children:"Schema"}),a.jsx(de.Th,{children:"Table"}),a.jsx(de.Th,{children:"Index"}),a.jsx(de.Th,{children:"fastupdate"}),a.jsx(de.Th,{children:"gin_pending_list_limit"}),a.jsx(de.Th,{children:"options"})]})}),a.jsxs(de.Tbody,{children:[I&&a.jsx(de.Tr,{children:a.jsx(de.Td,{colSpan:16,children:I})}),!I&&S?.map(A=>{const P=A.part??[],z=P.find(B=>B.name==="indexName")?.valueString;if(!z)throw new Error("Index missing name",{cause:A});return a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:P.find(B=>B.name==="schemaName")?.valueString}),a.jsx(de.Td,{children:P.find(B=>B.name==="tableName")?.valueString}),a.jsx(de.Td,{children:z}),a.jsx(px,{value:P.find(B=>B.name==="fastUpdate")?.valueBoolean,defaultValue:a.jsxs(Ee,{span:!0,c:"dimmed",fs:"italic",children:["default (",bN(!0),")"]}),...k}),a.jsx(px,{value:P.find(B=>B.name==="ginPendingListLimit")?.valueInteger,defaultValue:a.jsxs(Ee,{span:!0,c:"dimmed",fs:"italic",children:["default (",m,")"]}),...k}),a.jsx(px,{value:P.find(B=>B.name==="indexOptions")?.valueString,defaultValue:a.jsx(Ee,{span:!0,c:"dimmed",fs:"italic",children:"NULL"}),...k})]},z)})]})]})})]}),a.jsx(Vn,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function px({value:e,onClick:t,defaultValue:n}){return a.jsx(de.Td,{style:{cursor:"pointer"},onClick:()=>t?.(e),children:e===void 0?n:bN(e)})}function Gte(){const e=_e(),t=["GIN Indexes"],[n,r]=v.useState(t[0]);function o(s){s||(s=t[0]),r(s)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(Er,{outcome:lf}):a.jsx(fu,{maw:"100%",children:a.jsxs(kl,{children:[a.jsx(ze,{order:1,children:"Database Tools"}),a.jsxs(Pt,{value:n,onChange:o,children:[a.jsx(Pt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:t.map(s=>a.jsx(Pt.Tab,{value:s,children:s},s))}),a.jsx(Pt.Panel,{value:"GIN Indexes",pt:"md",children:a.jsx(qte,{})})]})]})})}function Qte(e){return a.jsx(Pl,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Bo(t)?e.onChange(Qt(t)):e.onChange(void 0)}})}function Wte(){const{membershipId:e}=Ht(),t=_e(),n=Ds(t),r=kn(),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(),[b,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(Yt(C)))}return a.jsxs(a.Fragment,{children:[a.jsx(ze,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(Ic,{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(R=>y(Yt(R)))},children:[!b&&a.jsxs(Ue,{children:[a.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:a.jsx(hg,{name:"accessPolicy",defaultValue:s,onChange:c})}),a.jsx($t,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:a.jsx(Qte,{name:"userConfiguration",defaultValue:d,onChange:f})}),a.jsx($t,{title:"Admin",htmlFor:"admin",outcome:g,children:a.jsx($n,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),a.jsxs(ye,{justify:"flex-end",mt:"xl",children:[a.jsx(Pe,{type:"submit",children:"Save"}),a.jsx(Pe,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&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(jt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function Yte(){const e=_e(),[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 b={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,b).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),zm(S)?c(S):m(S),f(b.sendEmail??!1),Ne({color:"green",message:"Invite success"})}).catch(S=>{Ne({color:"red",message:Qe(S),autoClose:!1}),c(Yt(S))})},[e,t,r]);return a.jsxs(pt,{onSubmit:g,children:[!p&&!s&&a.jsxs(Ue,{children:[a.jsx(ze,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx($t,{title:"Project",htmlFor:"project",outcome:s,children:a.jsx(Pl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(fn,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Lt(s,"resourceType")}),a.jsx(He,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Lt(s,"firstName")}),a.jsx(He,{name:"lastName",label:"Last Name",required:!0,error:Lt(s,"lastName")}),a.jsx(He,{name:"email",type:"email",label:"Email",required:!0,error:Lt(s,"email")}),a.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:a.jsx(hg,{name:"accessPolicy",onChange:o})}),a.jsx($n,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx($n,{name:"isAdmin",label:"Admin"}),a.jsx($n,{name:"isProjectScoped",label:"Project scoped"}),a.jsx($n,{name:"mfaRequired",label:"MFA required"}),a.jsx(ye,{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(jt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Ee,{children:"User created"}),d&&a.jsx(Ee,{children:"Email sent"}),a.jsxs(Nr,{children:[a.jsx(Nr.Item,{children:a.jsx(jt,{to:p,children:"Go to new membership"})}),a.jsx(Nr.Item,{children:a.jsx(jt,{to:p.profile,children:"Go to new profile"})}),a.jsx(Nr.Item,{children:a.jsx(jt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function Kte(){return a.jsxs(a.Fragment,{children:[a.jsx(ze,{children:"Patients"}),a.jsx(fg,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(jt,{to:"/admin/invite",children:"Invite new patient"})})]})}function Xte(){const e=_e();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(Er,{outcome:lf});function t(n){e.post("admin/projects/setpassword",n).then(()=>Ne({color:"green",message:"Done"})).catch(r=>Ne({color:"red",message:Qe(r),autoClose:!1}))}return a.jsxs(dt,{width:600,children:[a.jsx(ze,{order:1,children:"Project Admin"}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{order:2,children:"Force Set Password"}),a.jsx(Ee,{children:"Sets the password for the specified user in this project."}),a.jsx(Ee,{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(Ue,{children:[a.jsx(He,{name:"email",label:"Email",required:!0}),a.jsx(Ki,{name:"password",label:"Password",required:!0}),a.jsx(Pe,{type:"submit",children:"Force Set Password"})]})})]})}function o2(){const e=_e(),t=Ds(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(ze,{children:"Details"}),a.jsxs(yf,{children:[a.jsx(Lr,{term:"ID",children:n.project.id}),a.jsx(Lr,{term:"Name",children:n.project.name})]})]})}const a2=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function Jte(){const e=kn(),n=ti().pathname.replace("/admin/","")||a2[0],r=_e(),o=Ds(r),s=v.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function c(d){e(`/admin/${d}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(Or,{children:[a.jsx(xt,{children:a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"Project"}),a.jsx(xt.Value,{children:s.project.name})]})}),a.jsx(Jr,{children:a.jsx(Pt,{value:n.toLowerCase(),onChange:c,children:a.jsx(Pt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:a2.map(d=>a.jsx(Pt.Tab,{value:d.toLowerCase(),children:d},d))})})})]}),a.jsx(dt,{children:a.jsx(i1,{})})]})}function Zte(){const e=_e(),t=Ds(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(hi(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(()=>Ne({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(ze,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(xf,{property:_s("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(Pe,{type:"submit",children:"Save"})]})}function ene(){const e=_e(),t=Ds(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(hi(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(()=>Ne({color:"green",message:"Saved"})).catch(f=>{const p=Yt(f);Ne({color:"red",message:`Error ${p.issue?.[0].details?.text} ${p.issue?.[0].expression?.[0]}`,autoClose:!1})})},children:[a.jsx(ze,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(xf,{property:_s("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(Pe,{type:"submit",children:"Save"})]})}const SN="System AsyncJob",wN="Post-deploy Migrations",Zh=[wN,SN];function tne(){const e=_e(),[t,n]=v.useState(Zh[0]);function r(o){o||=Zh[0],Zh.includes(o)&&n(o)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(Er,{outcome:lf}):a.jsx(fu,{miw:"1600",maw:"2000",children:a.jsxs(kl,{children:[a.jsx(ze,{order:1,children:"AsyncJob Dashboard"}),a.jsxs(Pt,{keepMounted:!1,value:t,onChange:r,children:[a.jsx(Pt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Zh.map(o=>a.jsx(Pt.Tab,{value:o,children:o},o))}),a.jsx(Pt.Panel,{value:SN,pt:"md",children:a.jsx(rne,{})}),a.jsx(Pt.Panel,{value:wN,pt:"md",children:a.jsx(one,{})})]})]})})}const nne={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:he.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function rne(){const e=kn(),[t]=v.useState(nne);return a.jsxs(Ue,{children:[a.jsx(jt,{to:`/${t.resourceType}/${ps(t)}`,children:"Show in search page"}),a.jsx(pu,{checkboxesEnabled:!1,search:t,onClick:n=>e(s2(n.resource))?.catch(console.error),onAuxClick:n=>window.open(s2(n.resource),"_blank")})]})}const ine={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 one(){const e=_e(),[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((R,E)=>E-R),n(C)}).catch(C=>{Ne({color:"red",message:Qe(C),autoClose:!1})}).finally(()=>m(C=>C.filter(R=>R!==j)))},[e,d]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",ps({...ine,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{o(C.entry?.map(R=>R.resource))})).catch(C=>{o(void 0),Ne({color:"red",message:Qe(C),autoClose:!1})}).finally(()=>m(C=>C.filter(R=>R!==j)))},[e,d]);function g(){f(j=>j+1)}function y(j){c1(e,"Run pending post-deploy migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const b=p.length>0;function S(j,{isLoading:C}){return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(ym,{visible:C}),a.jsxs(de,{children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[a.jsx(de.Th,{children:"Version"}),a.jsx(de.Th,{children:"Action"}),a.jsx(de.Th,{children:"Status"}),a.jsx(de.Th,{children:"AsyncJob"}),a.jsx(de.Th,{children:"Last Updated"}),a.jsx(de.Th,{children:"Request Time"}),a.jsx(de.Th,{children:"Duration"}),a.jsx(de.Th,{children:"Attempts"})]})}),a.jsx(de.Tbody,{children:j()})]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(Pe,{size:"xs",mb:"xs",variant:"subtle",leftSection:a.jsx($k,{size:14}),onClick:g,loading:b,children:"Refresh"}),S(()=>{if(!b){if(!t)return a.jsx(de.Tr,{children:a.jsx(de.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return a.jsx(de.Tr,{children:a.jsx(de.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:t.postDeployMigrations?.map(j=>{const{status:C,asyncJob:R,asyncJobs:E}=ane(j,r??[],t?.pendingPostDeployMigration),T=s.includes(j),_=j===t?.pendingPostDeployMigration&&(!R||R?.status==="error"),k=[a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:j}),a.jsx(de.Td,{children:_&&a.jsx(Pe,{color:"green",size:"xs",onClick:()=>y(j),children:"Start"})}),a.jsx(de.Td,{children:C}),a.jsx(de.Td,{children:R&&a.jsx(jt,{to:`/AsyncJob/${R?.id}`,children:R?.id})}),a.jsx(de.Td,{children:R?.meta?.lastUpdated}),a.jsx(de.Td,{children:R?.requestTime}),a.jsx(de.Td,{children:l2(R)}),a.jsx(de.Td,{display:"flex",children:a.jsxs(ye,{gap:"xs",children:[E.length?E.length:"",T&&E.length>1&&a.jsx(Pe,{leftSection:a.jsx(Zq,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(j)?I.filter(A=>A!==j):I),children:"Hide all"}),!T&&E.length>1&&a.jsx(Pe,{leftSection:a.jsx(zk,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(j)?I:[...I,j]),children:"Show all"})]})})]},j)];return T&&k.push(...E.filter(I=>I.id!==R?.id).map(I=>a.jsxs(de.Tr,{bg:"gray.1",children:[a.jsx(de.Td,{children:j}),a.jsx(de.Td,{}),a.jsx(de.Td,{children:I.status}),a.jsx(de.Td,{children:a.jsx(jt,{to:`/AsyncJob/${I.id}`,children:I.id})}),a.jsx(de.Td,{children:I.meta?.lastUpdated}),a.jsx(de.Td,{children:I.requestTime}),a.jsx(de.Td,{children:l2(I)}),a.jsx(de.Td,{})]},I.id))),k})},{isLoading:b})]})}function ane(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 s2(e){return`/${e.resourceType}/${e.id}`}function l2(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 sne(){const e=_e(),[t,{open:n,close:r}]=Zc(!1),[o,s]=v.useState(""),[c,d]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(Er,{outcome:lf});function f(){_c(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){_c(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){_c(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(_){_c(e,"Reindexing Resources","admin/super/reindex",_)}function y(){_c(e,"Reload Cron Resources","admin/super/reloadcron")}function b(_){e.post("admin/super/removebotidjobsfromqueue",_).then(()=>Ne({color:"green",message:"Done"})).catch(k=>Ne({color:"red",message:Qe(k),autoClose:!1}))}function S(_){e.post("admin/super/purge",{..._,before:IS(_.before)}).then(()=>Ne({color:"green",message:"Done"})).catch(k=>Ne({color:"red",message:Qe(k),autoClose:!1}))}function j(_){e.post("admin/super/setpassword",_).then(()=>Ne({color:"green",message:"Done"})).catch(k=>Ne({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=>Ne({color:"red",message:Qe(k),autoClose:!1}))}function R(){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(`
|
|
246
|
-
`)})),n()}).catch(_=>Ne({color:"red",message:Qe(_),autoClose:!1}))}function E(){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(_=>Ne({color:"red",message:Qe(_),autoClose:!1}))}function T(){_c(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return a.jsxs(dt,{width:600,children:[a.jsx(ze,{order:1,children:"Super Admin"}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Pe,{onClick:f,children:"Rebuild StructureDefinitions"})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Pe,{onClick:p,children:"Rebuild SearchParameters"})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Pe,{onClick:m,children:"Rebuild ValueSets"})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Ue,{children:[a.jsx($t,{title:"Resource Type",htmlFor:"resourceType",children:a.jsx(He,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx($t,{title:"Search Filter",htmlFor:"filter",children:a.jsx(He,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),a.jsx($t,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:a.jsx(lne,{})}),a.jsx(Pe,{type:"submit",children:"Reindex"})]})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Ue,{children:[a.jsx($t,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(fn,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx($t,{title:"Purge Before",htmlFor:"before",children:a.jsx(_o,{name:"before",placeholder:"Before Date"})}),a.jsx(Pe,{type:"submit",children:"Purge"})]})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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:b,children:a.jsxs(Ue,{children:[a.jsx($t,{title:"Bot ID",children:a.jsx(He,{name:"botId",placeholder:"Bot Id"})}),a.jsx(Pe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Ue,{children:[a.jsx(He,{name:"email",label:"Email",required:!0}),a.jsx(Ki,{name:"password",label:"Password",required:!0}),a.jsx(He,{name:"projectId",label:"Project ID"}),a.jsx(Pe,{type:"submit",children:"Force Set Password"})]})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{order:2,children:"Database Stats"}),a.jsx("p",{children:"Query current table statistics from the database."}),a.jsx(pt,{onSubmit:C,children:a.jsxs(Ue,{children:[a.jsx($t,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:a.jsx(He,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),a.jsx(Pe,{type:"submit",children:"Get Database Stats"})]})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{order:2,children:"Database Invalid Indexes"}),a.jsx("p",{children:"Query invalid indexes from the database."}),a.jsx(pt,{onSubmit:R,children:a.jsx(Ue,{children:a.jsx(Pe,{type:"submit",children:"Get Database Invalid Indexes"})})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{order:2,children:"Database Schema Drift"}),a.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),a.jsxs(Sr,{children:[a.jsx(Sr.Col,{span:6,children:a.jsx(pt,{onSubmit:E,children:a.jsx(Ue,{children:a.jsx(Pe,{type:"submit",children:"Get Schema Drift"})})})}),a.jsx(Sr.Col,{span:6,children:a.jsx(pt,{onSubmit:T,children:a.jsx(Ue,{children:a.jsx(Pe,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Ue,{children:a.jsx(Pe,{type:"submit",children:"Reload Cron Resources"})})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(cne,{setModalTitle:s,setModalContent:d,openModal:n}),a.jsx(Vn,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function lne(){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(Hc,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function cne({setModalTitle:e,setModalContent:t,openModal:n}){const r=_e(),[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(Qt(j[0]))}).catch(j=>{console.error(j),Ne({color:"red",message:Qe(j),autoClose:!1})})},[r,c,o]);const b=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){Ne({color:"red",message:"Query is required",autoClose:!1});return}const C=j.onBehalfOfProjectMembership;delete j.onBehalfOfProjectMembership;const R={query:j.query,analyze:j.analyze==="on",format:"text"},E={};C&&(E["x-medplum-on-behalf-of"]=C),r.post("fhir/R4/$explain",R,void 0,{headers:E}).then(T=>{e("Database Explain");const _=T.parameter?.find(P=>P.name==="explain")?.valueString,k=T.parameter?.find(P=>P.name==="query")?.valueString,I=T.parameter?.find(P=>P.name==="parameters")?.valueString,A=[k,I,`
|
|
247
|
-
`,_].join(`
|
|
248
|
-
`);t(a.jsx(Jd,{block:!0,maw:"100%",children:A})),n()}).catch(T=>{Ne({color:"red",message:Qe(T),autoClose:!1})})}return!r.isLoading()&&!r.isSuperAdmin()?a.jsx(Er,{outcome:lf}):a.jsx(pt,{onSubmit:S,children:a.jsxs(Ue,{children:[a.jsx(He,{name:"query",label:"Search",required:!0,placeholder:"Observation?code=85354-9&_sort=-date&_count=5"}),a.jsx($n,{name:"analyze",label:"Analyze"}),a.jsx(Qd,{label:"On Behalf Of",children:a.jsxs(Ue,{gap:"sm",children:[a.jsx(vs,{required:!0,placeholder:"Project",targetTypes:["Project"],name:"onBehalfOfProject",onChange:s}),a.jsx(vs,{required:!0,placeholder:"Practitioner or Patient",name:"onBehalfOfProfile",targetTypes:["Practitioner","Patient"],onChange:d,searchCriteria:y}),f?.length!==1&&a.jsx(vs,{required:!0,placeholder:"ProjectMembership",name:"onBehalfOfProjectMembership",targetTypes:["ProjectMembership"],onChange:g,searchCriteria:b}),f?.length===1&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"hidden",name:"onBehalfOfProjectMembership",value:Ot(f[0])}),a.jsx(zp,{value:Qt(f[0])})]}),!m&&a.jsx(Ee,{fs:"italic",children:"On Behalf Of not set. Running as super admin"})]})}),a.jsx(Pe,{type:"submit",children:"Explain Search"})]})})}function une(){return a.jsxs(a.Fragment,{children:[a.jsx(ze,{children:"Users"}),a.jsx(fg,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(jt,{to:"/admin/invite",children:"Invite new user"})})]})}const dne=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 Xc(e,t,n){const r=fne(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&c2(r,"path",s),c2(r,"relativePath",s),r}function fne(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=dne.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function c2(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const hne=[".DS_Store","Thumbs.db"];function pne(e){return jl(this,void 0,void 0,function*(){return Wp(e)&&mne(e.dataTransfer)?xne(e.dataTransfer,e.type):gne(e)?vne(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?yne(e):[]})}function mne(e){return Wp(e)}function gne(e){return Wp(e)&&Wp(e.target)}function Wp(e){return typeof e=="object"&&e!==null}function vne(e){return lb(e.target.files).map(t=>Xc(t))}function yne(e){return jl(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Xc(n))})}function xne(e,t){return jl(this,void 0,void 0,function*(){if(e.items){const n=lb(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(bne));return u2(jN(r))}return u2(lb(e.files).map(n=>Xc(n)))})}function u2(e){return e.filter(t=>hne.indexOf(t.name)===-1)}function lb(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 bne(e){if(typeof e.webkitGetAsEntry!="function")return d2(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?CN(t):d2(e,t)}function jN(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?jN(n):[n]],[])}function d2(e,t){return jl(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,Xc(c)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Xc(r,(n=t?.fullPath)!==null&&n!==void 0?n:void 0)})}function Sne(e){return jl(this,void 0,void 0,function*(){return e.isDirectory?CN(e):wne(e)})}function CN(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function s(){t.readEntries(c=>jl(this,void 0,void 0,function*(){if(c.length){const d=Promise.all(c.map(Sne));o.push(d),s()}else try{const d=yield Promise.all(o);n(d)}catch(d){r(d)}}),c=>{r(c)})}s()})}function wne(e){return jl(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Xc(r,e.fullPath);t(o)},r=>{n(r)})})})}var ep={},f2;function jne(){return f2||(f2=1,ep.__esModule=!0,ep.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}),ep}var Cne=jne();const mx=Xp(Cne);function h2(e){return Rne(e)||Tne(e)||TN(e)||Ene()}function Ene(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
249
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rne(e){if(Array.isArray(e))return cb(e)}function p2(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 m2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p2(Object(n),!0).forEach(function(r){EN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bd(e,t){return Dne(e)||Ane(e,t)||TN(e,t)||_ne()}function _ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
250
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TN(e,t){if(e){if(typeof e=="string")return cb(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 cb(e,t)}}function cb(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 Ane(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 Dne(e){if(Array.isArray(e))return e}var kne=typeof mx=="function"?mx:mx.default,Pne="file-invalid-type",Nne="file-too-large",One="file-too-small",Mne="too-many-files",Lne=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:Pne,message:"File type must be ".concat(r)}},g2=function(t){return{code:Nne,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},v2=function(t){return{code:One,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ine={code:Mne,message:"Too many files"};function RN(e,t){var n=e.type==="application/x-moz-file"||kne(e,t);return[n,n?null:Lne(t)]}function _N(e,t,n){if(tl(e.size))if(tl(t)&&tl(n)){if(e.size>n)return[!1,g2(n)];if(e.size<t)return[!1,v2(t)]}else{if(tl(t)&&e.size<t)return[!1,v2(t)];if(tl(n)&&e.size>n)return[!1,g2(n)]}return[!0,null]}function tl(e){return e!=null}function zne(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=RN(f,n),m=Bd(p,1),g=m[0],y=_N(f,r,o),b=Bd(y,1),S=b[0],j=d?d(f):null;return g&&S&&!j})}function Yp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function tp(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 y2(e){e.preventDefault()}function $ne(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Une(e){return e.indexOf("Edge/")!==-1}function Bne(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return $ne(e)||Une(e)}function go(){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!Yp(r)&&d&&d.apply(void 0,[r].concat(s)),Yp(r)})}}function Vne(){return"showOpenFilePicker"in window}function Fne(e){if(tl(e)){var t=Object.entries(e).filter(function(n){var r=Bd(n,2),o=r[0],s=r[1],c=!0;return AN(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(DN))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=Bd(r,2),s=o[0],c=o[1];return m2(m2({},n),{},EN({},s,c))},{});return[{description:"Files",accept:t}]}return e}function Hne(e){if(tl(e))return Object.entries(e).reduce(function(t,n){var r=Bd(n,2),o=r[0],s=r[1];return[].concat(h2(t),[o],h2(s))},[]).filter(function(t){return AN(t)||DN(t)}).join(",")}function qne(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Gne(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function AN(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function DN(e){return/^.*\.[\w]+$/.test(e)}var Qne=["children"],Wne=["open"],Yne=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Kne=["refKey","onChange","onClick"];function Xne(e){return ere(e)||Zne(e)||kN(e)||Jne()}function Jne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
251
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ere(e){if(Array.isArray(e))return ub(e)}function gx(e,t){return rre(e)||nre(e,t)||kN(e,t)||tre()}function tre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
252
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kN(e,t){if(e){if(typeof e=="string")return ub(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 ub(e,t)}}function ub(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 nre(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 rre(e){if(Array.isArray(e))return e}function x2(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 On(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x2(Object(n),!0).forEach(function(r){db(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function db(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kp(e,t){if(e==null)return{};var n=ire(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 ire(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 u1=v.forwardRef(function(e,t){var n=e.children,r=Kp(e,Qne),o=NN(r),s=o.open,c=Kp(o,Wne);return v.useImperativeHandle(t,function(){return{open:s}},[s]),Mn.createElement(v.Fragment,null,n(On(On({},c),{},{open:s})))});u1.displayName="Dropzone";var PN={disabled:!1,getFilesFromEvent:pne,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};u1.defaultProps=PN;u1.propTypes={children:un.func,accept:un.objectOf(un.arrayOf(un.string)),multiple:un.bool,preventDropOnDocument:un.bool,noClick:un.bool,noKeyboard:un.bool,noDrag:un.bool,noDragEventsBubbling:un.bool,minSize:un.number,maxSize:un.number,maxFiles:un.number,disabled:un.bool,getFilesFromEvent:un.func,onFileDialogCancel:un.func,onFileDialogOpen:un.func,useFsAccessApi:un.bool,autoFocus:un.bool,onDragEnter:un.func,onDragLeave:un.func,onDragOver:un.func,onDrop:un.func,onDropAccepted:un.func,onDropRejected:un.func,onError:un.func,validator:un.func};var fb={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function NN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=On(On({},PN),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,b=t.onDropAccepted,S=t.onDropRejected,j=t.onFileDialogCancel,C=t.onFileDialogOpen,R=t.useFsAccessApi,E=t.autoFocus,T=t.preventDropOnDocument,_=t.noClick,k=t.noKeyboard,I=t.noDrag,A=t.noDragEventsBubbling,P=t.onError,z=t.validator,B=v.useMemo(function(){return Hne(n)},[n]),Y=v.useMemo(function(){return Fne(n)},[n]),J=v.useMemo(function(){return typeof C=="function"?C:b2},[C]),Z=v.useMemo(function(){return typeof j=="function"?j:b2},[j]),$=v.useRef(null),Q=v.useRef(null),M=v.useReducer(ore,fb),L=gx(M,2),U=L[0],V=L[1],K=U.isFocused,O=U.isFileDialogActive,F=v.useRef(typeof window<"u"&&window.isSecureContext&&R&&Vne()),ae=function(){!F.current&&O&&setTimeout(function(){if(Q.current){var qe=Q.current.files;qe.length||(V({type:"closeDialog"}),Z())}},300)};v.useEffect(function(){return window.addEventListener("focus",ae,!1),function(){window.removeEventListener("focus",ae,!1)}},[Q,O,Z,F]);var ue=v.useRef([]),be=function(qe){$.current&&$.current.contains(qe.target)||(qe.preventDefault(),ue.current=[])};v.useEffect(function(){return T&&(document.addEventListener("dragover",y2,!1),document.addEventListener("drop",be,!1)),function(){T&&(document.removeEventListener("dragover",y2),document.removeEventListener("drop",be))}},[$,T]),v.useEffect(function(){return!r&&E&&$.current&&$.current.focus(),function(){}},[$,E,r]);var we=v.useCallback(function(pe){P?P(pe):console.error(pe)},[P]),Ce=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Oe(pe),ue.current=[].concat(Xne(ue.current),[pe.target]),tp(pe)&&Promise.resolve(o(pe)).then(function(qe){if(!(Yp(pe)&&!A)){var je=qe.length,Ae=je>0&&zne({files:qe,accept:B,minSize:c,maxSize:s,multiple:d,maxFiles:f,validator:z}),_t=je>0&&!Ae;V({isDragAccept:Ae,isDragReject:_t,isDragActive:!0,type:"setDraggedFiles"}),p&&p(pe)}}).catch(function(qe){return we(qe)})},[o,p,we,A,B,c,s,d,f,z]),nt=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Oe(pe);var qe=tp(pe);if(qe&&pe.dataTransfer)try{pe.dataTransfer.dropEffect="copy"}catch{}return qe&&g&&g(pe),!1},[g,A]),De=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Oe(pe);var qe=ue.current.filter(function(Ae){return $.current&&$.current.contains(Ae)}),je=qe.indexOf(pe.target);je!==-1&&qe.splice(je,1),ue.current=qe,!(qe.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),tp(pe)&&m&&m(pe))},[$,m,A]),ft=v.useCallback(function(pe,qe){var je=[],Ae=[];pe.forEach(function(_t){var Zn=RN(_t,B),vn=gx(Zn,2),Pn=vn[0],yn=vn[1],En=_N(_t,c,s),Nn=gx(En,2),lr=Nn[0],Tn=Nn[1],Ho=z?z(_t):null;if(Pn&&lr&&!Ho)je.push(_t);else{var ao=[yn,Tn];Ho&&(ao=ao.concat(Ho)),Ae.push({file:_t,errors:ao.filter(function(so){return so})})}}),(!d&&je.length>1||d&&f>=1&&je.length>f)&&(je.forEach(function(_t){Ae.push({file:_t,errors:[Ine]})}),je.splice(0)),V({acceptedFiles:je,fileRejections:Ae,isDragReject:Ae.length>0,type:"setFiles"}),y&&y(je,Ae,qe),Ae.length>0&&S&&S(Ae,qe),je.length>0&&b&&b(je,qe)},[V,d,B,c,s,f,y,b,S,z]),ot=v.useCallback(function(pe){pe.preventDefault(),pe.persist(),Oe(pe),ue.current=[],tp(pe)&&Promise.resolve(o(pe)).then(function(qe){Yp(pe)&&!A||ft(qe,pe)}).catch(function(qe){return we(qe)}),V({type:"reset"})},[o,ft,we,A]),ht=v.useCallback(function(){if(F.current){V({type:"openDialog"}),J();var pe={multiple:d,types:Y};window.showOpenFilePicker(pe).then(function(qe){return o(qe)}).then(function(qe){ft(qe,null),V({type:"closeDialog"})}).catch(function(qe){qne(qe)?(Z(qe),V({type:"closeDialog"})):Gne(qe)?(F.current=!1,Q.current?(Q.current.value=null,Q.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}Q.current&&(V({type:"openDialog"}),J(),Q.current.value=null,Q.current.click())},[V,J,Z,R,ft,we,Y,d]),st=v.useCallback(function(pe){!$.current||!$.current.isEqualNode(pe.target)||(pe.key===" "||pe.key==="Enter"||pe.keyCode===32||pe.keyCode===13)&&(pe.preventDefault(),ht())},[$,ht]),yt=v.useCallback(function(){V({type:"focus"})},[]),mt=v.useCallback(function(){V({type:"blur"})},[]),It=v.useCallback(function(){_||(Bne()?setTimeout(ht,0):ht())},[_,ht]),Te=function(qe){return r?null:qe},Re=function(qe){return k?null:Te(qe)},Ie=function(qe){return I?null:Te(qe)},Oe=function(qe){A&&qe.stopPropagation()},ct=v.useMemo(function(){return function(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},qe=pe.refKey,je=qe===void 0?"ref":qe,Ae=pe.role,_t=pe.onKeyDown,Zn=pe.onFocus,vn=pe.onBlur,Pn=pe.onClick,yn=pe.onDragEnter,En=pe.onDragOver,Nn=pe.onDragLeave,lr=pe.onDrop,Tn=Kp(pe,Yne);return On(On(db({onKeyDown:Re(go(_t,st)),onFocus:Re(go(Zn,yt)),onBlur:Re(go(vn,mt)),onClick:Te(go(Pn,It)),onDragEnter:Ie(go(yn,Ce)),onDragOver:Ie(go(En,nt)),onDragLeave:Ie(go(Nn,De)),onDrop:Ie(go(lr,ot)),role:typeof Ae=="string"&&Ae!==""?Ae:"presentation"},je,$),!r&&!k?{tabIndex:0}:{}),Tn)}},[$,st,yt,mt,It,Ce,nt,De,ot,k,I,r]),tt=v.useCallback(function(pe){pe.stopPropagation()},[]),lt=v.useMemo(function(){return function(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},qe=pe.refKey,je=qe===void 0?"ref":qe,Ae=pe.onChange,_t=pe.onClick,Zn=Kp(pe,Kne),vn=db({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(go(Ae,ot)),onClick:Te(go(_t,tt)),tabIndex:-1},je,Q);return On(On({},vn),Zn)}},[Q,n,d,ot,r]);return On(On({},U),{},{isFocused:K&&!r,getRootProps:ct,getInputProps:lt,rootRef:$,inputRef:Q,open:Te(ht)})}function ore(e,t){switch(t.type){case"focus":return On(On({},e),{},{isFocused:!0});case"blur":return On(On({},e),{},{isFocused:!1});case"openDialog":return On(On({},fb),{},{isFileDialogActive:!0});case"closeDialog":return On(On({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return On(On({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return On(On({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return On({},fb);default:return e}}function b2(){}const[are,sre]=jr("Dropzone component was not found in tree");function d1(e){const t=n=>{const{children:r,...o}=ie(`Dropzone${cE(e)}`,{},n),s=sre(),c=Lo(r)?r:a.jsx("span",{children:r});return s[e]?v.cloneElement(c,o):null};return t.displayName=`@mantine/dropzone/${cE(e)}`,t}const lre=d1("accept"),cre=d1("reject"),ure=d1("idle");var Vd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const dre={multiple:!0,maxSize:1/0,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},fre=(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":Ft(t),"--dropzone-accept-color":s.color,"--dropzone-accept-bg":s.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},ks=ge((e,t)=>{const n=ie("Dropzone",dre,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,radius:p,disabled:m,loading:g,multiple:y,maxSize:b,accept:S,children:j,onDropAny:C,onDrop:R,onReject:E,openRef:T,name:_,maxFiles:k,autoFocus:I,activateOnClick:A,activateOnDrag:P,dragEventsBubbling:z,activateOnKeyboard:B,onDragEnter:Y,onDragLeave:J,onDragOver:Z,onFileDialogCancel:$,onFileDialogOpen:Q,preventDropOnDocument:M,useFsAccessApi:L,getFilesFromEvent:U,validator:V,rejectColor:K,acceptColor:O,enablePointerEvents:F,loaderProps:ae,inputProps:ue,mod:be,attributes:we,...Ce}=n,nt=Le({name:"Dropzone",classes:Vd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:we,vars:f,varsResolver:fre}),{getRootProps:De,getInputProps:ft,isDragAccept:ot,isDragReject:ht,isDragActive:st,open:yt}=NN({onDrop:C,onDropAccepted:R,onDropRejected:E,disabled:m||g,accept:Array.isArray(S)?S.reduce((Re,Ie)=>({...Re,[Ie]:[]}),{}):S,multiple:y,maxSize:b,maxFiles:k,autoFocus:I,noClick:!A,noDrag:!P,noDragEventsBubbling:!z,noKeyboard:!B,onDragEnter:Y,onDragLeave:J,onDragOver:Z,onFileDialogCancel:$,onFileDialogOpen:Q,preventDropOnDocument:M,useFsAccessApi:L,validator:V,...U?{getFilesFromEvent:U}:null});wd(T,yt);const mt=st&&ot,It=st&&ht,Te=!mt&&!It;return a.jsx(are,{value:{accept:mt,reject:It,idle:Te},children:a.jsxs(ce,{...De(),...nt("root",{focusable:!0}),...Ce,mod:[{accept:mt,reject:It,idle:Te,disabled:m,loading:g,"activate-on-click":A},be],children:[a.jsx(ym,{visible:g,overlayProps:{radius:p},unstyled:d,loaderProps:ae}),a.jsx("input",{...ft(ue),name:_}),a.jsx("div",{...nt("inner"),ref:t,"data-enable-pointer-events":F||void 0,children:j})]})})});ks.classes=Vd;ks.displayName="@mantine/dropzone/Dropzone";ks.Accept=lre;ks.Idle=ure;ks.Reject=cre;const hre={maxSize:1/0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:zr("max"),withinPortal:!0},f1=ge((e,t)=>{const n=ie("DropzoneFullScreen",hre,e),{classNames:r,className:o,style:s,styles:c,unstyled:d,vars:f,active:p,onDrop:m,onReject:g,zIndex:y,withinPortal:b,portalProps:S,attributes:j,...C}=n,R=Le({name:"DropzoneFullScreen",classes:Vd,props:n,className:o,style:s,classNames:r,styles:c,unstyled:d,attributes:j,rootSelector:"fullScreen"}),{resolvedClassNames:E,resolvedStyles:T}=Cl({classNames:r,styles:c,props:n}),[_,k]=v.useState(0),[I,{open:A,close:P}]=Zc(!1),z=Y=>{Y.dataTransfer?.types.includes("Files")&&(k(J=>J+1),A())},B=()=>{k(Y=>Y-1)};return v.useEffect(()=>{_===0&&P()},[_]),v.useEffect(()=>{if(p)return document.addEventListener("dragenter",z,!1),document.addEventListener("dragleave",B,!1),()=>{document.removeEventListener("dragenter",z,!1),document.removeEventListener("dragleave",B,!1)}},[p]),a.jsx(va,{...S,withinPortal:b,children:a.jsx(ce,{ref:t,...R("fullScreen",{style:{opacity:I?1:0,pointerEvents:I?"all":"none",zIndex:y}}),children:a.jsx(ks,{activateOnClick:!1,...C,classNames:E,styles:T,unstyled:d,className:Vd.dropzone,onDrop:Y=>{m?.(Y),P(),k(0)},onReject:Y=>{g?.(Y),P(),k(0)}})})})});f1.classes=Vd;f1.displayName="@mantine/dropzone/DropzoneFullScreen";ks.FullScreen=f1;const np=ks,pre='{"resourceType": "Bundle"}';function vx({id:e,title:t,message:n,color:r,icon:o,withCloseButton:s=!1,method:c="show",loading:d}){Di[c]({id:e,loading:d,title:t,message:n,color:r,icon:o,withCloseButton:s,autoClose:!1})}function mre(){const e=gn(),t=_e(),[n,r]=v.useState({}),o=v.useCallback(async(d,f)=>{const p="batch-upload";vx({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=pk(m));const g=await t.executeBatch(m);r(y=>({...y,[f]:g})),vx({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(Vo,{size:"1rem"}),withCloseButton:!0})}catch(m){vx({id:p,title:"Batch Upload Failed",color:"red",message:Qe(m),method:"update",icon:a.jsx(yl,{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(dt,{children:[a.jsx(ze,{children:"Batch Create"}),a.jsxs(Ee,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",a.jsx(Mt,{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(Pt,{defaultValue:"upload",children:[a.jsxs(Pt.List,{children:[a.jsx(Pt.Tab,{value:"upload",children:"File Upload"}),a.jsx(Pt.Tab,{value:"json",children:"JSON"})]}),a.jsx(Pt.Panel,{value:"upload",pt:"xs",children:a.jsx(np,{onDrop:s,accept:["application/json"],children:a.jsxs(ye,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(np.Accept,{children:a.jsx(tR,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(np.Reject,{children:a.jsx(yl,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(np.Idle,{children:a.jsx(tR,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(Ee,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(Ee,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(Pt.Panel,{value:"json",pt:"xs",children:a.jsxs(pt,{onSubmit:c,children:[a.jsx(au,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:pre,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(Pt,{defaultValue:Object.keys(n)[0],children:[a.jsx(Pt.List,{children:Object.keys(n).map(d=>a.jsx(Pt.Tab,{value:d,children:d},d))}),Object.keys(n).map(d=>a.jsx(Pt.Panel,{value:d,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[d],void 0,2)})},d))]}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{onClick:()=>r({}),children:"Start over"})})]})]})}function gre(){const{resourceType:e}=Ht(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Yc("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(dt,{children:[a.jsxs(ze,{children:["No apps for ",e]}),a.jsx(jt,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(dt,{children:a.jsx("div",{children:r.map(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(jt,{to:`/forms/${o.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(Ni,{})}function vre(){const e=_e(),[t,n]=v.useState(),[r,o]=v.useState(!1);return a.jsx(dt,{width:450,children:a.jsxs(pt,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>o(!0)).catch(c=>n(Yt(c)))},children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(ze,{children:"Change password"})]}),!r&&a.jsxs(Ue,{gap:"xl",mt:"xl",children:[a.jsx(Ki,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Lt(t,"oldPassword")}),a.jsx(Ki,{name:"newPassword",label:"New password",required:!0,error:Lt(t,"newPassword")}),a.jsx(Ki,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Lt(t,"confirmPassword")}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const hb=["Form","JSON","Profiles"],yre=["Profiles"],yx=hb[0].toLowerCase();function xre(){const e=kn(),t=gn(),{resourceType:n}=Ht(),[r,o]=v.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&hb.map(d=>d.toLowerCase()).includes(c)?c:yx});function s(c){c||(c=yx),o(c),e(`/${n}/new/${c}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(Or,{children:[a.jsxs(Ee,{p:"md",fw:500,children:["New ",n]}),a.jsx(Jr,{children:a.jsx(Pt,{defaultValue:yx,value:r,onChange:s,children:a.jsx(Pt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:hb.map(c=>a.jsx(Pt.Tab,{value:c.toLowerCase(),px:"md",children:yre.includes(c)?a.jsxs(ye,{gap:"xs",wrap:"nowrap",children:[c,a.jsx(vm,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),a.jsx(i1,{})]})}function bre(){return a.jsx(dt,{children:a.jsxs(Ue,{children:[a.jsx(ze,{order:1,children:"Unexpected Error"}),a.jsx(Ee,{children:"We're sorry, something went wrong."}),a.jsxs(Ee,{children:["Please contact ",a.jsx(Mt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function ON(e){const t=Kt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(jt,{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=ba(t);c!==Ot(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(xt,{children:n.map((c,d)=>a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:c.key}),a.jsx(xt.Value,{children:c.value})]},`${c.key}-${d}`))})}function Sre(){const{id:e}=Ht(),t=ti(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=_e(),[s,c]=v.useState(!0),[d,f]=v.useState(),[p,m]=v.useState(),[g,y]=v.useState(),[b,S]=v.useState(),[j,C]=v.useState();if(v.useEffect(()=>{const T={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const _=r.split(",").filter(k=>!!k);_.length===1&&T.entry.push({request:{method:"GET",url:_[0]}}),m(_)}o.executeBatch(T).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]),b)return a.jsx(dt,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return a.jsxs(dt,{children:[a.jsx(ze,{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(jt,{to:j[0],children:"Review your answers"})}),j.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:j.map(T=>a.jsx("li",{children:a.jsx(jt,{to:T,children:Ot(T)})},T.id))})]}),g&&a.jsx("li",{children:a.jsxs(jt,{to:g,children:["Back to ",ba(g)]})}),a.jsx("li",{children:a.jsx(jt,{to:"/",children:"Go back home"})})]})]});if(s||!d)return a.jsx(Ni,{});const R=g&&l1(g);return a.jsxs(a.Fragment,{children:[a.jsxs(Or,{shadow:"xs",radius:0,children:[R&&a.jsx(MP,{patient:R}),g&&g.resourceType!=="Patient"&&a.jsx(ON,{resource:g}),a.jsx(ce,{px:"xl",py:"md",children:a.jsxs(Ee,{children:[ba(d),p&&p.length>1&&a.jsxs(a.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),a.jsx(dt,{children:a.jsx(qP,{questionnaire:d,subject:g&&Qt(g),onSubmit:E})})]});async function E(T){const _=[];if(!p||p.length===0)_.push(await o.createResource(T));else for(const k of p)_.push(await o.createResource({...T,subject:{reference:k}}));C(_)}}const wre="_paper_unw9o_1",jre={paper:wre},Cre={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function MN(e,t){const n=e.resourceType||Ere(t),r=e.fields??Tre(n),o=e.filters??(e.resourceType?void 0:Rre(n)),s=e.sortRules??_re(n),c=e.offset??0,d=e.count??Fm;return{...e,resourceType:n,fields:r,filters:o,sortRules:s,offset:c,count:d}}function Ere(e){return localStorage.getItem("defaultResourceType")??e?.option?.find(t=>t.id==="defaultResourceType")?.valueString??"Patient"}function Tre(e){const t=h1(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 Rre(e){return h1(e)?.filters}function _re(e){const t=h1(e);return t?.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function h1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function Are(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function Dre(e,t){const n={...e,count:1e3,offset:0},r=MN(n,t.getUserConfiguration()),o=await t.search(r.resourceType,ps({...r,total:"accurate",fields:void 0}));return pk(o)}function S2(){const e=_e(),t=kn(),n=ti(),[r,o]=v.useState();return v.useEffect(()=>{const s=ck(n.pathname+n.search),c=MN(s,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===ps(c)?(Are(c),o(c)):t(`/${c.resourceType}${ps(c)}`)?.catch(console.error)},[e,t,n]),!r?.resourceType||!r.fields||r.fields.length===0?a.jsx(Ni,{}):a.jsx(Or,{shadow:"xs",m:"md",p:"xs",className:jre.paper,children:a.jsx(pu,{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}${ps(s.definition)}`)?.catch(console.error)},onNew:()=>{t(Cre[r.resourceType]??`/${r.resourceType}/new`)?.catch(console.error)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+ps(r);e.download(s).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Ne({color:"red",message:Qe(c),autoClose:!1}))},onExportTransactionBundle:async()=>{Dre(r,e).then(s=>Vk(JSON.stringify(s,void 0,2))).catch(s=>Ne({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=>Ne({color:"red",message:Qe(c),autoClose:!1})))},onBulk:s=>{t(`/bulk/${r.resourceType}?ids=${s.join(",")}`)?.catch(console.error)}})})}function kre(){const[e]=Yc("ObservationDefinition","_count=100");return e?a.jsxs(de,{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(Ro,{value:t.category?.[0]})}),a.jsx("td",{children:a.jsx(Ro,{value:t.code})}),a.jsx("td",{children:a.jsx(Ro,{value:t.method})}),a.jsx("td",{children:t.quantitativeDetails?.unit?.text}),a.jsx("td",{children:t.quantitativeDetails?.decimalPrecision}),a.jsx("td",{children:a.jsx(pb,{ranges:t.qualifiedInterval})})]},t.id))})]}):a.jsx(Ni,{})}function pb(e){const{ranges:t}=e;if(!t)return null;const n=w2(t.map(o=>o.gender));if(n.length>1)return Qc(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(pb,{ranges:e.ranges?.filter(s=>s.gender===o)})]},o))});const r=w2(t.map(o=>o.age&&Nd(o.age)));return r.length>1?(Qc(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(pb,{ranges:e.ranges?.filter(s=>Nd(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(LS,{value:o.range})})]})})},`range-${o.condition}`))})}function w2(e){return[...new Set(e.filter(t=>!!t))]}function Pre(){const[e]=Yc("ActivityDefinition","_count=100"),[t]=Yc("ObservationDefinition","_count=100");return!e||!t?a.jsx(Ni,{}):a.jsxs(de,{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(Ro,{value:n.category?.[0]})}),a.jsx("td",{children:a.jsx(Ro,{value:n.code})}),e.map(r=>a.jsx("td",{children:r.observationResultRequirement?.find(o=>o.reference?.includes(n.id))?"✅":""},r.id))]},n.id))})]})}function Nre(){const e=_e(),[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=>Ne({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),Ne({color:"green",message:"Success"})}).catch(g=>Ne({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(dt,{children:[a.jsx(Vn,{title:"Disable MFA",opened:s,onClose:()=>c(!1),children:a.jsx(Ip,{title:"Disable MFA",buttonText:"Submit code",onSubmit:async m=>{await p(m),c(!1),o(!1),Ne({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:a.jsx(aq,{})}),d()}})}),a.jsxs(ye,{children:[a.jsx(ze,{children:"MFA is enabled"}),a.jsx(Pe,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):a.jsx(dt,{width:400,children:a.jsx(Ip,{title:"Multi Factor Auth Setup",buttonText:"Enroll",qrCodeUrl:t,onSubmit:f})})}const Ore={},mb={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:Ore?.MEDPLUM_AWS_TEXTRACT_ENABLED};function Ef(){return mb}function LN(){return IN("registerEnabled")}function Mre(){return IN("awsTextractEnabled")}function IN(e){try{return mb[e]!==!1&&mb[e]!=="false"}catch{return!0}}function Lre(){const e=kn(),[t]=s1(),n=_e(),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){Ne({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 b of["scope","state","nonce"])t.has(b)&&y.searchParams.set(b,t.get(b));y.searchParams.set("code",g),nr.assign(y.toString())}return a.jsx(lP,{onCode:m,onForgotPassword:()=>e("/resetpassword")?.catch(console.error),onRegister:()=>e("/register")?.catch(console.error),googleClientId:Ef().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($i,{size:32}),a.jsx(ze,{children:o?.welcomeString??"Sign in to Medplum"})]})})}function Ire(){const e=_e(),t=kn(),n=Ef();return v.useEffect(()=>{e.getProfile()&&t("/signin?project=new")?.catch(console.error)},[e,t]),LN()?a.jsxs(hW,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx($i,{size:32}),a.jsx(ze,{children:"Create a new account"})]}):a.jsx(dt,{width:450,children:a.jsx($o,{icon:a.jsx(As,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function zre(){const e=kn(),t=_e(),[n,r]=v.useState(),[o,s]=v.useState(!1),c=Ef().recaptchaSiteKey;return v.useEffect(()=>{aP(c)},[c]),a.jsx(dt,{width:450,children:a.jsxs(pt,{onSubmit:async d=>{let f="";f=await sP(c),t.post("auth/resetpassword",{...d,recaptchaToken:f}).then(()=>s(!0)).catch(p=>r(Yt(p)))},children:[a.jsxs(Ue,{gap:"lg",mb:"xl",align:"center",children:[a.jsx($i,{size:32}),a.jsx(ze,{children:"Password Reset"})]}),a.jsxs(Ue,{gap:"xl",children:[a.jsx(Er,{issues:hu(n,void 0)}),!o&&a.jsxs(a.Fragment,{children:[a.jsx(He,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Lt(n,"email")}),a.jsxs(ye,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Mt,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register")?.catch(console.error),size:"xs",children:"Register"}),a.jsx(Pe,{type:"submit",children:"Reset password"})]})]}),o&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function $re(e){const t=_e(),[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(jt,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(jt,{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(Ue,{children:[a.jsxs(ze,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(Ee,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(Ee,{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(Ro,{value:c.code[0]})]},`action-${d}`))}),a.jsx($t,{title:"Subject",children:a.jsx(vs,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Pe,{type:"submit",children:"Go"})})]})})}function Ure(){const{resourceType:e,id:t}=Ht(),n=Kt({reference:e+"/"+t});return n?a.jsx(dt,{children:a.jsx($re,{planDefinition:n})}):null}function Bre(){const{resourceType:e,id:t}=Ht(),n=Kt({reference:e+"/"+t}),[r,o]=Yc("Questionnaire","subject-type="+e),[s,c]=Yc("ClientApplication",{_count:1e3});if(!n||o||c)return a.jsx(Ni,{});const d=s?.filter(m=>Vre(e)&&!!m.launchUri);if((!r||r.length===0)&&(!d||d.length===0))return a.jsxs(dt,{children:[a.jsx(ze,{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=Qt(n):n.resourceType==="Encounter"&&(f=n.subject,p=Qt(n)),a.jsxs(dt,{children:[r?.map(m=>a.jsxs("div",{children:[a.jsx(ze,{order:3,children:a.jsx(jt,{to:`/forms/${m.id}?subject=${Ot(n)}`,children:m.title||m.name})}),a.jsx(Ee,{children:m.description})]},m.id)),d?.map(m=>a.jsxs("div",{children:[a.jsx(ze,{order:3,children:a.jsx(dZ,{client:m,patient:f,encounter:p,children:m.name})}),a.jsx(Ee,{children:m.description})]},m.id))]})}function Vre(e){return e==="Patient"||e==="Encounter"}function Fre(){const{resourceType:e,id:t}=Ht(),n=kn(),[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(dt,{children:a.jsx(pu,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function Hre(){const e=_e(),{resourceType:t,id:n}=Ht(),r=e.readHistory(t,n).read();return a.jsx(Zd,{maw:1200,children:a.jsx(kl,{children:a.jsx(eZ,{history:r})})})}const qre="_hl7Input_k5xm3_1",Gre={hl7Input:qre};function Qre(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 Wre(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=>{xd(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Yre=`{
|
|
253
|
-
"resourceType": "Patient",
|
|
254
|
-
"name": [
|
|
255
|
-
{
|
|
256
|
-
"given": [
|
|
257
|
-
"Alice"
|
|
258
|
-
],
|
|
259
|
-
"family": "Smith"
|
|
260
|
-
}
|
|
261
|
-
]
|
|
262
|
-
}`,Kre="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 Xre(){const e=_e(),{id:t}=Ht(),[n,r]=v.useState(),[o,s]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(Yre),[m,g]=v.useState(Kre),[y,b]=v.useState(nn.FHIR_JSON),S=v.useRef(null),j=v.useRef(null),[C,R]=v.useState(!1);v.useEffect(()=>{e.readResource("Bot",t).then(async P=>{r(P),s(P.runtimeVersion==="vmcontext"?"commonjs":"esnext"),d(await Jre(e,P))}).catch(P=>Ne({color:"red",message:Qe(P),autoClose:!1}))},[e,t]);const E=v.useCallback(async()=>xd(S.current,{command:"getValue"}),[]),T=v.useCallback(async()=>xd(S.current,{command:"getOutput"}),[]),_=v.useCallback(async()=>y===nn.FHIR_JSON?JSON.parse(f):m,[y,f,m]),k=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),R(!0);try{const z=await E(),B=await T(),Y=await e.createAttachment({data:z,filename:"index.ts",contentType:nn.TYPESCRIPT}),J=await e.createAttachment({data:B,filename:o==="commonjs"?"index.cjs":"index.mjs",contentType:nn.JAVASCRIPT}),Z=[{op:"add",path:"/sourceCode",value:Y},{op:"add",path:"/executableCode",value:J}];await e.patchResource("Bot",t,Z),Ne({color:"green",message:"Saved"})}catch(z){Ne({color:"red",message:Qe(z),autoClose:!1})}finally{R(!1)}},[e,t,o,E,T]),I=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),R(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Ne({color:"green",message:"Deployed"})}catch(z){Ne({color:"red",message:Qe(z),autoClose:!1})}finally{R(!1)}},[e,t]),A=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),R(!0);try{const z=await _(),B=await e.post(e.fhirUrl("Bot",t,"$execute"),z,y);await xd(j.current,{command:"setValue",value:B}),Ne({color:"green",message:"Success"})}catch(z){Ne({color:"red",message:Qe(z),autoClose:!1})}finally{R(!1)}},[e,t,_,y]);return!n||c===void 0?null:a.jsxs(Sr,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(Sr.Col,{span:8,children:a.jsxs(Or,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(Wre,{iframeRef:S,language:"typescript",module:o,testId:"code-frame",defaultValue:c,minHeight:"528px"}),a.jsxs(ye,{justify:"flex-end",gap:"xs",children:[a.jsx(Pe,{type:"button",onClick:k,loading:C,leftSection:a.jsx(yq,{size:"1rem"}),children:"Save"}),a.jsx(Pe,{type:"button",onClick:I,loading:C,leftSection:a.jsx(CS,{size:"1rem"}),children:"Deploy"}),a.jsx(Pe,{type:"button",onClick:A,loading:C,leftSection:a.jsx(sG,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(Sr.Col,{span:4,children:[a.jsxs(Or,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(fn,{data:[{label:"FHIR",value:nn.FHIR_JSON},{label:"HL7",value:nn.HL7_V2}],onChange:P=>b(P.currentTarget.value)}),y===nn.FHIR_JSON?a.jsx(au,{value:f,onChange:P=>p(P),autosize:!0,minRows:15}):a.jsx("textarea",{className:Gre.hl7Input,value:m,onChange:P=>g(P.currentTarget.value),rows:15})]}),a.jsx(Or,{m:2,p:"xs",shadow:"md",children:a.jsx(Qre,{iframeRef:j,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Jre(e,t){if(t.sourceCode?.url){const n=t.sourceCode.url?.split("/")?.find(oS);return(await e.download(e.fhirUrl("Binary",n))).text()}return t.code??""}function Ml(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Zre(){const e=_e(),{resourceType:t,id:n}=Ht(),r={reference:t+"/"+n},o=v.useCallback(s=>{e.updateResource(Ml(s)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Qe(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(dt,{children:a.jsx(OX,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(dt,{children:a.jsx(lJ,{questionnaire:r,onSubmit:o})});default:return null}}function eie(){const{resourceType:e,id:t}=Ht(),n=Kt({reference:e+"/"+t}),r=kn();return n?a.jsx(dt,{children:a.jsx(LJ,{value:n,onStart:(o,s)=>r(`/forms/${pl(s)}`)?.catch(console.error),onEdit:(o,s,c)=>r(`/${c.reference}}`)?.catch(console.error)})}):null}function tie(){const e=_e(),{resourceType:t,id:n}=Ht(),r=kn();return a.jsxs(dt,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(Pe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)?.catch(console.error)).catch(o=>Ne({color:"red",message:Qe(o),autoClose:!1}))},children:"Delete"})]})}const nie="_selectProfileBtn_tbaz6_1",rie="_chevron_tbaz6_13",j2={selectProfileBtn:nie,chevron:rie};function iie(){const{resourceType:e,id:t}=Ht(),n=Kt({reference:e+"/"+t}),[r,o]=v.useState(),s=Rl({onDropdownClose:()=>s.resetSelectedOption()}),c=v.useMemo(()=>{if(Ln(n?.meta?.profile))return[a.jsx(Xe.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(Xe.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 Ln(c)&&(d=a.jsx(ye,{justify:"flex-end",children:a.jsxs(Ue,{align:"flex-end",gap:"xs",children:[a.jsxs(Xe,{store:s,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:f=>{o(f),s.closeDropdown()},children:[a.jsx(Xe.Target,{children:a.jsx(An,{onClick:()=>s.toggleDropdown(),children:a.jsxs(Jd,{fw:"bold",fs:"sm",className:j2.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(jS,{stroke:1.5,className:j2.chevron})]})})}),a.jsx(Xe.Dropdown,{w:"max-content",children:a.jsx(Xe.Options,{children:c})})]}),a.jsx(ce,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(Ee,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(Ee,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(Ee,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(dt,{children:a.jsxs(Ue,{gap:"xl",children:[d,a.jsx(FS,{value:n,profileUrl:r})]})})}function oie(){const e=_e(),{resourceType:t,id:n}=Ht(),[r,o]=v.useState(),[s,c]=v.useState(),d=kn(),[f,p]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(b=>{o(hi(b)),c(hi(b))}).catch(b=>{p(Yt(b)),Ne({color:"red",message:Qe(b),autoClose:!1})})},[e,t,n]);const m=v.useCallback(b=>{p(void 0),e.updateResource(Ml(b)).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(S=>{p(Yt(S)),Ne({color:"red",message:Qe(S),autoClose:!1})})},[e,t,n,d]),g=v.useCallback(b=>{p(void 0);const S=EP.createPatch(r,b);e.patchResource(t,n,S).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(j=>{p(Yt(j)),Ne({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(dt,{children:a.jsx(Hp,{defaultValue:s,onSubmit:m,onPatch:g,onDelete:y,outcome:f})}):null}function aie(){const{resourceType:e,id:t}=Ht(),n=Kt({reference:e+"/"+t});return n?a.jsx(dt,{maw:700,children:n.resourceType==="Patient"?a.jsx(_X,{patient:n}):a.jsx($o,{icon:a.jsx(As,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function zN({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=_e(),[s,c]=v.useState();return v.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(d=>{c(d.filter(WW))}).catch(console.error)},[o,n,r]),a.jsx(Pt,{value:t?.url,onChange:d=>{const f=s?.find(p=>p.url===d);f&&n(f)},children:a.jsx(Pt.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(Pt.Tab,{value:d.url,title:p,rightSection:f&&a.jsx(J0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(zG,{size:"90%"})}),children:d.title||d.name},d.url)})})})}function $N(e,t){const n=_e(),r=kn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(d=>r("/"+d.resourceType+"/"+d.id)).catch(d=>{t&&t(Yt(d)),Ne({color:"red",message:Qe(d),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function xx(){const{resourceType:e}=Ht(),t=ti(),[n,r]=v.useState(),{defaultValue:o,handleSubmit:s}=$N(e,r),[c,d]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=v.useCallback(m=>{const g=Ml(m);c&&tk(g,c.url),s(g)},[c,s]);return f?a.jsx(dt,{children:a.jsxs(Ue,{children:[a.jsx(zN,{resource:o,currentProfile:c,onChange:d}),c?a.jsx(Hp,{defaultValue:o,onSubmit:p,outcome:n,profileUrl:c.url},c.url):a.jsx(Ee,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(dt,{children:a.jsx(Hp,{defaultValue:o,onSubmit:s,outcome:n})})}function C2(){const e=_e(),{resourceType:t,id:n}=Ht(),r=e.readHistory(t,n).read();return a.jsx(dt,{children:a.jsx(sZ,{history:r})})}function sie(){const{resourceType:e}=Ht(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:o}=$N(e,n),s=v.useCallback(c=>{o(JSON.parse(c["new-resource"]))},[o]);return a.jsxs(dt,{children:[t&&a.jsx(Er,{outcome:t}),a.jsxs(pt,{onSubmit:s,children:[a.jsx(au,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:no(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{type:"submit",children:"OK"})})]})]})}function lie(){const e=_e(),{resourceType:t,id:n}=Ht(),r=Kt({reference:t+"/"+n}),o=kn(),[s,c]=v.useState(),d=v.useCallback(f=>{e.updateResource(Ml(JSON.parse(f.resource))).then(()=>{c(void 0),o(`/${t}/${n}/details`)?.catch(console.error),Ne({color:"green",message:"Success"})}).catch(p=>{Ne({color:"red",message:Qe(p),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(dt,{children:[s&&a.jsx(Er,{outcome:s}),a.jsxs(pt,{onSubmit:d,children:[a.jsx(au,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:no(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Pe,{type:"submit",children:"OK"})})]})]}):null}function cie(e){const{resourceType:t,id:n}=e;return a.jsxs(dt,{children:[a.jsxs($o,{icon:a.jsx(As,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Mt,{href:`/forms/${n}`,children:`/forms/${n}`})]}),a.jsx(qP,{questionnaire:{reference:t+"/"+n},onSubmit:()=>alert("You submitted the preview")})]})}const uie="_propertyTable_1xts4_1",die="_propertiesTitle_1xts4_17",UN={propertyTable:uie,propertiesTitle:die};function fie(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 hie(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=fie(d))}),{code:o,description:s,value:c}});return a.jsxs(de,{className:UN.propertyTable,children:[a.jsx(de.Thead,{children:a.jsxs(de.Tr,{children:[a.jsx(de.Th,{children:"Code"}),a.jsx(de.Th,{children:"Description"}),a.jsx(de.Th,{children:"Value"})]})}),a.jsx(de.Tbody,{children:n.map((r,o)=>a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:r.code}),a.jsx(de.Td,{children:r.description}),a.jsx(de.Td,{children:r.value})]},`property-${o}`))})]})}function pie(e){const{valueSet:t}=e,n=_e(),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}),R=n.fhirUrl("CodeSystem","$lookup")+"?"+C.toString(),E=await n.get(R);d(E)}catch(C){g(C instanceof Error?C:new Error(String(C)))}finally{p(!1)}},[n]),b=v.useMemo(()=>c?.parameter?.filter(j=>j.name==="property"&&j.part)??[],[c]),S=b.length>0;return a.jsx(dt,{children:a.jsxs(Ue,{gap:"xl",children:[a.jsx(gf,{binding:r,placeholder:"Select a value from the ValueSet",onChange:j=>y(j[0]),defaultValue:o,maxValues:1}),o?a.jsxs(Ue,{gap:"md",children:[a.jsxs(yf,{children:[a.jsx(Lr,{term:"Code",children:o.code}),o.system&&a.jsx(Lr,{term:"System",children:o.system}),o.display&&a.jsx(Lr,{term:"Display",children:o.display})]}),f&&a.jsxs(ye,{gap:"xs",children:[a.jsx(Ir,{size:"sm"}),a.jsx(Ee,{size:"sm",c:"dimmed",children:"Loading properties..."})]}),!f&&m&&a.jsxs($o,{icon:a.jsx(As,{size:16}),title:"Lookup Failed",color:"red",children:["Failed to retrieve code information: ",Qe(m)]}),!f&&!m&&S&&a.jsx(AS,{children:a.jsxs(Ue,{gap:"xs",mt:"lg",children:[a.jsx(Ee,{fw:500,size:"sm",c:"dimmed",className:UN.propertiesTitle,children:"Properties"}),a.jsx(hie,{properties:b})]})})]}):null]})})}function mie(){const{resourceType:e,id:t}=Ht(),n=Kt({reference:e+"/"+t});return n?n.resourceType==="Questionnaire"?a.jsx(cie,{resourceType:e,id:t}):n.resourceType==="ValueSet"?a.jsx(pie,{valueSet:n}):null:null}function gie(){const e=_e(),{resourceType:t,id:n}=Ht(),[r,o]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(d=>o(hi(d))).catch(d=>{Ne({color:"red",message:Qe(d)})})},[e,t,n]),r?a.jsxs(dt,{children:[a.jsxs(ze,{order:2,children:["Available ",t," profiles"]}),a.jsx(Ue,{children:a.jsxs(a.Fragment,{children:[a.jsx(zN,{resource:r,currentProfile:s,onChange:c}),s?a.jsx(vie,{profile:s,resource:r,onResourceUpdated:d=>o(d)},s.url):a.jsx(Ee,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const vie=({profile:e,resource:t,onResourceUpdated:n})=>{const r=_e(),[o,s]=v.useState(),[c,d]=v.useState(()=>t.meta?.profile?.includes(e.url)),f=v.useCallback(p=>{s(void 0);const m=Ml(p);c?tk(m,e.url):vB(m,e.url),r.updateResource(m).then(g=>{n(g),Ne({color:"green",message:"Success"})}).catch(g=>{s(Yt(g)),Ne({color:"red",message:Qe(g),autoClose:!1})})},[r,e.url,n,c]);return a.jsxs(Ue,{children:[a.jsx(rf,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>d(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?a.jsx(Hp,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Pe,{type:"submit",children:"OK"})})})]})},BN={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},yie=Object.keys(BN);function xie(){const e=_e(),{id:t}=Ht(),n=Kt({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=>bie(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},${Ot(n)}`:Ot(n)}`,channel:{type:"rest-hook",endpoint:Ot(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"),Ne({color:"green",message:"Success"})}).catch(g=>Ne({color:"red",message:Qe(g),autoClose:!1}))}return a.jsxs(dt,{children:[a.jsx(ze,{children:"Bots"}),a.jsxs(Ue,{children:[p.length===0&&a.jsx("p",{children:"No bots found."}),p.map(g=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(Nl,{value:{reference:g.channel?.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id))]}),a.jsx(_n,{}),a.jsxs(Ue,{mt:10,children:[a.jsx(Gd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),a.jsxs(ye,{children:[a.jsx(Pl,{name:"bot",resourceType:"Bot",onChange:g=>o(g)}),a.jsx(Pe,{onClick:m,children:"Connect"})]}),a.jsx(ye,{children:a.jsx(fn,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:yie,onChange:g=>c(BN[g.target.value])})})]}),a.jsx("div",{style:{display:"none"},children:d})]})}function bie(e,t){if(!t)return!1;const n=e.criteria||"",r=e.channel?.endpoint||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(Ot(t))||(t.url?n.includes(t.url):!1))}function Sie(){const{id:e}=Ht(),t=kn(),r=_e().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(dt,{children:a.jsx(pu,{search:o,onClick:c=>t(`/${c.resource.resourceType}/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})})}function wie(){const e=_e(),{resourceType:t,id:n}=Ht(),r=Kt({reference:t+"/"+n}),o=v.useCallback(s=>{e.updateResource(Ml(s)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Qe(c),autoClose:!1})})},[e]);return r?a.jsx(dt,{children:a.jsx(_J,{onSubmit:o,definition:r})}):null}function jie(){const{resourceType:e,id:t}=Ht(),n=Kt({reference:e+"/"+t});return n?a.jsx(dt,{children:e==="MeasureReport"?a.jsx(TX,{measureReport:n}):a.jsx(VS,{value:n})}):null}const Cie="_container_1ue98_1",Eie="_entry_1ue98_14",Tie="_active_1ue98_21",bx={container:Cie,entry:Eie,active:Tie};function Rie(e){const t=_e(),n=Kt(e.value),[r,o]=v.useState();return v.useEffect(()=>{if(!n)return;const s=l1(n);if(!s)return;const c="reference"in s?s.reference:Ot(s);t.search("ServiceRequest","subject="+c).then(d=>{const p=(d.entry??[]).map(m=>m.resource);TP(p),p.reverse(),o(p)}).catch(d=>Ne({color:"red",message:Qe(d),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:bx.container,children:r.map(s=>a.jsxs("div",{className:Ut(bx.entry,{[bx.active]:s.id===n?.id}),children:[a.jsx("p",{children:a.jsx(jt,{to:s,children:_ie(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:Aie(s)})]},s.id))}):null}function _ie(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function Aie(e){return e.authoredOn?e.authoredOn.substring(0,10):e.meta?.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const Die="_container_1l2dh_1",kie={container:Die};function Pie(e){const t=Kt(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:kie.container,children:a.jsx(fn,{defaultValue:e.defaultValue,onChange:o=>e.onChange(o.currentTarget.value),data:n})})}function Nie(e){const t=Kt(e.specimen);return t?a.jsxs(xt,{children:[a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"Type"}),a.jsx(xt.Value,{children:"Specimen"})]}),a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"Collected"}),a.jsx(xt.Value,{children:wr(t.collection?.collectedDateTime)})]}),a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"Specimen Age"}),a.jsx(xt.Value,{children:Oie(t)})]}),t.collection?.collectedDateTime&&t.receivedTime?a.jsxs(xt.Entry,{children:[a.jsx(xt.Key,{children:"Specimen Stability"}),a.jsx(xt.Value,{children:Mie(t)})]}):a.jsx(a.Fragment,{})]}):null}function Oie(e){const t=e.collection?.collectedDateTime;if(!t)return;const n=new Date(t);return VN(FN(n,new Date))}function Mie(e){if(!e.collection?.collectedDateTime||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return VN(FN(t,n))}function VN(e){return e.toString().padStart(3,"0")+"D"}function FN(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function Lie(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 Iie(){const e=_e(),{resourceType:t,id:n}=Ht(),r={reference:t+"/"+n},o=kn(),[s,c]=v.useState(),d=Kt(r,c),f=Lie(t),[p,m]=v.useState(()=>{const E=window.location.pathname.split("/").pop();return E&&f.map(T=>T.toLowerCase()).includes(E)?E:f[0].toLowerCase()});async function g(){const T=(await e.readHistory(t,n)).entry?.find(_=>!!_.resource)?.resource;T?y(T):Ne({color:"red",message:"No history to restore",autoClose:!1})}function y(E){e.updateResource(Ml(E)).then(()=>{c(void 0),Ne({color:"green",message:"Success"})}).catch(T=>{Ne({color:"red",message:Qe(T),autoClose:!1})})}if(s)return R8(s)?a.jsxs(dt,{children:[a.jsx(ze,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(Pe,{color:"red",onClick:g,children:"Restore"})]}):a.jsx(Er,{outcome:s});function b(E){E||(E=f[0].toLowerCase()),m(E),o(`/${t}/${n}/${E}`)?.catch(console.error)}function S(E){const T=d,_=T.orderDetail||[];_.length===0&&_.push({}),_[0].text!==E&&(_[0].text=E,y({...T,orderDetail:_}))}const j=d&&l1(d),C=d&&Ote(d),R=e.getUserConfiguration()?.option?.find(E=>E.id==="statusValueSet")?.valueString;return a.jsxs(a.Fragment,{children:[d?.resourceType==="ServiceRequest"&&R&&a.jsx(Pie,{valueSet:{reference:R},defaultValue:d.orderDetail?.[0]?.text,onChange:S},Ot(d)+"-"+d.orderDetail?.[0]?.text),d&&a.jsx(Rie,{value:d}),d&&a.jsxs(Or,{children:[j&&a.jsx(MP,{patient:j}),C&&a.jsx(Nie,{specimen:C}),t!=="Patient"&&a.jsx(ON,{resource:r}),a.jsx(Jr,{children:a.jsx(Pt,{value:p.toLowerCase(),onChange:b,children:a.jsx(Pt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map(E=>a.jsx(Pt.Tab,{value:E.toLowerCase(),children:E},E))})})})]}),a.jsx(i1,{})]})}function rp(){const e=kn(),{resourceType:t,id:n,versionId:r,tab:o}=Ht(),s=_e(),[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(T=>p(T)).then(()=>d(!1)).catch(T=>{g(T),d(!1)})},[s,t,n]),c)return a.jsx(Ni,{});const y=f?.entry??[],b=y.findIndex(T=>T.resource?.meta?.versionId===r);if(b===-1)return a.jsxs(dt,{children:[a.jsx(ze,{children:"Version not found"}),a.jsx(jt,{to:`/${t}/${n}`,children:"Return to resource"})]});const S=y[b].resource,j=b<y.length-1?y[b+1].resource:void 0,C="diff",R=o||C,E=y.length-b;return a.jsx(Zd,{maw:1200,children:a.jsx(kl,{children:a.jsxs(Ue,{gap:"lg",children:[m&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),a.jsxs(Lm,{cols:2,mb:"lg",children:[a.jsx(zi,{total:y.length,value:E,getControlProps:kP,onChange:T=>e(`/${t}/${n}/_history/${y[y.length-T]?.resource?.meta?.versionId}/${R}`)?.catch(console.error)}),a.jsx(ye,{justify:"right",children:a.jsx(qc,{data:[{value:"diff",label:"Diff"},{value:"raw",label:"Raw"}],value:R,onChange:T=>e(`/${t}/${n}/_history/${r}/${T||C}`)?.catch(console.error)})})]}),a.jsx(ce,{mb:"lg",children:a.jsxs(yf,{compact:!0,children:[a.jsx(Lr,{term:"Version ID",children:S.meta?.versionId}),a.jsx(Lr,{term:"Author",children:a.jsx(Ic,{value:S.meta?.author,link:!0},S.meta?.author?.reference)}),a.jsx(Lr,{term:"Date/Time",children:wr(S.meta?.lastUpdated)})]})}),R==="diff"&&a.jsx(rZ,{original:j??{resourceType:t,id:n},revised:S}),R==="raw"&&a.jsx("pre",{style:{fontSize:"9pt"},children:JSON.stringify(S,void 0,2)})]})})})}function zie(){const{resourceType:e,id:t}=Ht(),n=kn(),[r,o]=v.useState({resourceType:"Subscription",filters:[{code:"url",operator:he.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(dt,{children:a.jsx(pu,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>o(s.definition),hideFilters:!0})})}function $ie(e){const t=_e(),{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?Ot(d):void 0,verbose:p}),Ne({color:"green",message:"Done"}),o()}catch(y){Ne({color:"red",message:Qe(y),autoClose:!1})}},[t,n,o,s,d,p]);return a.jsx(Vn,{opened:r,onClose:o,title:"Resend Subscriptions",children:a.jsx(pt,{onSubmit:g,children:a.jsxs(Ue,{children:[a.jsx($n,{label:"Choose subscription (all subscriptions by default)",onChange:y=>c(y.currentTarget.checked)}),s&&a.jsx(Pl,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),a.jsx($n,{label:"Verbose mode",onChange:y=>m(y.currentTarget.checked)}),a.jsx(ye,{justify:"flex-end",children:a.jsx(Pe,{type:"submit",children:"Resend"})})]})})})}function E2(){const e=_e(),t=df(),{resourceType:n,id:r}=Ht(),o={reference:n+"/"+r},[s,c]=v.useState(),d=Zc(!1);function f(E,T){return e.updateResource({...E,priority:T})}function p(E,T){f(E,"stat").then(T).catch(console.error)}function m(E,T){f(E,"routine").then(T).catch(console.error)}function g(E){t(`/${E.resourceType}/${E.id}`)}function y(E){t(`/${E.resourceType}/${E.id}/edit`)}function b(E){t(`/${E.resourceType}/${E.id}/delete`)}function S(E){c(E),d[1].open()}function j(E){t(`/${E.resourceType}/${E.id}/_history/${E.meta?.versionId}`)}function C(E,T){const _="aws-textract";Ne({id:_,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(E.resourceType,E.id,"$aws-textract"),{}).then(()=>{T(),rl({id:_,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:a.jsx(Vo,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(k=>rl({id:_,title:"AWS Textract Error",color:"red",message:Qe(k),icon:a.jsx(yl,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function R(E){const{primaryResource:T,currentResource:_,reloadTimeline:k}=E,I=_.resourceType===T.resourceType&&_.id===T.id,A=_.resourceType==="Communication"&&_.priority!=="stat",P=_.resourceType==="Communication"&&_.priority==="stat",z=I,B=!I,Y=!I,J=!I,Z=e.getProjectMembership()?.admin,$=Z,Q=Mre()&&(_.resourceType==="DocumentReference"||_.resourceType==="Media");return a.jsxs(xe.Dropdown,{children:[a.jsx(xe.Label,{children:"Resource"}),A&&a.jsx(xe.Item,{leftSection:a.jsx(rG,{size:14}),onClick:()=>p(_,k),"aria-label":`Pin ${Ot(_)}`,children:"Pin"}),P&&a.jsx(xe.Item,{leftSection:a.jsx(oG,{size:14}),onClick:()=>m(_,k),"aria-label":`Unpin ${Ot(_)}`,children:"Unpin"}),B&&a.jsx(xe.Item,{leftSection:a.jsx(eR,{size:14}),onClick:()=>g(_),"aria-label":`Details ${Ot(_)}`,children:"Details"}),z&&a.jsx(xe.Item,{leftSection:a.jsx(eR,{size:14}),onClick:()=>j(_),"aria-label":`Details ${Ot(_)}`,children:"Details"}),Y&&a.jsx(xe.Item,{leftSection:a.jsx(Mk,{size:14}),onClick:()=>y(_),"aria-label":`Edit ${Ot(_)}`,children:"Edit"}),Z&&a.jsxs(a.Fragment,{children:[a.jsx(xe.Divider,{}),a.jsx(xe.Label,{children:"Admin"}),$&&a.jsx(xe.Item,{leftSection:a.jsx(hG,{size:14}),onClick:()=>S(_),"aria-label":`Resend Subscriptions ${Ot(_)}`,children:"Resend Subscriptions"})]}),Q&&a.jsxs(a.Fragment,{children:[a.jsx(xe.Divider,{}),a.jsx(xe.Label,{children:"AWS AI"}),a.jsx(xe.Item,{leftSection:a.jsx(kG,{size:14}),onClick:()=>C(_,k),"aria-label":`AWS Textract ${Ot(_)}`,children:"AWS Textract"})]}),J&&a.jsxs(a.Fragment,{children:[a.jsx(xe.Divider,{}),a.jsx(xe.Label,{children:"Danger zone"}),a.jsx(xe.Item,{color:"red",leftSection:a.jsx(Ym,{size:14}),onClick:()=>b(_),"aria-label":`Delete ${Ot(_)}`,children:"Delete"})]})]})}return a.jsxs(a.Fragment,{children:[n==="Encounter"&&a.jsx(xK,{encounter:o,getMenu:R}),n==="Patient"&&a.jsx(kX,{patient:o,getMenu:R}),n==="ServiceRequest"&&a.jsx(uZ,{serviceRequest:o,getMenu:R}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&a.jsx(yK,{resource:o,getMenu:R}),a.jsx($ie,{resource:s,opened:d[0],onClose:d[1].close},`resend-subscriptions-${s?.id}`)]})}function Uie(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||KF("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(ye,{children:[a.jsx(Pe,{onClick:()=>{c(p),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),a.jsx($n,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):a.jsx(Ni,{})}function Bie(){const e=_e(),{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(),[b,S]=v.useState(),[j,C]=v.useState(),[R,E]=v.useState(),[T,_]=v.useState(!1),[k,I]=v.useState(!1),[A,P]=v.useState(),[z,{open:B,close:Y}]=Zc(!1);v.useEffect(()=>{if(r||s||d||T){I(!0);return}I(!1)},[r,s,d,T]);const J=v.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(V=>{y(V.parameter?.find(K=>K.name==="status")?.valueCode),S(V.parameter?.find(K=>K.name==="version")?.valueString),C(V.parameter?.find(K=>K.name==="lastUpdated")?.valueInstant)}).catch(V=>U(Qe(V))).finally(()=>o(!1))},[e,t]),Z=v.useCallback(V=>{const K=V.host,O=V.pingCount||1;K&&(_(!0),e.pushToAgent(n,K,`PING ${O}`,nn.PING,!0).then(F=>E(F)).catch(F=>U(Qe(F))).finally(()=>_(!1)))},[e,n]),$=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(V=>{L("Agent config reloaded successfully.")}).catch(V=>U(Qe(V))).finally(()=>c(!1))},[e,t]),Q=v.useCallback(V=>{f(!0);const K=e.fhirUrl("Agent",t,"$upgrade");K.searchParams.set("force",String(V)),e.get(K,{cache:"reload"}).then(O=>{L("Agent upgraded successfully.")}).catch(O=>U(Qe(O))).finally(()=>f(!1))},[e,t]),M=v.useCallback(V=>{m(!0);const K=V.logLimit||20;e.get(e.fhirUrl("Agent",t,`$fetch-logs${K!==void 0?`?limit=${K}`:""}`),{cache:"reload"}).then(O=>{const F=O?.parameter?.find(ae=>ae.name==="logs");F&&P(F?.valueString)}).catch(O=>U(Qe(O))).finally(()=>m(!1))},[e,t]);function L(V){Ne({color:"green",title:"Success",icon:a.jsx(Vo,{size:"1rem"}),message:V})}function U(V){Ne({color:"red",title:"Error",message:V,autoClose:!1})}return a.jsxs(dt,{children:[a.jsx(Vn,{opened:z,onClose:Y,title:"Upgrade Agent",centered:!0,children:a.jsx(Uie,{opened:z,close:Y,version:b,loadingStatus:r,handleStatus:J,handleUpgrade:Q})}),a.jsx(ze,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(Nl,{value:n,link:!0})]}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Pe,{onClick:J,loading:r,disabled:k&&!r,children:"Get Status"}),!r&&g&&a.jsx(de,{children:a.jsxs(de.Tbody,{children:[a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:"Status"}),a.jsx(de.Td,{children:a.jsx(ig,{status:g})})]}),a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:"Version"}),a.jsx(de.Td,{children:b})]}),a.jsxs(de.Tr,{children:[a.jsx(de.Td,{children:"Last Updated"}),a.jsx(de.Td,{children:wr(j,void 0,{timeZoneName:"longOffset"})})]})]})}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Pe,{onClick:$,loading:s,disabled:k&&!s,"aria-label":"Reload config",children:"Reload Config"}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(Pe,{onClick:B,loading:d,disabled:k&&!d,"aria-label":"Upgrade agent",children:"Upgrade"}),a.jsx(_n,{my:"lg"}),a.jsxs(pt,{onSubmit:M,children:[a.jsx(ze,{order:2,children:"Fetch Logs"}),a.jsx("p",{children:"Fetch logs from the agent."}),A?.length?a.jsx(Jd,{block:!0,mb:15,children:A}):null,a.jsxs(ye,{children:[a.jsx(Hc,{w:100,id:"logLimit",name:"logLimit",placeholder:"20",label:"Log Limit"}),a.jsx(Pe,{mt:22,loading:p,disabled:k&&!p,"aria-label":"Fetch logs",type:"submit",children:"Fetch Logs"})]})]}),a.jsx(_n,{my:"lg"}),a.jsx(ze,{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(ye,{children:[a.jsx(He,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(Dn,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:T,disabled:k&&!T,children:a.jsx(vG,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(Hc,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!T&&R&&a.jsxs(a.Fragment,{children:[a.jsx(ze,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:R})]})]})}function Vie(){const e=kn(),t=_e(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(s=>Ne({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(()=>Ne({color:"green",message:"Login revoked"})).catch(c=>Ne({color:"red",message:Qe(c),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(dt,{children:[a.jsx(ze,{children:"Security"}),a.jsxs(yf,{children:[a.jsx(Lr,{term:"ID",children:a.jsx(Mt,{href:`/${Ot(n.profile)}`,children:n.profile.id})}),a.jsx(Lr,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(Lr,{term:"Name",children:Rs(n.profile.name?.[0])})]})]}),a.jsxs(dt,{children:[a.jsx(ze,{children:"Sessions"}),a.jsxs(de,{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:wr(s.lastUpdated)}),a.jsx("td",{children:a.jsx(Mt,{href:"#",onClick:()=>o(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(dt,{children:[a.jsx(ze,{children:"Password"}),a.jsx(Pe,{onClick:()=>e("/changepassword")?.catch(console.error),children:"Change password"})]}),a.jsxs(dt,{children:[a.jsx(ze,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(Pe,{onClick:()=>e("/mfa")?.catch(console.error),children:"Enroll"})]})]}):null}function Fie(){const{id:e,secret:t}=Ht(),n=_e(),[r,o]=v.useState(),[s,c]=v.useState(!1),d=hu(r,void 0);return a.jsxs(dt,{width:450,children:[a.jsx(Er,{issues:d}),a.jsxs(pt,{onSubmit:f=>{if(f.password!==f.confirmPassword){o(Eo("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(Yt(m)))},children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(ze,{children:"Set password"})]}),!s&&a.jsxs(Ue,{children:[a.jsx(Ki,{name:"password",label:"New password",required:!0,error:Lt(r,"password")}),a.jsx(Ki,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Lt(r,"confirmPassword")}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Pe,{type:"submit",children:"Set password"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(jt,{to:"/signin",children:"sign in"}),"."]})]})]})}function Hie(){const e=ff(),t=kn(),[n]=s1(),r=Ef(),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(lP,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword")?.catch(console.error),onRegister:LN()?()=>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($i,{size:32}),a.jsxs(ze,{children:["Sign in to ",Fk()]}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function qie(){const e=kn(),t=ti(),[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(gX,{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 Gie(){const{id:e,secret:t}=Ht(),n=_e(),[r,o]=v.useState(),[s,c]=v.useState(!1),d=hu(r,void 0);return a.jsxs(dt,{width:450,children:[a.jsx(Er,{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(Yt(p)))},children:[a.jsxs(hr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(ze,{children:"Email address verification required"})]}),!s&&a.jsxs(Ue,{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(ye,{justify:"flex-end",mt:"xl",children:a.jsx(Pe,{type:"submit",children:"Verify email"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Email verified. You can now ",a.jsx(jt,{to:"/signin",children:"sign in"}),"."]})]})]})}function Qie(){return a.jsx(Jee,{children:a.jsxs($e,{errorElement:a.jsx(bre,{}),children:[a.jsx($e,{path:"/signin",element:a.jsx(Hie,{})}),a.jsx($e,{path:"/oauth",element:a.jsx(Lre,{})}),a.jsx($e,{path:"/resetpassword",element:a.jsx(zre,{})}),a.jsx($e,{path:"/setpassword/:id/:secret",element:a.jsx(Fie,{})}),a.jsx($e,{path:"/verifyemail/:id/:secret",element:a.jsx(Gie,{})}),a.jsx($e,{path:"/register",element:a.jsx(Ire,{})}),a.jsx($e,{path:"/changepassword",element:a.jsx(vre,{})}),a.jsx($e,{path:"/security",element:a.jsx(Vie,{})}),a.jsx($e,{path:"/mfa",element:a.jsx(Nre,{})}),a.jsx($e,{path:"/batch",element:a.jsx(mre,{})}),a.jsx($e,{path:"/bulk/:resourceType",element:a.jsx(gre,{})}),a.jsx($e,{path:"/smart",element:a.jsx(qie,{})}),a.jsx($e,{path:"/forms/:id",element:a.jsx(Sre,{})}),a.jsx($e,{path:"/admin/super",element:a.jsx(sne,{})}),a.jsx($e,{path:"/admin/super/asyncjob",element:a.jsx(tne,{})}),a.jsx($e,{path:"/admin/super/db",element:a.jsx(Gte,{})}),a.jsx($e,{path:"/admin/config",element:a.jsx(Xte,{})}),a.jsxs($e,{path:"/admin",element:a.jsx(Jte,{}),children:[a.jsx($e,{path:"patients",element:a.jsx(Kte,{})}),a.jsx($e,{path:"bots/new",element:a.jsx(Ite,{})}),a.jsx($e,{path:"bots",element:a.jsx(Mte,{})}),a.jsx($e,{path:"clients/new",element:a.jsx(zte,{})}),a.jsx($e,{path:"clients",element:a.jsx(Lte,{})}),a.jsx($e,{path:"details",element:a.jsx(o2,{})}),a.jsx($e,{path:"invite",element:a.jsx(Yte,{})}),a.jsx($e,{path:"users",element:a.jsx(une,{})}),a.jsx($e,{path:"project",element:a.jsx(o2,{})}),a.jsx($e,{path:"secrets",element:a.jsx(Zte,{})}),a.jsx($e,{path:"sites",element:a.jsx(ene,{})}),a.jsx($e,{path:"members/:membershipId",element:a.jsx(Wte,{})})]}),a.jsx($e,{path:"/lab/assays",element:a.jsx(kre,{})}),a.jsx($e,{path:"/lab/panels",element:a.jsx(Pre,{})}),a.jsxs($e,{path:"/:resourceType/new",element:a.jsx(xre,{}),children:[a.jsx($e,{index:!0,element:a.jsx(xx,{})}),a.jsx($e,{path:"form",element:a.jsx(xx,{})}),a.jsx($e,{path:"json",element:a.jsx(sie,{})}),a.jsx($e,{path:"profiles",element:a.jsx(xx,{})})]}),a.jsxs($e,{path:"/:resourceType/:id",element:a.jsx(Iie,{}),children:[a.jsx($e,{index:!0,element:a.jsx(E2,{})}),a.jsx($e,{path:"apply",element:a.jsx(Ure,{})}),a.jsx($e,{path:"apps",element:a.jsx(Bre,{})}),a.jsx($e,{path:"event",element:a.jsx(Fre,{})}),a.jsx($e,{path:"blame",element:a.jsx(Hre,{})}),a.jsx($e,{path:"bots",element:a.jsx(xie,{})}),a.jsx($e,{path:"builder",element:a.jsx(Zre,{})}),a.jsx($e,{path:"checklist",element:a.jsx(eie,{})}),a.jsx($e,{path:"delete",element:a.jsx(tie,{})}),a.jsx($e,{path:"details",element:a.jsx(iie,{})}),a.jsx($e,{path:"edit",element:a.jsx(oie,{})}),a.jsx($e,{path:"editor",element:a.jsx(Xre,{})}),a.jsxs($e,{path:"history",children:[a.jsx($e,{index:!0,element:a.jsx(C2,{})}),a.jsx($e,{path:":versionId/:tab",element:a.jsx(rp,{})}),a.jsx($e,{path:":versionId",element:a.jsx(rp,{})})]}),a.jsxs($e,{path:"_history",children:[a.jsx($e,{index:!0,element:a.jsx(C2,{})}),a.jsx($e,{path:":versionId/:tab",element:a.jsx(rp,{})}),a.jsx($e,{path:":versionId",element:a.jsx(rp,{})})]}),a.jsx($e,{path:"json",element:a.jsx(lie,{})}),a.jsx($e,{path:"preview",element:a.jsx(mie,{})}),a.jsx($e,{path:"responses",element:a.jsx(Sie,{})}),a.jsx($e,{path:"report",element:a.jsx(jie,{})}),a.jsx($e,{path:"ranges",element:a.jsx(wie,{})}),a.jsx($e,{path:"subscriptions",element:a.jsx(zie,{})}),a.jsx($e,{path:"timeline",element:a.jsx(E2,{})}),a.jsx($e,{path:"tools",element:a.jsx(Bie,{})}),a.jsx($e,{path:"profiles",element:a.jsx(gie,{})}),a.jsx($e,{path:"export",element:a.jsx(aie,{})})]}),a.jsx($e,{path:"/:resourceType",element:a.jsx(S2,{})}),a.jsx($e,{path:"/",element:a.jsx(S2,{})})]})})}function Wie(){const e=_e(),t=e.getUserConfiguration(),n=ti(),[r]=s1();return e.isLoading()?a.jsx(Ni,{}):a.jsx(ZQ,{logo:a.jsx($i,{size:24}),pathname:n.pathname,searchParams:r,version:vk,menus:Yie(t),displayAddBookmark:!!t?.id,children:a.jsx(v.Suspense,{fallback:a.jsx(Ni,{}),children:a.jsx(Qie,{})})})}function Yie(e){const t=e?.menu?.map(n=>({title:n.title,links:n.link?.map(r=>({label:r.name,href:r.target,icon:Kie(r.target)}))||[]}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(Fq,{})}]}),t}const T2={Patient:EG,Practitioner:Lq,Organization:ZH,ServiceRequest:uG,DiagnosticReport:mG,Questionnaire:Oq,admin:QH,AccessPolicy:Bq,Subscription:MG,batch:tG,Observation:Xq};function Kie(e){if(e.includes("admin/super/db"))return a.jsx(gq,{});try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in T2){const n=T2[t];return a.jsx(n,{})}}catch{}return a.jsx(Im,{w:20})}async function Xie(){const e=Ef(),t=new yk({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=wte([{path:"*",element:a.jsx(Wie,{})}]),o=c=>r.navigate(c);gZ.createRoot(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(XF,{medplum:t,navigate:o,children:a.jsxs(K2,{theme:n,children:[a.jsx(Ra,{position:"bottom-right"}),a.jsx(Wee,{router:r})]})})}))}Xie().catch(console.error);
|
|
263
|
-
//# sourceMappingURL=index-CjxNlO-J.js.map
|