@medplum/app 4.3.5 → 4.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,589 +0,0 @@
1
- function g3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function hx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wv={exports:{}},Ou={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Bj;function v3(){if(Bj)return Ou;Bj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var c=null;if(o!==void 0&&(c=""+o),i.key!==void 0&&(c=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:c,ref:i!==void 0?i:null,props:o}}return Ou.Fragment=t,Ou.jsx=n,Ou.jsxs=n,Ou}var Vj;function y3(){return Vj||(Vj=1,wv.exports=v3()),wv.exports}var s=y3(),ea=function(){return ea=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ea.apply(this,arguments)};function lR(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function x3(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var jv={exports:{}},xt={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Fj;function b3(){if(Fj)return xt;Fj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=g&&O[g]||O["@@iterator"],typeof O=="function"?O:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function C(O,U,K){this.props=O,this.context=U,this.refs=w,this.updater=K||b}C.prototype.isReactComponent={},C.prototype.setState=function(O,U){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,U,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=C.prototype;function _(O,U,K){this.props=O,this.context=U,this.refs=w,this.updater=K||b}var T=_.prototype=new E;T.constructor=_,S(T,C.prototype),T.isPureReactComponent=!0;var R=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},k=Object.prototype.hasOwnProperty;function M(O,U,K,ee,Se,be){return K=be.ref,{$$typeof:e,type:O,key:U,ref:K!==void 0?K:null,props:be}}function I(O,U){return M(O.type,U,void 0,void 0,void 0,O.props)}function z(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function V(O){var U={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(K){return U[K]})}var Y=/\/+/g;function W(O,U){return typeof O=="object"&&O!==null&&O.key!=null?V(""+O.key):U.toString(36)}function J(){}function G(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(J,J):(O.status="pending",O.then(function(U){O.status==="pending"&&(O.status="fulfilled",O.value=U)},function(U){O.status==="pending"&&(O.status="rejected",O.reason=U)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function X(O,U,K,ee,Se){var be=typeof O;(be==="undefined"||be==="boolean")&&(O=null);var xe=!1;if(O===null)xe=!0;else switch(be){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(O.$$typeof){case e:case t:xe=!0;break;case m:return xe=O._init,X(xe(O._payload),U,K,ee,Se)}}if(xe)return Se=Se(O),xe=ee===""?"."+W(O,0):ee,R(Se)?(K="",xe!=null&&(K=xe.replace(Y,"$&/")+"/"),X(Se,U,K,"",function(tt){return tt})):Se!=null&&(z(Se)&&(Se=I(Se,K+(Se.key==null||O&&O.key===Se.key?"":(""+Se.key).replace(Y,"$&/")+"/")+xe)),U.push(Se)),1;xe=0;var Ge=ee===""?".":ee+":";if(R(O))for(var Me=0;Me<O.length;Me++)ee=O[Me],be=Ge+W(ee,Me),xe+=X(ee,U,K,be,Se);else if(Me=v(O),typeof Me=="function")for(O=Me.call(O),Me=0;!(ee=O.next()).done;)ee=ee.value,be=Ge+W(ee,Me++),xe+=X(ee,U,K,be,Se);else if(be==="object"){if(typeof O.then=="function")return X(G(O),U,K,ee,Se);throw U=String(O),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return xe}function P(O,U,K){if(O==null)return O;var ee=[],Se=0;return X(O,ee,"","",function(be){return U.call(K,be,Se++)}),ee}function L(O){if(O._status===-1){var U=O._result;U=U(),U.then(function(K){(O._status===0||O._status===-1)&&(O._status=1,O._result=K)},function(K){(O._status===0||O._status===-1)&&(O._status=2,O._result=K)}),O._status===-1&&(O._status=0,O._result=U)}if(O._status===1)return O._result.default;throw O._result}var $=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function H(){}return xt.Children={map:P,forEach:function(O,U,K){P(O,function(){U.apply(this,arguments)},K)},count:function(O){var U=0;return P(O,function(){U++}),U},toArray:function(O){return P(O,function(U){return U})||[]},only:function(O){if(!z(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},xt.Component=C,xt.Fragment=n,xt.Profiler=i,xt.PureComponent=_,xt.StrictMode=r,xt.Suspense=f,xt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,xt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},xt.cache=function(O){return function(){return O.apply(null,arguments)}},xt.cloneElement=function(O,U,K){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ee=S({},O.props),Se=O.key,be=void 0;if(U!=null)for(xe in U.ref!==void 0&&(be=void 0),U.key!==void 0&&(Se=""+U.key),U)!k.call(U,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&U.ref===void 0||(ee[xe]=U[xe]);var xe=arguments.length-2;if(xe===1)ee.children=K;else if(1<xe){for(var Ge=Array(xe),Me=0;Me<xe;Me++)Ge[Me]=arguments[Me+2];ee.children=Ge}return M(O.type,Se,void 0,void 0,be,ee)},xt.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},xt.createElement=function(O,U,K){var ee,Se={},be=null;if(U!=null)for(ee in U.key!==void 0&&(be=""+U.key),U)k.call(U,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(Se[ee]=U[ee]);var xe=arguments.length-2;if(xe===1)Se.children=K;else if(1<xe){for(var Ge=Array(xe),Me=0;Me<xe;Me++)Ge[Me]=arguments[Me+2];Se.children=Ge}if(O&&O.defaultProps)for(ee in xe=O.defaultProps,xe)Se[ee]===void 0&&(Se[ee]=xe[ee]);return M(O,be,void 0,void 0,null,Se)},xt.createRef=function(){return{current:null}},xt.forwardRef=function(O){return{$$typeof:u,render:O}},xt.isValidElement=z,xt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:L}},xt.memo=function(O,U){return{$$typeof:h,type:O,compare:U===void 0?null:U}},xt.startTransition=function(O){var U=D.T,K={};D.T=K;try{var ee=O(),Se=D.S;Se!==null&&Se(K,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(H,$)}catch(be){$(be)}finally{D.T=U}},xt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},xt.use=function(O){return D.H.use(O)},xt.useActionState=function(O,U,K){return D.H.useActionState(O,U,K)},xt.useCallback=function(O,U){return D.H.useCallback(O,U)},xt.useContext=function(O){return D.H.useContext(O)},xt.useDebugValue=function(){},xt.useDeferredValue=function(O,U){return D.H.useDeferredValue(O,U)},xt.useEffect=function(O,U,K){var ee=D.H;if(typeof K=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(O,U)},xt.useId=function(){return D.H.useId()},xt.useImperativeHandle=function(O,U,K){return D.H.useImperativeHandle(O,U,K)},xt.useInsertionEffect=function(O,U){return D.H.useInsertionEffect(O,U)},xt.useLayoutEffect=function(O,U){return D.H.useLayoutEffect(O,U)},xt.useMemo=function(O,U){return D.H.useMemo(O,U)},xt.useOptimistic=function(O,U){return D.H.useOptimistic(O,U)},xt.useReducer=function(O,U,K){return D.H.useReducer(O,U,K)},xt.useRef=function(O){return D.H.useRef(O)},xt.useState=function(O){return D.H.useState(O)},xt.useSyncExternalStore=function(O,U,K){return D.H.useSyncExternalStore(O,U,K)},xt.useTransition=function(){return D.H.useTransition()},xt.version="19.1.0",xt}var Hj;function px(){return Hj||(Hj=1,jv.exports=b3()),jv.exports}var y=px();const En=hx(y),S3=g3({__proto__:null,default:En},[y]);var hh="right-scroll-bar-position",ph="width-before-scroll-bar",w3="with-scroll-bars-hidden",j3="--removed-body-scroll-bar-size";function Cv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function C3(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var E3=typeof window<"u"?y.useLayoutEffect:y.useEffect,qj=new WeakMap;function T3(e,t){var n=C3(null,function(r){return e.forEach(function(i){return Cv(i,r)})});return E3(function(){var r=qj.get(n);if(r){var i=new Set(r),o=new Set(e),c=n.current;i.forEach(function(u){o.has(u)||Cv(u,null)}),o.forEach(function(u){i.has(u)||Cv(u,c)})}qj.set(n,e)},[e]),n}function R3(e){return e}function _3(e,t){t===void 0&&(t=R3);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var c=t(o,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(o){for(r=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(o),c=n}var f=function(){var m=c;c=[],m.forEach(o)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){c.push(m),h()},filter:function(m){return c=c.filter(m),n}}}};return i}function D3(e){e===void 0&&(e={});var t=_3(null);return t.options=ea({async:!0,ssr:!1},e),t}var cR=function(e){var t=e.sideCar,n=lR(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,ea({},n))};cR.isSideCarExport=!0;function A3(e,t){return e.useMedium(t),cR}var uR=D3(),Ev=function(){},lp=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Ev,onWheelCapture:Ev,onTouchMoveCapture:Ev}),i=r[0],o=r[1],c=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,g=e.shards,v=e.sideCar,b=e.noRelative,S=e.noIsolation,w=e.inert,C=e.allowPinchZoom,E=e.as,_=E===void 0?"div":E,T=e.gapMode,R=lR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=v,k=T3([n,t]),M=ea(ea({},R),i);return y.createElement(y.Fragment,null,m&&y.createElement(D,{sideCar:uR,removeScrollBar:h,shards:g,noRelative:b,noIsolation:S,inert:w,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:T}),c?y.cloneElement(y.Children.only(u),ea(ea({},M),{ref:k})):y.createElement(_,ea({},M,{className:f,ref:k}),u))});lp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lp.classNames={fullWidth:ph,zeroRight:hh};var k3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function P3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=k3();return t&&e.setAttribute("nonce",t),e}function N3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function O3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var M3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=P3())&&(N3(t,n),O3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},I3=function(){var e=M3();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dR=function(){var e=I3(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},L3={left:0,top:0,right:0,gap:0},Tv=function(e){return parseInt(e||"",10)||0},$3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Tv(n),Tv(r),Tv(i)]},z3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return L3;var t=$3(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])}},U3=dR(),rc="data-scroll-locked",B3=function(e,t,n,r){var i=e.left,o=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
18
- .`.concat(w3,` {
19
- overflow: hidden `).concat(r,`;
20
- padding-right: `).concat(u,"px ").concat(r,`;
21
- }
22
- body[`).concat(rc,`] {
23
- overflow: hidden `).concat(r,`;
24
- overscroll-behavior: contain;
25
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
26
- padding-left: `.concat(i,`px;
27
- padding-top: `).concat(o,`px;
28
- padding-right: `).concat(c,`px;
29
- margin-left:0;
30
- margin-top:0;
31
- margin-right: `).concat(u,"px ").concat(r,`;
32
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
33
- }
34
-
35
- .`).concat(hh,` {
36
- right: `).concat(u,"px ").concat(r,`;
37
- }
38
-
39
- .`).concat(ph,` {
40
- margin-right: `).concat(u,"px ").concat(r,`;
41
- }
42
-
43
- .`).concat(hh," .").concat(hh,` {
44
- right: 0 `).concat(r,`;
45
- }
46
-
47
- .`).concat(ph," .").concat(ph,` {
48
- margin-right: 0 `).concat(r,`;
49
- }
50
-
51
- body[`).concat(rc,`] {
52
- `).concat(j3,": ").concat(u,`px;
53
- }
54
- `)},Gj=function(){var e=parseInt(document.body.getAttribute(rc)||"0",10);return isFinite(e)?e:0},V3=function(){y.useEffect(function(){return document.body.setAttribute(rc,(Gj()+1).toString()),function(){var e=Gj()-1;e<=0?document.body.removeAttribute(rc):document.body.setAttribute(rc,e.toString())}},[])},F3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;V3();var o=y.useMemo(function(){return z3(i)},[i]);return y.createElement(U3,{styles:B3(o,!t,i,n?"":"!important")})},by=!1;if(typeof window<"u")try{var Kf=Object.defineProperty({},"passive",{get:function(){return by=!0,!0}});window.addEventListener("test",Kf,Kf),window.removeEventListener("test",Kf,Kf)}catch{by=!1}var Fl=by?{passive:!1}:!1,H3=function(e){return e.tagName==="TEXTAREA"},fR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!H3(e)&&n[t]==="visible")},q3=function(e){return fR(e,"overflowY")},G3=function(e){return fR(e,"overflowX")},Wj=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=hR(e,r);if(i){var o=pR(e,r),c=o[1],u=o[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},W3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Q3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hR=function(e,t){return e==="v"?q3(t):G3(t)},pR=function(e,t){return e==="v"?W3(t):Q3(t)},Y3=function(e,t){return e==="h"&&t==="rtl"?-1:1},X3=function(e,t,n,r,i){var o=Y3(e,window.getComputedStyle(t).direction),c=o*r,u=n.target,f=t.contains(u),h=!1,m=c>0,g=0,v=0;do{if(!u)break;var b=pR(e,u),S=b[0],w=b[1],C=b[2],E=w-C-o*S;(S||E)&&hR(e,u)&&(g+=E,v+=S);var _=u.parentNode;u=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(v)<1)&&(h=!0),h},Zf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qj=function(e){return[e.deltaX,e.deltaY]},Yj=function(e){return e&&"current"in e?e.current:e},K3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Z3=function(e){return`
55
- .block-interactivity-`.concat(e,` {pointer-events: none;}
56
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
- `)},J3=0,Hl=[];function eN(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(J3++)[0],o=y.useState(dR)[0],c=y.useRef(e);y.useEffect(function(){c.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=x3([e.lockRef.current],(e.shards||[]).map(Yj),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!c.current.allowPinchZoom;var E=Zf(w),_=n.current,T="deltaX"in w?w.deltaX:_[0]-E[0],R="deltaY"in w?w.deltaY:_[1]-E[1],D,k=w.target,M=Math.abs(T)>Math.abs(R)?"h":"v";if("touches"in w&&M==="h"&&k.type==="range")return!1;var I=Wj(M,k);if(!I)return!0;if(I?D=M:(D=M==="v"?"h":"v",I=Wj(M,k)),!I)return!1;if(!r.current&&"changedTouches"in w&&(T||R)&&(r.current=D),!D)return!0;var z=r.current||D;return X3(z,C,w,z==="h"?T:R)},[]),f=y.useCallback(function(w){var C=w;if(!(!Hl.length||Hl[Hl.length-1]!==o)){var E="deltaY"in C?Qj(C):Zf(C),_=t.current.filter(function(D){return D.name===C.type&&(D.target===C.target||C.target===D.shadowParent)&&K3(D.delta,E)})[0];if(_&&_.should){C.cancelable&&C.preventDefault();return}if(!_){var T=(c.current.shards||[]).map(Yj).filter(Boolean).filter(function(D){return D.contains(C.target)}),R=T.length>0?u(C,T[0]):!c.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),h=y.useCallback(function(w,C,E,_){var T={name:w,delta:C,target:E,should:_,shadowParent:tN(E)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(R){return R!==T})},1)},[]),m=y.useCallback(function(w){n.current=Zf(w),r.current=void 0},[]),g=y.useCallback(function(w){h(w.type,Qj(w),w.target,u(w,e.lockRef.current))},[]),v=y.useCallback(function(w){h(w.type,Zf(w),w.target,u(w,e.lockRef.current))},[]);y.useEffect(function(){return Hl.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Fl),document.addEventListener("touchmove",f,Fl),document.addEventListener("touchstart",m,Fl),function(){Hl=Hl.filter(function(w){return w!==o}),document.removeEventListener("wheel",f,Fl),document.removeEventListener("touchmove",f,Fl),document.removeEventListener("touchstart",m,Fl)}},[]);var b=e.removeScrollBar,S=e.inert;return y.createElement(y.Fragment,null,S?y.createElement(o,{styles:Z3(i)}):null,b?y.createElement(F3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tN(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nN=A3(uR,eN);var cc=y.forwardRef(function(e,t){return y.createElement(lp,ea({},e,{ref:t,sideCar:nN}))});cc.classNames=lp.classNames;function sn(e){return Object.keys(e)}function Rv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function mx(e,t){const n={...e},r=t;return Rv(e)&&Rv(t)&&Object.keys(t).forEach(i=>{Rv(r[i])&&i in e?n[i]=mx(n[i],r[i]):n[i]=r[i]}),n}function rN(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function iN(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function Ku(e){const t=iN(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 _v(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function mR(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const i=`${r/16}${e}`;return t?_v(i):i}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(o=>n(o)).join(",");if(r.includes(" "))return r.split(" ").map(o=>n(o)).join(" ");if(r.includes(e))return t?_v(r):r;const i=r.replace("px","");if(!Number.isNaN(Number(i))){const o=`${Number(i)/16}${e}`;return t?_v(o):o}}return r}return n}const le=mR("rem",{shouldScale:!0}),Eh=mR("em");function Go(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function gR(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 qa(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==y.Fragment:!1}function vr(e){const t=y.createContext(null);return[({children:i,value:o})=>s.jsx(t.Provider,{value:o,children:i}),()=>{const i=y.useContext(t);if(i===null)throw new Error(e);return i}]}function Ga(e=null){const t=y.createContext(e);return[({children:i,value:o})=>s.jsx(t.Provider,{value:o,children:i}),()=>y.useContext(t)]}function Xj(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Th(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function aN(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 oN(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 sN(e,t,n){return Th(e,n)===Th(t,n)}function vR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:o="rtl",orientation:c}){return u=>{var S;n==null||n(u);const f=Array.from(((S=Th(u.currentTarget,e))==null?void 0:S.querySelectorAll(t))||[]).filter(w=>sN(u.currentTarget,w,e)),h=f.findIndex(w=>u.currentTarget===w),m=oN(h,f,r),g=aN(h,f,r),v=o==="rtl"?g:m,b=o==="rtl"?m:g;switch(u.key){case"ArrowRight":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[v].focus(),i&&f[v].click());break}case"ArrowLeft":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[b].focus(),i&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[g].focus(),i&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[m].focus(),i&&f[m].click());break}case"Home":{u.stopPropagation(),u.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{u.stopPropagation(),u.preventDefault();const w=f.length-1;!f[w].disabled&&f[w].focus();break}}}}const lN={app:100,modal:200,popover:300,overlay:400,max:9999};function Qr(e){return lN[e]}const Rh=()=>{};function cN(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Rh:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function rt(e,t="size",n=!0){if(e!==void 0)return gR(e)?n?le(e):e:`var(--${t}-${e})`}function Nn(e){return rt(e,"mantine-spacing")}function Vt(e){return e===void 0?"var(--mantine-radius-default)":rt(e,"mantine-radius")}function On(e){return rt(e,"mantine-font-size")}function yR(e){return rt(e,"mantine-line-height",!1)}function gx(e){if(e)return rt(e,"mantine-shadow",!1)}function _r(e,t){return n=>{e==null||e(n),t==null||t(n)}}function vx(e,t){return e in t?Ku(t[e]):Ku(e)}function Zu(e,t){const n=e.map(r=>({value:r,px:vx(r,t)}));return n.sort((r,i)=>r.px-i.px),n}function Ai(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function uN(e,t,n){var r;return n?Array.from(((r=Th(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(i=>i===n):null}function dN(){const[e,t]=y.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function mh(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 _h(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function fN(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 i=0;i<r;i+=1){const o=n[i];if(!(o in t)||e[o]!==t[o]&&!(Number.isNaN(e[o])&&Number.isNaN(t[o])))return!1}return!0}function Kj(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Es(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function cp(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,i=Es(e),o=y.useRef(0),c=y.useRef(()=>{}),u=Object.assign(y.useCallback((...f)=>{window.clearTimeout(o.current);const h=()=>{o.current!==0&&(o.current=0,i(...f))};c.current=h,u.flush=h,o.current=window.setTimeout(h,n)},[i,n]),{flush:c.current});return y.useEffect(()=>()=>{window.clearTimeout(o.current),r&&u.flush()},[u,r]),u}const Zj=["mousedown","touchstart"];function hN(e,t,n){const r=y.useRef(null);return y.useEffect(()=>{const i=o=>{const{target:c}=o??{};if(Array.isArray(n)){const u=(c==null?void 0:c.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(c)&&c.tagName!=="HTML";n.every(h=>!!h&&!o.composedPath().includes(h))&&!u&&e()}else r.current&&!r.current.contains(c)&&e()};return(t||Zj).forEach(o=>document.addEventListener(o,i)),()=>{(t||Zj).forEach(o=>document.removeEventListener(o,i))}},[r,e,n]),r}function xR({timeout:e=2e3}={}){const[t,n]=y.useState(null),[r,i]=y.useState(!1),[o,c]=y.useState(null),u=m=>{window.clearTimeout(o),c(window.setTimeout(()=>i(!1),e)),i(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>u(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{i(!1),n(null),window.clearTimeout(o)},error:t,copied:r}}function pN(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function mN(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function bR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=y.useState(n?t:mN(e)),o=y.useRef(null);return y.useEffect(()=>{if("matchMedia"in window)return o.current=window.matchMedia(e),i(o.current.matches),pN(o.current,c=>i(c.matches))},[e]),r}function gN(e,t){return bR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const wc=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Ua(e,t){const n=y.useRef(!1);y.useEffect(()=>()=>{n.current=!1},[]),y.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function SR({opened:e,shouldReturnFocus:t=!0}){const n=y.useRef(null),r=()=>{var i;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((i=n.current)==null||i.focus({preventScroll:!0}))};return Ua(()=>{let i=-1;const o=c=>{c.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",o),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",o)}},[e,t]),r}const vN=/input|select|textarea|button|object/,wR="a, input, select, textarea, button, object, [tabindex]";function yN(e){return e.style.display==="none"}function xN(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(yN(n))return!1;n=n.parentNode}return!0}function jR(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Sy(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(jR(e));return(vN.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&xN(e)}function CR(e){const t=jR(e);return(Number.isNaN(t)||t>=0)&&Sy(e)}function bN(e){return Array.from(e.querySelectorAll(wR)).filter(CR)}function SN(e,t){const n=bN(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],i=e.getRootNode();let o=r===i.activeElement||e===i.activeElement;const c=i.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(o=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!o)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function wN(e=!0){const t=y.useRef(null),n=i=>{let o=i.querySelector("[data-autofocus]");if(!o){const c=Array.from(i.querySelectorAll(wR));o=c.find(CR)||c.find(Sy)||null,!o&&Sy(i)&&(o=i)}o&&o.focus({preventScroll:!0})},r=y.useCallback(i=>{e&&i!==null&&t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),t.current=i):t.current=null)},[e]);return y.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const i=o=>{o.key==="Tab"&&t.current&&SN(t.current,o)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),r}const jN=e=>(e+1)%1e6;function CN(){const[,e]=y.useReducer(jN,0);return e}const EN=En.useId||(()=>{});function TN(){const e=EN();return e?`mantine-${e.replace(/:/g,"")}`:""}function yr(e){const t=TN(),[n,r]=y.useState(t);return wc(()=>{r(_h())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function ER(e,t,n){y.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Ju(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function RN(...e){const t=new Map;return n=>{if(e.forEach(r=>{const i=Ju(r,n);i&&t.set(r,i)}),t.size>0)return()=>{e.forEach(r=>{const i=t.get(r);i?i():Ju(r,null)}),t.clear()}}}function Un(...e){return y.useCallback(RN(...e),e)}function Yn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[i,o]=y.useState(t!==void 0?t:n),c=(u,...f)=>{o(u),r==null||r(u,...f)};return e!==void 0?[e,r,!0]:[i,c,!1]}function Po(e,t){const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)}const Jf="dots";function _N({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:i=1,onChange:o}){const c=Math.max(Math.trunc(e),0),[u,f]=Yn({value:r,onChange:o,defaultValue:i,finalValue:i}),h=w=>{w<=0?f(1):w>c?f(c):f(w)},m=()=>h(u+1),g=()=>h(u-1),v=()=>h(1),b=()=>h(c);return{range:y.useMemo(()=>{if(t*2+3+n*2>=c)return Po(1,c);const C=Math.max(u-t,n),E=Math.min(u+t,c-n),_=C>n+2,T=E<c-(n+1);if(!_&&T){const R=t*2+n+2;return[...Po(1,R),Jf,...Po(c-(n-1),c)]}if(_&&!T){const R=n+1+2*t;return[...Po(1,n),Jf,...Po(c-R,c)]}return[...Po(1,n),Jf,...Po(C,E),Jf,...Po(c-n+1,c)]},[c,t,u]),active:u,setPage:h,next:m,previous:g,first:v,last:b}}function yx(e,t){return bR("(prefers-reduced-motion: reduce)",e,t)}function DN(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(!fN(e[n],t[n]))return!1;return!0}function AN(e){const t=y.useRef([]),n=y.useRef(0);return DN(t.current,e)||(t.current=e,n.current+=1),[n.current]}function kN(e,t){y.useEffect(e,AN(t))}function up(e=!1,t){const{onOpen:n,onClose:r}={},[i,o]=y.useState(e),c=y.useCallback(()=>{o(h=>h||(n==null||n(),!0))},[n]),u=y.useCallback(()=>{o(h=>h&&(r==null||r(),!1))},[r]),f=y.useCallback(()=>{i?u():c()},[u,c,i]);return[i,{open:c,close:u,toggle:f}]}function PN(e,t,n={autoInvoke:!1}){const r=y.useRef(null),i=y.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),o=y.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return y.useEffect(()=>(n.autoInvoke&&i(),o),[o,i]),{start:i,clear:o}}function NN(e,t,n){const r=y.useRef(null),i=y.useRef(null);return y.useEffect(()=>{const o=typeof n=="function"?n():n;return(o||i.current)&&(r.current=new MutationObserver(e),r.current.observe(o||i.current,t)),()=>{var c;(c=r.current)==null||c.disconnect()}},[e,t]),i}function ON(){const[e,t]=y.useState(!1);return y.useEffect(()=>t(!0),[]),e}var MN={};function TR(){return typeof process<"u"&&MN?"production":"development"}function dp(e){var n;const t=En.version;return typeof En.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function RR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=RR(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="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=RR(e))&&(r&&(r+=" "),r+=t);return r}const IN={};function LN(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,i])=>{t[r]?t[r]=Ut(t[r],i):t[r]=i})}),t}function fp({theme:e,classNames:t,props:n,stylesCtx:r}){const o=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||IN);return LN(o)}function Dh({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((o,c)=>typeof c=="function"?{...o,...c(e,n,r)}:{...o,...c},{})}const xx=y.createContext(null);function Wa(){const e=y.useContext(xx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function $N(){return Wa().cssVariablesResolver}function zN(){return Wa().classNamesPrefix}function hp(){return Wa().getStyleNonce}function UN(){return Wa().withStaticClasses}function BN(){return Wa().headless}function VN(){var e;return(e=Wa().stylesTransform)==null?void 0:e.sx}function FN(){var e;return(e=Wa().stylesTransform)==null?void 0:e.styles}function _R(){return Wa().env||"default"}function HN(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function qN(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,i=n>>8&255,o=n&255;return{r,g:i,b:o,a:1}}function GN(e){const[t,n,r,i]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function WN(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),i=parseInt(n[2],10)/100,o=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*o-1))*i,f=r/60,h=u*(1-Math.abs(f%2-1)),m=o-u/2;let g,v,b;return f>=0&&f<1?(g=u,v=h,b=0):f>=1&&f<2?(g=h,v=u,b=0):f>=2&&f<3?(g=0,v=u,b=h):f>=3&&f<4?(g=0,v=h,b=u):f>=4&&f<5?(g=h,v=0,b=u):(g=u,v=0,b=h),{r:Math.round((g+m)*255),g:Math.round((v+m)*255),b:Math.round((b+m)*255),a:c||1}}function bx(e){return HN(e)?qN(e):e.startsWith("rgb")?GN(e):e.startsWith("hsl")?WN(e):{r:0,g:0,b:0,a:1}}function eh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:i,a:o}=bx(e),c=1-t,u=f=>Math.round(f*c);return`rgba(${u(n)}, ${u(r)}, ${u(i)}, ${o})`}function ed(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Dv(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function QN(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function YN(e){if(e.startsWith("oklch("))return(QN(e)||0)/100;const{r:t,g:n,b:r}=bx(e),i=t/255,o=n/255,c=r/255,u=Dv(i),f=Dv(o),h=Dv(c);return .2126*u+.7152*f+.0722*h}function Mu(e,t=.179){return e.startsWith("var(")?!1:YN(e)>t}function hi({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:Mu(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:Mu(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:Mu(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,i]=e.split("."),o=i?Number(i):void 0,c=r in t.colors;if(c){const u=o!==void 0?t.colors[r][o]:t.colors[r][ed(t,n||"light")];return{color:r,value:u,shade:o,isThemeColor:c,isLight:Mu(u,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${o}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:Mu(e,t.luminanceThreshold),shade:o,variable:void 0}}function Ht(e,t){const n=hi({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function wy(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)??t.defaultGradient.deg??0},r=Ht(n.from,t),i=Ht(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function ci(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const o=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${o}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:i}=bx(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const ql=ci,XN=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{const o=hi({color:e,theme:t}),c=typeof i=="boolean"?i:t.autoContrast;if(n==="filled"){const u=c&&o.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return o.isThemeColor?o.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${le(1)} solid transparent`}:{background:`var(--mantine-color-${o.color}-${o.shade})`,hover:`var(--mantine-color-${o.color}-${o.shade===9?8:o.shade+1})`,color:u,border:`${le(1)} solid transparent`}:{background:e,hover:eh(e,.1),color:u,border:`${le(1)} solid transparent`}}if(n==="light"){if(o.isThemeColor){if(o.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:ci(u,.1),hover:ci(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:ci(e,.1),hover:ci(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return o.isThemeColor?o.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:ci(t.colors[o.color][o.shade],.05),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid var(--mantine-color-${o.color}-${o.shade})`}:{background:"transparent",hover:ci(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(o.isThemeColor){if(o.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:"transparent",hover:ci(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:ci(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?o.isThemeColor?o.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?o.isThemeColor?o.shade===void 0?{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:wy(r,t),hover:wy(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)`}:{}},KN={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"]},Jj="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Sx={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:KN,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:XN,autoContrast:!1,luminanceThreshold:.3,fontFamily:Jj,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:Jj,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 eC(e){return e==="auto"||e==="dark"||e==="light"}function ZN({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 eC(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&&eC(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const JN="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",tC="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Av(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function nC(e){if(!(e.primaryColor in e.colors))throw new Error(JN);if(typeof e.primaryShade=="object"&&(!Av(e.primaryShade.dark)||!Av(e.primaryShade.light)))throw new Error(tC);if(typeof e.primaryShade=="number"&&!Av(e.primaryShade))throw new Error(tC)}function eO(e,t){var r;if(!t)return nC(e),e;const n=mx(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),nC(n),n}const wx=y.createContext(null),tO=()=>y.useContext(wx)||Sx;function Sn(){const e=y.useContext(wx);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 DR({theme:e,children:t,inherit:n=!0}){const r=tO(),i=y.useMemo(()=>eO(n?r:Sx,e),[e,r,n]);return s.jsx(wx.Provider,{value:i,children:t})}DR.displayName="@mantine/core/MantineThemeProvider";function nO(){const e=Sn(),t=hp(),n=sn(e.breakpoints).reduce((r,i)=>{const o=e.breakpoints[i].includes("px"),c=Ku(e.breakpoints[i]),u=o?`${c-.1}px`:Eh(c-.1),f=o?`${c}px`:Eh(c);return`${r}@media (max-width: ${u}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${i} {display: none !important;}}`},"");return s.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function kv(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Iu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,i)=>`${i}{${r}}`,t)}function rO(e,t){const n=kv(e.variables),r=n?Iu(t,n):"",i=kv(e.dark),o=kv(e.light),c=i?Iu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,i):"",u=o?Iu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,o):"";return`${r}${c}${u}`}function Qa({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&hi({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function rC(e,t){return Qa({color:e.colors[e.primaryColor][ed(e,t)],theme:e,autoContrast:null})}function th({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n==="light"){const u=ed(e,"light"),f={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${u===9?8:u+1})`,[`--mantine-color-${r}-light`]:ql(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:ql(e.colors[t][u],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline-hover`]:ql(e.colors[t][u],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const o=ed(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${o})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${o===9?8:o+1})`,[`--mantine-color-${r}-light`]:ql(e.colors[t][Math.max(0,o-2)],.15),[`--mantine-color-${r}-light-hover`]:ql(e.colors[t][Math.max(0,o-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(o-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(o-4,0)})`,[`--mantine-color-${r}-outline-hover`]:ql(e.colors[t][Math.max(o-4,0)],.05)};return i?{[`--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 iO(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Gl(e,t,n){sn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const AR=e=>{const t=ed(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":rC(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":rC(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)"}};Gl(r.variables,e.breakpoints,"breakpoint"),Gl(r.variables,e.spacing,"spacing"),Gl(r.variables,e.fontSizes,"font-size"),Gl(r.variables,e.lineHeights,"line-height"),Gl(r.variables,e.shadows,"shadow"),Gl(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((o,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),sn(e.colors).forEach(o=>{const c=e.colors[o];if(iO(c)){Object.assign(r.light,th({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,th({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((u,f)=>{r.variables[`--mantine-color-${o}-${f}`]=u}),Object.assign(r.light,th({theme:e,color:o,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,th({theme:e,color:o,colorScheme:"dark",withColorValues:!1}))});const i=e.headings.sizes;return sn(i).forEach(o=>{r.variables[`--mantine-${o}-font-size`]=i[o].fontSize,r.variables[`--mantine-${o}-line-height`]=i[o].lineHeight,r.variables[`--mantine-${o}-font-weight`]=i[o].fontWeight||e.headings.fontWeight}),r};function aO({theme:e,generator:t}){const n=AR(e),r=t==null?void 0:t(e);return r?mx(n,r):n}const Pv=AR(Sx);function oO(e){const t={variables:{},light:{},dark:{}};return sn(e.variables).forEach(n=>{Pv.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),sn(e.light).forEach(n=>{Pv.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),sn(e.dark).forEach(n=>{Pv.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function sO(e){return`
58
- ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
59
- ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
60
- `}function kR({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Sn(),r=hp(),i=$N(),o=aO({theme:n,generator:i}),c=e===":root"&&t,u=c?oO(o):o,f=rO(u,e);return f?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${f}${c?"":sO(e)}`}}):null}kR.displayName="@mantine/CssVariables";function lO(){const e=console.error;console.error=(...t)=>{t.length>1&&typeof t[0]=="string"&&t[0].toLowerCase().includes("extra attributes from the server")&&typeof t[1]=="string"&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}}function Wl(e,t){var i,o;const n=typeof window<"u"&&"matchMedia"in window&&((i=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:i.matches),r=e!=="auto"?e:n?"dark":"light";(o=t())==null||o.setAttribute("data-mantine-color-scheme",r)}function cO({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const i=y.useRef(null),[o,c]=y.useState(()=>e.get(t)),u=r||o,f=y.useCallback(m=>{r||(Wl(m,n),c(m),e.set(m))},[e.set,u,r]),h=y.useCallback(()=>{c(t),Wl(t,n),e.clear()},[e.clear,t]);return y.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),wc(()=>{Wl(e.get(t),n)},[]),y.useEffect(()=>{var g;if(r)return Wl(r,n),()=>{};r===void 0&&Wl(o,n),typeof window<"u"&&"matchMedia"in window&&(i.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=v=>{o==="auto"&&Wl(v.matches?"dark":"light",n)};return(g=i.current)==null||g.addEventListener("change",m),()=>{var v;return(v=i.current)==null?void 0:v.removeEventListener("change",m)}},[o,r]),{colorScheme:u,setColorScheme:f,clearColorScheme:h}}function uO({respectReducedMotion:e,getRootElement:t}){wc(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}lO();function PR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:o=!0,withCssVariables:c=!0,cssVariablesSelector:u=":root",classNamesPrefix:f="mantine",colorSchemeManager:h=ZN(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:v,forceColorScheme:b,stylesTransform:S,env:w}){const{colorScheme:C,setColorScheme:E,clearColorScheme:_}=cO({defaultColorScheme:m,forceColorScheme:b,manager:h,getRootElement:g});return uO({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:g}),s.jsx(xx.Provider,{value:{colorScheme:C,setColorScheme:E,clearColorScheme:_,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:v,cssVariablesSelector:u,withStaticClasses:r,stylesTransform:S,env:w},children:s.jsxs(DR,{theme:e,children:[c&&s.jsx(kR,{cssVariablesSelector:u,deduplicateCssVariables:o}),i&&s.jsx(nO,{}),t]})})}PR.displayName="@mantine/core/MantineProvider";function Xs({classNames:e,styles:t,props:n,stylesCtx:r}){const i=Sn();return{resolvedClassNames:fp({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Dh({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}const dO={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function fO({theme:e,options:t,unstyled:n}){return Ut((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||dO[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function hO({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return fp({theme:i,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function iC({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return fp({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function pO({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function mO({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function gO({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(i=>`${t}-${i}-${n}`)}function vO({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(o=>{var c,u;return(u=fp({theme:t,classNames:(c=t.components[o])==null?void 0:c.classNames,props:r,stylesCtx:i}))==null?void 0:u[n]})}function yO({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function xO({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:o,classes:c,unstyled:u,className:f,rootSelector:h,props:m,stylesCtx:g,withStaticClasses:v,headless:b,transformedStyles:S}){return Ut(fO({theme:e,options:t,unstyled:u||b}),vO({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),yO({options:t,classes:c,selector:r,unstyled:u}),iC({selector:r,stylesCtx:g,theme:e,classNames:o,props:m}),iC({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),hO({selector:r,stylesCtx:g,options:t,props:m,theme:e}),pO({rootSelector:h,selector:r,className:f}),mO({selector:r,classes:c,unstyled:u||b}),v&&!b&&gO({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function bO({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(o=>{var c;return Dh({theme:e,styles:(c=e.components[o])==null?void 0:c.styles,props:n,stylesCtx:r})[i]}).reduce((o,c)=>({...o,...c}),{})}function jy({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...jy({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function SO(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Go(n[r])}}),t),{})}function wO({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:o,themeName:c,headless:u}){var f;return(f=SO([u?{}:t==null?void 0:t(n,r,i),...c.map(h=>{var m,g,v;return(v=(g=(m=n.components)==null?void 0:m[h])==null?void 0:g.vars)==null?void 0:v.call(g,n,r,i)}),e==null?void 0:e(n,r,i)]))==null?void 0:f[o]}function jO({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:o,rootSelector:c,styles:u,style:f,vars:h,varsResolver:m,headless:g,withStylesTransform:v}){return{...!v&&bO({theme:e,themeName:t,props:i,stylesCtx:o,selector:n}),...!v&&Dh({theme:e,styles:u,props:i,stylesCtx:o})[n],...!v&&Dh({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||i,stylesCtx:o})[n],...wO({theme:e,props:i,stylesCtx:o,vars:h,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?jy({style:f,theme:e}):null,...jy({style:r==null?void 0:r.style,theme:e})}}function CO({props:e,stylesCtx:t,themeName:n}){var c;const r=Sn(),i=(c=FN())==null?void 0:c();return{getTransformedStyles:u=>i?[...u.map(h=>i(h,{props:e,theme:r,ctx:t})),...n.map(h=>{var m;return i((m=r.components[h])==null?void 0:m.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!i}}function Ie({name:e,classes:t,props:n,stylesCtx:r,className:i,style:o,rootSelector:c="root",unstyled:u,classNames:f,styles:h,vars:m,varsResolver:g}){const v=Sn(),b=zN(),S=UN(),w=BN(),C=(Array.isArray(e)?e:[e]).filter(T=>T),{withStylesTransform:E,getTransformedStyles:_}=CO({props:n,stylesCtx:r,themeName:C});return(T,R)=>({className:xO({theme:v,options:R,themeName:C,selector:T,classNamesPrefix:b,classNames:f,classes:t,unstyled:u,className:i,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:S,headless:w,transformedStyles:_([R==null?void 0:R.styles,h])}),style:jO({theme:v,themeName:C,selector:T,options:R,props:n,stylesCtx:r,rootSelector:c,styles:h,style:o,vars:m,varsResolver:g,headless:w,withStylesTransform:E})})}function Ks(e,t){return typeof e=="boolean"?e:t.autoContrast}function aC(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 EO({keepTransitions:e}={}){const t=y.useRef(Rh),n=y.useRef(-1),r=y.useContext(xx),i=hp(),o=y.useRef(i==null?void 0:i());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:aC(o.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var v;(v=t.current)==null||v.call(t)},10)},u=()=>{r.clearColorScheme(),t.current=e?()=>{}:aC(o.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var g;(g=t.current)==null||g.call(t)},10)},f=gN("light",{getInitialValueInEffect:!1}),h=r.colorScheme==="auto"?f:r.colorScheme,m=y.useCallback(()=>c(h==="light"?"dark":"light"),[c,h]);return y.useEffect(()=>()=>{var g;(g=t.current)==null||g.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:u,toggleColorScheme:m}}function se(e,t,n){var c;const r=Sn(),i=(c=r.components[e])==null?void 0:c.defaultProps,o=typeof i=="function"?i(r):i;return{...t,...o,...Go(n)}}function Nv(e){return sn(e).reduce((t,n)=>e[n]!==void 0?`${t}${rN(n)}:${e[n]};`:t,"").trim()}function TO({selector:e,styles:t,media:n,container:r}){const i=t?Nv(t):"",o=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${Nv(u.styles)}}}`):[],c=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${Nv(u.styles)}}}`):[];return`${i?`${e}{${i}}`:""}${o.join("")}${c.join("")}`.trim()}function Zs(e){const t=hp();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:TO(e)}})}function Ya(e){const{m:t,mx:n,my:r,mt:i,mb:o,ml:c,mr:u,me:f,ms:h,p:m,px:g,py:v,pt:b,pb:S,pl:w,pr:C,pe:E,ps:_,bd:T,bg:R,c:D,opacity:k,ff:M,fz:I,fw:z,lts:V,ta:Y,lh:W,fs:J,tt:G,td:X,w:P,miw:L,maw:$,h:H,mih:O,mah:U,bgsz:K,bgp:ee,bgr:Se,bga:be,pos:xe,top:Ge,left:Me,bottom:tt,right:ke,inset:vt,display:Lt,flex:$t,hiddenFrom:gt,visibleFrom:At,lightHidden:rn,darkHidden:Ee,sx:De,...We}=e;return{styleProps:Go({m:t,mx:n,my:r,mt:i,mb:o,ml:c,mr:u,me:f,ms:h,p:m,px:g,py:v,pt:b,pb:S,pl:w,pr:C,pe:E,ps:_,bd:T,bg:R,c:D,opacity:k,ff:M,fz:I,fw:z,lts:V,ta:Y,lh:W,fs:J,tt:G,td:X,w:P,miw:L,maw:$,h:H,mih:O,mah:U,bgsz:K,bgp:ee,bgr:Se,bga:be,pos:xe,top:Ge,left:Me,bottom:tt,right:ke,inset:vt,display:Lt,flex:$t,hiddenFrom:gt,visibleFrom:At,lightHidden:rn,darkHidden:Ee,sx:De}),rest:We}}const RO={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function jx(e,t){const n=hi({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 _O(e,t){const n=hi({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:jx(e,t)}function DO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...i]=e.split(" ").filter(c=>c.trim()!=="");let o=`${le(n)}`;return r&&(o+=` ${r}`),i.length>0&&(o+=` ${jx(i.join(" "),t)}`),o.trim()}return e}const oC={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 AO(e){return typeof e=="string"&&e in oC?oC[e]:e}const kO=["h1","h2","h3","h4","h5","h6"];function PO(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&kO.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function NO(e){return e}const OO=["h1","h2","h3","h4","h5","h6"];function MO(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&OO.includes(e)?`var(--mantine-${e}-line-height)`:e}function IO(e){return typeof e=="number"?le(e):e}function LO(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 Ov={color:jx,textColor:_O,fontSize:PO,spacing:LO,identity:NO,size:IO,lineHeight:MO,fontFamily:AO,border:DO};function sC(e){return e.replace("(min-width: ","").replace("em)","")}function $O({media:e,...t}){const r=Object.keys(e).sort((i,o)=>Number(sC(i))-Number(sC(o))).map(i=>({query:i,styles:e[i]}));return{...t,media:r}}function zO(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function UO(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function BO(e){return typeof e=="object"&&e!==null?sn(e).filter(t=>t!=="base"):[]}function VO(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function NR({styleProps:e,data:t,theme:n}){return $O(sn(e).reduce((r,i)=>{if(i==="hiddenFrom"||i==="visibleFrom"||i==="sx")return r;const o=t[i],c=Array.isArray(o.property)?o.property:[o.property],u=UO(e[i]);if(!zO(e[i]))return c.forEach(h=>{r.inlineStyles[h]=Ov[o.type](u,n)}),r;r.hasResponsiveStyles=!0;const f=BO(e[i]);return c.forEach(h=>{u&&(r.styles[h]=Ov[o.type](u,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[h]:Ov[o.type](VO(e[i],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function hd(){return`__m__-${y.useId().replace(/:/g,"")}`}function OR(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...OR(r,t)}),{}):typeof e=="function"?e(t):e??{}}function MR(e){return e.startsWith("data-")?e:`data-${e}`}function FO(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[MR(n)]=e[n]),t},{})}function IR(e){return e?typeof e=="string"?{[MR(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...IR(n)}),{}):FO(e):null}function Cy(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Cy(r,t)}),{}):typeof e=="function"?e(t):e??{}}function HO({theme:e,style:t,vars:n,styleProps:r}){const i=Cy(t,e),o=Cy(n,e);return{...i,...o,...r}}const LR=y.forwardRef(({component:e,style:t,__vars:n,className:r,variant:i,mod:o,size:c,hiddenFrom:u,visibleFrom:f,lightHidden:h,darkHidden:m,renderRoot:g,__size:v,...b},S)=>{var I;const w=Sn(),C=e||"div",{styleProps:E,rest:_}=Ya(b),T=VN(),R=(I=T==null?void 0:T())==null?void 0:I(E.sx),D=hd(),k=NR({styleProps:E,theme:w,data:RO}),M={ref:S,style:HO({theme:w,style:t,vars:n,styleProps:k.inlineStyles}),className:Ut(r,R,{[D]:k.hasResponsiveStyles,"mantine-light-hidden":h,"mantine-dark-hidden":m,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${f}`]:f}),"data-variant":i,"data-size":gR(c)?void 0:c||void 0,size:v,...IR(o),..._};return s.jsxs(s.Fragment,{children:[k.hasResponsiveStyles&&s.jsx(Zs,{selector:`.${D}`,styles:k.styles,media:k.media}),typeof g=="function"?g(M):s.jsx(C,{...M})]})});LR.displayName="@mantine/core/Box";const ce=LR;function $R(e){return e}function qO(e){const t=e;return n=>{const r=y.forwardRef((i,o)=>s.jsx(t,{...n,...i,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ve(e){const t=y.forwardRef(e);return t.extend=$R,t.withProps=n=>{const r=y.forwardRef((i,o)=>s.jsx(t,{...n,...i,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function cr(e){const t=y.forwardRef(e);return t.withProps=n=>{const r=y.forwardRef((i,o)=>s.jsx(t,{...n,...i,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=$R,t}const GO=y.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Js(){return y.useContext(GO)}var Mv={exports:{}},ir={};/**
61
- * @license React
62
- * react-dom.production.js
63
- *
64
- * Copyright (c) Meta Platforms, Inc. and affiliates.
65
- *
66
- * This source code is licensed under the MIT license found in the
67
- * LICENSE file in the root directory of this source tree.
68
- */var lC;function WO(){if(lC)return ir;lC=1;var e=px();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" 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},i=Symbol.for("react.portal");function o(f,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:h,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ir.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(f,h,null,m)},ir.flushSync=function(f){var h=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=h,r.p=m,r.d.f()}},ir.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},ir.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},ir.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,g=u(m,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ir.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=u(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},ir.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=u(m,h.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},ir.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=u(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},ir.requestFormReset=function(f){r.d.r(f)},ir.unstable_batchedUpdates=function(f,h){return f(h)},ir.useFormState=function(f,h,m){return c.H.useFormState(f,h,m)},ir.useFormStatus=function(){return c.H.useHostTransitionStatus()},ir.version="19.1.0",ir}var cC;function zR(){if(cC)return Mv.exports;cC=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(),Mv.exports=WO(),Mv.exports}var Cx=zR();const qu=hx(Cx);function pp(){return typeof window<"u"}function jc(e){return UR(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function da(e){var t;return(t=(UR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function UR(e){return pp()?e instanceof Node||e instanceof Dr(e).Node:!1}function vn(e){return pp()?e instanceof Element||e instanceof Dr(e).Element:!1}function Gr(e){return pp()?e instanceof HTMLElement||e instanceof Dr(e).HTMLElement:!1}function Ey(e){return!pp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}const QO=new Set(["inline","contents"]);function pd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=pi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!QO.has(i)}const YO=new Set(["table","td","th"]);function XO(e){return YO.has(jc(e))}const KO=[":popover-open",":modal"];function mp(e){return KO.some(t=>{try{return e.matches(t)}catch{return!1}})}const ZO=["transform","translate","scale","rotate","perspective"],JO=["transform","translate","scale","rotate","perspective","filter"],eM=["paint","layout","strict","content"];function Ex(e){const t=gp(),n=vn(e)?pi(e):e;return ZO.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)||JO.some(r=>(n.willChange||"").includes(r))||eM.some(r=>(n.contain||"").includes(r))}function tM(e){let t=Ba(e);for(;Gr(t)&&!Vo(t);){if(Ex(t))return t;if(mp(t))return null;t=Ba(t)}return null}function gp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nM=new Set(["html","body","#document"]);function Vo(e){return nM.has(jc(e))}function pi(e){return Dr(e).getComputedStyle(e)}function vp(e){return vn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ba(e){if(jc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ey(e)&&e.host||da(e);return Ey(t)?t.host:t}function BR(e){const t=Ba(e);return Vo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gr(t)&&pd(t)?t:BR(t)}function $a(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=BR(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),c=Dr(i);if(o){const u=Ty(c);return t.concat(c,c.visualViewport||[],pd(i)?i:[],u&&n?$a(u):[])}return t.concat(i,$a(i,[],n))}function Ty(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uC(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 td(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ey(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function VR(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function FR(){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 rM(e){return oM()?!1:!dC()&&e.width===0&&e.height===0||dC()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function iM(){return/apple/i.test(navigator.vendor)}function dC(){const e=/android/i;return e.test(VR())||e.test(FR())}function aM(){return VR().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function oM(){return FR().includes("jsdom/")}function Ry(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function sM(e){return"nativeEvent"in e}function lM(e){return e.matches("html,body")}function Ds(e){return(e==null?void 0:e.ownerDocument)||document}function Iv(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 ec(e){return"composedPath"in e?e.composedPath()[0]:e.target}const cM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function uM(e){return Gr(e)&&e.matches(cM)}const Oi=Math.min,ar=Math.max,Ah=Math.round,nh=Math.floor,na=e=>({x:e,y:e}),dM={left:"right",right:"left",bottom:"top",top:"bottom"},fM={start:"end",end:"start"};function _y(e,t,n){return ar(e,Oi(t,n))}function Va(e,t){return typeof e=="function"?e(t):e}function Mi(e){return e.split("-")[0]}function Cc(e){return e.split("-")[1]}function Tx(e){return e==="x"?"y":"x"}function Rx(e){return e==="y"?"height":"width"}const hM=new Set(["top","bottom"]);function ki(e){return hM.has(Mi(e))?"y":"x"}function _x(e){return Tx(ki(e))}function pM(e,t,n){n===void 0&&(n=!1);const r=Cc(e),i=_x(e),o=Rx(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(c=kh(c)),[c,kh(c)]}function mM(e){const t=kh(e);return[Dy(e),t,Dy(t)]}function Dy(e){return e.replace(/start|end/g,t=>fM[t])}const fC=["left","right"],hC=["right","left"],gM=["top","bottom"],vM=["bottom","top"];function yM(e,t,n){switch(e){case"top":case"bottom":return n?t?hC:fC:t?fC:hC;case"left":case"right":return t?gM:vM;default:return[]}}function xM(e,t,n,r){const i=Cc(e);let o=yM(Mi(e),n==="start",r);return i&&(o=o.map(c=>c+"-"+i),t&&(o=o.concat(o.map(Dy)))),o}function kh(e){return e.replace(/left|right|bottom|top/g,t=>dM[t])}function bM(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dx(e){return typeof e!="number"?bM(e):{top:e,right:e,bottom:e,left:e}}function uc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function pC(e,t,n){let{reference:r,floating:i}=e;const o=ki(t),c=_x(t),u=Rx(c),f=Mi(t),h=o==="y",m=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,v=r[u]/2-i[u]/2;let b;switch(f){case"top":b={x:m,y:r.y-i.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-i.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Cc(t)){case"start":b[c]-=v*(n&&h?-1:1);break;case"end":b[c]+=v*(n&&h?-1:1);break}return b}const SM=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:c}=n,u=o.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:g}=pC(h,r,f),v=r,b={},S=0;for(let w=0;w<u.length;w++){const{name:C,fn:E}=u[w],{x:_,y:T,data:R,reset:D}=await E({x:m,y:g,initialPlacement:r,placement:v,strategy:i,middlewareData:b,rects:h,platform:c,elements:{reference:e,floating:t}});m=_??m,g=T??g,b={...b,[C]:{...b[C],...R}},D&&S<=50&&(S++,typeof D=="object"&&(D.placement&&(v=D.placement),D.rects&&(h=D.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):D.rects),{x:m,y:g}=pC(h,v,f)),w=-1)}return{x:m,y:g,placement:v,strategy:i,middlewareData:b}};async function Ax(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:c,elements:u,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:v=!1,padding:b=0}=Va(t,e),S=Dx(b),C=u[v?g==="floating"?"reference":"floating":g],E=uc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:h,rootBoundary:m,strategy:f})),_=g==="floating"?{x:r,y:i,width:c.floating.width,height:c.floating.height}:c.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),R=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},D=uc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:_,offsetParent:T,strategy:f}):_);return{top:(E.top-D.top+S.top)/R.y,bottom:(D.bottom-E.bottom+S.bottom)/R.y,left:(E.left-D.left+S.left)/R.x,right:(D.right-E.right+S.right)/R.x}}const wM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:c,elements:u,middlewareData:f}=t,{element:h,padding:m=0}=Va(e,t)||{};if(h==null)return{};const g=Dx(m),v={x:n,y:r},b=_x(i),S=Rx(b),w=await c.getDimensions(h),C=b==="y",E=C?"top":"left",_=C?"bottom":"right",T=C?"clientHeight":"clientWidth",R=o.reference[S]+o.reference[b]-v[b]-o.floating[S],D=v[b]-o.reference[b],k=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let M=k?k[T]:0;(!M||!await(c.isElement==null?void 0:c.isElement(k)))&&(M=u.floating[T]||o.floating[S]);const I=R/2-D/2,z=M/2-w[S]/2-1,V=Oi(g[E],z),Y=Oi(g[_],z),W=V,J=M-w[S]-Y,G=M/2-w[S]/2+I,X=_y(W,G,J),P=!f.arrow&&Cc(i)!=null&&G!==X&&o.reference[S]/2-(G<W?V:Y)-w[S]/2<0,L=P?G<W?G-W:G-J:0;return{[b]:v[b]+L,data:{[b]:X,centerOffset:G-X-L,...P&&{alignmentOffset:L}},reset:P}}}),jM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:c,initialPlacement:u,platform:f,elements:h}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...C}=Va(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Mi(i),_=ki(u),T=Mi(u)===u,R=await(f.isRTL==null?void 0:f.isRTL(h.floating)),D=v||(T||!w?[kh(u)]:mM(u)),k=S!=="none";!v&&k&&D.push(...xM(u,w,S,R));const M=[u,...D],I=await Ax(t,C),z=[];let V=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&z.push(I[E]),g){const G=pM(i,c,R);z.push(I[G[0]],I[G[1]])}if(V=[...V,{placement:i,overflows:z}],!z.every(G=>G<=0)){var Y,W;const G=(((Y=o.flip)==null?void 0:Y.index)||0)+1,X=M[G];if(X&&(!(g==="alignment"?_!==ki(X):!1)||V.every($=>$.overflows[0]>0&&ki($.placement)===_)))return{data:{index:G,overflows:V},reset:{placement:X}};let P=(W=V.filter(L=>L.overflows[0]<=0).sort((L,$)=>L.overflows[1]-$.overflows[1])[0])==null?void 0:W.placement;if(!P)switch(b){case"bestFit":{var J;const L=(J=V.filter($=>{if(k){const H=ki($.placement);return H===_||H==="y"}return!0}).map($=>[$.placement,$.overflows.filter(H=>H>0).reduce((H,O)=>H+O,0)]).sort(($,H)=>$[1]-H[1])[0])==null?void 0:J[0];L&&(P=L);break}case"initialPlacement":P=u;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function HR(e){const t=Oi(...e.map(o=>o.left)),n=Oi(...e.map(o=>o.top)),r=ar(...e.map(o=>o.right)),i=ar(...e.map(o=>o.bottom));return{x:t,y:n,width:r-t,height:i-n}}function CM(e){const t=e.slice().sort((i,o)=>i.y-o.y),n=[];let r=null;for(let i=0;i<t.length;i++){const o=t[i];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(i=>uc(HR(i)))}const EM=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:i,platform:o,strategy:c}=t,{padding:u=2,x:f,y:h}=Va(e,t),m=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(r.reference))||[]),g=CM(m),v=uc(HR(m)),b=Dx(u);function S(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&h!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&h>C.top-b.top&&h<C.bottom+b.bottom)||v;if(g.length>=2){if(ki(n)==="y"){const V=g[0],Y=g[g.length-1],W=Mi(n)==="top",J=V.top,G=Y.bottom,X=W?V.left:Y.left,P=W?V.right:Y.right,L=P-X,$=G-J;return{top:J,bottom:G,left:X,right:P,width:L,height:$,x:X,y:J}}const C=Mi(n)==="left",E=ar(...g.map(V=>V.right)),_=Oi(...g.map(V=>V.left)),T=g.filter(V=>C?V.left===_:V.right===E),R=T[0].top,D=T[T.length-1].bottom,k=_,M=E,I=M-k,z=D-R;return{top:R,bottom:D,left:k,right:M,width:I,height:z,x:k,y:R}}return v}const w=await o.getElementRects({reference:{getBoundingClientRect:S},floating:r.floating,strategy:c});return i.reference.x!==w.reference.x||i.reference.y!==w.reference.y||i.reference.width!==w.reference.width||i.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},qR=new Set(["left","top"]);async function TM(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),c=Mi(n),u=Cc(n),f=ki(n)==="y",h=qR.has(c)?-1:1,m=o&&f?-1:1,g=Va(t,e);let{mainAxis:v,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),f?{x:b*m,y:v*h}:{x:v*h,y:b*m}}const RM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:c,middlewareData:u}=t,f=await TM(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:c}}}}},_M=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:C=>{let{x:E,y:_}=C;return{x:E,y:_}}},...f}=Va(e,t),h={x:n,y:r},m=await Ax(t,f),g=ki(Mi(i)),v=Tx(g);let b=h[v],S=h[g];if(o){const C=v==="y"?"top":"left",E=v==="y"?"bottom":"right",_=b+m[C],T=b-m[E];b=_y(_,b,T)}if(c){const C=g==="y"?"top":"left",E=g==="y"?"bottom":"right",_=S+m[C],T=S-m[E];S=_y(_,S,T)}const w=u.fn({...t,[v]:b,[g]:S});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[v]:o,[g]:c}}}}}},DM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=Va(e,t),m={x:n,y:r},g=ki(i),v=Tx(g);let b=m[v],S=m[g];const w=Va(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const T=v==="y"?"height":"width",R=o.reference[v]-o.floating[T]+C.mainAxis,D=o.reference[v]+o.reference[T]-C.mainAxis;b<R?b=R:b>D&&(b=D)}if(h){var E,_;const T=v==="y"?"width":"height",R=qR.has(Mi(i)),D=o.reference[g]-o.floating[T]+(R&&((E=c.offset)==null?void 0:E[g])||0)+(R?0:C.crossAxis),k=o.reference[g]+o.reference[T]+(R?0:((_=c.offset)==null?void 0:_[g])||0)-(R?C.crossAxis:0);S<D?S=D:S>k&&(S=k)}return{[v]:b,[g]:S}}}},AM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:c,elements:u}=t,{apply:f=()=>{},...h}=Va(e,t),m=await Ax(t,h),g=Mi(i),v=Cc(i),b=ki(i)==="y",{width:S,height:w}=o.floating;let C,E;g==="top"||g==="bottom"?(C=g,E=v===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(E=g,C=v==="end"?"top":"bottom");const _=w-m.top-m.bottom,T=S-m.left-m.right,R=Oi(w-m[C],_),D=Oi(S-m[E],T),k=!t.middlewareData.shift;let M=R,I=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=_),k&&!v){const V=ar(m.left,0),Y=ar(m.right,0),W=ar(m.top,0),J=ar(m.bottom,0);b?I=S-2*(V!==0||Y!==0?V+Y:ar(m.left,m.right)):M=w-2*(W!==0||J!==0?W+J:ar(m.top,m.bottom))}await f({...t,availableWidth:I,availableHeight:M});const z=await c.getDimensions(u.floating);return S!==z.width||w!==z.height?{reset:{rects:!0}}:{}}}};function GR(e){const t=pi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Gr(e),o=i?e.offsetWidth:n,c=i?e.offsetHeight:r,u=Ah(n)!==o||Ah(r)!==c;return u&&(n=o,r=c),{width:n,height:r,$:u}}function kx(e){return vn(e)?e:e.contextElement}function ic(e){const t=kx(e);if(!Gr(t))return na(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=GR(t);let c=(o?Ah(n.width):n.width)/r,u=(o?Ah(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const kM=na(0);function WR(e){const t=Dr(e);return!gp()||!t.visualViewport?kM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function $s(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=kx(e);let c=na(1);t&&(r?vn(r)&&(c=ic(r)):c=ic(e));const u=PM(o,n,r)?WR(o):na(0);let f=(i.left+u.x)/c.x,h=(i.top+u.y)/c.y,m=i.width/c.x,g=i.height/c.y;if(o){const v=Dr(o),b=r&&vn(r)?Dr(r):r;let S=v,w=Ty(S);for(;w&&r&&b!==S;){const C=ic(w),E=w.getBoundingClientRect(),_=pi(w),T=E.left+(w.clientLeft+parseFloat(_.paddingLeft))*C.x,R=E.top+(w.clientTop+parseFloat(_.paddingTop))*C.y;f*=C.x,h*=C.y,m*=C.x,g*=C.y,f+=T,h+=R,S=Dr(w),w=Ty(S)}}return uc({width:m,height:g,x:f,y:h})}function Px(e,t){const n=vp(e).scrollLeft;return t?t.left+n:$s(da(e)).left+n}function QR(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Px(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function NM(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",c=da(r),u=t?mp(t.floating):!1;if(r===c||u&&o)return n;let f={scrollLeft:0,scrollTop:0},h=na(1);const m=na(0),g=Gr(r);if((g||!g&&!o)&&((jc(r)!=="body"||pd(c))&&(f=vp(r)),Gr(r))){const b=$s(r);h=ic(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const v=c&&!g&&!o?QR(c,f,!0):na(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+v.x,y:n.y*h.y-f.scrollTop*h.y+m.y+v.y}}function OM(e){return Array.from(e.getClientRects())}function MM(e){const t=da(e),n=vp(e),r=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Px(e);const u=-n.scrollTop;return pi(r).direction==="rtl"&&(c+=ar(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:c,y:u}}function IM(e,t){const n=Dr(e),r=da(e),i=n.visualViewport;let o=r.clientWidth,c=r.clientHeight,u=0,f=0;if(i){o=i.width,c=i.height;const h=gp();(!h||h&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:c,x:u,y:f}}const LM=new Set(["absolute","fixed"]);function $M(e,t){const n=$s(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Gr(e)?ic(e):na(1),c=e.clientWidth*o.x,u=e.clientHeight*o.y,f=i*o.x,h=r*o.y;return{width:c,height:u,x:f,y:h}}function mC(e,t,n){let r;if(t==="viewport")r=IM(e,n);else if(t==="document")r=MM(da(e));else if(vn(t))r=$M(t,n);else{const i=WR(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return uc(r)}function YR(e,t){const n=Ba(e);return n===t||!vn(n)||Vo(n)?!1:pi(n).position==="fixed"||YR(n,t)}function zM(e,t){const n=t.get(e);if(n)return n;let r=$a(e,[],!1).filter(u=>vn(u)&&jc(u)!=="body"),i=null;const o=pi(e).position==="fixed";let c=o?Ba(e):e;for(;vn(c)&&!Vo(c);){const u=pi(c),f=Ex(c);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&LM.has(i.position)||pd(c)&&!f&&YR(e,c))?r=r.filter(m=>m!==c):i=u,c=Ba(c)}return t.set(e,r),r}function UM(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const c=[...n==="clippingAncestors"?mp(t)?[]:zM(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((h,m)=>{const g=mC(t,m,i);return h.top=ar(g.top,h.top),h.right=Oi(g.right,h.right),h.bottom=Oi(g.bottom,h.bottom),h.left=ar(g.left,h.left),h},mC(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function BM(e){const{width:t,height:n}=GR(e);return{width:t,height:n}}function VM(e,t,n){const r=Gr(t),i=da(t),o=n==="fixed",c=$s(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=na(0);function h(){f.x=Px(i)}if(r||!r&&!o)if((jc(t)!=="body"||pd(i))&&(u=vp(t)),r){const b=$s(t,!0,o,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else i&&h();o&&!r&&i&&h();const m=i&&!r&&!o?QR(i,u):na(0),g=c.left+u.scrollLeft-f.x-m.x,v=c.top+u.scrollTop-f.y-m.y;return{x:g,y:v,width:c.width,height:c.height}}function Lv(e){return pi(e).position==="static"}function gC(e,t){if(!Gr(e)||pi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return da(e)===n&&(n=n.ownerDocument.body),n}function XR(e,t){const n=Dr(e);if(mp(e))return n;if(!Gr(e)){let i=Ba(e);for(;i&&!Vo(i);){if(vn(i)&&!Lv(i))return i;i=Ba(i)}return n}let r=gC(e,t);for(;r&&XO(r)&&Lv(r);)r=gC(r,t);return r&&Vo(r)&&Lv(r)&&!Ex(r)?n:r||tM(e)||n}const FM=async function(e){const t=this.getOffsetParent||XR,n=this.getDimensions,r=await n(e.floating);return{reference:VM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function HM(e){return pi(e).direction==="rtl"}const qM={convertOffsetParentRelativeRectToViewportRelativeRect:NM,getDocumentElement:da,getClippingRect:UM,getOffsetParent:XR,getElementRects:FM,getClientRects:OM,getDimensions:BM,getScale:ic,isElement:vn,isRTL:HM};function KR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function GM(e,t){let n=null,r;const i=da(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const h=e.getBoundingClientRect(),{left:m,top:g,width:v,height:b}=h;if(u||t(),!v||!b)return;const S=nh(g),w=nh(i.clientWidth-(m+v)),C=nh(i.clientHeight-(g+b)),E=nh(m),T={rootMargin:-S+"px "+-w+"px "+-C+"px "+-E+"px",threshold:ar(0,Oi(1,f))||1};let R=!0;function D(k){const M=k[0].intersectionRatio;if(M!==f){if(!R)return c();M?c(!1,M):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!KR(h,e.getBoundingClientRect())&&c(),R=!1}try{n=new IntersectionObserver(D,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,T)}n.observe(e)}return c(!0),o}function WM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=kx(e),m=i||o?[...h?$a(h):[],...$a(t)]:[];m.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const g=h&&u?GM(h,n):null;let v=-1,b=null;c&&(b=new ResizeObserver(E=>{let[_]=E;_&&_.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),n()}),h&&!f&&b.observe(h),b.observe(t));let S,w=f?$s(e):null;f&&C();function C(){const E=$s(e);w&&!KR(w,E)&&n(),w=E,S=requestAnimationFrame(C)}return n(),()=>{var E;m.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),g==null||g(),(E=b)==null||E.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const QM=RM,YM=_M,XM=jM,KM=AM,vC=wM,ZM=EM,JM=DM,e9=(e,t,n)=>{const r=new Map,i={platform:qM,...n},o={...i.platform,_c:r};return SM(e,t,{...i,platform:o})};var t9=typeof document<"u",n9=function(){},gh=t9?y.useLayoutEffect:n9;function Ph(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,i;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(!Ph(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Ph(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ZR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yC(e,t){const n=ZR(e);return Math.round(t*n)/n}function $v(e){const t=y.useRef(e);return gh(()=>{t.current=e}),t}function r9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[m,g]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=y.useState(r);Ph(v,r)||b(r);const[S,w]=y.useState(null),[C,E]=y.useState(null),_=y.useCallback($=>{$!==k.current&&(k.current=$,w($))},[]),T=y.useCallback($=>{$!==M.current&&(M.current=$,E($))},[]),R=o||S,D=c||C,k=y.useRef(null),M=y.useRef(null),I=y.useRef(m),z=f!=null,V=$v(f),Y=$v(i),W=$v(h),J=y.useCallback(()=>{if(!k.current||!M.current)return;const $={placement:t,strategy:n,middleware:v};Y.current&&($.platform=Y.current),e9(k.current,M.current,$).then(H=>{const O={...H,isPositioned:W.current!==!1};G.current&&!Ph(I.current,O)&&(I.current=O,Cx.flushSync(()=>{g(O)}))})},[v,t,n,Y,W]);gh(()=>{h===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[h]);const G=y.useRef(!1);gh(()=>(G.current=!0,()=>{G.current=!1}),[]),gh(()=>{if(R&&(k.current=R),D&&(M.current=D),R&&D){if(V.current)return V.current(R,D,J);J()}},[R,D,J,V,z]);const X=y.useMemo(()=>({reference:k,floating:M,setReference:_,setFloating:T}),[_,T]),P=y.useMemo(()=>({reference:R,floating:D}),[R,D]),L=y.useMemo(()=>{const $={position:n,left:0,top:0};if(!P.floating)return $;const H=yC(P.floating,m.x),O=yC(P.floating,m.y);return u?{...$,transform:"translate("+H+"px, "+O+"px)",...ZR(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:O}},[n,u,P.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:J,refs:X,elements:P,floatingStyles:L}),[m,J,X,P,L])}const i9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?vC({element:r.current,padding:i}).fn(n):{}:r?vC({element:r,padding:i}).fn(n):{}}}},JR=(e,t)=>({...QM(e),options:[e,t]}),Nx=(e,t)=>({...YM(e),options:[e,t]}),xC=(e,t)=>({...JM(e),options:[e,t]}),Nh=(e,t)=>({...XM(e),options:[e,t]}),a9=(e,t)=>({...KM(e),options:[e,t]}),Yu=(e,t)=>({...ZM(e),options:[e,t]}),e2=(e,t)=>({...i9(e),options:[e,t]});function o9(e){return y.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const t2={...S3},s9=t2.useInsertionEffect,l9=s9||(e=>e());function La(e){const t=y.useRef(()=>{});return l9(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var ra=typeof document<"u"?y.useLayoutEffect:y.useEffect;let bC=!1,c9=0;const SC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+c9++;function u9(){const[e,t]=y.useState(()=>bC?SC():void 0);return ra(()=>{e==null&&t(SC())},[]),y.useEffect(()=>{bC=!0},[]),e}const d9=t2.useId,n2=d9||u9;function f9(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const h9=y.createContext(null),p9=y.createContext(null),Ox=()=>{var e;return((e=y.useContext(h9))==null?void 0:e.id)||null},Mx=()=>y.useContext(p9);function Ix(e){return"data-floating-ui-"+e}function zv(e){const t=y.useRef(e);return ra(()=>{t.current=e}),t}const wC=Ix("safe-polygon");function vh(e,t,n){return n&&!Ry(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function m9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,events:o,elements:c}=e,{enabled:u=!0,delay:f=0,handleClose:h=null,mouseOnly:m=!1,restMs:g=0,move:v=!0}=t,b=Mx(),S=Ox(),w=zv(h),C=zv(f),E=zv(n),_=y.useRef(),T=y.useRef(-1),R=y.useRef(),D=y.useRef(-1),k=y.useRef(!0),M=y.useRef(!1),I=y.useRef(()=>{}),z=y.useRef(!1),V=y.useCallback(()=>{var L;const $=(L=i.current.openEvent)==null?void 0:L.type;return($==null?void 0:$.includes("mouse"))&&$!=="mousedown"},[i]);y.useEffect(()=>{if(!u)return;function L($){let{open:H}=$;H||(clearTimeout(T.current),clearTimeout(D.current),k.current=!0,z.current=!1)}return o.on("openchange",L),()=>{o.off("openchange",L)}},[u,o]),y.useEffect(()=>{if(!u||!w.current||!n)return;function L(H){V()&&r(!1,H,"hover")}const $=Ds(c.floating).documentElement;return $.addEventListener("mouseleave",L),()=>{$.removeEventListener("mouseleave",L)}},[c.floating,n,r,u,w,V]);const Y=y.useCallback(function(L,$,H){$===void 0&&($=!0),H===void 0&&(H="hover");const O=vh(C.current,"close",_.current);O&&!R.current?(clearTimeout(T.current),T.current=window.setTimeout(()=>r(!1,L,H),O)):$&&(clearTimeout(T.current),r(!1,L,H))},[C,r]),W=La(()=>{I.current(),R.current=void 0}),J=La(()=>{if(M.current){const L=Ds(c.floating).body;L.style.pointerEvents="",L.removeAttribute(wC),M.current=!1}}),G=La(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);y.useEffect(()=>{if(!u)return;function L(U){if(clearTimeout(T.current),k.current=!1,m&&!Ry(_.current)||g>0&&!vh(C.current,"open"))return;const K=vh(C.current,"open",_.current);K?T.current=window.setTimeout(()=>{E.current||r(!0,U,"hover")},K):n||r(!0,U,"hover")}function $(U){if(G())return;I.current();const K=Ds(c.floating);if(clearTimeout(D.current),z.current=!1,w.current&&i.current.floatingContext){n||clearTimeout(T.current),R.current=w.current({...i.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){J(),W(),G()||Y(U,!0,"safe-polygon")}});const Se=R.current;K.addEventListener("mousemove",Se),I.current=()=>{K.removeEventListener("mousemove",Se)};return}(_.current==="touch"?!td(c.floating,U.relatedTarget):!0)&&Y(U)}function H(U){G()||i.current.floatingContext&&(w.current==null||w.current({...i.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){J(),W(),G()||Y(U)}})(U))}if(vn(c.domReference)){var O;const U=c.domReference;return n&&U.addEventListener("mouseleave",H),(O=c.floating)==null||O.addEventListener("mouseleave",H),v&&U.addEventListener("mousemove",L,{once:!0}),U.addEventListener("mouseenter",L),U.addEventListener("mouseleave",$),()=>{var K;n&&U.removeEventListener("mouseleave",H),(K=c.floating)==null||K.removeEventListener("mouseleave",H),v&&U.removeEventListener("mousemove",L),U.removeEventListener("mouseenter",L),U.removeEventListener("mouseleave",$)}}},[c,u,e,m,g,v,Y,W,J,r,n,E,b,C,w,i,G]),ra(()=>{var L;if(u&&n&&(L=w.current)!=null&&L.__options.blockPointerEvents&&V()){M.current=!0;const H=c.floating;if(vn(c.domReference)&&H){var $;const O=Ds(c.floating).body;O.setAttribute(wC,"");const U=c.domReference,K=b==null||($=b.nodesRef.current.find(ee=>ee.id===S))==null||($=$.context)==null?void 0:$.elements.floating;return K&&(K.style.pointerEvents=""),O.style.pointerEvents="none",U.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{O.style.pointerEvents="",U.style.pointerEvents="",H.style.pointerEvents=""}}}},[u,n,S,c,b,w,V]),ra(()=>{n||(_.current=void 0,z.current=!1,W(),J())},[n,W,J]),y.useEffect(()=>()=>{W(),clearTimeout(T.current),clearTimeout(D.current),J()},[u,c.domReference,W,J]);const X=y.useMemo(()=>{function L($){_.current=$.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove($){const{nativeEvent:H}=$;function O(){!k.current&&!E.current&&r(!0,H,"hover")}m&&!Ry(_.current)||n||g===0||z.current&&$.movementX**2+$.movementY**2<2||(clearTimeout(D.current),_.current==="touch"?O():(z.current=!0,D.current=window.setTimeout(O,g)))}}},[m,r,n,E,g]),P=y.useMemo(()=>({onMouseEnter(){clearTimeout(T.current)},onMouseLeave(L){G()||Y(L.nativeEvent,!1)}}),[Y,G]);return y.useMemo(()=>u?{reference:X,floating:P}:{},[u,X,P])}const Ay=()=>{},r2=y.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ay,setState:Ay,isInstantPhase:!1}),g9=()=>y.useContext(r2);function v9(e){const{children:t,delay:n,timeoutMs:r=0}=e,[i,o]=y.useReducer((f,h)=>({...f,...h}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=y.useRef(null),u=y.useCallback(f=>{o({currentId:f})},[]);return ra(()=>{i.currentId?c.current===null?c.current=i.currentId:i.isInstantPhase||o({isInstantPhase:!0}):(i.isInstantPhase&&o({isInstantPhase:!1}),c.current=null)},[i.currentId,i.isInstantPhase]),y.createElement(r2.Provider,{value:y.useMemo(()=>({...i,setState:o,setCurrentId:u}),[i,u])},t)}function y9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:i}=e,{id:o,enabled:c=!0}=t,u=o??i,f=g9(),{currentId:h,setCurrentId:m,initialDelay:g,setState:v,timeoutMs:b}=f;return ra(()=>{c&&h&&(v({delay:{open:1,close:vh(g,"close")}}),h!==u&&r(!1))},[c,u,r,v,h,g]),ra(()=>{function S(){r(!1),v({delay:g,currentId:null})}if(c&&h&&!n&&h===u){if(b){const w=window.setTimeout(S,b);return()=>{clearTimeout(w)}}S()}},[c,n,v,h,u,r,g,b]),ra(()=>{c&&(m===Ay||!n||m(u))},[c,n,m,u]),f}function Uv(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(c=>{var u;return i.parentId===c.id&&((u=i.context)==null?void 0:u.open)})}),n=n.concat(r);return n}const x9="data-floating-ui-focusable",b9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},S9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},jC=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function w9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:h="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:b,capture:S}=t,w=Mx(),C=La(typeof f=="function"?f:()=>!1),E=typeof f=="function"?C:f,_=y.useRef(!1),T=y.useRef(!1),{escapeKey:R,outsidePress:D}=jC(b),{escapeKey:k,outsidePress:M}=jC(S),I=y.useRef(!1),z=La(X=>{var P;if(!n||!c||!u||X.key!=="Escape"||I.current)return;const L=(P=o.current.floatingContext)==null?void 0:P.nodeId,$=w?Uv(w.nodesRef.current,L):[];if(!R&&(X.stopPropagation(),$.length>0)){let H=!0;if($.forEach(O=>{var U;if((U=O.context)!=null&&U.open&&!O.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,sM(X)?X.nativeEvent:X,"escape-key")}),V=La(X=>{var P;const L=()=>{var $;z(X),($=ec(X))==null||$.removeEventListener("keydown",L)};(P=ec(X))==null||P.addEventListener("keydown",L)}),Y=La(X=>{var P;const L=_.current;_.current=!1;const $=T.current;if(T.current=!1,h==="click"&&$||L||typeof E=="function"&&!E(X))return;const H=ec(X),O="["+Ix("inert")+"]",U=Ds(i.floating).querySelectorAll(O);let K=vn(H)?H:null;for(;K&&!Vo(K);){const xe=Ba(K);if(Vo(xe)||!vn(xe))break;K=xe}if(U.length&&vn(H)&&!lM(H)&&!td(H,i.floating)&&Array.from(U).every(xe=>!td(K,xe)))return;if(Gr(H)&&G){const xe=H.clientWidth>0&&H.scrollWidth>H.clientWidth,Ge=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let Me=Ge&&X.offsetX>H.clientWidth;if(Ge&&pi(H).direction==="rtl"&&(Me=X.offsetX<=H.offsetWidth-H.clientWidth),Me||xe&&X.offsetY>H.clientHeight)return}const ee=(P=o.current.floatingContext)==null?void 0:P.nodeId,Se=w&&Uv(w.nodesRef.current,ee).some(xe=>{var Ge;return Iv(X,(Ge=xe.context)==null?void 0:Ge.elements.floating)});if(Iv(X,i.floating)||Iv(X,i.domReference)||Se)return;const be=w?Uv(w.nodesRef.current,ee):[];if(be.length>0){let xe=!0;if(be.forEach(Ge=>{var Me;if((Me=Ge.context)!=null&&Me.open&&!Ge.context.dataRef.current.__outsidePressBubbles){xe=!1;return}}),!xe)return}r(!1,X,"outside-press")}),W=La(X=>{var P;const L=()=>{var $;Y(X),($=ec(X))==null||$.removeEventListener(h,L)};(P=ec(X))==null||P.addEventListener(h,L)});y.useEffect(()=>{if(!n||!c)return;o.current.__escapeKeyBubbles=R,o.current.__outsidePressBubbles=D;let X=-1;function P(U){r(!1,U,"ancestor-scroll")}function L(){window.clearTimeout(X),I.current=!0}function $(){X=window.setTimeout(()=>{I.current=!1},gp()?5:0)}const H=Ds(i.floating);u&&(H.addEventListener("keydown",k?V:z,k),H.addEventListener("compositionstart",L),H.addEventListener("compositionend",$)),E&&H.addEventListener(h,M?W:Y,M);let O=[];return v&&(vn(i.domReference)&&(O=$a(i.domReference)),vn(i.floating)&&(O=O.concat($a(i.floating))),!vn(i.reference)&&i.reference&&i.reference.contextElement&&(O=O.concat($a(i.reference.contextElement)))),O=O.filter(U=>{var K;return U!==((K=H.defaultView)==null?void 0:K.visualViewport)}),O.forEach(U=>{U.addEventListener("scroll",P,{passive:!0})}),()=>{u&&(H.removeEventListener("keydown",k?V:z,k),H.removeEventListener("compositionstart",L),H.removeEventListener("compositionend",$)),E&&H.removeEventListener(h,M?W:Y,M),O.forEach(U=>{U.removeEventListener("scroll",P)}),window.clearTimeout(X)}},[o,i,u,E,h,n,r,v,c,R,D,z,k,V,Y,M,W]),y.useEffect(()=>{_.current=!1},[E,h]);const J=y.useMemo(()=>({onKeyDown:z,[b9[g]]:X=>{m&&r(!1,X.nativeEvent,"reference-press")}}),[z,r,m,g]),G=y.useMemo(()=>({onKeyDown:z,onMouseDown(){T.current=!0},onMouseUp(){T.current=!0},[S9[h]]:()=>{_.current=!0}}),[z,h]);return y.useMemo(()=>c?{reference:J,floating:G}:{},[c,J,G])}function j9(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=n2(),o=y.useRef({}),[c]=y.useState(()=>f9()),u=Ox()!=null,[f,h]=y.useState(r.reference),m=La((b,S,w)=>{o.current.openEvent=b?S:void 0,c.emit("openchange",{open:b,event:S,reason:w,nested:u}),n==null||n(b,S,w)}),g=y.useMemo(()=>({setPositionReference:h}),[]),v=y.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return y.useMemo(()=>({dataRef:o,open:t,onOpenChange:m,elements:v,events:c,floatingId:i,refs:g}),[t,m,v,c,i,g])}function Lx(e){e===void 0&&(e={});const{nodeId:t}=e,n=j9({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,c]=y.useState(null),[u,f]=y.useState(null),m=(i==null?void 0:i.domReference)||o,g=y.useRef(null),v=Mx();ra(()=>{m&&(g.current=m)},[m]);const b=r9({...e,elements:{...i,...u&&{reference:u}}}),S=y.useCallback(T=>{const R=vn(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;f(R),b.refs.setReference(R)},[b.refs]),w=y.useCallback(T=>{(vn(T)||T===null)&&(g.current=T,c(T)),(vn(b.refs.reference.current)||b.refs.reference.current===null||T!==null&&!vn(T))&&b.refs.setReference(T)},[b.refs]),C=y.useMemo(()=>({...b.refs,setReference:w,setPositionReference:S,domReference:g}),[b.refs,w,S]),E=y.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),_=y.useMemo(()=>({...b,...r,refs:C,elements:E,nodeId:t}),[b,C,E,t,r]);return ra(()=>{r.dataRef.current.floatingContext=_;const T=v==null?void 0:v.nodesRef.current.find(R=>R.id===t);T&&(T.context=_)}),y.useMemo(()=>({...b,context:_,refs:C,elements:E}),[b,C,E,_])}function C9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:o,elements:c}=e,{enabled:u=!0,visibleOnly:f=!0}=t,h=y.useRef(!1),m=y.useRef(),g=y.useRef(!0);y.useEffect(()=>{if(!u)return;const b=Dr(c.domReference);function S(){!n&&Gr(c.domReference)&&c.domReference===uC(Ds(c.domReference))&&(h.current=!0)}function w(){g.current=!0}return b.addEventListener("blur",S),b.addEventListener("keydown",w,!0),()=>{b.removeEventListener("blur",S),b.removeEventListener("keydown",w,!0)}},[c.domReference,n,u]),y.useEffect(()=>{if(!u)return;function b(S){let{reason:w}=S;(w==="reference-press"||w==="escape-key")&&(h.current=!0)}return i.on("openchange",b),()=>{i.off("openchange",b)}},[i,u]),y.useEffect(()=>()=>{clearTimeout(m.current)},[]);const v=y.useMemo(()=>({onPointerDown(b){rM(b.nativeEvent)||(g.current=!1)},onMouseLeave(){h.current=!1},onFocus(b){if(h.current)return;const S=ec(b.nativeEvent);if(f&&vn(S))try{if(iM()&&aM())throw Error();if(!S.matches(":focus-visible"))return}catch{if(!g.current&&!uM(S))return}r(!0,b.nativeEvent,"focus")},onBlur(b){h.current=!1;const S=b.relatedTarget,w=b.nativeEvent,C=vn(S)&&S.hasAttribute(Ix("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var E;const _=uC(c.domReference?c.domReference.ownerDocument:document);!S&&_===c.domReference||td((E=o.current.floatingContext)==null?void 0:E.refs.floating.current,_)||td(c.domReference,_)||C||r(!1,w,"focus")})}}),[o,c.domReference,r,f]);return y.useMemo(()=>u?{reference:v}:{},[u,v])}const CC="active",EC="selected";function Bv(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[CC]:c,[EC]:u,...f}=e;o=f}return{...n==="floating"&&{tabIndex:-1,[x9]:""},...o,...t.map(c=>{const u=c?c[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((c,u)=>(u&&Object.entries(u).forEach(f=>{let[h,m]=f;if(!(i&&[CC,EC].includes(h)))if(h.indexOf("on")===0){if(r.has(h)||r.set(h,[]),typeof m=="function"){var g;(g=r.get(h))==null||g.push(m),c[h]=function(){for(var v,b=arguments.length,S=new Array(b),w=0;w<b;w++)S[w]=arguments[w];return(v=r.get(h))==null?void 0:v.map(C=>C(...S)).find(C=>C!==void 0)}}}else c[h]=m}),c),{})}}function E9(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),i=y.useCallback(u=>Bv(u,e,"reference"),t),o=y.useCallback(u=>Bv(u,e,"floating"),n),c=y.useCallback(u=>Bv(u,e,"item"),r);return y.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:c}),[i,o,c])}const T9=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function R9(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:o=!0,role:c="dialog"}=t,u=(n=T9.get(c))!=null?n:c,f=n2(),m=Ox()!=null,g=y.useMemo(()=>u==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":r?i:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:f},...u==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[u,i,m,r,f,c]),v=y.useMemo(()=>{const S={id:i,...u&&{role:u}};return u==="tooltip"||c==="label"?S:{...S,...u==="menu"&&{"aria-labelledby":f}}},[u,i,f,c]),b=y.useCallback(S=>{let{active:w,selected:C}=S;const E={role:"option",...w&&{id:i+"-option"}};switch(c){case"select":return{...E,"aria-selected":w&&C};case"combobox":return{...E,...w&&{"aria-selected":!0}}}return{}},[i,c]);return y.useMemo(()=>o?{reference:g,floating:v,item:b}:{},[o,g,v,b])}const[_9,yi]=vr("ScrollArea.Root component was not found in tree");function dc(e,t){const n=Es(t);wc(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const D9=y.forwardRef((e,t)=>{const{style:n,...r}=e,i=yi(),[o,c]=y.useState(0),[u,f]=y.useState(0),h=!!(o&&u);return dc(i.scrollbarX,()=>{var g;const m=((g=i.scrollbarX)==null?void 0:g.offsetHeight)||0;i.onCornerHeightChange(m),f(m)}),dc(i.scrollbarY,()=>{var g;const m=((g=i.scrollbarY)==null?void 0:g.offsetWidth)||0;i.onCornerWidthChange(m),c(m)}),h?s.jsx("div",{...r,ref:t,style:{...n,width:o,height:u}}):null}),A9=y.forwardRef((e,t)=>{const n=yi(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(D9,{...e,ref:t}):null}),k9={scrollHideDelay:1e3,type:"hover"},i2=y.forwardRef((e,t)=>{const n=se("ScrollAreaRoot",k9,e),{type:r,scrollHideDelay:i,scrollbars:o,...c}=n,[u,f]=y.useState(null),[h,m]=y.useState(null),[g,v]=y.useState(null),[b,S]=y.useState(null),[w,C]=y.useState(null),[E,_]=y.useState(0),[T,R]=y.useState(0),[D,k]=y.useState(!1),[M,I]=y.useState(!1),z=Un(t,V=>f(V));return s.jsx(_9,{value:{type:r,scrollHideDelay:i,scrollArea:u,viewport:h,onViewportChange:m,content:g,onContentChange:v,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:k,scrollbarY:w,onScrollbarYChange:C,scrollbarYEnabled:M,onScrollbarYEnabledChange:I,onCornerWidthChange:_,onCornerHeightChange:R},children:s.jsx(ce,{...c,ref:z,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${E}px`,"--sa-corner-height":o!=="xy"?"0px":`${T}px`}})})});i2.displayName="@mantine/core/ScrollAreaRoot";function a2(e,t){const n=e/t;return Number.isNaN(n)?0:n}function yp(e){const t=a2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function o2(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 P9(e,[t,n]){return Math.min(n,Math.max(t,e))}function TC(e,t,n="ltr"){const r=yp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,c=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,c]:[c*-1,0],h=P9(e,f);return o2([0,c],[0,u])(h)}function N9(e,t,n,r="ltr"){const i=yp(n),o=i/2,c=t||o,u=i-c,f=n.scrollbar.paddingStart+c,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return o2([f,h],g)(e)}function s2(e,t){return e>0&&e<t}function Uo(e){return e?parseInt(e,10):0}function Is(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[O9,l2]=vr("ScrollAreaScrollbar was not found in tree"),c2=y.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:h,onResize:m,...g}=e,v=yi(),[b,S]=y.useState(null),w=Un(t,I=>S(I)),C=y.useRef(null),E=y.useRef(""),{viewport:_}=v,T=n.content-n.viewport,R=Es(h),D=Es(u),k=cp(m,10),M=I=>{if(C.current){const z=I.clientX-C.current.left,V=I.clientY-C.current.top;f({x:z,y:V})}};return y.useEffect(()=>{const I=z=>{const V=z.target;(b==null?void 0:b.contains(V))&&R(z,T)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[_,b,T,R]),y.useEffect(D,[n,D]),dc(b,k),dc(v.content,k),s.jsx(O9,{value:{scrollbar:b,hasThumb:r,onThumbChange:Es(i),onThumbPointerUp:Es(o),onThumbPositionChange:D,onThumbPointerDown:Es(c)},children:s.jsx("div",{...g,ref:w,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:Is(e.onPointerDown,I=>{I.preventDefault(),I.button===0&&(I.target.setPointerCapture(I.pointerId),C.current=b.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(I))}),onPointerMove:Is(e.onPointerMove,M),onPointerUp:Is(e.onPointerUp,I=>{const z=I.target;z.hasPointerCapture(I.pointerId)&&(I.preventDefault(),z.releasePointerCapture(I.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=E.current,C.current=null}})})}),u2=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...o}=e,c=yi(),[u,f]=y.useState(),h=y.useRef(null),m=Un(t,h,c.onScrollbarXChange);return y.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),s.jsx(c2,{"data-orientation":"horizontal",...o,ref:m,sizes:n,style:{...i,"--sa-thumb-width":`${yp(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(c.viewport){const b=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),s2(b,v)&&g.preventDefault()}},onResize:()=>{h.current&&c.viewport&&u&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:Uo(u.paddingLeft),paddingEnd:Uo(u.paddingRight)}})}})});u2.displayName="@mantine/core/ScrollAreaScrollbarX";const d2=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...o}=e,c=yi(),[u,f]=y.useState(),h=y.useRef(null),m=Un(t,h,c.onScrollbarYChange);return y.useEffect(()=>{h.current&&f(window.getComputedStyle(h.current))},[]),s.jsx(c2,{...o,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${yp(n)}px`,...i},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(c.viewport){const b=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),s2(b,v)&&g.preventDefault()}},onResize:()=>{h.current&&c.viewport&&u&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:Uo(u.paddingTop),paddingEnd:Uo(u.paddingBottom)}})}})});d2.displayName="@mantine/core/ScrollAreaScrollbarY";const xp=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:i}=Js(),o=yi(),c=y.useRef(null),u=y.useRef(0),[f,h]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=a2(f.viewport,f.content),g={...r,sizes:f,onSizesChange:h,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:b=>{u.current=b}},v=(b,S)=>N9(b,u.current,f,S);return n==="horizontal"?s.jsx(u2,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollLeft,S=TC(b,f,i);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollLeft=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollLeft=v(b,i))}}):n==="vertical"?s.jsx(d2,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollTop,S=TC(b,f);f.scrollbar.size===0?c.current.style.setProperty("--thumb-opacity","0"):c.current.style.setProperty("--thumb-opacity","1"),c.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollTop=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollTop=v(b))}}):null});xp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const $x=y.forwardRef((e,t)=>{const n=yi(),{forceMount:r,...i}=e,[o,c]=y.useState(!1),u=e.orientation==="horizontal",f=cp(()=>{if(n.viewport){const h=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(u?h:m)}},10);return dc(n.viewport,f),dc(n.content,f),r||o?s.jsx(xp,{"data-state":o?"visible":"hidden",...i,ref:t}):null});$x.displayName="@mantine/core/ScrollAreaScrollbarAuto";const f2=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yi(),[o,c]=y.useState(!1);return y.useEffect(()=>{const{scrollArea:u}=i;let f=0;if(u){const h=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",h),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",h),u.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),n||o?s.jsx($x,{"data-state":o?"visible":"hidden",...r,ref:t}):null});f2.displayName="@mantine/core/ScrollAreaScrollbarHover";const M9=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yi(),o=e.orientation==="horizontal",[c,u]=y.useState("hidden"),f=cp(()=>u("idle"),100);return y.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>u("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,i.scrollHideDelay]),y.useEffect(()=>{const{viewport:h}=i,m=o?"scrollLeft":"scrollTop";if(h){let g=h[m];const v=()=>{const b=h[m];g!==b&&(u("scrolling"),f()),g=b};return h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[i.viewport,o,f]),n||c!=="hidden"?s.jsx(xp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Is(e.onPointerEnter,()=>u("interacting")),onPointerLeave:Is(e.onPointerLeave,()=>u("idle"))}):null}),ky=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yi(),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=i,u=e.orientation==="horizontal";return y.useEffect(()=>(u?o(!0):c(!0),()=>{u?o(!1):c(!1)}),[u,o,c]),i.type==="hover"?s.jsx(f2,{...r,ref:t,forceMount:n}):i.type==="scroll"?s.jsx(M9,{...r,ref:t,forceMount:n}):i.type==="auto"?s.jsx($x,{...r,ref:t,forceMount:n}):i.type==="always"?s.jsx(xp,{...r,ref:t}):null});ky.displayName="@mantine/core/ScrollAreaScrollbar";function I9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},c=n.left!==o.left,u=n.top!==o.top;(c||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)}const h2=y.forwardRef((e,t)=>{const{style:n,...r}=e,i=yi(),o=l2(),{onThumbPositionChange:c}=o,u=Un(t,m=>o.onThumbChange(m)),f=y.useRef(void 0),h=cp(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const{viewport:m}=i;if(m){const g=()=>{if(h(),!f.current){const v=I9(m,c);f.current=v,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,h,c]),s.jsx("div",{"data-state":o.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:Is(e.onPointerDownCapture,m=>{const v=m.target.getBoundingClientRect(),b=m.clientX-v.left,S=m.clientY-v.top;o.onThumbPointerDown({x:b,y:S})}),onPointerUp:Is(e.onPointerUp,o.onThumbPointerUp)})});h2.displayName="@mantine/core/ScrollAreaThumb";const Py=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=l2();return n||i.hasThumb?s.jsx(h2,{ref:t,...r}):null});Py.displayName="@mantine/core/ScrollAreaThumb";const p2=y.forwardRef(({children:e,style:t,...n},r)=>{const i=yi(),o=Un(r,i.onViewportChange);return s.jsx(ce,{...n,ref:o,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t},children:s.jsx("div",{style:{minWidth:"100%"},ref:i.onContentChange,children:e})})});p2.displayName="@mantine/core/ScrollAreaViewport";var zx={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const m2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},L9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Yr=ve((e,t)=>{const n=se("ScrollArea",m2,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,scrollbarSize:f,vars:h,type:m,scrollHideDelay:g,viewportProps:v,viewportRef:b,onScrollPositionChange:S,children:w,offsetScrollbars:C,scrollbars:E,onBottomReached:_,onTopReached:T,overscrollBehavior:R,...D}=n,[k,M]=y.useState(!1),[I,z]=y.useState(!1),[V,Y]=y.useState(!1),W=Ie({name:"ScrollArea",props:n,classes:zx,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:h,varsResolver:L9}),J=y.useRef(null),G=o9([b,J]);return y.useEffect(()=>{if(!J.current||C!=="present")return;const X=J.current,P=new ResizeObserver(()=>{const{scrollHeight:L,clientHeight:$,scrollWidth:H,clientWidth:O}=X;z(L>$),Y(H>O)});return P.observe(X),()=>P.disconnect()},[J,C]),s.jsxs(i2,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:E,...W("root"),...D,children:[s.jsx(p2,{...v,...W("viewport",{style:v==null?void 0:v.style}),ref:G,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":E||void 0,"data-horizontal-hidden":C==="present"&&!V?"true":void 0,"data-vertical-hidden":C==="present"&&!I?"true":void 0,onScroll:X=>{var H;(H=v==null?void 0:v.onScroll)==null||H.call(v,X),S==null||S({x:X.currentTarget.scrollLeft,y:X.currentTarget.scrollTop});const{scrollTop:P,scrollHeight:L,clientHeight:$}=X.currentTarget;P-(L-$)>=-.6&&(_==null||_()),P===0&&(T==null||T())},children:w}),(E==="xy"||E==="x")&&s.jsx(ky,{...W("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!V?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(Py,{...W("thumb")})}),(E==="xy"||E==="y")&&s.jsx(ky,{...W("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!I?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(Py,{...W("thumb")})}),s.jsx(A9,{...W("corner"),"data-hovered":k||void 0,"data-hidden":m==="never"||void 0})]})});Yr.displayName="@mantine/core/ScrollArea";const bp=ve((e,t)=>{const{children:n,classNames:r,styles:i,scrollbarSize:o,scrollHideDelay:c,type:u,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:g,unstyled:v,variant:b,viewportProps:S,scrollbars:w,style:C,vars:E,onBottomReached:_,onTopReached:T,...R}=se("ScrollAreaAutosize",m2,e);return s.jsx(ce,{...R,ref:t,style:[{display:"flex",overflow:"auto"},C],children:s.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(Yr,{classNames:r,styles:i,scrollHideDelay:c,scrollbarSize:o,type:u,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:g,unstyled:v,variant:b,viewportProps:S,vars:E,scrollbars:w,onBottomReached:_,onTopReached:T,children:n})})})});Yr.classes=zx;bp.displayName="@mantine/core/ScrollAreaAutosize";bp.classes=zx;Yr.Autosize=bp;var g2={root:"m_87cf2631"};const $9={__staticSelector:"UnstyledButton"},tr=cr((e,t)=>{const n=se("UnstyledButton",$9,e),{className:r,component:i="button",__staticSelector:o,unstyled:c,classNames:u,styles:f,style:h,...m}=n,g=Ie({name:o,props:n,classes:g2,className:r,style:h,classNames:u,styles:f,unstyled:c});return s.jsx(ce,{...g("root",{focusable:!0}),component:i,ref:t,type:i==="button"?"button":void 0,...m})});tr.classes=g2;tr.displayName="@mantine/core/UnstyledButton";var v2={root:"m_515a97f8"};const z9={},Ux=ve((e,t)=>{const n=se("VisuallyHidden",z9,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,...h}=n,m=Ie({name:"VisuallyHidden",classes:v2,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u});return s.jsx(ce,{component:"span",ref:t,...m("root"),...h})});Ux.classes=v2;Ux.displayName="@mantine/core/VisuallyHidden";var y2={root:"m_1b7284a3"};const U9={},B9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Vt(t),"--paper-shadow":gx(n)}}),lr=cr((e,t)=>{const n=se("Paper",U9,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,withBorder:f,vars:h,radius:m,shadow:g,variant:v,mod:b,...S}=n,w=Ie({name:"Paper",props:n,classes:y2,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:h,varsResolver:B9});return s.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...w("root"),variant:v,...S})});lr.classes=y2;lr.displayName="@mantine/core/Paper";function x2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),i=n==="right"?"left":"right";return r===void 0?i:`${i}-${r}`}return t}function RC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function _C(e,t,n,r,i){return e==="center"||r==="center"?{left:t}:e==="end"?{[i==="ltr"?"right":"left"]:n}:e==="start"?{[i==="ltr"?"left":"right"]:n}:{}}const V9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function F9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:o,arrowY:c,dir:u}){const[f,h="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[V9[f]]:r},g=-t/2;return f==="left"?{...m,...RC(h,c,n,i),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...RC(h,c,n,i),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,..._C(h,o,n,i,u),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,..._C(h,o,n,i,u),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Bx=y.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:o,arrowX:c,arrowY:u,style:f,...h},m)=>{const{dir:g}=Js();return o?s.jsx("div",{...h,ref:m,style:{...f,...F9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:g,arrowX:c,arrowY:u})}}):null});Bx.displayName="@mantine/core/FloatingArrow";var b2={root:"m_9814e45f"};const H9={zIndex:Qr("modal")},q9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:o,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&ci(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${le(i)})`:void 0,"--overlay-radius":o===void 0?void 0:Vt(o),"--overlay-z-index":c==null?void 0:c.toString()}}),fc=cr((e,t)=>{const n=se("Overlay",H9,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,fixed:h,center:m,children:g,radius:v,zIndex:b,gradient:S,blur:w,color:C,backgroundOpacity:E,mod:_,...T}=n,R=Ie({name:"Overlay",props:n,classes:b2,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:q9});return s.jsx(ce,{ref:t,...R("root"),mod:[{center:m,fixed:h},_],...T,children:g})});fc.classes=b2;fc.displayName="@mantine/core/Overlay";function Vv(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 G9({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Vv(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const i=Vv(n);return i.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(i),i}return Vv(n)}const W9={},S2=ve((e,t)=>{const{children:n,target:r,reuseTargetNode:i,...o}=se("Portal",W9,e),[c,u]=y.useState(!1),f=y.useRef(null);return wc(()=>(u(!0),f.current=G9({target:r,reuseTargetNode:i,...o}),Ju(t,f.current),!r&&!i&&f.current&&document.body.appendChild(f.current),()=>{!r&&!i&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:Cx.createPortal(s.jsx(s.Fragment,{children:n}),f.current)});S2.displayName="@mantine/core/Portal";const Wo=ve(({withinPortal:e=!0,children:t,...n},r)=>_R()==="test"||!e?s.jsx(s.Fragment,{children:t}):s.jsx(S2,{ref:r,...n,children:t}));Wo.displayName="@mantine/core/OptionalPortal";const Lu=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),rh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...Lu("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Lu("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Lu("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Lu("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Lu("top"),common:{transformOrigin:"top right"}}},DC={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function Q9({transition:e,state:t,duration:n,timingFunction:r}){const i={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in rh?{transitionProperty:rh[e].transitionProperty,...i,...rh[e].common,...rh[e][DC[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[DC[t]]}}function Y9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:o,onEntered:c,onExited:u,enterDelay:f,exitDelay:h}){const m=Sn(),g=yx(),v=m.respectReducedMotion?g:!1,[b,S]=y.useState(v?0:e),[w,C]=y.useState(r?"entered":"exited"),E=y.useRef(-1),_=y.useRef(-1),T=y.useRef(-1);function R(){window.clearTimeout(E.current),window.clearTimeout(_.current),cancelAnimationFrame(T.current)}const D=M=>{R();const I=M?i:o,z=M?c:u,V=v?0:M?e:t;S(V),V===0?(typeof I=="function"&&I(),typeof z=="function"&&z(),C(M?"entered":"exited")):T.current=requestAnimationFrame(()=>{qu.flushSync(()=>{C(M?"pre-entering":"pre-exiting")}),T.current=requestAnimationFrame(()=>{typeof I=="function"&&I(),C(M?"entering":"exiting"),E.current=window.setTimeout(()=>{typeof z=="function"&&z(),C(M?"entered":"exited")},V)})})},k=M=>{if(R(),typeof(M?f:h)!="number"){D(M);return}_.current=window.setTimeout(()=>{D(M)},M?f:h)};return Ua(()=>{k(r)},[r]),y.useEffect(()=>()=>{R()},[]),{transitionDuration:b,transitionStatus:w,transitionTimingFunction:n||"ease"}}function fa({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:i,children:o,timingFunction:c="ease",onExit:u,onEntered:f,onEnter:h,onExited:m,enterDelay:g,exitDelay:v}){const b=_R(),{transitionDuration:S,transitionStatus:w,transitionTimingFunction:C}=Y9({mounted:i,exitDuration:r,duration:n,timingFunction:c,onExit:u,onEntered:f,onEnter:h,onExited:m,enterDelay:g,exitDelay:v});return S===0||b==="test"?i?s.jsx(s.Fragment,{children:o({})}):e?o({display:"none"}):null:w==="exited"?e?o({display:"none"}):null:s.jsx(s.Fragment,{children:o(Q9({transition:t,duration:S,state:w,timingFunction:C}))})}fa.displayName="@mantine/core/Transition";const[X9,w2]=vr("Popover component was not found in the tree");function Sp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const i=wN(t),o=Un(i,r);return qa(e)?y.cloneElement(e,{[n]:o}):e}function j2(e){return s.jsx(Ux,{tabIndex:-1,"data-autofocus":!0,...e})}Sp.displayName="@mantine/core/FocusTrap";j2.displayName="@mantine/core/FocusTrapInitialFocus";Sp.InitialFocus=j2;var C2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const K9={},Vx=ve((e,t)=>{var C,E,_,T;const n=se("PopoverDropdown",K9,e),{className:r,style:i,vars:o,children:c,onKeyDownCapture:u,variant:f,classNames:h,styles:m,...g}=n,v=w2(),b=SR({opened:v.opened,shouldReturnFocus:v.returnFocus}),S=v.withRoles?{"aria-labelledby":v.getTargetId(),id:v.getDropdownId(),role:"dialog",tabIndex:-1}:{},w=Un(t,v.floating);return v.disabled?null:s.jsx(Wo,{...v.portalProps,withinPortal:v.withinPortal,children:s.jsx(fa,{mounted:v.opened,...v.transitionProps,transition:((C=v.transitionProps)==null?void 0:C.transition)||"fade",duration:((E=v.transitionProps)==null?void 0:E.duration)??150,keepMounted:v.keepMounted,exitDuration:typeof((_=v.transitionProps)==null?void 0:_.exitDuration)=="number"?v.transitionProps.exitDuration:(T=v.transitionProps)==null?void 0:T.duration,children:R=>s.jsx(Sp,{active:v.trapFocus&&v.opened,innerRef:w,children:s.jsxs(ce,{...S,...g,variant:f,onKeyDownCapture:cN(()=>{var D,k;(D=v.onClose)==null||D.call(v),(k=v.onDismiss)==null||k.call(v)},{active:v.closeOnEscape,onTrigger:b,onKeyDown:u}),"data-position":v.placement,"data-fixed":v.floatingStrategy==="fixed"||void 0,...v.getStyles("dropdown",{className:r,props:n,classNames:h,styles:m,style:[{...R,zIndex:v.zIndex,top:v.y??0,left:v.x??0,width:v.width==="target"?void 0:le(v.width)},v.resolvedStyles.dropdown,m==null?void 0:m.dropdown,i]}),children:[c,s.jsx(Bx,{ref:v.arrowRef,arrowX:v.arrowX,arrowY:v.arrowY,visible:v.withArrow,position:v.placement,arrowSize:v.arrowSize,arrowRadius:v.arrowRadius,arrowOffset:v.arrowOffset,arrowPosition:v.arrowPosition,...v.getStyles("arrow",{props:n,classNames:h,styles:m})})]})})})})});Vx.classes=C2;Vx.displayName="@mantine/core/PopoverDropdown";const Z9={refProp:"ref",popupType:"dialog"},E2=ve((e,t)=>{const{children:n,refProp:r,popupType:i,...o}=se("PopoverTarget",Z9,e);if(!qa(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=o,u=w2(),f=Un(u.reference,dp(n),t),h=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return y.cloneElement(n,{...c,...h,...u.targetProps,className:Ut(u.targetProps.className,c.className,n.props.className),[r]:f,...u.controlled?null:{onClick:u.onToggle}})});E2.displayName="@mantine/core/PopoverTarget";function T2({opened:e,floating:t,position:n,positionDependencies:r}){const[i,o]=y.useState(0);y.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return WM(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,i,n]),Ua(()=>{t.update()},r),Ua(()=>{o(c=>c+1)},[e])}function J9(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 e5(e,t){const n=J9(e.middlewares),r=[JR(e.offset)];return n.shift&&r.push(Nx(typeof n.shift=="boolean"?{limiter:xC(),padding:5}:{limiter:xC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Nh():Nh(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Yu():Yu(n.inline)),r.push(e2({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(a9({...typeof n.size=="boolean"?{}:n.size,apply({rects:i,availableWidth:o,availableHeight:c,...u}){var m;const h=((m=t().refs.floating.current)==null?void 0:m.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:i,availableWidth:o,availableHeight:c,...u}):Object.assign(h,{maxWidth:`${o}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(h,{width:`${i.reference.width}px`})}})),r}function t5(e){const[t,n]=Yn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=y.useRef(t),i=()=>{t&&!e.disabled&&n(!1)},o=()=>!e.disabled&&n(!t),c=Lx({strategy:e.strategy,placement:e.position,middleware:e5(e,()=>c)});return T2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),Ua(()=>{var u;(u=e.onPositionChange)==null||u.call(e,c.placement)},[c.placement]),Ua(()=>{var u,f;t!==r.current&&(t?(f=e.onOpen)==null||f.call(e):(u=e.onClose)==null||u.call(e)),r.current=t},[t,e.onClose,e.onOpen]),{floating:c,controlled:typeof e.opened=="boolean",opened:t,onClose:i,onToggle:o}}const n5={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Qr("popover"),__staticSelector:"Popover",width:"max-content"},r5=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Vt(t),"--popover-shadow":gx(n)}});function $i(e){var ze,yt,ft,Gt,kt,un;const t=se("Popover",n5,e),{children:n,position:r,offset:i,onPositionChange:o,positionDependencies:c,opened:u,transitionProps:f,onExitTransitionEnd:h,onEnterTransitionEnd:m,width:g,middlewares:v,withArrow:b,arrowSize:S,arrowOffset:w,arrowRadius:C,arrowPosition:E,unstyled:_,classNames:T,styles:R,closeOnClickOutside:D,withinPortal:k,portalProps:M,closeOnEscape:I,clickOutsideEvents:z,trapFocus:V,onClose:Y,onDismiss:W,onOpen:J,onChange:G,zIndex:X,radius:P,shadow:L,id:$,defaultOpened:H,__staticSelector:O,withRoles:U,disabled:K,returnFocus:ee,variant:Se,keepMounted:be,vars:xe,floatingStrategy:Ge,withOverlay:Me,overlayProps:tt,...ke}=t,vt=Ie({name:O,props:t,classes:C2,classNames:T,styles:R,unstyled:_,rootSelector:"dropdown",vars:xe,varsResolver:r5}),{resolvedStyles:Lt}=Xs({classNames:T,styles:R,props:t}),$t=y.useRef(null),[gt,At]=y.useState(null),[rn,Ee]=y.useState(null),{dir:De}=Js(),We=yr($),Re=t5({middlewares:v,width:g,position:x2(De,r),offset:typeof i=="number"?i+(b?S/2:0):i,arrowRef:$t,arrowOffset:w,onPositionChange:o,positionDependencies:c,opened:u,defaultOpened:H,onChange:G,onOpen:J,onClose:Y,onDismiss:W,strategy:Ge,disabled:K});hN(()=>{D&&(Re.onClose(),W==null||W())},z,[gt,rn]);const me=y.useCallback(jt=>{At(jt),Re.floating.refs.setReference(jt)},[Re.floating.refs.setReference]),ge=y.useCallback(jt=>{Ee(jt),Re.floating.refs.setFloating(jt)},[Re.floating.refs.setFloating]),Ne=y.useCallback(()=>{var jt;(jt=f==null?void 0:f.onExited)==null||jt.call(f),h==null||h()},[f==null?void 0:f.onExited,h]),we=y.useCallback(()=>{var jt;(jt=f==null?void 0:f.onEntered)==null||jt.call(f),m==null||m()},[f==null?void 0:f.onEntered,m]);return s.jsxs(X9,{value:{returnFocus:ee,disabled:K,controlled:Re.controlled,reference:me,floating:ge,x:Re.floating.x,y:Re.floating.y,arrowX:(ft=(yt=(ze=Re.floating)==null?void 0:ze.middlewareData)==null?void 0:yt.arrow)==null?void 0:ft.x,arrowY:(un=(kt=(Gt=Re.floating)==null?void 0:Gt.middlewareData)==null?void 0:kt.arrow)==null?void 0:un.y,opened:Re.opened,arrowRef:$t,transitionProps:{...f,onExited:Ne,onEntered:we},width:g,withArrow:b,arrowSize:S,arrowOffset:w,arrowRadius:C,arrowPosition:E,placement:Re.floating.placement,trapFocus:V,withinPortal:k,portalProps:M,zIndex:X,radius:P,shadow:L,closeOnEscape:I,onDismiss:W,onClose:Re.onClose,onToggle:Re.onToggle,getTargetId:()=>`${We}-target`,getDropdownId:()=>`${We}-dropdown`,withRoles:U,targetProps:ke,__staticSelector:O,classNames:T,styles:R,unstyled:_,variant:Se,keepMounted:be,getStyles:vt,resolvedStyles:Lt,floatingStrategy:Ge},children:[n,Me&&s.jsx(fa,{transition:"fade",mounted:Re.opened,duration:(f==null?void 0:f.duration)||250,exitDuration:(f==null?void 0:f.exitDuration)||250,children:jt=>s.jsx(Wo,{withinPortal:k,children:s.jsx(fc,{...tt,...vt("overlay",{className:tt==null?void 0:tt.className,style:[jt,tt==null?void 0:tt.style]})})})})]})}$i.Target=E2;$i.Dropdown=Vx;$i.displayName="@mantine/core/Popover";$i.extend=e=>e;var Pi={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 R2=y.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:Ut(Pi.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Pi.bar}),s.jsx("span",{className:Pi.bar}),s.jsx("span",{className:Pi.bar})]}));R2.displayName="@mantine/core/Bars";const _2=y.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:Ut(Pi.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Pi.dot}),s.jsx("span",{className:Pi.dot}),s.jsx("span",{className:Pi.dot})]}));_2.displayName="@mantine/core/Dots";const D2=y.forwardRef(({className:e,...t},n)=>s.jsx(ce,{component:"span",className:Ut(Pi.ovalLoader,e),...t,ref:n}));D2.displayName="@mantine/core/Oval";const A2={bars:R2,oval:D2,dots:_2},i5={loaders:A2,type:"oval"},a5=(e,{size:t,color:n})=>({root:{"--loader-size":rt(t,"loader-size"),"--loader-color":n?Ht(n,e):void 0}}),kr=ve((e,t)=>{const n=se("Loader",i5,e),{size:r,color:i,type:o,vars:c,className:u,style:f,classNames:h,styles:m,unstyled:g,loaders:v,variant:b,children:S,...w}=n,C=Ie({name:"Loader",props:n,classes:Pi,className:u,style:f,classNames:h,styles:m,unstyled:g,vars:c,varsResolver:a5});return S?s.jsx(ce,{...C("root"),ref:t,...w,children:S}):s.jsx(ce,{...C("root"),ref:t,component:v[o],variant:b,size:r,...w})});kr.defaultLoaders=A2;kr.classes=Pi;kr.displayName="@mantine/core/Loader";var Ec={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const AC={orientation:"horizontal"},o5=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Fx=ve((e,t)=>{const n=se("ActionIconGroup",AC,e),{className:r,style:i,classNames:o,styles:c,unstyled:u,orientation:f,vars:h,borderWidth:m,variant:g,mod:v,...b}=se("ActionIconGroup",AC,e),S=Ie({name:"ActionIconGroup",props:n,classes:Ec,className:r,style:i,classNames:o,styles:c,unstyled:u,vars:h,varsResolver:o5,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},v],role:"group",...b})});Fx.classes=Ec;Fx.displayName="@mantine/core/ActionIconGroup";const kC={},s5=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:o});return{groupSection:{"--section-height":rt(c,"section-height"),"--section-padding-x":rt(c,"section-padding-x"),"--section-fz":On(c),"--section-radius":t===void 0?void 0:Vt(t),"--section-bg":n||i?u.background:void 0,"--section-color":u.color,"--section-bd":n||i?u.border:void 0}}},Hx=ve((e,t)=>{const n=se("ActionIconGroupSection",kC,e),{className:r,style:i,classNames:o,styles:c,unstyled:u,vars:f,variant:h,gradient:m,radius:g,autoContrast:v,...b}=se("ActionIconGroupSection",kC,e),S=Ie({name:"ActionIconGroupSection",props:n,classes:Ec,className:r,style:i,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:s5,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:h,...b})});Hx.classes=Ec;Hx.displayName="@mantine/core/ActionIconGroupSection";const l5={},c5=(e,{size:t,radius:n,variant:r,gradient:i,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":rt(t,"ai-size"),"--ai-radius":n===void 0?void 0:Vt(n),"--ai-bg":o||r?u.background:void 0,"--ai-hover":o||r?u.hover:void 0,"--ai-hover-color":o||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":o||r?u.border:void 0}}},An=cr((e,t)=>{const n=se("ActionIcon",l5,e),{className:r,unstyled:i,variant:o,classNames:c,styles:u,style:f,loading:h,loaderProps:m,size:g,color:v,radius:b,__staticSelector:S,gradient:w,vars:C,children:E,disabled:_,"data-disabled":T,autoContrast:R,mod:D,...k}=n,M=Ie({name:["ActionIcon",S],props:n,className:r,style:f,classes:Ec,classNames:c,styles:u,unstyled:i,vars:C,varsResolver:c5});return s.jsxs(tr,{...M("root",{active:!_&&!h&&!T}),...k,unstyled:i,variant:o,size:g,disabled:_||h,ref:t,mod:[{loading:h,disabled:_||T},D],children:[s.jsx(fa,{mounted:!!h,transition:"slide-down",duration:150,children:I=>s.jsx(ce,{component:"span",...M("loader",{style:I}),"aria-hidden":!0,children:s.jsx(kr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),s.jsx(ce,{component:"span",mod:{loading:h},...M("icon"),children:E})]})});An.classes=Ec;An.displayName="@mantine/core/ActionIcon";An.Group=Fx;An.GroupSection=Hx;const k2=y.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>s.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:s.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));k2.displayName="@mantine/core/CloseIcon";var P2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const u5={variant:"subtle"},d5=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":rt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Vt(n),"--cb-icon-size":le(r)}}),Qo=cr((e,t)=>{const n=se("CloseButton",u5,e),{iconSize:r,children:i,vars:o,radius:c,className:u,classNames:f,style:h,styles:m,unstyled:g,"data-disabled":v,disabled:b,variant:S,icon:w,mod:C,__staticSelector:E,..._}=n,T=Ie({name:E||"CloseButton",props:n,className:u,style:h,classes:P2,classNames:f,styles:m,unstyled:g,vars:o,varsResolver:d5});return s.jsxs(tr,{ref:t,..._,unstyled:g,variant:S,disabled:b,mod:[{disabled:b||v},C],...T("root",{variant:S,active:!b&&!v}),children:[w||s.jsx(k2,{}),i]})});Qo.classes=P2;Qo.displayName="@mantine/core/CloseButton";function f5(e){return y.Children.toArray(e).filter(Boolean)}var N2={root:"m_4081bf90"};const h5={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},p5=(e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:o,wrap:c},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":Nn(r),"--group-align":i,"--group-justify":o,"--group-wrap":c}}),je=ve((e,t)=>{const n=se("Group",h5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,children:f,gap:h,align:m,justify:g,wrap:v,grow:b,preventGrowOverflow:S,vars:w,variant:C,__size:E,mod:_,...T}=n,R=f5(f),D=R.length,k=Nn(h??"md"),I={childWidth:`calc(${100/D}% - (${k} - ${k} / ${D}))`},z=Ie({name:"Group",props:n,stylesCtx:I,className:i,style:o,classes:N2,classNames:r,styles:c,unstyled:u,vars:w,varsResolver:p5});return s.jsx(ce,{...z("root"),ref:t,variant:C,mod:[{grow:b},_],size:E,...T,children:R})});je.classes=N2;je.displayName="@mantine/core/Group";const[m5,Xa]=vr("ModalBase component was not found in tree");function g5({opened:e,transitionDuration:t}){const[n,r]=y.useState(e),i=y.useRef(-1),c=yx()?0:t;return y.useEffect(()=>(e?(r(!0),window.clearTimeout(i.current)):c===0?r(!1):i.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(i.current)),[e,c]),n}function v5({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:o,returnFocus:c}){const u=yr(e),[f,h]=y.useState(!1),[m,g]=y.useState(!1),v=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,b=g5({opened:n,transitionDuration:v});return ER("keydown",S=>{var w;S.key==="Escape"&&i&&!S.isComposing&&n&&((w=S.target)==null?void 0:w.getAttribute("data-mantine-stop-propagation"))!=="true"&&o()},{capture:!0}),SR({opened:n,shouldReturnFocus:r&&c}),{_id:u,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:h,setBodyMounted:g}}const O2=y.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:o,onEnterTransitionEnd:c,trapFocus:u,closeOnEscape:f,returnFocus:h,closeOnClickOutside:m,withinPortal:g,portalProps:v,lockScroll:b,children:S,zIndex:w,shadow:C,padding:E,__vars:_,unstyled:T,removeScrollProps:R,...D},k)=>{const{_id:M,titleMounted:I,bodyMounted:z,shouldLockScroll:V,setTitleMounted:Y,setBodyMounted:W}=v5({id:r,transitionProps:i,opened:t,trapFocus:u,closeOnEscape:f,onClose:n,returnFocus:h}),{key:J,...G}=R||{};return s.jsx(Wo,{...v,withinPortal:g,children:s.jsx(m5,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:o,onEnterTransitionEnd:c,transitionProps:{...i,keepMounted:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:I,bodyMounted:z,setTitleMounted:Y,setBodyMounted:W,trapFocus:u,closeOnEscape:f,zIndex:w,unstyled:T},children:s.jsx(cc,{enabled:V&&b,...G,children:s.jsx(ce,{ref:k,...D,__vars:{..._,"--mb-z-index":(w||Qr("modal")).toString(),"--mb-shadow":gx(C),"--mb-padding":Nn(E)},children:S})},J)})})});O2.displayName="@mantine/core/ModalBase";function y5(){const e=Xa();return y.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var hc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const M2=y.forwardRef(({className:e,...t},n)=>{const r=y5(),i=Xa();return s.jsx(ce,{ref:n,...t,id:r,className:Ut({[hc.body]:!i.unstyled},e)})});M2.displayName="@mantine/core/ModalBaseBody";const I2=y.forwardRef(({className:e,onClick:t,...n},r)=>{const i=Xa();return s.jsx(Qo,{ref:r,...n,onClick:o=>{i.onClose(),t==null||t(o)},className:Ut({[hc.close]:!i.unstyled},e),unstyled:i.unstyled})});I2.displayName="@mantine/core/ModalBaseCloseButton";const L2=y.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,...o},c)=>{const u=Xa();return s.jsx(fa,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{var f,h,m;(f=u.onExitTransitionEnd)==null||f.call(u),(m=(h=u.transitionProps)==null?void 0:h.onExited)==null||m.call(h)},onEntered:()=>{var f,h,m;(f=u.onEnterTransitionEnd)==null||f.call(u),(m=(h=u.transitionProps)==null?void 0:h.onEntered)==null||m.call(h)},...e,children:f=>s.jsx("div",{...n,className:Ut({[hc.inner]:!u.unstyled},n.className),children:s.jsx(Sp,{active:u.opened&&u.trapFocus,innerRef:c,children:s.jsx(lr,{...o,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":u.bodyMounted?u.getBodyId():void 0,"aria-labelledby":u.titleMounted?u.getTitleId():void 0,style:[i,f],className:Ut({[hc.content]:!u.unstyled},t),unstyled:u.unstyled,children:o.children})})})})});L2.displayName="@mantine/core/ModalBaseContent";const $2=y.forwardRef(({className:e,...t},n)=>{const r=Xa();return s.jsx(ce,{component:"header",ref:n,className:Ut({[hc.header]:!r.unstyled},e),...t})});$2.displayName="@mantine/core/ModalBaseHeader";const x5={duration:200,timingFunction:"ease",transition:"fade"};function b5(e){const t=Xa();return{...x5,...t.transitionProps,...e}}const z2=y.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...i},o)=>{const c=Xa(),u=b5(t);return s.jsx(fa,{mounted:r!==void 0?r:c.opened,...u,transition:"fade",children:f=>s.jsx(fc,{ref:o,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:h=>{e==null||e(h),c.closeOnClickOutside&&c.onClose()},...i})})});z2.displayName="@mantine/core/ModalBaseOverlay";function S5(){const e=Xa();return y.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const U2=y.forwardRef(({className:e,...t},n)=>{const r=S5(),i=Xa();return s.jsx(ce,{component:"h2",ref:n,className:Ut({[hc.title]:!i.unstyled},e),...t,id:r})});U2.displayName="@mantine/core/ModalBaseTitle";function w5({children:e}){return s.jsx(s.Fragment,{children:e})}const[j5,C5]=Ga({size:"sm"}),E5={},B2=ve((e,t)=>{const n=se("InputClearButton",E5,e),{size:r,variant:i,vars:o,classNames:c,styles:u,...f}=n,h=C5(),{resolvedClassNames:m,resolvedStyles:g}=Xs({classNames:c,styles:u,props:n});return s.jsx(Qo,{variant:i||"transparent",ref:t,size:r||(h==null?void 0:h.size)||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});B2.displayName="@mantine/core/InputClearButton";const[T5,Tc]=Ga({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var xi={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 PC={},R5=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),wp=ve((e,t)=>{const n=se("InputDescription",PC,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,__staticSelector:m,__inheritStyles:g=!0,variant:v,...b}=se("InputDescription",PC,n),S=Tc(),w=Ie({name:["InputWrapper",m],props:n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"description",vars:f,varsResolver:R5}),C=g&&(S==null?void 0:S.getStyles)||w;return s.jsx(ce,{component:"p",ref:t,variant:v,size:h,...C("description",S!=null&&S.getStyles?{className:i,style:o}:void 0),...b})});wp.classes=xi;wp.displayName="@mantine/core/InputDescription";const _5={},D5=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),jp=ve((e,t)=>{const n=se("InputError",_5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,__staticSelector:m,__inheritStyles:g=!0,variant:v,...b}=n,S=Ie({name:["InputWrapper",m],props:n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"error",vars:f,varsResolver:D5}),w=Tc(),C=g&&(w==null?void 0:w.getStyles)||S;return s.jsx(ce,{component:"p",ref:t,variant:v,size:h,...C("error",w!=null&&w.getStyles?{className:i,style:o}:void 0),...b})});jp.classes=xi;jp.displayName="@mantine/core/InputError";const NC={labelElement:"label"},A5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0}}),md=ve((e,t)=>{const n=se("InputLabel",NC,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,labelElement:h,size:m,required:g,htmlFor:v,onMouseDown:b,children:S,__staticSelector:w,variant:C,mod:E,..._}=se("InputLabel",NC,n),T=Ie({name:["InputWrapper",w],props:n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"label",vars:f,varsResolver:A5}),R=Tc(),D=(R==null?void 0:R.getStyles)||T;return s.jsxs(ce,{...D("label",R!=null&&R.getStyles?{className:i,style:o}:void 0),component:h,variant:C,size:m,ref:t,htmlFor:h==="label"?v:void 0,mod:[{required:g},E],onMouseDown:k=>{b==null||b(k),!k.defaultPrevented&&k.detail>1&&k.preventDefault()},..._,children:[S,g&&s.jsx("span",{...D("required"),"aria-hidden":!0,children:" *"})]})});md.classes=xi;md.displayName="@mantine/core/InputLabel";const OC={},qx=ve((e,t)=>{const n=se("InputPlaceholder",OC,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,__staticSelector:h,variant:m,error:g,mod:v,...b}=se("InputPlaceholder",OC,n),S=Ie({name:["InputPlaceholder",h],props:n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"placeholder"});return s.jsx(ce,{...S("placeholder"),mod:[{error:!!g},v],component:"span",variant:m,ref:t,...b})});qx.classes=xi;qx.displayName="@mantine/core/InputPlaceholder";function k5(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),i=e.slice(0,r),o=e.slice(r+1),c=t&&i.includes("description")||n&&i.includes("error");return{offsetBottom:t&&o.includes("description")||n&&o.includes("error"),offsetTop:c}}const P5={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},N5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),Gx=ve((e,t)=>{const n=se("InputWrapper",P5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,variant:m,__staticSelector:g,inputContainer:v,inputWrapperOrder:b,label:S,error:w,description:C,labelProps:E,descriptionProps:_,errorProps:T,labelElement:R,children:D,withAsterisk:k,id:M,required:I,__stylesApiProps:z,mod:V,...Y}=n,W=Ie({name:["InputWrapper",g],props:z||n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:N5}),J={size:h,variant:m,__staticSelector:g},G=yr(M),X=typeof k=="boolean"?k:I,P=(T==null?void 0:T.id)||`${G}-error`,L=(_==null?void 0:_.id)||`${G}-description`,$=G,H=!!w&&typeof w!="boolean",O=!!C,U=`${H?P:""} ${O?L:""}`,K=U.trim().length>0?U.trim():void 0,ee=(E==null?void 0:E.id)||`${G}-label`,Se=S&&s.jsx(md,{labelElement:R,id:ee,htmlFor:$,required:X,...J,...E,children:S},"label"),be=O&&s.jsx(wp,{..._,...J,size:(_==null?void 0:_.size)||J.size,id:(_==null?void 0:_.id)||L,children:C},"description"),xe=s.jsx(y.Fragment,{children:v(D)},"input"),Ge=H&&y.createElement(jp,{...T,...J,size:(T==null?void 0:T.size)||J.size,key:"error",id:(T==null?void 0:T.id)||P},w),Me=b.map(tt=>{switch(tt){case"label":return Se;case"input":return xe;case"description":return be;case"error":return Ge;default:return null}});return s.jsx(T5,{value:{getStyles:W,describedBy:K,inputId:$,labelId:ee,...k5(b,{hasDescription:O,hasError:H})},children:s.jsx(ce,{ref:t,variant:m,size:h,mod:[{error:!!w},V],...W("root"),...Y,children:Me})})});Gx.classes=xi;Gx.displayName="@mantine/core/InputWrapper";const O5={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},M5=(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":rt(t.size,"input-height"),"--input-fz":On(t.size),"--input-radius":t.radius===void 0?void 0:Vt(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?rt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),mn=cr((e,t)=>{const n=se("Input",O5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,required:f,__staticSelector:h,__stylesApiProps:m,size:g,wrapperProps:v,error:b,disabled:S,leftSection:w,leftSectionProps:C,leftSectionWidth:E,rightSection:_,rightSectionProps:T,rightSectionWidth:R,rightSectionPointerEvents:D,leftSectionPointerEvents:k,variant:M,vars:I,pointer:z,multiline:V,radius:Y,id:W,withAria:J,withErrorStyles:G,mod:X,inputSize:P,__clearSection:L,__clearable:$,__defaultRightSection:H,...O}=n,{styleProps:U,rest:K}=Ya(O),ee=Tc(),Se={offsetBottom:ee==null?void 0:ee.offsetBottom,offsetTop:ee==null?void 0:ee.offsetTop},be=Ie({name:["Input",h],props:m||n,classes:xi,className:i,style:o,classNames:r,styles:c,unstyled:u,stylesCtx:Se,rootSelector:"wrapper",vars:I,varsResolver:M5}),xe=J?{required:f,disabled:S,"aria-invalid":!!b,"aria-describedby":ee==null?void 0:ee.describedBy,id:(ee==null?void 0:ee.inputId)||W}:{},Ge=_||$&&L||H;return s.jsx(j5,{value:{size:g||"sm"},children:s.jsxs(ce,{...be("wrapper"),...U,...v,mod:[{error:!!b&&G,pointer:z,disabled:S,multiline:V,"data-with-right-section":!!Ge,"data-with-left-section":!!w},X],variant:M,size:g,children:[w&&s.jsx("div",{...C,"data-position":"left",...be("section",{className:C==null?void 0:C.className,style:C==null?void 0:C.style}),children:w}),s.jsx(ce,{component:"input",...K,...xe,ref:t,required:f,mod:{disabled:S,error:!!b&&G},variant:M,__size:P,...be("input")}),Ge&&s.jsx("div",{...T,"data-position":"right",...be("section",{className:T==null?void 0:T.className,style:T==null?void 0:T.style}),children:Ge})]})})});mn.classes=xi;mn.Wrapper=Gx;mn.Label=md;mn.Error=jp;mn.Description=wp;mn.Placeholder=qx;mn.ClearButton=B2;mn.displayName="@mantine/core/Input";function I5(e,t,n){const r=se(e,t,n),{label:i,description:o,error:c,required:u,classNames:f,styles:h,className:m,unstyled:g,__staticSelector:v,__stylesApiProps:b,errorProps:S,labelProps:w,descriptionProps:C,wrapperProps:E,id:_,size:T,style:R,inputContainer:D,inputWrapperOrder:k,withAsterisk:M,variant:I,vars:z,mod:V,...Y}=r,{styleProps:W,rest:J}=Ya(Y),G={label:i,description:o,error:c,required:u,classNames:f,className:m,__staticSelector:v,__stylesApiProps:b||r,errorProps:S,labelProps:w,descriptionProps:C,unstyled:g,styles:h,size:T,style:R,inputContainer:D,inputWrapperOrder:k,withAsterisk:M,variant:I,id:_,mod:V,...E};return{...J,classNames:f,styles:h,unstyled:g,wrapperProps:{...G,...W},inputProps:{required:u,classNames:f,styles:h,unstyled:g,size:T,__staticSelector:v,__stylesApiProps:b||r,error:c,variant:I,id:_}}}const L5={__staticSelector:"InputBase",withAria:!0},Nr=cr((e,t)=>{const{inputProps:n,wrapperProps:r,...i}=I5("InputBase",L5,e);return s.jsx(mn.Wrapper,{...r,children:s.jsx(mn,{...n,...i,ref:t})})});Nr.classes={...mn.classes,...mn.Wrapper.classes};Nr.displayName="@mantine/core/InputBase";const $5={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 V2={root:"m_8bffd616"};const z5={},Fo=cr((e,t)=>{const n=se("Flex",z5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,gap:h,rowGap:m,columnGap:g,align:v,justify:b,wrap:S,direction:w,...C}=n,E=Ie({name:"Flex",classes:V2,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f}),_=Sn(),T=hd(),R=NR({styleProps:{gap:h,rowGap:m,columnGap:g,align:v,justify:b,wrap:S,direction:w},theme:_,data:$5});return s.jsxs(s.Fragment,{children:[R.hasResponsiveStyles&&s.jsx(Zs,{selector:`.${T}`,styles:R.styles,media:R.media}),s.jsx(ce,{ref:t,...E("root",{className:T,style:Go(R.inlineStyles)}),...C})]})});Fo.classes=V2;Fo.displayName="@mantine/core/Flex";function U5(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 B5({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const i=y.useRef(-1),[o,c]=y.useState(!1),[u,f]=y.useState(typeof r=="boolean"?r:!1),h=()=>{if(!e||!t||!n.current)return;const b=e.getBoundingClientRect(),S=t.getBoundingClientRect(),w=window.getComputedStyle(e),C=window.getComputedStyle(t),E=Uo(w.borderTopWidth)+Uo(C.borderTopWidth),_=Uo(w.borderLeftWidth)+Uo(C.borderLeftWidth),T={top:b.top-S.top-E,left:b.left-S.left-_,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(i.current),n.current&&(n.current.style.transitionDuration="0ms"),h(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=y.useRef(null),v=y.useRef(null);return y.useEffect(()=>{if(h(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(v.current=new ResizeObserver(m),v.current.observe(t)),()=>{var b,S;(b=g.current)==null||b.disconnect(),(S=v.current)==null||S.disconnect()}},[t,e]),y.useEffect(()=>{if(t){const b=S=>{U5(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),PN(()=>{TR()!=="test"&&c(!0)},20,{autoInvoke:!0}),NN(b=>{b.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:o,hidden:u}}var F2={root:"m_96b553a6"};const V5={},F5=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Wx=ve((e,t)=>{const n=se("FloatingIndicator",V5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,target:h,parent:m,transitionDuration:g,mod:v,displayAfterTransitionEnd:b,...S}=n,w=Ie({name:"FloatingIndicator",classes:F2,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:F5}),C=y.useRef(null),{initialized:E,hidden:_}=B5({target:h,parent:m,ref:C,displayAfterTransitionEnd:b}),T=Un(t,C);return!h||!m?null:s.jsx(ce,{ref:T,mod:[{initialized:E,hidden:_},v],...w("root"),...S})});Wx.displayName="@mantine/core/FloatingIndicator";Wx.classes=F2;var H2={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 H5={},q5=(e,{radius:t,color:n,variant:r,autoContrast:i})=>{const o=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:Vt(t),"--alert-bg":n||r?o.background:void 0,"--alert-color":o.color,"--alert-bd":n||r?o.border:void 0}}},Ka=ve((e,t)=>{const n=se("Alert",H5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,radius:h,color:m,title:g,children:v,id:b,icon:S,withCloseButton:w,onClose:C,closeButtonLabel:E,variant:_,autoContrast:T,...R}=n,D=Ie({name:"Alert",classes:H2,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:q5}),k=yr(b),M=g&&`${k}-title`||void 0,I=`${k}-body`;return s.jsx(ce,{id:k,...D("root",{variant:_}),variant:_,ref:t,...R,role:"alert","aria-describedby":I,"aria-labelledby":M,children:s.jsxs("div",{...D("wrapper"),children:[S&&s.jsx("div",{...D("icon"),children:S}),s.jsxs("div",{...D("body"),children:[g&&s.jsx("div",{...D("title"),"data-with-close-button":w||void 0,children:s.jsx("span",{id:M,...D("label"),children:g})}),v&&s.jsx("div",{id:I,...D("message"),"data-variant":_,children:v})]}),w&&s.jsx(Qo,{...D("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":E,unstyled:u})]})})});Ka.classes=H2;Ka.displayName="@mantine/core/Alert";var q2={root:"m_b6d8b162"};function G5(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const W5={inherit:!1},Q5=(e,{variant:t,lineClamp:n,gradient:r,size:i,color:o})=>({root:{"--text-fz":On(i),"--text-lh":yR(i),"--text-gradient":t==="gradient"?wy(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":o?Ht(o,e):void 0}}),_e=cr((e,t)=>{const n=se("Text",W5,e),{lineClamp:r,truncate:i,inline:o,inherit:c,gradient:u,span:f,__staticSelector:h,vars:m,className:g,style:v,classNames:b,styles:S,unstyled:w,variant:C,mod:E,size:_,...T}=n,R=Ie({name:["Text",h],props:n,classes:q2,className:g,style:v,classNames:b,styles:S,unstyled:w,vars:m,varsResolver:Q5});return s.jsx(ce,{...R("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":G5(i),"data-line-clamp":typeof r=="number","data-inline":o,"data-inherit":c},E],size:_,...T})});_e.classes=q2;_e.displayName="@mantine/core/Text";var G2={root:"m_849cf0da"};const Y5={underline:"hover"},Nt=cr((e,t)=>{const{underline:n,className:r,unstyled:i,mod:o,...c}=se("Anchor",Y5,e);return s.jsx(_e,{component:"a",ref:t,className:Ut({[G2.root]:!i},r),...c,mod:[{underline:n},o],__staticSelector:"Anchor",unstyled:i})});Nt.classes=G2;Nt.displayName="@mantine/core/Anchor";const[X5,Rc]=vr("AppShell was not found in tree");var Yo={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const K5={},Qx=ve((e,t)=>{const n=se("AppShellAside",K5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,withBorder:h,zIndex:m,mod:g,...v}=n,b=Rc();return b.disabled?null:s.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":h??b.withBorder},g],...b.getStyles("aside",{className:i,classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});Qx.classes=Yo;Qx.displayName="@mantine/core/AppShellAside";const Z5={},Yx=ve((e,t)=>{var S;const n=se("AppShellFooter",Z5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,withBorder:h,zIndex:m,mod:g,...v}=n,b=Rc();return b.disabled?null:s.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":h??b.withBorder},g],...b.getStyles("footer",{className:Ut({[cc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-footer-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Yx.classes=Yo;Yx.displayName="@mantine/core/AppShellFooter";const J5={},Xx=ve((e,t)=>{var S;const n=se("AppShellHeader",J5,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,withBorder:h,zIndex:m,mod:g,...v}=n,b=Rc();return b.disabled?null:s.jsx(ce,{component:"header",ref:t,mod:[{"with-border":h??b.withBorder},g],...b.getStyles("header",{className:Ut({[cc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-header-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Xx.classes=Yo;Xx.displayName="@mantine/core/AppShellHeader";const e7={},Kx=ve((e,t)=>{const n=se("AppShellMain",e7,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=Rc();return s.jsx(ce,{component:"main",ref:t,...h.getStyles("main",{className:i,style:o,classNames:r,styles:c}),...f})});Kx.classes=Yo;Kx.displayName="@mantine/core/AppShellMain";function gd(e){return typeof e=="object"?e.base:e}function vd(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 yd(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function t7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i}){var f,h,m;const o=r==null?void 0:r.width,c="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-aside-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-aside-offset"]="0px"),vd(o)){const g=le(gd(o));e["--app-shell-aside-width"]=g,e["--app-shell-aside-offset"]=g}if(yd(o)&&(typeof o.base<"u"&&(e["--app-shell-aside-width"]=le(o.base),e["--app-shell-aside-offset"]=le(o.base)),sn(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-aside-width"]=le(o[g]),t[g]["--app-shell-aside-offset"]=le(o[g]))})),(h=r==null?void 0:r.collapsed)!=null&&h.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-aside-transform"]=c,t[g]["--app-shell-aside-transform-rtl"]=u,t[g]["--app-shell-aside-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=vx(r.breakpoint,i.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-aside-width"]="100%",n[g]["--app-shell-aside-offset"]="0px",n[g]["--app-shell-aside-transform"]=c,n[g]["--app-shell-aside-transform-rtl"]=u}}function n7({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,i="translateY(var(--app-shell-footer-height))",o=(n==null?void 0:n.offset)??!0;if(vd(r)){const c=le(gd(r));e["--app-shell-footer-height"]=c,o&&(e["--app-shell-footer-offset"]=c)}yd(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),o&&(e["--app-shell-footer-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),o&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=i,e["--app-shell-footer-offset"]="0px !important")}function r7({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,i="translateY(calc(var(--app-shell-header-height) * -1))",o=(n==null?void 0:n.offset)??!0;if(vd(r)){const c=le(gd(r));e["--app-shell-header-height"]=c,o&&(e["--app-shell-header-offset"]=c)}yd(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),o&&(e["--app-shell-header-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),o&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=i,e["--app-shell-header-offset"]="0px !important")}function i7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i}){var f,h,m;const o=r==null?void 0:r.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-navbar-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-navbar-offset"]="0px"),vd(o)){const g=le(gd(o));e["--app-shell-navbar-width"]=g,e["--app-shell-navbar-offset"]=g}if(yd(o)&&(typeof o.base<"u"&&(e["--app-shell-navbar-width"]=le(o.base),e["--app-shell-navbar-offset"]=le(o.base)),sn(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-navbar-width"]=le(o[g]),t[g]["--app-shell-navbar-offset"]=le(o[g]))})),(h=r==null?void 0:r.collapsed)!=null&&h.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-navbar-transform"]=c,t[g]["--app-shell-navbar-transform-rtl"]=u,t[g]["--app-shell-navbar-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=vx(r.breakpoint,i.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-navbar-width"]="100%",n[g]["--app-shell-navbar-offset"]="0px",n[g]["--app-shell-navbar-transform"]=c,n[g]["--app-shell-navbar-transform-rtl"]=u}}function Fv(e){return Number(e)===0?"0px":Nn(e)}function a7({padding:e,baseStyles:t,minMediaStyles:n}){vd(e)&&(t["--app-shell-padding"]=Fv(gd(e))),yd(e)&&(e.base&&(t["--app-shell-padding"]=Fv(e.base)),sn(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Fv(e[r]))}))}function o7({navbar:e,header:t,footer:n,aside:r,padding:i,theme:o}){const c={},u={},f={};i7({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,navbar:e,theme:o}),t7({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,aside:r,theme:o}),r7({baseStyles:f,minMediaStyles:c,header:t}),n7({baseStyles:f,minMediaStyles:c,footer:n}),a7({baseStyles:f,minMediaStyles:c,padding:i});const h=Zu(sn(c),o.breakpoints).map(v=>({query:`(min-width: ${Eh(v.px)})`,styles:c[v.value]})),m=Zu(sn(u),o.breakpoints).map(v=>({query:`(max-width: ${Eh(v.px)})`,styles:u[v.value]})),g=[...h,...m];return{baseStyles:f,media:g}}function s7({navbar:e,header:t,aside:n,footer:r,padding:i}){const o=Sn(),c=Wa(),{media:u,baseStyles:f}=o7({navbar:e,header:t,footer:r,aside:n,padding:i,theme:o});return s.jsx(Zs,{media:u,styles:f,selector:c.cssVariablesSelector})}const l7={},Zx=ve((e,t)=>{const n=se("AppShellNavbar",l7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,withBorder:h,zIndex:m,mod:g,...v}=n,b=Rc();return b.disabled?null:s.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":h??b.withBorder},g],...b.getStyles("navbar",{className:i,classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});Zx.classes=Yo;Zx.displayName="@mantine/core/AppShellNavbar";const c7={},Jx=cr((e,t)=>{const n=se("AppShellSection",c7,e),{classNames:r,className:i,style:o,styles:c,vars:u,grow:f,mod:h,...m}=n,g=Rc();return s.jsx(ce,{ref:t,mod:[{grow:f},h],...g.getStyles("section",{className:i,style:o,classNames:r,styles:c}),...m})});Jx.classes=Yo;Jx.displayName="@mantine/core/AppShellSection";function u7({transitionDuration:e,disabled:t}){const[n,r]=y.useState(!0),i=y.useRef(-1),o=y.useRef(-1);return ER("resize",()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),200)}),wc(()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const d7={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Qr("app")},f7=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Ar=ve((e,t)=>{const n=se("AppShell",d7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,navbar:h,withBorder:m,padding:g,transitionDuration:v,transitionTimingFunction:b,header:S,zIndex:w,layout:C,disabled:E,aside:_,footer:T,offsetScrollbars:R=C!=="alt",mod:D,...k}=n,M=Ie({name:"AppShell",classes:Yo,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:f7}),I=u7({disabled:E,transitionDuration:v});return s.jsxs(X5,{value:{getStyles:M,withBorder:m,zIndex:w,disabled:E,offsetScrollbars:R},children:[s.jsx(s7,{navbar:h,header:S,aside:_,footer:T,padding:g}),s.jsx(ce,{ref:t,...M("root"),mod:[{resizing:I,layout:C,disabled:E},D],...k})]})});Ar.classes=Yo;Ar.displayName="@mantine/core/AppShell";Ar.Navbar=Zx;Ar.Header=Xx;Ar.Main=Kx;Ar.Aside=Qx;Ar.Footer=Yx;Ar.Section=Jx;function W2(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=>W2(t))}:e}function Q2(e){return e?e.map(t=>W2(t)):[]}function Y2(e){return e.reduce((t,n)=>"group"in n?{...t,...Y2(n.items)}:(t[n.value]=n,t),{})}var Pr={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const h7={error:null},p7=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":rt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Ht(n,e):void 0}}),Cp=ve((e,t)=>{const n=se("ComboboxChevron",h7,e),{size:r,error:i,style:o,className:c,classNames:u,styles:f,unstyled:h,vars:m,mod:g,...v}=n,b=Ie({name:"ComboboxChevron",classes:Pr,props:n,style:o,className:c,classNames:u,styles:f,unstyled:h,vars:m,varsResolver:p7,rootSelector:"chevron"});return s.jsx(ce,{component:"svg",...v,...b("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:i},g],ref:t,children:s.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});Cp.classes=Pr;Cp.displayName="@mantine/core/ComboboxChevron";const[m7,bi]=vr("Combobox component was not found in tree"),X2=y.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...i},o)=>s.jsx(mn.ClearButton,{ref:o,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:c=>{c.preventDefault(),t==null||t(c)},onClick:c=>{r(),n==null||n(c)}}));X2.displayName="@mantine/core/ComboboxClearButton";const g7={},e0=ve((e,t)=>{const{classNames:n,styles:r,className:i,style:o,hidden:c,...u}=se("ComboboxDropdown",g7,e),f=bi();return s.jsx($i.Dropdown,{...u,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:i,style:o,classNames:n,styles:r})})});e0.classes=Pr;e0.displayName="@mantine/core/ComboboxDropdown";const v7={refProp:"ref"},K2=ve((e,t)=>{const{children:n,refProp:r}=se("ComboboxDropdownTarget",v7,e);if(bi(),!qa(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return s.jsx($i.Target,{ref:t,refProp:r,children:n})});K2.displayName="@mantine/core/ComboboxDropdownTarget";const y7={},t0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("ComboboxEmpty",y7,e),f=bi();return s.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:o,style:i}),...u})});t0.classes=Pr;t0.displayName="@mantine/core/ComboboxEmpty";function n0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:o}){const c=bi(),[u,f]=y.useState(null),h=g=>{if(e==null||e(g),!c.readOnly&&t){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectNextOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectPreviousOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const v=c.store.getSelectedOptionIndex();c.store.dropdownOpened&&v!==-1?(g.preventDefault(),c.store.clickSelectedOption()):i==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&i==="button"&&(g.preventDefault(),c.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(c.store.listId&&c.store.dropdownOpened)||void 0,"aria-controls":c.store.dropdownOpened?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&u||void 0,autoComplete:o,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:h}}const x7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Z2=ve((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...h}=se("ComboboxEventsTarget",x7,e);if(!qa(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=bi(),g=n0({targetType:u,withAriaAttributes:o,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return y.cloneElement(n,{...g,...h,[r]:Un(t,m.store.targetRef,dp(n))})});Z2.displayName="@mantine/core/ComboboxEventsTarget";const b7={},r0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("ComboboxFooter",b7,e),f=bi();return s.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:i,styles:o}),...u,onMouseDown:h=>{h.preventDefault()}})});r0.classes=Pr;r0.displayName="@mantine/core/ComboboxFooter";const S7={},i0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,children:u,label:f,...h}=se("ComboboxGroup",S7,e),m=bi();return s.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:i,styles:o}),...h,children:[f&&s.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:o}),children:f}),u]})});i0.classes=Pr;i0.displayName="@mantine/core/ComboboxGroup";const w7={},a0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("ComboboxHeader",w7,e),f=bi();return s.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:i,styles:o}),...u,onMouseDown:h=>{h.preventDefault()}})});a0.classes=Pr;a0.displayName="@mantine/core/ComboboxHeader";function J2({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}J2.displayName="@mantine/core/ComboboxHiddenInput";const j7={},o0=ve((e,t)=>{const n=se("ComboboxOption",j7,e),{classNames:r,className:i,style:o,styles:c,vars:u,onClick:f,id:h,active:m,onMouseDown:g,onMouseOver:v,disabled:b,selected:S,mod:w,...C}=n,E=bi(),_=y.useId(),T=h||_;return s.jsx(ce,{...E.getStyles("option",{className:i,classNames:r,styles:c,style:o}),...C,ref:t,id:T,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":S},w],role:"option",onClick:R=>{var D;b?R.preventDefault():((D=E.onOptionSubmit)==null||D.call(E,n.value,n),f==null||f(R))},onMouseDown:R=>{R.preventDefault(),g==null||g(R)},onMouseOver:R=>{E.resetSelectionOnOptionHover&&E.store.resetSelectedOption(),v==null||v(R)}})});o0.classes=Pr;o0.displayName="@mantine/core/ComboboxOption";const C7={},s0=ve((e,t)=>{const n=se("ComboboxOptions",C7,e),{classNames:r,className:i,style:o,styles:c,id:u,onMouseDown:f,labelledBy:h,...m}=n,g=bi(),v=yr(u);return y.useEffect(()=>{g.store.setListId(v)},[v]),s.jsx(ce,{ref:t,...g.getStyles("options",{className:i,style:o,classNames:r,styles:c}),...m,id:v,role:"listbox","aria-labelledby":h,onMouseDown:b=>{b.preventDefault(),f==null||f(b)}})});s0.classes=Pr;s0.displayName="@mantine/core/ComboboxOptions";const E7={withAriaAttributes:!0,withKeyboardNavigation:!0},l0=ve((e,t)=>{const n=se("ComboboxSearch",E7,e),{classNames:r,styles:i,unstyled:o,vars:c,withAriaAttributes:u,onKeyDown:f,withKeyboardNavigation:h,size:m,...g}=n,v=bi(),b=v.getStyles("search"),S=n0({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:h,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return s.jsx(mn,{ref:Un(t,v.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},i],size:m||v.size,...S,...g,__staticSelector:"Combobox"})});l0.classes=Pr;l0.displayName="@mantine/core/ComboboxSearch";const T7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},e_=ve((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...h}=se("ComboboxTarget",T7,e);if(!qa(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=bi(),g=n0({targetType:u,withAriaAttributes:o,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),v=y.cloneElement(n,{...g,...h});return s.jsx($i.Target,{ref:Un(t,m.store.targetRef),children:v})});e_.displayName="@mantine/core/ComboboxTarget";function R7(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 _7(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 D7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function xd({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:o=!0,scrollBehavior:c="instant"}={}){const[u,f]=Yn({value:t,defaultValue:e,finalValue:!1,onChange:n}),h=y.useRef(null),m=y.useRef(-1),g=y.useRef(null),v=y.useRef(null),b=y.useRef(-1),S=y.useRef(-1),w=y.useRef(-1),C=y.useCallback((P="unknown")=>{u||(f(!0),i==null||i(P))},[f,i,u]),E=y.useCallback((P="unknown")=>{u&&(f(!1),r==null||r(P))},[f,r,u]),_=y.useCallback((P="unknown")=>{u?E(P):C(P)},[E,C,u]),T=y.useCallback(()=>{const P=document.querySelector(`#${h.current} [data-combobox-selected]`);P==null||P.removeAttribute("data-combobox-selected"),P==null||P.removeAttribute("aria-selected")},[]),R=y.useCallback(P=>{const L=document.getElementById(h.current),$=L==null?void 0:L.querySelectorAll("[data-combobox-option]");if(!$)return null;const H=P>=$.length?0:P<0?$.length-1:P;return m.current=H,$!=null&&$[H]&&!$[H].hasAttribute("data-combobox-disabled")?(T(),$[H].setAttribute("data-combobox-selected","true"),$[H].setAttribute("aria-selected","true"),$[H].scrollIntoView({block:"nearest",behavior:c}),$[H].id):null},[c,T]),D=y.useCallback(()=>{const P=document.querySelector(`#${h.current} [data-combobox-active]`);if(P){const L=document.querySelectorAll(`#${h.current} [data-combobox-option]`),$=Array.from(L).findIndex(H=>H===P);return R($)}return R(0)},[R]),k=y.useCallback(()=>R(_7(m.current,document.querySelectorAll(`#${h.current} [data-combobox-option]`),o)),[R,o]),M=y.useCallback(()=>R(R7(m.current,document.querySelectorAll(`#${h.current} [data-combobox-option]`),o)),[R,o]),I=y.useCallback(()=>R(D7(document.querySelectorAll(`#${h.current} [data-combobox-option]`))),[R]),z=y.useCallback((P="selected",L)=>{w.current=window.setTimeout(()=>{var O;const $=document.querySelectorAll(`#${h.current} [data-combobox-option]`),H=Array.from($).findIndex(U=>U.hasAttribute(`data-combobox-${P}`));m.current=H,L!=null&&L.scrollIntoView&&((O=$[H])==null||O.scrollIntoView({block:"nearest",behavior:c}))},0)},[]),V=y.useCallback(()=>{m.current=-1,T()},[T]),Y=y.useCallback(()=>{const P=document.querySelectorAll(`#${h.current} [data-combobox-option]`),L=P==null?void 0:P[m.current];L==null||L.click()},[]),W=y.useCallback(P=>{h.current=P},[]),J=y.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),G=y.useCallback(()=>{S.current=window.setTimeout(()=>v.current.focus(),0)},[]),X=y.useCallback(()=>m.current,[]);return y.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(S.current),window.clearTimeout(w.current)},[]),{dropdownOpened:u,openDropdown:C,closeDropdown:E,toggleDropdown:_,selectedOptionIndex:m.current,getSelectedOptionIndex:X,selectOption:R,selectFirstOption:I,selectActiveOption:D,selectNextOption:k,selectPreviousOption:M,resetSelectedOption:V,updateSelectedOptionIndex:z,listId:h.current,setListId:W,clickSelectedOption:Y,searchRef:g,focusSearchInput:J,targetRef:v,focusTarget:G}}const A7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},k7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":On(t),"--combobox-option-padding":rt(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":On(t),"--combobox-option-padding":rt(t,"combobox-option-padding")}});function ct(e){const t=se("Combobox",A7,e),{classNames:n,styles:r,unstyled:i,children:o,store:c,vars:u,onOptionSubmit:f,onClose:h,size:m,dropdownPadding:g,resetSelectionOnOptionHover:v,__staticSelector:b,readOnly:S,...w}=t,C=xd(),E=c||C,_=Ie({name:b||"Combobox",classes:Pr,props:t,classNames:n,styles:r,unstyled:i,vars:u,varsResolver:k7}),T=()=>{h==null||h(),E.closeDropdown()};return s.jsx(m7,{value:{getStyles:_,store:E,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:v,readOnly:S},children:s.jsx($i,{opened:E.dropdownOpened,...w,onChange:R=>!R&&T(),withRoles:!1,unstyled:i,children:o})})}const P7=e=>e;ct.extend=P7;ct.classes=Pr;ct.displayName="@mantine/core/Combobox";ct.Target=e_;ct.Dropdown=e0;ct.Options=s0;ct.Option=o0;ct.Search=l0;ct.Empty=t0;ct.Chevron=Cp;ct.Footer=r0;ct.Header=a0;ct.EventsTarget=Z2;ct.DropdownTarget=K2;ct.Group=i0;ct.ClearButton=X2;ct.HiddenInput=J2;var t_={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const n_=t_,Ep=y.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:o,children:c,label:u,description:f,id:h,disabled:m,error:g,size:v,labelPosition:b="left",bodyElement:S="div",labelElement:w="label",variant:C,style:E,vars:_,mod:T,...R},D)=>{const k=Ie({name:e,props:t,className:n,style:E,classes:t_,classNames:r,styles:i,unstyled:o});return s.jsx(ce,{...k("root"),ref:D,__vars:{"--label-fz":On(v),"--label-lh":rt(v,"label-lh")},mod:[{"label-position":b},T],variant:C,size:v,...R,children:s.jsxs(ce,{component:S,htmlFor:S==="label"?h:void 0,...k("body"),children:[c,s.jsxs("div",{...k("labelWrapper"),"data-disabled":m||void 0,children:[u&&s.jsx(ce,{component:w,htmlFor:w==="label"?h:void 0,...k("label"),"data-disabled":m||void 0,children:u}),f&&s.jsx(mn.Description,{size:v,__inheritStyles:!1,...k("description"),children:f}),g&&typeof g!="boolean"&&s.jsx(mn.Error,{size:v,__inheritStyles:!1,...k("error"),children:g})]})]})})});Ep.displayName="@mantine/core/InlineInput";const r_=y.createContext(null),N7=r_.Provider,i_=()=>y.useContext(r_),[O7,M7]=Ga();var a_={card:"m_26775b0a"};const I7={withBorder:!0},L7=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),c0=ve((e,t)=>{const n=se("CheckboxCard",I7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,checked:h,mod:m,withBorder:g,value:v,onClick:b,defaultChecked:S,onChange:w,...C}=n,E=Ie({name:"CheckboxCard",classes:a_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:L7,rootSelector:"card"}),_=i_(),T=typeof h=="boolean"?h:_?_.value.includes(v||""):void 0,[R,D]=Yn({value:T,defaultValue:S,finalValue:!1,onChange:w});return s.jsx(O7,{value:{checked:R},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:R},m],...E("card"),...C,role:"checkbox","aria-checked":R,onClick:k=>{b==null||b(k),_==null||_.onChange(v||""),D(!R)}})})});c0.displayName="@mantine/core/CheckboxCard";c0.classes=a_;function u0({children:e,role:t}){const n=Tc();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const $7={},d0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:o,wrapperProps:c,children:u,readOnly:f,...h}=se("CheckboxGroup",$7,e),[m,g]=Yn({value:n,defaultValue:r,finalValue:[],onChange:i}),v=b=>{const S=typeof b=="string"?b:b.currentTarget.value;!f&&g(m.includes(S)?m.filter(w=>w!==S):[...m,S])};return s.jsx(N7,{value:{value:m,onChange:v,size:o},children:s.jsx(mn.Wrapper,{size:o,ref:t,...c,...h,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(u0,{role:"group",children:u})})})});d0.classes=mn.Wrapper.classes;d0.displayName="@mantine/core/CheckboxGroup";function Tp({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(e),...t}:t;return s.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:s.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function o_({indeterminate:e,...t}){return e?s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:s.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):s.jsx(Tp,{...t})}var s_={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const z7={icon:o_},U7=(e,{radius:t,color:n,size:r,iconColor:i,variant:o,autoContrast:c})=>{const u=hi({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--checkbox-size":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Vt(t),"--checkbox-color":o==="outline"?f:Ht(n,e),"--checkbox-icon-color":i?Ht(i,e):Ks(c,e)?Qa({color:n,theme:e,autoContrast:c}):void 0}}},f0=ve((e,t)=>{const n=se("CheckboxIndicator",z7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,icon:h,indeterminate:m,radius:g,color:v,iconColor:b,autoContrast:S,checked:w,mod:C,variant:E,disabled:_,...T}=n,R=h,D=Ie({name:"CheckboxIndicator",classes:s_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:U7,rootSelector:"indicator"}),k=M7(),M=typeof w=="boolean"||typeof m=="boolean"?w||m:(k==null?void 0:k.checked)||!1;return s.jsx(ce,{ref:t,...D("indicator",{variant:E}),variant:E,mod:[{checked:M,disabled:_},C],...T,children:s.jsx(R,{indeterminate:m,...D("icon")})})});f0.displayName="@mantine/core/CheckboxIndicator";f0.classes=s_;var l_={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const B7={labelPosition:"right",icon:o_},V7=(e,{radius:t,color:n,size:r,iconColor:i,variant:o,autoContrast:c})=>{const u=hi({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--checkbox-size":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Vt(t),"--checkbox-color":o==="outline"?f:Ht(n,e),"--checkbox-icon-color":i?Ht(i,e):Ks(c,e)?Qa({color:n,theme:e,autoContrast:c}):void 0}}},zn=ve((e,t)=>{const n=se("Checkbox",B7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,color:h,label:m,id:g,size:v,radius:b,wrapperProps:S,checked:w,labelPosition:C,description:E,error:_,disabled:T,variant:R,indeterminate:D,icon:k,rootRef:M,iconColor:I,onChange:z,autoContrast:V,mod:Y,...W}=n,J=i_(),G=v||(J==null?void 0:J.size),X=k,P=Ie({name:"Checkbox",props:n,classes:l_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:V7}),{styleProps:L,rest:$}=Ya(W),H=yr(g),O=J?{checked:J.value.includes($.value),onChange:ee=>{J.onChange(ee),z==null||z(ee)}}:{},U=y.useRef(null),K=t||U;return y.useEffect(()=>{K&&"current"in K&&K.current&&(K.current.indeterminate=D||!1)},[D,K]),s.jsx(Ep,{...P("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:H,size:G,labelPosition:C,label:m,description:E,error:_,disabled:T,classNames:r,styles:c,unstyled:u,"data-checked":O.checked||w||void 0,variant:R,ref:M,mod:Y,...L,...S,children:s.jsxs(ce,{...P("inner"),mod:{"data-label-position":C},children:[s.jsx(ce,{component:"input",id:H,ref:K,checked:w,disabled:T,mod:{error:!!_,indeterminate:D},...P("input",{focusable:!0,variant:R}),onChange:z,...$,...O,type:"checkbox"}),s.jsx(X,{indeterminate:D,...P("icon")})]})})});zn.classes={...l_,...n_};zn.displayName="@mantine/core/Checkbox";zn.Group=d0;zn.Indicator=f0;zn.Card=c0;function pc(e){return"group"in e}function c_({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),i=[];for(let o=0;o<e.length;o+=1){const c=e[o];if(i.length===n)return i;pc(c)&&i.push({group:c.group,items:c_({options:c.items,search:t,limit:n-i.length})}),pc(c)||c.label.toLowerCase().includes(r)&&i.push(c)}return i}function F7(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 u_(e,t=new Set){if(Array.isArray(e))for(const n of e)if(pc(n))u_(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 H7(e,t){return Array.isArray(e)?e.includes(t):e===t}function d_({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:i,renderOption:o}){if(!pc(e)){const u=H7(n,e.value),f=t&&u&&s.jsx(Tp,{className:Pr.optionsDropdownCheckIcon}),h=s.jsxs(s.Fragment,{children:[r==="left"&&f,s.jsx("span",{children:e.label}),r==="right"&&f]});return s.jsx(ct.Option,{value:e.value,disabled:e.disabled,className:Ut({[Pr.optionsDropdownOption]:!i}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof o=="function"?o({option:e,checked:u}):h})}const c=e.items.map(u=>s.jsx(d_,{data:u,value:n,unstyled:i,withCheckIcon:t,checkIconPosition:r,renderOption:o},u.value));return s.jsx(ct.Group,{label:e.group,children:c})}function q7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:o,maxDropdownHeight:c,withScrollArea:u=!0,filterOptions:f=!0,withCheckIcon:h=!1,value:m,checkIconPosition:g,nothingFoundMessage:v,unstyled:b,labelId:S,renderOption:w,scrollAreaProps:C,"aria-label":E}){u_(e);const T=typeof i=="string"?(r||c_)({options:e,search:f?i:"",limit:o??1/0}):e,R=F7(T),D=T.map(k=>s.jsx(d_,{data:k,withCheckIcon:h,value:m,checkIconPosition:g,unstyled:b,renderOption:w},pc(k)?k.group:k.value));return s.jsx(ct.Dropdown,{hidden:t||n&&R,"data-composed":!0,children:s.jsxs(ct.Options,{labelledBy:S,"aria-label":E,children:[u?s.jsx(Yr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:D}):D,R&&v&&s.jsx(ct.Empty,{children:v})]})})}const f_=y.createContext(null),G7=f_.Provider;function W7(){return{withinGroup:!!y.useContext(f_)}}var Rp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const Q7={},Y7=(e,{spacing:t})=>({group:{"--ag-spacing":Nn(t)}}),h0=ve((e,t)=>{const n=se("AvatarGroup",Q7,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,spacing:h,...m}=n,g=Ie({name:"AvatarGroup",classes:Rp,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:Y7,rootSelector:"group"});return s.jsx(G7,{value:!0,children:s.jsx(ce,{ref:t,...g("group"),...m})})});h0.classes=Rp;h0.displayName="@mantine/core/AvatarGroup";function X7(e){return s.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function K7(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 Z7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function J7(e,t=Z7){const n=K7(e),r=Math.abs(n)%t.length;return t[r]}function eI(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 tI={},nI=(e,{size:t,radius:n,variant:r,gradient:i,color:o,autoContrast:c,name:u,allowedInitialsColors:f})=>{const h=o==="initials"&&typeof u=="string"?J7(u,f):o,m=e.variantColorResolver({color:h||"gray",theme:e,gradient:i,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":rt(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Vt(n),"--avatar-bg":h||r?m.background:void 0,"--avatar-color":h||r?m.color:void 0,"--avatar-bd":h||r?m.border:void 0}}},zs=cr((e,t)=>{const n=se("Avatar",tI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,src:h,alt:m,radius:g,color:v,gradient:b,imageProps:S,children:w,autoContrast:C,mod:E,name:_,allowedInitialsColors:T,...R}=n,D=W7(),[k,M]=y.useState(!h),I=Ie({name:"Avatar",props:n,classes:Rp,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:nI});return y.useEffect(()=>M(!h),[h]),s.jsx(ce,{...I("root"),mod:[{"within-group":D.withinGroup},E],ref:t,...R,children:k?s.jsx("span",{...I("placeholder"),title:m,children:w||typeof _=="string"&&eI(_)||s.jsx(X7,{})}):s.jsx("img",{...S,...I("image"),src:h,alt:m,onError:z=>{var V;M(!0),(V=S==null?void 0:S.onError)==null||V.call(S,z)}})})});zs.classes=Rp;zs.displayName="@mantine/core/Avatar";zs.Group=h0;var h_={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const rI={},iI=(e,{radius:t,color:n,gradient:r,variant:i,size:o,autoContrast:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:c});return{root:{"--badge-height":rt(o,"badge-height"),"--badge-padding-x":rt(o,"badge-padding-x"),"--badge-fz":rt(o,"badge-fz"),"--badge-radius":t===void 0?void 0:Vt(t),"--badge-bg":n||i?u.background:void 0,"--badge-color":n||i?u.color:void 0,"--badge-bd":n||i?u.border:void 0,"--badge-dot-color":i==="dot"?Ht(n,e):void 0}}},_p=cr((e,t)=>{const n=se("Badge",rI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,radius:h,color:m,gradient:g,leftSection:v,rightSection:b,children:S,variant:w,fullWidth:C,autoContrast:E,circle:_,mod:T,...R}=n,D=Ie({name:"Badge",props:n,classes:h_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:iI});return s.jsxs(ce,{variant:w,mod:[{block:C,circle:_,"with-right-section":!!b,"with-left-section":!!v},T],...D("root",{variant:w}),ref:t,...R,children:[v&&s.jsx("span",{...D("section"),"data-position":"left",children:v}),s.jsx("span",{...D("label"),children:S}),b&&s.jsx("span",{...D("section"),"data-position":"right",children:b})]})});_p.classes=h_;_p.displayName="@mantine/core/Badge";var p_={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const aI={iconSize:48},oI=(e,{color:t,iconSize:n,radius:r})=>{const i=hi({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),o=hi({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":ci(o.value,.07),"--bq-bg-dark":ci(i.value,.06),"--bq-bd":Ht(t,e),"--bq-icon-size":le(n),"--bq-radius":Vt(r)}}},p0=ve((e,t)=>{const n=se("Blockquote",aI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,children:h,icon:m,iconSize:g,cite:v,...b}=n,S=Ie({name:"Blockquote",classes:p_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:oI});return s.jsxs(ce,{component:"blockquote",ref:t,...S("root"),...b,children:[m&&s.jsx("span",{...S("icon"),children:m}),h,v&&s.jsx("cite",{...S("cite"),children:v})]})});p0.classes=p_;p0.displayName="@mantine/core/Blockquote";var _c={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const MC={orientation:"horizontal"},sI=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),m0=ve((e,t)=>{const n=se("ButtonGroup",MC,e),{className:r,style:i,classNames:o,styles:c,unstyled:u,orientation:f,vars:h,borderWidth:m,variant:g,mod:v,...b}=se("ButtonGroup",MC,e),S=Ie({name:"ButtonGroup",props:n,classes:_c,className:r,style:i,classNames:o,styles:c,unstyled:u,vars:h,varsResolver:sI,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},v],role:"group",...b})});m0.classes=_c;m0.displayName="@mantine/core/ButtonGroup";const IC={},lI=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:o});return{groupSection:{"--section-height":rt(c,"section-height"),"--section-padding-x":rt(c,"section-padding-x"),"--section-fz":c!=null&&c.includes("compact")?On(c.replace("compact-","")):On(c),"--section-radius":t===void 0?void 0:Vt(t),"--section-bg":n||i?u.background:void 0,"--section-color":u.color,"--section-bd":n||i?u.border:void 0}}},g0=ve((e,t)=>{const n=se("ButtonGroupSection",IC,e),{className:r,style:i,classNames:o,styles:c,unstyled:u,vars:f,variant:h,gradient:m,radius:g,autoContrast:v,...b}=se("ButtonGroupSection",IC,e),S=Ie({name:"ButtonGroupSection",props:n,classes:_c,className:r,style:i,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:lI,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:h,...b})});g0.classes=_c;g0.displayName="@mantine/core/ButtonGroupSection";const cI={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},uI={},dI=(e,{radius:t,color:n,gradient:r,variant:i,size:o,justify:c,autoContrast:u})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:u});return{root:{"--button-justify":c,"--button-height":rt(o,"button-height"),"--button-padding-x":rt(o,"button-padding-x"),"--button-fz":o!=null&&o.includes("compact")?On(o.replace("compact-","")):On(o),"--button-radius":t===void 0?void 0:Vt(t),"--button-bg":n||i?f.background:void 0,"--button-hover":n||i?f.hover:void 0,"--button-color":f.color,"--button-bd":n||i?f.border:void 0,"--button-hover-color":n||i?f.hoverColor:void 0}}},Pe=cr((e,t)=>{const n=se("Button",uI,e),{style:r,vars:i,className:o,color:c,disabled:u,children:f,leftSection:h,rightSection:m,fullWidth:g,variant:v,radius:b,loading:S,loaderProps:w,gradient:C,classNames:E,styles:_,unstyled:T,"data-disabled":R,autoContrast:D,mod:k,...M}=n,I=Ie({name:"Button",props:n,classes:_c,className:o,style:r,classNames:E,styles:_,unstyled:T,vars:i,varsResolver:dI}),z=!!h,V=!!m;return s.jsxs(tr,{ref:t,...I("root",{active:!u&&!S&&!R}),unstyled:T,variant:v,disabled:u||S,mod:[{disabled:u||R,loading:S,block:g,"with-left-section":z,"with-right-section":V},k],...M,children:[s.jsx(fa,{mounted:!!S,transition:cI,duration:150,children:Y=>s.jsx(ce,{component:"span",...I("loader",{style:Y}),"aria-hidden":!0,children:s.jsx(kr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...w})})}),s.jsxs("span",{...I("inner"),children:[h&&s.jsx(ce,{component:"span",...I("section"),mod:{position:"left"},children:h}),s.jsx(ce,{component:"span",mod:{loading:S},...I("label"),children:f}),m&&s.jsx(ce,{component:"span",...I("section"),mod:{position:"right"},children:m})]})]})});Pe.classes=_c;Pe.displayName="@mantine/core/Button";Pe.Group=m0;Pe.GroupSection=g0;var m_={root:"m_4451eb3a"};const fI={},er=cr((e,t)=>{const n=se("Center",fI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,inline:h,mod:m,...g}=n,v=Ie({name:"Center",props:n,classes:m_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f});return s.jsx(ce,{ref:t,mod:[{inline:h},m],...v("root"),...g})});er.classes=m_;er.displayName="@mantine/core/Center";const[hI,pI]=Ga(),mI={};function g_(e){const{value:t,defaultValue:n,onChange:r,multiple:i,children:o}=se("ChipGroup",mI,e),[c,u]=Yn({value:t,defaultValue:n,finalValue:i?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,h=m=>{const g=m.currentTarget.value;Array.isArray(c)?u(c.includes(g)?c.filter(v=>v!==g):[...c,g]):u(g)};return s.jsx(hI,{value:{isChipSelected:f,onChange:h,multiple:i},children:o})}g_.displayName="@mantine/core/ChipGroup";var v_={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 gI={type:"checkbox"},vI=(e,{size:t,radius:n,variant:r,color:i,autoContrast:o})=>{const c=e.variantColorResolver({color:i||e.primaryColor,theme:e,variant:r||"filled",autoContrast:o});return{root:{"--chip-fz":On(t),"--chip-size":rt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Vt(n),"--chip-checked-padding":rt(t,"chip-checked-padding"),"--chip-padding":rt(t,"chip-padding"),"--chip-icon-size":rt(t,"chip-icon-size"),"--chip-bg":i||r?c.background:void 0,"--chip-hover":i||r?c.hover:void 0,"--chip-color":i||r?c.color:void 0,"--chip-bd":i||r?c.border:void 0,"--chip-spacing":rt(t,"chip-spacing")}}},nd=ve((e,t)=>{const n=se("Chip",gI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,id:h,checked:m,defaultChecked:g,onChange:v,value:b,wrapperProps:S,type:w,disabled:C,children:E,size:_,variant:T,icon:R,rootRef:D,autoContrast:k,mod:M,...I}=n,z=Ie({name:"Chip",classes:v_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:vI}),V=pI(),Y=yr(h),{styleProps:W,rest:J}=Ya(I),[G,X]=Yn({value:m,defaultValue:g,finalValue:!1,onChange:v}),P=V?{checked:V.isChipSelected(b),onChange:$=>{V.onChange($),v==null||v($.currentTarget.checked)},type:V.multiple?"checkbox":"radio"}:{},L=P.checked||G;return s.jsxs(ce,{size:_,variant:T,ref:D,mod:M,...z("root"),...W,...S,children:[s.jsx("input",{type:w,...z("input"),checked:L,onChange:$=>X($.currentTarget.checked),id:Y,disabled:C,ref:t,value:b,...P,...J}),s.jsxs("label",{htmlFor:Y,"data-checked":L||void 0,"data-disabled":C||void 0,...z("label",{variant:T||"filled"}),children:[L&&s.jsx("span",{...z("iconWrapper"),children:R||s.jsx(Tp,{...z("checkIcon")})}),s.jsx("span",{children:E})]})]})});nd.classes=v_;nd.displayName="@mantine/core/Chip";nd.Group=g_;var y_={root:"m_b183c0a2"};const yI={},xI=(e,{color:t})=>({root:{"--code-bg":t?Ht(t,e):void 0}}),v0=ve((e,t)=>{const n=se("Code",yI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,color:h,block:m,variant:g,mod:v,...b}=n,S=Ie({name:"Code",props:n,classes:y_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:xI});return s.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},v],...S("root"),...b,dir:"ltr"})});v0.classes=y_;v0.displayName="@mantine/core/Code";var x_={root:"m_7485cace"};const bI={},SI=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:rt(t,"container-size")}}),y0=ve((e,t)=>{const n=se("Container",bI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,fluid:h,mod:m,...g}=n,v=Ie({name:"Container",classes:x_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:SI});return s.jsx(ce,{ref:t,mod:[{fluid:h},m],...v("root"),...g})});y0.classes=x_;y0.displayName="@mantine/core/Container";const wI={timeout:1e3};function b_(e){const{children:t,timeout:n,value:r,...i}=se("CopyButton",wI,e),o=xR({timeout:n}),c=()=>o.copy(r);return s.jsx(s.Fragment,{children:t({copy:c,copied:o.copied,...i})})}b_.displayName="@mantine/core/CopyButton";var S_={root:"m_3eebeb36",label:"m_9e365f20"};const jI={orientation:"horizontal"},CI=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Ht(t,e):void 0,"--divider-border-style":n,"--divider-size":rt(r,"divider-size")}}),Cn=ve((e,t)=>{const n=se("Divider",jI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,color:h,orientation:m,label:g,labelPosition:v,mod:b,...S}=n,w=Ie({name:"Divider",classes:S_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:CI});return s.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...w("root"),...S,role:"separator",children:g&&s.jsx(ce,{component:"span",mod:{position:v},...w("label"),children:g})})});Cn.classes=S_;Cn.displayName="@mantine/core/Divider";function EI({open:e,close:t,openDelay:n,closeDelay:r}){const i=y.useRef(-1),o=y.useRef(-1),c=()=>{window.clearTimeout(i.current),window.clearTimeout(o.current)},u=()=>{c(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():o.current=window.setTimeout(t,r)};return y.useEffect(()=>c,[]),{openDropdown:u,closeDropdown:f}}const[LC,w_]=vr("Grid component was not found in tree"),Ny=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,$C=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Ny(e,t),zC=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},UC=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function TI({span:e,order:t,offset:n,selector:r}){var b;const i=Sn(),o=w_(),c=o.breakpoints||i.breakpoints,f=Ai(e)===void 0?12:Ai(e),h=Go({"--col-order":(b=Ai(t))==null?void 0:b.toString(),"--col-flex-grow":zC(f,o.grow),"--col-flex-basis":Ny(f,o.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":$C(f,o.columns,o.grow),"--col-offset":UC(Ai(n),o.columns)}),m=sn(c).reduce((S,w)=>{var C;return S[w]||(S[w]={}),typeof t=="object"&&t[w]!==void 0&&(S[w]["--col-order"]=(C=t[w])==null?void 0:C.toString()),typeof e=="object"&&e[w]!==void 0&&(S[w]["--col-flex-grow"]=zC(e[w],o.grow),S[w]["--col-flex-basis"]=Ny(e[w],o.columns),S[w]["--col-width"]=e[w]==="content"?"auto":void 0,S[w]["--col-max-width"]=$C(e[w],o.columns,o.grow)),typeof n=="object"&&n[w]!==void 0&&(S[w]["--col-offset"]=UC(n[w],o.columns)),S},{}),v=Zu(sn(m),c).filter(S=>sn(m[S.value]).length>0).map(S=>({query:o.type==="container"?`mantine-grid (min-width: ${c[S.value]})`:`(min-width: ${c[S.value]})`,styles:m[S.value]}));return s.jsx(Zs,{styles:h,media:o.type==="container"?void 0:v,container:o.type==="container"?v:void 0,selector:r})}var x0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const RI={span:12},b0=ve((e,t)=>{const n=se("GridCol",RI,e),{classNames:r,className:i,style:o,styles:c,vars:u,span:f,order:h,offset:m,...g}=n,v=w_(),b=hd();return s.jsxs(s.Fragment,{children:[s.jsx(TI,{selector:`.${b}`,span:f,order:h,offset:m}),s.jsx(ce,{ref:t,...v.getStyles("col",{className:Ut(i,b),style:o,classNames:r,styles:c}),...g})]})});b0.classes=x0;b0.displayName="@mantine/core/GridCol";function BC({gutter:e,selector:t,breakpoints:n,type:r}){const i=Sn(),o=n||i.breakpoints,c=Go({"--grid-gutter":Nn(Ai(e))}),u=sn(o).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=Nn(e[g])),m),{}),h=Zu(sn(u),o).filter(m=>sn(u[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${o[m.value]})`:`(min-width: ${o[m.value]})`,styles:u[m.value]}));return s.jsx(Zs,{styles:c,media:r==="container"?void 0:h,container:r==="container"?h:void 0,selector:t})}const _I={gutter:"md",grow:!1,columns:12},DI=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),or=ve((e,t)=>{const n=se("Grid",_I,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,grow:h,gutter:m,columns:g,align:v,justify:b,children:S,breakpoints:w,type:C,...E}=n,_=Ie({name:"Grid",classes:x0,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:DI}),T=hd();return C==="container"&&w?s.jsxs(LC,{value:{getStyles:_,grow:h,columns:g||12,breakpoints:w,type:C},children:[s.jsx(BC,{selector:`.${T}`,...n}),s.jsx("div",{..._("container"),children:s.jsx(ce,{ref:t,..._("root",{className:T}),...E,children:s.jsx("div",{..._("inner"),children:S})})})]}):s.jsxs(LC,{value:{getStyles:_,grow:h,columns:g||12,breakpoints:w,type:C},children:[s.jsx(BC,{selector:`.${T}`,...n}),s.jsx(ce,{ref:t,..._("root",{className:T}),...E,children:s.jsx("div",{..._("inner"),children:S})})]})});or.classes=x0;or.displayName="@mantine/core/Grid";or.Col=b0;function Oh(){return Oh=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},Oh.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 AI=y.useLayoutEffect,kI=function(t){var n=En.useRef(t);return AI(function(){n.current=t}),n},VC=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},PI=function(t,n){var r=En.useRef();return En.useCallback(function(i){t.current=i,r.current&&VC(r.current,null),r.current=n,n&&VC(n,i)},[n])},FC={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},NI=function(t){Object.keys(FC).forEach(function(n){t.style.setProperty(n,FC[n],"important")})},HC=NI,fr=null,qC=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function OI(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),fr||(fr=document.createElement("textarea"),fr.setAttribute("tabindex","-1"),fr.setAttribute("aria-hidden","true"),HC(fr)),fr.parentNode===null&&document.body.appendChild(fr);var i=e.paddingSize,o=e.borderSize,c=e.sizingStyle,u=c.boxSizing;Object.keys(c).forEach(function(v){var b=v;fr.style[b]=c[b]}),HC(fr),fr.value=t;var f=qC(fr,e);fr.value=t,f=qC(fr,e),fr.value="x";var h=fr.scrollHeight-i,m=h*n;u==="border-box"&&(m=m+i+o),f=Math.max(m,f);var g=h*r;return u==="border-box"&&(g=g+i+o),f=Math.min(g,f),[f,h]}var GC=function(){},MI=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},II=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],LI=!!document.documentElement.currentStyle,$I=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=MI(II,n),i=r.boxSizing;if(i==="")return null;LI&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:c}},zI=$I;function w0(e,t,n){var r=kI(n);y.useLayoutEffect(function(){var i=function(c){return r.current(c)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var UI=function(t,n){w0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},BI=function(t){w0(window,"resize",t)},VI=function(t){w0(document.fonts,"loadingdone",t)},FI=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],HI=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,c=t.onChange,u=c===void 0?GC:c,f=t.onHeightChange,h=f===void 0?GC:f,m=S0(t,FI),g=m.value!==void 0,v=y.useRef(null),b=PI(v,n),S=y.useRef(0),w=y.useRef(),C=function(){var T=v.current,R=r&&w.current?w.current:zI(T);if(R){w.current=R;var D=OI(R,T.value||T.placeholder||"x",o,i),k=D[0],M=D[1];S.current!==k&&(S.current=k,T.style.setProperty("height",k+"px","important"),h(k,{rowHeight:M}))}},E=function(T){g||C(),u(T)};return y.useLayoutEffect(C),UI(v,function(){if(!g){var _=v.current.value;requestAnimationFrame(function(){var T=v.current;T&&_!==T.value&&C()})}}),BI(C),VI(C),y.createElement("textarea",Oh({},m,{onChange:E,ref:b}))},qI=y.forwardRef(HI);const GI={},el=ve((e,t)=>{const{autosize:n,maxRows:r,minRows:i,__staticSelector:o,resize:c,...u}=se("Textarea",GI,e),f=n&&TR()!=="test",h=f?{maxRows:r,minRows:i}:{};return s.jsx(Nr,{component:f?qI:"textarea",ref:t,...u,__staticSelector:o||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...h})});el.classes=Nr.classes;el.displayName="@mantine/core/Textarea";function WC(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const WI={serialize:JSON.stringify,deserialize:JSON.parse},Dc=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,formatOnBlur:o,validationError:c,serialize:u,deserialize:f,onFocus:h,onBlur:m,readOnly:g,error:v,...b}=se("JsonInput",WI,e),[S,w]=Yn({value:n,defaultValue:r,finalValue:"",onChange:i}),[C,E]=y.useState(WC(S,f)),_=R=>{h==null||h(R),E(!0)},T=R=>{typeof m=="function"&&m(R);const D=WC(R.currentTarget.value,f);o&&!g&&D&&R.currentTarget.value.trim()!==""&&w(u(f(R.currentTarget.value),null,2)),E(D)};return s.jsx(el,{value:S,onChange:R=>w(R.currentTarget.value),onFocus:_,onBlur:T,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?v:c||!0,"data-monospace":!0})});Dc.classes=Nr.classes;Dc.displayName="@mantine/core/JsonInput";const[QI,YI]=vr("List component was not found in tree");var j0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const XI={},C0=ve((e,t)=>{const n=se("ListItem",XI,e),{classNames:r,className:i,style:o,styles:c,vars:u,icon:f,children:h,mod:m,...g}=n,v=YI(),b=f||v.icon,S={classNames:r,styles:c};return s.jsx(ce,{...v.getStyles("item",{...S,className:i,style:o}),component:"li",mod:[{"with-icon":!!b,centered:v.center},m],ref:t,...g,children:s.jsxs("div",{...v.getStyles("itemWrapper",S),children:[b&&s.jsx("span",{...v.getStyles("itemIcon",S),children:b}),s.jsx("span",{...v.getStyles("itemLabel",S),children:h})]})})});C0.classes=j0;C0.displayName="@mantine/core/ListItem";const KI={type:"unordered"},ZI=(e,{size:t,spacing:n})=>({root:{"--list-fz":On(t),"--list-lh":yR(t),"--list-spacing":Nn(n)}}),mr=ve((e,t)=>{const n=se("List",KI,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,children:h,type:m,withPadding:g,icon:v,spacing:b,center:S,listStyleType:w,mod:C,...E}=n,_=Ie({name:"List",classes:j0,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:ZI});return s.jsx(QI,{value:{center:S,icon:v,getStyles:_},children:s.jsx(ce,{..._("root",{style:{listStyleType:w}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g},C],ref:t,...E,children:h})})});mr.classes=j0;mr.displayName="@mantine/core/List";mr.Item=C0;var j_={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const QC={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Qr("overlay")},JI=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),Dp=ve((e,t)=>{const n=se("LoadingOverlay",QC,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,transitionProps:h,loaderProps:m,overlayProps:g,visible:v,zIndex:b,...S}=n,w=Sn(),C=Ie({name:"LoadingOverlay",classes:j_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:JI}),E={...QC.overlayProps,...g};return s.jsx(fa,{transition:"fade",...h,mounted:!!v,children:_=>s.jsxs(ce,{...C("root",{style:_}),ref:t,...S,children:[s.jsx(kr,{...C("loader"),unstyled:u,...m}),s.jsx(fc,{...E,...C("overlay"),darkHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||w.white}),s.jsx(fc,{...E,...C("overlay"),lightHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||w.colors.dark[5]})]})})});Dp.classes=j_;Dp.displayName="@mantine/core/LoadingOverlay";const[eL,bd]=vr("Menu component was not found in the tree");var Ac={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const tL={},E0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("MenuDivider",tL,e),f=bd();return s.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:i,styles:o,classNames:n}),...u})});E0.classes=Ac;E0.displayName="@mantine/core/MenuDivider";const nL={},T0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,onMouseEnter:u,onMouseLeave:f,onKeyDown:h,children:m,...g}=se("MenuDropdown",nL,e),v=y.useRef(null),b=bd(),S=_r(h,E=>{var _,T;(E.key==="ArrowUp"||E.key==="ArrowDown")&&(E.preventDefault(),(T=(_=v.current)==null?void 0:_.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||T.focus())}),w=_r(u,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=_r(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return s.jsxs($i.Dropdown,{...g,onMouseEnter:w,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Un(t,v),...b.getStyles("dropdown",{className:r,style:i,styles:o,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[b.withInitialFocusPlaceholder&&s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});T0.classes=Ac;T0.displayName="@mantine/core/MenuDropdown";const rL={},R0=cr((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,color:u,closeMenuOnClick:f,leftSection:h,rightSection:m,children:g,disabled:v,"data-disabled":b,...S}=se("MenuItem",rL,e),w=bd(),C=Sn(),{dir:E}=Js(),_=y.useRef(null),T=w.getItemIndex(_.current),R=S,D=_r(R.onMouseLeave,()=>w.setHovered(-1)),k=_r(R.onMouseEnter,()=>w.setHovered(w.getItemIndex(_.current))),M=_r(R.onClick,()=>{b||(typeof f=="boolean"?f&&w.closeDropdownImmediately():w.closeOnItemClick&&w.closeDropdownImmediately())}),I=_r(R.onFocus,()=>w.setHovered(w.getItemIndex(_.current))),z=u?C.variantColorResolver({color:u,theme:C,variant:"light"}):void 0,V=u?hi({color:u,theme:C}):null;return s.jsxs(tr,{...S,unstyled:w.unstyled,tabIndex:w.menuItemTabIndex,onFocus:I,...w.getStyles("item",{className:r,style:i,styles:o,classNames:n}),ref:Un(_,t),role:"menuitem",disabled:v,"data-menu-item":!0,"data-disabled":v||b||void 0,"data-hovered":w.hovered===T?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:k,onMouseLeave:D,onClick:M,onKeyDown:vR({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:w.loop,dir:E,orientation:"vertical",onKeyDown:R.onKeyDown}),__vars:{"--menu-item-color":V!=null&&V.isThemeColor&&(V==null?void 0:V.shade)===void 0?`var(--mantine-color-${V.color}-6)`:z==null?void 0:z.color,"--menu-item-hover":z==null?void 0:z.hover},children:[h&&s.jsx("div",{...w.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"left",children:h}),g&&s.jsx("div",{...w.getStyles("itemLabel",{styles:o,classNames:n}),children:g}),m&&s.jsx("div",{...w.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"right",children:m})]})});R0.classes=Ac;R0.displayName="@mantine/core/MenuItem";const iL={},_0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,...u}=se("MenuLabel",iL,e),f=bd();return s.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:i,styles:o,classNames:n}),...u})});_0.classes=Ac;_0.displayName="@mantine/core/MenuLabel";const aL={refProp:"ref"},C_=y.forwardRef((e,t)=>{const{children:n,refProp:r,...i}=se("MenuTarget",aL,e);if(!qa(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const o=bd(),c=n.props,u=_r(c.onClick,()=>{o.trigger==="click"?o.toggleDropdown():o.trigger==="click-hover"&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),f=_r(c.onMouseEnter,()=>(o.trigger==="hover"||o.trigger==="click-hover")&&o.openDropdown()),h=_r(c.onMouseLeave,()=>{(o.trigger==="hover"||o.trigger==="click-hover"&&!o.openedViaClick)&&o.closeDropdown()});return s.jsx($i.Target,{refProp:r,popupType:"menu",ref:t,...i,children:y.cloneElement(n,{onClick:u,onMouseEnter:f,onMouseLeave:h,"data-expanded":o.opened?!0:void 0})})});C_.displayName="@mantine/core/MenuTarget";const oL={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Ce(e){const t=se("Menu",oL,e),{children:n,onOpen:r,onClose:i,opened:o,defaultOpened:c,trapFocus:u,onChange:f,closeOnItemClick:h,loop:m,closeOnEscape:g,trigger:v,openDelay:b,closeDelay:S,classNames:w,styles:C,unstyled:E,variant:_,vars:T,menuItemTabIndex:R,keepMounted:D,withInitialFocusPlaceholder:k,...M}=t,I=Ie({name:"Menu",classes:Ac,props:t,classNames:w,styles:C,unstyled:E}),[z,{setHovered:V,resetHovered:Y}]=dN(),[W,J]=Yn({value:o,defaultValue:c,finalValue:!1,onChange:f}),[G,X]=y.useState(!1),P=()=>{J(!1),X(!1),W&&(i==null||i())},L=()=>{J(!0),!W&&(r==null||r())},$=()=>{W?P():L()},{openDropdown:H,closeDropdown:O}=EI({open:L,close:P,closeDelay:S,openDelay:b}),U=Se=>uN("[data-menu-item]","[data-menu-dropdown]",Se),{resolvedClassNames:K,resolvedStyles:ee}=Xs({classNames:w,styles:C,props:t});return Ua(()=>{Y()},[W]),s.jsx(eL,{value:{getStyles:I,opened:W,toggleDropdown:$,getItemIndex:U,hovered:z,setHovered:V,openedViaClick:G,setOpenedViaClick:X,closeOnItemClick:h,closeDropdown:v==="click"?P:O,openDropdown:v==="click"?L:H,closeDropdownImmediately:P,loop:m,trigger:v,unstyled:E,menuItemTabIndex:R,withInitialFocusPlaceholder:k},children:s.jsx($i,{...M,opened:W,onChange:$,defaultOpened:c,trapFocus:D?!1:u,closeOnEscape:g,__staticSelector:"Menu",classNames:K,styles:ee,unstyled:E,variant:_,keepMounted:D,children:n})})}Ce.extend=e=>e;Ce.withProps=qO(Ce);Ce.classes=Ac;Ce.displayName="@mantine/core/Menu";Ce.Item=R0;Ce.Label=_0;Ce.Dropdown=T0;Ce.Target=C_;Ce.Divider=E0;const[sL,kc]=vr("Modal component was not found in tree");var Za={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const lL={},Ap=ve((e,t)=>{const n=se("ModalBody",lL,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=kc();return s.jsx(M2,{ref:t,...h.getStyles("body",{classNames:r,style:o,styles:c,className:i}),...f})});Ap.classes=Za;Ap.displayName="@mantine/core/ModalBody";const cL={},kp=ve((e,t)=>{const n=se("ModalCloseButton",cL,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=kc();return s.jsx(I2,{ref:t,...h.getStyles("close",{classNames:r,style:o,styles:c,className:i}),...f})});kp.classes=Za;kp.displayName="@mantine/core/ModalCloseButton";const uL={},Pp=ve((e,t)=>{const n=se("ModalContent",uL,e),{classNames:r,className:i,style:o,styles:c,vars:u,children:f,__hidden:h,...m}=n,g=kc(),v=g.scrollAreaComponent||w5;return s.jsx(L2,{...g.getStyles("content",{className:i,style:o,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:i,style:o,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":h||void 0,ref:t,...m,children:s.jsx(v,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});Pp.classes=Za;Pp.displayName="@mantine/core/ModalContent";const dL={},Np=ve((e,t)=>{const n=se("ModalHeader",dL,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=kc();return s.jsx($2,{ref:t,...h.getStyles("header",{classNames:r,style:o,styles:c,className:i}),...f})});Np.classes=Za;Np.displayName="@mantine/core/ModalHeader";const fL={},Op=ve((e,t)=>{const n=se("ModalOverlay",fL,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=kc();return s.jsx(z2,{ref:t,...h.getStyles("overlay",{classNames:r,style:o,styles:c,className:i}),...f})});Op.classes=Za;Op.displayName="@mantine/core/ModalOverlay";const hL={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Qr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},pL=(e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:Vt(t),"--modal-size":rt(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(i)}}),Mp=ve((e,t)=>{const n=se("ModalRoot",hL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,yOffset:h,scrollAreaComponent:m,radius:g,fullScreen:v,centered:b,xOffset:S,__staticSelector:w,...C}=n,E=Ie({name:w,classes:Za,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:pL});return s.jsx(sL,{value:{yOffset:h,scrollAreaComponent:m,getStyles:E,fullScreen:v},children:s.jsx(O2,{ref:t,...E("root"),"data-full-screen":v||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Yr.Autosize||void 0,unstyled:u,...C})})});Mp.classes=Za;Mp.displayName="@mantine/core/ModalRoot";const[mL,gL]=Ga();function E_({children:e}){const[t,n]=y.useState([]),[r,i]=y.useState(Qr("modal"));return s.jsx(mL,{value:{stack:t,addModal:(o,c)=>{n(u=>[...new Set([...u,o])]),i(u=>typeof c=="number"&&typeof u=="number"?Math.max(u,c):u)},removeModal:o=>n(c=>c.filter(u=>u!==o)),getZIndex:o=>`calc(${r} + ${t.indexOf(o)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}E_.displayName="@mantine/core/ModalStack";const vL={},Ip=ve((e,t)=>{const n=se("ModalTitle",vL,e),{classNames:r,className:i,style:o,styles:c,vars:u,...f}=n,h=kc();return s.jsx(U2,{ref:t,...h.getStyles("title",{classNames:r,style:o,styles:c,className:i}),...f})});Ip.classes=Za;Ip.displayName="@mantine/core/ModalTitle";const yL={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Qr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Bn=ve((e,t)=>{const{title:n,withOverlay:r,overlayProps:i,withCloseButton:o,closeButtonProps:c,children:u,radius:f,opened:h,stackId:m,zIndex:g,...v}=se("Modal",yL,e),b=gL(),S=!!n||o,w=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:h;return y.useEffect(()=>{b&&m&&(h?b.addModal(m,g||Qr("modal")):b.removeModal(m))},[h,m,g]),s.jsxs(Mp,{ref:t,radius:f,opened:h,zIndex:b&&m?b.getZIndex(m):g,...v,...w,children:[r&&s.jsx(Op,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...i}),s.jsxs(Pp,{radius:f,__hidden:b&&m&&h?m!==b.currentId:!1,children:[S&&s.jsxs(Np,{children:[n&&s.jsx(Ip,{children:n}),o&&s.jsx(kp,{...c})]}),s.jsx(Ap,{children:u})]})]})});Bn.classes=Za;Bn.displayName="@mantine/core/Modal";Bn.Root=Mp;Bn.Overlay=Op;Bn.Content=Pp;Bn.Body=Ap;Bn.Header=Np;Bn.Title=Ip;Bn.CloseButton=kp;Bn.Stack=E_;const[xL,D0]=Ga(),[bL,SL]=Ga();var Lp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const wL={},jL=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?rt(t):rt(n,"pg-gap")}}),A0=ve((e,t)=>{const n=se("PillGroup",wL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,disabled:m,...g}=n,v=D0(),b=(v==null?void 0:v.size)||h||void 0,S=Ie({name:"PillGroup",classes:Lp,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:jL,stylesCtx:{size:b},rootSelector:"group"});return s.jsx(bL,{value:{size:b,disabled:m},children:s.jsx(ce,{ref:t,size:b,...S("group"),...g})})});A0.classes=Lp;A0.displayName="@mantine/core/PillGroup";const CL={variant:"default"},EL=(e,{radius:t},{size:n})=>({root:{"--pill-fz":rt(n,"pill-fz"),"--pill-height":rt(n,"pill-height"),"--pill-radius":t===void 0?void 0:Vt(t)}}),Us=ve((e,t)=>{const n=se("Pill",CL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,variant:h,children:m,withRemoveButton:g,onRemove:v,removeButtonProps:b,radius:S,size:w,disabled:C,mod:E,..._}=n,T=SL(),R=D0(),D=w||(T==null?void 0:T.size)||void 0,k=(R==null?void 0:R.variant)==="filled"?"contrast":h||"default",M=Ie({name:"Pill",classes:Lp,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:EL,stylesCtx:{size:D}});return s.jsxs(ce,{component:"span",ref:t,variant:k,size:D,...M("root",{variant:k}),mod:[{"with-remove":g&&!C,disabled:C||(T==null?void 0:T.disabled)},E],..._,children:[s.jsx("span",{...M("label"),children:m}),g&&s.jsx(Qo,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:u,...b,...M("remove",{className:b==null?void 0:b.className,style:b==null?void 0:b.style}),onMouseDown:I=>{var z;I.preventDefault(),I.stopPropagation(),(z=b==null?void 0:b.onMouseDown)==null||z.call(b,I)},onClick:I=>{var z;I.stopPropagation(),v==null||v(),(z=b==null?void 0:b.onClick)==null||z.call(b,I)}})]})});Us.classes=Lp;Us.displayName="@mantine/core/Pill";Us.Group=A0;var T_={field:"m_45c4369d"};const TL={type:"visible"},k0=ve((e,t)=>{const n=se("PillsInputField",TL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,type:h,disabled:m,id:g,pointer:v,mod:b,...S}=n,w=D0(),C=Tc(),E=Ie({name:"PillsInputField",classes:T_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"field"}),_=m||(w==null?void 0:w.disabled);return s.jsx(ce,{component:"input",ref:Un(t,w==null?void 0:w.fieldRef),"data-type":h,disabled:_,mod:[{disabled:_,pointer:v},b],...E("field"),...S,id:(C==null?void 0:C.inputId)||g,"aria-invalid":w==null?void 0:w.hasError,"aria-describedby":C==null?void 0:C.describedBy,type:"text",onMouseDown:T=>!v&&T.stopPropagation()})});k0.classes=T_;k0.displayName="@mantine/core/PillsInputField";const RL={},mc=ve((e,t)=>{const n=se("PillsInput",RL,e),{children:r,onMouseDown:i,onClick:o,size:c,disabled:u,__staticSelector:f,error:h,variant:m,...g}=n,v=y.useRef(null);return s.jsx(xL,{value:{fieldRef:v,size:c,disabled:u,hasError:!!h,variant:m},children:s.jsx(Nr,{size:c,error:h,variant:m,component:"div",ref:t,onMouseDown:b=>{var S;b.preventDefault(),i==null||i(b),(S=v.current)==null||S.focus()},onClick:b=>{var w;b.preventDefault();const S=b.currentTarget.closest("fieldset");S!=null&&S.disabled||((w=v.current)==null||w.focus(),o==null||o(b))},...g,multiline:!0,disabled:u,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});mc.displayName="@mantine/core/PillsInput";mc.Field=k0;function _L({data:e,value:t}){const n=t.map(i=>i.trim().toLowerCase());return e.reduce((i,o)=>(pc(o)?i.push({group:o.group,items:o.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(o.value.toLowerCase().trim())===-1&&i.push(o),i),[])}const DL={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},$p=ve((e,t)=>{const n=se("MultiSelect",DL,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,size:h,value:m,defaultValue:g,onChange:v,onKeyDown:b,variant:S,data:w,dropdownOpened:C,defaultDropdownOpened:E,onDropdownOpen:_,onDropdownClose:T,selectFirstOptionOnChange:R,onOptionSubmit:D,comboboxProps:k,filter:M,limit:I,withScrollArea:z,maxDropdownHeight:V,searchValue:Y,defaultSearchValue:W,onSearchChange:J,readOnly:G,disabled:X,onFocus:P,onBlur:L,radius:$,rightSection:H,rightSectionWidth:O,rightSectionPointerEvents:U,rightSectionProps:K,leftSection:ee,leftSectionWidth:Se,leftSectionPointerEvents:be,leftSectionProps:xe,inputContainer:Ge,inputWrapperOrder:Me,withAsterisk:tt,labelProps:ke,descriptionProps:vt,errorProps:Lt,wrapperProps:$t,description:gt,label:At,error:rn,maxValues:Ee,searchable:De,nothingFoundMessage:We,withCheckIcon:Re,checkIconPosition:me,hidePickedOptions:ge,withErrorStyles:Ne,name:we,form:ze,id:yt,clearable:ft,clearButtonProps:Gt,hiddenInputProps:kt,placeholder:un,hiddenInputValuesDivider:jt,required:Fi,mod:Si,renderOption:ga,onRemove:Vn,onClear:wi,scrollAreaProps:Kr,chevronColor:cl,...va}=n,ro=yr(yt),Hi=Q2(w),br=Y2(Hi),qn=xd({opened:C,defaultOpened:E,onDropdownOpen:_,onDropdownClose:()=>{T==null||T(),qn.resetSelectedOption()}}),{styleProps:ya,rest:{type:io,autoComplete:ts,...ns}}=Ya(va),[F,Z]=Yn({value:m,defaultValue:g,finalValue:[],onChange:v}),[re,he]=Yn({value:Y,defaultValue:W,finalValue:"",onChange:J}),Te=Ke=>{he(Ke),qn.resetSelectedOption()},Be=Ie({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:u}),{resolvedClassNames:nt,resolvedStyles:Ue}=Xs({props:n,styles:c,classNames:r}),Ze=Ke=>{b==null||b(Ke),Ke.key===" "&&!De&&(Ke.preventDefault(),qn.toggleDropdown()),Ke.key==="Backspace"&&re.length===0&&F.length>0&&(Vn==null||Vn(F[F.length-1]),Z(F.slice(0,F.length-1)))},Je=F.map((Ke,Qt)=>{var dn,Pt;return s.jsx(Us,{withRemoveButton:!G&&!((dn=br[Ke])!=null&&dn.disabled),onRemove:()=>{Z(F.filter(Rt=>Ke!==Rt)),Vn==null||Vn(Ke)},unstyled:u,disabled:X,...Be("pill"),children:((Pt=br[Ke])==null?void 0:Pt.label)||Ke},`${Ke}-${Qt}`)});y.useEffect(()=>{R&&qn.selectFirstOption()},[R,re]);const it=s.jsx(ct.ClearButton,{...Gt,onClear:()=>{wi==null||wi(),Z([]),Te("")}}),Xe=_L({data:Hi,value:F}),st=ft&&F.length>0&&!X&&!G;return s.jsxs(s.Fragment,{children:[s.jsxs(ct,{store:qn,classNames:nt,styles:Ue,unstyled:u,size:h,readOnly:G,__staticSelector:"MultiSelect",onOptionSubmit:Ke=>{D==null||D(Ke),Te(""),qn.updateSelectedOptionIndex("selected"),F.includes(br[Ke].value)?(Z(F.filter(Qt=>Qt!==br[Ke].value)),Vn==null||Vn(br[Ke].value)):F.length<Ee&&Z([...F,br[Ke].value])},...k,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(mc,{...ya,__staticSelector:"MultiSelect",classNames:nt,styles:Ue,unstyled:u,size:h,className:i,style:o,variant:S,disabled:X,radius:$,__defaultRightSection:s.jsx(ct.Chevron,{size:h,error:rn,unstyled:u,color:cl}),__clearSection:it,__clearable:st,rightSection:H,rightSectionPointerEvents:U||(it?"all":"none"),rightSectionWidth:O,rightSectionProps:K,leftSection:ee,leftSectionWidth:Se,leftSectionPointerEvents:be,leftSectionProps:xe,inputContainer:Ge,inputWrapperOrder:Me,withAsterisk:tt,labelProps:ke,descriptionProps:vt,errorProps:Lt,wrapperProps:$t,description:gt,label:At,error:rn,withErrorStyles:Ne,__stylesApiProps:{...n,rightSectionPointerEvents:U||(st?"all":"none"),multiline:!0},pointer:!De,onClick:()=>De?qn.openDropdown():qn.toggleDropdown(),"data-expanded":qn.dropdownOpened||void 0,id:ro,required:Fi,mod:Si,children:s.jsxs(Us.Group,{disabled:X,unstyled:u,...Be("pillsList"),children:[Je,s.jsx(ct.EventsTarget,{autoComplete:ts,children:s.jsx(mc.Field,{...ns,ref:t,id:ro,placeholder:un,type:!De&&!un?"hidden":"visible",...Be("inputField"),unstyled:u,onFocus:Ke=>{P==null||P(Ke),De&&qn.openDropdown()},onBlur:Ke=>{L==null||L(Ke),qn.closeDropdown(),Te("")},onKeyDown:Ze,value:re,onChange:Ke=>{Te(Ke.currentTarget.value),De&&qn.openDropdown(),R&&qn.selectFirstOption()},disabled:X,readOnly:G||!De,pointer:!De})})]})})}),s.jsx(q7,{data:ge?Xe:Hi,hidden:G||X,filter:M,search:re,limit:I,hiddenWhenEmpty:!We,withScrollArea:z,maxDropdownHeight:V,filterOptions:De,value:F,checkIconPosition:me,withCheckIcon:Re,nothingFoundMessage:We,unstyled:u,labelId:At?`${ro}-label`:void 0,"aria-label":At?void 0:va["aria-label"],renderOption:ga,scrollAreaProps:Kr})]}),s.jsx(ct.HiddenInput,{name:we,valuesDivider:jt,value:F,form:ze,disabled:X,...kt})]})});$p.classes={...Nr.classes,...ct.classes};$p.displayName="@mantine/core/MultiSelect";function AL(e){return"group"in e}function P0({data:e}){if(AL(e)){const i=e.items.map(o=>s.jsx(P0,{data:o},o.value));return s.jsx("optgroup",{label:e.group,children:i})}const{value:t,label:n,...r}=e;return s.jsx("option",{value:e.value,...r,children:e.label},e.value)}P0.displayName="@mantine/core/NativeSelectOption";const kL={rightSectionPointerEvents:"none"},ln=ve((e,t)=>{const{data:n,children:r,size:i,error:o,rightSection:c,unstyled:u,...f}=se("NativeSelect",kL,e),h=Q2(n).map((m,g)=>s.jsx(P0,{data:m},g));return s.jsx(Nr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:i,pointer:!0,error:o,unstyled:u,rightSection:c||s.jsx(Cp,{size:i,error:o,unstyled:u}),children:r||h})});ln.classes=Nr.classes;ln.displayName="@mantine/core/NativeSelect";var R_={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const PL={withCloseButton:!0},NL=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Vt(t),"--notification-color":n?Ht(n,e):void 0}}),N0=ve((e,t)=>{const n=se("Notification",PL,e),{className:r,color:i,radius:o,loading:c,withCloseButton:u,withBorder:f,title:h,icon:m,children:g,onClose:v,closeButtonProps:b,classNames:S,style:w,styles:C,unstyled:E,variant:_,vars:T,mod:R,loaderProps:D,role:k,...M}=n,I=Ie({name:"Notification",classes:R_,props:n,className:r,style:w,classNames:S,styles:C,unstyled:E,vars:T,varsResolver:NL});return s.jsxs(ce,{...I("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},R],ref:t,variant:_,role:k||"alert",...M,children:[m&&!c&&s.jsx("div",{...I("icon"),children:m}),c&&s.jsx(kr,{size:28,color:i,...D,...I("loader")}),s.jsxs("div",{...I("body"),children:[h&&s.jsx("div",{...I("title"),children:h}),s.jsx(ce,{...I("description"),mod:{"data-with-title":!!h},children:g})]}),u&&s.jsx(Qo,{iconSize:16,color:"gray",...b,unstyled:E,onClick:v,...I("closeButton")})]})});N0.classes=R_;N0.displayName="@mantine/core/Notification";function __(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var rd;(function(e){e.event="event",e.props="prop"})(rd||(rd={}));function $o(){}function OL(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(o,c){return o===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function id(e){return!!(e||"").match(/\d/)}function ac(e){return e==null}function ML(e){return typeof e=="number"&&isNaN(e)}function D_(e){return ac(e)||ML(e)||typeof e=="number"&&!isFinite(e)}function A_(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function IL(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 LL(e,t,n){var r=IL(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function $L(e){var t=y.useRef(e);t.current=e;var n=y.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function O0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],c=i[1]||"";return{beforeDecimal:o,afterDecimal:c,hasNegation:n,addNegation:r}}function zL(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",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function k_(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function YC(e,t){return Array(t+1).join(e)}function P_(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],o=r[1];if(o=Number(o),!o)return n+i;i=i.replace(".","");var c=1+o,u=i.length;return c<0?i="0."+YC("0",Math.abs(c))+i:c>=u?i=i+YC("0",c-u):i=(i.substring(0,c)||"0")+"."+i.substring(c),n+i}function XC(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=O0(e),o=i.beforeDecimal,c=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(c||"0")),h=c.length<=t?"0."+c:f.toFixed(t),m=h.split("."),g=o;o&&Number(m[0])&&(g=o.split("").reverse().reduce(function(w,C,E){return w.length>E?(Number(w[0])+Number(C)).toString()+w.substring(1,w.length):C+w},m[0]));var v=k_(m[1]||"",t,n),b=u?"-":"",S=r?".":"";return""+b+g+S+v}function Ts(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 N_=OL(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),UL=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function BL(e,t,n){return Math.min(Math.max(e,t),n)}function Hv(e){return Math.max(e.selectionStart,e.selectionEnd)}function VL(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function FL(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function HL(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function qL(e,t,n,r,i,o,c){c===void 0&&(c=HL);var u=i.findIndex(function(R){return R}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var h=n.length,m=e.length,g={},v=new Array(h),b=0;b<h;b++){v[b]=-1;for(var S=0,w=m;S<w;S++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:S});if(C&&g[S]!==!0){v[b]=S,g[S]=!0;break}}}for(var E=r;E<h&&(v[E]===-1||!o(n[E]));)E++;var _=E===h||v[E]===-1?m:v[E];for(E=r-1;E>0&&v[E]===-1;)E--;var T=E===-1||v[E]===-1?0:v[E]+1;return T>_?_:r-T<_-r?T:_}function KC(e,t,n,r){var i=e.length;if(t=BL(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function GL(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(id(e[n])||id(e[n-1]));return t}function O_(e,t,n,r,i,o){o===void 0&&(o=$o);var c=$L(function(S,w){var C,E;return D_(S)?(E="",C=""):typeof S=="number"||w?(E=typeof S=="number"?P_(S):S,C=r(E)):(E=i(S,void 0),C=r(E)),{formattedValue:C,numAsString:E}}),u=y.useState(function(){return c(ac(e)?t:e,n)}),f=u[0],h=u[1],m=function(S,w){S.formattedValue!==f.formattedValue&&h({formattedValue:S.formattedValue,numAsString:S.value}),o(S,w)},g=e,v=n;ac(e)&&(g=f.numAsString,v=!0);var b=c(g,v);return y.useMemo(function(){h(b)},[b.formattedValue]),[f,m]}function WL(e){return e.replace(/[^0-9]/g,"")}function QL(e){return e}function YL(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,o=e.getInputRef,c=e.format;c===void 0&&(c=QL);var u=e.removeFormatting;u===void 0&&(u=WL);var f=e.defaultValue,h=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,v=e.onChange;v===void 0&&(v=$o);var b=e.onKeyDown;b===void 0&&(b=$o);var S=e.onMouseUp;S===void 0&&(S=$o);var w=e.onFocus;w===void 0&&(w=$o);var C=e.onBlur;C===void 0&&(C=$o);var E=e.value,_=e.getCaretBoundary;_===void 0&&(_=GL);var T=e.isValidInputCharacter;T===void 0&&(T=id);var R=e.isCharacterSame,D=__(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),k=O_(E,f,!!h,c,u,m),M=k[0],I=M.formattedValue,z=M.numAsString,V=k[1],Y=y.useRef(),W=y.useRef({formattedValue:I,numAsString:z}),J=function(Ee,De){W.current={formattedValue:Ee.formattedValue,numAsString:Ee.value},V(Ee,De)},G=y.useState(!1),X=G[0],P=G[1],L=y.useRef(null),$=y.useRef({setCaretTimeout:null,focusTimeout:null});y.useEffect(function(){return P(!0),function(){clearTimeout($.current.setCaretTimeout),clearTimeout($.current.focusTimeout)}},[]);var H=c,O=function(Ee,De){var We=parseFloat(De);return{formattedValue:Ee,value:De,floatValue:isNaN(We)?void 0:We}},U=function(Ee,De,We){Ee.selectionStart===0&&Ee.selectionEnd===Ee.value.length||(Ts(Ee,De),$.current.setCaretTimeout=setTimeout(function(){Ee.value===We&&Ee.selectionStart!==De&&Ts(Ee,De)},0))},K=function(Ee,De,We){return KC(Ee,De,_(Ee),We)},ee=function(Ee,De,We){var Re=_(De),me=qL(De,I,Ee,We,Re,T,R);return me=KC(De,me,Re),me},Se=function(Ee){var De=Ee.formattedValue;De===void 0&&(De="");var We=Ee.input,Re=Ee.source,me=Ee.event,ge=Ee.numAsString,Ne;if(We){var we=Ee.inputValue||We.value,ze=Hv(We);We.value=De,Ne=ee(we,De,ze),Ne!==void 0&&U(We,Ne,De)}De!==I&&J(O(De,ge),{event:me,source:Re})};y.useEffect(function(){var Ee=W.current,De=Ee.formattedValue,We=Ee.numAsString;(I!==De||z!==We)&&J(O(I,z),{event:void 0,source:rd.props})},[I,z]);var be=L.current?Hv(L.current):void 0,xe=typeof window<"u"?y.useLayoutEffect:y.useEffect;xe(function(){var Ee=L.current;if(I!==W.current.formattedValue&&Ee){var De=ee(W.current.formattedValue,I,be);Ee.value=I,U(Ee,De,I)}},[I]);var Ge=function(Ee,De,We){var Re=De.target,me=Y.current?UL(Y.current,Re.selectionEnd):N_(I,Ee),ge=Object.assign(Object.assign({},me),{lastValue:I}),Ne=u(Ee,ge),we=H(Ne);if(Ne=u(we,void 0),g&&!g(O(we,Ne))){var ze=De.target,yt=Hv(ze),ft=ee(Ee,I,yt);return ze.value=I,U(ze,ft,I),!1}return Se({formattedValue:we,numAsString:Ne,inputValue:Ee,event:De,source:We,input:De.target}),!0},Me=function(Ee,De){De===void 0&&(De=0);var We=Ee.selectionStart,Re=Ee.selectionEnd;Y.current={selectionStart:We,selectionEnd:Re+De}},tt=function(Ee){var De=Ee.target,We=De.value,Re=Ge(We,Ee,rd.event);Re&&v(Ee),Y.current=void 0},ke=function(Ee){var De=Ee.target,We=Ee.key,Re=De.selectionStart,me=De.selectionEnd,ge=De.value;ge===void 0&&(ge="");var Ne;We==="ArrowLeft"||We==="Backspace"?Ne=Math.max(Re-1,0):We==="ArrowRight"?Ne=Math.min(Re+1,ge.length):We==="Delete"&&(Ne=Re);var we=0;We==="Delete"&&Re===me&&(we=1);var ze=We==="ArrowLeft"||We==="ArrowRight";if(Ne===void 0||Re!==me&&!ze){b(Ee),Me(De,we);return}var yt=Ne;if(ze){var ft=We==="ArrowLeft"?"left":"right";yt=K(ge,Ne,ft),yt!==Ne&&Ee.preventDefault()}else We==="Delete"&&!T(ge[Ne])?yt=K(ge,Ne,"right"):We==="Backspace"&&!T(ge[Ne])&&(yt=K(ge,Ne,"left"));yt!==Ne&&U(De,yt,ge),b(Ee),Me(De,we)},vt=function(Ee){var De=Ee.target,We=function(){var Re=De.selectionStart,me=De.selectionEnd,ge=De.value;if(ge===void 0&&(ge=""),Re===me){var Ne=K(ge,Re);Ne!==Re&&U(De,Ne,ge)}};We(),requestAnimationFrame(function(){We()}),S(Ee),Me(De)},Lt=function(Ee){Ee.persist&&Ee.persist();var De=Ee.target,We=Ee.currentTarget;L.current=De,$.current.focusTimeout=setTimeout(function(){var Re=De.selectionStart,me=De.selectionEnd,ge=De.value;ge===void 0&&(ge="");var Ne=K(ge,Re);Ne!==Re&&!(Re===0&&me===ge.length)&&U(De,Ne,ge),w(Object.assign(Object.assign({},Ee),{currentTarget:We}))},0)},$t=function(Ee){L.current=null,clearTimeout($.current.focusTimeout),clearTimeout($.current.setCaretTimeout),C(Ee)},gt=X&&VL()?"numeric":void 0,At=Object.assign({inputMode:gt},D,{type:t,value:I,onChange:tt,onKeyDown:ke,onMouseUp:vt,onFocus:Lt,onBlur:$t});if(n==="text")return i?En.createElement(En.Fragment,null,i(I,D)||null):En.createElement("span",Object.assign({},D,{ref:o}),I);if(r){var rn=r;return En.createElement(rn,Object.assign({},At,{ref:o}))}return En.createElement("input",Object.assign({},At,{ref:o}))}function ZC(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var c=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=zp(t),h=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,v=O0(e,c),b=v.beforeDecimal,S=v.afterDecimal,w=v.addNegation;return n!==void 0&&(S=k_(S,n,!!r)),h&&(b=LL(b,h,u)),i&&(b=i+b),o&&(S=S+o),w&&(b="-"+b),e=b+(g&&m||"")+S,e}function zp(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 XL(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function KL(e,t){return new RegExp("(^-)|[0-9]|"+A_(e),"g")}function ZL(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function JL(e,t,n){var r;t===void 0&&(t=FL(e));var i=n.allowNegative,o=n.prefix;o===void 0&&(o="");var c=n.suffix;c===void 0&&(c="");var u=n.decimalScale,f=t.from,h=t.to,m=h.start,g=h.end,v=zp(n),b=v.allowedDecimalSeparators,S=v.decimalSeparator,w=e[g]===S;if(id(e)&&(e===o||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=u===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var E=function(L,$,H){var O=!1,U=!1;o.startsWith("-")?O=!1:L.startsWith("--")?(O=!1,U=!0):c.startsWith("-")&&L.length===c.length?O=!1:L[0]==="-"&&(O=!0);var K=O?1:0;return U&&(K=2),K&&(L=L.substring(K),$-=K,H-=K),{value:L,start:$,end:H,hasNegation:O}},_=E(e,m,g),T=_.hasNegation;r=_,e=r.value,m=r.start,g=r.end;var R=E(t.lastValue,f.start,f.end),D=R.start,k=R.end,M=R.value,I=e.substring(m,g);e.length&&M.length&&(D>M.length-c.length||k<o.length)&&!(I&&c.startsWith(I))&&(e=M);var z=0;e.startsWith(o)?z+=o.length:m<o.length&&(z=m),e=e.substring(z),g-=z;var V=e.length,Y=e.length-c.length;e.endsWith(c)?V=Y:(g>Y||g>e.length-c.length)&&(V=g),e=e.substring(0,V),e=XL(T?"-"+e:e,i),e=(e.match(KL(S))||[]).join("");var W=e.indexOf(S);e=e.replace(new RegExp(A_(S),"g"),function(L,$){return $===W?".":""});var J=O0(e,i),G=J.beforeDecimal,X=J.afterDecimal,P=J.addNegation;return h.end-h.start<f.end-f.start&&G===""&&w&&!parseFloat(X)&&(e=P?"-":""),e}function e6(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,n.length+(o?1:0));var c=e.length;return i.fill(!1,c-r.length+1,c+1),i}function t6(e){var t=zp(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
69
- Decimal separator can't be same as thousand separator.
70
- thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
71
- decimalSeparator: `+r+` (default value for decimalSeparator is .)
72
- `);return i.startsWith("-")&&o&&(console.error(`
73
- Prefix can't start with '-' when allowNegative is true.
74
- prefix: `+i+`
75
- allowNegative: `+o+`
76
- `),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function n6(e){e=t6(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=$o);var o=e.onBlur;o===void 0&&(o=$o);var c=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,h=e.prefix;h===void 0&&(h="");var m=e.defaultValue,g=e.value,v=e.valueIsNumericString,b=e.onValueChange,S=__(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),w=zp(e),C=w.decimalSeparator,E=w.allowedDecimalSeparators,_=function(P){return ZC(P,e)},T=function(P,L){return JL(P,L,e)},R=ac(g)?m:g,D=v??ZL(R,h,t);ac(g)?ac(m)||(D=D||typeof m=="number"):D=D||typeof g=="number";var k=function(P){return D_(P)?P:(typeof P=="number"&&(P=P_(P)),D&&typeof u=="number"?XC(P,u,!!f):P)},M=O_(k(g),k(m),!!D,_,T,b),I=M[0],z=I.numAsString,V=I.formattedValue,Y=M[1],W=function(P){var L=P.target,$=P.key,H=L.selectionStart,O=L.selectionEnd,U=L.value;if(U===void 0&&(U=""),($==="Backspace"||$==="Delete")&&O<h.length){P.preventDefault();return}if(H!==O){i(P);return}$==="Backspace"&&U[0]==="-"&&H===h.length+1&&n&&Ts(L,1),u&&f&&($==="Backspace"&&U[H-1]===C?(Ts(L,H-1),P.preventDefault()):$==="Delete"&&U[H]===C&&P.preventDefault()),E!=null&&E.includes($)&&U[H]===C&&Ts(L,H+1);var K=c===!0?",":c;$==="Backspace"&&U[H-1]===K&&Ts(L,H-1),$==="Delete"&&U[H]===K&&Ts(L,H+1),i(P)},J=function(P){var L=z;if(L.match(/\d/g)||(L=""),r||(L=zL(L)),f&&u&&(L=XC(L,u,f)),L!==z){var $=ZC(L,e);Y({formattedValue:$,value:L,floatValue:parseFloat(L)},{event:P,source:rd.event})}o(P)},G=function(P){return P===C?!0:id(P)},X=function(P){var L=P.currentValue,$=P.lastValue,H=P.formattedValue,O=P.currentValueIndex,U=P.formattedValueIndex,K=L[O],ee=H[U],Se=N_($,L),be=Se.to,xe=function(Ge){return T(Ge).indexOf(".")+h.length};return g===0&&f&&u&&L[be.start]===C&&xe(L)<O&&xe(H)>U?!1:O>=be.start&&O<be.end&&E&&E.includes(K)&&ee===C?!0:K===ee};return Object.assign(Object.assign({},S),{value:V,valueIsNumericString:!1,isValidInputCharacter:G,isCharacterSame:X,onValueChange:Y,format:_,removeFormatting:T,getCaretBoundary:function(P){return e6(P,e)},onKeyDown:W,onBlur:J})}function r6(e){var t=n6(e);return En.createElement(YL,Object.assign({},t))}function JC({direction:e,style:t,...n}){return s.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:e==="up"?"rotate(180deg)":void 0,...t},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:s.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var Oy={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const i6=/^(0\.0*|-0(\.0*)?)$/,a6=/^-?0\d+(\.\d+)?\.?$/;function My(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function qv(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||My(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function o6(e){return e.toString().replace(".","").length}function s6(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&o6(t)<14&&t!==""}function eE(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,i=n===void 0||e<=n;return r&&i}const l6={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},c6=(e,{size:t})=>({controls:{"--ni-chevron-size":rt(t,"ni-chevron-size")}});function u6(e,t,n){const r=e.toString().replace(/^0+/,""),i=parseFloat(r);return Number.isNaN(i)?r:i>Number.MAX_SAFE_INTEGER?t!==void 0?String(t):r:mh(i,n,t)}const Up=ve((e,t)=>{const n=se("NumberInput",l6,e),{className:r,classNames:i,styles:o,unstyled:c,vars:u,onChange:f,onValueChange:h,value:m,defaultValue:g,max:v,min:b,step:S,hideControls:w,rightSection:C,isAllowed:E,clampBehavior:_,onBlur:T,allowDecimal:R,decimalScale:D,onKeyDown:k,onKeyDownCapture:M,handlersRef:I,startValue:z,disabled:V,rightSectionPointerEvents:Y,allowNegative:W,readOnly:J,size:G,rightSectionWidth:X,stepHoldInterval:P,stepHoldDelay:L,allowLeadingZeros:$,withKeyboardEvents:H,trimLeadingZeroesOnBlur:O,...U}=n,K=Ie({name:"NumberInput",classes:Oy,props:n,classNames:i,styles:o,unstyled:c,vars:u,varsResolver:c6}),{resolvedClassNames:ee,resolvedStyles:Se}=Xs({classNames:i,styles:o,props:n}),[be,xe]=Yn({value:m,defaultValue:g,finalValue:"",onChange:f}),Ge=L!==void 0&&P!==void 0,Me=y.useRef(null),tt=y.useRef(null),ke=y.useRef(0),vt=(we,ze)=>{ze.source==="event"&&xe(s6(we.floatValue,we.value)&&!i6.test(we.value)&&!($&&a6.test(we.value))?we.floatValue:we.value),h==null||h(we,ze)},Lt=we=>{const ze=String(we).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return ze?Math.max(0,(ze[1]?ze[1].length:0)-(ze[2]?+ze[2]:0)):0},$t=we=>{Me.current&&typeof we<"u"&&Me.current.setSelectionRange(we,we)},gt=y.useRef(Rh);gt.current=()=>{if(!qv(be))return;let we;const ze=Lt(be),yt=Lt(S),ft=Math.max(ze,yt),Gt=10**ft;if(!My(be)&&(typeof be!="number"||Number.isNaN(be)))we=mh(z,b,v);else if(v!==void 0){const un=(Math.round(Number(be)*Gt)+Math.round(S*Gt))/Gt;we=un<=v?un:v}else we=(Math.round(Number(be)*Gt)+Math.round(S*Gt))/Gt;const kt=we.toFixed(ft);xe(parseFloat(kt)),h==null||h({floatValue:parseFloat(kt),formattedValue:kt,value:kt},{source:"increment"}),setTimeout(()=>{var un;return $t((un=Me.current)==null?void 0:un.value.length)},0)};const At=y.useRef(Rh);At.current=()=>{if(!qv(be))return;let we;const ze=b!==void 0?b:W?Number.MIN_SAFE_INTEGER:0,yt=Lt(be),ft=Lt(S),Gt=Math.max(yt,ft),kt=10**Gt;if(!My(be)&&typeof be!="number"||Number.isNaN(be))we=mh(z,ze,v);else{const jt=(Math.round(Number(be)*kt)-Math.round(S*kt))/kt;we=ze!==void 0&&jt<ze?ze:jt}const un=we.toFixed(Gt);xe(parseFloat(un)),h==null||h({floatValue:parseFloat(un),formattedValue:un,value:un},{source:"decrement"}),setTimeout(()=>{var jt;return $t((jt=Me.current)==null?void 0:jt.value.length)},0)};const rn=we=>{k==null||k(we),!(J||!H)&&(we.key==="ArrowUp"&&(we.preventDefault(),gt.current()),we.key==="ArrowDown"&&(we.preventDefault(),At.current()))},Ee=we=>{if(M==null||M(we),we.key==="Backspace"){const ze=Me.current;ze.selectionStart===0&&ze.selectionStart===ze.selectionEnd&&(we.preventDefault(),window.setTimeout(()=>$t(0),0))}},De=we=>{let ze=be;_==="blur"&&typeof ze=="number"&&(ze=mh(ze,b,v)),O&&typeof ze=="string"&&Lt(ze)<15&&(ze=u6(ze,v,b)),be!==ze&&xe(ze),T==null||T(we)};Ju(I,{increment:gt.current,decrement:At.current});const We=we=>{we?gt.current():At.current(),ke.current+=1},Re=we=>{if(We(we),Ge){const ze=typeof P=="number"?P:P(ke.current);tt.current=window.setTimeout(()=>Re(we),ze)}},me=(we,ze)=>{var yt;we.preventDefault(),(yt=Me.current)==null||yt.focus(),We(ze),Ge&&(tt.current=window.setTimeout(()=>Re(ze),L))},ge=()=>{tt.current&&window.clearTimeout(tt.current),tt.current=null,ke.current=0},Ne=s.jsxs("div",{...K("controls"),children:[s.jsx(tr,{...K("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof be=="number"&&v!==void 0&&be>=v,mod:{direction:"up"},onMouseDown:we=>we.preventDefault(),onPointerDown:we=>{me(we,!0)},onPointerUp:ge,onPointerLeave:ge,children:s.jsx(JC,{direction:"up"})}),s.jsx(tr,{...K("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof be=="number"&&b!==void 0&&be<=b,mod:{direction:"down"},onMouseDown:we=>we.preventDefault(),onPointerDown:we=>{me(we,!1)},onPointerUp:ge,onPointerLeave:ge,children:s.jsx(JC,{direction:"down"})})]});return s.jsx(Nr,{component:r6,allowNegative:W,className:Ut(Oy.root,r),size:G,...U,readOnly:J,disabled:V,value:be,getInputRef:Un(t,Me),onValueChange:vt,rightSection:w||J||!qv(be)?C:C||Ne,classNames:ee,styles:Se,unstyled:c,__staticSelector:"NumberInput",decimalScale:R?D:0,onKeyDown:rn,onKeyDownCapture:Ee,rightSectionPointerEvents:Y??(V?"none":void 0),rightSectionWidth:X??`var(--ni-right-section-width-${G||"sm"})`,allowLeadingZeros:$,onBlur:De,isAllowed:we=>_==="strict"?E?E(we)&&eE(we.floatValue,b,v):eE(we.floatValue,b,v):E?E(we):!0})});Up.classes={...Nr.classes,...Oy};Up.displayName="@mantine/core/NumberInput";const[d6,Bp]=vr("Pagination.Root component was not found in tree");var Sd={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const f6={withPadding:!0},wd=ve((e,t)=>{const n=se("PaginationControl",f6,e),{classNames:r,className:i,style:o,styles:c,vars:u,active:f,disabled:h,withPadding:m,mod:g,...v}=n,b=Bp(),S=h||b.disabled;return s.jsx(tr,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...b.getStyles("control",{className:i,style:o,classNames:r,styles:c,active:!S}),...v})});wd.classes=Sd;wd.displayName="@mantine/core/PaginationControl";function jd({style:e,children:t,path:n,...r}){return s.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...e},...r,children:s.jsx("path",{d:n,fill:"currentColor"})})}const h6=e=>s.jsx(jd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),p6=e=>s.jsx(jd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),m6=e=>s.jsx(jd,{...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"}),g6=e=>s.jsx(jd,{...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"}),v6=e=>s.jsx(jd,{...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"}),y6={icon:v6},Vp=ve((e,t)=>{const n=se("PaginationDots",y6,e),{classNames:r,className:i,style:o,styles:c,vars:u,icon:f,...h}=n,m=Bp(),g=f;return s.jsx(ce,{ref:t,...m.getStyles("dots",{className:i,style:o,styles:c,classNames:r}),...h,children:s.jsx(g,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Vp.classes=Sd;Vp.displayName="@mantine/core/PaginationDots";function Fp({icon:e,name:t,action:n,type:r}){const i={icon:e},o=y.forwardRef((c,u)=>{const{icon:f,...h}=se(t,i,c),m=f,g=Bp(),v=r==="next"?g.active===g.total:g.active===1;return s.jsx(wd,{disabled:g.disabled||v,ref:u,onClick:g[n],withPadding:!1,...h,children:s.jsx(m,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return o.displayName=`@mantine/core/${t}`,o}const M_=Fp({icon:h6,name:"PaginationNext",action:"onNext",type:"next"}),I_=Fp({icon:p6,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),L_=Fp({icon:m6,name:"PaginationFirst",action:"onFirst",type:"previous"}),$_=Fp({icon:g6,name:"PaginationLast",action:"onLast",type:"next"});function M0({dotsIcon:e}){const t=Bp(),n=t.range.map((r,i)=>{var o,c,u;return r==="dots"?s.jsx(Vp,{icon:e},i):s.jsx(wd,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(o=t.getItemProps)==null?void 0:o.call(t,r),children:((u=(c=t.getItemProps)==null?void 0:c.call(t,r))==null?void 0:u.children)??r},i)});return s.jsx(s.Fragment,{children:n})}M0.displayName="@mantine/core/PaginationItems";const x6={siblings:1,boundaries:1},b6=(e,{size:t,radius:n,color:r,autoContrast:i})=>({root:{"--pagination-control-radius":n===void 0?void 0:Vt(n),"--pagination-control-size":rt(t,"pagination-control-size"),"--pagination-control-fz":On(t),"--pagination-active-bg":r?Ht(r,e):void 0,"--pagination-active-color":Ks(i,e)?Qa({color:r,theme:e,autoContrast:i}):void 0}}),Hp=ve((e,t)=>{const n=se("PaginationRoot",x6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,total:h,value:m,defaultValue:g,onChange:v,disabled:b,siblings:S,boundaries:w,color:C,radius:E,onNextPage:_,onPreviousPage:T,onFirstPage:R,onLastPage:D,getItemProps:k,autoContrast:M,...I}=n,z=Ie({name:"Pagination",classes:Sd,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:b6}),{range:V,setPage:Y,next:W,previous:J,active:G,first:X,last:P}=_N({page:m,initialPage:g,onChange:v,total:h,siblings:S,boundaries:w}),L=_r(_,W),$=_r(T,J),H=_r(R,X),O=_r(D,P);return s.jsx(d6,{value:{total:h,range:V,active:G,disabled:b,getItemProps:k,onChange:Y,onNext:L,onPrevious:$,onFirst:H,onLast:O,getStyles:z},children:s.jsx(ce,{ref:t,...z("root"),...I})})});Hp.classes=Sd;Hp.displayName="@mantine/core/PaginationRoot";const S6={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},zi=ve((e,t)=>{const n=se("Pagination",S6,e),{withEdges:r,withControls:i,getControlProps:o,nextIcon:c,previousIcon:u,lastIcon:f,firstIcon:h,dotsIcon:m,total:g,gap:v,hideWithOnePage:b,withPages:S,...w}=n;return g<=0||b&&g===1?null:s.jsx(Hp,{ref:t,total:g,...w,children:s.jsxs(je,{gap:v,children:[r&&s.jsx(L_,{icon:h,...o==null?void 0:o("first")}),i&&s.jsx(I_,{icon:u,...o==null?void 0:o("previous")}),S&&s.jsx(M0,{dotsIcon:m}),i&&s.jsx(M_,{icon:c,...o==null?void 0:o("next")}),r&&s.jsx($_,{icon:f,...o==null?void 0:o("last")})]})})});zi.classes=Sd;zi.displayName="@mantine/core/Pagination";zi.Root=Hp;zi.Control=wd;zi.Dots=Vp;zi.First=L_;zi.Last=$_;zi.Next=M_;zi.Previous=I_;zi.Items=M0;const w6=({reveal:e})=>s.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:s.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var Iy={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const j6={visibilityToggleIcon:w6},C6=(e,{size:t})=>({root:{"--psi-icon-size":rt(t,"psi-icon-size"),"--psi-button-size":rt(t,"psi-button-size")}}),Ni=ve((e,t)=>{const n=se("PasswordInput",j6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,required:h,error:m,leftSection:g,disabled:v,id:b,variant:S,inputContainer:w,description:C,label:E,size:_,errorProps:T,descriptionProps:R,labelProps:D,withAsterisk:k,inputWrapperOrder:M,wrapperProps:I,radius:z,rightSection:V,rightSectionWidth:Y,rightSectionPointerEvents:W,leftSectionWidth:J,visible:G,defaultVisible:X,onVisibilityChange:P,visibilityToggleIcon:L,visibilityToggleButtonProps:$,rightSectionProps:H,leftSectionProps:O,leftSectionPointerEvents:U,withErrorStyles:K,mod:ee,...Se}=n,be=yr(b),[xe,Ge]=Yn({value:G,defaultValue:X,finalValue:!1,onChange:P}),Me=()=>Ge(!xe),tt=Ie({name:"PasswordInput",classes:Iy,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:C6}),{resolvedClassNames:ke,resolvedStyles:vt}=Xs({classNames:r,styles:c,props:n}),{styleProps:Lt,rest:$t}=Ya(Se),gt=L,At=(T==null?void 0:T.id)||`${be}-error`,rn=(R==null?void 0:R.id)||`${be}-description`,We=`${!!m&&typeof m!="boolean"?At:""} ${!!C?rn:""}`,Re=We.trim().length>0?We.trim():void 0,me=s.jsx(An,{...tt("visibilityToggle"),disabled:v,radius:z,"aria-hidden":!$,tabIndex:-1,...$,variant:($==null?void 0:$.variant)??"subtle",color:"gray",unstyled:u,onTouchEnd:ge=>{var Ne;ge.preventDefault(),(Ne=$==null?void 0:$.onTouchEnd)==null||Ne.call($,ge),Me()},onMouseDown:ge=>{var Ne;ge.preventDefault(),(Ne=$==null?void 0:$.onMouseDown)==null||Ne.call($,ge),Me()},onKeyDown:ge=>{var Ne;(Ne=$==null?void 0:$.onKeyDown)==null||Ne.call($,ge),ge.key===" "&&(ge.preventDefault(),Me())},children:s.jsx(gt,{reveal:xe})});return s.jsx(mn.Wrapper,{required:h,id:be,label:E,error:m,description:C,size:_,classNames:ke,styles:vt,__staticSelector:"PasswordInput",unstyled:u,withAsterisk:k,inputWrapperOrder:M,inputContainer:w,variant:S,labelProps:{...D,htmlFor:be},descriptionProps:{...R,id:rn},errorProps:{...T,id:At},mod:ee,...tt("root"),...Lt,...I,children:s.jsx(mn,{component:"div",error:m,leftSection:g,size:_,classNames:{...ke,input:Ut(Iy.input,ke.input)},styles:vt,radius:z,disabled:v,__staticSelector:"PasswordInput",rightSectionWidth:Y,rightSection:V??me,variant:S,unstyled:u,leftSectionWidth:J,rightSectionPointerEvents:W||"all",rightSectionProps:H,leftSectionProps:O,leftSectionPointerEvents:U,withAria:!1,withErrorStyles:K,children:s.jsx("input",{required:h,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...tt("innerInput"),disabled:v,id:be,ref:t,...$t,"aria-describedby":Re,autoComplete:$t.autoComplete||"off",type:xe?"text":"password"})})})});Ni.classes={...Nr.classes,...Iy};Ni.displayName="@mantine/core/PasswordInput";const[E6,z_]=Ga(),[T6,R6]=Ga();var U_={card:"m_9dc8ae12"};const _6={withBorder:!0},D6=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),I0=ve((e,t)=>{const n=se("RadioCard",_6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,checked:h,mod:m,withBorder:g,value:v,onClick:b,name:S,onKeyDown:w,...C}=n,E=Ie({name:"RadioCard",classes:U_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:D6,rootSelector:"card"}),{dir:_}=Js(),T=z_(),R=typeof h=="boolean"?h:(T==null?void 0:T.value)===v||!1,D=S||(T==null?void 0:T.name),k=M=>{if(w==null||w(M),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(M.nativeEvent.code)){M.preventDefault();const I=Array.from(document.querySelectorAll(`[role="radio"][name="${D||"__mantine"}"]`)),z=I.findIndex(W=>W===M.target),V=z+1>=I.length?0:z+1,Y=z-1<0?I.length-1:z-1;M.nativeEvent.code==="ArrowDown"&&(I[V].focus(),I[V].click()),M.nativeEvent.code==="ArrowUp"&&(I[Y].focus(),I[Y].click()),M.nativeEvent.code==="ArrowLeft"&&(I[_==="ltr"?Y:V].focus(),I[_==="ltr"?Y:V].click()),M.nativeEvent.code==="ArrowRight"&&(I[_==="ltr"?V:Y].focus(),I[_==="ltr"?V:Y].click())}};return s.jsx(T6,{value:{checked:R},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:R},m],...E("card"),...C,role:"radio","aria-checked":R,name:D,onClick:M=>{b==null||b(M),T==null||T.onChange(v||"")},onKeyDown:k})})});I0.displayName="@mantine/core/RadioCard";I0.classes=U_;const A6={},L0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:o,wrapperProps:c,children:u,name:f,readOnly:h,...m}=se("RadioGroup",A6,e),g=yr(f),[v,b]=Yn({value:n,defaultValue:r,finalValue:"",onChange:i}),S=w=>!h&&b(typeof w=="string"?w:w.currentTarget.value);return s.jsx(E6,{value:{value:v,onChange:S,size:o,name:g},children:s.jsx(mn.Wrapper,{size:o,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(u0,{role:"radiogroup",children:u})})})});L0.classes=mn.Wrapper.classes;L0.displayName="@mantine/core/RadioGroup";function B_({size:e,style:t,...n}){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:le(e),height:le(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var V_={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const k6={icon:B_},P6=(e,{radius:t,color:n,size:r,iconColor:i,variant:o,autoContrast:c})=>{const u=hi({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--radio-size":rt(r,"radio-size"),"--radio-radius":t===void 0?void 0:Vt(t),"--radio-color":o==="outline"?f:Ht(n,e),"--radio-icon-size":rt(r,"radio-icon-size"),"--radio-icon-color":i?Ht(i,e):Ks(c,e)?Qa({color:n,theme:e,autoContrast:c}):void 0}}},$0=ve((e,t)=>{const n=se("RadioIndicator",k6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,icon:h,radius:m,color:g,iconColor:v,autoContrast:b,checked:S,mod:w,variant:C,disabled:E,..._}=n,T=h,R=Ie({name:"RadioIndicator",classes:V_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:P6,rootSelector:"indicator"}),D=R6(),k=typeof S=="boolean"?S:(D==null?void 0:D.checked)||!1;return s.jsx(ce,{ref:t,...R("indicator",{variant:C}),variant:C,mod:[{checked:k,disabled:E},w],..._,children:s.jsx(T,{...R("icon")})})});$0.displayName="@mantine/core/RadioIndicator";$0.classes=V_;var F_={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const N6={labelPosition:"right"},O6=(e,{size:t,radius:n,color:r,iconColor:i,variant:o,autoContrast:c})=>{const u=hi({color:r||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--radio-size":rt(t,"radio-size"),"--radio-radius":n===void 0?void 0:Vt(n),"--radio-color":o==="outline"?f:Ht(r,e),"--radio-icon-color":i?Ht(i,e):Ks(c,e)?Qa({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":rt(t,"radio-icon-size")}}},Bs=ve((e,t)=>{const n=se("Radio",N6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,id:h,size:m,label:g,labelPosition:v,description:b,error:S,radius:w,color:C,variant:E,disabled:_,wrapperProps:T,icon:R=B_,rootRef:D,iconColor:k,onChange:M,mod:I,...z}=n,V=Ie({name:"Radio",classes:F_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:O6}),Y=z_(),W=(Y==null?void 0:Y.size)??m,J=n.size?m:W,{styleProps:G,rest:X}=Ya(z),P=yr(h),L=Y?{checked:Y.value===X.value,name:X.name??Y.name,onChange:$=>{Y.onChange($),M==null||M($)}}:{};return s.jsx(Ep,{...V("root"),__staticSelector:"Radio",__stylesApiProps:n,id:P,size:J,labelPosition:v,label:g,description:b,error:S,disabled:_,classNames:r,styles:c,unstyled:u,"data-checked":L.checked||void 0,variant:E,ref:D,mod:I,...G,...T,children:s.jsxs(ce,{...V("inner"),mod:{"label-position":v},children:[s.jsx(ce,{...V("radio",{focusable:!0,variant:E}),onChange:M,...X,...L,component:"input",mod:{error:!!S},ref:t,id:P,disabled:_,type:"radio"}),s.jsx(R,{...V("icon"),"aria-hidden":!0})]})})});Bs.classes=F_;Bs.displayName="@mantine/core/Radio";Bs.Group=L0;Bs.Card=I0;Bs.Indicator=$0;const M6={duration:100,transition:"fade"};function I6(e,t){return{...M6,...t,...e}}function L6({offset:e,position:t,defaultOpened:n}){const[r,i]=y.useState(n),o=y.useRef(null),{x:c,y:u,elements:f,refs:h,update:m,placement:g}=Lx({placement:t,middleware:[Nx({crossAxis:!0,padding:5,rootBoundary:"document"})]}),v=g.includes("right")?e:t.includes("left")?e*-1:0,b=g.includes("bottom")?e:t.includes("top")?e*-1:0,S=y.useCallback(({clientX:w,clientY:C})=>{h.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:w,y:C,left:w+v,top:C+b,right:w,bottom:C}}})},[f.reference]);return y.useEffect(()=>{if(h.floating.current){const w=o.current;w.addEventListener("mousemove",S);const C=$a(h.floating.current);return C.forEach(E=>{E.addEventListener("scroll",m)}),()=>{w.removeEventListener("mousemove",S),C.forEach(E=>{E.removeEventListener("scroll",m)})}}},[f.reference,h.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:u,opened:r,setOpened:i,boundaryRef:o,floating:h.setFloating}}var qp={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const $6={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Qr("popover")},z6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Vt(t),"--tooltip-bg":n?Ht(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),z0=ve((e,t)=>{const n=se("TooltipFloating",$6,e),{children:r,refProp:i,withinPortal:o,style:c,className:u,classNames:f,styles:h,unstyled:m,radius:g,color:v,label:b,offset:S,position:w,multiline:C,zIndex:E,disabled:_,defaultOpened:T,variant:R,vars:D,portalProps:k,...M}=n,I=Sn(),z=Ie({name:"TooltipFloating",props:n,classes:qp,className:u,style:c,classNames:f,styles:h,unstyled:m,rootSelector:"tooltip",vars:D,varsResolver:z6}),{handleMouseMove:V,x:Y,y:W,opened:J,boundaryRef:G,floating:X,setOpened:P}=L6({offset:S,position:w,defaultOpened:T});if(!qa(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 L=Un(G,dp(r),t),$=r.props,H=U=>{var K;(K=$.onMouseEnter)==null||K.call($,U),V(U),P(!0)},O=U=>{var K;(K=$.onMouseLeave)==null||K.call($,U),P(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(Wo,{...k,withinPortal:o,children:s.jsx(ce,{...M,...z("tooltip",{style:{...OR(c,I),zIndex:E,display:!_&&J?"block":"none",top:(W&&Math.round(W))??"",left:(Y&&Math.round(Y))??""}}),variant:R,ref:X,mod:{multiline:C},children:b})}),y.cloneElement(r,{...$,[i]:L,onMouseEnter:H,onMouseLeave:O})]})});z0.classes=qp;z0.displayName="@mantine/core/TooltipFloating";const H_=y.createContext(!1),U6=H_.Provider,B6=()=>y.useContext(H_),V6={openDelay:0,closeDelay:0};function U0(e){const{openDelay:t,closeDelay:n,children:r}=se("TooltipGroup",V6,e);return s.jsx(U6,{value:!0,children:s.jsx(v9,{delay:{open:t,close:n},children:r})})}U0.displayName="@mantine/core/TooltipGroup";U0.extend=e=>e;function F6(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 H6(e){const t=F6(e.middlewares),n=[JR(e.offset)];return t.shift&&n.push(Nx(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Nh():Nh(t.flip)),n.push(e2({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Yu():Yu(t.inline)):e.inline&&n.push(Yu()),n}function q6(e){var k,M,I;const[t,n]=y.useState(e.defaultOpened),i=typeof e.opened=="boolean"?e.opened:t,o=B6(),c=yr(),u=y.useCallback(z=>{n(z),z&&_(c)},[c]),{x:f,y:h,context:m,refs:g,update:v,placement:b,middlewareData:{arrow:{x:S,y:w}={}}}=Lx({strategy:e.strategy,placement:e.position,open:i,onOpenChange:u,middleware:H6(e)}),{delay:C,currentId:E,setCurrentId:_}=y9(m,{id:c}),{getReferenceProps:T,getFloatingProps:R}=E9([m9(m,{enabled:(k=e.events)==null?void 0:k.hover,delay:o?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((M=e.events)!=null&&M.touch)}),C9(m,{enabled:(I=e.events)==null?void 0:I.focus,visibleOnly:!0}),R9(m,{role:"tooltip"}),w9(m,{enabled:typeof e.opened>"u"})]);T2({opened:i,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),Ua(()=>{var z;(z=e.onPositionChange)==null||z.call(e,b)},[b]);const D=i&&E&&E!==c;return{x:f,y:h,arrowX:S,arrowY:w,reference:g.setReference,floating:g.setFloating,getFloatingProps:R,getReferenceProps:T,isGroupPhase:D,opened:i,placement:b}}const tE={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Qr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},G6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Vt(t),"--tooltip-bg":n?Ht(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),tl=ve((e,t)=>{const n=se("Tooltip",tE,e),{children:r,position:i,refProp:o,label:c,openDelay:u,closeDelay:f,onPositionChange:h,opened:m,defaultOpened:g,withinPortal:v,radius:b,color:S,classNames:w,styles:C,unstyled:E,style:_,className:T,withArrow:R,arrowSize:D,arrowOffset:k,arrowRadius:M,arrowPosition:I,offset:z,transitionProps:V,multiline:Y,events:W,zIndex:J,disabled:G,positionDependencies:X,onClick:P,onMouseEnter:L,onMouseLeave:$,inline:H,variant:O,keepMounted:U,vars:K,portalProps:ee,mod:Se,floatingStrategy:be,middlewares:xe,...Ge}=se("Tooltip",tE,n),{dir:Me}=Js(),tt=y.useRef(null),ke=q6({position:x2(Me,i),closeDelay:f,openDelay:u,onPositionChange:h,opened:m,defaultOpened:g,events:W,arrowRef:tt,arrowOffset:k,offset:typeof z=="number"?z+(R?D/2:0):z,positionDependencies:[...X,r],inline:H,strategy:be,middlewares:xe}),vt=Ie({name:"Tooltip",props:n,classes:qp,className:T,style:_,classNames:w,styles:C,unstyled:E,rootSelector:"tooltip",vars:K,varsResolver:G6});if(!qa(r))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Lt=Un(ke.reference,dp(r),t),$t=I6(V,{duration:100,transition:"fade"}),gt=r.props;return s.jsxs(s.Fragment,{children:[s.jsx(Wo,{...ee,withinPortal:v,children:s.jsx(fa,{...$t,keepMounted:U,mounted:!G&&!!ke.opened,duration:ke.isGroupPhase?10:$t.duration,children:At=>s.jsxs(ce,{...Ge,"data-fixed":be==="fixed"||void 0,variant:O,mod:[{multiline:Y},Se],...ke.getFloatingProps({ref:ke.floating,className:vt("tooltip").className,style:{...vt("tooltip").style,...At,zIndex:J,top:ke.y??0,left:ke.x??0}}),children:[c,s.jsx(Bx,{ref:tt,arrowX:ke.arrowX,arrowY:ke.arrowY,visible:R,position:ke.placement,arrowSize:D,arrowOffset:k,arrowRadius:M,arrowPosition:I,...vt("arrow")})]})})}),y.cloneElement(r,ke.getReferenceProps({onClick:P,onMouseEnter:L,onMouseLeave:$,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:Ut(T,gt.className),...gt,[o]:Lt}))]})});tl.classes=qp;tl.displayName="@mantine/core/Tooltip";tl.Floating=z0;tl.Group=U0;function W6({size:e,thickness:t,sum:n,value:r,root:i,offset:o}){const c=(e*.9-t*2)/2,u=Math.PI*c*2/100,f=i||r===void 0?`${(100-n)*u}, ${n*u}`:`${r*u}, ${(100-r)*u}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:c||0,transform:i?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:i?0:o||0}}function q_({size:e,value:t,offset:n,sum:r,thickness:i,root:o,color:c,lineRoundCaps:u,tooltip:f,getStyles:h,display:m,...g}){const v=Sn();return s.jsx(tl.Floating,{disabled:!f,label:f,children:s.jsx(ce,{component:"circle",...g,...h("curve"),__vars:{"--curve-color":c?Ht(c,v):void 0},fill:"none",strokeLinecap:u?"round":"butt",...W6({sum:r,size:e,thickness:i,value:t,offset:n,root:o})})})}q_.displayName="@mantine/core/Curve";function Q6({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:i}){const o=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let u=c;const f=[],h=[];for(let m=0;m<n.length;m+=1)f.push({sum:o,offset:u,data:n[m],root:!1}),u-=n[m].value/100*c;if(f.push({sum:o,offset:u,data:{color:i},root:!0}),h.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){h.push({...f[0],lineRoundCaps:r}),h.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)h.push({...f[m],lineRoundCaps:!1})}else h.push({...f[0],lineRoundCaps:r});return h}var G_={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function Y6(e,t){return Math.min(e||12,(t||120)/4)}const X6={size:120,thickness:12},K6=(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}}),Gp=ve((e,t)=>{const n=se("RingProgress",X6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,label:h,sections:m,size:g,thickness:v,roundCaps:b,rootColor:S,transitionDuration:w,...C}=n,E=Ie({name:"RingProgress",classes:G_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:K6}),_=Y6(v,g),T=Q6({size:g,thickness:_,sections:m,renderRoundedLineCaps:b,rootColor:S}).map(({data:R,sum:D,root:k,lineRoundCaps:M,offset:I},z)=>y.createElement(q_,{...R,key:z,size:g,thickness:_,sum:D,offset:I,color:R==null?void 0:R.color,root:k,lineRoundCaps:M,getStyles:E}));return s.jsxs(ce,{...E("root"),size:g,ref:t,...C,children:[s.jsx("svg",{...E("svg"),children:T}),h&&s.jsx("div",{...E("label"),children:h})]})});Gp.classes=G_;Gp.displayName="@mantine/core/RingProgress";var W_={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const Z6={withItemsBorders:!0},J6=(e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:Vt(t),"--sc-color":n?Ht(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":o,"--sc-padding":rt(i,"sc-padding"),"--sc-font-size":On(i)}}),Wp=ve((e,t)=>{var Me,tt;const n=se("SegmentedControl",Z6,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,data:h,value:m,defaultValue:g,onChange:v,size:b,name:S,disabled:w,readOnly:C,fullWidth:E,orientation:_,radius:T,color:R,transitionDuration:D,transitionTimingFunction:k,variant:M,autoContrast:I,withItemsBorders:z,mod:V,...Y}=n,W=Ie({name:"SegmentedControl",props:n,classes:W_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:J6}),J=Sn(),G=h.map(ke=>typeof ke=="string"?{label:ke,value:ke}:ke),X=ON(),[P,L]=y.useState(_h()),[$,H]=y.useState(null),[O,U]=y.useState({}),K=(ke,vt)=>{O[vt]=ke,U(O)},[ee,Se]=Yn({value:m,defaultValue:g,finalValue:Array.isArray(h)?((Me=G.find(ke=>!ke.disabled))==null?void 0:Me.value)??((tt=h[0])==null?void 0:tt.value)??null:null,onChange:v}),be=yr(S),xe=G.map(ke=>y.createElement(ce,{...W("control"),mod:{active:ee===ke.value,orientation:_},key:ke.value},y.createElement("input",{...W("input"),disabled:w||ke.disabled,type:"radio",name:be,value:ke.value,id:`${be}-${ke.value}`,checked:ee===ke.value,onChange:()=>!C&&Se(ke.value),"data-focus-ring":J.focusRing,key:`${ke.value}-input`}),y.createElement(ce,{component:"label",...W("label"),mod:{active:ee===ke.value&&!(w||ke.disabled),disabled:w||ke.disabled,"read-only":C},htmlFor:`${be}-${ke.value}`,ref:vt=>K(vt,ke.value),__vars:{"--sc-label-color":R!==void 0?Qa({color:R,theme:J,autoContrast:I}):void 0},key:`${ke.value}-label`},s.jsx("span",{...W("innerLabel"),children:ke.label})))),Ge=Un(t,ke=>H(ke));return kN(()=>{L(_h())},[h.length]),h.length===0?null:s.jsxs(ce,{...W("root"),variant:M,size:b,ref:Ge,mod:[{"full-width":E,orientation:_,initialized:X,"with-items-borders":z},V],...Y,role:"radiogroup","data-disabled":w,children:[typeof ee=="string"&&s.jsx(Wx,{target:O[ee],parent:$,component:"span",transitionDuration:"var(--sc-transition-duration)",...W("indicator")},P),xe]})});Wp.classes=W_;Wp.displayName="@mantine/core/SegmentedControl";function e$({spacing:e,verticalSpacing:t,cols:n,selector:r}){var m;const i=Sn(),o=t===void 0?e:t,c=Go({"--sg-spacing-x":Nn(Ai(e)),"--sg-spacing-y":Nn(Ai(o)),"--sg-cols":(m=Ai(n))==null?void 0:m.toString()}),u=sn(i.breakpoints).reduce((g,v)=>(g[v]||(g[v]={}),typeof e=="object"&&e[v]!==void 0&&(g[v]["--sg-spacing-x"]=Nn(e[v])),typeof o=="object"&&o[v]!==void 0&&(g[v]["--sg-spacing-y"]=Nn(o[v])),typeof n=="object"&&n[v]!==void 0&&(g[v]["--sg-cols"]=n[v]),g),{}),h=Zu(sn(u),i.breakpoints).filter(g=>sn(u[g.value]).length>0).map(g=>({query:`(min-width: ${i.breakpoints[g.value]})`,styles:u[g.value]}));return s.jsx(Zs,{styles:c,media:h,selector:r})}function Gv(e){return typeof e=="object"&&e!==null?sn(e):[]}function t$(e){return e.sort((t,n)=>Ku(t)-Ku(n))}function n$({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Gv(e),...Gv(t),...Gv(n)]));return t$(r)}function r$({spacing:e,verticalSpacing:t,cols:n,selector:r}){var h;const i=t===void 0?e:t,o=Go({"--sg-spacing-x":Nn(Ai(e)),"--sg-spacing-y":Nn(Ai(i)),"--sg-cols":(h=Ai(n))==null?void 0:h.toString()}),c=n$({spacing:e,verticalSpacing:t,cols:n}),u=c.reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=Nn(e[g])),typeof i=="object"&&i[g]!==void 0&&(m[g]["--sg-spacing-y"]=Nn(i[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),f=c.map(m=>({query:`simple-grid (min-width: ${m})`,styles:u[m]}));return s.jsx(Zs,{styles:o,container:f,selector:r})}var Q_={container:"m_925c2d2c",root:"m_2415a157"};const i$={cols:1,spacing:"md",type:"media"},B0=ve((e,t)=>{const n=se("SimpleGrid",i$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,cols:h,verticalSpacing:m,spacing:g,type:v,...b}=n,S=Ie({name:"SimpleGrid",classes:Q_,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f}),w=hd();return v==="container"?s.jsxs(s.Fragment,{children:[s.jsx(r$,{...n,selector:`.${w}`}),s.jsx("div",{...S("container"),children:s.jsx(ce,{ref:t,...S("root",{className:w}),...b})})]}):s.jsxs(s.Fragment,{children:[s.jsx(e$,{...n,selector:`.${w}`}),s.jsx(ce,{ref:t,...S("root",{className:w}),...b})]})});B0.classes=Q_;B0.displayName="@mantine/core/SimpleGrid";const a$={},Qp=ve((e,t)=>{const{w:n,h:r,miw:i,mih:o,...c}=se("Space",a$,e);return s.jsx(ce,{ref:t,...c,w:n,miw:i??n,h:r,mih:o??r})});Qp.displayName="@mantine/core/Space";var Y_={root:"m_6d731127"};const o$={gap:"md",align:"stretch",justify:"flex-start"},s$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Nn(t),"--stack-align":n,"--stack-justify":r}}),qe=ve((e,t)=>{const n=se("Stack",o$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,align:h,justify:m,gap:g,variant:v,...b}=n,S=Ie({name:"Stack",props:n,classes:Y_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:s$});return s.jsx(ce,{ref:t,...S("root"),variant:v,...b})});qe.classes=Y_;qe.displayName="@mantine/core/Stack";const[l$,c$]=vr("Stepper component was not found in tree"),Mh=()=>null;Mh.displayName="@mantine/core/StepperCompleted";var V0={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 ih=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,u$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},F0=ve((e,t)=>{const{classNames:n,className:r,style:i,styles:o,vars:c,step:u,state:f,color:h,icon:m,completedIcon:g,progressIcon:v,label:b,description:S,withIcon:w,iconSize:C,loading:E,allowStepClick:_,allowStepSelect:T,iconPosition:R,orientation:D,mod:k,...M}=se("StepperStep",u$,e),I=c$(),z=Sn(),V={classNames:n,styles:o},Y=f==="stepCompleted"?null:f==="stepProgress"?v:m,W={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return s.jsxs(tr,{...I.getStyles("step",{className:r,style:i,variant:I.orientation,...V}),mod:[{"icon-position":R||I.iconPosition,"allow-click":_},k],ref:t,...W,...M,__vars:{"--step-color":h?Ht(h,z):void 0},tabIndex:_?0:-1,children:[w&&s.jsxs("span",{...I.getStyles("stepWrapper",V),children:[s.jsxs("span",{...I.getStyles("stepIcon",V),...W,children:[s.jsx(fa,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:J=>s.jsx("span",{...I.getStyles("stepCompletedIcon",{style:J,...V}),children:E?s.jsx(kr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...I.getStyles("stepLoader",V)}):ih(g,u)||s.jsx(Tp,{size:"60%"})})}),f!=="stepCompleted"?E?s.jsx(kr,{...I.getStyles("stepLoader",V),size:"calc(var(--stepper-icon-size) / 2)",color:h}):ih(Y||m,u):null]}),D==="vertical"&&s.jsx("span",{...I.getStyles("verticalSeparator",V),"data-active":f==="stepCompleted"||void 0})]}),(b||S)&&s.jsxs("span",{...I.getStyles("stepBody",V),"data-orientation":I.orientation,"data-icon-position":R||I.iconPosition,children:[b&&s.jsx("span",{...I.getStyles("stepLabel",V),children:ih(b,u)}),S&&s.jsx("span",{...I.getStyles("stepDescription",V),children:ih(S,u)})]})]})});F0.classes=V0;F0.displayName="@mantine/core/StepperStep";const d$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},f$=(e,{color:t,iconSize:n,size:r,contentPadding:i,radius:o,autoContrast:c})=>({root:{"--stepper-color":t?Ht(t,e):void 0,"--stepper-icon-color":Ks(c,e)?Qa({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?rt(r,"stepper-icon-size"):le(n),"--stepper-content-padding":Nn(i),"--stepper-radius":o===void 0?void 0:Vt(o),"--stepper-fz":On(r),"--stepper-spacing":Nn(r)}}),gc=ve((e,t)=>{var $,H,O;const n=se("Stepper",d$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,children:h,onStepClick:m,active:g,icon:v,completedIcon:b,progressIcon:S,color:w,iconSize:C,contentPadding:E,orientation:_,iconPosition:T,size:R,radius:D,allowNextStepsSelect:k,wrap:M,autoContrast:I,...z}=n,V=Ie({name:"Stepper",classes:V0,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:f$}),Y=y.Children.toArray(h),W=Y.filter(U=>U.type!==Mh),J=Y.find(U=>U.type===Mh),G=W.reduce((U,K,ee)=>{const Se=g===ee?"stepProgress":g>ee?"stepCompleted":"stepInactive",xe=typeof m!="function"?!1:typeof K.props.allowStepSelect=="boolean"?K.props.allowStepSelect:Se==="stepCompleted"||k;return U.push(y.cloneElement(K,{icon:K.props.icon||v||ee+1,key:ee,step:ee,state:Se,onClick:()=>xe&&(m==null?void 0:m(ee)),allowStepClick:xe,completedIcon:K.props.completedIcon||b,progressIcon:K.props.progressIcon||S,color:K.props.color||w,iconSize:C,iconPosition:K.props.iconPosition||T,orientation:_})),_==="horizontal"&&ee!==W.length-1&&U.push(y.createElement("div",{...V("separator"),"data-active":ee<g||void 0,"data-orientation":_,key:`separator-${ee}`})),U},[]),X=(H=($=W[g])==null?void 0:$.props)==null?void 0:H.children,P=(O=J==null?void 0:J.props)==null?void 0:O.children,L=g>W.length-1?P:X;return s.jsx(l$,{value:{getStyles:V,orientation:_,iconPosition:T},children:s.jsxs(ce,{...V("root"),ref:t,size:R,...z,children:[s.jsx(ce,{...V("steps"),mod:{orientation:_,"icon-position":T,wrap:M&&_!=="vertical"},children:G}),L&&s.jsx("div",{...V("content"),children:L})]})})});gc.classes=V0;gc.displayName="@mantine/core/Stepper";gc.Completed=Mh;gc.Step=F0;const X_=y.createContext(null),h$=X_.Provider,p$=()=>y.useContext(X_),m$={},H0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:o,wrapperProps:c,children:u,readOnly:f,...h}=se("SwitchGroup",m$,e),[m,g]=Yn({value:n,defaultValue:r,finalValue:[],onChange:i}),v=b=>{const S=b.currentTarget.value;!f&&g(m.includes(S)?m.filter(w=>w!==S):[...m,S])};return s.jsx(h$,{value:{value:m,onChange:v,size:o},children:s.jsx(mn.Wrapper,{size:o,ref:t,...c,...h,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(u0,{role:"group",children:u})})})});H0.classes=mn.Wrapper.classes;H0.displayName="@mantine/core/SwitchGroup";var K_={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const g$={labelPosition:"right"},v$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Vt(t),"--switch-height":rt(r,"switch-height"),"--switch-width":rt(r,"switch-width"),"--switch-thumb-size":rt(r,"switch-thumb-size"),"--switch-label-font-size":rt(r,"switch-label-font-size"),"--switch-track-label-padding":rt(r,"switch-track-label-padding"),"--switch-color":n?Ht(n,e):void 0}}),Cd=ve((e,t)=>{const n=se("Switch",g$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,color:h,label:m,offLabel:g,onLabel:v,id:b,size:S,radius:w,wrapperProps:C,thumbIcon:E,checked:_,defaultChecked:T,onChange:R,labelPosition:D,description:k,error:M,disabled:I,variant:z,rootRef:V,mod:Y,...W}=n,J=p$(),G=S||(J==null?void 0:J.size),X=Ie({name:"Switch",props:n,classes:K_,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:v$}),{styleProps:P,rest:L}=Ya(W),$=yr(b),H=J?{checked:J.value.includes(L.value),onChange:J.onChange}:{},[O,U]=Yn({value:H.checked??_,defaultValue:T,finalValue:!1});return s.jsxs(Ep,{...X("root"),__staticSelector:"Switch",__stylesApiProps:n,id:$,size:G,labelPosition:D,label:m,description:k,error:M,disabled:I,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:u,"data-checked":H.checked||_||void 0,variant:z,ref:V,mod:Y,...P,...C,children:[s.jsx("input",{...L,disabled:I,checked:O,"data-checked":H.checked||_||void 0,onChange:K=>{var ee;J?(ee=H.onChange)==null||ee.call(H,K):R==null||R(K),U(K.currentTarget.checked)},id:$,ref:t,type:"checkbox",role:"switch",...X("input")}),s.jsxs(ce,{"aria-hidden":"true",component:"span",mod:{error:M,"label-position":D,"without-labels":!v&&!g},...X("track"),children:[s.jsx(ce,{component:"span",mod:"reduce-motion",...X("thumb"),children:E}),s.jsx("span",{...X("trackLabel"),children:O?v:g})]})]})});Cd.classes={...K_,...n_};Cd.displayName="@mantine/core/Switch";Cd.Group=H0;const[y$,x$]=vr("Table component was not found in the tree");var Ed={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 b$(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 nl(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ve((i,o)=>{const c=se(n,{},i),{classNames:u,className:f,style:h,styles:m,...g}=c,v=x$();return s.jsx(ce,{component:e,ref:o,...b$(v,t),...v.getStyles(e,{className:f,classNames:u,style:h,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=Ed,r}const Ly=nl("th",{columnBorder:!0}),Z_=nl("td",{columnBorder:!0}),yh=nl("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),J_=nl("thead",{stickyHeader:!0}),eD=nl("tbody"),tD=nl("tfoot"),nD=nl("caption",{captionSide:!0});function q0({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(nD,{children:e.caption}),e.head&&s.jsx(J_,{children:s.jsx(yh,{children:e.head.map((t,n)=>s.jsx(Ly,{children:t},n))})}),e.body&&s.jsx(eD,{children:e.body.map((t,n)=>s.jsx(yh,{children:t.map((r,i)=>s.jsx(Z_,{children:r},i))},n))}),e.foot&&s.jsx(tD,{children:s.jsx(yh,{children:e.foot.map((t,n)=>s.jsx(Ly,{children:t},n))})})]})}q0.displayName="@mantine/core/TableDataRenderer";const S$={type:"scrollarea"},w$=(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}}),G0=ve((e,t)=>{const n=se("TableScrollContainer",S$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,children:h,minWidth:m,maxHeight:g,type:v,scrollAreaProps:b,...S}=n,w=Ie({name:"TableScrollContainer",classes:Ed,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:w$,rootSelector:"scrollContainer"});return s.jsx(ce,{component:v==="scrollarea"?Yr:"div",...v==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...w("scrollContainer"),...S,children:s.jsx("div",{...w("scrollContainerInner"),children:h})})});G0.classes=Ed;G0.displayName="@mantine/core/TableScrollContainer";const j$={withRowBorders:!0,verticalSpacing:7},C$=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:o,stripedColor:c,highlightOnHoverColor:u,striped:f,highlightOnHover:h,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Nn(r),"--table-vertical-spacing":Nn(i),"--table-border-color":o?Ht(o,e):void 0,"--table-striped-color":f&&c?Ht(c,e):void 0,"--table-highlight-on-hover-color":h&&u?Ht(u,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),ye=ve((e,t)=>{const n=se("Table",j$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,horizontalSpacing:h,verticalSpacing:m,captionSide:g,stripedColor:v,highlightOnHoverColor:b,striped:S,highlightOnHover:w,withColumnBorders:C,withRowBorders:E,withTableBorder:_,borderColor:T,layout:R,variant:D,data:k,children:M,stickyHeader:I,stickyHeaderOffset:z,mod:V,tabularNums:Y,...W}=n,J=Ie({name:"Table",props:n,className:i,style:o,classes:Ed,classNames:r,styles:c,unstyled:u,rootSelector:"table",vars:f,varsResolver:C$});return s.jsx(y$,{value:{getStyles:J,stickyHeader:I,striped:S===!0?"odd":S||void 0,highlightOnHover:w,withColumnBorders:C,withRowBorders:E,captionSide:g||"bottom"},children:s.jsx(ce,{component:"table",variant:D,ref:t,mod:[{"data-with-table-border":_,"data-tabular-nums":Y},V],...J("table"),...W,children:M||!!k&&s.jsx(q0,{data:k})})})});ye.classes=Ed;ye.displayName="@mantine/core/Table";ye.Td=Z_;ye.Th=Ly;ye.Tr=yh;ye.Thead=J_;ye.Tbody=eD;ye.Tfoot=tD;ye.Caption=nD;ye.ScrollContainer=G0;ye.DataRenderer=q0;const[E$,W0]=vr("Tabs component was not found in the tree");var Td={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",panel:"m_b0c91715",tab:"m_4ec4dce6",tabSection:"m_fc420b1f","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const T$={},Q0=ve((e,t)=>{const n=se("TabsList",T$,e),{children:r,className:i,grow:o,justify:c,classNames:u,styles:f,style:h,mod:m,...g}=n,v=W0();return s.jsx(ce,{...g,...v.getStyles("list",{className:i,style:h,classNames:u,styles:f,props:n,variant:v.variant}),ref:t,role:"tablist",variant:v.variant,mod:[{grow:o,orientation:v.orientation,placement:v.orientation==="vertical"&&v.placement,inverted:v.inverted},m],"aria-orientation":v.orientation,__vars:{"--tabs-justify":c},children:r})});Q0.classes=Td;Q0.displayName="@mantine/core/TabsList";const R$={},Y0=ve((e,t)=>{const n=se("TabsPanel",R$,e),{children:r,className:i,value:o,classNames:c,styles:u,style:f,mod:h,keepMounted:m,...g}=n,v=W0(),b=v.value===o,S=v.keepMounted||m||b?r:null;return s.jsx(ce,{...g,...v.getStyles("panel",{className:i,classNames:c,styles:u,style:[f,b?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:v.orientation},h],role:"tabpanel",id:v.getPanelId(o),"aria-labelledby":v.getTabId(o),children:S})});Y0.classes=Td;Y0.displayName="@mantine/core/TabsPanel";const _$={},X0=ve((e,t)=>{const n=se("TabsTab",_$,e),{className:r,children:i,rightSection:o,leftSection:c,value:u,onClick:f,onKeyDown:h,disabled:m,color:g,style:v,classNames:b,styles:S,vars:w,mod:C,tabIndex:E,..._}=n,T=Sn(),{dir:R}=Js(),D=W0(),k=u===D.value,M=z=>{D.onChange(D.allowTabDeactivation&&u===D.value?null:u),f==null||f(z)},I={classNames:b,styles:S,props:n};return s.jsxs(tr,{..._,...D.getStyles("tab",{className:r,style:v,variant:D.variant,...I}),disabled:m,unstyled:D.unstyled,variant:D.variant,mod:[{active:k,disabled:m,orientation:D.orientation,inverted:D.inverted,placement:D.orientation==="vertical"&&D.placement},C],ref:t,role:"tab",id:D.getTabId(u),"aria-selected":k,tabIndex:E!==void 0?E:k||D.value===null?0:-1,"aria-controls":D.getPanelId(u),onClick:M,__vars:{"--tabs-color":g?Ht(g,T):void 0},onKeyDown:vR({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:D.activateTabWithKeyboard,loop:D.loop,orientation:D.orientation||"horizontal",dir:R,onKeyDown:h}),children:[c&&s.jsx("span",{...D.getStyles("tabSection",I),"data-position":"left",children:c}),i&&s.jsx("span",{...D.getStyles("tabLabel",I),children:i}),o&&s.jsx("span",{...D.getStyles("tabSection",I),"data-position":"right",children:o})]})});X0.classes=Td;X0.displayName="@mantine/core/TabsTab";const nE="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",D$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},A$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Vt(t),"--tabs-color":Ht(n,e),"--tabs-text-color":Ks(r,e)?Qa({color:n,theme:e,autoContrast:r}):void 0}}),Tt=ve((e,t)=>{const n=se("Tabs",D$,e),{defaultValue:r,value:i,onChange:o,orientation:c,children:u,loop:f,id:h,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:v,color:b,radius:S,inverted:w,placement:C,keepMounted:E,classNames:_,styles:T,unstyled:R,className:D,style:k,vars:M,autoContrast:I,mod:z,...V}=n,Y=yr(h),[W,J]=Yn({value:i,defaultValue:r,finalValue:null,onChange:o}),G=Ie({name:"Tabs",props:n,classes:Td,className:D,style:k,classNames:_,styles:T,unstyled:R,vars:M,varsResolver:A$});return s.jsx(E$,{value:{placement:C,value:W,orientation:c,id:Y,loop:f,activateTabWithKeyboard:m,getTabId:Xj(`${Y}-tab`,nE),getPanelId:Xj(`${Y}-panel`,nE),onChange:J,allowTabDeactivation:g,variant:v,color:b,radius:S,inverted:w,keepMounted:E,unstyled:R,getStyles:G},children:s.jsx(ce,{ref:t,id:Y,variant:v,mod:[{orientation:c,inverted:c==="horizontal"&&w,placement:c==="vertical"&&C},z],...G("root"),...V,children:u})})});Tt.classes=Td;Tt.displayName="@mantine/core/Tabs";Tt.Tab=X0;Tt.Panel=Y0;Tt.List=Q0;const k$={},$e=ve((e,t)=>{const n=se("TextInput",k$,e);return s.jsx(Nr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});$e.classes=Nr.classes;$e.displayName="@mantine/core/TextInput";var rD={root:"m_7341320d"};const P$={},N$=(e,{size:t,radius:n,variant:r,gradient:i,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":rt(t,"ti-size"),"--ti-radius":n===void 0?void 0:Vt(n),"--ti-bg":o||r?u.background:void 0,"--ti-color":o||r?u.color:void 0,"--ti-bd":o||r?u.border:void 0}}},K0=ve((e,t)=>{const n=se("ThemeIcon",P$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,autoContrast:h,...m}=n,g=Ie({name:"ThemeIcon",classes:rD,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:N$});return s.jsx(ce,{ref:t,...g("root"),...m})});K0.classes=rD;K0.displayName="@mantine/core/ThemeIcon";const O$=["h1","h2","h3","h4","h5","h6"],M$=["xs","sm","md","lg","xl"];function I$(e,t){const n=t!==void 0?t:`h${e}`;return O$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:M$.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 iD={root:"m_8a5d1357"};const L$={order:1},$$=(e,{order:t,size:n,lineClamp:r,textWrap:i})=>{const o=I$(t,n);return{root:{"--title-fw":o.fontWeight,"--title-lh":o.lineHeight,"--title-fz":o.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":i}}},Le=ve((e,t)=>{const n=se("Title",L$,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,order:f,vars:h,size:m,variant:g,lineClamp:v,textWrap:b,mod:S,...w}=n,C=Ie({name:"Title",props:n,classes:iD,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:h,varsResolver:$$});return[1,2,3,4,5,6].includes(f)?s.jsx(ce,{...C("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof v=="number"},S],size:m,...w}):null});Le.classes=iD;Le.displayName="@mantine/core/Title";function z$(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(i){t=typeof i=="function"?i(t):i},setState(i){this.updateState(i),r.forEach(o=>o(t))},initialize(i){n||(t=i,n=!0)},subscribe(i){return r.add(i),()=>r.delete(i)}}}function U$(e){return y.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function B$(e,t,n){const r=[],i=[],o={};for(const c of e){const u=c.position||t;o[u]=o[u]||0,o[u]+=1,o[u]<=n?i.push(c):r.push(c)}return{notifications:i,queue:r}}const V$=()=>z$({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),rl=V$(),F$=(e=rl)=>U$(e);function Pc(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),i=B$(r,n.defaultPosition,n.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Oe(e,t=rl){const n=e.id||_h();return Pc(t,r=>e.id&&r.some(i=>i.id===e.id)?r:[...r,{...e,id:n}]),n}function aD(e,t=rl){return Pc(t,n=>n.filter(r=>{var i;return r.id===e?((i=r.onClose)==null||i.call(r,r),!1):!0})),e}function As(e,t=rl){return Pc(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function H$(e=rl){Pc(e,()=>[])}function q$(e=rl){Pc(e,t=>t.slice(0,e.getState().limit))}const di={show:Oe,hide:aD,update:As,clean:H$,cleanQueue:q$,updateState:Pc};function $y(e,t){return $y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},$y(e,t)}function oD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$y(e,t)}var Wv={exports:{}},Qv,rE;function G$(){if(rE)return Qv;rE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Qv=e,Qv}var Yv,iE;function W$(){if(iE)return Yv;iE=1;var e=G$();function t(){}function n(){}return n.resetWarningCache=t,Yv=function(){function r(c,u,f,h,m,g){if(g!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Yv}var aE;function Q$(){return aE||(aE=1,Wv.exports=W$()()),Wv.exports}var Y$=Q$();const on=hx(Y$),oE={disabled:!1},Ih=En.createContext(null);var X$=function(t){return t.scrollTop},Gu="unmounted",js="exited",Cs="entering",tc="entered",zy="exiting",Ja=function(e){oD(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var c=i,u=c&&!c.isMounting?r.enter:r.appear,f;return o.appearStatus=null,r.in?u?(f=js,o.appearStatus=Cs):f=tc:r.unmountOnExit||r.mountOnEnter?f=Gu:f=js,o.state={status:f},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var c=i.in;return c&&o.status===Gu?{status:js}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var c=this.state.status;this.props.in?c!==Cs&&c!==tc&&(o=Cs):(c===Cs||c===tc)&&(o=zy)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,c,u;return o=c=u=i,i!=null&&typeof i!="number"&&(o=i.exit,c=i.enter,u=i.appear!==void 0?i.appear:c),{exit:o,enter:c,appear:u}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Cs){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:qu.findDOMNode(this);c&&X$(c)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===js&&this.setState({status:Gu})},n.performEnter=function(i){var o=this,c=this.props.enter,u=this.context?this.context.isMounting:i,f=this.props.nodeRef?[u]:[qu.findDOMNode(this),u],h=f[0],m=f[1],g=this.getTimeouts(),v=u?g.appear:g.enter;if(!i&&!c||oE.disabled){this.safeSetState({status:tc},function(){o.props.onEntered(h)});return}this.props.onEnter(h,m),this.safeSetState({status:Cs},function(){o.props.onEntering(h,m),o.onTransitionEnd(v,function(){o.safeSetState({status:tc},function(){o.props.onEntered(h,m)})})})},n.performExit=function(){var i=this,o=this.props.exit,c=this.getTimeouts(),u=this.props.nodeRef?void 0:qu.findDOMNode(this);if(!o||oE.disabled){this.safeSetState({status:js},function(){i.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:zy},function(){i.props.onExiting(u),i.onTransitionEnd(c.exit,function(){i.safeSetState({status:js},function(){i.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,c=!0;return this.nextCallback=function(u){c&&(c=!1,o.nextCallback=null,i(u))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var c=this.props.nodeRef?this.props.nodeRef.current:qu.findDOMNode(this),u=i==null&&!this.props.addEndListener;if(!c||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],h=f[0],m=f[1];this.props.addEndListener(h,m)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Gu)return null;var o=this.props,c=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var u=S0(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return En.createElement(Ih.Provider,{value:null},typeof c=="function"?c(i,u):En.cloneElement(En.Children.only(c),u))},t}(En.Component);Ja.contextType=Ih;Ja.propTypes={};function Ql(){}Ja.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ql,onEntering:Ql,onEntered:Ql,onExit:Ql,onExiting:Ql,onExited:Ql};Ja.UNMOUNTED=Gu;Ja.EXITED=js;Ja.ENTERING=Cs;Ja.ENTERED=tc;Ja.EXITING=zy;function K$(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(o){return t&&y.isValidElement(o)?t(o):o},r=Object.create(null);return e&&y.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Z$(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),i=[];for(var o in e)o in t?i.length&&(r[o]=i,i=[]):i.push(o);var c,u={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var h=r[f][c];u[r[f][c]]=n(h)}u[f]=n(f)}for(c=0;c<i.length;c++)u[i[c]]=n(i[c]);return u}function ks(e,t,n){return n[t]!=null?n[t]:e.props[t]}function J$(e,t){return Z0(e.children,function(n){return y.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ks(n,"appear",e),enter:ks(n,"enter",e),exit:ks(n,"exit",e)})})}function ez(e,t,n){var r=Z0(e.children),i=Z$(t,r);return Object.keys(i).forEach(function(o){var c=i[o];if(y.isValidElement(c)){var u=o in t,f=o in r,h=t[o],m=y.isValidElement(h)&&!h.props.in;f&&(!u||m)?i[o]=y.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:ks(c,"exit",e),enter:ks(c,"enter",e)}):!f&&u&&!m?i[o]=y.cloneElement(c,{in:!1}):f&&u&&y.isValidElement(h)&&(i[o]=y.cloneElement(c,{onExited:n.bind(null,c),in:h.props.in,exit:ks(c,"exit",e),enter:ks(c,"enter",e)}))}}),i}var tz=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},nz={component:"div",childFactory:function(t){return t}},Mo=function(e){oD(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var c=o.handleExited.bind(K$(o));return o.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},o}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,o){var c=o.children,u=o.handleExited,f=o.firstRender;return{children:f?J$(i,u):ez(i,c,u),firstRender:!1}},n.handleExited=function(i,o){var c=Z0(this.props.children);i.key in c||(i.props.onExited&&i.props.onExited(o),this.mounted&&this.setState(function(u){var f=Oh({},u.children);return delete f[i.key],{children:f}}))},n.render=function(){var i=this.props,o=i.component,c=i.childFactory,u=S0(i,["component","childFactory"]),f=this.state.contextValue,h=tz(this.state.children).map(c);return delete u.appear,delete u.enter,delete u.exit,o===null?En.createElement(Ih.Provider,{value:f},h):En.createElement(Ih.Provider,{value:f},En.createElement(o,u,h))},t}(En.Component);Mo.propTypes={};Mo.defaultProps=nz;const sD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function rz(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),sD.reduce((n,r)=>(n[r]=[],n),{}))}const sE={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},iz={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function az({state:e,maxHeight:t,position:n,transitionDuration:r}){const[i,o]=n.split("-"),c=o==="center"?`${i}-center`:o,u={opacity:0,maxHeight:t,transform:sE[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:iz[c]},h={opacity:0,maxHeight:0,transform:sE[c]};return{...u,...{entering:f,entered:f,exiting:h,exited:h}[e]}}function oz(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const lD=y.forwardRef(({data:e,onHide:t,autoClose:n,...r},i)=>{const{autoClose:o,message:c,...u}=e,f=oz(n,e.autoClose),h=y.useRef(-1),m=()=>window.clearTimeout(h.current),g=()=>{t(e.id),m()},v=()=>{typeof f=="number"&&(h.current=window.setTimeout(g,f))};return y.useEffect(()=>{var b;(b=e.onOpen)==null||b.call(e,e)},[]),y.useEffect(()=>(v(),m),[f]),s.jsx(N0,{...r,...u,onClose:g,ref:i,onMouseEnter:m,onMouseLeave:v,children:c})});lD.displayName="@mantine/notifications/NotificationContainer";var cD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const sz=Ja,lz={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Qr("overlay"),store:rl,withinPortal:!0},cz=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":le(n)}}),eo=ve((e,t)=>{const n=se("Notifications",lz,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,position:h,autoClose:m,transitionDuration:g,containerWidth:v,notificationMaxHeight:b,limit:S,zIndex:w,store:C,portalProps:E,withinPortal:_,...T}=n,R=Sn(),D=F$(C),k=CN(),M=yx(),I=y.useRef({}),z=y.useRef(0),Y=(R.respectReducedMotion?M:!1)?1:g,W=Ie({name:"Notifications",classes:cD,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:cz});y.useEffect(()=>{C==null||C.updateState(X=>({...X,limit:S||5,defaultPosition:h}))},[S,h]),Ua(()=>{D.notifications.length>z.current&&setTimeout(()=>k(),0),z.current=D.notifications.length},[D.notifications]);const J=rz(D.notifications,h),G=sD.reduce((X,P)=>(X[P]=J[P].map(({style:L,...$})=>s.jsx(sz,{timeout:Y,onEnter:()=>I.current[$.id].offsetHeight,nodeRef:{current:I.current[$.id]},children:H=>s.jsx(lD,{ref:O=>{I.current[$.id]=O},data:$,onHide:O=>aD(O,C),autoClose:m,...W("notification",{style:{...az({state:H,position:P,transitionDuration:Y,maxHeight:b}),...L}})})},$.id)),X),{});return s.jsxs(Wo,{withinPortal:_,...E,children:[s.jsx(ce,{...W("root"),"data-position":"top-center",ref:t,...T,children:s.jsx(Mo,{children:G["top-center"]})}),s.jsx(ce,{...W("root"),"data-position":"top-left",...T,children:s.jsx(Mo,{children:G["top-left"]})}),s.jsx(ce,{...W("root",{className:cc.classNames.fullWidth}),"data-position":"top-right",...T,children:s.jsx(Mo,{children:G["top-right"]})}),s.jsx(ce,{...W("root",{className:cc.classNames.fullWidth}),"data-position":"bottom-right",...T,children:s.jsx(Mo,{children:G["bottom-right"]})}),s.jsx(ce,{...W("root"),"data-position":"bottom-left",...T,children:s.jsx(Mo,{children:G["bottom-left"]})}),s.jsx(ce,{...W("root"),"data-position":"bottom-center",...T,children:s.jsx(Mo,{children:G["bottom-center"]})})]})});eo.classes=cD;eo.displayName="@mantine/notifications/Notifications";eo.show=di.show;eo.hide=di.hide;eo.update=di.update;eo.clean=di.clean;eo.cleanQueue=di.cleanQueue;eo.updateState=di.updateState;class uz{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Rd{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class dz{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(i,o){const c=i.consumeAndParse(n);return r(o,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(i,o,c){const u=i.consumeAndParse(n);return r(o,c,u)},precedence:n})}construct(t){return new fz(t,this.prefixParselets,this.infixParselets)}}class fz{constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){const n=this.peek();return(n==null?void 0:n.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let i=r.parse(this,n);for(;t>this.getPrecedence();){const o=this.consume();i=this.getInfixParselet(o).parse(this,i,o)}return i}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){var r,i;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const o=this.peek();throw Error(`Expected ${t} but got "${o.id}" (${o.value}) at line ${o.line} column ${o.column}.`)}if(n&&((i=this.peek())==null?void 0:i.value)!==n){const o=this.peek();throw Error(`Expected "${n}" but got "${o.value}" at line ${o.line} column ${o.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}class uD{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 Ui="http://hl7.org",dD="ok",hz="created",pz="gone",mz="not-modified",gz="not-found",vz="unauthorized",yz="forbidden",xz="accepted",bz={resourceType:"OperationOutcome",id:dD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Sz={resourceType:"OperationOutcome",id:gz,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},ad={resourceType:"OperationOutcome",id:vz,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},wz={...ad,issue:[...ad.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},lE={...ad,issue:[...ad.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},J0={resourceType:"OperationOutcome",id:yz,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function ia(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function yn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function jz(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Cz(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 Yp(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function fD(e){return e.id===dD||e.id===hz||e.id===mz||e.id===xz}function Ez(e){return e.id===pz}class dt extends Error{constructor(t,n){super(hD(t)),this.outcome=t,this.cause=n}}function Zt(e){return e instanceof dt?e.outcome:Yp(e)?e:ia(Ye(e))}function Ye(e){return e?typeof e=="string"?e:Cz(e)?e.message:Yp(e)?hD(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function hD(e){var n;const t=((n=e.issue)==null?void 0:n.map(pD))??[];return t.length>0?t.join("; "):"Unknown error"}function pD(e){var n,r;let t;return(n=e.details)!=null&&n.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(r=e.expression)!=null&&r.length&&(t+=` (${e.expression.join(", ")})`),t}function Tz(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 Rz(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(([i,o])=>[i,Tz(i,o)])),constraints:[],innerTypes:[]};return t}const _z={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},Dz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},Az={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"}]}}},kz={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"}]}}},Pz={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"}]}}},Nz={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"}]}}},Oz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},Mz={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"}]}}},Iz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},Lz={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"}]}}},$z={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"}]}}},zz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Uz={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"}]}}},Bz={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"}]}}},Vz={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"}]}}},Fz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},Hz={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"}]}}},qz={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"]}]}}},Gz={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"]}]}}},Wz={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"}]}}},Qz={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"}]}}},Yz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},Xz={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"}]}}},Kz={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"}]}}},Zz={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"}]}}},Jz={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"}]}}},e8={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"]}]}}},t8={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"]}]}}},n8={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"}]}}},r8={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"}]}}},i8={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"}]}}},a8={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"}]}}},o8={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"]}]}}},s8={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"}]}}},l8={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"}]}}},c8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},u8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},d8={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"]}]}}},f8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},h8={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"}]}}},p8={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"}]}}},m8={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"}]}}},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"}]}}},v8={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"]}]}}},y8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},x8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},reference:{type:[{code:"string"}]},type:{type:[{code:"uri"}]},identifier:{type:[{code:"Identifier"}]},display:{type:[{code:"string"}]}}},b8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},label:{type:[{code:"string"}]},display:{type:[{code:"string"}]},citation:{type:[{code:"markdown"}]},url:{type:[{code:"url"}]},document:{type:[{code:"Attachment"}]},resource:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/Resource"]}]}}},S8={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"}]}}},w8={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"}]}}},j8={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"}]}}},C8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},E8={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"}]}}},T8={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"}]}}},R8={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"}]}}},_8={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"]}]}}},D8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},A8={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"}]}}},k8={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"}]}}},P8={Element:_z,BackboneElement:Dz,Address:Az,Age:kz,Annotation:Pz,Attachment:Nz,CodeableConcept:Oz,Coding:Mz,ContactDetail:Iz,ContactPoint:Lz,Contributor:$z,Count:zz,DataRequirement:Uz,DataRequirementCodeFilter:Bz,DataRequirementDateFilter:Vz,DataRequirementSort:Fz,Distance:Hz,Dosage:qz,DosageDoseAndRate:Gz,Duration:Wz,ElementDefinition:Qz,ElementDefinitionSlicingDiscriminator:Yz,ElementDefinitionSlicing:Xz,ElementDefinitionBase:Kz,ElementDefinitionType:Zz,ElementDefinitionExample:Jz,ElementDefinitionConstraint:e8,ElementDefinitionBinding:t8,ElementDefinitionMapping:n8,Expression:r8,Extension:i8,HumanName:a8,Identifier:o8,MarketingStatus:s8,Meta:l8,Money:c8,Narrative:u8,ParameterDefinition:d8,Period:f8,Population:h8,ProdCharacteristic:p8,ProductShelfLife:m8,Quantity:g8,Range:v8,Ratio:y8,Reference:x8,RelatedArtifact:b8,SampledData:S8,Signature:w8,SubstanceAmount:j8,SubstanceAmountReferenceRange:C8,Timing:E8,TimingRepeat:T8,TriggerDefinition:R8,UsageContext:_8,MoneyQuantity:D8,SimpleQuantity:A8,IdentityProvider:k8};function N8(e){return new M8(e).parse()}const Lh=Rz(P8),eb=Object.create(null),cE=Object.create(null),O8={"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=cE[e],t||(t=cE[e]=Object.create(null)),t}function uE(e){var r;const n=(Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(i=>i.resource))??[]).filter(i=>(i==null?void 0:i.resourceType)==="StructureDefinition");TU(n);for(const i of n)gD(i)}function gD(e){var o,c;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=N8(e),n=O8[e.url];let r,i;n?(r=Lh,i=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(o=e.type)!=null&&o.startsWith("http://")||(c=e.type)!=null&&c.startsWith("https://")?(r=Lh,i=e.type):(r=mD(e.url),i=e.type),r[i]=t;for(const u of t.innerTypes)u.parentType=t,r[u.name]=u;eb[e.url]=t}function vD(e){return!!Lh[e]}function Xp(e,t){if(t){const n=mD(t)[e];if(n)return n}return Lh[e]}function yD(e,t){const n=Xp(e,t);if(!n)throw new dt(ia("Unknown data type: "+e));return n}function tb(e){return!!eb[e]}function Nc(e){return eb[e]}class M8{constructor(t){var n;if(!((n=t.snapshot)!=null&&n.element)||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,path:this.root.path,title:t.title,type:t.type,url:t.url,version:t.version,kind:t.kind,description:$8(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,i,o,c;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((n=t.id)!=null&&n.includes(":")){if((r=this.slicingContext)!=null&&r.current){const u=Xv(t,this.slicingContext.path);this.slicingContext.current.elements[u]=this.parseElementDefinition(t)}}else{const u=this.parseElementDefinition(t);this.checkFieldEnter(t,u);let f=this.backboneContext;for(;f;){if((i=t.path)!=null&&i.startsWith(f.path+".")){f.type.elements[Xv(t,f.path)]=u;break}f=f.parent}if(!f){const h=Xv(t,this.root.path);t.isSummary&&((o=this.resourceSchema.summaryProperties)==null||o.add(h.replace("[x]",""))),u.min>0&&((c=this.resourceSchema.mandatoryProperties)==null||c.add(h.replace("[x]",""))),this.resourceSchema.elements[h]=u}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),this.slicingContext&&!Yl(this.slicingContext.path,t==null?void 0:t.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var r,i,o;for(;this.backboneContext&&!Yl((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=xE(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:Yl((i=this.backboneContext)==null?void 0:i.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,n){var r,i,o,c;L8(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((i=t.slicing)==null?void 0:i.discriminator)??[]).map(u=>{if(u.type!=="value"&&u.type!=="pattern"&&u.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${u.type}`);return{path:u.path,type:u.type}}),slices:[],ordered:((o=t.slicing)==null?void 0:o.ordered)??!1,rule:(c=t.slicing)==null?void 0:c.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!Yl(this.backboneContext.path,t==null?void 0:t.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!Yl(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){const t=this.peek();if(t)return this.index++,t}peek(){var n,r,i,o,c;const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const u=t.contentReference.slice(t.contentReference.indexOf("#")+1),f=this.elementIndex[u];return f?{...f,id:t.id,path:t.path,min:t.min??f.min,max:t.max??f.max,base:{path:((n=f.base)==null?void 0:n.path)??u,min:((r=t.base)==null?void 0:r.min)??((i=f.base)==null?void 0:i.min)??f.min,max:((o=t.base)==null?void 0:o.max)??((c=f.base)==null?void 0:c.max)??f.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(Yl(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(i=>["BackboneElement","Element"].includes(i.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var i;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=xE(t)),r||(r=(i=ha(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:i.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var o,c;const n=dE(t.max),r=(o=t.base)!=null&&o.max?dE(t.base.max):n,i={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((c=t.base)==null?void 0:c.path)||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(u=>({key:u.key??"",severity:u.severity??"error",expression:u.expression??"",description:u.human??""})),type:this.parseElementDefinitionType(t),fixed:fE(vc(i,"fixed[x]")),pattern:fE(vc(i,"pattern[x]")),binding:t.binding}}}function dE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Xv(e,t=""){return I8(e.path,t)}function I8(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Yl(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function fE(e){return Array.isArray(e)&&e.length>0?e[0]:Rn(e)?void 0:e}function L8(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(i=>i.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function $8(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function z8(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?U8:vc,[i,...o]=t.split(".");let c=[r(e,i,n)];for(const u of o){const f=[];for(const h of c)if(Array.isArray(h))for(const m of h)f.push(r(m,u,n));else(n!=null&&n.withPath&&h&&h.value!==void 0||!(n!=null&&n.withPath)&&h!==void 0)&&f.push(r(h,u,n));c=f}return c}function U8(e,t,n){const r=e.path;return B8(vc(e,t,n),r,t)}function B8(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((i,o)=>({...i,path:`${r}${n}[${o}]`})):{...e,path:`${r}${n}`}}const xD={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 V8(e,t,n,r){var c;if(Array.isArray(e))return!1;let i;t.path==="$this"?i=n:i=(r??n.elements)[t.path];const o=n.type;switch(t.type){case"value":case"pattern":if(!e||!i)return!1;if(i.pattern)return ib(e,i.pattern);if(i.fixed)return la(e,i.fixed);if(((c=i.binding)==null?void 0:c.strength)==="required"&&i.binding.valueSet)return!0;break;case"type":return!e||!(o!=null&&o.length)?!1:o.some(u=>u.code===e.type)}return!1}function Qe(e){return[{type:ae.boolean,value:e}]}function mi(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:ae.integer,value:e}:typeof e=="number"?{type:ae.decimal,value:e}:typeof e=="boolean"?{type:ae.boolean,value:e}:typeof e=="string"?{type:ae.string,value:e}:fi(e)?{type:ae.Quantity,value:e}:pa(e)?{type:e.resourceType,value:e}:DD(e)?{type:ae.CodeableConcept,value:e}:_D(e)?{type:ae.Coding,value:e}:{type:ae.BackboneElement,value:e}}function ta(e){return e.length===0?!1:!!e[0].value}function Fa(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 vc(e,t,n){if(!e.value)return;const r=Xo(e.type,t,n==null?void 0:n.profileUrl);return r?bD(e,t,r):_d(e,t)}function bD(e,t,n){const r=e.value,i=n.type;if(!i||i.length===0)return;let o,c="undefined",u;const f=n.path.lastIndexOf("."),h=n.path.substring(f+1);for(const m of i){const g=h.replace("[x]",In(m.code));if(o=r[g],u=r["_"+g],o!==void 0||u!==void 0){c=m.code;break}}if(u)if(Array.isArray(o)){o=o.slice();for(let m=0;m<Math.max(o.length,u.length);m++)o[m]=gE(o[m],u[m])}else o=gE(o,u);if(!Rn(o))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(o)?o.map(m=>hE(m,c)):hE(o,c)}function hE(e,t){return t==="Resource"&&pa(e)&&(t=e.resourceType),{type:t,value:e}}function _d(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const i=n[t];Array.isArray(i)?r=i.map(mi):r=mi(i)}else{const i=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const o of Object.values(ae)){const c=i+In(o);if(c in n){const u=n[c];Array.isArray(u)?r=u.map(f=>({type:o,value:f})):r={type:o,value:u};break}}}if(Array.isArray(r)){if(r.length===0||Rn(r[0]))return}else if(Rn(r))return;return r}function SD(e){const t=[];for(const n of e){let r=!1;for(const i of t)if(ta(Kp(n,i))){r=!0;break}r||t.push(n)}return t}function F8(e){return Qe(!ta(e))}function H8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Qe(!1):Qe(e.every((n,r)=>ta(Kp(n,t[r]))))}function q8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Qe(!0):Qe(e.some((n,r)=>!ta(Kp(n,t[r]))))}function Kp(e,t){var i,o;const n=(i=e.value)==null?void 0:i.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?Qe(Math.abs(n-r)<1e-8):fi(n)&&fi(r)?Qe(ED(n,r)):Qe(typeof n=="object"&&typeof r=="object"?nb(e,t):n===r)}function wD(e,t){return e.length===0&&t.length===0?Qe(!0):e.length!==t.length?Qe(!1):(e.sort(pE),t.sort(pE),Qe(e.every((n,r)=>ta(G8(n,t[r])))))}function G8(e,t){const{type:n,value:r}=e,{type:i,value:o}=t,c=r==null?void 0:r.valueOf(),u=o==null?void 0:o.valueOf();return typeof c=="number"&&typeof u=="number"?Qe(Math.abs(c-u)<.01):fi(c)&&fi(u)?Qe(ED(c,u)):Qe(n==="Coding"&&i==="Coding"?typeof c!="object"||typeof u!="object"?!1:c.code===u.code&&c.system===u.system:typeof c=="object"&&typeof u=="object"?nb({...c,id:void 0},{...u,id:void 0}):typeof c=="string"&&typeof u=="string"?c.toLowerCase()===u.toLowerCase():c===u)}function pE(e,t){var i,o;const n=(i=e.value)==null?void 0:i.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function jD(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 W8(n);case"DateTime":return $h(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return CD(n);case"Quantity":return fi(n);default:return e.type===r||typeof n=="object"&&(n==null?void 0:n.resourceType)===r}}function W8(e){return typeof e=="string"&&!!xD.date.exec(e)}function $h(e){return typeof e=="string"&&!!xD.dateTime.exec(e)}function CD(e){return!!(e&&typeof e=="object"&&("start"in e&&$h(e.start)||"end"in e&&$h(e.end)))}function fi(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function ED(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 nb(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i],c=t[i];if(mE(o)&&mE(c)){if(!nb(o,c))return!1}else if(o!==c)return!1}return!0}function mE(e){return e!==null&&typeof e=="object"}function gE(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return Q8(e??{},t)}return e}function Q8(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function Y8(e,t){return pa(e,t)&&"id"in e&&typeof e.id=="string"}function nn(e){const t=zt(e)??"undefined/undefined",n=Ha(e);return n===t?{reference:t}:{reference:t,display:n}}function zt(e){if(Ko(e))return e.reference;if(Y8(e))return`${e.resourceType}/${e.id}`}function Vs(e){if(e)return Ko(e)?e.reference.split("/")[1]:e.id}function X8(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Ha(e){if(X8(e)){const t=K8(e);if(t)return t}if(e.resourceType==="Device"){const t=Z8(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Ho(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]),DD(t))return Ho(t);if(lU(t))return t.text}return zt(e)??""}function K8(e){const t=e.name;if(t&&t.length>0)return Oc(t[0])}function Z8(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function J8(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=vE(n);if(r)return r}else return vE(t)}function vE(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function TD(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 i=n.getUTCFullYear(),o=n.getUTCMonth(),c=n.getUTCDate(),u=r.getUTCFullYear(),f=r.getUTCMonth(),h=r.getUTCDate();let m=u-i;(f<o||f===o&&h<c)&&m--;let g=u*12+f-(i*12+o);h<c&&g--;const v=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:v}}function eU(e,t){const{years:n,months:r,days:i}=TD(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":i.toString().padStart(3,"0")+"D"}function ha(e,...t){var r;let n=e;for(let i=0;i<t.length&&n;i++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(o=>o.url===t[i]);return n}function Ii(e,t){const n=rb(e);return JSON.stringify(n,null,t?2:void 0)??""}function rb(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?tU(e):nU(e):e}function tU(e){const t=e.length;if(t===0)return;let n,r=0;for(let i=0;i<t;i++){const o=e[i],c=rb(o);c!==o&&!n&&(n=Array.from(e)),c===void 0?n&&(n[i]=null):(n&&(n[i]=c),r++)}if(r!==0)return n??e}function nU(e){let t,n=0;for(const r in e){const i=e[r],o=rb(i);o!==i&&!t&&(t={...e}),o===void 0?t&&delete t[r]:(t&&(t[r]=o),n++)}if(n!==0)return t??e}function Rn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Tn(e):!1}function Tn(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 la(e,t,n){return e===t||Rn(e)&&Rn(t)?!0:Rn(e)||Rn(t)?!1:Array.isArray(e)&&Array.isArray(t)?rU(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?iU(e,t,n):(sr(e)||sr(t),!1)}function rU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!la(e[n],t[n]))return!1;return!0}function iU(e,t,n){const r=new Set;Object.keys(e).forEach(i=>r.add(i)),Object.keys(t).forEach(i=>r.add(i)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const i of r){const o=e[i],c=t[i];if(!la(o,c,i))return!1}return!0}function ib(e,t){return Rn(e)?!0:Rn(t)?!1:Array.isArray(e)&&Array.isArray(t)?aU(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?oU(e,t):sr(e)||sr(t)?!1:e===t}function aU(e,t){return t.every(n=>e.some(r=>ib(r,n)))}function oU(e,t){return Object.entries(t).every(([n,r])=>n in e&&ib(e[n],r))}function Wr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function RD(e){return/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i.test(e)}function sr(e){return e!==null&&typeof e=="object"}function sU(e){return typeof e=="string"}function _D(e){return sr(e)&&"code"in e&&typeof e.code=="string"}function DD(e){return sr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(_D)}function lU(e){return sr(e)&&"text"in e&&typeof e.text=="string"}const AD=[];for(let e=0;e<256;e++)AD.push(e.toString(16).padStart(2,"0"));function cU(e){const t=kD(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=AD[n[i]];return r.join("")}function uU(e){const t=kD(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=String.fromCharCode(n[i]);return window.btoa(r.join(""))}function kD(e){return ArrayBuffer.isView(e)?e.buffer:e}function In(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function ab(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function Ps(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function dU(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(i=>i.system===t))==null?void 0:r.code}function fU(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const yE=e=>new Promise(t=>{setTimeout(t,e)});function Uy(e,t,n){const r=[];for(let i=0;i<n-1;i++){const o=e.indexOf(t);if(o<0)break;r.push(e.slice(0,o)),e=e.slice(o+t.length)}return r.push(e),r}function hU(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function $u(e,t){return e?(e.push(t),e):[t]}function od(e){return e.sort((t,n)=>t.localeCompare(n))}function ob(e){return e.endsWith("/")?e:e+"/"}function pU(e){return e.startsWith("/")?e.slice(1):e}function Zi(e,t){return new URL(pU(t),ob(e.toString())).toString()}function mU(e,t){return Zi(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function gU(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 PD(e,t){var n,r;return(r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function vU(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const i=e.meta.profile.indexOf(t);e.meta.profile.splice(i,1)}return e}function yc(e){if(!e)return"";switch(e.type){case"Address":return ND(e.value);case"CodeableConcept":return Ho(e.value);case"Coding":return Dd(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Oc(e.value);case"Quantity":return Ns(e.value);case"Reference":return yU(e.value);default:return e.value.toString()}}function yU(e){return e?e.display??e.reference??Ii(e):""}function ND(e,t){if(!e)return"";const n=[];if(e.line&&n.push(...e.line),e.city||e.state||e.postalCode){const r=[];e.city&&r.push(e.city),e.state&&r.push(e.state),e.postalCode&&r.push(e.postalCode),n.push(r.join(", "))}return e.use&&(t!=null&&t.use),n.join(", ").trim()}function Oc(e,t){if(!e)return"";const n=[];if(e.prefix&&(t==null?void 0:t.prefix)!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&n.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&n.push("["+e.use+"]"),n.length===0){const r=ld(e.text);if(r)return r}return n.join(" ").trim()}function Zp(e){return e instanceof Date&&!isNaN(e.getTime())}function xU(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Zp(r)?r.toLocaleTimeString(t,n):""}function gr(e,t,n){if(!e)return"";const r=new Date(e);return Zp(r)?r.toLocaleString(t,n):""}function bU(e,t,n){return!e||!e.start&&!e.end?"":gr(e.start,t,n)+" - "+gr(e.end,t,n)}const SU={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},wU={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},jU={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function OD(e){if(!e)return"";const t=[];return CU(t,e.repeat),e.event&&t.push(e.event.map(n=>gr(n)).join(", ")),In(t.join(" ").trim())}function CU(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,i=t.periodUnit;n===1&&r===1?e.push(SU[i]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+wU[i]):e.push("per "+r+" "+jU[i])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(In).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(o=>xU(o)).join(", "))}function sd(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},i=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(i==null?void 0:i.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(i==null?void 0:i.value)===void 0?`>= ${Ns(r)}`:(r==null?void 0:r.value)===void 0&&(i==null?void 0:i.value)!==void 0?`<= ${Ns(i)}`:((r==null?void 0:r.unit)===(i==null?void 0:i.unit)&&(r==null||delete r.unit),`${Ns(r)} - ${Ns(i)}`)}function Ns(e,t){if(!e)return"";const n=[];return e.comparator&&(n.push(e.comparator),n.push(" ")),e.value!==void 0&&n.push(e.value),e.unit&&(e.unit!=="%"&&n[n.length-1]!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function EU(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Ho(e){if(!e)return"";const t=ld(e.text);return t||(e.coding?e.coding.map(n=>Dd(n)).join(", "):"")}function Dd(e,t){const n=ld(e==null?void 0:e.display);return n?`${n}`:ld(e==null?void 0:e.code)??""}function MD(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(Ns(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Ho(e.valueCodeableConcept));else{const n=ld(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>MD(n)).join(" / ")),t.join(" / ").trim()}function ld(e){return typeof e=="string"?e:void 0}const ae={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function TU(e){var n;const t=Array.isArray(e)?e:((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];for(const r of t)(r==null?void 0:r.resourceType)==="StructureDefinition"&&r.kind==="resource"&&ID(r.type)}function ID(e){let t=ca.types[e];return t||(t={searchParamsDetails:{}},ca.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 RU(e){for(const t of e.base??[]){const n=ID(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function xE(e){var n,r,i,o;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?_U((o=((i=e.base)==null?void 0:i.path)??e.path)==null?void 0:o.split(".")):t}function _U(e){return e.length===1?e[0]:e.map(In).join("")}function sb(e){var t;return(t=ca.types[e])==null?void 0:t.searchParams}function DU(e,t){var n,r;return(r=(n=ca.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function Fs(e){const t=e.replaceAll("[x]","").split(".").pop();return LD(t)}function LD(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(kU).join(" ").replace("_"," ").replace(/\s+/g," ")}const AU=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function kU(e){const t=e.toUpperCase();return e===t?e:AU.has(t)?t:t.charAt(0)+e.slice(1)}function Xo(e,t,n){const r=Xp(e,n);if(r)return PU(r.elements,t)}function PU(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const i=t[r];if(i>="A"&&i<="Z"){const o=t.slice(0,r)+"[x]",c=e[o];if(c)return c}}}function pa(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function Ko(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const ca={types:{}};function xh(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 Oa=()=>[],Rr={empty:(e,t)=>Qe(t.length===0||t.every(n=>Rn(n.value))),hasValue:(e,t)=>Qe(t.length!==0),exists:(e,t,n)=>Qe(n?t.filter(r=>ta(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Rn(r.value))),all:(e,t,n)=>Qe(t.every(r=>ta(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Qe(!1);return Qe(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Qe(!0);return Qe(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Qe(!1);return Qe(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Qe(!0);return Qe(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Qe(!0);const r=n.eval(e,bs(e));return r.length===0?Qe(!1):Qe(t.every(i=>r.some(o=>o.value===i.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,bs(e));return r.length===0?Qe(!0):t.length===0?Qe(!1):Qe(r.every(i=>t.some(o=>o.value===i.value)))},count:(e,t)=>[{type:ae.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(i=>i.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Qe(t.length===Rr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>ta(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:Oa,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{var i;const r=(i=n.eval(e,t)[0])==null?void 0:i.value;if(typeof r!="number")throw new Error("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{var i;const r=(i=n.eval(e,t)[0])==null?void 0:i.value;if(typeof r!="number")throw new Error("Expected a number for take(num)");return r>=t.length?t:r<=0?[]:t.slice(0,r)},intersect:(e,t,n)=>{if(!n)return t;const r=n.eval(e,bs(e)),i=[];for(const o of t)!i.some(c=>c.value===o.value)&&r.some(c=>c.value===o.value)&&i.push(o);return i},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,bs(e)),i=[];for(const o of t)r.some(c=>c.value===o.value)||i.push(o);return i},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,bs(e));return SD([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,bs(e));return[...t,...r]},htmlChecks:(e,t,n)=>[mi(!0)],iif:(e,t,n,r,i)=>{const o=n.eval(e,t);if(o.length>1||o.length===1&&typeof o[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ta(o)?r.eval(e,t):i?i.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);if(typeof n=="boolean")return[{type:ae.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Qe(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Qe(!0);if(["false","f","no","n","0","0.0"].includes(r))return Qe(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Qe(Rr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return typeof n=="number"?[{type:ae.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:ae.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:ae.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Qe(Rr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ae.date,value:xh(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Qe(Rr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:ae.dateTime,value:xh(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Qe(Rr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return typeof n=="number"?[{type:ae.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:ae.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:ae.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Qe(Rr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return fi(n)?[{type:ae.Quantity,value:n}]:typeof n=="number"?[{type:ae.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:ae.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:ae.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Qe(Rr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);return n==null?[]:fi(n)?[{type:ae.string,value:`${n.value} '${n.unit}'`}]:[{type:ae.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Qe(Rr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ji(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:ae.time,value:xh("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Qe(Rr.toTime(e,t).length===1),indexOf:(e,t,n)=>li((r,i)=>r.indexOf(i),e,t,n),substring:(e,t,n,r)=>li((i,o,c)=>{const u=o,f=c?u+c:i.length;return u<0||u>=i.length?void 0:i.substring(u,f)},e,t,n,r),startsWith:(e,t,n)=>li((r,i)=>r.startsWith(i),e,t,n),endsWith:(e,t,n)=>li((r,i)=>r.endsWith(i),e,t,n),contains:(e,t,n)=>li((r,i)=>r.includes(i),e,t,n),upper:(e,t)=>li(n=>n.toUpperCase(),e,t),lower:(e,t)=>li(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>li((i,o,c)=>i.replaceAll(o,c),e,t,n,r),matches:(e,t,n)=>li((r,i)=>!!new RegExp(i).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>li((i,o,c)=>i.replaceAll(new RegExp(o,"g"),c),e,t,n,r),length:(e,t)=>li(n=>n.length,e,t),toChars:(e,t)=>li(n=>n?n.split(""):void 0,e,t),encode:Oa,decode:Oa,escape:Oa,unescape:Oa,trim:Oa,split:Oa,join:(e,t,n)=>{var i;const r=((i=n==null?void 0:n.eval(e,bs(e))[0])==null?void 0:i.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:ae.string,value:t.map(o=>{var c;return((c=o.value)==null?void 0:c.toString())??""}).join(r)}]},abs:(e,t)=>Xi(Math.abs,e,t),ceiling:(e,t)=>Xi(Math.ceil,e,t),exp:(e,t)=>Xi(Math.exp,e,t),floor:(e,t)=>Xi(Math.floor,e,t),ln:(e,t)=>Xi(Math.log,e,t),log:(e,t,n)=>Xi((r,i)=>Math.log(r)/Math.log(i),e,t,n),power:(e,t,n)=>Xi(Math.pow,e,t,n),round:(e,t)=>Xi(Math.round,e,t),sqrt:(e,t)=>Xi(Math.sqrt,e,t),truncate:(e,t)=>Xi(n=>n|0,e,t),children:Oa,descendants:Oa,trace:(e,t,n)=>t,now:()=>[{type:ae.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:ae.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:ae.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,i)=>{var h;const o=Rr.toDateTime(e,n.eval(e,t));if(o.length===0)throw new Error("Invalid start date");const c=Rr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const u=(h=i.eval(e,t)[0])==null?void 0:h.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const f=TD(o[0].value,c[0].value);return[{type:ae.Quantity,value:{value:f[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof zh?r=n.name:n instanceof lb&&(r=n.left.name+"."+n.right.name),r?t.map(i=>({type:ae.boolean,value:jD(i,r)})):[]},not:(e,t)=>Rr.toBoolean(e,t).map(n=>({type:ae.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let i;if(typeof r=="string")i=r;else if(typeof r=="object"){const o=r;if(o.resource)return mi(o.resource);o.reference?i=o.reference:o.type&&o.identifier&&(i=`${o.type}?identifier=${o.identifier.system}|${o.identifier.value}`)}if(i!=null&&i.includes("?")){const[o]=i.split("?");return{type:o,value:{resourceType:o}}}if(i!=null&&i.includes("/")){const[o,c]=i.split("/");return{type:o,value:{resourceType:o,id:c}}}return{type:ae.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:ae.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:ae.BackboneElement,value:{namespace:"System",name:"Integer"}}:pa(n)?{type:ae.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:ae.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 i=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(o=>{var c;return{type:ae.boolean,value:((c=o.value)==null?void 0:c.resourceType)===i}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:ae.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let i="";return n instanceof zh&&(i=n.name),i&&!r.reference.startsWith(i+"/")?[]:[{type:ae.id,value:Vs(r)}]},extension:(e,t,n)=>{var o;const r=n.eval(e,t)[0].value,i=(o=t==null?void 0:t[0])==null?void 0:o.value;if(i){const c=ha(i,r);if(c)return[{type:ae.Extension,value:c}]}return[]}};function li(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Ji(n,1);if(typeof i!="string")throw new Error("String function cannot be called with non-string");const o=e(i,...r.map(c=>{var u;return(u=c==null?void 0:c.eval(t,n)[0])==null?void 0:u.value}));return o===void 0?[]:Array.isArray(o)?o.map(mi):[mi(o)]}function Xi(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Ji(n,1),o=fi(i),c=o?i.value:i;if(typeof c!="number")throw new Error("Math function cannot be called with non-number");const u=e(c,...r.map(m=>{var g;return(g=m.eval(t,n)[0])==null?void 0:g.value})),f=o?ae.Quantity:n[0].type,h=o?{...i,value:u}:u;return[{type:f,value:h}]}function Ji(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 bs(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class $D{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const i of n)r.push(this.child.eval({parent:t,variables:{$this:i}},[i]));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 Xl{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class zh{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(i=>this.evalValue(i)).filter(i=>(i==null?void 0:i.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 pa(n,this.name)?t:vc(t,this.name)}toString(){return this.name}}class NU{eval(){return[]}toString(){return"{}"}}class OU extends uz{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 Uh extends Rd{constructor(t,n){super("as",t,n)}eval(t,n){return Rr.ofType(t,this.left.eval(t,n),this.right)}}class Or extends Rd{}class _i extends Or{constructor(t,n,r,i){super(t,n,r),this.impl=i}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.eval(t,n);if(i.length!==1)return[];const o=r[0].value,c=i[0].value,u=fi(o)?o.value:o,f=fi(c)?c.value:c,h=this.impl(u,f);return typeof h=="boolean"?Qe(h):fi(o)?[{type:ae.Quantity,value:{...o,value:h}}]:[mi(h)]}}class MU extends Rd{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n),o=[...r,...i];return o.length>0&&o.every(c=>typeof c.value=="string")?[{type:ae.string,value:o.map(c=>c.value).join("")}]:o}}class IU extends Or{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return Qe(r.some(o=>o.value===i[0].value))}}class LU extends Or{constructor(t,n){super("in",t,n)}eval(t,n){const r=Fa(this.left.eval(t,n)),i=this.right.eval(t,n);return r?Qe(i.some(o=>Kp(r,o)[0].value)):[]}}class lb extends Rd{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 cb extends Rd{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return SD([...r,...i])}}class $U extends Or{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return H8(r,i)}}class zU extends Or{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return q8(r,i)}}class UU extends Or{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return wD(r,i)}}class BU extends Or{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return F8(wD(r,i))}}class ub extends Or{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.name;return Qe(jD(r[0],i))}}class VU extends Or{constructor(t,n){super("and",t,n)}eval(t,n){const r=Fa(this.left.eval(t,n),"boolean"),i=Fa(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(i==null?void 0:i.value)===!0?Qe(!0):(r==null?void 0:r.value)===!1||(i==null?void 0:i.value)===!1?Qe(!1):[]}}class FU extends Or{constructor(t,n){super("or",t,n)}eval(t,n){const r=Fa(this.left.eval(t,n),"boolean"),i=Fa(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(i==null?void 0:i.value)===!1?Qe(!1):r!=null&&r.value||i!=null&&i.value?Qe(!0):[]}}class HU extends Or{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Fa(this.left.eval(t,n),"boolean"),i=Fa(this.right.eval(t,n),"boolean");return!r||!i?[]:Qe(r.value!==i.value)}}class qU extends Or{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Fa(this.left.eval(t,n),"boolean"),i=Fa(this.right.eval(t,n),"boolean");return(i==null?void 0:i.value)===!0||(r==null?void 0:r.value)===!1?Qe(!0):!r||!i?[]:Qe(!1)}}class db{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Rr[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 fb{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 i=r[0].value;if(typeof i!="number")throw new Error("Invalid indexer expression: should return integer}");const o=this.left.eval(t,n);return i in o?[o[i]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const GU=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class WU{constructor(t,n,r,i){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(i!=null&&i.dateTimeLiterals),this.symbolRegex=(i==null?void 0:i.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
77
- `))}consumeString(t){this.advance();const r=this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t).replace(/\\u([0-9a-fA-F]{4})/g,(o,c)=>String.fromCodePoint(parseInt(c,16))),i=this.buildToken(t==="`"?"Symbol":"String",r);return this.advance(),i}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 i=this.str.substring(t,this.pos.index);return i.endsWith("T")?i=i.substring(0,i.length-1):!i.startsWith("T")&&n&&!r&&(i+="Z"),this.buildToken("DateTime",i)}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()===" "&&QU(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){var n;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((n=this.prevToken())==null?void 0:n.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
78
- `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,n){const r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:t,value:n,...r}}}function QU(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&GU.includes(e.value)))}const YU=["true","false"],XU=["!=","!~","<=",">=","{}","->"];function KU(e){return new WU(e,YU,XU).tokenize()}const Kt={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},ZU={parse(e){var n;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((n=e.peek())==null?void 0:n.value)+"`");return t}},JU={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new fb(t,n)},precedence:Kt.Indexer},eB={parse(e,t){if(!(t instanceof zh))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new db(t.name,n)},precedence:Kt.FunctionCall};function tB(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r!=null&&r.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function nB(){return new dz().registerPrefix("String",{parse:(e,t)=>new Xl({type:ae.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Xl({type:ae.dateTime,value:xh(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Xl({type:ae.Quantity,value:tB(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Xl({type:t.value.includes(".")?ae.decimal:ae.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Xl({type:ae.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Xl({type:ae.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new zh(t.value)}).registerPrefix("{}",{parse:()=>new NU}).registerPrefix("(",ZU).registerInfix("[",JU).registerInfix("(",eB).prefix("+",Kt.UnaryAdd,(e,t)=>new OU("+",t,n=>n)).prefix("-",Kt.UnarySubtract,(e,t)=>new _i("-",t,t,(n,r)=>-r)).infixLeft(".",Kt.Dot,(e,t,n)=>new lb(e,n)).infixLeft("/",Kt.Divide,(e,t,n)=>new _i("/",e,n,(r,i)=>r/i)).infixLeft("*",Kt.Multiply,(e,t,n)=>new _i("*",e,n,(r,i)=>r*i)).infixLeft("+",Kt.Add,(e,t,n)=>new _i("+",e,n,(r,i)=>r+i)).infixLeft("-",Kt.Subtract,(e,t,n)=>new _i("-",e,n,(r,i)=>r-i)).infixLeft("|",Kt.Union,(e,t,n)=>new cb(e,n)).infixLeft("=",Kt.Equals,(e,t,n)=>new $U(e,n)).infixLeft("!=",Kt.NotEquals,(e,t,n)=>new zU(e,n)).infixLeft("~",Kt.Equivalent,(e,t,n)=>new UU(e,n)).infixLeft("!~",Kt.NotEquivalent,(e,t,n)=>new BU(e,n)).infixLeft("<",Kt.LessThan,(e,t,n)=>new _i("<",e,n,(r,i)=>r<i)).infixLeft("<=",Kt.LessThanOrEquals,(e,t,n)=>new _i("<=",e,n,(r,i)=>r<=i)).infixLeft(">",Kt.GreaterThan,(e,t,n)=>new _i(">",e,n,(r,i)=>r>i)).infixLeft(">=",Kt.GreaterThanOrEquals,(e,t,n)=>new _i(">=",e,n,(r,i)=>r>=i)).infixLeft("&",Kt.Ampersand,(e,t,n)=>new MU(e,n)).infixLeft("and",Kt.And,(e,t,n)=>new VU(e,n)).infixLeft("as",Kt.As,(e,t,n)=>new Uh(e,n)).infixLeft("contains",Kt.Contains,(e,t,n)=>new IU(e,n)).infixLeft("div",Kt.Divide,(e,t,n)=>new _i("div",e,n,(r,i)=>r/i|0)).infixLeft("in",Kt.In,(e,t,n)=>new LU(e,n)).infixLeft("is",Kt.Is,(e,t,n)=>new ub(e,n)).infixLeft("mod",Kt.Modulo,(e,t,n)=>new _i("mod",e,n,(r,i)=>r%i)).infixLeft("or",Kt.Or,(e,t,n)=>new FU(e,n)).infixLeft("xor",Kt.Xor,(e,t,n)=>new HU(e,n)).infixLeft("implies",Kt.Implies,(e,t,n)=>new qU(e,n))}const rB=nB();function hb(e){return new $D(e,rB.construct(KU(e)).consumeAndParse())}function Mc(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const i=n[r];typeof i=="object"&&"type"in i&&"value"in i||(n[r]=mi(n[r]))}return Hs(e,n).map(r=>r.value)}function Hs(e,t,n={},r=void 0){let i;if(typeof e=="string"){const o=r==null?void 0:r.get(e);i=o??hb(e),r&&!o&&r.set(e,i)}else i=e;return i.eval({variables:n},t).map(o=>{var c;return{type:o.type,value:(c=o.value)==null?void 0:c.valueOf()}})}const Jn={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Ic(e,t){var r,i;let n=(i=(r=ca.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:i[t.code];return n||(n=aB(e,t)),n}function iB(e,t,n){let r=ca.types[e];r||(r={},ca.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function aB(e,t){const n=t.code,r=cB(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const u=bh(c),f=hU(()=>u.join("."));u.length===1&&u[0]instanceof Or?i.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?i.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):zD(i,u,e,1),f().endsWith("extension.valueDateTime")&&(i.array=!1)}const o={type:lB(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,parsedExpression:uB(e,t.expression),array:i.array};return iB(e,n,o),o}function zD(e,t,n,r){const i=t[r];if(i instanceof Uh){e.propertyTypes.add(i.right.toString());return}if(i instanceof db){oB(e,i);return}const o=i.toString(),c=Xo(n,o);if(!c)throw new Error(`Element definition not found for ${n} ${o}`);let u=!1,f=r+1;f<t.length&&t[f]instanceof fb&&(u=!0,f++);const h=t[f];if(c.isArray&&!u&&(e.array=!0),f===t.length-1&&h instanceof Uh){e.elementDefinitions.push(c),e.propertyTypes.add(h.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;sB(g)&&(g=c.type[0].code),zD(e,t,g,f)}}function oB(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 ub){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function sB(e){return e==="Element"||e==="BackboneElement"}function lB(e,t){switch(e.type){case"date":return t.size===1&&t.has(ae.date)?Jn.DATE:Jn.DATETIME;case"number":return Jn.NUMBER;case"quantity":return Jn.QUANTITY;case"reference":return t.has(ae.canonical)?Jn.CANONICAL:Jn.REFERENCE;case"token":return t.size===1&&t.has(ae.boolean)?Jn.BOOLEAN:Jn.TEXT;default:return Jn.TEXT}}function cB(e,t){const n=[],r=hb(t);return Bh(e,r.child,n),n}function uB(e,t){const n=[],r=hb(t);if(Bh(e,r.child,n),n.length===0)return r;let i=n[0];for(let o=1;o<n.length;o++)i=new cb(i,n[o]);return new $D("<original-not-available>",i)}function Bh(e,t,n){t instanceof cb?(Bh(e,t.left,n),Bh(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function bh(e){if(e instanceof Uh||e instanceof fb)return[bh(e.left),e].flat();if(e instanceof Or)return[e];if(e instanceof lb)return[bh(e.left),bh(e.right)].flat();if(e instanceof db){if(e.name==="where"&&!(e.args[0]instanceof ub))return[];if(e.name==="last")return[]}return[e]}const Jp=20,ue={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"},UD={contains:ue.CONTAINS,exact:ue.EXACT,above:ue.ABOVE,below:ue.BELOW,text:ue.TEXT,not:ue.NOT,in:ue.IN,"not-in":ue.NOT_IN,"of-type":ue.OF_TYPE,missing:ue.MISSING,identifier:ue.IDENTIFIER,iterate:ue.ITERATE},pb={eq:ue.EQUALS,ne:ue.NOT_EQUALS,lt:ue.LESS_THAN,le:ue.LESS_THAN_OR_EQUALS,gt:ue.GREATER_THAN,ge:ue.GREATER_THAN_OR_EQUALS,sa:ue.STARTS_AFTER,eb:ue.ENDS_BEFORE,ap:ue.APPROXIMATELY,sw:ue.STARTS_WITH};function BD(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,u]=e.split("?");n=c,r=new URLSearchParams(u)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let i;n.includes("/")?i=n.split("/").filter(Boolean).pop():i=n;const o=[];return r&&o.push(...r.entries()),dB(i,o)}function dB(e,t){const n={resourceType:e};for(const[r,i]of t)fB(n,r,i);return n}function fB(e,t,n){var c,u;let r,i;const o=t.indexOf(":");if(o>=0?(r=t.substring(0,o),i=t.substring(o+1)):(r=t,i=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=$u(e.filters,{code:t,operator:ue.EQUALS,value:n});return}switch(r){case"_sort":hB(e,n);break;case"_cursor":e.cursor=n;break;case"_count":e.count=parseInt(n,10);break;case"_offset":e.offset=parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const f=bE(n);i==="iterate"&&(f.modifier=ue.ITERATE),e.include=$u(e.include,f);break}case"_revinclude":{const f=bE(n);i==="iterate"&&(f.modifier=ue.ITERATE),e.revInclude=$u(e.revInclude,f);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const f=(u=(c=ca.types[e.resourceType])==null?void 0:c.searchParams)==null?void 0:u[r];f?e.filters=$u(e.filters,mB(f,i,n)):e.filters=$u(e.filters,gB(r,i,n))}}}}function hB(e,t){for(const n of t.split(",")){let r,i=!1;n.startsWith("-")?(r=n.substring(1),i=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:i})}}const pB=[ue.MISSING,ue.PRESENT];function mB(e,t,n){if(pB.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:i}=vB(n);if(!SE(e,i))throw new dt(ia(`Invalid format for ${e.type} search parameter: ${i}`));return{code:e.code,operator:r,value:i}}case"reference":case"string":case"token":case"uri":if(!SE(e,n))throw new dt(ia(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:yB(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function gB(e,t,n){var i;let r=ue.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in pb&&(n.length===2||(i=n.at(2))!=null&&i.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function vB(e){const t=e.substring(0,2),n=pb[t];return n?{operator:n,value:e.substring(2)}:{operator:ue.EQUALS,value:e}}function yB(e){return UD[e]??ue.EQUALS}function bE(e){const t=e.split(":");if(t.includes("*"))throw new dt(ia("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new dt(ia(`Invalid include value '${e}': must be of the form ResourceType:search-parameter`));if(t.length===2)return{resourceType:t[0],searchParam:t[1]};if(t.length===3)return{resourceType:t[0],searchParam:t[1],targetType:t[2]};throw new dt(ia(`Invalid include value '${e}'`))}function SE(e,t){switch(e.type){case"date":return $h(t);default:return!0}}function Bo(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(xB(n))),e.sortRules&&e.sortRules.length>0&&t.push(bB(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(wE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(wE("_revinclude",n))),t.length===0?"":(od(t),"?"+t.join("&"))}function xB(e){const t=e.operator in UD?":"+e.operator:"",n=e.operator!==ue.EQUALS&&e.operator in pb?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function bB(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function wE(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function mb(e){const t=[];let n="",r=!1;for(const i of e)r?(n+=i,r=!1):i==="\\"?r=!0:i===","?(t.push(n),n=""):n+=i;return t.push(n),t}function SB(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!wB(e,t,n))return!1}return!0}function wB(e,t,n){var i,o;const r=(o=(i=ca.types[t.resourceType])==null?void 0:i.searchParams)==null?void 0:o[n.code];if(!r)return!1;if(n.operator===ue.MISSING||n.operator===ue.PRESENT)return jB(e,n,r);switch(r.type){case"reference":return CB(e,n,r);case"string":case"uri":return VD(e,n,r);case"token":return EB(e,n,r);case"date":return DB(e,n,r);default:return!1}}function jB(e,t,n){const i=Mc(n.expression,e).length>0;return(t.operator===ue.MISSING&&t.value==="false"||t.operator===ue.PRESENT&&t.value==="true")===i}function CB(e,t,n){const r=Mc(n.expression,e),i=em(t.operator);if(t.value===""&&r.length===0)return t.operator===ue.EQUALS;const o=r.map(c=>typeof c=="string"?c:c.reference);for(const c of mb(t.value)){let u=o.includes(c);if(!u&&t.code==="_compartment"&&(u=o.some(f=>f==null?void 0:f.endsWith("/"+c))),u)return!i}return i}function EB(e,t,n){return Ic(e.resourceType,n).type===Jn.BOOLEAN?TB(e,t,n):VD(e,t,n,!0)}function TB(e,t,n){const r=Mc(n.expression,e),i=t.value==="true",o=r.includes(i);return em(t.operator)?!o:o}function VD(e,t,n,r){var h,m,g,v;const o=(v=(g=(m=(h=Ic(e.resourceType,n).elementDefinitions)==null?void 0:h[0])==null?void 0:m.type)==null?void 0:g[0])==null?void 0:v.code,c=Mc(n.expression,e),u=mb(t.value),f=em(t.operator);for(const b of c)for(const S of u){let w;if(o===ae.Identifier?w=RB(b,t.operator,S):o===ae.CodeableConcept?w=_B(b,t.operator,S):w=By(b,t.operator,S,r),w)return!f}return f}function By(e,t,n,r){if(r&&n.includes("|")){const[o,c]=n.split("|");return By(e,t,o,!1)&&(!c||By(e,t,c,!1))}let i="";return e&&(typeof e=="string"?i=e:typeof e=="object"&&(i=JSON.stringify(e))),i.toLowerCase().includes(n.toLowerCase())}function RB(e,t,n){var r,i,o,c;if(n.includes("|")){const[u,f]=n.split("|").map(h=>h.toLowerCase());return!u&&!f?!1:u?((i=e.system)==null?void 0:i.toLowerCase())===u&&(!f||((o=e.value)==null?void 0:o.toLowerCase())===f):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===f}return((c=e.value)==null?void 0:c.toLowerCase())===n.toLowerCase()}function _B(e,t,n){var r,i,o,c;if(n.includes("|")){const[u,f]=n.split("|").map(h=>h.toLowerCase());return!u&&!f?!1:u?((i=e.coding)==null?void 0:i.some(h=>{var m,g;return((m=h.system)==null?void 0:m.toLowerCase())===u&&(!f||((g=h.code)==null?void 0:g.toLowerCase())===f)}))??!1:((r=e.coding)==null?void 0:r.some(h=>{var m;return!h.system&&((m=h.code)==null?void 0:m.toLowerCase())===f}))??!1}return((o=e.text)==null?void 0:o.toLowerCase())===n.toLowerCase()||(((c=e.coding)==null?void 0:c.some(u=>{var f;return((f=u.code)==null?void 0:f.toLowerCase())===n.toLowerCase()}))??!1)}function DB(e,t,n){const r=Mc(n.expression,e),i=mb(t.value),o=em(t.operator);for(const c of r)for(const u of i)if(AB(Vh(c),t.operator,Vh(u)))return!o;return o}function AB(e,t,n){if(!e)return!1;switch(t){case ue.STARTS_AFTER:case ue.GREATER_THAN:return e>n;case ue.GREATER_THAN_OR_EQUALS:return e>=n;case ue.ENDS_BEFORE:case ue.LESS_THAN:return e<n;case ue.LESS_THAN_OR_EQUALS:return e<=n;case ue.EQUALS:case ue.NOT_EQUALS:return e===n;default:return!1}}function Vh(e){if(sU(e))try{return new Date(e).toISOString()}catch(t){console.debug("Failed to parse date",e,t)}else if(CD(e)){if("start"in e)return Vh(e.start);if("end"in e)return Vh(e.end)}}function em(e){return e===ue.NOT_EQUALS||e===ue.NOT}const kB={resourceType:"*"},PB=["DomainConfiguration","JsonWebKey","Login"],NB=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],Os={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},OB=[Os.READ,Os.VREAD,Os.HISTORY,Os.SEARCH];function MB(e,t){return PB.includes(t)?!1:IB(e,Os.UPDATE,t)}function IB(e,t,n){var r;return!!((r=e.resource)!=null&&r.some(i=>HD(i,n,t)))}function FD(e,t,n){var r;return n?(r=n.resource)==null?void 0:r.find(i=>LB(e,t,i)):kB}function LB(e,t,n){var i,o;const r=e.resourceType;return HD(n,r,t)?r==="Binary"?!0:!(n.compartment&&!((o=(i=e.meta)==null?void 0:i.compartment)!=null&&o.some(c=>{var u;return c.reference===((u=n.compartment)==null?void 0:u.reference)}))||n.criteria&&!SB(e,BD(n.criteria))):!1}function HD(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||NB.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||OB.includes(n)}function $B(e){if(typeof window<"u"){const t=window.atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new window.TextDecoder().decode(n)}if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function jE(e){if(typeof window<"u"){const t=new window.TextEncoder().encode(e),n=String.fromCharCode.apply(null,t);return window.btoa(n)}if(typeof Buffer<"u")return Buffer.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function zB(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replace(/-/g,"+").replace(/_/g,"/");return $B(t)}function CE(){const e=new Uint32Array(28);return crypto.getRandomValues(e),cU(e.buffer)}async function UB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function qD(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function GD(e){var i;const t={};e=Wr(e);for(const o of e.entry||[]){const c=o.resource;if(!c)continue;c.meta!==void 0&&(delete c.meta.author,delete c.meta.compartment,delete c.meta.lastUpdated,delete c.meta.project,delete c.meta.versionId,Object.keys(c.meta).length===0&&delete c.meta);const u=c==null?void 0:c.id;u&&(t[u]=qD(),o.fullUrl="urn:uuid:"+t[u],(i=o.resource)==null||delete i.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(o=>{var c;return{fullUrl:o.fullUrl,request:{method:"POST",url:(c=o.resource)==null?void 0:c.resourceType},resource:o.resource}})},(o,c)=>BB(o,c,t),2);return VB(JSON.parse(r))}function BB(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 i=n[r];if(i)return"urn:uuid:"+i}}return t}function VB(e){const t=HB(e),{sorted:n,cycles:r}=FB(t),i={};for(const c of e.entry??[])c.fullUrl&&(i[c.fullUrl]=c);const o=n.map(c=>i[c]);for(const c of r)for(const u of c){const f=i[u],h={...f,request:{...f.request,method:"PUT"}};o.push(h)}return{...e,entry:o}}const Kl={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function FB(e){const t=[],n={},r=[];for(const o of Object.keys(e))n[o]=Kl.NotVisited;function i(o,c){if(n[o]===Kl.Visited)return!0;if(n[o]===Kl.Visiting){const f=c.lastIndexOf(o);return f!==-1&&r.push(c.slice(f)),!0}n[o]=Kl.Visiting,c.push(o);let u=!1;for(const f of e[o])i(f,c)||(u=!0);return n[o]=Kl.Visited,c.pop(),t.unshift(o),!u}for(const o in e)n[o]===Kl.NotVisited&&i(o,[]);return{sorted:t,cycles:r}}function WD(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Ko(r)){const i=r.reference;i.startsWith("urn:uuid:")&&t(i)}else WD(r,t)}}function HB(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&&WD(n.resource,i=>{t[i]&&t[i].push(r)})}return t}const hn={FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",JSON:"application/json",JSON_PATCH:"application/json-patch+json",TEXT:"text/plain",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml"};let qB=class{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 i=0;i<r.length;i++)if(r[i]===n){r.splice(i,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}};class tm{constructor(){this.emitter=new qB}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,n){this.emitter.addEventListener(t,n)}removeEventListener(t,n){this.emitter.removeEventListener(t,n)}removeAllListeners(){this.emitter.removeAllListeners()}}const Vy={"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"},GB=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],gb=["DiagnosticReport-update"];function WB(e){return gb.includes(e)}function QB(e){if(gb.includes(e))throw new dt(yn(`'context.version' is required for '${e}'.`))}const YB={"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 XB(e){return GB.includes(e)}function QD(e){return!!e.endpoint}function EE(e){if(!vb(e))throw new dt(yn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:i}=e,o={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":i.join(",")};return QD(e)&&(o.endpoint=e.endpoint),new URLSearchParams(o).toString()}function vb(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:i}=e;if(!(t&&n&&r&&i)||typeof r!="string"||typeof i!="object"||!Array.isArray(i)||i.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const o of i)if(!Vy[o])return!1;return!(QD(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function KB(e,t,n,r){if(typeof t!="object")throw new dt(yn(`context[${n}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new dt(yn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new dt(yn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const i=r.resourceType;if(i!=="*"){if(!XB(t.resourceType))throw new dt(yn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(i&&t.resourceType!==i)throw new dt(yn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${i}.`))}}function ZB(e,t,n,r,i){if(i.set(t.key,(i.get(t.key)??0)+1),r.reference){if(!Ko(t.reference))throw new dt(yn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else KB(e,t.resource,n,r)}function JB(e,t){const n=new Map,r=YB[e];for(let i=0;i<t.length;i++){const o=t[i].key;if(!r[o])throw new dt(yn(`Key '${o}' not found for event '${e}'. Make sure to add only valid keys.`));ZB(e,t[i],i,r[o],n)}for(const[i,o]of Object.entries(r)){if(!(o.optional||n.has(i)))throw new dt(yn(`Missing required key '${i}' on context for '${e}' event.`));if(!o.manyAllowed&&(n.get(i)??0)>1)throw new dt(yn(`${n.get(i)} context entries with key '${i}' found for the '${e}' event when schema only allows for 1.`))}}function TE(e,t,n,r){if(!(e&&typeof e=="string"))throw new dt(yn("Must provide a topic."));if(!Vy[t])throw new dt(yn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Vy).join(", ")}`));if(typeof n!="object")throw new dt(yn("context must be a context object or array of context objects."));if(gb.includes(t)&&!r)throw new dt(yn(`The '${t}' event must contain a 'context.versionId'.`));const i=Array.isArray(n)?n:[n];return JB(t,i),{timestamp:new Date().toISOString(),id:qD(),event:{"hub.topic":e,"hub.event":t,context:i,...r?{"context.versionId":r}:{}}}}class eV extends tm{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new dt(yn("Subscription request should contain an endpoint."));if(!vb(t))throw new dt(yn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const i=JSON.parse(r.data);if(i["hub.topic"])return;const o=i;o.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:o}),n.send(JSON.stringify({id:i==null?void 0:i.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function tV(e){return JSON.parse(zB(e))}function nV(e){return e.split(".").length===3}function yb(e){const[t,n,r]=e.split(".");return tV(n)}function rV(e){try{return typeof yb(e).login_id=="string"}catch{return!1}}function iV(e){try{const n=yb(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class aV{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,hn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var YD;YD=Symbol.toStringTag;class Di{constructor(t){this[YD]="ReadablePromise",this.status="pending",this.suspender=t.then(n=>(this.status="success",this.response=n,n),n=>{throw this.status="error",this.error=n,n})}isPending(){return this.status==="pending"}isOk(){return this.status==="success"}read(){switch(this.status){case"pending":throw this.suspender;case"error":throw this.error;default:return this.response}}then(t,n){return this.suspender.then(t,n)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}class oV{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new sV)}clear(){this.storage.clear()}getString(t){return this.storage.getItem(t)??void 0}setString(t,n){n?this.storage.setItem(t,n):this.storage.removeItem(t)}getObject(t){const n=this.getString(t);return n?JSON.parse(n):void 0}setObject(t,n){this.setString(t,n?Ii(n):void 0)}}class sV{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}/*!
79
- * Reconnecting WebSocket
80
- * by Pedro Ladaria <pedro.ladaria@gmail.com>
81
- * https://github.com/pladaria/reconnecting-websocket
82
- * License MIT
83
- *
84
- * Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
85
- * https://github.com/partykit/partykit/blob/main/packages/partysocket
86
- */const oc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let RE=!1;function lV(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");oc.Event=globalThis.Event,oc.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},oc.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function cV(e,t){if(!e)throw new Error(t)}function ah(e){return new e.constructor(e.type,e)}const Ss={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let _E=!1;class Io extends tm{constructor(t,n,r={}){RE||(lV(),RE=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._closeCalled=!1,this._messageQueue=[],this._debugLogger=console.log.bind(console),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=i=>{this._debug("open event");const{minUptime:o=Ss.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),o),cV(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(c=>{var u;return(u=this._ws)==null?void 0:u.send(c)}),this._messageQueue=[],this.onopen&&this.onopen(i),this.dispatchEvent(ah(i))},this._handleMessage=i=>{this._debug("message event"),this.onmessage&&this.onmessage(i),this.dispatchEvent(ah(i))},this._handleError=i=>{this._debug("error event",i.message),this._disconnect(void 0,i.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(i),this._debug("exec error listeners"),this.dispatchEvent(ah(i)),this._connect()},this._handleClose=i=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(i),this.dispatchEvent(ah(i))},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 Io.CONNECTING}get OPEN(){return Io.OPEN}get CLOSING(){return Io.CLOSING}get CLOSED(){return Io.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){var n;return this._messageQueue.reduce((r,i)=>(typeof i=="string"?r+=i.length:i instanceof Blob?r+=i.size:r+=i.byteLength,r),0)+(((n=this._ws)==null?void 0:n.bufferedAmount)??0)}get extensions(){var t;return((t=this._ws)==null?void 0:t.extensions)??""}get protocol(){var t;return((t=this._ws)==null?void 0:t.protocol)??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Io.CLOSED:Io.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(t=1e3,n){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)}reconnect(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=Ss.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=Ss.reconnectionDelayGrowFactor,minReconnectionDelay:n=Ss.minReconnectionDelay,maxReconnectionDelay:r=Ss.maxReconnectionDelay}=this._options;let i=0;return this._retryCount>0&&(i=n*Math.pow(t,this._retryCount-1),i>r&&(i=r)),this._debug("next delay",i),i}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=Ss.maxRetries,connectionTimeout:n=Ss.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"&&!_E&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),_E=!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 oc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new oc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new oc.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}}const uV=5e3;class Fy extends tm{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 dV{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new Fy(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class fV{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof KD))throw new dt(yn("First arg of constructor should be a `MedplumClient`"));let i;try{i=new URL(n).toString()}catch{throw new dt(yn("Not a valid URL"))}const o=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(i,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new Io(i,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=o,this.masterSubEmitter=new Fy,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??uV,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,i,o,c,u,f;try{const h=JSON.parse(n.data);if(h.type==="pong"){this.waitingForPong=!1;return}const m=h,g=(i=(r=m==null?void 0:m.entry)==null?void 0:r[0])==null?void 0:i.resource;if(g.type==="heartbeat"){(o=this.masterSubEmitter)==null||o.dispatchEvent({type:"heartbeat",payload:m});return}if(g.type==="handshake"){const b=Vs(g.subscription),S={type:"connect",payload:{subscriptionId:b}};(c=this.masterSubEmitter)==null||c.dispatchEvent(S);const w=this.criteriaEntriesBySubscriptionId.get(b);if(!w){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}w.connecting=!1,w.emitter.dispatchEvent({...S});return}(u=this.masterSubEmitter)==null||u.dispatchEvent({type:"message",payload:m});const v=this.criteriaEntriesBySubscriptionId.get(Vs(g.subscription));if(!v){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}v.emitter.dispatchEvent({type:"message",payload:m})}catch(h){console.error(h);const m={type:"error",payload:h};(f=this.masterSubEmitter)==null||f.dispatchEvent(m);for(const g of this.getAllCriteriaEmitters())g.dispatchEvent({...m})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new dt(jz(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const i of this.getAllCriteriaEmitters())i.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,i;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(i=this.masterSubEmitter)==null||i.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const i of this.getAllCriteriaEmitters())i.dispatchEvent({...n});this.refreshAllSubscriptions().catch(console.error),this.pingTimer||(this.pingTimer=setInterval(()=>{if(this.waitingForPong){this.waitingForPong=!1,t.reconnect();return}t.send(JSON.stringify({type:"ping"})),this.waitingForPong=!0},this.pingIntervalMs))}),this.medplum.addEventListener("change",()=>{var r;const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&((r=this.currentProfile)==null?void 0:r.id)!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){var i;const r={type:"error",payload:n};(i=this.masterSubEmitter)==null||i.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const i={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(i),t.emitter.dispatchEvent({...i})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var c,u;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${zt(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`),i=(c=r==null?void 0:r.find(f=>f.name==="token"))==null?void 0:c.valueString,o=(u=r==null?void 0:r.find(f=>f.name==="websocket-url"))==null?void 0:u.valueUrl;if(!i)throw new dt(yn("Failed to get token"));if(!o)throw new dt(yn("Failed to get URL from $get-ws-binding-token"));return[n,i]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const i of r.criteriaWithProps)if(la(n,i.subscriptionProps))return i}}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 i;this.criteriaEntries.has(n)?i=this.criteriaEntries.get(n):(i={criteriaWithProps:[]},this.criteriaEntries.set(n,i)),r?i.criteriaWithProps.push(t):i.bareCriteria=t}removeCriteriaEntry(t){var u;const{criteria:n,subscriptionProps:r,subscriptionId:i,token:o}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(f=>{const h=f.subscriptionProps;return!la(r,h)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(u=this.masterSubEmitter)==null||u._removeCriteria(n)),i&&this.criteriaEntriesBySubscriptionId.delete(i),o&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:o}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Ye(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 i=new dV(t,n);return this.addCriteriaEntry(i),this.subscribeToCriteria(i).catch(console.error),i.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 Fy(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const XD="4.3.5-be2f2f517",hV=hn.FHIR_JSON+", */*; q=0.1",pV="https://api.medplum.com/",mV=1e3,gV=6e4,vV=0,yV=3e5,xV="Binary/",DE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},Zl={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"},bV={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},SV={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class KD extends tm{constructor(t){if(super(),this.initComplete=!0,t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??wV(),this.storage=(t==null?void 0:t.storage)??new oV,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=ob((t==null?void 0:t.baseUrl)??pV),this.fhirBaseUrl=Zi(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Zi(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Zi(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Zi(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=Zi(this.baseUrl,(t==null?void 0:t.fhircastHubUrl)??"fhircast/STU3"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.credentialsInHeader=(t==null?void 0:t.authCredentialsMethod)==="header",this.defaultHeaders=(t==null?void 0:t.defaultHeaders)??{},this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.refreshGracePeriod=(t==null?void 0:t.refreshGracePeriod)??yV,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?vV:gV),this.cacheTime>0?this.requestCache=new uD((t==null?void 0:t.resourceCacheSize)??mV):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initPromise=Promise.resolve(),this.dispatchEvent({type:"storageInitialized"})):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0,this.dispatchEvent({type:"storageInitialized"})}).catch(n=>{console.error(n),this.initComplete=!0,this.dispatchEvent({type:"storageInitFailed",payload:{error:n}})})),this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}getFhircastHubUrl(){return this.fhircastHubUrl}getDefaultHeaders(){return this.defaultHeaders}clear(){this.storage.clear(),typeof window<"u"&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.refreshPromise=void 0,this.accessTokenExpires=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){var n;t=t.toString(),(n=this.requestCache)==null||n.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const n=Zi(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 i;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?i=new Promise((c,u)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:u}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):i=this.request("GET",t,n);const o=new Di(i);return this.setCacheEntry(t,o),o}post(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("POST",t,i)}put(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("PUT",t,i)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,hn.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:i}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:i},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(window.location.search).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,i,o=!0){let c=i;o&&(c=await this.ensureCodeChallenge(i)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,c,o))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:Zl.TokenExchange,subject_token_type:bV.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,i,o=!0){const c=new URL(t);if(c.searchParams.set("response_type","code"),c.searchParams.set("client_id",n),c.searchParams.set("redirect_uri",r),c.searchParams.set("scope",i.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(i)),o){const{codeChallenge:u,codeChallengeMethod:f}=i;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!u)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",u)}return c.toString()}fhirUrl(...t){return new URL(Zi(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=gU(n)),r}search(t,n,r){const i=this.fhirSearchUrl(t,n),o="search-"+i.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=this.getBundle(i,r);return this.setCacheEntry(o,u),u}searchOne(t,n,r){const i=this.fhirSearchUrl(t,n);i.searchParams.set("_count","1"),i.searchParams.sort();const o="searchOne-"+i.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new Di(this.search(t,i.searchParams,r).then(f=>{var h,m;return(m=(h=f.entry)==null?void 0:h[0])==null?void 0:m.resource}));return this.setCacheEntry(o,u),u}searchResources(t,n,r){const o="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new Di(this.search(t,n,r).then(PE));return this.setCacheEntry(o,u),u}async*searchResourcePages(t,n,r){var o,c;let i=this.fhirSearchUrl(t,n);for(;i;){const u=new URL(i).searchParams;u.has("_count")||u.set("_count","1000");const f=await this.search(t,u,r),h=(o=f.link)==null?void 0:o.find(m=>m.relation==="next");if(!((c=f.entry)!=null&&c.length)&&!h)break;yield PE(f),i=h!=null&&h.url?new URL(h.url):void 0}}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){var i,o;const r=(o=(i=this.requestCache)==null?void 0:i.get(this.fhirUrl(t,n).toString()))==null?void 0:o.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return DE;const[r,i]=n.split("/");if(!(!r||!i))return this.getCached(r,i)}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 Di(Promise.reject(new Error("Missing reference")));if(r==="system")return new Di(Promise.resolve(DE));const[i,o]=r.split("/");return!i||!o?new Di(Promise.reject(new Error("Invalid reference"))):this.readResource(i,o,n)}requestSchema(t){if(vD(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const i=new Di((async()=>{const o=`{
87
- StructureDefinitionList(_filter: "name eq ${t}") {
88
- resourceType,
89
- name,
90
- kind,
91
- description,
92
- type,
93
- url,
94
- snapshot {
95
- element {
96
- id,
97
- path,
98
- definition,
99
- min,
100
- max,
101
- base {
102
- path,
103
- min,
104
- max
105
- },
106
- contentReference,
107
- type {
108
- code,
109
- profile,
110
- targetProfile
111
- },
112
- binding {
113
- strength,
114
- valueSet
115
- }
116
- }
117
- }
118
- }
119
- SearchParameterList(base: "${t}", _count: 100) {
120
- base,
121
- code,
122
- type,
123
- expression,
124
- target
125
- }
126
- }`.replace(/\s+/g," "),c=await this.graphql(o);uE(c.data.StructureDefinitionList);for(const u of c.data.SearchParameterList)RU(u)})());return this.setCacheEntry(n,i),i}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&tb(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),i=this.getCacheEntry(r,void 0);if(i)return i.value;const o=new Di((async()=>{if(n!=null&&n.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const u=await this.post(c.toString(),{});uE(u)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}gD(c)}})());return this.setCacheEntry(r,o),o}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,i){return this.get(this.fhirUrl(t,n,"_history",r),i)}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 i=this.fhirUrl(t.resourceType);r?r.headers?Array.isArray(r.headers)?r.headers.push(["If-None-Exist",n]):r.headers instanceof Headers?r.headers.set("If-None-Exist",n):r.headers["If-None-Exist"]=n:r.headers={"If-None-Exist":n}:r={headers:{"If-None-Exist":n}};const o=await this.post(i,t,void 0,r);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async upsertResource(t,n,r){const i=this.fhirSearchUrl(t.resourceType,n);let o=await this.put(i,t,void 0,r);return o||(o=t),this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async createAttachment(t,n,r,i,o){let c=NE(t,n,r,i);if(c.contentType===hn.XML){const h=c.data;let m;h instanceof Blob?m=await new Promise((g,v)=>{const b=new FileReader;b.onload=()=>{if(!b.result){v(new Error("Failed to load file"));return}g(b.result)},b.readAsText(h,"utf-8")}):ArrayBuffer.isView(h)?m=new TextDecoder().decode(h):m=h,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:hn.CDA_XML})}const u=o??(typeof n=="object"?n:{}),f=await this.createBinary(c,u);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,i,o){const c=NE(t,n,r,i),u=o??(typeof n=="object"?n:{}),{data:f,contentType:h,filename:m,securityContext:g,onProgress:v}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g!=null&&g.reference&&this.setRequestHeader(u,"X-Security-Context",g.reference),v?this.uploadwithProgress(b,f,h,v,u):this.post(b,f,h,u)}uploadwithProgress(t,n,r,i,o){return new Promise((c,u)=>{var g;const f=new XMLHttpRequest,h=()=>f.abort();(g=o==null?void 0:o.signal)==null||g.addEventListener("abort",h);const m=v=>{var b;(b=o==null?void 0:o.signal)==null||b.removeEventListener("abort",h),v instanceof Error?u(v):c(v)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),i&&(f.upload.onprogress=v=>i(v),f.upload.onload=v=>i(v)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new dt(Zt(f.response||f.statusText)))},f.open("POST",t),f.withCredentials=!0,f.setRequestHeader("Authorization","Bearer "+this.accessToken),f.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),f.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&f.setRequestHeader("X-Medplum","extended"),o!=null&&o.headers){const v=o.headers;for(const[b,S]of Object.entries(v))f.setRequestHeader(b,S)}f.send(n)})}async createPdf(t,n,r,i){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const o=EV(t,n,r,i),c=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:f,fonts:h,...m}=o,g=await this.createPdfImpl(u,f,h),v={...m,data:g,contentType:"application/pdf"};return this.createBinary(v,c)}createComment(t,n,r){const i=this.getProfile();let o,c;return t.resourceType==="Encounter"&&(o=nn(t),c=t.subject),t.resourceType==="ServiceRequest"&&(o=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=nn(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[nn(t)],encounter:o,subject:c,sender:i?nn(i):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,i){const o=await this.patch(this.fhirUrl(t,n),r,i);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),o}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,i){let o;if(typeof t=="string"){const c=t;o=this.fhirUrl("Bot",c,"$execute")}else{const c=t;o=this.fhirUrl("Bot","$execute"),o.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(o,n,r,i)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,hn.JSON,n)}graphql(t,n,r,i){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},hn.JSON,i)}readResourceGraph(t,n,r,i){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,i)}pushToAgent(t,n,r,i,o,c){const{waitTimeout:u,...f}=c??{};return this.post(this.fhirUrl("Agent",Vs(t),"$push"),{destination:typeof n=="string"?n:zt(n),body:r,contentType:i,waitForResponse:o,...u!==void 0?{waitTimeout:u}:void 0},hn.FHIR_JSON,f)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||zt(this.sessionDetails.profile)!==((r=t.profile)==null?void 0:r.reference))&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}isAuthenticated(t){return this.accessTokenExpires!==void 0&&Date.now()<this.accessTokenExpires-(t??this.refreshGracePeriod)}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=iV(t),this.medplumServer=rV(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var i,o;return((i=r.profile)==null?void 0:i.reference)!==((o=t.profile)==null?void 0:o.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{var o,c;this.profilePromise=void 0;const i=((c=(o=this.sessionDetails)==null?void 0:o.profile)==null?void 0:c.id)!==r.profile.id;this.sessionDetails=r,i&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){var t;return!this.isInitialized||!!this.profilePromise&&!((t=this.sessionDetails)!=null&&t.profile)}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(xV)&&(t=this.fhirUrl(r));let i=n.headers;return i||(i={},n.headers=i),i.Accept||(i.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...i}=t,o=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});i.securityContext||(i.securityContext=nn(o));const c=await this.createAttachment(i,n);return this.updateResource({...o,status:"completed",content:c})}async uploadMedia(t,n,r,i,o){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:i},o)}async createDocumentReference(t,n){const{additionalFields:r,...i}=t,o=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});i.securityContext||(i.securityContext=nn(o));const c=await this.createAttachment(i,n);return this.updateResource({...o,content:[{attachment:c}]})}async bulkExport(t="",n,r,i){const o=t&&`${t}/`,c=this.fhirUrl(`${o}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),i)}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 aV(this)),this.keyValueClient}getBundle(t,n){return new Di((async()=>{const r=await this.get(t,n);if(r.entry)for(const i of r.entry)this.cacheResource(i.resource);return r})())}getCacheEntry(t,n){if(!this.requestCache||(n==null?void 0:n.cache)==="no-cache"||(n==null?void 0:n.cache)==="reload")return;const r=this.requestCache.get(t);if(!(!r||r.requestTime+this.cacheTime<Date.now()))return r}setCacheEntry(t,n){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t){var n,r;t!=null&&t.id&&!((r=(n=t.meta)==null?void 0:n.tag)!=null&&r.some(i=>i.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Di(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},i={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const o=await this.fetchWithRetry(n,r);if(o.status===401)return this.handleUnauthenticated(t,n,r);if(o.status===204||o.status===304)return;const c=o.headers.get("content-type"),u=c==null?void 0:c.includes("json");if(o.status===404&&!u)throw new dt(Sz);const f=await this.parseBody(o,u);if(o.status===200&&r.followRedirectOnOk||o.status===201&&r.followRedirectOnCreated){const h=await kE(o,f);if(h)return this.request("GET",h,{...r,body:void 0})}if(o.status===202&&r.pollStatusOnAccepted){const m=await kE(o,f)??i.statusUrl;if(m)return this.pollStatus(m,r,i)}if(o.status>=400)throw new dt(Zt(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(i){throw console.error("Error parsing response",t.status,i),i}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Zi(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2;for(let i=0;i<=r;i++)try{this.options.verbose&&this.logRequest(t,n);const o=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(o),this.setCurrentRateLimit(o),i>=r||!TV(o))return o;const c=this.getRetryDelay(i),u=n.maxRetryTime??2e3;if(c>u)return o;await yE(c)}catch(o){if(o.message==="Failed to fetch"&&i===0&&this.dispatchEvent({type:"offline"}),o.name==="AbortError"||i===r)throw o}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const i of od(Object.keys(r)))console.log(`> ${i}: ${r[i]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){var r;const n=(r=t.headers)==null?void 0:r.get("ratelimit");n&&(this.currentRateLimits=n)}rateLimitStatus(){if(!this.currentRateLimits)return[];const t=this.currentRateLimits;return t.split(/\s*;\s*/g).map(n=>{const r=n.split(/\s*,\s*/g);if(r.length!==3)throw new Error("Could not parse RateLimit header: "+t);const i=r[0].substring(1,r[0].length-1),o=r.find(h=>h.startsWith("r=")),c=o?parseInt(o.substring(2),10):NaN,u=r.find(h=>h.startsWith("t=")),f=u?parseInt(u.substring(2),10):NaN;if(!i||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:i,remainingUnits:c,secondsUntilReset:f}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const i of n)i.remainingUnits||(r=Math.max(r,i.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const i={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(i.headers={...n.headers},delete i.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const o=n.pollStatusPeriod??1e3;await yE(o),r.pollCount++}return this.request("GET",t,i,r)}async executeAutoBatch(){var i,o;if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const c=t[0];try{c.resolve(await this.request(c.method,Zi(this.fhirBaseUrl,c.url),c.options))}catch(u){c.reject(new dt(Zt(u)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(c=>({request:{method:c.method,url:c.url},resource:c.options.body?JSON.parse(c.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let c=0;c<t.length;c++){const u=t[c],f=(i=r.entry)==null?void 0:i[c];(o=f==null?void 0:f.response)!=null&&o.outcome&&!fD(f.response.outcome)?u.reject(new dt(f.response.outcome)):u.resolve(f==null?void 0:f.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",hV,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",hn.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,i=!1){t.headers||(t.headers={});const o=t.headers;i&&o[n]||(o[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||(n==null?void 0:n.constructor.name)==="Blob")||typeof File<"u"&&(n instanceof File||(n==null?void 0:n.constructor.name)==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||(n==null?void 0:n.constructor.name)==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new dt(ad)))}async startPkce(){const t=CE();sessionStorage.setItem("pkceState",t);const n=CE().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await UB(n),i=uU(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",i),{codeChallengeMethod:"S256",codeChallenge:i}}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??AE()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),window.location.assign(r.toString())}processCode(t,n){const r={grant_type:Zl.AuthorizationCode,code:t,client_id:(n==null?void 0:n.clientId)??this.clientId??"",redirect_uri:(n==null?void 0:n.redirectUri)??AE()};if(typeof sessionStorage<"u"){const i=sessionStorage.getItem("codeVerifier");i&&(r.code_verifier=i)}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:Zl.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:Zl.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:Zl.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:Zl.ClientCredentials,client_assertion_type:SV.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=jE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new dt(yn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new dt(yn("Invalid events provided. Events must be an array of event names containing at least one event."));const r={channelType:"websocket",mode:"subscribe",topic:t,events:n},o=(await this.post(this.fhircastHubUrl,EE(r),hn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!o)throw new Error("Invalid response!");return r.endpoint=o,r}async fhircastUnsubscribe(t){if(!vb(t))throw new dt(yn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new dt(yn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,EE(t),hn.FORM_URL_ENCODED)}fhircastConnect(t){return new eV(t)}async fhircastPublish(t,n,r,i){return WB(n)?this.post(this.fhircastHubUrl,TE(t,n,r,i),hn.JSON):(QB(n),this.post(this.fhircastHubUrl,TE(t,n,r),hn.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":hn.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 ${jE(t.client_id+":"+t.client_secret)}`));const i={method:"POST",headers:r,body:n.toString(),credentials:"include"};let o;try{o=await this.fetchWithRetry(this.tokenUrl,i)}catch(u){throw this.refreshPromise=void 0,u}if(!o.ok){this.clearActiveLogin();try{const u=await o.json();throw new dt(ia(u.error_description))}catch(u){throw new dt(ia("Failed to fetch tokens"),u)}}const c=await o.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(nV(n)){const r=yb(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new dt(wz);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new dt(lE)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new dt(lE)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){var n,r;return this.sessionDetails&&t?((r=(n=t.profile)==null?void 0:n.reference)==null?void 0:r.endsWith(this.sessionDetails.profile.id))??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)window.location.reload();else if(t.key==="activeLogin"){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;(n==null?void 0:n.profile.reference)!==(r==null?void 0:r.profile.reference)||!this.checkSessionDetailsMatchLogin(r)?window.location.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new fV(this,mU(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 wV(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function AE(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function kE(e,t){var i,o;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Yp(t)&&((o=(i=t.issue)==null?void 0:i[0])!=null&&o.diagnostics))return t.issue[0].diagnostics}function PE(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function jV(e){return sr(e)&&"data"in e&&"contentType"in e}function NE(e,t,n,r){return jV(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function CV(e){return sr(e)&&"docDefinition"in e}function EV(e,t,n,r){return CV(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function TV(e){return e.status===429||e.status>=500}function xc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:i,accessPolicyResource:o}){if(t===(e==null?void 0:e.path))return;i??(i=(e==null?void 0:e.debugMode)??!1),o??(o=e==null?void 0:e.accessPolicyResource);let c=RV(t,n,e,!!i);const u=Uy(t,".",2)[1];c=_V(c,o,u),c=DV(c,o,u);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let h;if(e&&!e.isDefaultContext)h=e.getExtendedProps;else{const m=Object.create(null);h=g=>{const v=Uy(g,".",2)[1];if(v){if(!m[v]){const b=Fh(v,o==null?void 0:o.hiddenFields);m[v]={hidden:b,readonly:b||Fh(v,o==null?void 0:o.readonlyFields)}}return m[v]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:i,getExtendedProps:h,accessPolicyResource:o}}function RV(e,t,n,r){const i=Object.create(null);if(n)for(const[c,u]of Object.entries(n.elementsByPath)){const f=Ps(e,c);f!==void 0&&(i[f]=u)}let o=!1;if(t)for(const[c,u]of Object.entries(t))c in i||(i[c]=u,o=!0);return r&&console.assert(o,"Unnecessary ElementsContext; not using any newly provided elements"),i}function _V(e,t,n){var i;if(!((i=t==null?void 0:t.hiddenFields)!=null&&i.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!Fh(r+o,t.hiddenFields)))}function DV(e,t,n){var o;if(!((o=t==null?void 0:t.readonlyFields)!=null&&o.length))return e;const r=Object.create(null),i=n?n+".":"";for(const[c,u]of Object.entries(e))Fh(i+c,t.readonlyFields)?r[c]={...u,readonly:!0}:r[c]=u;return r}function Fh(e,t){if(!(t!=null&&t.length))return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");if(t.includes(i))return!0}return!1}function ZD(e){return e.type!==void 0&&e.type.length>0}function AV(e,t,n,r){var o;const i=z8(e,t.path,{profileUrl:r});if(i){const c=((o=n.typeSchema)==null?void 0:o.elements)??n.elements;return i.some(u=>V8(u,t,n,c))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function JD(e,t,n,r){var i,o;if(e)for(const c of t){const u={value:e,type:((i=c.typeSchema)==null?void 0:i.type)??((o=c.type)==null?void 0:o[0].code)};if(n.every(f=>{var h;return AV(u,f,c,((h=c.typeSchema)==null?void 0:h.url)??r)}))return c.name}}class kV{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const i=xc({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(i===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[i],this.visitor=n}get elementsContext(){return this.elementsContextStack[this.elementsContextStack.length-1]}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const i=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([o])=>o.startsWith(n)));this.crawlElementsImpl(i,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const i=this.prepareSlices(r.slices,r);if(!Tn(i.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(i.slices[0],n.path,i),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=PV(t);for(const i of r)this.crawlElementNode(i,n)}crawlElementNode(t,n){var i,o;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const c of t.children)this.crawlElementNode(c,n);Tn((o=(i=t.element)==null?void 0:i.slicing)==null?void 0:o.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var o,c;const r=[];for(const u of t){if(!ZD(u))continue;const f=(c=(o=u.type.find(h=>Tn(h.profile)))==null?void 0:o.profile)==null?void 0:c[0];if(Tn(f)){const h=Nc(f);h&&(u.typeSchema=h)}r.push(u)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const i of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(i))&&this.crawlSliceImpl(i,n,r)}crawlSliceImpl(t,n,r){const i=t.typeSchema;i&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(i),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let o;const c=(i==null?void 0:i.elements)??t.elements;Tn(c)&&(o=xc({path:n,parentContext:this.elementsContext,elements:c})),o&&this.elementsContextStack.push(o),this.crawlElementsImpl(c,n),o&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),i&&this.visitor.onExitSchema&&this.visitor.onExitSchema(i)}}function PV(e){const t=[];function n(o,c){return c.startsWith(o+".")}function r(o,c){for(const u of o.children)if(n(u.key,c.key)){r(u,c);return}o.children.push(c)}const i=Object.entries(e);i.sort((o,c)=>o[0].localeCompare(c[0]));for(const[o,c]of i){const u={key:o,element:c,children:[]};let f=!1;for(const h of t)if(n(h.key,o)){r(h,u),f=!0;break}f||t.push(u)}return t}const Kv="__sliceName";function NV(e,t){const n=new OV(e,e.resourceType,"resource");return new kV(t,n).crawlResource(),n.getDefaultValue()}function OE(e,t,n){for(const[r,i]of Object.entries(t)){if(n===void 0||n===r){Hh(e,r,i,t);continue}const o=Ps(n,r);o!==void 0&&Hh(e,o,i,t)}return e}class OV{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Wr(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const i=this.value.values,o=this.value.path,c=Ps(o,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${o}`);const u=[];for(const f of i){if(f===void 0)continue;const h=Ps(r.path,o),m=Array.isArray(f)?f:[f];for(const g of m){MV(g,c,n,r.elements,h),Hh(g,c,n,r.elements);const v=qy(g,c,r.elements,h);v!==void 0&&u.push(v)}}this.valueStack.push({type:"element",path:t,values:u})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const o=Ps(this.value.path,t);if(o===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=Ps(r.path,this.value.path);for(const u of this.value.values){const f=qy(u,o,r.elements,c);if(Array.isArray(f))for(let h=f.length-1;h>=0;h--){const m=f[h];Tn(m)||f.splice(h,1)}Rn(f)&&Hy(u,void 0,o,n)}}onEnterSlice(t,n,r){const i=this.value.values,o=[];for(const c of i)if(c!==void 0){const u=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(u,n,r);o.push(f)}this.valueStack.push({type:"slice",path:t,values:o})}getMatchingSliceValues(t,n,r){const i=[];for(const o of t)(o[Kv]??JD(o,[n],r.discriminator,this.schema.url))===n.name&&i.push(o);for(let o=i.length;o<n.min;o++)if(ab(n.type[0].code)){const c=Object.create(null);i.push(c),t.push(c)}return i}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 i=n[r];Kv in i&&delete i[Kv]}}getDefaultValue(){return this.rootValue}}function MV(e,t,n,r,i){const o=qy(e,t,r,i);n.min>0&&o===void 0&&ab(n.type[0].code)&&(n.isArray?Hy(e,[Object.create(null)],t,n):Hy(e,Object.create(null),t,n))}function Hy(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let i=n;if(n.includes("[x]")){const o=r.type[0].code;i=n.replace("[x]",In(o))}t===void 0?delete e[i]:e[i]=t}function qy(e,t,n,r){const i=t.split(".");let o=e,c;for(let u=0;u<i.length;u++){let f=i[u];if(f.includes("[x]")){const h=(r?r+".":"")+i.slice(0,u+1).join("."),g=n[h].type[0].code;f=f.replace("[x]",In(g))}if(u===i.length-1){Array.isArray(o)?c=o.map(h=>h[f]):c=o[f];continue}if(Array.isArray(o))o=o.map(h=>h[f]);else if(sr(o)){if(o[f]===void 0)return;o=o[f]}else return}return c}function Hh(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>Hh(u,t,n,r));e==null&&(e=Object.create(null));const i=e,o=t.split(".");let c=i;for(let u=0;u<o.length;u++){let f=o[u];if(f.includes("[x]")){const m=r[o.slice(0,u+1).join(".")].type[0].code;f=f.replace("[x]",In(m))}if(u===o.length-1){const h=Array.isArray(c)?c:[c];for(const m of h)n.fixed?m[f]??(m[f]=n.fixed.value):n.pattern&&(m[f]=eA(m[f],n.pattern.value))}else{if(!(f in c)){const h=o.slice(0,u+1).join(".");c[f]=r[h].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return i}function eA(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Wr(t);if(sr(t)&&(sr(e)&&!Array.isArray(e)||e===void 0)){const n=Wr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=eA(n[r],t[r]);return n}return e}const IV="https://meta.medplum.com/releases",Zv=new Map;function LV(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!(n!=null&&n.length))throw new Error("Manifest missing assets list");for(const r of n){if(!r.browser_download_url)throw new Error("Asset missing browser download URL");if(!r.name)throw new Error("Asset missing name")}}async function $V(e,t,n){let r=Zv.get("latest");if(!r){const i="latest",o=new URL(`${IV}/${i}.json`);o.searchParams.set("a",e),o.searchParams.set("c",XD);const c=await fetch(o.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(h){console.error(`Failed to parse message from body: ${Ye(h)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const u=await c.json();LV(u),r=u,Zv.set("latest",r),Zv.set(r.tag_name.slice(1),r)}return r}async function zV(e){const t=await $V(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 tA=y.createContext(void 0);function nm(){return y.useContext(tA)}function Ae(){return nm().medplum}function rm(){return nm().navigate}function im(){return nm().profile}const ME=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function UV(e){const t=e.medplum,n=e.navigate??BV,[r,i]=y.useState({profile:t.getProfile(),loading:t.isLoading()});y.useEffect(()=>{function c(){i(u=>({...u,profile:t.getProfile(),loading:t.isLoading()}))}for(const u of ME)t.addEventListener(u,c);return()=>{for(const u of ME)t.removeEventListener(u,c)}},[t]);const o=y.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(tA.Provider,{value:o,children:e.children})}function BV(e){window.location.assign(e)}const IE=new Map,nA=e=>y.useMemo(()=>{if(!e)return;const t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;const r=n.get("Expires");if(!r||r.length>13)return e;const i=IE.get(t);if(i){const c=new URLSearchParams(new URL(i).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return i}return IE.set(t,e),e},[e]);function Wt(e,t){const n=Ae(),[r,i]=y.useState(()=>LE(n,e)),o=y.useCallback(c=>{la(c,r)||i(c)},[r]);return y.useEffect(()=>{let c=!0;const u=LE(n,e);return!u&&Ko(e)?n.readReference(e).then(f=>{c&&o(f)}).catch(f=>{c&&(o(void 0),t&&t(Zt(f)))}):o(u),()=>c=!1},[n,e,o,t]),r}function LE(e,t){if(t){if(pa(t))return t;if(Ko(t))return e.getCachedReference(t)}}const wt={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"},xb=`${Ui}/fhir/StructureDefinition/questionnaire-itemControl`,VV=`${Ui}/fhir/StructureDefinition/questionnaire-referenceFilter`,Gy=`${Ui}/fhir/StructureDefinition/questionnaire-referenceResource`,FV=`${Ui}/fhir/StructureDefinition/questionnaire-validationError`,HV=`${Ui}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,qV=`${Ui}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,GV=`${Ui}/fhir/StructureDefinition/questionnaire-signatureRequired`,Sh=`${Ui}/fhir/StructureDefinition/questionnaireresponse-signature`;function WV(e){return e.type==="choice"||e.type==="open-choice"}function QV(e,t){const n=YV(e,t);return n!==void 0?n:XV(e,t)}function YV(e,t){var r;const n=ha(e,HV);if(t&&n){const i=(r=n.valueExpression)==null?void 0:r.expression;if(i){const o=mi(t),c=Hs(i,[o],{"%resource":o});return ta(c)}}}function XV(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const i=aA(t==null?void 0:t.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(i!=null&&i.length)){if(n==="any")return!0;continue}const{anyMatch:o,allMatch:c}=nF(r,i,n);if(n==="any"&&o)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function rA(e,t,n=t.item){for(const r of e){const i=n==null?void 0:n.find(o=>o.linkId===r.linkId);i&&(KV(t,r,i),r.item&&i.item&&rA(r.item,t,i.item))}}function KV(e,t,n){try{const r=eF(t,e);if(!r)return;const i=JV(t,r);if(!i)return;n.answer=[i]}catch(r){n.extension=[{url:FV,valueString:`Expression evaluation failed: ${Ye(r)}`}]}}const ZV={[wt.boolean]:[ae.boolean],[wt.date]:[ae.date],[wt.dateTime]:[ae.dateTime],[wt.time]:[ae.time],[wt.url]:[ae.string,ae.uri,ae.url],[wt.attachment]:[ae.Attachment],[wt.reference]:[ae.Reference],[wt.quantity]:[ae.Quantity],[wt.decimal]:[ae.decimal,ae.integer],[wt.integer]:[ae.decimal,ae.integer]};function JV(e,t){if(!e.type)return;if(e.type===wt.choice||e.type===wt.openChoice)return{[`value${In(t.type)}`]:t.value};if(e.type===wt.string||e.type===wt.text)return typeof t.value=="string"?{valueString:t.value}:void 0;const n=ZV[e.type];if(n!=null&&n.includes(t.type))return{[`value${In(e.type)}`]:t.value}}function eF(e,t){var r;if(!t)return;const n=ha(e,qV);if(n){const i=(r=n.valueExpression)==null?void 0:r.expression;if(i){const o=mi(t),c=Hs(i,[o],{"%resource":o});return c.length!==0?c[0]:void 0}}}function iA(e,t,n){var i;const r=[];for(const o of e){const c=(i=n.answerOption)==null?void 0:i.find(u=>yc(ua(u))===o);if(c){const u=ua(c);u&&r.push({[t]:u.value})}}return r}function aA(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=aA(n.item,t);if(r)return r}}}function tF(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:i}]=Hs(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return i}else return!1}function nF(e,t,n){const r=t||[],i=aF(e);let o=!1,c=!0;for(const u of r){const f=oF(u),{operator:h}=e;if(tF(f,i,h)?o=!0:c=!1,n==="any"&&o)break}return{anyMatch:o,allMatch:c}}function oA(e){var n,r;const t=ha(e,Gy);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(r=(n=t.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:r.map(i=>i.code)}}function Jv(e,t){var i;const n=Wr(e);let r=ha(n,Gy);return!t||t.length===0?(r&&(n.extension=(i=n.extension)==null?void 0:i.filter(o=>o!==r)),n):(r||(n.extension??(n.extension=[]),r={url:Gy},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 rF(e,t,n){const r=ha(e,VV);if(!(r!=null&&r.valueString))return;let i=r.valueString;t!=null&&t.reference&&(i=i.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(i=i.replaceAll("$encounter",n.reference));const o={},c=i.split("&");for(const u of c){const[f,h]=Uy(u,"=",2);o[f]=h}return o}function $E(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??zt(e),item:bb(e.item,t==null?void 0:t.item),status:"in-progress"}}function bb(e,t){if(!e)return;const n=[];for(const r of e){if(r.type===wt.display)continue;const i=t==null?void 0:t.filter(o=>o.linkId===r.linkId);if(i&&(i==null?void 0:i.length)>0)for(const o of i)o.id=o.id??lA(),o.text=o.text??r.text,o.item=bb(r.item,o.item),o.answer=cA(r,o),n.push(o);else n.push(sA(r))}return n}function sA(e){return{id:lA(),linkId:e.linkId,text:e.text,item:bb(e.item,void 0),answer:cA(e)}}let iF=1;function lA(){return"id-"+iF++}function cA(e,t){if(!(e.type===wt.display||e.type===wt.group)){if(t!=null&&t.answer&&t.answer.length>0)return t.answer;if(e.initial&&e.initial.length>0)return e.initial.map(n=>({...n}))}}function Sb(e){return _d({value:e},"value")}function ua(e){return _d({value:e},"value")}function aF(e){return _d({value:e},"answer")}function oF(e){return _d({value:e},"value")}function sF(e){const t=Wt(e.questionnaire),n=Wt(e.defaultValue),[,r]=y.useReducer(S=>S+1,0),i=y.useRef({activePage:0});if(!i.current.questionnaire&&t&&(i.current.questionnaire=t,i.current.pages=e.disablePagination?void 0:lF(t)),t&&e.defaultValue&&n&&!i.current.questionnaireResponse&&(i.current.questionnaireResponse=$E(t,n),b()),t&&!e.defaultValue&&!i.current.questionnaireResponse&&(i.current.questionnaireResponse=$E(t),b()),!i.current.questionnaire||!i.current.questionnaireResponse)return{loading:!0};function o(S,w){var E,_;let C=i.current.questionnaireResponse;for(const T of S)C=(E=C==null?void 0:C.item)==null?void 0:E.find(R=>R.linkId===T.linkId);return w&&(C=(_=C==null?void 0:C.item)==null?void 0:_.find(T=>T.linkId===w.linkId)),C}function c(){i.current.activePage=(i.current.activePage??0)+1,r()}function u(){i.current.activePage=(i.current.activePage??0)-1,r()}function f(S,w){const C=o(S);C&&(C.item??(C.item=[]),C.item.push(sA(w)),b())}function h(S,w){const C=o(S,w);C&&(C.answer??(C.answer=[]),C.answer.push({}),b())}function m(S,w,C){const E=o(S,w);E&&(E.answer=C,b())}function g(S){var C;const w=i.current.questionnaireResponse;w&&(S?(w.extension=w.extension??[],w.extension=w.extension.filter(E=>E.url!==Sh),w.extension.push({url:Sh,valueSignature:S})):w.extension=(C=w.extension)==null?void 0:C.filter(E=>E.url!==Sh),b())}function v(){const S=i.current.questionnaire;if(S!=null&&S.item){const w=i.current.questionnaireResponse;rA(S.item,w)}}function b(){var w;const S=i.current.questionnaireResponse;S&&(v(),r(),(w=e.onChange)==null||w.call(e,S))}return{loading:!1,pagination:!!i.current.pages,questionnaire:i.current.questionnaire,questionnaireResponse:i.current.questionnaireResponse,subject:e.subject,encounter:e.encounter,activePage:i.current.activePage,pages:i.current.pages,items:cF(i.current.questionnaire,i.current.pages,i.current.activePage),responseItems:uF(i.current.questionnaireResponse,i.current.pages,i.current.activePage),onNextPage:c,onPrevPage:u,onAddGroup:f,onAddAnswer:h,onChangeAnswer:m,onChangeSignature:g}}function lF(e){var n,r,i,o;if(!(e!=null&&e.item))return;const t=ha((n=e==null?void 0:e.item)==null?void 0:n[0],xb);if(((o=(i=(r=t==null?void 0:t.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:o.code)==="page")return e.item.map((c,u)=>({linkId:c.linkId,title:c.text??`Page ${u+1}`,group:c}))}function cF(e,t,n=0){var r;return t&&((r=e==null?void 0:e.item)!=null&&r[n])?[e.item[n]]:e.item??[]}function uF(e,t,n=0){var r;return t&&((r=e==null?void 0:e.item)!=null&&r[n])?[e.item[n]]:e.item??[]}function dF(e,t,n={leading:!1}){const[r,i]=y.useState(e),o=y.useRef(!1),c=y.useRef(void 0),u=y.useRef(!1),f=y.useCallback(()=>window.clearTimeout(c.current),[]);return y.useEffect(()=>{o.current&&(!u.current&&n.leading?(u.current=!0,i(e)):(f(),c.current=setTimeout(()=>{u.current=!1,i(e)},t)))},[e,n.leading,t,f]),y.useEffect(()=>(o.current=!0,f),[f]),[r,f]}const fF=250;function hF(e,t,n){return uA("searchOne",e,t)}function bc(e,t,n){return uA("searchResources",e,t)}function uA(e,t,n,r){const i=Ae(),[o,c]=y.useState(),[u,f]=y.useState(!0),[h,m]=y.useState(),[g,v]=y.useState(),b=i.fhirSearchUrl(t,n).toString(),[S]=dF(b,fF,{leading:!0});return y.useEffect(()=>{S!==o&&(c(S),i[e](t,n).then(w=>{f(!1),m(w),v(bz)}).catch(w=>{f(!1),m(void 0),v(Zt(w))}))},[i,e,t,n,o,S]),[h,u,g]}function pF(e){const t=e.value;return t?s.jsx(s.Fragment,{children:ND(t)}):null}const dA=["meta","implicitRules","contained","extension","modifierExtension"],fA=["language","text"],cn=y.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});cn.displayName="ElementsContext";const wb=["extension","modifierExtension"],mF=["id",...dA].filter(e=>!wb.includes(e));function gF(e){return Object.entries(e).filter(([n,r])=>{var i;return!Tn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||wb.includes(n)&&!Tn((i=r.slicing)==null?void 0:i.slices)||mF.includes(n)?!1:!(fA.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function zE(e,t){return e.line&&e.line.length>t?e.line[t]:""}function UE(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function vF(e){const[t,n]=y.useState(e.defaultValue||{}),r=y.useRef(t);r.current=t;const{getExtendedProps:i}=y.useContext(cn),[o,c,u,f,h,m,g]=y.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(R=>i(e.path+"."+R)),[i,e.path]);function v(R){n(R),e.onChange&&e.onChange(R)}function b(R){v({...r.current,use:R})}function S(R){v({...r.current,type:R})}function w(R){v(UE(r.current||{},0,R))}function C(R){v(UE(r.current||{},1,R))}function E(R){v({...r.current,city:R})}function _(R){v({...r.current,state:R})}function T(R){v({...r.current,postalCode:R})}return s.jsxs(je,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(ln,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:R=>b(R.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(ln,{disabled:e.disabled||(c==null?void 0:c.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:R=>S(R.currentTarget.value),data:["","postal","physical","both"]}),s.jsx($e,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Line 1",defaultValue:zE(t,0),onChange:R=>w(R.currentTarget.value)}),s.jsx($e,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Line 2",defaultValue:zE(t,1),onChange:R=>C(R.currentTarget.value)}),s.jsx($e,{disabled:e.disabled||(h==null?void 0:h.readonly),placeholder:"City",defaultValue:t.city,onChange:R=>E(R.currentTarget.value)}),s.jsx($e,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"State",defaultValue:t.state,onChange:R=>_(R.currentTarget.value)}),s.jsx($e,{disabled:e.disabled||(g==null?void 0:g.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:R=>T(R.currentTarget.value)})]})}function yF(e){const t=im(),[n,r]=y.useState(e.defaultValue||{});function i(o){const c=o?{text:o,authorReference:t&&nn(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return s.jsx($e,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:o=>i(o.currentTarget.value)})}/**
127
- * @license @tabler/icons-react v3.17.0 - MIT
128
- *
129
- * This source code is licensed under the MIT license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */var xF={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
132
- * @license @tabler/icons-react v3.17.0 - MIT
133
- *
134
- * This source code is licensed under the MIT license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const Ve=(e,t,n,r)=>{const i=y.forwardRef(({color:o="currentColor",size:c=24,stroke:u=2,title:f,className:h,children:m,...g},v)=>y.createElement("svg",{ref:v,...xF[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,h].join(" "),...e==="filled"?{fill:o}:{strokeWidth:u,stroke:o},...g},[f&&y.createElement("title",{key:"svg-title"},f),...r.map(([b,S])=>y.createElement(b,S)),...Array.isArray(m)?m:[m]]));return i.displayName=`${n}`,i};/**
137
- * @license @tabler/icons-react v3.17.0 - MIT
138
- *
139
- * This source code is licensed under the MIT license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */var bF=Ve("outline","adjustments-horizontal","IconAdjustmentsHorizontal",[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]]);/**
142
- * @license @tabler/icons-react v3.17.0 - MIT
143
- *
144
- * This source code is licensed under the MIT license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */var il=Ve("outline","alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]);/**
147
- * @license @tabler/icons-react v3.17.0 - MIT
148
- *
149
- * This source code is licensed under the MIT license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */var SF=Ve("outline","arrow-down","IconArrowDown",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]]);/**
152
- * @license @tabler/icons-react v3.17.0 - MIT
153
- *
154
- * This source code is licensed under the MIT license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */var wF=Ve("outline","arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);/**
157
- * @license @tabler/icons-react v3.17.0 - MIT
158
- *
159
- * This source code is licensed under the MIT license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */var jF=Ve("outline","bleach-off","IconBleachOff",[["path",{d:"M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]]);/**
162
- * @license @tabler/icons-react v3.17.0 - MIT
163
- *
164
- * This source code is licensed under the MIT license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */var CF=Ve("outline","bleach","IconBleach",[["path",{d:"M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",key:"svg-0"}]]);/**
167
- * @license @tabler/icons-react v3.17.0 - MIT
168
- *
169
- * This source code is licensed under the MIT license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */var EF=Ve("outline","box-multiple","IconBoxMultiple",[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]]);/**
172
- * @license @tabler/icons-react v3.17.0 - MIT
173
- *
174
- * This source code is licensed under the MIT license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */var TF=Ve("outline","brackets-contain","IconBracketsContain",[["path",{d:"M7 4h-4v16h4",key:"svg-0"}],["path",{d:"M17 4h4v16h-4",key:"svg-1"}],["path",{d:"M8 16h.01",key:"svg-2"}],["path",{d:"M12 16h.01",key:"svg-3"}],["path",{d:"M16 16h.01",key:"svg-4"}]]);/**
177
- * @license @tabler/icons-react v3.17.0 - MIT
178
- *
179
- * This source code is licensed under the MIT license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */var RF=Ve("outline","brand-asana","IconBrandAsana",[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]]);/**
182
- * @license @tabler/icons-react v3.17.0 - MIT
183
- *
184
- * This source code is licensed under the MIT license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */var _F=Ve("outline","bucket-off","IconBucketOff",[["path",{d:"M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]);/**
187
- * @license @tabler/icons-react v3.17.0 - MIT
188
- *
189
- * This source code is licensed under the MIT license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */var DF=Ve("outline","bucket","IconBucket",[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]]);/**
192
- * @license @tabler/icons-react v3.17.0 - MIT
193
- *
194
- * This source code is licensed under the MIT license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */var AF=Ve("outline","building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]);/**
197
- * @license @tabler/icons-react v3.17.0 - MIT
198
- *
199
- * This source code is licensed under the MIT license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */var No=Ve("outline","calendar","IconCalendar",[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]]);/**
202
- * @license @tabler/icons-react v3.17.0 - MIT
203
- *
204
- * This source code is licensed under the MIT license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */var to=Ve("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
207
- * @license @tabler/icons-react v3.17.0 - MIT
208
- *
209
- * This source code is licensed under the MIT license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */var kF=Ve("outline","checkbox","IconCheckbox",[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]]);/**
212
- * @license @tabler/icons-react v3.17.0 - MIT
213
- *
214
- * This source code is licensed under the MIT license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */var jb=Ve("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
217
- * @license @tabler/icons-react v3.17.0 - MIT
218
- *
219
- * This source code is licensed under the MIT license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */var PF=Ve("outline","circle-check","IconCircleCheck",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]);/**
222
- * @license @tabler/icons-react v3.17.0 - MIT
223
- *
224
- * This source code is licensed under the MIT license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */var qh=Ve("outline","circle-minus","IconCircleMinus",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]]);/**
227
- * @license @tabler/icons-react v3.17.0 - MIT
228
- *
229
- * This source code is licensed under the MIT license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */var Gh=Ve("outline","circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]);/**
232
- * @license @tabler/icons-react v3.17.0 - MIT
233
- *
234
- * This source code is licensed under the MIT license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */var Cb=Ve("outline","cloud-upload","IconCloudUpload",[["path",{d:"M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1",key:"svg-0"}],["path",{d:"M9 15l3 -3l3 3",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}]]);/**
237
- * @license @tabler/icons-react v3.17.0 - MIT
238
- *
239
- * This source code is licensed under the MIT license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */var NF=Ve("outline","columns","IconColumns",[["path",{d:"M4 6l5.5 0",key:"svg-0"}],["path",{d:"M4 10l5.5 0",key:"svg-1"}],["path",{d:"M4 14l5.5 0",key:"svg-2"}],["path",{d:"M4 18l5.5 0",key:"svg-3"}],["path",{d:"M14.5 6l5.5 0",key:"svg-4"}],["path",{d:"M14.5 10l5.5 0",key:"svg-5"}],["path",{d:"M14.5 14l5.5 0",key:"svg-6"}],["path",{d:"M14.5 18l5.5 0",key:"svg-7"}]]);/**
242
- * @license @tabler/icons-react v3.17.0 - MIT
243
- *
244
- * This source code is licensed under the MIT license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */var hA=Ve("outline","copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);/**
247
- * @license @tabler/icons-react v3.17.0 - MIT
248
- *
249
- * This source code is licensed under the MIT license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */var OF=Ve("outline","currency-dollar","IconCurrencyDollar",[["path",{d:"M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2",key:"svg-0"}],["path",{d:"M12 3v3m0 12v3",key:"svg-1"}]]);/**
252
- * @license @tabler/icons-react v3.17.0 - MIT
253
- *
254
- * This source code is licensed under the MIT license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */var MF=Ve("outline","device-floppy","IconDeviceFloppy",[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]]);/**
257
- * @license @tabler/icons-react v3.17.0 - MIT
258
- *
259
- * This source code is licensed under the MIT license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */var IF=Ve("outline","dots","IconDots",[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);/**
262
- * @license @tabler/icons-react v3.17.0 - MIT
263
- *
264
- * This source code is licensed under the MIT license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */var pA=Ve("outline","edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);/**
267
- * @license @tabler/icons-react v3.17.0 - MIT
268
- *
269
- * This source code is licensed under the MIT license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */var Ad=Ve("outline","equal-not","IconEqualNot",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]]);/**
272
- * @license @tabler/icons-react v3.17.0 - MIT
273
- *
274
- * This source code is licensed under the MIT license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */var kd=Ve("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
277
- * @license @tabler/icons-react v3.17.0 - MIT
278
- *
279
- * This source code is licensed under the MIT license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */var BE=Ve("outline","file-alert","IconFileAlert",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]]);/**
282
- * @license @tabler/icons-react v3.17.0 - MIT
283
- *
284
- * This source code is licensed under the MIT license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */var LF=Ve("outline","file-plus","IconFilePlus",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]]);/**
287
- * @license @tabler/icons-react v3.17.0 - MIT
288
- *
289
- * This source code is licensed under the MIT license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */var $F=Ve("outline","filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);/**
292
- * @license @tabler/icons-react v3.17.0 - MIT
293
- *
294
- * This source code is licensed under the MIT license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */var zF=Ve("outline","forms","IconForms",[["path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3",key:"svg-0"}],["path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3",key:"svg-1"}],["path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7",key:"svg-2"}],["path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1",key:"svg-3"}],["path",{d:"M17 12h.01",key:"svg-4"}],["path",{d:"M13 12h.01",key:"svg-5"}]]);/**
297
- * @license @tabler/icons-react v3.17.0 - MIT
298
- *
299
- * This source code is licensed under the MIT license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */var UF=Ve("outline","id","IconId",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 8l2 0",key:"svg-2"}],["path",{d:"M15 12l2 0",key:"svg-3"}],["path",{d:"M7 16l10 0",key:"svg-4"}]]);/**
302
- * @license @tabler/icons-react v3.17.0 - MIT
303
- *
304
- * This source code is licensed under the MIT license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */var VE=Ve("outline","list-details","IconListDetails",[["path",{d:"M13 5h8",key:"svg-0"}],["path",{d:"M13 9h5",key:"svg-1"}],["path",{d:"M13 15h8",key:"svg-2"}],["path",{d:"M13 19h5",key:"svg-3"}],["path",{d:"M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-5"}]]);/**
307
- * @license @tabler/icons-react v3.17.0 - MIT
308
- *
309
- * This source code is licensed under the MIT license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */var BF=Ve("outline","lock-access","IconLockAccess",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M8 11m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]]);/**
312
- * @license @tabler/icons-react v3.17.0 - MIT
313
- *
314
- * This source code is licensed under the MIT license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */var VF=Ve("outline","lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]);/**
317
- * @license @tabler/icons-react v3.17.0 - MIT
318
- *
319
- * This source code is licensed under the MIT license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */var FF=Ve("outline","logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]);/**
322
- * @license @tabler/icons-react v3.17.0 - MIT
323
- *
324
- * This source code is licensed under the MIT license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */var mA=Ve("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
327
- * @license @tabler/icons-react v3.17.0 - MIT
328
- *
329
- * This source code is licensed under the MIT license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */var gA=Ve("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
332
- * @license @tabler/icons-react v3.17.0 - MIT
333
- *
334
- * This source code is licensed under the MIT license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */var HF=Ve("outline","message","IconMessage",[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]]);/**
337
- * @license @tabler/icons-react v3.17.0 - MIT
338
- *
339
- * This source code is licensed under the MIT license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */var qF=Ve("outline","microscope","IconMicroscope",[["path",{d:"M5 21h14",key:"svg-0"}],["path",{d:"M6 18h2",key:"svg-1"}],["path",{d:"M7 18v3",key:"svg-2"}],["path",{d:"M9 11l3 3l6 -6l-3 -3z",key:"svg-3"}],["path",{d:"M10.5 12.5l-1.5 1.5",key:"svg-4"}],["path",{d:"M17 3l3 3",key:"svg-5"}],["path",{d:"M12 21a6 6 0 0 0 3.715 -10.712",key:"svg-6"}]]);/**
342
- * @license @tabler/icons-react v3.17.0 - MIT
343
- *
344
- * This source code is licensed under the MIT license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */var GF=Ve("outline","minus","IconMinus",[["path",{d:"M5 12l14 0",key:"svg-0"}]]);/**
347
- * @license @tabler/icons-react v3.17.0 - MIT
348
- *
349
- * This source code is licensed under the MIT license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */var WF=Ve("outline","packages","IconPackages",[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-0"}],["path",{d:"M2 13.5v5.5l5 3",key:"svg-1"}],["path",{d:"M7 16.545l5 -3.03",key:"svg-2"}],["path",{d:"M17 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-3"}],["path",{d:"M12 19l5 3",key:"svg-4"}],["path",{d:"M17 16.5l5 -3",key:"svg-5"}],["path",{d:"M12 13.5v-5.5l-5 -3l5 -3l5 3v5.5",key:"svg-6"}],["path",{d:"M7 5.03v5.455",key:"svg-7"}],["path",{d:"M12 8l5 -3",key:"svg-8"}]]);/**
352
- * @license @tabler/icons-react v3.17.0 - MIT
353
- *
354
- * This source code is licensed under the MIT license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */var QF=Ve("outline","pin","IconPin",[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]]);/**
357
- * @license @tabler/icons-react v3.17.0 - MIT
358
- *
359
- * This source code is licensed under the MIT license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */var YF=Ve("outline","pinned-off","IconPinnedOff",[["path",{d:"M3 3l18 18",key:"svg-0"}],["path",{d:"M15 4.5l-3.249 3.249m-2.57 1.433l-2.181 .818l-1.5 1.5l7 7l1.5 -1.5l.82 -2.186m1.43 -2.563l3.25 -3.251",key:"svg-1"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-2"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-3"}]]);/**
362
- * @license @tabler/icons-react v3.17.0 - MIT
363
- *
364
- * This source code is licensed under the MIT license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */var XF=Ve("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
367
- * @license @tabler/icons-react v3.17.0 - MIT
368
- *
369
- * This source code is licensed under the MIT license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */var vA=Ve("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
372
- * @license @tabler/icons-react v3.17.0 - MIT
373
- *
374
- * This source code is licensed under the MIT license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */var KF=Ve("outline","receipt","IconReceipt",[["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2m4 -14h6m-6 4h6m-2 4h2",key:"svg-0"}]]);/**
377
- * @license @tabler/icons-react v3.17.0 - MIT
378
- *
379
- * This source code is licensed under the MIT license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */var yA=Ve("outline","refresh","IconRefresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]);/**
382
- * @license @tabler/icons-react v3.17.0 - MIT
383
- *
384
- * This source code is licensed under the MIT license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */var ZF=Ve("outline","repeat","IconRepeat",[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]]);/**
387
- * @license @tabler/icons-react v3.17.0 - MIT
388
- *
389
- * This source code is licensed under the MIT license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */var JF=Ve("outline","report-medical","IconReportMedical",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]]);/**
392
- * @license @tabler/icons-react v3.17.0 - MIT
393
- *
394
- * This source code is licensed under the MIT license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */var eH=Ve("outline","router","IconRouter",[["path",{d:"M3 13m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17l0 .01",key:"svg-1"}],["path",{d:"M13 17l0 .01",key:"svg-2"}],["path",{d:"M15 13l0 -2",key:"svg-3"}],["path",{d:"M11.75 8.75a4 4 0 0 1 6.5 0",key:"svg-4"}],["path",{d:"M8.5 6.5a8 8 0 0 1 13 0",key:"svg-5"}]]);/**
397
- * @license @tabler/icons-react v3.17.0 - MIT
398
- *
399
- * This source code is licensed under the MIT license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */var tH=Ve("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);/**
402
- * @license @tabler/icons-react v3.17.0 - MIT
403
- *
404
- * This source code is licensed under the MIT license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */var Wy=Ve("outline","settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]);/**
407
- * @license @tabler/icons-react v3.17.0 - MIT
408
- *
409
- * This source code is licensed under the MIT license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */var Eb=Ve("outline","sort-ascending","IconSortAscending",[["path",{d:"M4 6l7 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l9 0",key:"svg-2"}],["path",{d:"M15 9l3 -3l3 3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
412
- * @license @tabler/icons-react v3.17.0 - MIT
413
- *
414
- * This source code is licensed under the MIT license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */var Tb=Ve("outline","sort-descending","IconSortDescending",[["path",{d:"M4 6l9 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l7 0",key:"svg-2"}],["path",{d:"M15 15l3 3l3 -3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
417
- * @license @tabler/icons-react v3.17.0 - MIT
418
- *
419
- * This source code is licensed under the MIT license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */var nH=Ve("outline","square","IconSquare",[["path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}]]);/**
422
- * @license @tabler/icons-react v3.17.0 - MIT
423
- *
424
- * This source code is licensed under the MIT license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */var rH=Ve("outline","star","IconStar",[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z",key:"svg-0"}]]);/**
427
- * @license @tabler/icons-react v3.17.0 - MIT
428
- *
429
- * This source code is licensed under the MIT license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */var iH=Ve("outline","switch-horizontal","IconSwitchHorizontal",[["path",{d:"M16 3l4 4l-4 4",key:"svg-0"}],["path",{d:"M10 7l10 0",key:"svg-1"}],["path",{d:"M8 13l-4 4l4 4",key:"svg-2"}],["path",{d:"M4 17l9 0",key:"svg-3"}]]);/**
432
- * @license @tabler/icons-react v3.17.0 - MIT
433
- *
434
- * This source code is licensed under the MIT license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */var aH=Ve("outline","table-export","IconTableExport",[["path",{d:"M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-4"}]]);/**
437
- * @license @tabler/icons-react v3.17.0 - MIT
438
- *
439
- * This source code is licensed under the MIT license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */var oH=Ve("outline","text-recognition","IconTextRecognition",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M12 16v-7",key:"svg-4"}],["path",{d:"M9 9h6",key:"svg-5"}]]);/**
442
- * @license @tabler/icons-react v3.17.0 - MIT
443
- *
444
- * This source code is licensed under the MIT license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */var am=Ve("outline","trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);/**
447
- * @license @tabler/icons-react v3.17.0 - MIT
448
- *
449
- * This source code is licensed under the MIT license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */var FE=Ve("outline","upload","IconUpload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]);/**
452
- * @license @tabler/icons-react v3.17.0 - MIT
453
- *
454
- * This source code is licensed under the MIT license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */var sH=Ve("outline","webhook","IconWebhook",[["path",{d:"M4.876 13.61a4 4 0 1 0 6.124 3.39h6",key:"svg-0"}],["path",{d:"M15.066 20.502a4 4 0 1 0 1.934 -7.502c-.706 0 -1.424 .179 -2 .5l-3 -5.5",key:"svg-1"}],["path",{d:"M16 8a4 4 0 1 0 -8 0c0 1.506 .77 2.818 2 3.5l-3 5.5",key:"svg-2"}]]);/**
457
- * @license @tabler/icons-react v3.17.0 - MIT
458
- *
459
- * This source code is licensed under the MIT license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */var qs=Ve("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
462
- * @license @tabler/icons-react v3.17.0 - MIT
463
- *
464
- * This source code is licensed under the MIT license.
465
- * See the LICENSE file in the root directory of this source tree.
466
- */var lH=Ve("filled","circle-filled","IconCircleFilled",[["path",{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",key:"svg-0"}]]);class xA extends y.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?s.jsx(Ka,{icon:s.jsx(il,{size:16}),title:"Something went wrong",color:"red",children:Ye(this.state.error)}):this.props.children}}function gi(){return s.jsx(er,{style:{width:"100%",height:"100vh"},children:s.jsx(kr,{})})}const cH="_main_6f7o5_1",uH={main:cH};function pn(e){e.preventDefault(),e.stopPropagation()}function bA(e){return e.button===1||e.ctrlKey||e.metaKey}function SA(e){if(HE(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&HE(t[0]))return!0}return!1}function HE(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Xu(e,t){return new Promise((n,r)=>{var o;const i=new MessageChannel;i.port1.onmessage=({data:c})=>{i.port1.close(),c.error?r(c.error):n(c.result)},(o=e.contentWindow)==null||o.postMessage(t,new URL(e.src).origin,[i.port2])})}function wA(e,t){const n=new Blob([e],{type:hn.JSON}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r;const o=t??new Date().toISOString().replace(/\D/g,"");i.download=`${o}.json`,document.body.appendChild(i),i.click(),URL.revokeObjectURL(r)}function mt(e){const t=rm(),{to:n,suffix:r,label:i,onClick:o,children:c,...u}=e;let f=dH(n);return r&&(f+="/"+r),s.jsx(Nt,{href:f,"aria-label":i,onAuxClick:h=>{h.stopPropagation()},onClick:h=>{h.stopPropagation(),o?(h.preventDefault(),o(h)):n&&(bA(h)||(h.preventDefault(),t(f)))},...u,children:c})}function dH(e){if(e){if(typeof e=="string")return fH(e);if(pa(e))return hH(e);if(Ko(e))return pH(e)}return"#"}function fH(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function hH(e){return`/${e.resourceType}/${e.id}`}function pH(e){return`/${e.reference}`}function mH(e){const t=e.split(" ").filter(Boolean);return t.length>1?t[0][0]+t[t.length-1][0]:t.length===1?t[0][0]:""}function Zo(e){const t=Wt(e.value),n=t?Ha(t):e.alt??"",r=mH(n),i=(t&&J8(t))??e.src,o=nA(i??void 0),c=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?s.jsx(mt,{to:t,children:s.jsx(zs,{src:o,alt:n,radius:c,...u,children:r})}):s.jsx(zs,{src:o,alt:n,radius:c,...u,children:r})}const gH="_logoButton_189g3_1",vH="_user_189g3_11",yH="_userName_189g3_21",xH="_userActive_189g3_31",oh={logoButton:gH,user:vH,userName:yH,userActive:xH};function Rb(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Oc(t,e.options)}):null}function bH(e){var f,h,m;const t=nm(),{medplum:n,profile:r,navigate:i}=t,o=n.getLogins(),{colorScheme:c,setColorScheme:u}=EO();return s.jsxs(s.Fragment,{children:[s.jsxs(qe,{align:"center",p:"xl",children:[s.jsx(Zo,{size:"xl",radius:100,value:t.profile}),s.jsx(Rb,{value:(h=(f=t.profile)==null?void 0:f.name)==null?void 0:h[0]}),s.jsx(_e,{c:"dimmed",size:"xs",children:(m=n.getActiveLogin())==null?void 0:m.project.display})]}),o.length>1&&s.jsx(Ce.Divider,{}),o.map(g=>g.profile.reference!==zt(t.profile)&&s.jsx(Ce.Item,{onClick:()=>{n.setActiveLogin(g).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(je,{children:[s.jsx(zs,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(_e,{size:"sm",fw:500,children:g.profile.display}),s.jsx(_e,{c:"dimmed",size:"xs",children:g.project.display})]})]})},g.profile.reference)),s.jsx(Ce.Divider,{}),s.jsx(je,{justify:"center",children:s.jsx(Wp,{size:"xs",value:c,onChange:g=>u(g),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(iH,{size:14,stroke:1.5}),onClick:()=>i("/signin"),children:"Add another account"}),s.jsx(Ce.Item,{leftSection:s.jsx(Wy,{size:14,stroke:1.5}),onClick:()=>i(`/${zt(r)}`),children:"Account settings"}),s.jsx(Ce.Item,{leftSection:s.jsx(FF,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),i("/signin")},children:"Sign out"}),s.jsx(_e,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const qE={selectedItems:"selected-items",options:"options"};function _b(e){const t=xd({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:i,error:o,defaultValue:c,toOption:u,loadOptions:f,itemComponent:h,pillComponent:m,emptyComponent:g,onChange:v,onCreate:b,creatable:S,clearable:w,required:C,placeholder:E,leftSection:_,maxValues:T,optionsDropdownMaxHeight:R=320,minInputLength:D=0,...k}=e,M=k.disabled,I=SH(c),[z,V]=y.useState(""),[Y,W]=y.useState(),[J,G]=y.useState(),[X,P]=y.useState(),[L,$]=y.useState(I.map(u)),[H,O]=y.useState([]),U=h??wH,K=m??jH,ee=g??CH,Se=y.useRef(z);Se.current=z;const be=y.useRef(void 0),xe=y.useRef(void 0),Ge=y.useRef(Y);Ge.current=Y;const Me=y.useRef(J);Me.current=J;const tt=y.useRef(X);tt.current=X;const ke=y.useRef(H);ke.current=H;const vt=y.useCallback(()=>{var me;if(W(void 0),Se.current===xe.current&&f===be.current||(((me=Se.current)==null?void 0:me.length)??0)<D)return;xe.current=Se.current,be.current=f;const Re=new AbortController;G(Re),f(Se.current??"",Re.signal).then(ge=>{Re.signal.aborted||(O(ge.map(u)),tt.current?(ge.length>0&&v(ge.slice(0,1)),P(!1)):ge.length>0&&t.openDropdown())}).catch(ge=>{Re.signal.aborted||ge.message.includes("aborted")||Oe({color:"red",message:Ye(ge)})}).finally(()=>{Re.signal.aborted||G(void 0)})},[t,f,v,u,D]),Lt=y.useCallback(Re=>{(H&&H.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),V(Re.currentTarget.value),Me.current&&(Me.current.abort(),G(void 0)),Ge.current!==void 0&&window.clearTimeout(Ge.current);const me=window.setTimeout(()=>vt(),100);W(me)},[t,H,S,vt]),$t=y.useCallback(Re=>{const me=L.some(we=>we.value===Re),ge=me?L.filter(we=>we.value!==Re):[...L];let Ne=H==null?void 0:H.find(we=>we.value===Re);if(!Ne&&S!==!1&&b){const we=b(Re);Ne=u(we)}if(Ne){if(T===0){v([Ne.resource]),L.length>0&&$([]);return}me||ge.push(Ne)}if(T!==void 0)for(;ge.length>T;)ge.shift();v(ge.map(we=>we.resource)),$(ge)},[S,H,L,T,v,b,u]),gt=y.useMemo(()=>{if(!M)return Re=>{M||(T===1&&(V(""),O([]),t.closeDropdown()),xe.current=void 0,Re==="$create"?(V(""),$t(z)):$t(Re))}},[$t,t,M,T,z]),At=y.useCallback(Re=>{const me=L.filter(ge=>ge.value!==Re.value);v(me.map(ge=>ge.resource)),$(me)},[L,v]),rn=y.useCallback(Re=>{Re.key==="Enter"?(Y||J)&&P(!0):Re.key==="Backspace"&&z.length===0&&(pn(Re),At(L[L.length-1]))},[J,At,z.length,L,Y]);y.useEffect(()=>()=>{Me.current&&Me.current.abort()},[]);const Ee=!M&&w&&L.length>0&&s.jsx(ct.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{V(""),$([]),v([]),t.closeDropdown()}}),De=S&&z.trim().length>0,We=H.length>0||De;return s.jsxs(ct,{store:t,onOptionSubmit:gt,withinPortal:!0,shadow:"xl",...k,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(mc,{label:r,description:i,error:o,className:e.className,leftSection:_,rightSection:J?s.jsx(kr,{size:16}):Ee,required:C,disabled:M,children:s.jsxs(Us.Group,{"data-testid":qE.selectedItems,children:[L.map(Re=>s.jsx(K,{item:Re,disabled:M,onRemove:()=>At(Re)},Re.value)),!M&&(T===void 0||T===0||L.length<T)&&s.jsx(ct.EventsTarget,{children:s.jsx(mc.Field,{role:"searchbox",name:n,value:z,placeholder:E,onFocus:Lt,onBlur:()=>{t.closeDropdown(),V("")},onKeyDown:rn,onChange:Lt})})]})})}),s.jsx(ct.Dropdown,{hidden:!We,"data-testid":qE.options,children:s.jsx(ct.Options,{children:s.jsxs(bp,{type:"scroll",mah:R,children:[H.map(Re=>{const me=L.some(ge=>ge.value===Re.value);return s.jsx(ct.Option,{value:Re.value,active:me,children:s.jsx(U,{...Re,active:me})},Re.value)}),De&&s.jsxs(ct.Option,{value:"$create",children:["+ Create ",z]}),!S&&z.trim().length>0&&H.length===0&&s.jsx(ee,{search:z})]})})})]})}function SH(e){return e?Array.isArray(e)?e:[e]:[]}function wH(e){return s.jsxs(je,{gap:"xs",children:[e.active&&s.jsx(to,{size:12}),s.jsx("span",{children:e.label})]})}function jH({item:e,disabled:t,onRemove:n}){return s.jsx(Us,{withRemoveButton:!t,onRemove:n,children:e.label})}function CH(){return s.jsx(ct.Empty,{children:"Nothing found"})}const EH="_searchInput_dick8_1",TH={searchInput:EH};function RH(e){return{value:e.id,label:Ha(e),resource:e}}function _H(e){const t=rm(),n=Ae(),r=y.useCallback(async(o,c)=>{const u=AH(o),f={signal:c},h=await n.graphql(u,void 0,void 0,f);return kH(h,o)},[n]),i=y.useCallback(o=>{o.length>0&&t(`/${zt(o[0])}`)},[t]);return s.jsx(_b,{size:"sm",radius:"md",className:TH.searchInput,leftSection:s.jsx(tH,{size:16}),placeholder:"Search",itemComponent:DH,toOption:RH,onChange:i,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const DH=y.forwardRef(({resource:e,active:t,...n},r)=>{var o;let i;return e.resourceType==="Patient"?i=e.birthDate:e.resourceType==="ServiceRequest"&&(i=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...n,children:s.jsxs(je,{wrap:"nowrap",children:[s.jsx(Zo,{value:e}),s.jsxs("div",{children:[s.jsx(_e,{children:Ha(e)}),s.jsx(_e,{size:"xs",c:"dimmed",children:i})]})]})})});function AH(e){const t=JSON.stringify(e);return RD(e)?`{
467
- Patients1: PatientList(_id: ${t}, _count: 1) {
468
- resourceType
469
- id
470
- identifier {
471
- system
472
- value
473
- }
474
- name {
475
- given
476
- family
477
- }
478
- birthDate
479
- }
480
- ServiceRequestList(_id: ${t}, _count: 1) {
481
- resourceType
482
- id
483
- identifier {
484
- system
485
- value
486
- }
487
- subject {
488
- display
489
- }
490
- }
491
- }`.replace(/\s+/g," "):`{
492
- Patients1: PatientList(name: ${t}, _count: 5) {
493
- resourceType
494
- id
495
- identifier {
496
- system
497
- value
498
- }
499
- name {
500
- given
501
- family
502
- }
503
- birthDate
504
- }
505
- Patients2: PatientList(identifier: ${t}, _count: 5) {
506
- resourceType
507
- id
508
- identifier {
509
- system
510
- value
511
- }
512
- name {
513
- given
514
- family
515
- }
516
- birthDate
517
- }
518
- ServiceRequestList(identifier: ${t}, _count: 5) {
519
- resourceType
520
- id
521
- identifier {
522
- system
523
- value
524
- }
525
- subject {
526
- display
527
- }
528
- }
529
- }`.replace(/\s+/g," ")}function kH(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),NH(PH(n),t).slice(0,5)}function PH(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 NH(e,t){return e.sort((n,r)=>GE(r,t)-GE(n,t))}function GE(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,WE(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,WE(Oc(r),t));return n}function WE(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function OH(e){var i;const t=im(),[n,r]=y.useState(!1);return s.jsx(Ar.Header,{p:8,style:{zIndex:101},children:s.jsxs(je,{justify:"space-between",children:[s.jsxs(je,{gap:"xs",children:[s.jsx(tr,{className:oh.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(_H,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(je,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(Ce,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(Ce.Target,{children:s.jsx(tr,{className:Ut(oh.user,{[oh.userActive]:n}),onClick:()=>r(o=>!o),children:s.jsxs(je,{gap:7,children:[s.jsx(Zo,{value:t,radius:"xl",size:24}),s.jsx(_e,{size:"sm",className:oh.userName,children:Oc((i=t==null?void 0:t.name)==null?void 0:i[0])}),s.jsx(jb,{size:12,stroke:1.5})]})})}),s.jsx(Ce.Dropdown,{children:s.jsx(bH,{version:e.version})})]})]})]})})}const Db=y.createContext({submitting:!1});Db.displayName="FormContext";function MH(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?IH(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&LH(t,n);return t}function IH(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function LH(e,t){e[t.name]=t.value}function pt(e){const[t,n]=y.useState(!1);return s.jsx(Db.Provider,{value:{submitting:t},children:s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const i=MH(r.target);if(e.onSubmit){n(!0);const o=e.onSubmit(i);o!=null&&o.then?o.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function xr(e){const{children:t,...n}=e,{submitting:r}=y.useContext(Db);return s.jsx(Pe,{type:"submit",loading:r,...n,children:t})}function $H(e){const t=Ae(),n=t.getUserConfiguration();function r(i){var m,g;const{menuname:o,bookmarkname:c}=i,u=`${e.pathname}?${e.searchParams.toString()}`,f=Wr(n),h=(m=f.menu)==null?void 0:m.find(({title:v})=>v===o);(g=h==null?void 0:h.link)==null||g.push({name:c,target:u}),t.updateResource(f).then(v=>{n.menu=v.menu,t.dispatchEvent({type:"change"}),Oe({color:"green",message:"Success"}),e.onOk()}).catch(v=>{Oe({color:"red",message:Ye(v)})})}return s.jsx(Bn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(pt,{onSubmit:r,children:s.jsxs(qe,{children:[s.jsx(zH,{config:n}),s.jsx($e,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(je,{justify:"flex-end",children:s.jsx(xr,{mt:"sm",children:"OK"})})]})})})}function zH(e){function t(r){var i;return(i=r==null?void 0:r.menu)==null?void 0:i.map(o=>o.title)}const n=t(e.config);return s.jsx(ln,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function jA(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function UH(e){return typeof e.display=="string"?e.display:jA(e)}function BH(e){return{value:jA(e),label:UH(e),resource:e}}function VH(e){return{code:e,display:e}}function om(e){const t=Ae(),{binding:n,creatable:r,clearable:i,expandParams:o,withHelpText:c,...u}=e,f=y.useCallback(async(h,m)=>{var S;if(!n)return[];const v=((S=(await t.valueSetExpand({...o,url:n,filter:h,count:10},{signal:m})).expansion)==null?void 0:S.contains)??[],b=[];for(const w of v)w.code&&!b.some(C=>C.code===w.code)&&b.push(w);return b},[t,o,n]);return s.jsx(_b,{...u,creatable:r??!0,clearable:i??!0,toOption:BH,loadOptions:f,onCreate:VH,itemComponent:c?FH:void 0})}const FH=y.forwardRef(({label:e,resource:t,active:n,...r},i)=>s.jsx("div",{ref:i,...r,children:s.jsxs(je,{wrap:"nowrap",gap:"xs",children:[n&&s.jsx(to,{size:12}),s.jsxs("div",{children:[s.jsx(_e,{children:e}),s.jsx(_e,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function CA(e){const{defaultValue:t,onChange:n,withHelpText:r,...i}=e,[o,c]=y.useState(t);function u(f){const h=f[0],m=qH(h);c(m),n&&n(m)}return s.jsx(om,{defaultValue:HH(o),onChange:u,withHelpText:r??!0,...i})}function HH(e){return e?{code:e}:void 0}function qH(e){return e==null?void 0:e.code}function Ab(e){const[t,n]=y.useState(e.defaultValue),r=e.onChange,i=y.useCallback(o=>{n(o),r&&r(o)},[r]);return s.jsx(CA,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:i,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 GH="_menuTitle_9g6l5_1",WH="_link_9g6l5_9",QH="_linkActive_9g6l5_38",Qy={menuTitle:GH,link:WH,linkActive:QH};function YH(e){var u;const t=rm(),n=ZH(e.pathname,e.searchParams,e.menus),[r,i]=y.useState(!1);function o(f,h){f.stopPropagation(),f.preventDefault(),t(h),window.innerWidth<768&&e.closeNavbar()}function c(f){f&&t(`/${f}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Ar.Navbar,{children:s.jsxs(Yr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(Ar.Section,{mb:"sm",children:s.jsx(Ab,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:f=>c(f)},window.location.pathname)}),s.jsxs(Ar.Section,{grow:!0,children:[(u=e.menus)==null?void 0:u.map(f=>{var h;return s.jsxs(y.Fragment,{children:[s.jsx(_e,{className:Qy.menuTitle,children:f.title}),(h=f.links)==null?void 0:h.map(m=>s.jsxs(XH,{to:m.href,active:m.href===(n==null?void 0:n.href),onClick:g=>o(g,m.href),children:[s.jsx(KH,{icon:m.icon}),s.jsx("span",{children:m.label})]},m.href))]},`menu-${f.title}`)}),e.displayAddBookmark&&s.jsx(Pe,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(vA,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx($H,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function XH(e){return s.jsx(mt,{onClick:e.onClick,to:e.to,className:Ut(Qy.link,{[Qy.linkActive]:e.active}),children:e.children})}function KH(e){return e.icon?e.icon:s.jsx(Qp,{w:30})}function ZH(e,t,n){if(!e||!t||!n)return;let r,i=0;for(const o of n)if(o.links)for(const c of o.links){const u=JH(e,t,c.href);u>i&&(i=u,r=c)}return r}function JH(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const i=["_count","_offset"];for(const[c,u]of r.searchParams.entries())if(!i.includes(c)&&t.get(c)!==u)return 0;let o=1;for(const[c,u]of t.entries())i.includes(c)||r.searchParams.get(c)===u&&o++;return o}function eq(e){const[t,n]=y.useState(localStorage.navbarOpen==="true"),r=Ae(),i=im();y.useEffect(()=>{function f(){Oe({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",f),()=>r.removeEventListener("offline",f)},[r]);function o(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){o(!1)}function u(){o(!t)}return r.isLoading()?s.jsx(gi,{}):s.jsxs(Ar,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!i||!t,mobile:!i||!t}},padding:0,children:[i&&s.jsx(OH,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:u,notifications:e.notifications}),i&&t?s.jsx(YH,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(Ar.Main,{className:uH.main,children:s.jsx(xA,{children:s.jsx(y.Suspense,{fallback:s.jsx(gi,{}),children:e.children})})})]})}const tq="https://ccda.medplum.com",nq="https://ccda-validator.medplum.com/";function rq(e){const{url:t}=e,[n,r]=y.useState(!1),i=y.useRef(null),[o,c]=y.useState(),[u,f]=y.useState(!1);y.useEffect(()=>{t&&n&&i.current&&(Xu(i.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const h=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 w=`${nq}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(w,{method:"POST",body:S,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const E=await C.json();c(E)}catch(v){c(void 0),console.error("CCDA validation error:",v)}finally{f(!1)}},m=()=>{if(!o)return;const v=JSON.stringify(o,null,2);wA(v,"ccda-validation-results")},g=()=>o?o.resultsMetaData.resultMetaData.filter(v=>v==null?void 0:v.type.includes("Error")).reduce((v,b)=>v+(b.count||0),0):0;return t?s.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[s.jsx("div",{style:{minHeight:400},children:s.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:i,src:tq,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),s.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[s.jsx(Pe,{type:"button",onClick:h,disabled:u,children:u?"Validating...":"Validate"}),o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{marginLeft:"15px"},children:[s.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),s.jsx(Pe,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function Pd(e){const{contentType:t,url:n,title:r}=e.value??{},i=nA(n);return i?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:i,alt:r}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:i})}),((t==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&s.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:i+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===hn.CDA_XML&&s.jsx(rq,{url:i}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Nt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:iq(r),children:r||"Download"})})]}):null}function iq(e){return e!=null&&e.includes(".")?e:void 0}const aq="_root_17n8t_1",oq="_compact_17n8t_25",QE={root:aq,compact:oq};function kb(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:Ut(QE.root,{[QE.compact]:n}),children:t})}function za(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function sq(e){var r;const t=(r=e.values)==null?void 0:r.map((i,o)=>s.jsx("div",{children:s.jsx(Pd,{value:i,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(!Tn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const i=e.path.split(".").pop();n=s.jsx(za,{term:Fs(i),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function Pb(e){const t=Ae(),n=y.useRef(null);function r(c){var u;pn(c),(u=n.current)==null||u.click()}function i(c){pn(c);const u=c.target.files;u&&Array.from(u).forEach(o)}function o(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Zt(f))}))}return s.jsxs(s.Fragment,{children:[s.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:c=>i(c)}),e.children({onClick:r,disabled:e.disabled})]})}function lq(e){const[t,n]=y.useState(e.defaultValue??[]),r=y.useRef(t);r.current=t;function i(o){n(o),e.onChange&&e.onChange(o)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((o,c)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Pd,{value:o,maxWidth:200})}),s.jsx("td",{children:s.jsx(An,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{pn(u);const f=t.slice();f.splice(c,1),i(f)},children:s.jsx(qh,{})})})]},`${c}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(Pb,{disabled:e.disabled,onUpload:o=>{i([...r.current,o])},children:o=>s.jsx(An,{...o,title:"Add",variant:"subtle",size:"sm",color:o.disabled?"gray":"green",children:s.jsx(Cb,{})})})})]})]})]})}function EA(e){const[t,n]=y.useState(e.defaultValue);function r(i){n(i),e.onChange&&e.onChange(i)}return t?s.jsxs(s.Fragment,{children:[s.jsx(Pd,{value:t,maxWidth:200}),s.jsx(Pe,{disabled:e.disabled,onClick:i=>{pn(i),r(void 0)},children:"Remove"})]}):s.jsx(Pb,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:i=>s.jsx(Pe,{...i,children:"Upload..."})})}const cq="_root_1vii2_1",uq={root:cq};function Lc(e){const{children:t,...n}=e;return s.jsx(y0,{className:uq.root,...n,children:t})}const dq="_paper_1igaj_1",fq="_fill_1igaj_20",YE={paper:dq,fill:fq};function sm(e){const{width:t,fill:n,className:r,children:i,...o}=e,c=t?{maxWidth:t}:void 0;return s.jsx(lr,{className:Ut(YE.paper,n&&YE.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...o,children:i})}function ot(e){const{children:t,...n}=e;return s.jsx(Lc,{children:s.jsx(sm,{...n,children:t})})}function Bi(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),s.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function Ot(e,t){var n,r,i;return(i=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(o=>{var c;return TA((c=o.expression)==null?void 0:c[0],t)}))==null?void 0:r.map(o=>{var c;return(c=o.details)==null?void 0:c.text}))==null?void 0:i.join(`
530
- `)}function Nd(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var i;return TA((i=r.expression)==null?void 0:i[0],t)})}const sh=/\[\d+\]/;function TA(e,t){const n=typeof e=="string"&&sh.test(e),r=typeof t=="string"&&sh.test(t);if(n!==r&&(e=e==null?void 0:e.replace(sh,""),t=t==null?void 0:t.replace(sh,"")),e===t)return!0;if(!e||!t)return!1;const i=e.indexOf(".");if(i>=0&&e.substring(i+1)===t)return!0;const o=t.indexOf(".");return o>=0&&t.substring(o+1)===e}function RA(e){const t=Ae(),[n,r]=y.useState();return s.jsxs(pt,{onSubmit:async i=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:i.projectName}))}catch(o){r(Zt(o))}},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Bi,{size:32}),s.jsx(Le,{children:"Create project"})]}),s.jsxs(qe,{gap:"xl",children:[s.jsx($e,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Ot(n,"projectName")}),s.jsxs(_e,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Nt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Nt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(xr,{children:"Create project"})})]})}function _A(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 DA(e){const t=Ae(),{googleClientId:n,handleGoogleCredential:r}=e,i=y.useRef(null),[o,c]=y.useState(typeof google<"u"),[u,f]=y.useState(!1),[h,m]=y.useState(!1);return y.useEffect(()=>{if(typeof google>"u"){_A("https://accounts.google.com/gsi/client",()=>c(!0));return}u||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),i.current&&!h&&(google.accounts.id.renderButton(i.current,{}),m(!0))},[t,n,u,o,i,h,r]),n?s.jsx("div",{ref:i}):null}function AA(e){if(e)return e;if(typeof window<"u"){const t=window.location.protocol+"//"+window.location.host;if([].includes(t))return"__GOOGLE_CLIENT_ID__"}}function Xr(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Ka,{icon:s.jsx(il,{size:16}),color:"red",children:t.map(r=>{var i;return s.jsx("div",{"data-testid":"text-field-error",children:pD(r)},(i=r.details)==null?void 0:i.text)})})}function kA(e){typeof grecaptcha>"u"&&_A("https://www.google.com/recaptcha/api.js?render="+e)}function PA(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function hq(e){const t=AA(e.googleClientId),n=e.recaptchaSiteKey,r=Ae(),[i,o]=y.useState(),c=Nd(i,void 0);return y.useEffect(()=>{n&&kA(n)},[n]),s.jsxs(pt,{onSubmit:async u=>{o(void 0);try{let f="";n&&(f=await PA(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:u.firstName,lastName:u.lastName,email:u.email,password:u.password,remember:u.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){o(Zt(f))}},children:[s.jsx(er,{style:{flexDirection:"column"},children:e.children}),s.jsx(Xr,{issues:c}),t&&s.jsxs(s.Fragment,{children:[s.jsx(je,{justify:"center",p:"xl",style:{height:70},children:s.jsx(DA,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(f){o(Zt(f))}}})}),s.jsx(Cn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(qe,{gap:"xl",children:[s.jsx($e,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Ot(i,"firstName")}),s.jsx($e,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Ot(i,"lastName")}),s.jsx($e,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Ot(i,"email")}),s.jsx(Ni,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Ot(i,"password")}),s.jsxs(_e,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Nt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Nt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(_e,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Nt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Nt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(je,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(zn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(xr,{children:"Create account"})]})]})}function pq(e){const{type:t,projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:o,onSuccess:c}=e,u=Ae(),[f,h]=y.useState(),[m,g]=y.useState();y.useEffect(()=>{t==="patient"&&f&&u.startNewPatient({login:f,projectId:n}).then(b=>u.processCode(b.code)).then(()=>c()).catch(b=>g(Zt(b)))},[u,t,n,f,c]);function v(b){b.code?u.processCode(b.code).then(()=>c()).catch(console.log):b.login&&h(b.login)}return s.jsxs(ot,{width:450,children:[m&&s.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&s.jsx(hq,{projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:o,handleAuthResponse:v,children:e.children}),f&&t==="project"&&s.jsx(RA,{login:f,handleAuthResponse:v})]})}function mq(e){const[t,n]=y.useState();return t?s.jsx(vq,{email:t,...e}):s.jsx(gq,{setEmail:n,...e})}function gq(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:i,disableEmailAuth:o,...c}=e,u=Ae(),f=!e.disableGoogleAuth&&AA(e.googleClientId),[h,m]=y.useState(),g=Nd(h,void 0),v=y.useCallback(async w=>{if(!w.authorizeUrl)return!1;const C=JSON.stringify({...await u.ensureCodeChallenge(c),domain:w.domain}),E=new URL(w.authorizeUrl);return E.searchParams.set("state",C),window.location.assign(E.toString()),!0},[u,c]),b=y.useCallback(async w=>{const C=await u.post("auth/method",{email:w.email});await v(C)||t(w.email)},[u,v,t]),S=y.useCallback(async w=>{try{const C=await u.startGoogleLogin({...c,googleCredential:w.credential});await v(C)||r(C)}catch(C){m(Zt(C))}},[u,c,v,r]);return s.jsxs(pt,{onSubmit:b,children:[s.jsx(er,{style:{flexDirection:"column"},children:i}),s.jsx(Xr,{issues:g}),f&&s.jsxs(s.Fragment,{children:[s.jsx(je,{justify:"center",p:"xl",style:{height:70},children:s.jsx(DA,{googleClientId:f,handleGoogleCredential:S})}),!o&&s.jsx(Cn,{label:"or",labelPosition:"center",my:"lg"})]}),!o&&s.jsx($e,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Ot(h,"email")}),s.jsxs(je,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Nt,{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"})}),!o&&s.jsx(xr,{children:"Next"})]})]})}function vq(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...i}=e,o=Ae(),[c,u]=y.useState(),f=Nd(c,void 0),h=y.useCallback(m=>{o.startLogin({...i,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>u(Zt(g)))},[o,i,n]);return s.jsxs(pt,{onSubmit:h,children:[s.jsx(er,{style:{flexDirection:"column"},children:r}),s.jsx(Xr,{issues:f}),s.jsx(qe,{gap:"xl",children:s.jsx(Ni,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Ot(c,"password")})}),s.jsxs(je,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Nt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(zn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(xr,{children:"Sign in"})]})]})}function yq(e){const t=Ae(),n=xd(),[r,i]=y.useState(""),[o,c]=y.useState();function u(g){var v;return!!((v=g==null?void 0:g.toLowerCase())!=null&&v.includes(r.toLowerCase()))}function f(g){var v,b;return u((v=g.profile)==null?void 0:v.display)||u((b=g.project)==null?void 0:b.display)}function h(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(v=>c(Zt(v)))}const m=e.memberships.filter(f).slice(0,10).map(g=>s.jsx(ct.Option,{value:g.id,children:s.jsx(xq,{...g})},g.id));return s.jsxs(qe,{children:[s.jsxs(Fo,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(Bi,{size:32}),s.jsx(Le,{order:3,children:"Choose profile"})]}),s.jsx(Xr,{outcome:o}),s.jsxs(ct,{store:n,onOptionSubmit:h,children:[s.jsx(ct.EventsTarget,{children:s.jsx($e,{placeholder:"Search",value:r,onChange:g=>{i(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(ct.Options,{children:m.length>0?m:s.jsx(ct.Empty,{children:"Nothing found..."})})})]})]})}function xq(e){var t,n;return s.jsxs(je,{children:[s.jsx(zs,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(_e,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(_e,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}const bq=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,Sq="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",wq="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",jq="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",Cq=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,Eq="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",Tq="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",Rq="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",_q="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",Dq="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",Aq="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function kq(e){const t=Ae();return s.jsx(pt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(qe,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Bi,{size:32}),s.jsx(Le,{children:"Choose scope"})]}),s.jsx(qe,{children:(e.scope??"openid").split(" ").map(n=>{let r;return bq.test(n)?r=[n+Sq,n+wq,n+jq]:Cq.test(n)&&(r=[n+Eq,n+Tq,n+Rq,n+_q,n+Dq,n+Aq]),s.jsxs(s.Fragment,{children:[s.jsx(zn,{id:n,name:n,label:n,defaultChecked:!0},n),r==null?void 0:r.map(i=>s.jsx(zn,{id:i,name:i,label:i},i))]},n+"_group")})}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(xr,{children:"Set scope"})})]})})}function NA(e){const[t,n]=y.useState();return s.jsx(pt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(i=>n(Ye(i)))},children:s.jsxs(qe,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Bi,{size:32}),s.jsx(Le,{children:"Enter MFA code"})]}),t&&s.jsx(Ka,{icon:s.jsx(il,{size:16}),title:"Error",color:"red",children:t}),s.jsx(qe,{children:s.jsx($e,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(xr,{children:"Submit code"})})]})})}function OA(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:i,onRegister:o,onCode:c,...u}=e,f=Ae(),[h,m]=y.useState(),g=y.useRef(!1),[v,b]=y.useState(!1),[S,w]=y.useState(),C=y.useCallback(T=>{c?c(T):f.processCode(T).then(()=>{r&&r()}).catch(R=>Oe({color:"red",message:Ye(R)}))},[f,c,r]),E=y.useCallback(T=>{b(!!T.mfaRequired),T.login&&m(T.login),T.memberships&&w(T.memberships),T.code&&(n?w(void 0):C(T.code))},[n,C]),_=y.useCallback(T=>{C(T.code)},[C]);return y.useEffect(()=>{t&&!g.current&&!h&&(g.current=!0,f.get("auth/login/"+t).then(E).catch(T=>Oe({color:"red",message:Ye(T)})))},[f,t,g,h,E]),s.jsx(ot,{width:450,px:"sm",py:"md",children:h?v?s.jsx(NA,{onSubmit:async T=>{const R=await f.post("auth/mfa/verify",{login:h,token:T.token});E(R)}}):S?s.jsx(yq,{login:h,memberships:S,handleAuthResponse:E}):e.projectId==="new"?s.jsx(RA,{login:h,handleAuthResponse:E}):e.chooseScopes?s.jsx(kq,{login:h,scope:e.scope,handleAuthResponse:_}):s.jsx("div",{children:"Success"}):s.jsx(mq,{onForgotPassword:i,onRegister:o,handleAuthResponse:E,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function aa(e){return s.jsx(s.Fragment,{children:Ho(e.value)})}function Pq(e){return s.jsx(s.Fragment,{children:Dd(e.value)})}function MA(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),s.jsx(s.Fragment,{children:n.join("").trim()})}function Nq(e){var n;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>s.jsx(MA,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function lm(e,t,n){const r=vc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function Oq(e,t,n){const r=bD(e,t,n);return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function Mq(e){const{elementDefinitionType:t}=e,n=Ae(),r=y.useContext(cn),[i,o]=y.useState(yD("Extension")),c=y.useMemo(()=>{if(Tn(t==null?void 0:t.profile))return t.profile[0]},[t]),[u,f]=y.useState(c!==void 0);if(y.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=Nc(c);f(!1),g&&o(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(u||!tb(c)))return s.jsx("div",{children:"Loading..."});const h=i.elements["value[x]"];if((h==null?void 0:h.max)!==0){const[g,v]=lm({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return s.jsx(Li,{propertyType:v,value:g})}return s.jsx(Wh,{path:e.path,value:{type:i.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function Iq(e){var t,n;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function Lq(e){return s.jsx(s.Fragment,{children:EU(e.value)})}function cd(e){return s.jsx(s.Fragment,{children:Ns(e.value)})}function Nb(e){return s.jsx(s.Fragment,{children:sd(e.value)})}function $q(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(cd,{value:t.numerator})," / ",s.jsx(cd,{value:t.denominator})]}):null}function Yy(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Ii(e.value);return e.link!==!1&&e.value.reference?s.jsx(mt,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function IA(e,t,n,r){if(!Tn(n==null?void 0:n.slices))return[e];const i=new Array(t.length+1);for(let o=0;o<i.length;o++)i[o]=[];for(const o of e){const c=JD(o,t,n.discriminator,r);let u=c?t.findIndex(f=>f.name===c):-1;u===-1&&(u=t.length),i[u].push(o)}return i}async function LA({medplum:e,property:t}){return new Promise((n,r)=>{var u,f;if(!t.slicing){n([]);return}const i=[],o=[],c=[];for(const h of t.slicing.slices){if(!ZD(h)){console.debug("Unsupported slice definition",h);continue}let m;Tn(h.elements)||(m=(f=(u=h.type[0])==null?void 0:u.profile)==null?void 0:f[0]),i.push(h),o.push(m),m&&c.push(e.requestProfileSchema(m))}Promise.all(c).then(()=>{for(let h=0;h<i.length;h++){const m=i[h],g=o[h];if(g){const v=Nc(g);m.typeSchema=v}}n(i)}).catch(r)})}function cm(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function zq(e){var c,u;const{slice:t,property:n}=e,r=((c=t.typeSchema)==null?void 0:c.elements)??t.elements,i=y.useContext(cn),o=y.useMemo(()=>{var f;if(Tn(r))return xc({parentContext:i,elements:r,path:e.path,profileUrl:(f=t.typeSchema)==null?void 0:f.url})},[i,e.path,(u=t.typeSchema)==null?void 0:u.url,r]);return cm(cn.Provider,o,s.jsx(s.Fragment,{children:e.value.map((f,h)=>s.jsx("div",{children:s.jsx(Li,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:f,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${h}-${e.value.length}`))}))}const XE=50;function Uq(e){var C;const{property:t,propertyType:n}=e,r=Ae(),i=y.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[o,c]=y.useState(!0),[u,f]=y.useState([]),[h,m]=y.useState(()=>[i]),[g,v]=y.useState(0),b=y.useContext(cn);if(y.useEffect(()=>{LA({medplum:r,property:t}).then(E=>{v(i.length),f(E);const _=i.slice(0,XE),T=IA(_,E,t.slicing,b.profileUrl);m(T),c(!1)}).catch(E=>{console.error(E),c(!1)})},[r,t,b.profileUrl,m,i]),o)return s.jsx("div",{children:"Loading..."});let S;if(((C=t.type[0])==null?void 0:C.code)!=="Extension"){const E=h[u.length],_=E.map((T,R)=>s.jsx("div",{children:s.jsx(Li,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:T,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${R}-${E.length}`));if(e.includeDescriptionListEntry){if(!Tn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const T=e.path.split(".").pop();S=s.jsx(za,{term:Fs(T),children:_})}else S=s.jsx(s.Fragment,{children:_})}return s.jsxs(s.Fragment,{children:[u.map((E,_)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let T=s.jsx(zq,{path:e.path,slice:E,property:t,value:h[_],ignoreMissingValues:e.ignoreMissingValues,link:e.link},E.name);return e.includeDescriptionListEntry&&(T=s.jsx(za,{term:Fs(E.name),children:T},E.name)),T}),S,g>XE&&s.jsx(je,{justify:"right",children:s.jsxs(_e,{children:["... ",g," total values"]})})]})}function Li(e){var o;const{property:t,propertyType:n,value:r}=e;if((o=t==null?void 0:t.path)==null?void 0:o.endsWith(".id"))return s.jsxs(ce,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Rn(r)&&s.jsx(b_,{value:r,timeout:2e3,children:({copied:c,copy:u})=>s.jsx(tl,{label:c?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(An,{variant:"subtle",color:c?"teal":"gray",onClick:u,children:c?s.jsx(to,{size:"1rem"}):s.jsx(hA,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===ae.Attachment?s.jsx(sq,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(Uq,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case ae.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case ae.SystemString:case ae.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case ae.code:case ae.date:case ae.decimal:case ae.id:case ae.integer:case ae.positiveInt:case ae.unsignedInt:case ae.uri:case ae.url:return s.jsx(s.Fragment,{children:r});case ae.canonical:return s.jsx(Yy,{value:{reference:r},link:e.link});case ae.dateTime:case ae.instant:return s.jsx(s.Fragment,{children:gr(r)});case ae.markdown:return s.jsx("pre",{children:r});case ae.Address:return s.jsx(pF,{value:r});case ae.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case ae.Attachment:return s.jsx(Pd,{value:r,maxWidth:e.maxWidth});case ae.CodeableConcept:return s.jsx(aa,{value:r});case ae.Coding:return s.jsx(Pq,{value:r});case ae.ContactDetail:return s.jsx(Nq,{value:r});case ae.ContactPoint:return s.jsx(MA,{value:r});case ae.HumanName:return s.jsx(Rb,{value:r});case ae.Identifier:return s.jsx(Iq,{value:r});case ae.Money:return s.jsx(Lq,{value:r});case ae.Period:return s.jsx(s.Fragment,{children:bU(r)});case ae.Quantity:case ae.Duration:return s.jsx(cd,{value:r});case ae.Range:return s.jsx(Nb,{value:r});case ae.Ratio:return s.jsx($q,{value:r});case ae.Reference:return s.jsx(Yy,{value:r,link:e.link});case ae.Timing:return s.jsx(s.Fragment,{children:OD(r)});case ae.Dosage:case ae.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Wh,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case ae.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Mq,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Wh,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const $A=["extension","modifierExtension"],Bq=dA.filter(e=>!$A.includes(e));function Wh(e){const t=e.value,{value:n,type:r}=t,i=y.useContext(cn),o=e.profileUrl??(i==null?void 0:i.profileUrl),c=y.useMemo(()=>Xp(r,o),[o,r]),u=y.useMemo(()=>{if(c)return xc({parentContext:i,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,i,e.path,e.accessPolicyResource]);if(Rn(n))return null;if(!c)return s.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return s.jsx("div",{children:n.name});const f=u??i;return cm(cn.Provider,u,s.jsx(kb,{compact:e.compact,children:Object.entries(f.elements).map(([h,m])=>{var w;if($A.includes(h)&&Rn((w=m.slicing)==null?void 0:w.slices))return null;if(Bq.includes(h))return null;if(fA.includes(h)&&m.path.split(".").length===2||h.includes("."))return null;const[g,v]=lm(t,h,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Rn(g)||e.path.endsWith(".extension")&&(h==="url"||h==="id"))return null;const b=m.max>1||m.isArray,S=s.jsx(Li,{property:m,propertyType:v,path:e.path+"."+h,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},h);return b?S:s.jsx(za,{term:Fs(h),children:S},h)})}))}const Vq="_dimmed_11me5_1",Fq="_preserveBreaks_11me5_5",Xy={dimmed:Vq,preserveBreaks:Fq},zA="Read Only";function UA(e,t){return e?s.jsx(tl.Floating,{label:e,children:t}):t}function BA(e){const{debugMode:t}=y.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,UA(e!=null&&e.readonly?zA:void 0,s.jsxs(je,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(mn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?Xy.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function It(e){const{debugMode:t}=y.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,UA(e!=null&&e.readonly?zA:void 0,s.jsx(mn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:Ut({[Xy.dimmed]:e==null?void 0:e.readonly},Xy.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Ot(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function Hq(e,t,n,r,i){const o=r.type;if(o.length>1)for(const c of o){const u=t.replace("[x]",In(c.code));u in e&&delete e[u]}return Rn(i)?e[n]=void 0:e[n]=i,e}function qq(e){return!!e&&!Rn(e.url)&&!Rn(e.name)}function Gq(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:i,path:o,valuePath:c,...u}=e,[f,h]=y.useState(t);function m(g){const v=Qq(g);h(v),n&&n(v)}return s.jsx(om,{defaultValue:f&&Wq(f),onChange:m,withHelpText:r??!0,...u})}function Wq(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function Qq(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function Yq(e){var h,m;const{defaultValue:t,onChange:n,withHelpText:r,response:i,...o}=e,[c,u]=y.useState(((m=(h=i==null?void 0:i.answer)==null?void 0:h[0])==null?void 0:m.valueCoding)??t);function f(g){const v=g[0],b=v&&Kq(v);u(b),n&&n(b)}return s.jsx(om,{defaultValue:c?Xq(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...o})}function Xq(e){return{system:e.system,code:e.code,display:e.display}}function Kq(e){return{system:e.system,code:e.code,display:e.display}}function VA(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:i}=y.useContext(cn),[o,c]=y.useState(e.defaultValue),u=y.useRef(o);u.current=o;const[f,h,m]=y.useMemo(()=>["system","use","value"].map(T=>r[t+"."+T]),[r,t]),[g,v,b]=y.useMemo(()=>["system","use","value"].map(T=>i(t+"."+T)),[i,t]);function S(T){T&&Object.keys(T).length===0&&(T=void 0),c(T),e.onChange&&e.onChange(T)}function w(T){const R={...u.current,system:T};T||delete R.system,S(R)}function C(T){const R={...u.current,use:T};T||delete R.use,S(R)}function E(T){const R={...u.current,value:T};T||delete R.value,S(R)}const _=e.valuePath??t;return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ln,{disabled:e.disabled||(g==null?void 0:g.readonly),"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((f==null?void 0:f.min)??0)>0,onChange:T=>w(T.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Ot(n,_+".system")}),s.jsx(ln,{disabled:e.disabled||(v==null?void 0:v.readonly),"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((h==null?void 0:h.min)??0)>0,onChange:T=>C(T.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Ot(n,_+".use")}),s.jsx($e,{disabled:e.disabled||(b==null?void 0:b.readonly),placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((m==null?void 0:m.min)??0)>0,onChange:T=>E(T.currentTarget.value),error:Ot(n,_+".value")})]})}function Zq(e){var m;const[t,n]=y.useState(e.defaultValue),r=y.useRef(t);r.current=t;const{getExtendedProps:i}=y.useContext(cn),[o,c]=y.useMemo(()=>["name","telecom"].map(g=>i(e.path+"."+g)),[i,e.path]);function u(g){n(g),e.onChange&&e.onChange(g)}function f(g){const v={...r.current,name:g};g||delete v.name,u(v)}function h(g){const v={...r.current,telecom:g&&[g]};g||delete v.telecom,u(v)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx($e,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:g=>f(g.currentTarget.value)}),s.jsx(VA,{disabled:e.disabled||(c==null?void 0:c.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(m=t==null?void 0:t.telecom)==null?void 0:m[0],onChange:h,outcome:e.outcome})]})}function Jq(e){if(!e)return"";const t=new Date(e);return Zp(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function Ob(e){if(!e)return"";const t=new Date(e);return Zp(t)?t.toISOString():""}function oa(e){return s.jsx($e,{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:eG(),step:1,defaultValue:Jq(e.defaultValue),autoFocus:e.autoFocus,error:Ot(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(Ob(n))}}})}function eG(){return"datetime-local"}function tG(e){const{propertyType:t}=e,n=Ae(),r=y.useMemo(()=>{if(Tn(t.profile))return t.profile[0]},[t]),[i,o]=y.useState(r!==void 0);return y.useEffect(()=>{r&&(o(!0),n.requestProfileSchema(r).then(()=>o(!1)).catch(c=>{o(!1),console.warn(c)}))},[n,r]),r&&(i||!tb(r))?s.jsx("div",{children:"Loading..."}):s.jsx($b,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function nG(e){var _,T,R;const{outcome:t,path:n}=e,[r,i]=y.useState(e.defaultValue),{getExtendedProps:o}=y.useContext(cn),[c,u,f,h,m]=y.useMemo(()=>["use","prefix","given","family","suffix"].map(D=>o(e.path+"."+D)),[o,e.path]);function g(D){i(D),e.onChange&&e.onChange(D)}function v(D){g({...r,use:D||void 0})}function b(D){g({...r,prefix:D?D.split(" "):void 0})}function S(D){g({...r,given:D?D.split(" "):void 0})}function w(D){g({...r,family:D||void 0})}function C(D){g({...r,suffix:D?D.split(" "):void 0})}const E=e.valuePath??n;return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ln,{disabled:e.disabled||(c==null?void 0:c.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:D=>v(D.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Ot(t,E+".use")}),s.jsx($e,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(_=r==null?void 0:r.prefix)==null?void 0:_.join(" "),onChange:D=>b(D.currentTarget.value),error:Ot(t,E+".prefix")}),s.jsx($e,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(T=r==null?void 0:r.given)==null?void 0:T.join(" "),onChange:D=>S(D.currentTarget.value),error:Ot(t,E+".given")}),s.jsx($e,{disabled:e.disabled||(h==null?void 0:h.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:D=>w(D.currentTarget.value),error:Ot(t,E+".family")}),s.jsx($e,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(R=r==null?void 0:r.suffix)==null?void 0:R.join(" "),onChange:D=>C(D.currentTarget.value),error:Ot(t,E+".suffix")})]})}function rG(e){const[t,n]=y.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:i}=y.useContext(cn),[o,c]=y.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[u,f]=y.useMemo(()=>["system","value"].map(g=>i(e.path+"."+g)),[i,e.path]);function h(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx($e,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"System",required:((o==null?void 0:o.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:g=>h({...t,system:g.currentTarget.value}),error:Ot(e.outcome,m+".system")}),s.jsx($e,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Value",required:((c==null?void 0:c.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:g=>h({...t,value:g.currentTarget.value}),error:Ot(e.outcome,m+".value")})]})}const iG=["USD","EUR","CAD","GBP","AUD"];function aG(e){var g;const{onChange:t}=e,[n,r]=y.useState(e.defaultValue),{getExtendedProps:i}=y.useContext(cn),[o,c]=y.useMemo(()=>["currency","value"].map(v=>i(e.path+"."+v)),[i,e.path]),u=y.useCallback(v=>{r(v),t&&t(v)},[t]),f=y.useCallback(v=>{u({...n,currency:v.currentTarget.value})},[n,u]),h=y.useCallback(v=>{u({...n,value:v.currentTarget.valueAsNumber})},[n,u]),m=s.jsx(ln,{disabled:e.disabled||(o==null?void 0:o.readonly),defaultValue:n==null?void 0:n.currency,data:iG,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return s.jsx($e,{disabled:e.disabled||(c==null?void 0:c.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((g=n==null?void 0:n.value)==null?void 0:g.toString())??"USD",leftSection:s.jsx(OF,{size:14}),rightSection:m,rightSectionWidth:92,onChange:h})}function oG(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[i,o]=y.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(oa,{disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:u=>c({...t,start:u})}),s.jsx(oa,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:u=>c({...t,end:u})})]})}function Gs(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[i,o,c]=y.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function u(f){n(f),e.onChange&&e.onChange(f)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ln,{disabled:e.disabled||(i==null?void 0:i.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:f=>u({...t,comparator:f.currentTarget.value})}),s.jsx($e,{disabled:e.disabled||(o==null?void 0:o.readonly),id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{u({...t,value:sG(f.currentTarget.value)})}}),s.jsx($e,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:f=>u({...t,unit:f.currentTarget.value})})]})}function sG(e){if(e)return parseFloat(e)}function Mb(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[i,o]=y.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Gs,{path:e.path+".low",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:u=>c({...t,low:u})}),s.jsx(Gs,{path:e.path+".high",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:u=>c({...t,high:u})})]})}function lG(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[i,o]=y.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Gs,{path:e.path+".numerator",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:u=>c({...t,numerator:u})}),s.jsx(Gs,{path:e.path+".denominator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:u=>c({...t,denominator:u})})]})}const cG={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},uG=["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 dG(e){return{value:zt(e)??"",label:Ha(e),resource:e}}function al(e){const t=Ae(),{resourceType:n,searchCriteria:r}=e,[i,o]=y.useState(),c=Wt(e.defaultValue,o),u=e.itemComponent??fG,f=e.onChange,h=y.useCallback(async(g,v)=>{const b=hG(n),S=new URLSearchParams({[b]:g??"",_count:"10",...r});return await t.searchResources(n,S,{signal:v})},[t,n,r]),m=y.useCallback(g=>{f&&f(g[0])},[f]);return Tn(e.defaultValue)&&!i&&!c?null:s.jsx(_b,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:u,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:dG,loadOptions:h,onChange:m,clearable:!0})}const fG=y.forwardRef(({label:e,resource:t,active:n,...r},i)=>s.jsx("div",{ref:i,...r,children:s.jsxs(je,{wrap:"nowrap",children:[s.jsx(Zo,{value:t}),s.jsxs("div",{children:[s.jsx(_e,{children:e}),s.jsx(_e,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function hG(e){return cG[e]??(uG.includes(e)?"name":"_id")}function Od(e){const{onChange:t}=e,n=Ae(),[r,i]=y.useState(e.defaultValue),[o,c]=y.useState(()=>pG(e.targetTypes)),[u,f]=y.useState(()=>mG(e.defaultValue,o)),h=y.useRef(new uD),m=y.useMemo(()=>(u==null?void 0:u.type)==="profile"?{...e.searchCriteria,_profile:u.value}:e.searchCriteria,[e.searchCriteria,u]);y.useEffect(()=>{let b=!1;const S=o==null?void 0:o.map(w=>{if(!vG(w))return Promise.resolve(w);b=!0;const C=w.value,E=h.current.get(C);if(E)return E;const _=gG(n,w.value).then(R=>{const D={...w};return R?Tn(R.type)?(D.resourceType=R.type,D.name=R.name,D.title=R.title):(console.error(`StructureDefinition.type missing for ${w.value}`),D.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${w.value}`),D.error="StructureDefinition not found"),D}).catch(R=>(console.error(R),{...w,error:R})),T=new Di(_);return h.current.set(C,T),T});!S||!b||Promise.all(S).then(w=>{if(c(w),!u)return;const C=w.findIndex(E=>E.value===u.value||E.resourceType===u.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${u.resourceType}`);return}f(w[C])}).catch(console.error)},[n,u,o]);const g=y.useCallback(b=>{const S=b?nn(b):void 0;i(S),t&&t(S)},[t]),v=y.useMemo(()=>o?o.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[o]);return s.jsxs(s.Fragment,{children:[e.name&&s.jsx("input",{type:"hidden",name:e.name,value:(r==null?void 0:r.reference)??""}),s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o&&o.length>1&&s.jsx(ln,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:u==null?void 0:u.resourceType,autoFocus:e.autoFocus,onChange:b=>{const S=b.currentTarget.value,w=o.find(C=>C.value===S);f(w)},data:v}),!o&&s.jsx(Ab,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:u==null?void 0:u.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(al,{resourceType:u==null?void 0:u.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function pG(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 mG(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const i=t==null?void 0:t.find(o=>o.resourceType===n);return i||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function gG(e,t){const n=Nc(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
531
- StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
532
- type,
533
- name,
534
- title,
535
- }
536
- }`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function vG(e){return e.type==="profile"&&!(e!=null&&e.error)&&Rn(e.resourceType)}function yG(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const xG="_indented_ldk1d_1",FA={indented:xG};function Ib({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(Pe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(Gh,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(An,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(Gh,{size:"1.25rem"})})}function HA({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(An,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(qh,{size:"1.25rem"})})}function bG(e){var b,S;const{slice:t,property:n}=e,[r,i]=y.useState(e.defaultValue),o=((b=t.typeSchema)==null?void 0:b.elements)??t.elements,c=y.useContext(cn),u=y.useMemo(()=>{var w;if(Tn(o))return xc({parentContext:c,elements:o,path:e.path,profileUrl:(w=t.typeSchema)==null?void 0:w.url})},[c,e.path,(S=t.typeSchema)==null?void 0:S.url,o]);function f(w){i(w),e.onChange&&e.onChange(w)}const h=t.min>0,m=Rn(t.elements),g=LD(t.name),v=e.property.readonly&&r.length===0;return cm(cn.Provider,u,s.jsx(It,{title:g,description:t.definition,withAsterisk:h,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:v?s.jsx(_e,{c:"dimmed",children:"(empty)"}):s.jsxs(qe,{className:m?FA.indented:void 0,children:[r.map((w,C)=>s.jsxs(je,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${C}`,children:s.jsx(Lb,{elementDefinitionType:t.type[0],name:t.name,defaultValue:w,onChange:E=>{const _=[...r];_[C]=E,f(_)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0,readOnly:e.property.readonly})}),!e.property.readonly&&r.length>t.min&&s.jsx(HA,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${C}`,onClick:E=>{pn(E);const _=[...r];_.splice(C,1),f(_)}})]},`${C}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(je,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Ib,{propertyDisplayName:g,onClick:w=>{pn(w);const C=[...r,void 0];f(C)},testId:e.testId&&`${e.testId}-add`})})]})}))}function SG(e){var _;const{property:t}=e,n=Ae(),[r,i]=y.useState(!0),[o,c]=y.useState([]),[u]=y.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,h]=y.useState(()=>[u]),m=y.useContext(cn),g=(_=t.type[0])==null?void 0:_.code;y.useEffect(()=>{LA({medplum:n,property:t}).then(T=>{c(T);const R=IA(u,T,t.slicing,m.profileUrl);wG(R,T),h(R),i(!1)}).catch(T=>{console.error(T),i(!1)})},[n,t,u,m.profileUrl,h]);function v(T,R){const D=[...f];if(D[R]=T,h(D),e.onChange){const k=D.flat().filter(M=>M!==void 0);e.onChange(k)}}if(r)return s.jsx("div",{children:"Loading..."});const b=o.length,S=f[b],w=!(e.hideNonSliceValues??(g==="Extension"&&o.length>0)),C=Fs(t.path),E=e.property.readonly&&o.length===0&&u.length===0;return s.jsxs(qe,{className:e.indent?FA.indented:void 0,children:[E&&s.jsx(_e,{c:"dimmed",children:"(empty)"}),o.map((T,R)=>s.jsx(bG,{slice:T,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[R],onChange:D=>{v(D,R)},testId:`slice-${T.name}`},T.name)),w&&S.map((T,R)=>s.jsxs(je,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(Md,{arrayElement:!0,property:e.property,name:e.name+"."+R,path:e.path,valuePath:yG(e.path,e.valuePath,R),defaultValue:T,onChange:D=>{const k=[...S];k[R]=D,v(k,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(HA,{propertyDisplayName:C,testId:`nonsliced-remove-${R}`,onClick:D=>{pn(D);const k=[...S];k.splice(R,1),v(k,b)}})]},`${R}-${S.length}`)),!e.property.readonly&&w&&f.flat().length<t.max&&s.jsx(je,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Ib,{propertyDisplayName:C,onClick:T=>{pn(T);const R=[...S];R.push(void 0),v(R,b)},testId:"nonsliced-add"})})]})}function wG(e,t){for(let n=0;n<t.length;n++){const r=t[n],i=e[n];for(;i.length<r.min;)i.push(void 0)}}function jG(e){const[t,n]=y.useState(!1),r=xR(),i=y.useRef(null),o={...e.styles};return t||(o.input||(o.input={}),o.input.WebkitTextSecurity="disc"),s.jsxs(Fo,{gap:"xs",children:[s.jsx(el,{...e,styles:{...o,root:{...o.root??{},flexGrow:1}},ref:i,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(An,{title:"Copy secret",onClick:()=>{var c;r.copy((c=i.current)==null?void 0:c.value),Oe({color:"green",message:"Copied"})},children:s.jsx(hA,{})})]})}const CG=["sun","mon","tue","wed","thu","fri","sat"];function EG(e){const[t,n]=y.useState(e.defaultValue),[r,i]=y.useState(!e.disabled&&(e.defaultModalOpen??!1)),o=y.useRef(t);return o.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:OD(o.current)||"No repeat"}),s.jsx(Pe,{disabled:e.disabled,onClick:()=>i(!0),children:"Edit"})]}),!e.disabled&&s.jsx(TG,{path:e.path,visible:r,defaultValue:o.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),i(!1)},onCancel:()=>i(!1)})]})}const KE={repeat:{period:1,periodUnit:"d"}};function TG(e){const[t,n]=y.useState(e.defaultValue||KE),{getExtendedProps:r}=y.useContext(cn),[i,o,c,u,f]=y.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(w=>r(e.path+"."+w)),[r,e.path]),h=y.useRef(t);h.current=t;function m(w){n({...h.current,event:[w]})}function g(w){n({...h.current,repeat:w})}function v(w){var C;g({...(C=h.current)==null?void 0:C.repeat,period:w})}function b(w){var C;g({...(C=h.current)==null?void 0:C.repeat,periodUnit:w})}function S(w){var C;g({...(C=h.current)==null?void 0:C.repeat,dayOfWeek:w})}return s.jsx(Bn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(qe,{children:[s.jsx(It,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(oa,{disabled:i==null?void 0:i.readonly,name:"timing-dialog-start",onChange:w=>m(w)})}),s.jsx(Cd,{disabled:o==null?void 0:o.readonly,label:"Repeat",checked:!!t.repeat,onChange:w=>g(w.currentTarget.checked?KE.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(It,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx($e,{disabled:c==null?void 0:c.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:w=>v(parseInt(w.currentTarget.value,10)||1)}),s.jsx(ln,{disabled:u==null?void 0:u.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:w=>b(w.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&s.jsx(It,{title:"Repeat on",children:s.jsx(nd.Group,{multiple:!0,onChange:S,children:s.jsx(je,{justify:"space-between",mt:"md",gap:"xs",children:CG.map(w=>s.jsx(nd,{value:w,size:"xs",radius:"xl",disabled:f==null?void 0:f.readonly,children:w.charAt(0).toUpperCase()},w))})})})]}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Md(e){var u;const{property:t,name:n,onChange:r,defaultValue:i}=e,o=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(o===ae.Attachment)return s.jsx(lq,{name:n,defaultValue:i,onChange:r,disabled:t.readonly});const f=((u=c[0])==null?void 0:u.code)!==ae.Extension;return s.jsx(SG,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:i,indent:f,onChange:r,outcome:e.outcome})}else return c.length>1?s.jsx(RG,{elementDefinitionTypes:c,...e}):s.jsx(Lb,{name:n,defaultValue:i,onChange:f=>{if(e.onChange){const h=e.name.replace("[x]",In(c[0].code));e.onChange(f,h)}},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 RG(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(o=>o.code===e.defaultPropertyType)),n||(n=t[0]);const[r,i]=y.useState(n);return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ln,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:o=>{i(t.find(c=>c.code===o.currentTarget.value))},data:t.map(o=>({value:o.code,label:o.code}))}),s.jsx(Lb,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:o=>{e.onChange&&e.onChange(o,e.name.replace("[x]",In(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 Lb(e){const{name:t,onChange:n,outcome:r,binding:i,path:o,valuePath:c,readOnly:u}=e,f=e.min!==void 0&&e.min>0,h=e.elementDefinitionType.code,m=y.useContext(cn),g=y.useMemo(()=>{if(!ab(h)||!Rn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)OE(S,m.elements);else{const w=Ps(m.path,e.path);if(w===void 0)return e.defaultValue;OE(S,m.elements,w)}return Tn(S)?S:e.defaultValue},[h,m.path,m.elements,e.path,e.defaultValue]);if(!h)return s.jsx("div",{children:"Property type not specified "});function v(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:o,valuePath:c,disabled:u}}function b(){const S=Ot(e.outcome,c??o);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:u}}switch(h){case ae.SystemString:case ae.canonical:case ae.string:case ae.time:case ae.uri:case ae.url:return e.path==="Project.secret.value[x]"?s.jsx(jG,{...b(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):s.jsx($e,{...b(),onChange:S=>{n&&n(S.currentTarget.value)}});case ae.date:return s.jsx($e,{...b(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case ae.dateTime:case ae.instant:return s.jsx(oa,{...b(),onChange:n,outcome:r});case ae.decimal:case ae.integer:case ae.positiveInt:case ae.unsignedInt:return s.jsx($e,{...b(),type:"number",step:h===ae.decimal?"any":"1",onChange:S=>{if(n){const w=S.currentTarget.valueAsNumber;n(Number.isNaN(w)?void 0:w)}}});case ae.code:return s.jsx(CA,{...b(),error:void 0,onChange:n,binding:i==null?void 0:i.valueSet,creatable:!0,maxValues:1});case ae.boolean:return s.jsx(zn,{...b(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case ae.base64Binary:case ae.markdown:return s.jsx(el,{...b(),spellCheck:h!==ae.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case ae.Address:return s.jsx(vF,{...v()});case ae.Annotation:return s.jsx(yF,{...v()});case ae.Attachment:return s.jsx(EA,{...v()});case ae.CodeableConcept:return s.jsx(Gq,{binding:i==null?void 0:i.valueSet,...v()});case ae.Coding:return s.jsx(Yq,{binding:i==null?void 0:i.valueSet,...v()});case ae.ContactDetail:return s.jsx(Zq,{...v()});case ae.ContactPoint:return s.jsx(VA,{...v()});case ae.Extension:return s.jsx(tG,{...v(),propertyType:e.elementDefinitionType});case ae.HumanName:return s.jsx(nG,{...v()});case ae.Identifier:return s.jsx(rG,{...v()});case ae.Money:return s.jsx(aG,{...v()});case ae.Period:return s.jsx(oG,{...v()});case ae.Duration:case ae.Quantity:return s.jsx(Gs,{...v()});case ae.Range:return s.jsx(Mb,{...v()});case ae.Ratio:return s.jsx(lG,{...v()});case ae.Reference:return s.jsx(Od,{...v(),targetTypes:DG(e.elementDefinitionType)});case ae.Timing:return s.jsx(EG,{...v()});case ae.Dosage:case ae.UsageContext:default:return s.jsx($b,{...v(),typeName:h})}}const _G=[`${Ui}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function DG(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=_G.find(i=>n.startsWith(i));return r?n.slice(r.length):n})}function AG(e){const[t,n]=y.useState(e.defaultValue??{}),r=y.useContext(cn),i=y.useMemo(()=>gF(r.elements),[r.elements]);function o(u){n(u),e.onChange&&e.onChange(u)}const c={type:e.type,value:t};return s.jsx(qe,{style:{flexGrow:1},"data-testid":e.testId,children:i.map(([u,f])=>{const[h,m]=Oq(c,u,f),g=f.min!==void 0&&f.min>0,v=e.valuePath?e.valuePath+"."+u:void 0,b=s.jsx(Md,{property:f,name:u,path:e.path+"."+u,valuePath:v,defaultValue:h,defaultPropertyType:m,onChange:(S,w)=>{o(Hq({...t},u,w??u,f,S))},outcome:e.outcome},u);return e.type==="Extension"||wb.includes(u)?b:f.type.length===1&&f.type[0].code==="boolean"?s.jsx(BA,{title:Fs(u),description:f.description,htmlFor:u,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},u):s.jsx(It,{title:Fs(u),description:f.description,withAsterisk:g,htmlFor:u,outcome:e.outcome,fhirPath:f.path,errorExpression:v,readonly:f.readonly,children:b},u)})})}function $b(e){const[t]=y.useState(()=>e.defaultValue??{}),n=y.useContext(cn),r=e.profileUrl??(n==null?void 0:n.profileUrl),i=y.useMemo(()=>Xp(e.typeName,r),[e.typeName,r]),o=(i==null?void 0:i.type)??e.typeName,c=y.useMemo(()=>{if(i)return xc({parentContext:n,elements:i.elements,path:e.path,profileUrl:i.url,accessPolicyResource:e.accessPolicyResource})},[i,n,e.path,e.accessPolicyResource]);return i?cm(cn.Provider,c,s.jsx(AG,{path:e.path,valuePath:e.valuePath,type:o,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[o," not implemented"]})}const kG="_noteCite_10swh_5",PG="_noteRoot_10swh_10",ZE={noteCite:kG,noteRoot:PG};function qA({value:e}){return e?s.jsx(qe,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(p0,{classNames:{cite:ZE.noteCite,root:ZE.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function $c(e){const{value:t,link:n,...r}=e,[i,o]=y.useState(),c=Wt(t,o);let u;if(i&&!fD(i))u=`[${Ye(i)}]`;else if(c)u=Ha(c);else return null;return n?s.jsx(mt,{to:t,...r,children:u}):s.jsx(_e,{component:"span",...r,children:u})}function sc(e){return s.jsxs(je,{gap:"xs",children:[s.jsx(Zo,{size:24,radius:12,value:e.value,link:e.link}),s.jsx($c,{value:e.value,link:e.link})]})}const NG={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 um(e){const{status:t,...n}=e;return s.jsx(_p,{color:e.color||NG[t],...n,children:t.replace(/-/g," ")})}const OG="_table_pe9td_1",MG="_criticalRow_pe9td_12",GA={table:OG,criticalRow:MG};zb.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function zb(e){var c;const t=Ae(),n=Wt(e.value),[r,i]=y.useState();if(y.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(u=>t.readReference(u))).then(u=>u.filter(f=>f.status==="fulfilled").map(f=>f.value)).then(i).catch(console.error)},[t,n]),!n)return null;const o=(r==null?void 0:r.flatMap(u=>u.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const u=n.presentedForm[0];(c=u.contentType)!=null&&c.startsWith("text/plain")&&u.data&&o.push({text:window.atob(u.data)})}return s.jsxs(qe,{children:[s.jsx(Le,{children:"Diagnostic Report"}),s.jsx(IG,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&LG(r),n.result&&s.jsx($G,{hideObservationNotes:e.hideObservationNotes,value:n.result}),o.length>0&&s.jsx(qA,{value:o})]})}function IG({value:e,hideSubject:t=!1}){var n,r;return s.jsxs(je,{mt:"md",gap:30,children:[e.subject&&!t&&s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(sc,{value:e.subject,link:!0})]}),(n=e.resultsInterpreter)==null?void 0:n.map(i=>s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(sc,{value:i,link:!0})]},i.reference)),(r=e.performer)==null?void 0:r.map(i=>s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(sc,{value:i,link:!0})]},i.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(_e,{children:gr(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(_e,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(um,{status:e.status})]})]})}function LG(e){return s.jsxs(qe,{gap:"xs",children:[s.jsx(Le,{order:2,size:"h6",children:"Specimens"}),s.jsx(mr,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(mr.Item,{ml:"sm",children:s.jsxs(je,{gap:20,children:[s.jsxs(je,{gap:5,children:[s.jsx(_e,{fw:500,children:"Collected:"})," ",gr((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(je,{gap:5,children:[s.jsx(_e,{fw:500,children:"Received:"})," ",gr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function $G(e){return s.jsxs("table",{className:GA.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(WA,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function WA(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(zG,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Ko(n)?n.reference:n.id}`))})}function zG(e){var i,o;const t=Wt(e.value);if(!t||(i=e.ancestorIds)!=null&&i.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=VG(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:Ut({[GA.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(mt,{to:t,children:s.jsx(aa,{value:t.code})})}),s.jsx("td",{children:s.jsx(UG,{value:t})}),s.jsx("td",{children:s.jsx(BG,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(aa,{value:t.interpretation[0]})}),s.jsx("td",{children:t.category&&t.category.length>0&&s.jsx(s.Fragment,{children:t.category.map(c=>s.jsx("div",{children:s.jsx(aa,{value:c})},`category-${Ho(c)}`))})}),s.jsx("td",{children:(o=t.performer)==null?void 0:o.map(c=>s.jsx(Yy,{value:c},c.reference))}),s.jsx("td",{children:t.status&&s.jsx(um,{status:t.status})})]}),t.hasMember&&s.jsx(WA,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(qA,{value:t.note})})})]})}function UG(e){const t=e.value;return s.jsx(s.Fragment,{children:MD(t)})}function BG(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(Nb,{value:t}):null}function VG(e){var n,r,i,o;const t=(o=(i=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:o.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var ey={},Ma={},JE;function QA(){if(JE)return Ma;JE=1,Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.Pointer=Ma.escapeToken=Ma.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}Ma.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}Ma.escapeToken=t;var n=function(){function r(i){i===void 0&&(i=[""]),this.tokens=i}return r.fromJSON=function(i){var o=i.split("/").map(e);if(o[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(i));return new r(o)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(i){for(var o=null,c="",u=i,f=1,h=this.tokens.length;f<h;f++)o=u,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(u=(o||{})[c]);return{parent:o,key:c,value:u}},r.prototype.get=function(i){return this.evaluate(i).value},r.prototype.set=function(i,o){var c=this.evaluate(i);c.parent&&(c.parent[c.key]=o)},r.prototype.push=function(i){this.tokens.push(i)},r.prototype.add=function(i){var o=this.tokens.concat(String(i));return new r(o)},r}();return Ma.Pointer=n,Ma}var gn={},ty={},eT;function YA(){return eT||(eT=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(i){return i===void 0?"undefined":i===null?"null":Array.isArray(i)?"array":typeof i}e.objectType=t;function n(i){return i!=null&&typeof i=="object"}function r(i){if(!n(i))return i;if(i.constructor==Array){for(var o=i.length,c=new Array(o),u=0;u<o;u++)c[u]=r(i[u]);return c}if(i.constructor==Date){var f=new Date(+i);return f}var h={};for(var m in i)e.hasOwnProperty.call(i,m)&&(h[m]=r(i[m]));return h}e.clone=r}(ty)),ty}var hr={},tT;function XA(){if(tT)return hr;tT=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.diffAny=hr.diffObjects=hr.diffArrays=hr.intersection=hr.subtract=hr.isDestructive=void 0;var e=YA();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}hr.isDestructive=t;function n(m,g){var v={};for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&(v[b]=1);for(var S in g)e.hasOwnProperty.call(g,S)&&g[S]!==void 0&&delete v[S];return Object.keys(v)}hr.subtract=n;function r(m){for(var g=m.length,v={},b=0;b<g;b++){var S=m[b];for(var w in S)e.hasOwnProperty.call(S,w)&&S[w]!==void 0&&(v[w]=(v[w]||0)+1)}for(var w in v)v[w]<g&&delete v[w];return Object.keys(v)}hr.intersection=r;function i(m){return m.op==="add"}function o(m){return m.op==="remove"}function c(m,g){return{operations:m.operations.concat(g),cost:m.cost+1}}function u(m,g,v,b){b===void 0&&(b=h);var S={"0,0":{operations:[],cost:0}};function w(R,D){var k="".concat(R,",").concat(D),M=S[k];if(M===void 0){if(R>0&&D>0&&!b(m[R-1],g[D-1],v.add(String(R-1))).length)M=w(R-1,D-1);else{var I=[];if(R>0){var z=w(R-1,D),V={op:"remove",index:R-1};I.push(c(z,V))}if(D>0){var Y=w(R,D-1),W={op:"add",index:R-1,value:g[D-1]};I.push(c(Y,W))}if(R>0&&D>0){var J=w(R-1,D-1),G={op:"replace",index:R-1,original:m[R-1],value:g[D-1]};I.push(c(J,G))}var X=I.sort(function(P,L){return P.cost-L.cost})[0];M=X}S[k]=M}return M}var C=isNaN(m.length)||m.length<=0?0:m.length,E=isNaN(g.length)||g.length<=0?0:g.length,_=w(C,E).operations,T=_.reduce(function(R,D){var k=R[0],M=R[1];if(i(D)){var I=D.index+1+M,z=I<C+M?String(I):"-",V={op:D.op,path:v.add(z).toString(),value:D.value};return[k.concat(V),M+1]}else if(o(D)){var V={op:D.op,path:v.add(String(D.index+M)).toString()};return[k.concat(V),M-1]}else{var Y=v.add(String(D.index+M)),W=b(D.original,D.value,Y);return[k.concat.apply(k,W),M]}},[[],0])[0];return T}hr.diffArrays=u;function f(m,g,v,b){b===void 0&&(b=h);var S=[];return n(m,g).forEach(function(w){S.push({op:"remove",path:v.add(w).toString()})}),n(g,m).forEach(function(w){S.push({op:"add",path:v.add(w).toString(),value:g[w]})}),r([m,g]).forEach(function(w){S.push.apply(S,b(m[w],g[w],v.add(w)))}),S}hr.diffObjects=f;function h(m,g,v,b){if(b===void 0&&(b=h),m===g)return[];var S=(0,e.objectType)(m),w=(0,e.objectType)(g);return S=="array"&&w=="array"?u(m,g,v,b):S=="object"&&w=="object"?f(m,g,v,b):[{op:"replace",path:v.toString(),value:g}]}return hr.diffAny=h,hr}var nT;function FG(){if(nT)return gn;nT=1;var e=gn&&gn.__extends||function(){var C=function(E,_){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,R){T.__proto__=R}||function(T,R){for(var D in R)Object.prototype.hasOwnProperty.call(R,D)&&(T[D]=R[D])},C(E,_)};return function(E,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");C(E,_);function T(){this.constructor=E}E.prototype=_===null?Object.create(_):(T.prototype=_.prototype,new T)}}();Object.defineProperty(gn,"__esModule",{value:!0}),gn.apply=gn.InvalidOperationError=gn.test=gn.copy=gn.move=gn.replace=gn.remove=gn.add=gn.TestError=gn.MissingError=void 0;var t=QA(),n=YA(),r=XA(),i=function(C){e(E,C);function E(_){var T=C.call(this,"Value required at path: ".concat(_))||this;return T.path=_,T.name="MissingError",T}return E}(Error);gn.MissingError=i;var o=function(C){e(E,C);function E(_,T){var R=C.call(this,"Test failed: ".concat(_," != ").concat(T))||this;return R.actual=_,R.expected=T,R.name="TestError",R}return E}(Error);gn.TestError=o;function c(C,E,_){if(Array.isArray(C))if(E=="-")C.push(_);else{var T=parseInt(E,10);C.splice(T,0,_)}else C[E]=_}function u(C,E){if(Array.isArray(C)){var _=parseInt(E,10);C.splice(_,1)}else delete C[E]}function f(C,E){var _=t.Pointer.fromJSON(E.path).evaluate(C);return _.parent===void 0?new i(E.path):(c(_.parent,_.key,(0,n.clone)(E.value)),null)}gn.add=f;function h(C,E){var _=t.Pointer.fromJSON(E.path).evaluate(C);return _.value===void 0?new i(E.path):(u(_.parent,_.key),null)}gn.remove=h;function m(C,E){var _=t.Pointer.fromJSON(E.path).evaluate(C);if(_.parent===null)return new i(E.path);if(Array.isArray(_.parent)){if(parseInt(_.key,10)>=_.parent.length)return new i(E.path)}else if(_.value===void 0)return new i(E.path);return _.parent[_.key]=(0,n.clone)(E.value),null}gn.replace=m;function g(C,E){var _=t.Pointer.fromJSON(E.from).evaluate(C);if(_.value===void 0)return new i(E.from);var T=t.Pointer.fromJSON(E.path).evaluate(C);return T.parent===void 0?new i(E.path):(u(_.parent,_.key),c(T.parent,T.key,_.value),null)}gn.move=g;function v(C,E){var _=t.Pointer.fromJSON(E.from).evaluate(C);if(_.value===void 0)return new i(E.from);var T=t.Pointer.fromJSON(E.path).evaluate(C);return T.parent===void 0?new i(E.path):(c(T.parent,T.key,(0,n.clone)(_.value)),null)}gn.copy=v;function b(C,E){var _=t.Pointer.fromJSON(E.path).evaluate(C);return(0,r.diffAny)(_.value,E.value,new t.Pointer).length?new o(_.value,E.value):null}gn.test=b;var S=function(C){e(E,C);function E(_){var T=C.call(this,"Invalid operation: ".concat(_.op))||this;return T.operation=_,T.name="InvalidOperationError",T}return E}(Error);gn.InvalidOperationError=S;function w(C,E){switch(E.op){case"add":return f(C,E);case"remove":return h(C,E);case"replace":return m(C,E);case"move":return g(C,E);case"copy":return v(C,E);case"test":return b(C,E)}return new S(E)}return gn.apply=w,gn}var rT;function HG(){return rT||(rT=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=QA();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=FG(),r=XA();function i(h,m){return m.map(function(g){return(0,n.apply)(h,g)})}e.applyPatch=i;function o(h){function m(g,v,b){var S=h(g,v,b);return Array.isArray(S)?S:(0,r.diffAny)(g,v,b,m)}return m}function c(h,m,g){var v=new t.Pointer;return(g?o(g):r.diffAny)(h,m,v)}e.createPatch=c;function u(h,m){var g=t.Pointer.fromJSON(m).evaluate(h);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(h,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(v){var b=u(h,v.path);if(b&&g.push(b),"from"in v){var S=u(h,v.from);S&&g.push(S)}}),g}e.createTests=f}(ey)),ey}var KA=HG();const qG="_removed_el5zk_1",GG="_added_el5zk_6",iT={removed:qG,added:GG};function WG(e){var m;const{name:t,path:n,property:r,originalValue:i,revisedValue:o}=e,c=!!((m=r==null?void 0:r.type)!=null&&m.find(g=>g.code==="Attachment")),[u,f]=y.useState(c),h=()=>f(g=>!g);return s.jsx(s.Fragment,{children:c&&!u||!c?s.jsx(s.Fragment,{children:s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:t}),s.jsx(ye.Td,{className:iT.removed,children:i&&s.jsx(Li,{path:n,property:r,propertyType:i.type,value:i.value,ignoreMissingValues:!0})}),s.jsx(ye.Td,{className:iT.added,children:o&&s.jsx(Li,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})})]})}):s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:t}),s.jsx(ye.Td,{colSpan:2,style:{textAlign:"right"},children:s.jsx(Pe,{onClick:h,variant:"light",children:"Expand"})})]})})}const QG="_root_15xvr_1",YG={root:QG};function XG(e){const t=Ae(),{original:n,revised:r}=e,[i,o]=y.useState(!1);y.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[t,e.original.resourceType]);const c=y.useMemo(()=>{if(!i)return null;const u=[mi(n)],f=[mi(r)],h=[],m=KG(KA.createPatch(n,r));for(const g of m){const v=g.path,b=ZG(v),S=JG(n.resourceType,b),w=g.op==="add"?void 0:Hs(b,u),C=g.op==="remove"?void 0:Hs(b,f);h.push({key:`op-${g.op}-${g.path}`,name:`${In(g.op)} ${b}`,path:(S==null?void 0:S.path)??n.resourceType+"."+b,property:S,originalValue:aT(S,w),revisedValue:aT(S,C)})}return h},[i,n,r]);return c?s.jsxs(ye,{className:YG.root,children:[s.jsx(ye.Thead,{children:s.jsxs(ye.Tr,{children:[s.jsx(ye.Th,{}),s.jsx(ye.Th,{children:"Before"}),s.jsx(ye.Th,{children:"After"})]})}),s.jsx(ye.Tbody,{children:c.map(u=>{const{key:f,...h}=u;return s.jsx(WG,{...h},f)})})]}):null}function KG(e){const t=[];for(const n of e){const{op:r,path:i}=n;if(i.startsWith("/meta/author")||i.startsWith("/meta/compartment")||i.startsWith("/meta/lastUpdated")||i.startsWith("/meta/versionId"))continue;const o=e.filter(u=>u.op===r&&u.path===i).length,c={op:r,path:i};o>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(i)&&(c.op="replace",c.path=i.replace(/\/[^/]+$/,"")),t.some(u=>u.op===c.op&&u.path===c.path)||t.push(c)}return t}function ZG(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const i=t[r];i==="-"?n+=".last()":/^\d+$/.test(i)?n+=`[${i}]`:(r>0&&(n+="."),n+=i)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function JG(e,t){var r;const n=Ic(e,{code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function aT(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:eW(t,!!(e!=null&&e.isArray))}}function eW(e,t){const n=fU(e).flatMap(r=>r.value);return t?n:n[0]}function Ub(e){const{profileUrl:t}=e,n=Ae(),r=n.getAccessPolicy(),i=Wt(e.value),[o,c]=y.useState(!1);y.useEffect(()=>{if(i)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Nc(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=i.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,i]);const u=y.useMemo(()=>i&&FD(i,Os.READ,r),[r,i]);return!o||!i?null:s.jsx(Wh,{path:i.resourceType,value:{type:i.resourceType,value:e.forceUseInput?e.value:i},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const tW="_item_5q6yx_1",nW="_itemPadding_5q6yx_5",oT={item:tW,itemPadding:nW};function rW(e){return s.jsx(Lc,{children:e.children})}function Ws(e){var f,h;const{resource:t,profile:n,padding:r,popupMenuItems:i,...o}=e,c=n??((f=t.meta)==null?void 0:f.author),u=e.dateTime??((h=t.meta)==null?void 0:h.lastUpdated);return s.jsxs(sm,{"data-testid":"timeline-item",fill:!0,...o,children:[s.jsxs(je,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Zo,{value:c,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(_e,{size:"sm",children:s.jsx($c,{c:"dark",fw:500,value:c,link:!0})}),s.jsxs(_e,{size:"xs",children:[s.jsx(mt,{c:"dimmed",to:e.resource,children:gr(u)}),s.jsx(_e,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(mt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),i&&s.jsxs(Ce,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(Ce.Target,{children:s.jsx(An,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${zt(e.resource)}`,children:s.jsx(IF,{})})}),i]})]}),s.jsx(xA,{children:s.jsx("div",{className:Ut(oT.item,{[oT.itemPadding]:r}),children:e.children})})]})}function ZA(e,t){e.sort((n,r)=>{const i=sT(n,t),o=sT(r,t);return i>o?1:i<o?-1:lT(n,t)-lT(r,t)})}function sT(e,t){if(!JA(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function lT(e,t){var r;if(!JA(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const n=(r=e.meta)==null?void 0:r.lastUpdated;return n?new Date(n).getTime():0}function JA(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const iW="_pinnedComment_u08s5_1",aW={pinnedComment:iW};function dm(e){const t=Ae(),n=t.getProfile(),r=y.useRef(null),i=Wt(e.value),[o,c]=y.useState(),[u,f]=y.useState([]),h=e.loadTimelineResources,m=y.useRef(u);m.current=u;const g=y.useCallback(R=>{ZA(R,i),R.reverse(),f(R)},[i]),v=y.useCallback(R=>{const D=[];for(const k of R){if(k.status!=="fulfilled")continue;const M=k.value;if(M.type==="history"&&c(M),M.entry)for(const I of M.entry)D.push(I.resource)}g(D)},[g]),b=y.useCallback(R=>g([...m.current,R]),[g]),S=y.useCallback(()=>{var k;let R,D;"resourceType"in e.value?(R=e.value.resourceType,D=e.value.id):[R,D]=(k=e.value.reference)==null?void 0:k.split("/"),h(t,R,D).then(v).catch(console.error)},[t,e.value,h,v]);y.useEffect(()=>S(),[S]);function w(R){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,R)).then(D=>b(D)).catch(console.error)}function C(R){!i||!e.createMedia||t.createResource(e.createMedia(i,n,R)).then(D=>b(D)).then(()=>As({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(to,{size:16}),autoClose:2e3})).catch(D=>As({id:"upload-notification",color:"red",title:"Upload error",message:Ye(D),icon:s.jsx(BE,{size:16}),autoClose:2e3}))}function E(){Oe({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(R){As({id:"upload-notification",loading:!0,title:"Uploading...",message:fW(R),autoClose:!1,withCloseButton:!1})}function T(R){As({id:"upload-notification",color:"red",title:"Upload error",message:Ye(R),icon:s.jsx(BE,{size:16}),autoClose:2e3})}return i?s.jsxs(rW,{children:[e.createCommunication&&s.jsx(sm,{children:s.jsx(pt,{testid:"timeline-form",onSubmit:R=>{w(R.text);const D=r.current;D&&(D.value="",D.focus())},children:s.jsxs(je,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Zo,{value:n}),s.jsx($e,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(An,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(HF,{size:16})}),s.jsx(Pb,{securityContext:nn(i),onUpload:C,onUploadStart:E,onUploadProgress:_,onUploadError:T,children:R=>s.jsx(An,{...R,radius:"xl",color:"blue",variant:"filled",children:s.jsx(Cb,{size:16})})})]})})}),u.map(R=>{var M;if(!R)return null;const D=`${R.resourceType}/${R.id}/${(M=R.meta)==null?void 0:M.versionId}`,k=e.getMenu?e.getMenu({primaryResource:i,currentResource:R,reloadTimeline:S}):void 0;if(R.resourceType===i.resourceType&&R.id===i.id)return s.jsx(oW,{history:o,resource:R,popupMenuItems:k},D);switch(R.resourceType){case"AuditEvent":return s.jsx(uW,{resource:R,popupMenuItems:k},D);case"Communication":return s.jsx(lW,{resource:R,popupMenuItems:k},D);case"DiagnosticReport":return s.jsx(dW,{resource:R,popupMenuItems:k},D);case"Media":return s.jsx(cW,{resource:R,popupMenuItems:k},D);default:return s.jsx(Ws,{resource:R,padding:!0,children:s.jsx(Ub,{value:R,ignoreMissingValues:!0})},D)}})]}):s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(kr,{})})}function oW(e){const{history:t,resource:n,...r}=e,i=sW(t,n);return i?s.jsx(Ws,{resource:n,padding:!0,...r,children:s.jsx(XG,{original:i,revised:e.resource})}):s.jsxs(Ws,{resource:n,padding:!0,...r,children:[s.jsx("h3",{children:"Created"}),s.jsx(Ub,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function sW(e,t){const n=e.entry??[],r=n.findIndex(i=>{var o,c,u;return((c=(o=i.resource)==null?void 0:o.meta)==null?void 0:c.versionId)===((u=t.meta)==null?void 0:u.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function lW(e){var r,i;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:aW.pinnedComment;return s.jsx(Ws,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:s.jsx("p",{children:(i=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:i.contentString})})}function cW(e){var r;const t=(r=e.resource.content)==null?void 0:r.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(Ws,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:s.jsx(Pd,{value:e.resource.content})})}function uW(e){return s.jsx(Ws,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Yr,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function dW(e){return s.jsx(Ws,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(zb,{value:e.resource})})}function fW(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${ny(e.loaded)} / ${ny(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${ny(e.loaded)}`}function ny(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 hW(e){const{resource:t,...n}=e;return s.jsx(dm,{value:t,loadTimelineResources:async(r,i,o)=>{const c=`${i}/${o}`;return Promise.allSettled([r.readHistory(i,o),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function pW(e){const{encounter:t,...n}=e;return s.jsx(dm,{value:t,loadTimelineResources:async(r,i,o)=>Promise.allSettled([r.readHistory("Encounter",o),r.search("Communication","encounter=Encounter/"+o),r.search("Media","encounter=Encounter/"+o)]),createCommunication:(r,i,o)=>({resourceType:"Communication",status:"completed",encounter:nn(r),subject:r.subject,sender:nn(i),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,i,o)=>({resourceType:"Media",status:"completed",encounter:nn(r),subject:r.subject,operator:nn(i),issued:new Date().toISOString(),content:o}),...n})}function mW(e){let t;try{t=Mc(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return s.jsx(Li,{value:t[0]||"",propertyType:e.propertyType})}function gW(e){return s.jsxs(Bn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(cT,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(cT,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(_e,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function cT(e){return s.jsx(Pe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const vW={string:[ue.EQUALS,ue.NOT,ue.CONTAINS,ue.EXACT],fulltext:[ue.EQUALS,ue.NOT,ue.CONTAINS,ue.EXACT],token:[ue.EQUALS,ue.NOT],reference:[ue.EQUALS,ue.NOT],numeric:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS],quantity:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS],date:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS,ue.STARTS_AFTER,ue.ENDS_BEFORE,ue.APPROXIMATELY],datetime:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS,ue.STARTS_AFTER,ue.ENDS_BEFORE,ue.APPROXIMATELY],uri:[ue.EQUALS,ue.NOT,ue.ABOVE,ue.BELOW]},yW={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 Bb(e,t){return{...e,filters:t,offset:0,name:void 0}}function ek(e,t){return Bb(e,(e.filters??[]).filter(n=>n.code!==t))}function fm(e,t,n,r,i){const o=[];return e.filters&&o.push(...e.filters),o.push({code:t,operator:n,value:r??""}),Bb(e,o)}function xW(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function bW(e,t){return Vb(e,t,-1)}function SW(e,t){return Vb(e,t,0)}function wW(e,t){return Vb(e,t,1)}function Vb(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setDate(i.getDate()+1),i.setTime(i.getTime()-1),hm(e,t,r,i)}function jW(e,t){const n=new Date,r=new Date(n.getTime()+24*60*60*1e3);return hm(e,t,n,r)}function CW(e,t){return Fb(e,t,-1)}function EW(e,t){return Fb(e,t,0)}function TW(e,t){return Fb(e,t,1)}function Fb(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setMonth(i.getMonth()+1),i.setDate(1),i.setHours(0,0,0,0),i.setTime(i.getTime()-1),hm(e,t,r,i)}function RW(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),hm(e,t,n,new Date)}function hm(e,t,n,r){return e=ek(e,t),e=uT(e,t,ue.GREATER_THAN_OR_EQUALS,n),e=uT(e,t,ue.LESS_THAN_OR_EQUALS,r),e}function uT(e,t,n,r){return fm(e,t,n,r.toISOString())}function dT(e,t,n=!0){return fm(e,t,ue.MISSING,n.toString())}function _W(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function DW(e,t){const n=e.count??Jp,r=(t-1)*n;return _W(e,r)}function AW(e,t,n){return t===kW(e)&&n!==void 0&&n===PW(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function kW(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function PW(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function NW(e){return vW[e.type]}function tk(e){return yW[e]??""}function Qs(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replace(/([A-Z])/g," $1"),t=t.replace(/[-_]/g," "),t=t.replace(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map(In).join(" "))}function OW(e,t){var r,i;const n=t.name;return n==="id"?s.jsx(mt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?gr((i=e.meta)==null?void 0:i.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?MW(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?IW(e,t.searchParams[0]):null}function MW(e,t){var o,c,u;const n=((u=(c=(o=t.path)==null?void 0:o.split("."))==null?void 0:c.pop())==null?void 0:u.replaceAll("[x]",""))??"",[r,i]=lm({type:e.resourceType,value:e},n);return r?s.jsx(Li,{path:t.path,property:t,propertyType:i,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function IW(e,t){const n=Hs(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,i)=>s.jsx(Li,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${i}-${n.length}`))})}function LW(e){const t=y.useRef(!1),[n,r]=y.useState({search:JSON.parse(Ii(e.search))}),[i,o]=y.useState(!1);y.useEffect(()=>{r({search:e.search})},[e.search]);const c=y.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,h=yD(f),m=sb(f);return od($W(h,m)).map(g=>({value:g,label:Qs(g)}))},[e.visible,e.search.resourceType]);function u(f){r({search:{...n.search,fields:f}})}return s.jsx(Bn,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=i},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(qe,{children:[s.jsx($p,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>o(!0),onDropdownClose:()=>o(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function $W(e,t){const n=[],r=new Set,i=new Set;for(const o of Object.keys(e.elements))n.push(o),r.add(o.toLowerCase()),i.add(Qs(o));if(t)for(const o of Object.keys(t)){const c=Qs(o);!r.has(o)&&!i.has(c)&&(n.push(o),r.add(o),i.add(c))}return n}function nk(e){const t=Ic(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case Jn.REFERENCE:return s.jsx(Od,{name:n,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(r.reference):e.onChange("")}});case Jn.BOOLEAN:return s.jsx(zn,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.checked.toString())});case Jn.DATE:return s.jsx($e,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case Jn.DATETIME:return s.jsx(oa,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Jn.NUMBER:return s.jsx($e,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case Jn.QUANTITY:return s.jsx(Gs,{name:n,path:"",defaultValue:zW(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx($e,{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 zW(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function UW(e){const[t,n]=y.useState(Wr(e.search)),r=y.useRef(t);r.current=t,y.useEffect(()=>{n(Wr(e.search))},[e.search]);function i(f){n(fm(r.current,f.code,f.operator,f.value))}const o=e.search.resourceType,c=sb(o)??{},u=t.filters||[];return s.jsx(Bn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:s.jsxs(pt,{onSubmit:()=>e.onOk(r.current),children:[s.jsxs("div",{children:[s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:40}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:u.map((f,h)=>s.jsx(BW,{id:`filter-${h}-row`,resourceType:o,searchParams:c,value:f,onChange:m=>{const g=[...u];g[h]=m,n(Bb(r.current,g))},onDelete:()=>n(xW(r.current,h))},`filter-${h}-row`))})]}),s.jsx(Ib,{propertyDisplayName:"Filter",onClick:()=>i({})})]}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(xr,{children:"OK"})})]})})}function BW(e){const t=e.value,n=y.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=ue.EQUALS,n.current.value="",e.onChange(n.current)}function i(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function o(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],u=c&&NW(c);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ln,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:f=>r(f.currentTarget.value),data:["",...Object.keys(e.searchParams).map(f=>({value:f,label:Qs(f)}))]})}),s.jsx("td",{children:u&&s.jsx(ln,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>i(f.currentTarget.value),data:["",...u.map(f=>({value:f,label:tk(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),s.jsx("td",{children:c&&t.operator&&s.jsx(nk,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:o},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),s.jsx("td",{children:e.onDelete&&s.jsx(An,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:s.jsx(qs,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function VW(e){const[t,n]=y.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return s.jsx(Bn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(pt,{onSubmit:r,children:s.jsxs(or,{children:[s.jsx(or.Col,{span:10,children:s.jsx(nk,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(or.Col,{span:2,children:s.jsx(Pe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function FW(e){var i;const{resourceType:t,filter:n}=e,r=(i=ca.types[t].searchParams)==null?void 0:i[n.code];if(r){if(r.type==="reference"&&(n.operator===ue.EQUALS||n.operator===ue.NOT_EQUALS))return s.jsx($c,{value:{reference:n.value}});const o=Ic(t,r);if(n.code==="_lastUpdated"||o.type===Jn.DATETIME)return s.jsx(s.Fragment,{children:gr(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function HW(e){if(!e.searchParams)return null;function t(o,c){i(AW(e.search,o.code,c))}function n(o){i(ek(e.search,o.code))}function r(o,c){e.onPrompt(o,{code:o.code,operator:c,value:""})}function i(o){e.onChange(o)}return e.searchParams.length===1?s.jsx(qW,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:i,onClear:n}):s.jsx(Ce.Dropdown,{children:e.searchParams.map(o=>s.jsx(Ce.Item,{children:Qs(o.code)},o.code))})}function qW(e){switch(e.searchParam.type){case"date":return s.jsx(GW,{...e});case"number":case"quantity":return s.jsx(WW,{...e});case"reference":return s.jsx(QW,{...e});case"string":return s.jsx(YW,{...e});case"token":case"uri":return s.jsx(XW,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function GW(e){const{searchParam:t}=e,n=t.code;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(Eb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(Ce.Item,{leftSection:s.jsx(Tb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(gA,{size:14}),onClick:()=>e.onPrompt(t,ue.ENDS_BEFORE),children:"Before..."}),s.jsx(Ce.Item,{leftSection:s.jsx(mA,{size:14}),onClick:()=>e.onPrompt(t,ue.STARTS_AFTER),children:"After..."}),s.jsx(Ce.Item,{leftSection:s.jsx(TF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Between..."}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(wW(e.search,n)),children:"Tomorrow"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(SW(e.search,n)),children:"Today"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(bW(e.search,n)),children:"Yesterday"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(jW(e.search,n)),children:"Next 24 Hours"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(TW(e.search,n)),children:"Next Month"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(EW(e.search,n)),children:"This Month"}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(CW(e.search,n)),children:"Last Month"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(No,{size:14}),onClick:()=>e.onChange(RW(e.search,n)),children:"Year to date"}),s.jsx(Id,{...e})]})}function WW(e){const{searchParam:t}=e;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(Eb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(Ce.Item,{leftSection:s.jsx(Tb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(mA,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN),children:"Greater than..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Wy,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(Ce.Item,{leftSection:s.jsx(gA,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN),children:"Less than..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Wy,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Id,{...e})]})}function QW(e){const{searchParam:t}=e;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),s.jsx(Id,{...e})]})}function YW(e){const{searchParam:t}=e;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(Eb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(Ce.Item,{leftSection:s.jsx(Tb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(DF,{size:14}),onClick:()=>e.onPrompt(t,ue.CONTAINS),children:"Contains..."}),s.jsx(Ce.Item,{leftSection:s.jsx(_F,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Does not contain..."}),s.jsx(Id,{...e})]})}function XW(e){const{searchParam:t}=e;return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Item,{leftSection:s.jsx(kd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),s.jsx(Ce.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),s.jsx(Id,{...e})]})}function Id(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(CF,{size:14}),onClick:()=>e.onChange(dT(e.search,n)),children:"Missing"}),s.jsx(Ce.Item,{leftSection:s.jsx(jF,{size:14}),onClick:()=>e.onChange(dT(e.search,n,!1)),children:"Not missing"}),s.jsx(Ce.Divider,{}),s.jsx(Ce.Item,{leftSection:s.jsx(qs,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const KW="_root_vlout_1",ZW="_table_vlout_8",JW="_tr_vlout_12",eQ="_control_vlout_22",tQ="_icon_vlout_31",zu={root:KW,table:ZW,tr:JW,control:eQ,icon:tQ};function nQ(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(rQ(t,r));return n}function rQ(e,t){var i;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=Xo(e,t),r=DU(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=sb(e);let c;if(o){const u=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);c=Object.values(o).filter(f=>!!f.expression&&u.test(f==null?void 0:f.expression)),c.length===0&&(c=void 0)}return{name:t,elementDefinition:n,searchParams:c}}if(r){const o=Ic(e,r);return{name:t,elementDefinition:(i=o.elementDefinitions)==null?void 0:i[0],searchParams:[r]}}return{name:t}}class iQ extends Event{constructor(t){super("change"),this.definition=t}}class aQ extends Event{constructor(t){super("load"),this.response=t}}class Qh extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function zc(e){var G,X;const t=Ae(),[n,r]=y.useState(),{search:i,onLoad:o}=e,[c,u]=y.useState(i);la(i,c)||u(i);const[f,h]=y.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=y.useRef(f);m.current=f;const g=c.total??"accurate",v=y.useCallback(P=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,Bo({...c,total:g,fields:void 0}),P)).then(L=>{h({...m.current,searchResponse:L}),o&&o(new aQ(L))}).catch(L=>{h({...m.current,searchResponse:void 0}),r(Zt(L))})},[t,c,g,o]),b=y.useCallback(()=>{h({...m.current,searchResponse:void 0}),v({cache:"reload"})},[v]);y.useEffect(()=>{v()},[v]);function S(P,L){P.stopPropagation();const H=P.target.checked,O={...m.current.selected};H?O[L]=!0:delete O[L],h({...m.current,selected:O})}function w(P){P.stopPropagation();const $=P.target.checked,H={},O=m.current.searchResponse;$&&(O!=null&&O.entry)&&O.entry.forEach(U=>{var K;(K=U.resource)!=null&&K.id&&(H[U.resource.id]=!0)}),h({...m.current,selected:H})}function C(){var L,$;const P=m.current;if(!((L=P.searchResponse)!=null&&L.entry)||P.searchResponse.entry.length===0)return!1;for(const H of P.searchResponse.entry)if(($=H.resource)!=null&&$.id&&!P.selected[H.resource.id])return!1;return!0}function E(P){e.onChange&&e.onChange(new iQ(P))}function _(P,L){if(SA(P.target)||P.button===2)return;pn(P);const $=bA(P);!$&&e.onClick&&e.onClick(new Qh(L,P)),$&&e.onAuxClick&&e.onAuxClick(new Qh(L,P))}function T(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return s.jsx(Xr,{outcome:n});if(!vD(c.resourceType))return s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(kr,{})});const R=e.checkboxesEnabled,D=nQ(c),k=c.resourceType,M=f.searchResponse,I=M==null?void 0:M.entry,z=I==null?void 0:I.map(P=>P.resource),V="subtle",Y="gray",W=16,J=window.innerWidth<768;return s.jsxs("div",{className:zu.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(je,{justify:"space-between",mb:"xl",children:[s.jsxs(je,{gap:2,children:[s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(NF,{size:W}),onClick:()=>h({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx($F,{size:W}),onClick:()=>h({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(LF,{size:W}),onClick:e.onNew,children:"New..."}),!J&&T()&&s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(aH,{size:W}),onClick:e.onExport?e.onExport:()=>h({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!J&&e.onDelete&&s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(am,{size:W}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!J&&e.onBulk&&s.jsx(Pe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(EF,{size:W}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),s.jsxs(je,{gap:2,children:[M&&s.jsxs(_e,{size:"xs",c:"dimmed","data-testid":"count-display",children:[rk(c,M).toLocaleString(),"-",uQ(c,M).toLocaleString(),M.total!==void 0&&` of ${c.total==="estimate"?"~":""}${(G=M.total)==null?void 0:G.toLocaleString()}`]}),s.jsx(An,{variant:V,color:Y,title:"Refresh",onClick:b,children:s.jsx(yA,{size:W})})]})]}),s.jsxs(ye,{className:zu.table,children:[s.jsxs(ye.Thead,{children:[s.jsxs(ye.Tr,{children:[R&&s.jsx(ye.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:P=>w(P)})}),D.map(P=>s.jsx(ye.Th,{children:s.jsxs(Ce,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(Ce.Target,{children:s.jsx(tr,{className:zu.control,p:2,children:s.jsxs(je,{justify:"space-between",wrap:"nowrap",children:[s.jsx(_e,{fw:500,children:Qs(P.name)}),s.jsx(er,{className:zu.icon,children:s.jsx(bF,{size:14,stroke:1.5})})]})})}),s.jsx(HW,{search:c,searchParams:P.searchParams,onPrompt:(L,$)=>{h({...m.current,filterDialogVisible:!0,filterDialogSearchParam:L,filterDialogFilter:$,dialogOpenTime:Date.now()})},onChange:L=>{E(L)}})]})},P.name))]}),!e.hideFilters&&s.jsxs(ye.Tr,{children:[R&&s.jsx(ye.Th,{}),D.map(P=>s.jsx(ye.Th,{children:P.searchParams&&s.jsx(sQ,{resourceType:k,searchParams:P.searchParams,filters:c.filters})},P.name))]})]}),s.jsx(ye.Tbody,{children:z==null?void 0:z.map(P=>P&&s.jsxs(ye.Tr,{className:zu.tr,"data-testid":"search-control-row",onClick:L=>_(L,P),onAuxClick:L=>_(L,P),children:[R&&s.jsx(ye.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${P.id}`,checked:!!f.selected[P.id],onChange:L=>S(L,P.id)})}),D.map(L=>s.jsx(ye.Td,{children:OW(P,L)},L.name))]},P.id))})]}),!(z!=null&&z.length)&&s.jsx(Lc,{children:s.jsx(er,{style:{height:150},children:s.jsx(_e,{size:"xl",c:"dimmed",children:"No results"})})}),M&&s.jsx(er,{m:"md",p:"md",children:s.jsx(zi,{value:lQ(c),total:cQ(c,M),onChange:P=>E(DW(c,P)),getControlProps:P=>{switch(P){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),s.jsx(LW,{search:c,visible:m.current.fieldEditorVisible,onOk:P=>{E(P),h({...m.current,fieldEditorVisible:!1})},onCancel:()=>{h({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),s.jsx(UW,{search:c,visible:m.current.filterEditorVisible,onOk:P=>{E(P),h({...m.current,filterEditorVisible:!1})},onCancel:()=>{h({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),s.jsx(gW,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{h({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),s.jsx(VW,{visible:m.current.filterDialogVisible,title:(X=f.filterDialogSearchParam)!=null&&X.code?Qs(f.filterDialogSearchParam.code):"",resourceType:k,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:P=>{E(fm(c,P.code,P.operator,P.value)),h({...m.current,filterDialogVisible:!1})},onCancel:()=>{h({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const oQ=zc;function sQ(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(n=>s.jsxs("div",{children:[tk(n.operator)," ",s.jsx(FW,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function lQ(e){return Math.floor((e.offset??0)/(e.count??Jp))+1}function cQ(e,t){const n=e.count??Jp,r=ik(e,t);return Math.ceil(r/n)}function rk(e,t){return Math.min(ik(e,t),(e.offset??0)+1)}function uQ(e,t){var n;return Math.max(rk(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function ik(e,t){var r,i;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((i=t.link)!=null&&i.some(o=>o.relation==="next")?1:0)),n}function dQ(e){const t=Ae(),[n,r]=y.useState(!1),[i,o]=y.useState(),{query:c,fields:u}=e,[f,h]=y.useState(),[m,g]=y.useState({}),v=y.useRef(f);v.current=f;const b=y.useRef({});b.current=m,y.useEffect(()=>{o(void 0),t.graphql(c).then(h).catch(T=>o(Zt(T)))},[t,c]);function S(T,R){T.stopPropagation();const k=T.target.checked,M={...b.current};k?M[R]=!0:delete M[R],g(M)}function w(T){var I;T.stopPropagation();const D=T.target.checked,k={},M=(I=v.current)==null?void 0:I.data.ResourceList;D&&M&&M.forEach(z=>{z.id&&(k[z.id]=!0)}),g(k)}function C(){var R;const T=(R=v.current)==null?void 0:R.data.ResourceList;if(!T||T.length===0)return!1;for(const D of T)if(D.id&&!b.current[D.id])return!1;return!0}function E(T,R){SA(T.target)||(pn(T),T.button!==1&&e.onClick&&e.onClick(new Qh(R,T)),T.button===1&&e.onAuxClick&&e.onAuxClick(new Qh(R,T)))}if(y.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(kr,{});const _=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:T=>pn(T),"data-testid":"search-control",children:[s.jsxs(ye,{children:[s.jsx(ye.Thead,{children:s.jsxs(ye.Tr,{children:[_&&s.jsx(ye.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:T=>w(T)})}),u.map(T=>s.jsx(ye.Th,{children:T.name},T.name))]})}),s.jsx(ye.Tbody,{children:f==null?void 0:f.data.ResourceList.map(T=>T&&s.jsxs(ye.Tr,{"data-testid":"search-control-row",onClick:R=>E(R,T),onAuxClick:R=>E(R,T),children:[_&&s.jsx(ye.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${T.id}`,checked:!!m[T.id],onChange:R=>S(R,T.id)})}),u.map(R=>s.jsx(ye.Td,{children:s.jsx(mW,{propertyType:R.propertyType,path:R.fhirPath,resource:T})},R.name))]},T.id))})]}),(f==null?void 0:f.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),i&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),e.onBulk&&s.jsx(Pe,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const fQ=y.memo(dQ),hQ="_root_1fbwr_1",pQ="_entry_1fbwr_8",mQ="_key_1fbwr_13",gQ="_value_1fbwr_20",pm={root:hQ,entry:pQ,key:mQ,value:gQ};function ht(e){return s.jsx(Yr,{children:s.jsx("div",{className:pm.root,children:e.children})})}ht.Entry=function(t){return s.jsx("div",{className:pm.entry,children:t.children})};ht.Key=function(t){return s.jsx("div",{className:pm.key,children:t.children})};ht.Value=function(t){return s.jsx("div",{className:pm.value,children:t.children})};function vQ(e){const{group:t}=e;return s.jsx(lr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(je,{children:[t.measureScore&&s.jsx(bQ,{group:t}),!t.measureScore&&s.jsx(xQ,{group:t})]})})}function yQ(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(_e,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(_e,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function xQ(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(f=>Ho(f.code)==="numerator"),i=n==null?void 0:n.find(f=>Ho(f.code)==="denominator"),o=r==null?void 0:r.count,c=i==null?void 0:i.count;if(c===0)return s.jsxs(ce,{children:[s.jsx(Le,{order:3,children:"Not Applicable"}),s.jsx(_e,{children:`Denominator: ${c}`})]});if(o===void 0||c===void 0)return s.jsxs(ce,{children:[s.jsx(Le,{order:3,children:"Insufficient Data"}),s.jsx(_e,{children:`Numerator: ${o}`}),s.jsx(_e,{children:`Denominator: ${c}`})]});const u=o/c*100;return s.jsx(Gp,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:ak(u)}],label:s.jsx(Fo,{justify:"center",children:s.jsxs(_e,{fw:700,fz:18,children:[o," / ",c]})})})}function bQ(e){var r,i,o;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((i=t.measureScore)==null?void 0:i.code);return s.jsx(s.Fragment,{children:n==="%"?s.jsx(Gp,{size:120,thickness:12,roundCaps:!0,sections:[{value:SQ(t),color:ak(((o=t==null?void 0:t.measureScore)==null?void 0:o.value)??0)}],label:s.jsx(Fo,{justify:"center",children:s.jsx(_e,{fw:700,fz:18,children:s.jsx(cd,{value:t.measureScore})})})}):s.jsx(Fo,{h:120,align:"center",children:s.jsx(Le,{order:3,children:s.jsx(cd,{value:t.measureScore})})})})}function SQ(e){var r,i;const t=(r=e.measureScore)==null?void 0:r.value,n=(i=e.measureScore)==null?void 0:i.unit;return t?t<=1&&n==="%"?t*100:t:0}function ak(e){return e<=33?"red":e<=67?"yellow":"green"}function wQ(e){var r;const t=Wt(e.measureReport),[n]=hF("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(ce,{children:[n&&s.jsx(yQ,{measure:n}),s.jsx(B0,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((i,o)=>s.jsx(vQ,{group:i},i.id??o))})]}):null}const ry="patient-export",iy="Patient Export",jQ={everything:{operation:"$everything",extension:"json",contentType:hn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:hn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:hn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:hn.CDA_XML}};function CQ(e){const t=Ae(),{patient:n}=e,r=y.useCallback(async i=>{const o=Vs(n),c=i.format,{operation:u,type:f,contentType:h,extension:m}=jQ[c],g=t.fhirUrl("Patient",o,u),v={};f&&(v.type=f),i.author&&(v.author={reference:i.author}),i.authoredOn&&(v.authoredOn=Ob(i.authoredOn)),i.startDate&&(v.start=i.startDate),i.endDate&&(v.end=i.endDate),di.show({id:ry,title:iy,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,v,void 0,{cache:"no-cache",headers:{Accept:h}}),S=`Patient-export-${o}-${new Date().toISOString().replaceAll(":","-")}.${m}`;EQ(b,S,h),di.update({id:ry,title:iy,color:"green",message:"Done",icon:s.jsx(to,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){di.update({id:ry,title:iy,color:"red",message:Ye(b),icon:s.jsx(qs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return s.jsx(pt,{onSubmit:r,children:s.jsxs(qe,{children:[s.jsx(It,{title:"Export Format",description:"Required",withAsterisk:!0,children:s.jsx(Wp,{name:"format",data:[{label:"FHIR Everything",value:"everything"},{label:"Patient Summary",value:"summary"},{label:"C-CDA",value:"ccda"},{label:"C-CDA Referral",value:"ccdaReferral"}],fullWidth:!0})}),s.jsx(It,{title:"Author",description:"Optional author for composition. Default value is current user.",children:s.jsx(Od,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),s.jsx(It,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:s.jsx(oa,{name:"authoredOn",placeholder:"Authored on"})}),s.jsx(It,{title:"Start Date",description:"The start date of care. If no start date is provided, all records prior to the end date are in scope.",children:s.jsx(oa,{name:"startDate",placeholder:"Start date"})}),s.jsx(It,{title:"End Date",description:"The end date of care. If no end date is provided, all records subsequent to the start date are in scope.",children:s.jsx(oa,{name:"endDate",placeholder:"End date"})}),s.jsx(je,{justify:"right",children:s.jsx(xr,{children:"Request Export"})})]})})}function EQ(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),i=new Blob([r],{type:n}),o=window.URL.createObjectURL(i),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=o,c.download=t,c.click(),window.URL.revokeObjectURL(o)}function TQ(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function ok(e){var n,r;const t=Wt(e.patient);return t?s.jsxs(ht,{children:[s.jsx(Zo,{value:t,size:"lg",color:TQ(t)}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Name"}),s.jsx(ht.Value,{children:s.jsx(mt,{to:t,fw:500,children:t.name?s.jsx(Rb,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"DoB"}),s.jsx(ht.Value,{children:t.birthDate})]}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Age"}),s.jsx(ht.Value,{children:eU(t.birthDate)})]})]}),t.gender&&s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Gender"}),s.jsx(ht.Value,{children:t.gender})]}),t.address&&s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"State"}),s.jsx(ht.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(i=>s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:i==null?void 0:i.system}),s.jsx(ht.Value,{children:i==null?void 0:i.value})]},`${i==null?void 0:i.system}-${i==null?void 0:i.value}`))]}):null}function RQ(e){const{patient:t,...n}=e,r=y.useCallback((i,o,c)=>{const u=`${o}/${c}`,f=100;return Promise.allSettled([i.readHistory("Patient",c),i.search("Communication",{subject:u,_count:f}),i.search("Device",{patient:u,_count:f}),i.search("DeviceRequest",{patient:u,_count:f}),i.search("DiagnosticReport",{subject:u,_count:f}),i.search("Media",{subject:u,_count:f}),i.search("ServiceRequest",{subject:u,_count:f}),i.search("Task",{subject:u,_count:f})])},[]);return s.jsx(dm,{value:t,loadTimelineResources:r,createCommunication:(i,o,c)=>({resourceType:"Communication",status:"completed",subject:nn(i),sender:nn(o),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(i,o,c)=>({resourceType:"Media",status:"completed",subject:nn(i),operator:nn(o),issued:new Date().toISOString(),content:c}),...n})}const _Q="_section_pqpwm_1",DQ="_hovering_pqpwm_7",Ky={section:_Q,hovering:DQ};function AQ(e){const t=Ae(),n=Wt(e.value),[r,i]=y.useState(!1),[o,c]=y.useState(),[u,f]=y.useState(),[h,m]=y.useState();function g(){f(void 0)}function v(){c(void 0)}const b=y.useRef(h);if(b.current=h,y.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>i(!0)).catch(console.log)},[t]),y.useEffect(()=>(m(MQ(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",v)}),[n]),!r||!h)return null;function S(w,C){m({...b.current,[w]:C})}return s.jsx("div",{children:s.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(h),children:[s.jsx($e,{label:"Plan Title",py:"md",defaultValue:h.title,onChange:w=>S("title",w.currentTarget.value)}),s.jsx(kQ,{actions:h.action||[],selectedKey:o,setSelectedKey:c,hoverKey:u,setHoverKey:f,onChange:w=>S("action",w)}),s.jsx(xr,{children:"Save"})]})})}function kQ(e){const t=y.useRef(e.actions);t.current=e.actions;function n(o){e.onChange(t.current.map(c=>c.id===o.id?o:c))}function r(o){e.onChange([...t.current,o]),e.setSelectedKey(o.id)}function i(o){e.onChange(t.current.filter(c=>c!==o))}return s.jsxs(qe,{gap:"md",className:Ky.section,children:[e.actions.map(o=>s.jsx(PQ,{action:o,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(o)},o.id)),s.jsx("div",{children:s.jsx(Pe,{variant:"outline",onClick:o=>{pn(o),r({id:sk()})},children:"Add action"})})]})}function PQ(e){const{action:t}=e,n=OQ(t);function r(o){o.stopPropagation(),e.setSelectedKey(e.action.id)}function i(o){pn(o),e.setHoverKey(e.action.id)}return s.jsx("div",{onClick:r,onMouseOver:i,onFocus:i,children:s.jsx(NQ,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function NQ(e){const{action:t}=e,[n,r]=y.useState(e.actionType),i=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function c(f,h){e.onChange({...t,[f]:h})}const u=Ut(Ky.section,{[Ky.hovering]:o&&!i});return s.jsxs(lr,{"data-testid":t.id,className:u,p:0,radius:"sm",withBorder:!0,children:[s.jsxs(Fo,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[s.jsx($e,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),s.jsx(Qo,{"data-testid":"close-button",onClick:e.onRemove})]}),i&&s.jsxs(qe,{gap:"xl",p:"md",children:[s.jsx(ce,{children:s.jsx($e,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),s.jsx(ce,{children:s.jsx(ln,{label:"Type of Action",value:n,onChange:f=>{const h=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(h),e.onChange({...e.action,definitionCanonical:h==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&s.jsxs(qe,{gap:0,children:[s.jsxs(je,{gap:0,mb:"xs",children:[s.jsx(_e,{fw:600,children:"Select questionnaire"}),s.jsx(_e,{c:"red",children:"*"})]}),s.jsxs(_e,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Nt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),s.jsx(fT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&s.jsxs(qe,{gap:0,children:[s.jsxs(je,{gap:0,mb:"xs",children:[s.jsx(_e,{fw:600,children:"Select activity definition"}),s.jsx(_e,{c:"red",children:"*"})]}),s.jsxs(_e,{size:"sm",c:"dimmed",mb:"sm",children:["ActivityDefinition.kind resource to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Nt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),s.jsx(fT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function fT(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(al,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:i=>{i?e.onChange({...e.action,definitionCanonical:zt(i)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function OQ(e){var t,n;return(t=e.definitionCanonical)!=null&&t.startsWith("Questionnaire")?"questionnaire":(n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let ay=1;function sk(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(ay=Math.max(ay,t+1))}return e}return"id-"+ay++}function MQ(e){return{...e,action:lk(e.action)}}function lk(e){if(e)return e.map(t=>({...t,id:sk(t.id),action:lk(t.action)}))}const Ls=30,Yh=50;function Xh(e){const t=e.formState,n=e.item,r=e.responseItem;function i(g){t&&e.context&&t.onChangeAnswer(e.context,e.item,g)}const o=n.type;if(!o)return null;const c=n.linkId;if(!c)return null;const u=n.initial&&n.initial.length>0?n.initial[0]:void 0,f=qb(r,e.index)??Sb(u),h=ha(r,`${Ui}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(o){case wt.display:m=s.jsx("p",{children:e.item.text},e.item.linkId);break;case wt.boolean:m=s.jsx(BA,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(zn,{id:e.item.linkId,name:e.item.linkId,required:e.required??n.required,defaultChecked:f==null?void 0:f.value,onChange:g=>i([{valueBoolean:g.currentTarget.checked}])})},e.item.linkId);break;case wt.decimal:m=s.jsx($e,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueDecimal:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber}])});break;case wt.integer:m=s.jsx($e,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueInteger:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber}])});break;case wt.date:m=s.jsx($e,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueDate:g.currentTarget.value}])});break;case wt.dateTime:m=s.jsx(oa,{name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueDateTime:g}])});break;case wt.time:m=s.jsx($e,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueTime:g.currentTarget.value}])});break;case wt.string:case wt.url:m=s.jsx($e,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const v=g.currentTarget.value;i([{valueString:v===""?void 0:v}])}});break;case wt.text:m=s.jsx(el,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const v=g.currentTarget.value;i([{valueString:v===""?void 0:v}])}});break;case wt.attachment:m=s.jsx(je,{py:4,children:s.jsx(EA,{path:"",name:c,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueAttachment:g}])})});break;case wt.reference:m=s.jsx(Od,{name:c,required:e.required??n.required,targetTypes:oA(n),searchCriteria:rF(n,t==null?void 0:t.subject,t==null?void 0:t.encounter),defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueReference:g}])});break;case wt.quantity:m=s.jsx(Gs,{path:"",name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>i([{valueQuantity:g}]),disableWheel:!0});break;case wt.choice:case wt.openChoice:VQ(n)?m=s.jsx(zQ,{name:c,item:n,required:e.required??n.required,initial:u,response:r,onChangeAnswer:g=>i(g)}):BQ(n)||n.answerValueSet&&!FQ(n)?m=s.jsx(IQ,{name:c,item:n,required:e.required??n.required,initial:u,response:r,onChangeAnswer:g=>i(g)}):m=s.jsx($Q,{name:c,item:n,required:e.required??n.required,initial:u,response:r,onChangeAnswer:g=>i(g)});break;default:return null}return s.jsxs(s.Fragment,{children:[m,(h==null?void 0:h.valueString)&&s.jsx(_e,{c:"red",size:"lg",mt:4,children:h.valueString})]})}function IQ(e){var g;const{name:t,item:n,required:r,initial:i,onChangeAnswer:o,response:c}=e;if(!((g=n.answerOption)!=null&&g.length)&&!n.answerValueSet)return s.jsx(Hb,{});const u=Sb(i),f=qb(c)??u,h=dk(c),m=n.repeats||HQ(n);if(n.answerValueSet)return s.jsx(om,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:m?void 0:1,required:r,onChange:v=>{m?v.length===0?o([{}]):o(v.map(b=>({valueCoding:b}))):o([{valueCoding:v[0]}])},defaultValue:f==null?void 0:f.value});if(m){const{propertyName:v,data:b}=qQ(n);return s.jsx($p,{data:b,placeholder:"Select items",searchable:!0,defaultValue:h||[yc(u)],required:r,onChange:S=>{if(S.length===0)o([{}]);else{const w=iA(S,v,n);o(w)}}})}else{const v=[""];if(n.answerOption)for(const b of n.answerOption){const S=ua(b);v.push(yc(S))}return s.jsx(ln,{id:t,name:t,required:r,onChange:b=>{const S=b.currentTarget.selectedIndex;if(S===0){o([{}]);return}const w=n.answerOption[S-1],C=ua(w),E="value"+In(C.type);o([{[E]:C.value}])},defaultValue:Dd(f==null?void 0:f.value)||(f==null?void 0:f.value),data:v})}}function LQ(e,t){return e?t.valueSetExpand({url:e,count:Ls+1}).then(n=>{var r;return((r=n.expansion)==null?void 0:r.contains)??[]}):Promise.resolve([])}function ck(e){const t=Ae(),[n,r]=y.useState([]),[i,o]=y.useState(!1);return y.useEffect(()=>{async function c(){if(e){o(!0);try{const u=await LQ(e,t);r(u)}catch(u){console.error("Error loading value set:",u)}finally{o(!1)}}}c().catch(console.error)},[e,t]),[n,i]}function uk(e,t){return e.map((n,r)=>{const i=`${t}-valueset-${r}`,o={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[i,o]})}function $Q(e){const{name:t,item:n,required:r,initial:i,onChangeAnswer:o,response:c}=e,u=Xo("QuestionnaireItemAnswerOption","value[x]"),f=Sb(i),[h,m]=ck(n.answerValueSet),g=[];let v;if(n.answerValueSet)g.push(...uk(h,t));else if(n.answerOption){const C=n.answerOption.slice(0,Yh).map((E,_)=>{const T=`${t}-option-${_}`,R=ua(E);return R!=null&&R.value?(f&&Ii(R)===Ii(f)&&(v=T),[T,R]):null}).filter(E=>E!==null);g.push(...C)}const b=qb(c),S=UQ(g,b);if(m)return s.jsx(_e,{children:"Loading options..."});if(g.length===0)return s.jsx(Hb,{});const w=g.slice(0,Ls);return s.jsxs(s.Fragment,{children:[s.jsx(Bs.Group,{name:t,value:S??v,required:r,onChange:C=>{const E=g.find(_=>_[0]===C);if(E){const _=E[1],T="value"+In(_.type);o([{[T]:_.value}])}},children:w.map(([C,E])=>s.jsx(Bs,{id:C,value:C,py:4,required:r,label:s.jsx(Li,{property:u,propertyType:E.type,value:E.value})},C))}),(n.answerValueSet&&g.length>Ls||n.answerOption&&g.length>Yh)&&s.jsxs(_e,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",Ls," options"]})]})}function zQ(e){var S;const{name:t,item:n,onChangeAnswer:r,response:i}=e,o=Xo("QuestionnaireItemAnswerOption","value[x]"),[c,u]=ck(n.answerValueSet),f=n.answerValueSet?(((S=i.answer)==null?void 0:S.map(w=>w.valueCoding))||[]).filter(w=>w!==void 0):dk(i),[h,m]=y.useState(f),g=[];if(n.answerValueSet)g.push(...uk(c,t));else if(n.answerOption){const w=n.answerOption.slice(0,Yh).map((C,E)=>{const _=`${t}-option-${E}`,T=ua(C);return T!=null&&T.value?[_,T]:null}).filter(C=>C!==null);g.push(...w)}if(u)return s.jsx(_e,{children:"Loading options..."});if(g.length===0)return s.jsx(Hb,{});const v=g.slice(0,Ls),b=(w,C)=>{if(n.answerValueSet){const E=h;let _;C?_=[...E,w.value]:_=E.filter(T=>!la(T,w.value)),m(_),_.length===0?r([{}]):r(_.map(T=>({valueCoding:T})))}else{const E=h,_=yc(w);let T;if(C?T=[...E,_]:T=E.filter(R=>R!==_),m(T),T.length===0)r([{}]);else{const R=iA(T,"value"+In(w.type),n);r(R)}}};return s.jsxs(je,{style:{flexDirection:"column",alignItems:"flex-start"},children:[v.map(([w,C])=>{const E=yc(C),_=n.answerValueSet?h.some(T=>la(T,C.value)):h.includes(E);return s.jsx(zn,{id:w,label:s.jsx(Li,{property:o,propertyType:C.type,value:C.value}),checked:_,onChange:T=>b(C,T.currentTarget.checked)},w)}),(n.answerValueSet&&g.length>Ls||n.answerOption&&g.length>Yh)&&s.jsxs(_e,{size:"sm",c:"dimmed",children:["Showing first ",Ls," options"]})]})}function Hb(){return s.jsx($e,{disabled:!0,placeholder:"No Answers Defined"})}function qb(e,t=0){const n=e.answer;return ua((n==null?void 0:n[t])??{})}function dk(e){const t=e.answer;return t?t.map(r=>ua(r)).map(r=>Dd(r==null?void 0:r.value)||(r==null?void 0:r.value)).filter(Boolean):[]}function UQ(e,t){var n;return(n=e.find(r=>la(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function mm(e,t){var n;return!!((n=e.extension)!=null&&n.some(r=>{var i,o,c;return r.url===xb&&((c=(o=(i=r.valueCodeableConcept)==null?void 0:i.coding)==null?void 0:o[0])==null?void 0:c.code)===t}))}function BQ(e){return mm(e,"drop-down")}function VQ(e){return mm(e,"check-box")}function FQ(e){return mm(e,"radio-button")}function HQ(e){return mm(e,"multi-select")}function qQ(e){var o;if(((o=e.answerOption)==null?void 0:o.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=ua(t),r="value"+In(n.type),i=(e.answerOption??[]).map(c=>{const u=ua(c),f=yc(u);return{value:f,label:f}});return{propertyName:r,data:i}}const GQ="_section_my8o4_1",WQ="_hovering_my8o4_10",QQ="_editing_my8o4_14",YQ="_questionBody_my8o4_20",XQ="_topActions_my8o4_24",KQ="_bottomActions_my8o4_33",ZQ="_movementActions_my8o4_44",JQ="_movementIcons_my8o4_56",eY="_columnAlignment_my8o4_60",tY="_linkIdInput_my8o4_65",nY="_typeSelect_my8o4_70",rY="_preserveBreaks_my8o4_74",Fr={section:GQ,hovering:WQ,editing:QQ,questionBody:YQ,topActions:XQ,bottomActions:KQ,movementActions:ZQ,movementIcons:JQ,columnAlignment:eY,linkIdInput:tY,typeSelect:nY,preserveBreaks:rY};function iY(e){const t=Ae(),n=Wt(e.questionnaire),[r,i]=y.useState(!1),[o,c]=y.useState(),[u,f]=y.useState(),[h,m]=y.useState();function g(){m(void 0)}function v(){f(void 0)}y.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>i(!0)).catch(console.log)},[t]),y.useEffect(()=>(c(lY(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",v)}),[n]);const b=(S,w)=>{c(S),e.autoSave&&!w&&e.onSubmit&&e.onSubmit(S)};return!r||!o?null:s.jsx("div",{children:s.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(o),children:[s.jsx(fk,{item:o,selectedKey:u,setSelectedKey:f,hoverKey:h,setHoverKey:m,onChange:b}),s.jsx(xr,{children:"Save"})]})})}function fk(e){var T;const t=e.item,n=e.item,r=pa(e.item),i=r||n.type===wt.group,o=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,f=y.useRef(e.item);f.current=e.item;function h(R){pn(R),e.setSelectedKey(e.item.id)}function m(R){pn(R),e.setHoverKey(e.item.id)}function g(R){var k;const D=f.current;e.onChange({...D,item:(k=D.item)==null?void 0:k.map(M=>M.id===R.id?R:M)})}function v(R,D){e.onChange({...e.item,item:[...e.item.item??[],R]},D)}function b(R){var D;e.onChange({...e.item,item:(D=e.item.item)==null?void 0:D.filter(k=>k!==R)})}function S(R,D){e.onChange({...f.current,[R]:D})}function w(R){e.onChange({...e.item,...R})}function C(R){var D;e.onChange({...e.item,item:(D=e.item.item)==null?void 0:D.map(k=>k===R?{...k,repeats:!k.repeats}:k)})}function E(R,D){const k=dY(e.item.item,R,D);e.onChange({...e.item,item:k})}const _=Ut(Fr.section,{[Fr.editing]:c,[Fr.hovering]:u&&!c});return s.jsxs("div",{"data-testid":n.linkId,className:_,onClick:h,onMouseOver:m,onFocus:m,children:[s.jsx("div",{className:Fr.questionBody,children:c?s.jsxs(s.Fragment,{children:[r&&s.jsx($e,{size:"xl",defaultValue:t.title,onBlur:R=>S("title",R.currentTarget.value)}),!r&&s.jsx(el,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:R=>S("text",R.currentTarget.value)}),n.type==="reference"&&s.jsx(sY,{item:n,onChange:w}),WV(n)&&s.jsx(aY,{item:n,onChange:R=>w(R)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(Le,{children:t.title}),n.text&&s.jsx("div",{className:Fr.preserveBreaks,children:n.text}),!i&&s.jsx(Xh,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),(T=n.item)==null?void 0:T.map((R,D)=>s.jsx("div",{children:s.jsx(fk,{item:R,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:D===0,isLast:D===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(R),onRepeatable:C,onMoveUp:()=>E(D,-1),onMoveDown:()=>E(D,1)})},R.id)),!i&&s.jsx("div",{className:Fr.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx($e,{size:"xs",className:Fr.linkIdInput,defaultValue:n.linkId,onBlur:R=>S("linkId",R.currentTarget.value)}),!i&&s.jsx(ln,{size:"xs",className:Fr.typeSelect,defaultValue:n.type,onChange:R=>S("type",R.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:o})}),!r&&s.jsx(ce,{className:Fr.movementActions,children:s.jsxs(ce,{className:Fr.columnAlignment,children:[!e.isFirst&&s.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(wF,{"data-testid":"up-button",size:15,className:Fr.movementIcons})}),!e.isLast&&s.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(SF,{"data-testid":"down-button",size:15,className:Fr.movementIcons})})]})}),s.jsxs("div",{className:Fr.bottomActions,children:[i&&s.jsxs(s.Fragment,{children:[s.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),v({id:Ys(),linkId:ex("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),v({id:Ys(),linkId:ex("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),v(uY(),!0)},children:"Add Page"}),c&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Nt,{href:"#",onClick:R=>{R.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function aY(e){const t=Xo("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx($e,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(oY,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(ce,{display:"flex",children:[s.jsx(Nt,{href:"#",onClick:r=>{pn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Ys()}]})},children:"Add choice"}),s.jsx(Qp,{w:"lg"}),s.jsx(Nt,{href:"#",onClick:r=>{pn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function oY(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=lm({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(Md,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(i,o)=>{const c=[...e.options],u=c.findIndex(f=>f.id===t.id);c[u]={id:t.id,[o]:i},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Nt,{href:"#",onClick:i=>{pn(i),e.onChange({...e.item,answerOption:e.options.filter(o=>o.id!==t.id)})},children:"Remove"})})]},t.id)})})}function sY(e){const t=oA(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(je,{children:[s.jsx(Ab,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:i=>{e.onChange(Jv(e.item,t.map(o=>o===n?i:o)))}}),s.jsx(Nt,{href:"#",onClick:i=>{pn(i),e.onChange(Jv(e.item,t.filter(o=>o!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Nt,{href:"#",onClick:n=>{pn(n),e.onChange(Jv(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Zy=1,Jy=1;function ex(e){return e+Zy++}function Ys(){return"id-"+Jy++}function lY(e){return{...e,id:e.id||Ys(),item:hk(e.item)}}function hk(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Jy=Math.max(Jy,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Zy=Math.max(Zy,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Ys(),item:hk(t.item),answerOption:cY(t.answerOption)}))}function cY(e){if(e)return e.map(t=>({...t,id:t.id||Ys()}))}function uY(){return{id:Ys(),linkId:ex("s"),type:"group",text:"New Page",extension:[{url:xb,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function dY(e,t,n){const r=e??[],i=t+n;if(i<0||i>=r.length)return r;const o=[...r];return[o[t],o[i]]=[o[i],o[t]],o}/*!
537
- * Signature Pad v5.0.10 | https://github.com/szimek/signature_pad
538
- * (c) 2025 Szymon Nowak | Released under the MIT license
539
- */class Kh{constructor(t,n,r,i){if(isNaN(t)||isNaN(n))throw new Error(`Point is invalid: (${t}, ${n})`);this.x=+t,this.y=+n,this.pressure=r||0,this.time=i||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class Gb{static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,i=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new Gb(t[1],r,i,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const i=t.x-n.x,o=t.y-n.y,c=n.x-r.x,u=n.y-r.y,f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},h={x:(n.x+r.x)/2,y:(n.y+r.y)/2},m=Math.sqrt(i*i+o*o),g=Math.sqrt(c*c+u*u),v=f.x-h.x,b=f.y-h.y,S=m+g==0?0:g/(m+g),w={x:h.x+v*S,y:h.y+b*S},C=n.x-w.x,E=n.y-w.y;return{c1:new Kh(f.x+C,f.y+E),c2:new Kh(h.x+C,h.y+E)}}constructor(t,n,r,i,o,c){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=i,this.startWidth=o,this.endWidth=c}length(){let n=0,r,i;for(let o=0;o<=10;o+=1){const c=o/10,u=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(o>0){const h=u-r,m=f-i;n+=Math.sqrt(h*h+m*m)}r=u,i=f}return n}point(t,n,r,i,o){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*i*(1-t)*t*t+o*t*t*t}}class fY{constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(t,n,r){this._et.addEventListener(t,n,r)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,n,r){this._et.removeEventListener(t,n,r)}}function hY(e,t=250){let n=0,r=null,i,o,c;const u=()=>{n=Date.now(),r=null,i=e.apply(o,c),r||(o=null,c=[])};return function(...h){const m=Date.now(),g=t-(m-n);return o=this,c=h,g<=0||g>t?(r&&(clearTimeout(r),r=null),n=m,i=e.apply(o,c),r||(o=null,c=[])):r||(r=window.setTimeout(u,g)),i}}class Zh extends fY{constructor(t,n={}){var r,i,o;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=(r=n.throttle)!==null&&r!==void 0?r:16,this.minDistance=(i=n.minDistance)!==null&&i!==void 0?i: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=(o=n.canvasContextOptions)!==null&&o!==void 0?o:{},this._strokeMoveUpdate=this.throttle?hY(Zh.prototype._strokeUpdate,this.throttle):Zh.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._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}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._strokePointerId=void 0}fromDataURL(t,n={}){return new Promise((r,i)=>{const o=new Image,c=n.ratio||window.devicePixelRatio||1,u=n.width||this.canvas.width/c,f=n.height||this.canvas.height/c,h=n.xOffset||0,m=n.yOffset||0;this._reset(this._getPointGroupOptions()),o.onload=()=>{this._ctx.drawImage(o,h,m,u,f),r()},o.onerror=g=>{i(g)},o.crossOrigin="anonymous",o.src=t,this._isEmpty=!1})}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(){var t;const n=window.document===this.canvas.ownerDocument?window:(t=this.canvas.ownerDocument.defaultView)!==null&&t!==void 0?t:this.canvas.ownerDocument;return{addEventListener:n.addEventListener.bind(n),removeEventListener:n.removeEventListener.bind(n)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}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)))}_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});break;case"pointerdown":r("pointermove",this._handlePointerMove,{passive:!1}),r("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const i=this._getPointGroupOptions(),o=Object.assign(Object.assign({},i),{points:[]});this._data.push(o),this._reset(i),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],i=r.points,o=i.length>0&&i[i.length-1],c=o?n.distanceTo(o)<=this.minDistance:!1,u=this._getPointGroupOptions(r);if(!o||!(o&&c)){const f=this._addPoint(n,u);o?f&&this._drawCurve(f,u):this._drawDot(n,u),i.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 i=this.canvas.getBoundingClientRect();return new Kh(t-i.left,n-i.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 i=this._calculateCurveWidths(r[1],r[2],n),o=Gb.fromPoints(r,i);return r.shift(),o}return null}_calculateCurveWidths(t,n,r){const i=r.velocityFilterWeight*n.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(i,r),c={end:o,start:this._lastWidth};return this._lastVelocity=i,this._lastWidth=o,c}_strokeWidth(t,n){return Math.max(n.maxWidth/(t+1),n.minWidth)}_drawCurveSegment(t,n,r){const i=this._ctx;i.moveTo(t,n),i.arc(t,n,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,n){const r=this._ctx,i=t.endWidth-t.startWidth,o=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=n.penColor;for(let c=0;c<o;c+=1){const u=c/o,f=u*u,h=f*u,m=1-u,g=m*m,v=g*m;let b=v*t.startPoint.x;b+=3*g*u*t.control1.x,b+=3*m*f*t.control2.x,b+=h*t.endPoint.x;let S=v*t.startPoint.y;S+=3*g*u*t.control1.y,S+=3*m*f*t.control2.y,S+=h*t.endPoint.y;const w=Math.min(t.startWidth+h*i,n.maxWidth);this._drawCurveSegment(b,S,w)}r.closePath(),r.fill()}_drawDot(t,n){const r=this._ctx,i=n.dotSize>0?n.dotSize:(n.minWidth+n.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,i),r.closePath(),r.fillStyle=n.penColor,r.fill()}_fromData(t,n,r){for(const i of t){const{points:o}=i,c=this._getPointGroupOptions(i);if(o.length>1)for(let u=0;u<o.length;u+=1){const f=o[u],h=new Kh(f.x,f.y,f.pressure,f.time);u===0&&this._reset(c);const m=this._addPoint(h,c);m&&n(m,c)}else this._reset(c),r(o[0],c)}}toSVG({includeBackgroundColor:t=!1}={}){const n=this._data,r=Math.max(window.devicePixelRatio||1,1),i=0,o=0,c=this.canvas.width/r,u=this.canvas.height/r,f=document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.setAttribute("xmlns","http://www.w3.org/2000/svg"),f.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),f.setAttribute("viewBox",`${i} ${o} ${c} ${u}`),f.setAttribute("width",c.toString()),f.setAttribute("height",u.toString()),t&&this.backgroundColor){const h=document.createElement("rect");h.setAttribute("width","100%"),h.setAttribute("height","100%"),h.setAttribute("fill",this.backgroundColor),f.appendChild(h)}return this._fromData(n,(h,{penColor:m})=>{const g=document.createElement("path");if(!isNaN(h.control1.x)&&!isNaN(h.control1.y)&&!isNaN(h.control2.x)&&!isNaN(h.control2.y)){const v=`M ${h.startPoint.x.toFixed(3)},${h.startPoint.y.toFixed(3)} C ${h.control1.x.toFixed(3)},${h.control1.y.toFixed(3)} ${h.control2.x.toFixed(3)},${h.control2.y.toFixed(3)} ${h.endPoint.x.toFixed(3)},${h.endPoint.y.toFixed(3)}`;g.setAttribute("d",v),g.setAttribute("stroke-width",(h.endWidth*2.25).toFixed(3)),g.setAttribute("stroke",m),g.setAttribute("fill","none"),g.setAttribute("stroke-linecap","round"),f.appendChild(g)}},(h,{penColor:m,dotSize:g,minWidth:v,maxWidth:b})=>{const S=document.createElement("circle"),w=g>0?g:(v+b)/2;S.setAttribute("r",w.toString()),S.setAttribute("cx",h.x.toString()),S.setAttribute("cy",h.y.toString()),S.setAttribute("fill",m),f.appendChild(S)}),f.outerHTML}}function pY(e){const t=Ae(),{width:n=500,height:r=200,defaultValue:i,who:o,onChange:c,...u}=e,f=y.useRef(null),h=y.useRef(null),m=y.useRef(c);m.current=c,y.useEffect(()=>{function v(){var b,S;(S=m.current)==null||S.call(m,{type:[{system:Ui+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:o??nn(t.getProfile()),data:(b=h.current)==null?void 0:b.toDataURL()})}if(f.current){const b=new Zh(f.current);i!=null&&i.data&&b.fromDataURL(i.data).catch(console.error),b.addEventListener("endStroke",v),h.current=b}return()=>{h.current&&h.current.removeEventListener("beginStroke",v)}},[t,i,o]);const g=()=>{var v;h.current&&h.current.clear(),(v=m.current)==null||v.call(m,void 0)};return s.jsxs(lr,{withBorder:!0,p:0,w:n,h:r,pos:"relative",...u,children:[s.jsx("canvas",{ref:f,width:n,height:r,"aria-label":"Signature input area"}),s.jsx(Pe,{onClick:g,"aria-label":"Clear signature",pos:"absolute",top:0,right:0,size:"xs",leftSection:s.jsx(am,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function pk(e){const t=[...e.context,e.responseItem];return s.jsxs("div",{children:[e.item.text&&s.jsx(Le,{order:3,mb:"md",children:e.item.text}),s.jsx(tx,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function mY(e){return s.jsxs(s.Fragment,{children:[e.responseItems.map(t=>s.jsx(pk,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),s.jsx(Nt,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function gY(e){const{formState:t,context:n,item:r,responseItem:i}=e,o=r.type!==wt.choice&&r.type!==wt.openChoice,c=i.answer&&i.answer.length>0?i.answer:[{}];return s.jsxs(It,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[s.jsx(qe,{gap:"xs",children:c==null?void 0:c.map((u,f)=>s.jsx(Xh,{formState:t,context:n,item:r,responseItem:i,index:f},`${r.linkId}-${f}`))}),o&&s.jsx(Nt,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function tx(e){const{formState:t,context:n,items:r,responseItems:i}=e;return s.jsx(qe,{children:r.map((o,c)=>{if(!QV(o,t.questionnaireResponse))return null;if(o.type===wt.display)return s.jsx("p",{children:o.text},`display-${o.id}-${c}`);const u=i.filter(f=>f.linkId===o.linkId);return o.type===wt.group&&o.repeats?s.jsx(mY,{formState:t,context:n,item:o,responseItems:u},`repeating-group-${o.id}-${c}`):o.type===wt.group?s.jsx(pk,{formState:t,context:n,item:o,responseItem:u[0]},`group-${o.id}-${c}`):o.type===wt.boolean?s.jsx(Xh,{formState:t,context:n,item:o,responseItem:u[0],index:0},`boolean-item-${o.id}-${c}`):o.repeats?s.jsx(gY,{formState:t,context:n,item:o,responseItem:u[0]},`repeating-item-${o.id}-${c}`):s.jsx(It,{htmlFor:o.linkId,title:o.text,withAsterisk:o.required,children:s.jsx(Xh,{formState:t,context:n,item:o,responseItem:u[0],index:0})},`repeating-item-${o.id}-${c}`)})})}function vY(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:i}=e,o=t.pages,c=t.activePage,u=c>0,f=c<o.length-1,h=c===o.length-1;return s.jsxs(s.Fragment,{children:[s.jsx(gc,{active:c,allowNextStepsSelect:!1,p:6,children:o.map((m,g)=>s.jsx(gc.Step,{label:m.title,children:g===c&&i},m.linkId))}),!r&&s.jsxs(je,{justify:"flex-end",mt:"xl",gap:"xs",children:[u&&s.jsx(Pe,{onClick:t.onPrevPage,children:"Back"}),f&&s.jsx(Pe,{onClick:m=>{m.currentTarget.closest("form").reportValidity()&&t.onNextPage()},children:"Next"}),h&&s.jsx(xr,{children:n??"Submit"})]})]})}function mk(e){const t=Ae(),[n,r]=y.useState(!1),i=y.useRef(e);i.current=e;const o=y.useCallback(g=>{var v,b;r(!1),(b=(v=i.current).onChange)==null||b.call(v,g)},[]),c=sF({questionnaire:e.questionnaire,defaultValue:e.questionnaireResponse,subject:e.subject,encounter:e.encounter,source:e.source,disablePagination:e.disablePagination,onChange:o}),u=y.useRef(c);u.current=c;const f=y.useMemo(()=>c.loading?!1:!!ha(c.questionnaire,GV),[c]),h=y.useMemo(()=>{var g;return c.loading?!1:!!((g=c.questionnaireResponse.extension)!=null&&g.find(v=>v.url===Sh))},[c]),m=y.useCallback(()=>{const g=u.current;if(g.loading)return;const v=i.current.onSubmit;if(!v)return;if(f&&!h){r(!0);return}const b=g.questionnaire,S=g.questionnaireResponse,w=i.current.subject;let C=i.current.source;if(!C){const E=t.getProfile();E&&(C=nn(E))}v({...S,questionnaire:b.url??zt(b),subject:w,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,h]);return c.loading?null:s.jsxs(pt,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&s.jsx(Le,{children:c.questionnaire.title}),c.pagination?s.jsx(vY,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:s.jsx(tx,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):s.jsxs(s.Fragment,{children:[s.jsx(tx,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&s.jsxs(qe,{mt:"md",gap:0,children:[s.jsx(_e,{size:"sm",fw:500,children:"Signature"}),s.jsx(pY,{onChange:c.onChangeSignature}),!h&&n&&s.jsx(_e,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&s.jsx(je,{justify:"flex-end",mt:"xl",gap:"xs",children:s.jsx(xr,{children:e.submitButtonText??"Submit"})})]})]})}const yY="_section_4m5it_1",xY={section:yY},bY=["gender","age","gestationalAge","context","appliesTo","category"],SY={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function wY(e){e=Object.assign(SY,e);const t=e.definition,[n,r]=y.useState([]),[i,o]=y.useState(1),[c,u]=y.useState(1);return y.useEffect(()=>{const S=EY(t,u);r(TY(S.qualifiedInterval||[],o))},[t]),s.jsxs(pt,{testid:"reference-range-editor",onSubmit:f,children:[s.jsx(qe,{children:n.map(S=>{var w;return s.jsx(jY,{unit:_Y((w=t.quantitativeDetails)==null?void 0:w.unit),onChange:g,onAdd:v,onRemove:b,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`)})}),s.jsx(An,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{pn(S),h({id:`group-id-${i}`,filters:{},intervals:[]}),o(w=>w+1)},children:s.jsx(Gh,{})}),s.jsx(je,{justify:"flex-end",children:s.jsx(xr,{children:"Save"})})]});function f(){const S=n.flatMap(w=>w.intervals).filter(w=>!DY(w));e.onSubmit({...t,qualifiedInterval:S})}function h(S){r(w=>[...w,S])}function m(S){r(w=>w.filter(C=>C.id!==S.id))}function g(S,w){r(C=>{C=[...C];const E=C.find(T=>T.id===S),_=E==null?void 0:E.intervals.findIndex(T=>T.id===w.id);return _!==void 0&&(E!=null&&E.intervals[_])&&(E.intervals[_]=w),C})}function v(S,w){w.id===void 0&&(w.id=`id-${c}`,u(C=>C+1)),r(C=>{C=[...C];const E=C.findIndex(_=>_.id===S);if(E!==-1){const _={...C[E]};w={...w,..._.filters},_.intervals=[..._.intervals,w],C[E]=_}return C})}function b(S,w){r(C=>{C=[...C];const E=C.find(_=>_.id===S);return E&&(E.intervals=E.intervals.filter(_=>_.id!==w.id)),C})}}function jY(e){const{intervalGroup:t,unit:n}=e;return s.jsx(Lc,{"data-testid":t.id,className:xY.section,children:s.jsxs(qe,{gap:"lg",children:[s.jsx(je,{justify:"flex-end",children:s.jsx(An,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{pn(r),e.onRemoveGroup(t)},children:s.jsx(qh,{})},`remove-group-button-${t.id}`)}),s.jsx(CY,{intervalGroup:t,onChange:e.onChange}),s.jsx(Cn,{}),t.intervals.map(r=>s.jsxs(qe,{gap:"xs",children:[s.jsxs(je,{children:[s.jsx($e,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:i=>{pn(i),e.onChange(t.id,{...r,condition:i.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(An,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:i=>{pn(i),e.onRemove(t.id,r)},children:s.jsx(qh,{})},`remove-interval-${r.id}`)]}),s.jsx(Mb,{path:"",onChange:i=>{e.onChange(t.id,{...r,range:i})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(An,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{pn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(Gh,{})})]})})}function CY(e){var r,i;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const o of["low","high"])(r=t.filters.age[o])!=null&&r.unit||(t.filters.age[o]={...t.filters.age[o],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(qe,{style:{maxWidth:"50%"},children:[s.jsx(je,{children:s.jsx(ln,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""&&(u=void 0),n(t.id,{...c,gender:u})}}})}),s.jsxs(je,{gap:"xs",children:[s.jsx(_e,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Mb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:o=>{for(const c of t.intervals)n(t.id,{...c,age:o})}},`age-${t.id}`)})]}),s.jsx(ln,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((i=t.filters.context)==null?void 0:i.text)||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""?(u=void 0,n(t.id,{...c,context:void 0})):n(t.id,{...c,context:{text:u,coding:[{code:u,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(ln,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:o=>{for(const c of t.intervals){const u=o.currentTarget.value;u===""?n(t.id,{...c,category:void 0}):n(t.id,{...c,category:u})}}})]})}function EY(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(i=>{var c;const o=parseInt(((c=i.id)==null?void 0:c.substring(3))||"",10);return isNaN(o)?Number.NEGATIVE_INFINITY:o}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(i=>({...i,id:i.id||`id-${r++}`}))},t(r),e}function TY(e,t){let n=1;const r={};for(const i of e){const o=RY(i);o in r||(r[o]={id:`group-id-${n++}`,filters:Object.fromEntries(bY.map(c=>[c,i[c]])),intervals:[]}),r[o].intervals.push(i)}return t(n),Object.values(r)}function RY(e){var n,r;return[`gender=${e.gender}`,`age=${sd(e.age)}`,`gestationalAge=${sd(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(i=>i.text).join("+")}`,`category=${e.category}`].join(":")}function _Y(e){return e&&(dU(e,"http://unitsofmeasure.org")||e.text)}function DY(e){var t,n,r,i;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((i=(r=e.range)==null?void 0:r.high)==null?void 0:i.value)===void 0}function AY(e){var h;const t=Ae(),n=Wt(e.value),[r,i]=y.useState(!1),[o,c]=y.useState();if(y.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(c).catch(console.log),i(!0))},[t,n,r]),!n||!o)return null;return s.jsx(or,{children:(h=n.action)==null?void 0:h.map((m,g)=>{var w,C,E,_,T,R;const v=m.resource&&f(m.resource),b=(C=(w=v==null?void 0:v.input)==null?void 0:w[0])==null?void 0:C.valueReference,S=(_=(E=v==null?void 0:v.output)==null?void 0:E[0])==null?void 0:_.valueReference;return s.jsxs(y.Fragment,{children:[s.jsx(or.Col,{span:1,p:"md",children:(v==null?void 0:v.status)==="completed"?s.jsx(kF,{}):s.jsx(nH,{color:"gray"})}),s.jsxs(or.Col,{span:9,p:"xs",children:[s.jsx(_e,{fw:500,children:m.title}),m.description&&s.jsx("div",{children:m.description}),s.jsxs("div",{children:["Last edited by ",s.jsx($c,{value:(T=v==null?void 0:v.meta)==null?void 0:T.author})," on ",gr((R=v==null?void 0:v.meta)==null?void 0:R.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(um,{status:(v==null?void 0:v.status)||"unknown"})]})]}),s.jsxs(or.Col,{span:2,p:"md",children:[b&&!S&&s.jsx(Pe,{onClick:()=>e.onStart(v,b),children:"Start"}),b&&S&&s.jsx(Pe,{onClick:()=>e.onEdit(v,b,S),children:"Edit"})]})]},`action-${g}`)})});function u(m){var v;const g=[];if(m.action)for(const b of m.action)(v=b.resource)!=null&&v.reference&&g.push({request:{method:"GET",url:b.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:g}}function f(m){for(const g of(o==null?void 0:o.entry)??[])if(g.resource&&m.reference===zt(g.resource))return g.resource}}function gk(e,t){const n=kY(e,t);return PY(n,e,t)}function kY(e,t){const n=e.length,r=t.length,i=n+r+1,o=1+2*i,c=o/2|0,u=new Array(o);u[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<i;f++){for(let h=-f;h<=f;h+=2){const m=c+h,g=m+1,v=m-1,b=u[g],S=u[v];let w,C=0;h===-f||h!==f&&S.i<b.i?(C=b.i,w=b):(C=S.i+1,w=S),u[v]=void 0;let E=C-h,_={i:C,j:E,prev:NY(w),snake:!1};for(;C<n&&E<r&&e[C]===t[E];)C++,E++;if(C>_.i&&(_={i:C,j:E,prev:_,snake:!0}),u[m]=_,C>=n&&E>=r)return u[m]}u[c+f-1]=void 0}}function PY(e,t,n){const r=[];let i=e;for(i.snake&&(i=i.prev);i!=null&&i.prev&&i.prev.j>=0;){const o=i.i,c=i.j;i=i.prev;const u=i.i,f=i.j,h={position:u,lines:t.slice(u,o)},m={position:f,lines:n.slice(f,c)};let g;h.lines.length===0&&m.lines.length>0?g="insert":h.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:h,revised:m,type:g}),i.snake&&(i=i.prev)}return r}function NY(e){return e&&!e.snake&&e.prev?e.prev:e}function OY(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>{var i;return{meta:(i=r.resource)==null?void 0:i.meta,lines:Ii(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,i)=>r.meta.lastUpdated.localeCompare(i.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 MY(n,t),IY(n),n}function MY(e,t){for(let n=1;n<t.length;n++){const r=gk(t[n-1].lines,t[n].lines);for(const i of r){const o=i.original.position,c=i.original.lines,u=i.revised.lines;if((i.type==="delete"||i.type==="change")&&e.splice(o,c.length),i.type==="insert"||i.type==="change")for(let f=0;f<i.revised.lines.length;f++)e.splice(o+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:u[f],span:1})}}}function IY(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 LY="_container_1oj0p_1",$Y="_root_1oj0p_5",zY="_startRow_1oj0p_20",UY="_normalRow_1oj0p_24",BY="_author_1oj0p_28",VY="_dateTime_1oj0p_32",FY="_lineNumber_1oj0p_37",HY="_line_1oj0p_37",qY="_pre_1oj0p_52",Ia={container:LY,root:$Y,startRow:zY,normalRow:UY,author:BY,dateTime:VY,lineNumber:FY,line:HY,pre:qY};function GY(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function WY(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Jl(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Jl(r,"month");const i=Math.floor(t/86400);if(i>0)return Jl(i,"day");const o=Math.floor(t/3600);if(o>0)return Jl(o,"hour");const c=Math.floor(t/60);return c>0?Jl(c,"minute"):Jl(t,"second")}function Jl(e,t){return`${e} ${e===1?t:t+"s"} ago`}function QY(e){var c,u;const t=Ae(),[n,r]=y.useState(e.history);if(y.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const i=(u=(c=n.entry)==null?void 0:c[0])==null?void 0:u.resource;if(!i)return null;const o=OY(n);return s.jsx("div",{className:Ia.container,children:s.jsx("table",{className:Ia.root,children:s.jsx("tbody",{children:o.map((f,h)=>s.jsxs("tr",{className:f.span>0?Ia.startRow:Ia.normalRow,children:[f.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:Ia.author,rowSpan:f.span,children:s.jsx(sc,{value:f.meta.author,link:!0})}),s.jsx("td",{className:Ia.dateTime,rowSpan:f.span,children:s.jsx(mt,{to:GY(i,f.meta.versionId),children:WY(f.meta.lastUpdated)})})]}),s.jsx("td",{className:Ia.lineNumber,children:h+1}),s.jsx("td",{className:Ia.line,children:s.jsx("pre",{className:Ia.pre,children:f.value})})]},"row-"+h))})})})}const YY="_removed_el5zk_1",XY="_added_el5zk_6",hT={removed:YY,added:XY};function KY(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Ii(t,!0).match(/[^\r\n]+/g),i=Ii(n,!0).match(/[^\r\n]+/g),o=gk(r,i);return s.jsx("pre",{style:{color:"gray"},children:o.map((c,u)=>s.jsx(ZY,{delta:c},"delta"+u))})}function ZY(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:hT.removed,children:e.delta.original.lines.join(`
540
- `)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:hT.added,children:e.delta.revised.lines.join(`
541
- `)}),"...",s.jsx("br",{})]})}const JY="_splitButton_1i0gi_1",eX="_menuControl_1i0gi_6",pT={splitButton:JY,menuControl:eX};function Jh(e){const{outcome:t}=e,n=Ae(),r=Wt(e.defaultValue),i=r==null?void 0:r.resourceType,[o,c]=y.useState(!1),[u,f]=y.useState(),h=n.getAccessPolicy(),m=Sn();y.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=Nc(b);if(S){c(!0);const w=NV(r,S);f(w)}else console.error(`Schema not found for ${b}`)}).catch(S=>{console.error("Error in requestProfileSchema",S)})}else n.requestSchema(i).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,i,e.profileUrl]);const g=y.useMemo(()=>r&&FD(r,Os.READ,h),[h,r]),v=y.useMemo(()=>n.isSuperAdmin()||!h||!Tn(u==null?void 0:u.resourceType)?!0:MB(h,u==null?void 0:u.resourceType),[n,h,u==null?void 0:u.resourceType]);return!o||!u?s.jsx("div",{children:"Loading..."}):v?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[s.jsxs(qe,{mb:"xl",children:[s.jsx(It,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx($e,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),s.jsx(It,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx($e,{name:"id",defaultValue:u.id,disabled:!0})})]}),s.jsx($b,{path:u.resourceType,valuePath:u.resourceType,typeName:i,defaultValue:u,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),s.jsxs(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[s.jsx(Pe,{type:"submit",className:Ut((e.onPatch||e.onDelete)&&pT.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&s.jsxs(Ce,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[s.jsx(Ce.Target,{children:s.jsx(An,{variant:"filled",color:m.primaryColor,size:36,className:pT.menuControl,"aria-label":"More actions",children:s.jsx(jb,{size:14,stroke:1.5})})}),s.jsxs(Ce.Dropdown,{children:[e.onPatch&&s.jsx(Ce.Item,{leftSection:s.jsx(pA,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&s.jsx(Ce.Item,{color:"red",leftSection:s.jsx(am,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):s.jsxs(Ka,{color:"red",title:"Permission denied",icon:s.jsx(il,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function tX(e){var i;const t=Ae(),[n,r]=y.useState(e.history);return y.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?s.jsxs(ye,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(ye.Thead,{children:s.jsxs(ye.Tr,{children:[s.jsx(ye.Th,{children:"Author"}),s.jsx(ye.Th,{children:"Date"}),s.jsx(ye.Th,{children:"Version"})]})}),s.jsx(ye.Tbody,{children:(i=n.entry)==null?void 0:i.map((o,c)=>s.jsx(nX,{entry:o},"entry-"+c))})]}):s.jsx("div",{children:"Loading..."})}function nX(e){var r,i,o;const{response:t,resource:n}=e.entry;return n?s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:s.jsx(sc,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(ye.Td,{children:gr((i=n.meta)==null?void 0:i.lastUpdated)}),s.jsx(ye.Td,{children:s.jsx(mt,{to:rX(n),children:(o=n.meta)==null?void 0:o.versionId})})]}):s.jsx(ye.Tr,{children:s.jsx(ye.Td,{colSpan:3,children:Ye(t==null?void 0:t.outcome)})})}function rX(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function iX(e){const{serviceRequest:t,...n}=e;return s.jsx(dm,{value:t,loadTimelineResources:async(r,i,o)=>{const c=`${i}/${o}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",o),r.search("Communication",{"based-on":c,_count:u}),r.search("DiagnosticReport",{"based-on":c,_count:u}),r.search("Media",{"based-on":c,_count:u}),r.search("DocumentReference",{related:c,_count:u}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:u})])},createCommunication:(r,i,o)=>({resourceType:"Communication",status:"completed",basedOn:[nn(r)],subject:r.subject,sender:nn(i),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,i,o)=>({resourceType:"Media",status:"completed",basedOn:[nn(r)],subject:r.subject,operator:nn(i),issued:new Date().toISOString(),content:o}),...n})}function aX(e){const t=Ae(),{client:n,patient:r,encounter:i,children:o,...c}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:i}).then(f=>{const h=new URL(n.launchUri);h.searchParams.set("iss",ob(t.fhirUrl().toString())),h.searchParams.set("launch",f.id),window.location.assign(h.toString())}).catch(f=>Oe({color:"red",message:Ye(f),autoClose:!1}))}return s.jsx(Nt,{onClick:()=>u(),...c,children:o})}var oy={exports:{}},Uu={},sy={exports:{}},ly={};/**
542
- * @license React
543
- * scheduler.production.js
544
- *
545
- * Copyright (c) Meta Platforms, Inc. and affiliates.
546
- *
547
- * This source code is licensed under the MIT license found in the
548
- * LICENSE file in the root directory of this source tree.
549
- */var mT;function oX(){return mT||(mT=1,function(e){function t(P,L){var $=P.length;P.push(L);e:for(;0<$;){var H=$-1>>>1,O=P[H];if(0<i(O,L))P[H]=L,P[$]=O,$=H;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var L=P[0],$=P.pop();if($!==L){P[0]=$;e:for(var H=0,O=P.length,U=O>>>1;H<U;){var K=2*(H+1)-1,ee=P[K],Se=K+1,be=P[Se];if(0>i(ee,$))Se<O&&0>i(be,ee)?(P[H]=be,P[Se]=$,H=Se):(P[H]=ee,P[K]=$,H=K);else if(Se<O&&0>i(be,$))P[H]=be,P[Se]=$,H=Se;else break e}}return L}function i(P,L){var $=P.sortIndex-L.sortIndex;return $!==0?$:P.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,g=null,v=3,b=!1,S=!1,w=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function R(P){for(var L=n(h);L!==null;){if(L.callback===null)r(h);else if(L.startTime<=P)r(h),L.sortIndex=L.expirationTime,t(f,L);else break;L=n(h)}}function D(P){if(w=!1,R(P),!S)if(n(f)!==null)S=!0,k||(k=!0,W());else{var L=n(h);L!==null&&X(D,L.startTime-P)}}var k=!1,M=-1,I=5,z=-1;function V(){return C?!0:!(e.unstable_now()-z<I)}function Y(){if(C=!1,k){var P=e.unstable_now();z=P;var L=!0;try{e:{S=!1,w&&(w=!1,_(M),M=-1),b=!0;var $=v;try{t:{for(R(P),g=n(f);g!==null&&!(g.expirationTime>P&&V());){var H=g.callback;if(typeof H=="function"){g.callback=null,v=g.priorityLevel;var O=H(g.expirationTime<=P);if(P=e.unstable_now(),typeof O=="function"){g.callback=O,R(P),L=!0;break t}g===n(f)&&r(f),R(P)}else r(f);g=n(f)}if(g!==null)L=!0;else{var U=n(h);U!==null&&X(D,U.startTime-P),L=!1}}break e}finally{g=null,v=$,b=!1}L=void 0}}finally{L?W():k=!1}}}var W;if(typeof T=="function")W=function(){T(Y)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,G=J.port2;J.port1.onmessage=Y,W=function(){G.postMessage(null)}}else W=function(){E(Y,0)};function X(P,L){M=E(function(){P(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(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(P){switch(v){case 1:case 2:case 3:var L=3;break;default:L=v}var $=v;v=L;try{return P()}finally{v=$}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(P,L){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var $=v;v=P;try{return L()}finally{v=$}},e.unstable_scheduleCallback=function(P,L,$){var H=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?H+$:H):$=H,P){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=$+O,P={id:m++,callback:L,priorityLevel:P,startTime:$,expirationTime:O,sortIndex:-1},$>H?(P.sortIndex=$,t(h,P),n(f)===null&&P===n(h)&&(w?(_(M),M=-1):w=!0,X(D,$-H))):(P.sortIndex=O,t(f,P),S||b||(S=!0,k||(k=!0,W()))),P},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(P){var L=v;return function(){var $=v;v=L;try{return P.apply(this,arguments)}finally{v=$}}}}(ly)),ly}var gT;function sX(){return gT||(gT=1,sy.exports=oX()),sy.exports}/**
550
- * @license React
551
- * react-dom-client.production.js
552
- *
553
- * Copyright (c) Meta Platforms, Inc. and affiliates.
554
- *
555
- * This source code is licensed under the MIT license found in the
556
- * LICENSE file in the root directory of this source tree.
557
- */var vT;function lX(){if(vT)return Uu;vT=1;var e=sX(),t=px(),n=zR();function r(a){var l="https://react.dev/errors/"+a;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var l=a,d=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,(l.flags&4098)!==0&&(d=l.return),a=l.return;while(a)}return l.tag===3?d:null}function c(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function u(a){if(o(a)!==a)throw Error(r(188))}function f(a){var l=a.alternate;if(!l){if(l=o(a),l===null)throw Error(r(188));return l!==a?null:a}for(var d=a,p=l;;){var x=d.return;if(x===null)break;var j=x.alternate;if(j===null){if(p=x.return,p!==null){d=p;continue}break}if(x.child===j.child){for(j=x.child;j;){if(j===d)return u(x),a;if(j===p)return u(x),l;j=j.sibling}throw Error(r(188))}if(d.return!==p.return)d=x,p=j;else{for(var A=!1,N=x.child;N;){if(N===d){A=!0,d=x,p=j;break}if(N===p){A=!0,p=x,d=j;break}N=N.sibling}if(!A){for(N=j.child;N;){if(N===d){A=!0,d=j,p=x;break}if(N===p){A=!0,p=j,d=x;break}N=N.sibling}if(!A)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:l}function h(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a;for(a=a.child;a!==null;){if(l=h(a),l!==null)return l;a=a.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),_=Symbol.for("react.consumer"),T=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function W(a){return a===null||typeof a!="object"?null:(a=Y&&a[Y]||a["@@iterator"],typeof a=="function"?a:null)}var J=Symbol.for("react.client.reference");function G(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===J?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case D:return"Suspense";case k:return"SuspenseList";case z:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case b:return"Portal";case T:return(a.displayName||"Context")+".Provider";case _:return(a._context.displayName||"Context")+".Consumer";case R:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case M:return l=a.displayName||null,l!==null?l:G(a.type)||"Memo";case I:l=a._payload,a=a._init;try{return G(a(l))}catch{}}return null}var X=Array.isArray,P=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,$={pending:!1,data:null,method:null,action:null},H=[],O=-1;function U(a){return{current:a}}function K(a){0>O||(a.current=H[O],H[O]=null,O--)}function ee(a,l){O++,H[O]=a.current,a.current=l}var Se=U(null),be=U(null),xe=U(null),Ge=U(null);function Me(a,l){switch(ee(xe,l),ee(be,a),ee(Se,null),l.nodeType){case 9:case 11:a=(a=l.documentElement)&&(a=a.namespaceURI)?mj(a):0;break;default:if(a=l.tagName,l=l.namespaceURI)l=mj(l),a=gj(l,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}K(Se),ee(Se,a)}function tt(){K(Se),K(be),K(xe)}function ke(a){a.memoizedState!==null&&ee(Ge,a);var l=Se.current,d=gj(l,a.type);l!==d&&(ee(be,a),ee(Se,d))}function vt(a){be.current===a&&(K(Se),K(be)),Ge.current===a&&(K(Ge),Du._currentValue=$)}var Lt=Object.prototype.hasOwnProperty,$t=e.unstable_scheduleCallback,gt=e.unstable_cancelCallback,At=e.unstable_shouldYield,rn=e.unstable_requestPaint,Ee=e.unstable_now,De=e.unstable_getCurrentPriorityLevel,We=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,me=e.unstable_NormalPriority,ge=e.unstable_LowPriority,Ne=e.unstable_IdlePriority,we=e.log,ze=e.unstable_setDisableYieldValue,yt=null,ft=null;function Gt(a){if(typeof we=="function"&&ze(a),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(yt,a)}catch{}}var kt=Math.clz32?Math.clz32:Fi,un=Math.log,jt=Math.LN2;function Fi(a){return a>>>=0,a===0?32:31-(un(a)/jt|0)|0}var Si=256,ga=4194304;function Vn(a){var l=a&42;if(l!==0)return l;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function wi(a,l,d){var p=a.pendingLanes;if(p===0)return 0;var x=0,j=a.suspendedLanes,A=a.pingedLanes;a=a.warmLanes;var N=p&134217727;return N!==0?(p=N&~j,p!==0?x=Vn(p):(A&=N,A!==0?x=Vn(A):d||(d=N&~a,d!==0&&(x=Vn(d))))):(N=p&~j,N!==0?x=Vn(N):A!==0?x=Vn(A):d||(d=p&~a,d!==0&&(x=Vn(d)))),x===0?0:l!==0&&l!==x&&(l&j)===0&&(j=x&-x,d=l&-l,j>=d||j===32&&(d&4194048)!==0)?l:x}function Kr(a,l){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&l)===0}function cl(a,l){switch(a){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 va(){var a=Si;return Si<<=1,(Si&4194048)===0&&(Si=256),a}function ro(){var a=ga;return ga<<=1,(ga&62914560)===0&&(ga=4194304),a}function Hi(a){for(var l=[],d=0;31>d;d++)l.push(a);return l}function br(a,l){a.pendingLanes|=l,l!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function qn(a,l,d,p,x,j){var A=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var N=a.entanglements,B=a.expirationTimes,ne=a.hiddenUpdates;for(d=A&~d;0<d;){var de=31-kt(d),pe=1<<de;N[de]=0,B[de]=-1;var ie=ne[de];if(ie!==null)for(ne[de]=null,de=0;de<ie.length;de++){var oe=ie[de];oe!==null&&(oe.lane&=-536870913)}d&=~pe}p!==0&&ya(a,p,0),j!==0&&x===0&&a.tag!==0&&(a.suspendedLanes|=j&~(A&~l))}function ya(a,l,d){a.pendingLanes|=l,a.suspendedLanes&=~l;var p=31-kt(l);a.entangledLanes|=l,a.entanglements[p]=a.entanglements[p]|1073741824|d&4194090}function io(a,l){var d=a.entangledLanes|=l;for(a=a.entanglements;d;){var p=31-kt(d),x=1<<p;x&l|a[p]&l&&(a[p]|=l),d&=~x}}function ts(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function ns(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function F(){var a=L.p;return a!==0?a:(a=window.event,a===void 0?32:Mj(a.type))}function Z(a,l){var d=L.p;try{return L.p=a,l()}finally{L.p=d}}var re=Math.random().toString(36).slice(2),he="__reactFiber$"+re,Te="__reactProps$"+re,Be="__reactContainer$"+re,nt="__reactEvents$"+re,Ue="__reactListeners$"+re,Ze="__reactHandles$"+re,Je="__reactResources$"+re,it="__reactMarker$"+re;function Xe(a){delete a[he],delete a[Te],delete a[nt],delete a[Ue],delete a[Ze]}function st(a){var l=a[he];if(l)return l;for(var d=a.parentNode;d;){if(l=d[Be]||d[he]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(a=bj(a);a!==null;){if(d=a[he])return d;a=bj(a)}return l}a=d,d=a.parentNode}return null}function Ke(a){if(a=a[he]||a[Be]){var l=a.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return a}return null}function Qt(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a.stateNode;throw Error(r(33))}function dn(a){var l=a[Je];return l||(l=a[Je]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Pt(a){a[it]=!0}var Rt=new Set,ao={};function ur(a,l){Zr(a,l),Zr(a+"Capture",l)}function Zr(a,l){for(ao[a]=l,a=0;a<l.length;a++)Rt.add(l[a])}var Sr=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]*$"),oo={},so={};function Uc(a){return Lt.call(so,a)?!0:Lt.call(oo,a)?!1:Sr.test(a)?so[a]=!0:(oo[a]=!0,!1)}function Jr(a,l,d){if(Uc(l))if(d===null)a.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(l);return}}a.setAttribute(l,""+d)}}function xa(a,l,d){if(d===null)a.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttribute(l,""+d)}}function Ct(a,l,d,p){if(p===null)a.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(l,d,""+p)}}var nr,ji;function Ci(a){if(nr===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);nr=l&&l[1]||"",ji=-1<d.stack.indexOf(`
558
- at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
559
- `+nr+a+ji}var rs=!1;function xn(a,l){if(!a||rs)return"";rs=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(oe){var ie=oe}Reflect.construct(a,[],pe)}else{try{pe.call()}catch(oe){ie=oe}a.call(pe.prototype)}}else{try{throw Error()}catch(oe){ie=oe}(pe=a())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(oe){if(oe&&ie&&typeof oe.stack=="string")return[oe.stack,ie.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var j=p.DetermineComponentFrameRoot(),A=j[0],N=j[1];if(A&&N){var B=A.split(`
560
- `),ne=N.split(`
561
- `);for(x=p=0;p<B.length&&!B[p].includes("DetermineComponentFrameRoot");)p++;for(;x<ne.length&&!ne[x].includes("DetermineComponentFrameRoot");)x++;if(p===B.length||x===ne.length)for(p=B.length-1,x=ne.length-1;1<=p&&0<=x&&B[p]!==ne[x];)x--;for(;1<=p&&0<=x;p--,x--)if(B[p]!==ne[x]){if(p!==1||x!==1)do if(p--,x--,0>x||B[p]!==ne[x]){var de=`
562
- `+B[p].replace(" at new "," at ");return a.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",a.displayName)),de}while(1<=p&&0<=x);break}}}finally{rs=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Ci(d):""}function lo(a){switch(a.tag){case 26:case 27:case 5:return Ci(a.type);case 16:return Ci("Lazy");case 13:return Ci("Suspense");case 19:return Ci("SuspenseList");case 0:case 15:return xn(a.type,!1);case 11:return xn(a.type.render,!1);case 1:return xn(a.type,!0);case 31:return Ci("Activity");default:return""}}function Bc(a){try{var l="";do l+=lo(a),a=a.return;while(a);return l}catch(d){return`
563
- Error generating stack: `+d.message+`
564
- `+d.stack}}function wr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function u1(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function dP(a){var l=u1(a)?"checked":"value",d=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),p=""+a[l];if(!a.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,j=d.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return x.call(this)},set:function(A){p=""+A,j.call(this,A)}}),Object.defineProperty(a,l,{enumerable:d.enumerable}),{getValue:function(){return p},setValue:function(A){p=""+A},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function Vd(a){a._valueTracker||(a._valueTracker=dP(a))}function d1(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var d=l.getValue(),p="";return a&&(p=u1(a)?a.checked?"true":"false":a.value),a=p,a!==d?(l.setValue(a),!0):!1}function Fd(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var fP=/[\n"\\]/g;function ei(a){return a.replace(fP,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function xm(a,l,d,p,x,j,A,N){a.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?a.type=A:a.removeAttribute("type"),l!=null?A==="number"?(l===0&&a.value===""||a.value!=l)&&(a.value=""+wr(l)):a.value!==""+wr(l)&&(a.value=""+wr(l)):A!=="submit"&&A!=="reset"||a.removeAttribute("value"),l!=null?bm(a,A,wr(l)):d!=null?bm(a,A,wr(d)):p!=null&&a.removeAttribute("value"),x==null&&j!=null&&(a.defaultChecked=!!j),x!=null&&(a.checked=x&&typeof x!="function"&&typeof x!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.name=""+wr(N):a.removeAttribute("name")}function f1(a,l,d,p,x,j,A,N){if(j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(a.type=j),l!=null||d!=null){if(!(j!=="submit"&&j!=="reset"||l!=null))return;d=d!=null?""+wr(d):"",l=l!=null?""+wr(l):d,N||l===a.value||(a.value=l),a.defaultValue=l}p=p??x,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=N?a.checked:!!p,a.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(a.name=A)}function bm(a,l,d){l==="number"&&Fd(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function ul(a,l,d,p){if(a=a.options,l){l={};for(var x=0;x<d.length;x++)l["$"+d[x]]=!0;for(d=0;d<a.length;d++)x=l.hasOwnProperty("$"+a[d].value),a[d].selected!==x&&(a[d].selected=x),x&&p&&(a[d].defaultSelected=!0)}else{for(d=""+wr(d),l=null,x=0;x<a.length;x++){if(a[x].value===d){a[x].selected=!0,p&&(a[x].defaultSelected=!0);return}l!==null||a[x].disabled||(l=a[x])}l!==null&&(l.selected=!0)}}function h1(a,l,d){if(l!=null&&(l=""+wr(l),l!==a.value&&(a.value=l),d==null)){a.defaultValue!==l&&(a.defaultValue=l);return}a.defaultValue=d!=null?""+wr(d):""}function p1(a,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(X(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=wr(l),a.defaultValue=d,p=a.textContent,p===d&&p!==""&&p!==null&&(a.value=p)}function dl(a,l){if(l){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=l;return}}a.textContent=l}var hP=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 m1(a,l,d){var p=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?p?a.setProperty(l,""):l==="float"?a.cssFloat="":a[l]="":p?a.setProperty(l,d):typeof d!="number"||d===0||hP.has(l)?l==="float"?a.cssFloat=d:a[l]=(""+d).trim():a[l]=d+"px"}function g1(a,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(a=a.style,d!=null){for(var p in d)!d.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?a.setProperty(p,""):p==="float"?a.cssFloat="":a[p]="");for(var x in l)p=l[x],l.hasOwnProperty(x)&&d[x]!==p&&m1(a,x,p)}else for(var j in l)l.hasOwnProperty(j)&&m1(a,j,l[j])}function Sm(a){if(a.indexOf("-")===-1)return!1;switch(a){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 pP=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"]]),mP=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hd(a){return mP.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var wm=null;function jm(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var fl=null,hl=null;function v1(a){var l=Ke(a);if(l&&(a=l.stateNode)){var d=a[Te]||null;e:switch(a=l.stateNode,l.type){case"input":if(xm(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),l=d.name,d.type==="radio"&&l!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+ei(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==a&&p.form===a.form){var x=p[Te]||null;if(!x)throw Error(r(90));xm(p,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<d.length;l++)p=d[l],p.form===a.form&&d1(p)}break e;case"textarea":h1(a,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&ul(a,!!d.multiple,l,!1)}}}var Cm=!1;function y1(a,l,d){if(Cm)return a(l,d);Cm=!0;try{var p=a(l);return p}finally{if(Cm=!1,(fl!==null||hl!==null)&&(Af(),fl&&(l=fl,a=hl,hl=fl=null,v1(l),a)))for(l=0;l<a.length;l++)v1(a[l])}}function Vc(a,l){var d=a.stateNode;if(d===null)return null;var p=d[Te]||null;if(p===null)return null;d=p[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":(p=!p.disabled)||(a=a.type,p=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!p;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Em=!1;if(ba)try{var Fc={};Object.defineProperty(Fc,"passive",{get:function(){Em=!0}}),window.addEventListener("test",Fc,Fc),window.removeEventListener("test",Fc,Fc)}catch{Em=!1}var co=null,Tm=null,qd=null;function x1(){if(qd)return qd;var a,l=Tm,d=l.length,p,x="value"in co?co.value:co.textContent,j=x.length;for(a=0;a<d&&l[a]===x[a];a++);var A=d-a;for(p=1;p<=A&&l[d-p]===x[j-p];p++);return qd=x.slice(a,1<p?1-p:void 0)}function Gd(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Wd(){return!0}function b1(){return!1}function jr(a){function l(d,p,x,j,A){this._reactName=d,this._targetInst=x,this.type=p,this.nativeEvent=j,this.target=A,this.currentTarget=null;for(var N in a)a.hasOwnProperty(N)&&(d=a[N],this[N]=d?d(j):j[N]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?Wd:b1,this.isPropagationStopped=b1,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Wd)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Wd)},persist:function(){},isPersistent:Wd}),l}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qd=jr(is),Hc=m({},is,{view:0,detail:0}),gP=jr(Hc),Rm,_m,qc,Yd=m({},Hc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Am,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==qc&&(qc&&a.type==="mousemove"?(Rm=a.screenX-qc.screenX,_m=a.screenY-qc.screenY):_m=Rm=0,qc=a),Rm)},movementY:function(a){return"movementY"in a?a.movementY:_m}}),S1=jr(Yd),vP=m({},Yd,{dataTransfer:0}),yP=jr(vP),xP=m({},Hc,{relatedTarget:0}),Dm=jr(xP),bP=m({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),SP=jr(bP),wP=m({},is,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),jP=jr(wP),CP=m({},is,{data:0}),w1=jr(CP),EP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TP={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"},RP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _P(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=RP[a])?!!l[a]:!1}function Am(){return _P}var DP=m({},Hc,{key:function(a){if(a.key){var l=EP[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=Gd(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?TP[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Am,charCode:function(a){return a.type==="keypress"?Gd(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Gd(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),AP=jr(DP),kP=m({},Yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),j1=jr(kP),PP=m({},Hc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Am}),NP=jr(PP),OP=m({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),MP=jr(OP),IP=m({},Yd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),LP=jr(IP),$P=m({},is,{newState:0,oldState:0}),zP=jr($P),UP=[9,13,27,32],km=ba&&"CompositionEvent"in window,Gc=null;ba&&"documentMode"in document&&(Gc=document.documentMode);var BP=ba&&"TextEvent"in window&&!Gc,C1=ba&&(!km||Gc&&8<Gc&&11>=Gc),E1=" ",T1=!1;function R1(a,l){switch(a){case"keyup":return UP.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _1(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var pl=!1;function VP(a,l){switch(a){case"compositionend":return _1(l);case"keypress":return l.which!==32?null:(T1=!0,E1);case"textInput":return a=l.data,a===E1&&T1?null:a;default:return null}}function FP(a,l){if(pl)return a==="compositionend"||!km&&R1(a,l)?(a=x1(),qd=Tm=co=null,pl=!1,a):null;switch(a){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 C1&&l.locale!=="ko"?null:l.data;default:return null}}var HP={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 D1(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!HP[a.type]:l==="textarea"}function A1(a,l,d,p){fl?hl?hl.push(p):hl=[p]:fl=p,l=If(l,"onChange"),0<l.length&&(d=new Qd("onChange","change",null,d,p),a.push({event:d,listeners:l}))}var Wc=null,Qc=null;function qP(a){uj(a,0)}function Xd(a){var l=Qt(a);if(d1(l))return a}function k1(a,l){if(a==="change")return l}var P1=!1;if(ba){var Pm;if(ba){var Nm="oninput"in document;if(!Nm){var N1=document.createElement("div");N1.setAttribute("oninput","return;"),Nm=typeof N1.oninput=="function"}Pm=Nm}else Pm=!1;P1=Pm&&(!document.documentMode||9<document.documentMode)}function O1(){Wc&&(Wc.detachEvent("onpropertychange",M1),Qc=Wc=null)}function M1(a){if(a.propertyName==="value"&&Xd(Qc)){var l=[];A1(l,Qc,a,jm(a)),y1(qP,l)}}function GP(a,l,d){a==="focusin"?(O1(),Wc=l,Qc=d,Wc.attachEvent("onpropertychange",M1)):a==="focusout"&&O1()}function WP(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Xd(Qc)}function QP(a,l){if(a==="click")return Xd(l)}function YP(a,l){if(a==="input"||a==="change")return Xd(l)}function XP(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Ir=typeof Object.is=="function"?Object.is:XP;function Yc(a,l){if(Ir(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var d=Object.keys(a),p=Object.keys(l);if(d.length!==p.length)return!1;for(p=0;p<d.length;p++){var x=d[p];if(!Lt.call(l,x)||!Ir(a[x],l[x]))return!1}return!0}function I1(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function L1(a,l){var d=I1(a);a=0;for(var p;d;){if(d.nodeType===3){if(p=a+d.textContent.length,a<=l&&p>=l)return{node:d,offset:l-a};a=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=I1(d)}}function $1(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?$1(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function z1(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var l=Fd(a.document);l instanceof a.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)a=l.contentWindow;else break;l=Fd(a.document)}return l}function Om(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}var KP=ba&&"documentMode"in document&&11>=document.documentMode,ml=null,Mm=null,Xc=null,Im=!1;function U1(a,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Im||ml==null||ml!==Fd(p)||(p=ml,"selectionStart"in p&&Om(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Xc&&Yc(Xc,p)||(Xc=p,p=If(Mm,"onSelect"),0<p.length&&(l=new Qd("onSelect","select",null,l,d),a.push({event:l,listeners:p}),l.target=ml)))}function as(a,l){var d={};return d[a.toLowerCase()]=l.toLowerCase(),d["Webkit"+a]="webkit"+l,d["Moz"+a]="moz"+l,d}var gl={animationend:as("Animation","AnimationEnd"),animationiteration:as("Animation","AnimationIteration"),animationstart:as("Animation","AnimationStart"),transitionrun:as("Transition","TransitionRun"),transitionstart:as("Transition","TransitionStart"),transitioncancel:as("Transition","TransitionCancel"),transitionend:as("Transition","TransitionEnd")},Lm={},B1={};ba&&(B1=document.createElement("div").style,"AnimationEvent"in window||(delete gl.animationend.animation,delete gl.animationiteration.animation,delete gl.animationstart.animation),"TransitionEvent"in window||delete gl.transitionend.transition);function os(a){if(Lm[a])return Lm[a];if(!gl[a])return a;var l=gl[a],d;for(d in l)if(l.hasOwnProperty(d)&&d in B1)return Lm[a]=l[d];return a}var V1=os("animationend"),F1=os("animationiteration"),H1=os("animationstart"),ZP=os("transitionrun"),JP=os("transitionstart"),e4=os("transitioncancel"),q1=os("transitionend"),G1=new Map,$m="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(" ");$m.push("scrollEnd");function Ei(a,l){G1.set(a,l),ur(l,[a])}var W1=new WeakMap;function ti(a,l){if(typeof a=="object"&&a!==null){var d=W1.get(a);return d!==void 0?d:(l={value:a,source:l,stack:Bc(l)},W1.set(a,l),l)}return{value:a,source:l,stack:Bc(l)}}var ni=[],vl=0,zm=0;function Kd(){for(var a=vl,l=zm=vl=0;l<a;){var d=ni[l];ni[l++]=null;var p=ni[l];ni[l++]=null;var x=ni[l];ni[l++]=null;var j=ni[l];if(ni[l++]=null,p!==null&&x!==null){var A=p.pending;A===null?x.next=x:(x.next=A.next,A.next=x),p.pending=x}j!==0&&Q1(d,x,j)}}function Zd(a,l,d,p){ni[vl++]=a,ni[vl++]=l,ni[vl++]=d,ni[vl++]=p,zm|=p,a.lanes|=p,a=a.alternate,a!==null&&(a.lanes|=p)}function Um(a,l,d,p){return Zd(a,l,d,p),Jd(a)}function yl(a,l){return Zd(a,null,null,l),Jd(a)}function Q1(a,l,d){a.lanes|=d;var p=a.alternate;p!==null&&(p.lanes|=d);for(var x=!1,j=a.return;j!==null;)j.childLanes|=d,p=j.alternate,p!==null&&(p.childLanes|=d),j.tag===22&&(a=j.stateNode,a===null||a._visibility&1||(x=!0)),a=j,j=j.return;return a.tag===3?(j=a.stateNode,x&&l!==null&&(x=31-kt(d),a=j.hiddenUpdates,p=a[x],p===null?a[x]=[l]:p.push(l),l.lane=d|536870912),j):null}function Jd(a){if(50<Su)throw Su=0,Gg=null,Error(r(185));for(var l=a.return;l!==null;)a=l,l=a.return;return a.tag===3?a.stateNode:null}var xl={};function t4(a,l,d,p){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(a,l,d,p){return new t4(a,l,d,p)}function Bm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Sa(a,l){var d=a.alternate;return d===null?(d=Lr(a.tag,l,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=l,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&65011712,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,l=a.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function Y1(a,l){a.flags&=65011714;var d=a.alternate;return d===null?(a.childLanes=0,a.lanes=l,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=d.childLanes,a.lanes=d.lanes,a.child=d.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=d.memoizedProps,a.memoizedState=d.memoizedState,a.updateQueue=d.updateQueue,a.type=d.type,l=d.dependencies,a.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),a}function ef(a,l,d,p,x,j){var A=0;if(p=a,typeof a=="function")Bm(a)&&(A=1);else if(typeof a=="string")A=r3(a,d,Se.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case z:return a=Lr(31,d,l,x),a.elementType=z,a.lanes=j,a;case S:return ss(d.children,x,j,l);case w:A=8,x|=24;break;case C:return a=Lr(12,d,l,x|2),a.elementType=C,a.lanes=j,a;case D:return a=Lr(13,d,l,x),a.elementType=D,a.lanes=j,a;case k:return a=Lr(19,d,l,x),a.elementType=k,a.lanes=j,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case E:case T:A=10;break e;case _:A=9;break e;case R:A=11;break e;case M:A=14;break e;case I:A=16,p=null;break e}A=29,d=Error(r(130,a===null?"null":typeof a,"")),p=null}return l=Lr(A,d,l,x),l.elementType=a,l.type=p,l.lanes=j,l}function ss(a,l,d,p){return a=Lr(7,a,p,l),a.lanes=d,a}function Vm(a,l,d){return a=Lr(6,a,null,l),a.lanes=d,a}function Fm(a,l,d){return l=Lr(4,a.children!==null?a.children:[],a.key,l),l.lanes=d,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}var bl=[],Sl=0,tf=null,nf=0,ri=[],ii=0,ls=null,wa=1,ja="";function cs(a,l){bl[Sl++]=nf,bl[Sl++]=tf,tf=a,nf=l}function X1(a,l,d){ri[ii++]=wa,ri[ii++]=ja,ri[ii++]=ls,ls=a;var p=wa;a=ja;var x=32-kt(p)-1;p&=~(1<<x),d+=1;var j=32-kt(l)+x;if(30<j){var A=x-x%5;j=(p&(1<<A)-1).toString(32),p>>=A,x-=A,wa=1<<32-kt(l)+x|d<<x|p,ja=j+a}else wa=1<<j|d<<x|p,ja=a}function Hm(a){a.return!==null&&(cs(a,1),X1(a,1,0))}function qm(a){for(;a===tf;)tf=bl[--Sl],bl[Sl]=null,nf=bl[--Sl],bl[Sl]=null;for(;a===ls;)ls=ri[--ii],ri[ii]=null,ja=ri[--ii],ri[ii]=null,wa=ri[--ii],ri[ii]=null}var dr=null,_n=null,Ft=!1,us=null,qi=!1,Gm=Error(r(519));function ds(a){var l=Error(r(418,""));throw Jc(ti(l,a)),Gm}function K1(a){var l=a.stateNode,d=a.type,p=a.memoizedProps;switch(l[he]=a,l[Te]=p,d){case"dialog":Dt("cancel",l),Dt("close",l);break;case"iframe":case"object":case"embed":Dt("load",l);break;case"video":case"audio":for(d=0;d<ju.length;d++)Dt(ju[d],l);break;case"source":Dt("error",l);break;case"img":case"image":case"link":Dt("error",l),Dt("load",l);break;case"details":Dt("toggle",l);break;case"input":Dt("invalid",l),f1(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0),Vd(l);break;case"select":Dt("invalid",l);break;case"textarea":Dt("invalid",l),p1(l,p.value,p.defaultValue,p.children),Vd(l)}d=p.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||p.suppressHydrationWarning===!0||pj(l.textContent,d)?(p.popover!=null&&(Dt("beforetoggle",l),Dt("toggle",l)),p.onScroll!=null&&Dt("scroll",l),p.onScrollEnd!=null&&Dt("scrollend",l),p.onClick!=null&&(l.onclick=Lf),l=!0):l=!1,l||ds(a)}function Z1(a){for(dr=a.return;dr;)switch(dr.tag){case 5:case 13:qi=!1;return;case 27:case 3:qi=!0;return;default:dr=dr.return}}function Kc(a){if(a!==dr)return!1;if(!Ft)return Z1(a),Ft=!0,!1;var l=a.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||lv(a.type,a.memoizedProps)),d=!d),d&&_n&&ds(a),Z1(a),l===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8)if(d=a.data,d==="/$"){if(l===0){_n=Ri(a.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++;a=a.nextSibling}_n=null}}else l===27?(l=_n,To(a.type)?(a=fv,fv=null,_n=a):_n=l):_n=dr?Ri(a.stateNode.nextSibling):null;return!0}function Zc(){_n=dr=null,Ft=!1}function J1(){var a=us;return a!==null&&(Tr===null?Tr=a:Tr.push.apply(Tr,a),us=null),a}function Jc(a){us===null?us=[a]:us.push(a)}var Wm=U(null),fs=null,Ca=null;function uo(a,l,d){ee(Wm,l._currentValue),l._currentValue=d}function Ea(a){a._currentValue=Wm.current,K(Wm)}function Qm(a,l,d){for(;a!==null;){var p=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),a===d)break;a=a.return}}function Ym(a,l,d,p){var x=a.child;for(x!==null&&(x.return=a);x!==null;){var j=x.dependencies;if(j!==null){var A=x.child;j=j.firstContext;e:for(;j!==null;){var N=j;j=x;for(var B=0;B<l.length;B++)if(N.context===l[B]){j.lanes|=d,N=j.alternate,N!==null&&(N.lanes|=d),Qm(j.return,d,a),p||(A=null);break e}j=N.next}}else if(x.tag===18){if(A=x.return,A===null)throw Error(r(341));A.lanes|=d,j=A.alternate,j!==null&&(j.lanes|=d),Qm(A,d,a),A=null}else A=x.child;if(A!==null)A.return=x;else for(A=x;A!==null;){if(A===a){A=null;break}if(x=A.sibling,x!==null){x.return=A.return,A=x;break}A=A.return}x=A}}function eu(a,l,d,p){a=null;for(var x=l,j=!1;x!==null;){if(!j){if((x.flags&524288)!==0)j=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var A=x.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var N=x.type;Ir(x.pendingProps.value,A.value)||(a!==null?a.push(N):a=[N])}}else if(x===Ge.current){if(A=x.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(a!==null?a.push(Du):a=[Du])}x=x.return}a!==null&&Ym(l,a,d,p),l.flags|=262144}function rf(a){for(a=a.firstContext;a!==null;){if(!Ir(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function hs(a){fs=a,Ca=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function rr(a){return eS(fs,a)}function af(a,l){return fs===null&&hs(a),eS(a,l)}function eS(a,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},Ca===null){if(a===null)throw Error(r(308));Ca=l,a.dependencies={lanes:0,firstContext:l},a.flags|=524288}else Ca=Ca.next=l;return d}var n4=typeof AbortController<"u"?AbortController:function(){var a=[],l=this.signal={aborted:!1,addEventListener:function(d,p){a.push(p)}};this.abort=function(){l.aborted=!0,a.forEach(function(d){return d()})}},r4=e.unstable_scheduleCallback,i4=e.unstable_NormalPriority,Fn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xm(){return{controller:new n4,data:new Map,refCount:0}}function tu(a){a.refCount--,a.refCount===0&&r4(i4,function(){a.controller.abort()})}var nu=null,Km=0,wl=0,jl=null;function a4(a,l){if(nu===null){var d=nu=[];Km=0,wl=Jg(),jl={status:"pending",value:void 0,then:function(p){d.push(p)}}}return Km++,l.then(tS,tS),l}function tS(){if(--Km===0&&nu!==null){jl!==null&&(jl.status="fulfilled");var a=nu;nu=null,wl=0,jl=null;for(var l=0;l<a.length;l++)(0,a[l])()}}function o4(a,l){var d=[],p={status:"pending",value:null,reason:null,then:function(x){d.push(x)}};return a.then(function(){p.status="fulfilled",p.value=l;for(var x=0;x<d.length;x++)(0,d[x])(l)},function(x){for(p.status="rejected",p.reason=x,x=0;x<d.length;x++)(0,d[x])(void 0)}),p}var nS=P.S;P.S=function(a,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&a4(a,l),nS!==null&&nS(a,l)};var ps=U(null);function Zm(){var a=ps.current;return a!==null?a:fn.pooledCache}function of(a,l){l===null?ee(ps,ps.current):ee(ps,l.pool)}function rS(){var a=Zm();return a===null?null:{parent:Fn._currentValue,pool:a}}var ru=Error(r(460)),iS=Error(r(474)),sf=Error(r(542)),Jm={then:function(){}};function aS(a){return a=a.status,a==="fulfilled"||a==="rejected"}function lf(){}function oS(a,l,d){switch(d=a[d],d===void 0?a.push(l):d!==l&&(l.then(lf,lf),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,lS(a),a;default:if(typeof l.status=="string")l.then(lf,lf);else{if(a=fn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=l,a.status="pending",a.then(function(p){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=p}},function(p){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,lS(a),a}throw iu=l,ru}}var iu=null;function sS(){if(iu===null)throw Error(r(459));var a=iu;return iu=null,a}function lS(a){if(a===ru||a===sf)throw Error(r(483))}var fo=!1;function eg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tg(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ho(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function po(a,l,d){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(Yt&2)!==0){var x=p.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),p.pending=l,l=Jd(a),Q1(a,null,d),l}return Zd(a,p,l,d),Jd(a)}function au(a,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var p=l.lanes;p&=a.pendingLanes,d|=p,l.lanes=d,io(a,d)}}function ng(a,l){var d=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var x=null,j=null;if(d=d.firstBaseUpdate,d!==null){do{var A={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};j===null?x=j=A:j=j.next=A,d=d.next}while(d!==null);j===null?x=j=l:j=j.next=l}else x=j=l;d={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:j,shared:p.shared,callbacks:p.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=l:a.next=l,d.lastBaseUpdate=l}var rg=!1;function ou(){if(rg){var a=jl;if(a!==null)throw a}}function su(a,l,d,p){rg=!1;var x=a.updateQueue;fo=!1;var j=x.firstBaseUpdate,A=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var B=N,ne=B.next;B.next=null,A===null?j=ne:A.next=ne,A=B;var de=a.alternate;de!==null&&(de=de.updateQueue,N=de.lastBaseUpdate,N!==A&&(N===null?de.firstBaseUpdate=ne:N.next=ne,de.lastBaseUpdate=B))}if(j!==null){var pe=x.baseState;A=0,de=ne=B=null,N=j;do{var ie=N.lane&-536870913,oe=ie!==N.lane;if(oe?(Mt&ie)===ie:(p&ie)===ie){ie!==0&&ie===wl&&(rg=!0),de!==null&&(de=de.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ut=a,at=N;ie=l;var tn=d;switch(at.tag){case 1:if(ut=at.payload,typeof ut=="function"){pe=ut.call(tn,pe,ie);break e}pe=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=at.payload,ie=typeof ut=="function"?ut.call(tn,pe,ie):ut,ie==null)break e;pe=m({},pe,ie);break e;case 2:fo=!0}}ie=N.callback,ie!==null&&(a.flags|=64,oe&&(a.flags|=8192),oe=x.callbacks,oe===null?x.callbacks=[ie]:oe.push(ie))}else oe={lane:ie,tag:N.tag,payload:N.payload,callback:N.callback,next:null},de===null?(ne=de=oe,B=pe):de=de.next=oe,A|=ie;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;oe=N,N=oe.next,oe.next=null,x.lastBaseUpdate=oe,x.shared.pending=null}}while(!0);de===null&&(B=pe),x.baseState=B,x.firstBaseUpdate=ne,x.lastBaseUpdate=de,j===null&&(x.shared.lanes=0),wo|=A,a.lanes=A,a.memoizedState=pe}}function cS(a,l){if(typeof a!="function")throw Error(r(191,a));a.call(l)}function uS(a,l){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)cS(d[a],l)}var Cl=U(null),cf=U(0);function dS(a,l){a=Pa,ee(cf,a),ee(Cl,l),Pa=a|l.baseLanes}function ig(){ee(cf,Pa),ee(Cl,Cl.current)}function ag(){Pa=cf.current,K(Cl),K(cf)}var mo=0,St=null,Jt=null,Ln=null,uf=!1,El=!1,ms=!1,df=0,lu=0,Tl=null,s4=0;function kn(){throw Error(r(321))}function og(a,l){if(l===null)return!1;for(var d=0;d<l.length&&d<a.length;d++)if(!Ir(a[d],l[d]))return!1;return!0}function sg(a,l,d,p,x,j){return mo=j,St=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=a===null||a.memoizedState===null?QS:YS,ms=!1,j=d(p,x),ms=!1,El&&(j=hS(l,d,p,x)),fS(a),j}function fS(a){P.H=vf;var l=Jt!==null&&Jt.next!==null;if(mo=0,Ln=Jt=St=null,uf=!1,lu=0,Tl=null,l)throw Error(r(300));a===null||Gn||(a=a.dependencies,a!==null&&rf(a)&&(Gn=!0))}function hS(a,l,d,p){St=a;var x=0;do{if(El&&(Tl=null),lu=0,El=!1,25<=x)throw Error(r(301));if(x+=1,Ln=Jt=null,a.updateQueue!=null){var j=a.updateQueue;j.lastEffect=null,j.events=null,j.stores=null,j.memoCache!=null&&(j.memoCache.index=0)}P.H=p4,j=l(d,p)}while(El);return j}function l4(){var a=P.H,l=a.useState()[0];return l=typeof l.then=="function"?cu(l):l,a=a.useState()[0],(Jt!==null?Jt.memoizedState:null)!==a&&(St.flags|=1024),l}function lg(){var a=df!==0;return df=0,a}function cg(a,l,d){l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~d}function ug(a){if(uf){for(a=a.memoizedState;a!==null;){var l=a.queue;l!==null&&(l.pending=null),a=a.next}uf=!1}mo=0,Ln=Jt=St=null,El=!1,lu=df=0,Tl=null}function Cr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ln===null?St.memoizedState=Ln=a:Ln=Ln.next=a,Ln}function $n(){if(Jt===null){var a=St.alternate;a=a!==null?a.memoizedState:null}else a=Jt.next;var l=Ln===null?St.memoizedState:Ln.next;if(l!==null)Ln=l,Jt=a;else{if(a===null)throw St.alternate===null?Error(r(467)):Error(r(310));Jt=a,a={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},Ln===null?St.memoizedState=Ln=a:Ln=Ln.next=a}return Ln}function dg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cu(a){var l=lu;return lu+=1,Tl===null&&(Tl=[]),a=oS(Tl,a,l),l=St,(Ln===null?l.memoizedState:Ln.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?QS:YS),a}function ff(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return cu(a);if(a.$$typeof===T)return rr(a)}throw Error(r(438,String(a)))}function fg(a){var l=null,d=St.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var p=St.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=dg(),St.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(a),p=0;p<a;p++)d[p]=V;return l.index++,d}function Ta(a,l){return typeof l=="function"?l(a):l}function hf(a){var l=$n();return hg(l,Jt,a)}function hg(a,l,d){var p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var x=a.baseQueue,j=p.pending;if(j!==null){if(x!==null){var A=x.next;x.next=j.next,j.next=A}l.baseQueue=x=j,p.pending=null}if(j=a.baseState,x===null)a.memoizedState=j;else{l=x.next;var N=A=null,B=null,ne=l,de=!1;do{var pe=ne.lane&-536870913;if(pe!==ne.lane?(Mt&pe)===pe:(mo&pe)===pe){var ie=ne.revertLane;if(ie===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),pe===wl&&(de=!0);else if((mo&ie)===ie){ne=ne.next,ie===wl&&(de=!0);continue}else pe={lane:0,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=pe,A=j):B=B.next=pe,St.lanes|=ie,wo|=ie;pe=ne.action,ms&&d(j,pe),j=ne.hasEagerState?ne.eagerState:d(j,pe)}else ie={lane:pe,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=ie,A=j):B=B.next=ie,St.lanes|=pe,wo|=pe;ne=ne.next}while(ne!==null&&ne!==l);if(B===null?A=j:B.next=N,!Ir(j,a.memoizedState)&&(Gn=!0,de&&(d=jl,d!==null)))throw d;a.memoizedState=j,a.baseState=A,a.baseQueue=B,p.lastRenderedState=j}return x===null&&(p.lanes=0),[a.memoizedState,p.dispatch]}function pg(a){var l=$n(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var p=d.dispatch,x=d.pending,j=l.memoizedState;if(x!==null){d.pending=null;var A=x=x.next;do j=a(j,A.action),A=A.next;while(A!==x);Ir(j,l.memoizedState)||(Gn=!0),l.memoizedState=j,l.baseQueue===null&&(l.baseState=j),d.lastRenderedState=j}return[j,p]}function pS(a,l,d){var p=St,x=$n(),j=Ft;if(j){if(d===void 0)throw Error(r(407));d=d()}else d=l();var A=!Ir((Jt||x).memoizedState,d);A&&(x.memoizedState=d,Gn=!0),x=x.queue;var N=vS.bind(null,p,x,a);if(uu(2048,8,N,[a]),x.getSnapshot!==l||A||Ln!==null&&Ln.memoizedState.tag&1){if(p.flags|=2048,Rl(9,pf(),gS.bind(null,p,x,d,l),null),fn===null)throw Error(r(349));j||(mo&124)!==0||mS(p,l,d)}return d}function mS(a,l,d){a.flags|=16384,a={getSnapshot:l,value:d},l=St.updateQueue,l===null?(l=dg(),St.updateQueue=l,l.stores=[a]):(d=l.stores,d===null?l.stores=[a]:d.push(a))}function gS(a,l,d,p){l.value=d,l.getSnapshot=p,yS(l)&&xS(a)}function vS(a,l,d){return d(function(){yS(l)&&xS(a)})}function yS(a){var l=a.getSnapshot;a=a.value;try{var d=l();return!Ir(a,d)}catch{return!0}}function xS(a){var l=yl(a,2);l!==null&&Vr(l,a,2)}function mg(a){var l=Cr();if(typeof a=="function"){var d=a;if(a=d(),ms){Gt(!0);try{d()}finally{Gt(!1)}}}return l.memoizedState=l.baseState=a,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:a},l}function bS(a,l,d,p){return a.baseState=d,hg(a,Jt,typeof p=="function"?p:Ta)}function c4(a,l,d,p,x){if(gf(a))throw Error(r(485));if(a=l.action,a!==null){var j={payload:x,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){j.listeners.push(A)}};P.T!==null?d(!0):j.isTransition=!1,p(j),d=l.pending,d===null?(j.next=l.pending=j,SS(l,j)):(j.next=d.next,l.pending=d.next=j)}}function SS(a,l){var d=l.action,p=l.payload,x=a.state;if(l.isTransition){var j=P.T,A={};P.T=A;try{var N=d(x,p),B=P.S;B!==null&&B(A,N),wS(a,l,N)}catch(ne){gg(a,l,ne)}finally{P.T=j}}else try{j=d(x,p),wS(a,l,j)}catch(ne){gg(a,l,ne)}}function wS(a,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){jS(a,l,p)},function(p){return gg(a,l,p)}):jS(a,l,d)}function jS(a,l,d){l.status="fulfilled",l.value=d,CS(l),a.state=d,l=a.pending,l!==null&&(d=l.next,d===l?a.pending=null:(d=d.next,l.next=d,SS(a,d)))}function gg(a,l,d){var p=a.pending;if(a.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,CS(l),l=l.next;while(l!==p)}a.action=null}function CS(a){a=a.listeners;for(var l=0;l<a.length;l++)(0,a[l])()}function ES(a,l){return l}function TS(a,l){if(Ft){var d=fn.formState;if(d!==null){e:{var p=St;if(Ft){if(_n){t:{for(var x=_n,j=qi;x.nodeType!==8;){if(!j){x=null;break t}if(x=Ri(x.nextSibling),x===null){x=null;break t}}j=x.data,x=j==="F!"||j==="F"?x:null}if(x){_n=Ri(x.nextSibling),p=x.data==="F!";break e}}ds(p)}p=!1}p&&(l=d[0])}}return d=Cr(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ES,lastRenderedState:l},d.queue=p,d=qS.bind(null,St,p),p.dispatch=d,p=mg(!1),j=Sg.bind(null,St,!1,p.queue),p=Cr(),x={state:l,dispatch:null,action:a,pending:null},p.queue=x,d=c4.bind(null,St,x,j,d),x.dispatch=d,p.memoizedState=a,[l,d,!1]}function RS(a){var l=$n();return _S(l,Jt,a)}function _S(a,l,d){if(l=hg(a,l,ES)[0],a=hf(Ta)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=cu(l)}catch(A){throw A===ru?sf:A}else p=l;l=$n();var x=l.queue,j=x.dispatch;return d!==l.memoizedState&&(St.flags|=2048,Rl(9,pf(),u4.bind(null,x,d),null)),[p,j,a]}function u4(a,l){a.action=l}function DS(a){var l=$n(),d=Jt;if(d!==null)return _S(l,d,a);$n(),l=l.memoizedState,d=$n();var p=d.queue.dispatch;return d.memoizedState=a,[l,p,!1]}function Rl(a,l,d,p){return a={tag:a,create:d,deps:p,inst:l,next:null},l=St.updateQueue,l===null&&(l=dg(),St.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=a.next=a:(p=d.next,d.next=a,a.next=p,l.lastEffect=a),a}function pf(){return{destroy:void 0,resource:void 0}}function AS(){return $n().memoizedState}function mf(a,l,d,p){var x=Cr();p=p===void 0?null:p,St.flags|=a,x.memoizedState=Rl(1|l,pf(),d,p)}function uu(a,l,d,p){var x=$n();p=p===void 0?null:p;var j=x.memoizedState.inst;Jt!==null&&p!==null&&og(p,Jt.memoizedState.deps)?x.memoizedState=Rl(l,j,d,p):(St.flags|=a,x.memoizedState=Rl(1|l,j,d,p))}function kS(a,l){mf(8390656,8,a,l)}function PS(a,l){uu(2048,8,a,l)}function NS(a,l){return uu(4,2,a,l)}function OS(a,l){return uu(4,4,a,l)}function MS(a,l){if(typeof l=="function"){a=a();var d=l(a);return function(){typeof d=="function"?d():l(null)}}if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function IS(a,l,d){d=d!=null?d.concat([a]):null,uu(4,4,MS.bind(null,l,a),d)}function vg(){}function LS(a,l){var d=$n();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&og(l,p[1])?p[0]:(d.memoizedState=[a,l],a)}function $S(a,l){var d=$n();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&og(l,p[1]))return p[0];if(p=a(),ms){Gt(!0);try{a()}finally{Gt(!1)}}return d.memoizedState=[p,l],p}function yg(a,l,d){return d===void 0||(mo&1073741824)!==0?a.memoizedState=l:(a.memoizedState=d,a=Bw(),St.lanes|=a,wo|=a,d)}function zS(a,l,d,p){return Ir(d,l)?d:Cl.current!==null?(a=yg(a,d,p),Ir(a,l)||(Gn=!0),a):(mo&42)===0?(Gn=!0,a.memoizedState=d):(a=Bw(),St.lanes|=a,wo|=a,l)}function US(a,l,d,p,x){var j=L.p;L.p=j!==0&&8>j?j:8;var A=P.T,N={};P.T=N,Sg(a,!1,l,d);try{var B=x(),ne=P.S;if(ne!==null&&ne(N,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var de=o4(B,p);du(a,l,de,Br(a))}else du(a,l,p,Br(a))}catch(pe){du(a,l,{then:function(){},status:"rejected",reason:pe},Br())}finally{L.p=j,P.T=A}}function d4(){}function xg(a,l,d,p){if(a.tag!==5)throw Error(r(476));var x=BS(a).queue;US(a,x,l,$,d===null?d4:function(){return VS(a),d(p)})}function BS(a){var l=a.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:$},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:d},next:null},a.memoizedState=l,a=a.alternate,a!==null&&(a.memoizedState=l),l}function VS(a){var l=BS(a).next.queue;du(a,l,{},Br())}function bg(){return rr(Du)}function FS(){return $n().memoizedState}function HS(){return $n().memoizedState}function f4(a){for(var l=a.return;l!==null;){switch(l.tag){case 24:case 3:var d=Br();a=ho(d);var p=po(l,a,d);p!==null&&(Vr(p,l,d),au(p,l,d)),l={cache:Xm()},a.payload=l;return}l=l.return}}function h4(a,l,d){var p=Br();d={lane:p,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},gf(a)?GS(l,d):(d=Um(a,l,d,p),d!==null&&(Vr(d,a,p),WS(d,l,p)))}function qS(a,l,d){var p=Br();du(a,l,d,p)}function du(a,l,d,p){var x={lane:p,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(gf(a))GS(l,x);else{var j=a.alternate;if(a.lanes===0&&(j===null||j.lanes===0)&&(j=l.lastRenderedReducer,j!==null))try{var A=l.lastRenderedState,N=j(A,d);if(x.hasEagerState=!0,x.eagerState=N,Ir(N,A))return Zd(a,l,x,0),fn===null&&Kd(),!1}catch{}finally{}if(d=Um(a,l,x,p),d!==null)return Vr(d,a,p),WS(d,l,p),!0}return!1}function Sg(a,l,d,p){if(p={lane:2,revertLane:Jg(),action:p,hasEagerState:!1,eagerState:null,next:null},gf(a)){if(l)throw Error(r(479))}else l=Um(a,d,p,2),l!==null&&Vr(l,a,2)}function gf(a){var l=a.alternate;return a===St||l!==null&&l===St}function GS(a,l){El=uf=!0;var d=a.pending;d===null?l.next=l:(l.next=d.next,d.next=l),a.pending=l}function WS(a,l,d){if((d&4194048)!==0){var p=l.lanes;p&=a.pendingLanes,d|=p,l.lanes=d,io(a,d)}}var vf={readContext:rr,use:ff,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useLayoutEffect:kn,useInsertionEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useSyncExternalStore:kn,useId:kn,useHostTransitionStatus:kn,useFormState:kn,useActionState:kn,useOptimistic:kn,useMemoCache:kn,useCacheRefresh:kn},QS={readContext:rr,use:ff,useCallback:function(a,l){return Cr().memoizedState=[a,l===void 0?null:l],a},useContext:rr,useEffect:kS,useImperativeHandle:function(a,l,d){d=d!=null?d.concat([a]):null,mf(4194308,4,MS.bind(null,l,a),d)},useLayoutEffect:function(a,l){return mf(4194308,4,a,l)},useInsertionEffect:function(a,l){mf(4,2,a,l)},useMemo:function(a,l){var d=Cr();l=l===void 0?null:l;var p=a();if(ms){Gt(!0);try{a()}finally{Gt(!1)}}return d.memoizedState=[p,l],p},useReducer:function(a,l,d){var p=Cr();if(d!==void 0){var x=d(l);if(ms){Gt(!0);try{d(l)}finally{Gt(!1)}}}else x=l;return p.memoizedState=p.baseState=x,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:x},p.queue=a,a=a.dispatch=h4.bind(null,St,a),[p.memoizedState,a]},useRef:function(a){var l=Cr();return a={current:a},l.memoizedState=a},useState:function(a){a=mg(a);var l=a.queue,d=qS.bind(null,St,l);return l.dispatch=d,[a.memoizedState,d]},useDebugValue:vg,useDeferredValue:function(a,l){var d=Cr();return yg(d,a,l)},useTransition:function(){var a=mg(!1);return a=US.bind(null,St,a.queue,!0,!1),Cr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,l,d){var p=St,x=Cr();if(Ft){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),fn===null)throw Error(r(349));(Mt&124)!==0||mS(p,l,d)}x.memoizedState=d;var j={value:d,getSnapshot:l};return x.queue=j,kS(vS.bind(null,p,j,a),[a]),p.flags|=2048,Rl(9,pf(),gS.bind(null,p,j,d,l),null),d},useId:function(){var a=Cr(),l=fn.identifierPrefix;if(Ft){var d=ja,p=wa;d=(p&~(1<<32-kt(p)-1)).toString(32)+d,l="«"+l+"R"+d,d=df++,0<d&&(l+="H"+d.toString(32)),l+="»"}else d=s4++,l="«"+l+"r"+d.toString(32)+"»";return a.memoizedState=l},useHostTransitionStatus:bg,useFormState:TS,useActionState:TS,useOptimistic:function(a){var l=Cr();l.memoizedState=l.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=Sg.bind(null,St,!0,d),d.dispatch=l,[a,l]},useMemoCache:fg,useCacheRefresh:function(){return Cr().memoizedState=f4.bind(null,St)}},YS={readContext:rr,use:ff,useCallback:LS,useContext:rr,useEffect:PS,useImperativeHandle:IS,useInsertionEffect:NS,useLayoutEffect:OS,useMemo:$S,useReducer:hf,useRef:AS,useState:function(){return hf(Ta)},useDebugValue:vg,useDeferredValue:function(a,l){var d=$n();return zS(d,Jt.memoizedState,a,l)},useTransition:function(){var a=hf(Ta)[0],l=$n().memoizedState;return[typeof a=="boolean"?a:cu(a),l]},useSyncExternalStore:pS,useId:FS,useHostTransitionStatus:bg,useFormState:RS,useActionState:RS,useOptimistic:function(a,l){var d=$n();return bS(d,Jt,a,l)},useMemoCache:fg,useCacheRefresh:HS},p4={readContext:rr,use:ff,useCallback:LS,useContext:rr,useEffect:PS,useImperativeHandle:IS,useInsertionEffect:NS,useLayoutEffect:OS,useMemo:$S,useReducer:pg,useRef:AS,useState:function(){return pg(Ta)},useDebugValue:vg,useDeferredValue:function(a,l){var d=$n();return Jt===null?yg(d,a,l):zS(d,Jt.memoizedState,a,l)},useTransition:function(){var a=pg(Ta)[0],l=$n().memoizedState;return[typeof a=="boolean"?a:cu(a),l]},useSyncExternalStore:pS,useId:FS,useHostTransitionStatus:bg,useFormState:DS,useActionState:DS,useOptimistic:function(a,l){var d=$n();return Jt!==null?bS(d,Jt,a,l):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:fg,useCacheRefresh:HS},_l=null,fu=0;function yf(a){var l=fu;return fu+=1,_l===null&&(_l=[]),oS(_l,a,l)}function hu(a,l){l=l.props.ref,a.ref=l!==void 0?l:null}function xf(a,l){throw l.$$typeof===g?Error(r(525)):(a=Object.prototype.toString.call(l),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a)))}function XS(a){var l=a._init;return l(a._payload)}function KS(a){function l(Q,q){if(a){var te=Q.deletions;te===null?(Q.deletions=[q],Q.flags|=16):te.push(q)}}function d(Q,q){if(!a)return null;for(;q!==null;)l(Q,q),q=q.sibling;return null}function p(Q){for(var q=new Map;Q!==null;)Q.key!==null?q.set(Q.key,Q):q.set(Q.index,Q),Q=Q.sibling;return q}function x(Q,q){return Q=Sa(Q,q),Q.index=0,Q.sibling=null,Q}function j(Q,q,te){return Q.index=te,a?(te=Q.alternate,te!==null?(te=te.index,te<q?(Q.flags|=67108866,q):te):(Q.flags|=67108866,q)):(Q.flags|=1048576,q)}function A(Q){return a&&Q.alternate===null&&(Q.flags|=67108866),Q}function N(Q,q,te,fe){return q===null||q.tag!==6?(q=Vm(te,Q.mode,fe),q.return=Q,q):(q=x(q,te),q.return=Q,q)}function B(Q,q,te,fe){var He=te.type;return He===S?de(Q,q,te.props.children,fe,te.key):q!==null&&(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===I&&XS(He)===q.type)?(q=x(q,te.props),hu(q,te),q.return=Q,q):(q=ef(te.type,te.key,te.props,null,Q.mode,fe),hu(q,te),q.return=Q,q)}function ne(Q,q,te,fe){return q===null||q.tag!==4||q.stateNode.containerInfo!==te.containerInfo||q.stateNode.implementation!==te.implementation?(q=Fm(te,Q.mode,fe),q.return=Q,q):(q=x(q,te.children||[]),q.return=Q,q)}function de(Q,q,te,fe,He){return q===null||q.tag!==7?(q=ss(te,Q.mode,fe,He),q.return=Q,q):(q=x(q,te),q.return=Q,q)}function pe(Q,q,te){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Vm(""+q,Q.mode,te),q.return=Q,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return te=ef(q.type,q.key,q.props,null,Q.mode,te),hu(te,q),te.return=Q,te;case b:return q=Fm(q,Q.mode,te),q.return=Q,q;case I:var fe=q._init;return q=fe(q._payload),pe(Q,q,te)}if(X(q)||W(q))return q=ss(q,Q.mode,te,null),q.return=Q,q;if(typeof q.then=="function")return pe(Q,yf(q),te);if(q.$$typeof===T)return pe(Q,af(Q,q),te);xf(Q,q)}return null}function ie(Q,q,te,fe){var He=q!==null?q.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return He!==null?null:N(Q,q,""+te,fe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return te.key===He?B(Q,q,te,fe):null;case b:return te.key===He?ne(Q,q,te,fe):null;case I:return He=te._init,te=He(te._payload),ie(Q,q,te,fe)}if(X(te)||W(te))return He!==null?null:de(Q,q,te,fe,null);if(typeof te.then=="function")return ie(Q,q,yf(te),fe);if(te.$$typeof===T)return ie(Q,q,af(Q,te),fe);xf(Q,te)}return null}function oe(Q,q,te,fe,He){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return Q=Q.get(te)||null,N(q,Q,""+fe,He);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case v:return Q=Q.get(fe.key===null?te:fe.key)||null,B(q,Q,fe,He);case b:return Q=Q.get(fe.key===null?te:fe.key)||null,ne(q,Q,fe,He);case I:var Et=fe._init;return fe=Et(fe._payload),oe(Q,q,te,fe,He)}if(X(fe)||W(fe))return Q=Q.get(te)||null,de(q,Q,fe,He,null);if(typeof fe.then=="function")return oe(Q,q,te,yf(fe),He);if(fe.$$typeof===T)return oe(Q,q,te,af(q,fe),He);xf(q,fe)}return null}function ut(Q,q,te,fe){for(var He=null,Et=null,et=q,lt=q=0,Qn=null;et!==null&&lt<te.length;lt++){et.index>lt?(Qn=et,et=null):Qn=et.sibling;var Bt=ie(Q,et,te[lt],fe);if(Bt===null){et===null&&(et=Qn);break}a&&et&&Bt.alternate===null&&l(Q,et),q=j(Bt,q,lt),Et===null?He=Bt:Et.sibling=Bt,Et=Bt,et=Qn}if(lt===te.length)return d(Q,et),Ft&&cs(Q,lt),He;if(et===null){for(;lt<te.length;lt++)et=pe(Q,te[lt],fe),et!==null&&(q=j(et,q,lt),Et===null?He=et:Et.sibling=et,Et=et);return Ft&&cs(Q,lt),He}for(et=p(et);lt<te.length;lt++)Qn=oe(et,Q,lt,te[lt],fe),Qn!==null&&(a&&Qn.alternate!==null&&et.delete(Qn.key===null?lt:Qn.key),q=j(Qn,q,lt),Et===null?He=Qn:Et.sibling=Qn,Et=Qn);return a&&et.forEach(function(ko){return l(Q,ko)}),Ft&&cs(Q,lt),He}function at(Q,q,te,fe){if(te==null)throw Error(r(151));for(var He=null,Et=null,et=q,lt=q=0,Qn=null,Bt=te.next();et!==null&&!Bt.done;lt++,Bt=te.next()){et.index>lt?(Qn=et,et=null):Qn=et.sibling;var ko=ie(Q,et,Bt.value,fe);if(ko===null){et===null&&(et=Qn);break}a&&et&&ko.alternate===null&&l(Q,et),q=j(ko,q,lt),Et===null?He=ko:Et.sibling=ko,Et=ko,et=Qn}if(Bt.done)return d(Q,et),Ft&&cs(Q,lt),He;if(et===null){for(;!Bt.done;lt++,Bt=te.next())Bt=pe(Q,Bt.value,fe),Bt!==null&&(q=j(Bt,q,lt),Et===null?He=Bt:Et.sibling=Bt,Et=Bt);return Ft&&cs(Q,lt),He}for(et=p(et);!Bt.done;lt++,Bt=te.next())Bt=oe(et,Q,lt,Bt.value,fe),Bt!==null&&(a&&Bt.alternate!==null&&et.delete(Bt.key===null?lt:Bt.key),q=j(Bt,q,lt),Et===null?He=Bt:Et.sibling=Bt,Et=Bt);return a&&et.forEach(function(m3){return l(Q,m3)}),Ft&&cs(Q,lt),He}function tn(Q,q,te,fe){if(typeof te=="object"&&te!==null&&te.type===S&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case v:e:{for(var He=te.key;q!==null;){if(q.key===He){if(He=te.type,He===S){if(q.tag===7){d(Q,q.sibling),fe=x(q,te.props.children),fe.return=Q,Q=fe;break e}}else if(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===I&&XS(He)===q.type){d(Q,q.sibling),fe=x(q,te.props),hu(fe,te),fe.return=Q,Q=fe;break e}d(Q,q);break}else l(Q,q);q=q.sibling}te.type===S?(fe=ss(te.props.children,Q.mode,fe,te.key),fe.return=Q,Q=fe):(fe=ef(te.type,te.key,te.props,null,Q.mode,fe),hu(fe,te),fe.return=Q,Q=fe)}return A(Q);case b:e:{for(He=te.key;q!==null;){if(q.key===He)if(q.tag===4&&q.stateNode.containerInfo===te.containerInfo&&q.stateNode.implementation===te.implementation){d(Q,q.sibling),fe=x(q,te.children||[]),fe.return=Q,Q=fe;break e}else{d(Q,q);break}else l(Q,q);q=q.sibling}fe=Fm(te,Q.mode,fe),fe.return=Q,Q=fe}return A(Q);case I:return He=te._init,te=He(te._payload),tn(Q,q,te,fe)}if(X(te))return ut(Q,q,te,fe);if(W(te)){if(He=W(te),typeof He!="function")throw Error(r(150));return te=He.call(te),at(Q,q,te,fe)}if(typeof te.then=="function")return tn(Q,q,yf(te),fe);if(te.$$typeof===T)return tn(Q,q,af(Q,te),fe);xf(Q,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,q!==null&&q.tag===6?(d(Q,q.sibling),fe=x(q,te),fe.return=Q,Q=fe):(d(Q,q),fe=Vm(te,Q.mode,fe),fe.return=Q,Q=fe),A(Q)):d(Q,q)}return function(Q,q,te,fe){try{fu=0;var He=tn(Q,q,te,fe);return _l=null,He}catch(et){if(et===ru||et===sf)throw et;var Et=Lr(29,et,null,Q.mode);return Et.lanes=fe,Et.return=Q,Et}finally{}}}var Dl=KS(!0),ZS=KS(!1),ai=U(null),Gi=null;function go(a){var l=a.alternate;ee(Hn,Hn.current&1),ee(ai,a),Gi===null&&(l===null||Cl.current!==null||l.memoizedState!==null)&&(Gi=a)}function JS(a){if(a.tag===22){if(ee(Hn,Hn.current),ee(ai,a),Gi===null){var l=a.alternate;l!==null&&l.memoizedState!==null&&(Gi=a)}}else vo()}function vo(){ee(Hn,Hn.current),ee(ai,ai.current)}function Ra(a){K(ai),Gi===a&&(Gi=null),K(Hn)}var Hn=U(0);function bf(a){for(var l=a;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||dv(d)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function wg(a,l,d,p){l=a.memoizedState,d=d(p,l),d=d==null?l:m({},l,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var jg={enqueueSetState:function(a,l,d){a=a._reactInternals;var p=Br(),x=ho(p);x.payload=l,d!=null&&(x.callback=d),l=po(a,x,p),l!==null&&(Vr(l,a,p),au(l,a,p))},enqueueReplaceState:function(a,l,d){a=a._reactInternals;var p=Br(),x=ho(p);x.tag=1,x.payload=l,d!=null&&(x.callback=d),l=po(a,x,p),l!==null&&(Vr(l,a,p),au(l,a,p))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var d=Br(),p=ho(d);p.tag=2,l!=null&&(p.callback=l),l=po(a,p,d),l!==null&&(Vr(l,a,d),au(l,a,d))}};function ew(a,l,d,p,x,j,A){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(p,j,A):l.prototype&&l.prototype.isPureReactComponent?!Yc(d,p)||!Yc(x,j):!0}function tw(a,l,d,p){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,p),l.state!==a&&jg.enqueueReplaceState(l,l.state,null)}function gs(a,l){var d=l;if("ref"in l){d={};for(var p in l)p!=="ref"&&(d[p]=l[p])}if(a=a.defaultProps){d===l&&(d=m({},d));for(var x in a)d[x]===void 0&&(d[x]=a[x])}return d}var Sf=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function nw(a){Sf(a)}function rw(a){console.error(a)}function iw(a){Sf(a)}function wf(a,l){try{var d=a.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function aw(a,l,d){try{var p=a.onCaughtError;p(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Cg(a,l,d){return d=ho(d),d.tag=3,d.payload={element:null},d.callback=function(){wf(a,l)},d}function ow(a){return a=ho(a),a.tag=3,a}function sw(a,l,d,p){var x=d.type.getDerivedStateFromError;if(typeof x=="function"){var j=p.value;a.payload=function(){return x(j)},a.callback=function(){aw(l,d,p)}}var A=d.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(a.callback=function(){aw(l,d,p),typeof x!="function"&&(jo===null?jo=new Set([this]):jo.add(this));var N=p.stack;this.componentDidCatch(p.value,{componentStack:N!==null?N:""})})}function m4(a,l,d,p,x){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=d.alternate,l!==null&&eu(l,d,x,!0),d=ai.current,d!==null){switch(d.tag){case 13:return Gi===null?Qg():d.alternate===null&&Dn===0&&(Dn=3),d.flags&=-257,d.flags|=65536,d.lanes=x,p===Jm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),Xg(a,p,x)),!1;case 22:return d.flags|=65536,p===Jm?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([p]):d.add(p)),Xg(a,p,x)),!1}throw Error(r(435,d.tag))}return Xg(a,p,x),Qg(),!1}if(Ft)return l=ai.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,p!==Gm&&(a=Error(r(422),{cause:p}),Jc(ti(a,d)))):(p!==Gm&&(l=Error(r(423),{cause:p}),Jc(ti(l,d))),a=a.current.alternate,a.flags|=65536,x&=-x,a.lanes|=x,p=ti(p,d),x=Cg(a.stateNode,p,x),ng(a,x),Dn!==4&&(Dn=2)),!1;var j=Error(r(520),{cause:p});if(j=ti(j,d),bu===null?bu=[j]:bu.push(j),Dn!==4&&(Dn=2),l===null)return!0;p=ti(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,a=x&-x,d.lanes|=a,a=Cg(d.stateNode,p,a),ng(d,a),!1;case 1:if(l=d.type,j=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(jo===null||!jo.has(j))))return d.flags|=65536,x&=-x,d.lanes|=x,x=ow(x),sw(x,a,d,p),ng(d,x),!1}d=d.return}while(d!==null);return!1}var lw=Error(r(461)),Gn=!1;function Xn(a,l,d,p){l.child=a===null?ZS(l,null,d,p):Dl(l,a.child,d,p)}function cw(a,l,d,p,x){d=d.render;var j=l.ref;if("ref"in p){var A={};for(var N in p)N!=="ref"&&(A[N]=p[N])}else A=p;return hs(l),p=sg(a,l,d,A,j,x),N=lg(),a!==null&&!Gn?(cg(a,l,x),_a(a,l,x)):(Ft&&N&&Hm(l),l.flags|=1,Xn(a,l,p,x),l.child)}function uw(a,l,d,p,x){if(a===null){var j=d.type;return typeof j=="function"&&!Bm(j)&&j.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=j,dw(a,l,j,p,x)):(a=ef(d.type,null,p,l,l.mode,x),a.ref=l.ref,a.return=l,l.child=a)}if(j=a.child,!Pg(a,x)){var A=j.memoizedProps;if(d=d.compare,d=d!==null?d:Yc,d(A,p)&&a.ref===l.ref)return _a(a,l,x)}return l.flags|=1,a=Sa(j,p),a.ref=l.ref,a.return=l,l.child=a}function dw(a,l,d,p,x){if(a!==null){var j=a.memoizedProps;if(Yc(j,p)&&a.ref===l.ref)if(Gn=!1,l.pendingProps=p=j,Pg(a,x))(a.flags&131072)!==0&&(Gn=!0);else return l.lanes=a.lanes,_a(a,l,x)}return Eg(a,l,d,p,x)}function fw(a,l,d){var p=l.pendingProps,x=p.children,j=a!==null?a.memoizedState:null;if(p.mode==="hidden"){if((l.flags&128)!==0){if(p=j!==null?j.baseLanes|d:d,a!==null){for(x=l.child=a.child,j=0;x!==null;)j=j|x.lanes|x.childLanes,x=x.sibling;l.childLanes=j&~p}else l.childLanes=0,l.child=null;return hw(a,l,p,d)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},a!==null&&of(l,j!==null?j.cachePool:null),j!==null?dS(l,j):ig(),JS(l);else return l.lanes=l.childLanes=536870912,hw(a,l,j!==null?j.baseLanes|d:d,d)}else j!==null?(of(l,j.cachePool),dS(l,j),vo(),l.memoizedState=null):(a!==null&&of(l,null),ig(),vo());return Xn(a,l,x,d),l.child}function hw(a,l,d,p){var x=Zm();return x=x===null?null:{parent:Fn._currentValue,pool:x},l.memoizedState={baseLanes:d,cachePool:x},a!==null&&of(l,null),ig(),JS(l),a!==null&&eu(a,l,p,!0),null}function jf(a,l){var d=l.ref;if(d===null)a!==null&&a.ref!==null&&(l.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(a===null||a.ref!==d)&&(l.flags|=4194816)}}function Eg(a,l,d,p,x){return hs(l),d=sg(a,l,d,p,void 0,x),p=lg(),a!==null&&!Gn?(cg(a,l,x),_a(a,l,x)):(Ft&&p&&Hm(l),l.flags|=1,Xn(a,l,d,x),l.child)}function pw(a,l,d,p,x,j){return hs(l),l.updateQueue=null,d=hS(l,p,d,x),fS(a),p=lg(),a!==null&&!Gn?(cg(a,l,j),_a(a,l,j)):(Ft&&p&&Hm(l),l.flags|=1,Xn(a,l,d,j),l.child)}function mw(a,l,d,p,x){if(hs(l),l.stateNode===null){var j=xl,A=d.contextType;typeof A=="object"&&A!==null&&(j=rr(A)),j=new d(p,j),l.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=jg,l.stateNode=j,j._reactInternals=l,j=l.stateNode,j.props=p,j.state=l.memoizedState,j.refs={},eg(l),A=d.contextType,j.context=typeof A=="object"&&A!==null?rr(A):xl,j.state=l.memoizedState,A=d.getDerivedStateFromProps,typeof A=="function"&&(wg(l,d,A,p),j.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(A=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),A!==j.state&&jg.enqueueReplaceState(j,j.state,null),su(l,p,j,x),ou(),j.state=l.memoizedState),typeof j.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(a===null){j=l.stateNode;var N=l.memoizedProps,B=gs(d,N);j.props=B;var ne=j.context,de=d.contextType;A=xl,typeof de=="object"&&de!==null&&(A=rr(de));var pe=d.getDerivedStateFromProps;de=typeof pe=="function"||typeof j.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,de||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(N||ne!==A)&&tw(l,j,p,A),fo=!1;var ie=l.memoizedState;j.state=ie,su(l,p,j,x),ou(),ne=l.memoizedState,N||ie!==ne||fo?(typeof pe=="function"&&(wg(l,d,pe,p),ne=l.memoizedState),(B=fo||ew(l,d,B,p,ie,ne,A))?(de||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(l.flags|=4194308)):(typeof j.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=ne),j.props=p,j.state=ne,j.context=A,p=B):(typeof j.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{j=l.stateNode,tg(a,l),A=l.memoizedProps,de=gs(d,A),j.props=de,pe=l.pendingProps,ie=j.context,ne=d.contextType,B=xl,typeof ne=="object"&&ne!==null&&(B=rr(ne)),N=d.getDerivedStateFromProps,(ne=typeof N=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(A!==pe||ie!==B)&&tw(l,j,p,B),fo=!1,ie=l.memoizedState,j.state=ie,su(l,p,j,x),ou();var oe=l.memoizedState;A!==pe||ie!==oe||fo||a!==null&&a.dependencies!==null&&rf(a.dependencies)?(typeof N=="function"&&(wg(l,d,N,p),oe=l.memoizedState),(de=fo||ew(l,d,de,p,ie,oe,B)||a!==null&&a.dependencies!==null&&rf(a.dependencies))?(ne||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(p,oe,B),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(p,oe,B)),typeof j.componentDidUpdate=="function"&&(l.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof j.componentDidUpdate!="function"||A===a.memoizedProps&&ie===a.memoizedState||(l.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&ie===a.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=oe),j.props=p,j.state=oe,j.context=B,p=de):(typeof j.componentDidUpdate!="function"||A===a.memoizedProps&&ie===a.memoizedState||(l.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&ie===a.memoizedState||(l.flags|=1024),p=!1)}return j=p,jf(a,l),p=(l.flags&128)!==0,j||p?(j=l.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:j.render(),l.flags|=1,a!==null&&p?(l.child=Dl(l,a.child,null,x),l.child=Dl(l,null,d,x)):Xn(a,l,d,x),l.memoizedState=j.state,a=l.child):a=_a(a,l,x),a}function gw(a,l,d,p){return Zc(),l.flags|=256,Xn(a,l,d,p),l.child}var Tg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rg(a){return{baseLanes:a,cachePool:rS()}}function _g(a,l,d){return a=a!==null?a.childLanes&~d:0,l&&(a|=oi),a}function vw(a,l,d){var p=l.pendingProps,x=!1,j=(l.flags&128)!==0,A;if((A=j)||(A=a!==null&&a.memoizedState===null?!1:(Hn.current&2)!==0),A&&(x=!0,l.flags&=-129),A=(l.flags&32)!==0,l.flags&=-33,a===null){if(Ft){if(x?go(l):vo(),Ft){var N=_n,B;if(B=N){e:{for(B=N,N=qi;B.nodeType!==8;){if(!N){N=null;break e}if(B=Ri(B.nextSibling),B===null){N=null;break e}}N=B}N!==null?(l.memoizedState={dehydrated:N,treeContext:ls!==null?{id:wa,overflow:ja}:null,retryLane:536870912,hydrationErrors:null},B=Lr(18,null,null,0),B.stateNode=N,B.return=l,l.child=B,dr=l,_n=null,B=!0):B=!1}B||ds(l)}if(N=l.memoizedState,N!==null&&(N=N.dehydrated,N!==null))return dv(N)?l.lanes=32:l.lanes=536870912,null;Ra(l)}return N=p.children,p=p.fallback,x?(vo(),x=l.mode,N=Cf({mode:"hidden",children:N},x),p=ss(p,x,d,null),N.return=l,p.return=l,N.sibling=p,l.child=N,x=l.child,x.memoizedState=Rg(d),x.childLanes=_g(a,A,d),l.memoizedState=Tg,p):(go(l),Dg(l,N))}if(B=a.memoizedState,B!==null&&(N=B.dehydrated,N!==null)){if(j)l.flags&256?(go(l),l.flags&=-257,l=Ag(a,l,d)):l.memoizedState!==null?(vo(),l.child=a.child,l.flags|=128,l=null):(vo(),x=p.fallback,N=l.mode,p=Cf({mode:"visible",children:p.children},N),x=ss(x,N,d,null),x.flags|=2,p.return=l,x.return=l,p.sibling=x,l.child=p,Dl(l,a.child,null,d),p=l.child,p.memoizedState=Rg(d),p.childLanes=_g(a,A,d),l.memoizedState=Tg,l=x);else if(go(l),dv(N)){if(A=N.nextSibling&&N.nextSibling.dataset,A)var ne=A.dgst;A=ne,p=Error(r(419)),p.stack="",p.digest=A,Jc({value:p,source:null,stack:null}),l=Ag(a,l,d)}else if(Gn||eu(a,l,d,!1),A=(d&a.childLanes)!==0,Gn||A){if(A=fn,A!==null&&(p=d&-d,p=(p&42)!==0?1:ts(p),p=(p&(A.suspendedLanes|d))!==0?0:p,p!==0&&p!==B.retryLane))throw B.retryLane=p,yl(a,p),Vr(A,a,p),lw;N.data==="$?"||Qg(),l=Ag(a,l,d)}else N.data==="$?"?(l.flags|=192,l.child=a.child,l=null):(a=B.treeContext,_n=Ri(N.nextSibling),dr=l,Ft=!0,us=null,qi=!1,a!==null&&(ri[ii++]=wa,ri[ii++]=ja,ri[ii++]=ls,wa=a.id,ja=a.overflow,ls=l),l=Dg(l,p.children),l.flags|=4096);return l}return x?(vo(),x=p.fallback,N=l.mode,B=a.child,ne=B.sibling,p=Sa(B,{mode:"hidden",children:p.children}),p.subtreeFlags=B.subtreeFlags&65011712,ne!==null?x=Sa(ne,x):(x=ss(x,N,d,null),x.flags|=2),x.return=l,p.return=l,p.sibling=x,l.child=p,p=x,x=l.child,N=a.child.memoizedState,N===null?N=Rg(d):(B=N.cachePool,B!==null?(ne=Fn._currentValue,B=B.parent!==ne?{parent:ne,pool:ne}:B):B=rS(),N={baseLanes:N.baseLanes|d,cachePool:B}),x.memoizedState=N,x.childLanes=_g(a,A,d),l.memoizedState=Tg,p):(go(l),d=a.child,a=d.sibling,d=Sa(d,{mode:"visible",children:p.children}),d.return=l,d.sibling=null,a!==null&&(A=l.deletions,A===null?(l.deletions=[a],l.flags|=16):A.push(a)),l.child=d,l.memoizedState=null,d)}function Dg(a,l){return l=Cf({mode:"visible",children:l},a.mode),l.return=a,a.child=l}function Cf(a,l){return a=Lr(22,a,null,l),a.lanes=0,a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},a}function Ag(a,l,d){return Dl(l,a.child,null,d),a=Dg(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function yw(a,l,d){a.lanes|=l;var p=a.alternate;p!==null&&(p.lanes|=l),Qm(a.return,l,d)}function kg(a,l,d,p,x){var j=a.memoizedState;j===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:x}:(j.isBackwards=l,j.rendering=null,j.renderingStartTime=0,j.last=p,j.tail=d,j.tailMode=x)}function xw(a,l,d){var p=l.pendingProps,x=p.revealOrder,j=p.tail;if(Xn(a,l,p.children,d),p=Hn.current,(p&2)!==0)p=p&1|2,l.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&yw(a,d,l);else if(a.tag===19)yw(a,d,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}p&=1}switch(ee(Hn,p),x){case"forwards":for(d=l.child,x=null;d!==null;)a=d.alternate,a!==null&&bf(a)===null&&(x=d),d=d.sibling;d=x,d===null?(x=l.child,l.child=null):(x=d.sibling,d.sibling=null),kg(l,!1,x,d,j);break;case"backwards":for(d=null,x=l.child,l.child=null;x!==null;){if(a=x.alternate,a!==null&&bf(a)===null){l.child=x;break}a=x.sibling,x.sibling=d,d=x,x=a}kg(l,!0,d,null,j);break;case"together":kg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function _a(a,l,d){if(a!==null&&(l.dependencies=a.dependencies),wo|=l.lanes,(d&l.childLanes)===0)if(a!==null){if(eu(a,l,d,!1),(d&l.childLanes)===0)return null}else return null;if(a!==null&&l.child!==a.child)throw Error(r(153));if(l.child!==null){for(a=l.child,d=Sa(a,a.pendingProps),l.child=d,d.return=l;a.sibling!==null;)a=a.sibling,d=d.sibling=Sa(a,a.pendingProps),d.return=l;d.sibling=null}return l.child}function Pg(a,l){return(a.lanes&l)!==0?!0:(a=a.dependencies,!!(a!==null&&rf(a)))}function g4(a,l,d){switch(l.tag){case 3:Me(l,l.stateNode.containerInfo),uo(l,Fn,a.memoizedState.cache),Zc();break;case 27:case 5:ke(l);break;case 4:Me(l,l.stateNode.containerInfo);break;case 10:uo(l,l.type,l.memoizedProps.value);break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(go(l),l.flags|=128,null):(d&l.child.childLanes)!==0?vw(a,l,d):(go(l),a=_a(a,l,d),a!==null?a.sibling:null);go(l);break;case 19:var x=(a.flags&128)!==0;if(p=(d&l.childLanes)!==0,p||(eu(a,l,d,!1),p=(d&l.childLanes)!==0),x){if(p)return xw(a,l,d);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ee(Hn,Hn.current),p)break;return null;case 22:case 23:return l.lanes=0,fw(a,l,d);case 24:uo(l,Fn,a.memoizedState.cache)}return _a(a,l,d)}function bw(a,l,d){if(a!==null)if(a.memoizedProps!==l.pendingProps)Gn=!0;else{if(!Pg(a,d)&&(l.flags&128)===0)return Gn=!1,g4(a,l,d);Gn=(a.flags&131072)!==0}else Gn=!1,Ft&&(l.flags&1048576)!==0&&X1(l,nf,l.index);switch(l.lanes=0,l.tag){case 16:e:{a=l.pendingProps;var p=l.elementType,x=p._init;if(p=x(p._payload),l.type=p,typeof p=="function")Bm(p)?(a=gs(p,a),l.tag=1,l=mw(null,l,p,a,d)):(l.tag=0,l=Eg(null,l,p,a,d));else{if(p!=null){if(x=p.$$typeof,x===R){l.tag=11,l=cw(null,l,p,a,d);break e}else if(x===M){l.tag=14,l=uw(null,l,p,a,d);break e}}throw l=G(p)||p,Error(r(306,l,""))}}return l;case 0:return Eg(a,l,l.type,l.pendingProps,d);case 1:return p=l.type,x=gs(p,l.pendingProps),mw(a,l,p,x,d);case 3:e:{if(Me(l,l.stateNode.containerInfo),a===null)throw Error(r(387));p=l.pendingProps;var j=l.memoizedState;x=j.element,tg(a,l),su(l,p,null,d);var A=l.memoizedState;if(p=A.cache,uo(l,Fn,p),p!==j.cache&&Ym(l,[Fn],d,!0),ou(),p=A.element,j.isDehydrated)if(j={element:p,isDehydrated:!1,cache:A.cache},l.updateQueue.baseState=j,l.memoizedState=j,l.flags&256){l=gw(a,l,p,d);break e}else if(p!==x){x=ti(Error(r(424)),l),Jc(x),l=gw(a,l,p,d);break e}else{switch(a=l.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(_n=Ri(a.firstChild),dr=l,Ft=!0,us=null,qi=!0,d=ZS(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Zc(),p===x){l=_a(a,l,d);break e}Xn(a,l,p,d)}l=l.child}return l;case 26:return jf(a,l),a===null?(d=Cj(l.type,null,l.pendingProps,null))?l.memoizedState=d:Ft||(d=l.type,a=l.pendingProps,p=$f(xe.current).createElement(d),p[he]=l,p[Te]=a,Zn(p,d,a),Pt(p),l.stateNode=p):l.memoizedState=Cj(l.type,a.memoizedProps,l.pendingProps,a.memoizedState),null;case 27:return ke(l),a===null&&Ft&&(p=l.stateNode=Sj(l.type,l.pendingProps,xe.current),dr=l,qi=!0,x=_n,To(l.type)?(fv=x,_n=Ri(p.firstChild)):_n=x),Xn(a,l,l.pendingProps.children,d),jf(a,l),a===null&&(l.flags|=4194304),l.child;case 5:return a===null&&Ft&&((x=p=_n)&&(p=H4(p,l.type,l.pendingProps,qi),p!==null?(l.stateNode=p,dr=l,_n=Ri(p.firstChild),qi=!1,x=!0):x=!1),x||ds(l)),ke(l),x=l.type,j=l.pendingProps,A=a!==null?a.memoizedProps:null,p=j.children,lv(x,j)?p=null:A!==null&&lv(x,A)&&(l.flags|=32),l.memoizedState!==null&&(x=sg(a,l,l4,null,null,d),Du._currentValue=x),jf(a,l),Xn(a,l,p,d),l.child;case 6:return a===null&&Ft&&((a=d=_n)&&(d=q4(d,l.pendingProps,qi),d!==null?(l.stateNode=d,dr=l,_n=null,a=!0):a=!1),a||ds(l)),null;case 13:return vw(a,l,d);case 4:return Me(l,l.stateNode.containerInfo),p=l.pendingProps,a===null?l.child=Dl(l,null,p,d):Xn(a,l,p,d),l.child;case 11:return cw(a,l,l.type,l.pendingProps,d);case 7:return Xn(a,l,l.pendingProps,d),l.child;case 8:return Xn(a,l,l.pendingProps.children,d),l.child;case 12:return Xn(a,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,uo(l,l.type,p.value),Xn(a,l,p.children,d),l.child;case 9:return x=l.type._context,p=l.pendingProps.children,hs(l),x=rr(x),p=p(x),l.flags|=1,Xn(a,l,p,d),l.child;case 14:return uw(a,l,l.type,l.pendingProps,d);case 15:return dw(a,l,l.type,l.pendingProps,d);case 19:return xw(a,l,d);case 31:return p=l.pendingProps,d=l.mode,p={mode:p.mode,children:p.children},a===null?(d=Cf(p,d),d.ref=l.ref,l.child=d,d.return=l,l=d):(d=Sa(a.child,p),d.ref=l.ref,l.child=d,d.return=l,l=d),l;case 22:return fw(a,l,d);case 24:return hs(l),p=rr(Fn),a===null?(x=Zm(),x===null&&(x=fn,j=Xm(),x.pooledCache=j,j.refCount++,j!==null&&(x.pooledCacheLanes|=d),x=j),l.memoizedState={parent:p,cache:x},eg(l),uo(l,Fn,x)):((a.lanes&d)!==0&&(tg(a,l),su(l,null,null,d),ou()),x=a.memoizedState,j=l.memoizedState,x.parent!==p?(x={parent:p,cache:p},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),uo(l,Fn,p)):(p=j.cache,uo(l,Fn,p),p!==x.cache&&Ym(l,[Fn],d,!0))),Xn(a,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Da(a){a.flags|=4}function Sw(a,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!Dj(l)){if(l=ai.current,l!==null&&((Mt&4194048)===Mt?Gi!==null:(Mt&62914560)!==Mt&&(Mt&536870912)===0||l!==Gi))throw iu=Jm,iS;a.flags|=8192}}function Ef(a,l){l!==null&&(a.flags|=4),a.flags&16384&&(l=a.tag!==22?ro():536870912,a.lanes|=l,Nl|=l)}function pu(a,l){if(!Ft)switch(a.tailMode){case"hidden":l=a.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function jn(a){var l=a.alternate!==null&&a.alternate.child===a.child,d=0,p=0;if(l)for(var x=a.child;x!==null;)d|=x.lanes|x.childLanes,p|=x.subtreeFlags&65011712,p|=x.flags&65011712,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)d|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=p,a.childLanes=d,l}function v4(a,l,d){var p=l.pendingProps;switch(qm(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jn(l),null;case 1:return jn(l),null;case 3:return d=l.stateNode,p=null,a!==null&&(p=a.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),Ea(Fn),tt(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(Kc(l)?Da(l):a===null||a.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,J1())),jn(l),null;case 26:return d=l.memoizedState,a===null?(Da(l),d!==null?(jn(l),Sw(l,d)):(jn(l),l.flags&=-16777217)):d?d!==a.memoizedState?(Da(l),jn(l),Sw(l,d)):(jn(l),l.flags&=-16777217):(a.memoizedProps!==p&&Da(l),jn(l),l.flags&=-16777217),null;case 27:vt(l),d=xe.current;var x=l.type;if(a!==null&&l.stateNode!=null)a.memoizedProps!==p&&Da(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return jn(l),null}a=Se.current,Kc(l)?K1(l):(a=Sj(x,p,d),l.stateNode=a,Da(l))}return jn(l),null;case 5:if(vt(l),d=l.type,a!==null&&l.stateNode!=null)a.memoizedProps!==p&&Da(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return jn(l),null}if(a=Se.current,Kc(l))K1(l);else{switch(x=$f(xe.current),a){case 1:a=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:a=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":a=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":a=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":a=x.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof p.is=="string"?x.createElement("select",{is:p.is}):x.createElement("select"),p.multiple?a.multiple=!0:p.size&&(a.size=p.size);break;default:a=typeof p.is=="string"?x.createElement(d,{is:p.is}):x.createElement(d)}}a[he]=l,a[Te]=p;e:for(x=l.child;x!==null;){if(x.tag===5||x.tag===6)a.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===l)break e;for(;x.sibling===null;){if(x.return===null||x.return===l)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}l.stateNode=a;e:switch(Zn(a,d,p),d){case"button":case"input":case"select":case"textarea":a=!!p.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Da(l)}}return jn(l),l.flags&=-16777217,null;case 6:if(a&&l.stateNode!=null)a.memoizedProps!==p&&Da(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(a=xe.current,Kc(l)){if(a=l.stateNode,d=l.memoizedProps,p=null,x=dr,x!==null)switch(x.tag){case 27:case 5:p=x.memoizedProps}a[he]=l,a=!!(a.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||pj(a.nodeValue,d)),a||ds(l)}else a=$f(a).createTextNode(p),a[he]=l,l.stateNode=a}return jn(l),null;case 13:if(p=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(x=Kc(l),p!==null&&p.dehydrated!==null){if(a===null){if(!x)throw Error(r(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[he]=l}else Zc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;jn(l),x=!1}else x=J1(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(Ra(l),l):(Ra(l),null)}if(Ra(l),(l.flags&128)!==0)return l.lanes=d,l;if(d=p!==null,a=a!==null&&a.memoizedState!==null,d){p=l.child,x=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(x=p.alternate.memoizedState.cachePool.pool);var j=null;p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(j=p.memoizedState.cachePool.pool),j!==x&&(p.flags|=2048)}return d!==a&&d&&(l.child.flags|=8192),Ef(l,l.updateQueue),jn(l),null;case 4:return tt(),a===null&&rv(l.stateNode.containerInfo),jn(l),null;case 10:return Ea(l.type),jn(l),null;case 19:if(K(Hn),x=l.memoizedState,x===null)return jn(l),null;if(p=(l.flags&128)!==0,j=x.rendering,j===null)if(p)pu(x,!1);else{if(Dn!==0||a!==null&&(a.flags&128)!==0)for(a=l.child;a!==null;){if(j=bf(a),j!==null){for(l.flags|=128,pu(x,!1),a=j.updateQueue,l.updateQueue=a,Ef(l,a),l.subtreeFlags=0,a=d,d=l.child;d!==null;)Y1(d,a),d=d.sibling;return ee(Hn,Hn.current&1|2),l.child}a=a.sibling}x.tail!==null&&Ee()>_f&&(l.flags|=128,p=!0,pu(x,!1),l.lanes=4194304)}else{if(!p)if(a=bf(j),a!==null){if(l.flags|=128,p=!0,a=a.updateQueue,l.updateQueue=a,Ef(l,a),pu(x,!0),x.tail===null&&x.tailMode==="hidden"&&!j.alternate&&!Ft)return jn(l),null}else 2*Ee()-x.renderingStartTime>_f&&d!==536870912&&(l.flags|=128,p=!0,pu(x,!1),l.lanes=4194304);x.isBackwards?(j.sibling=l.child,l.child=j):(a=x.last,a!==null?a.sibling=j:l.child=j,x.last=j)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=Ee(),l.sibling=null,a=Hn.current,ee(Hn,p?a&1|2:a&1),l):(jn(l),null);case 22:case 23:return Ra(l),ag(),p=l.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(d&536870912)!==0&&(l.flags&128)===0&&(jn(l),l.subtreeFlags&6&&(l.flags|=8192)):jn(l),d=l.updateQueue,d!==null&&Ef(l,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048),a!==null&&K(ps),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Ea(Fn),jn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function y4(a,l){switch(qm(l),l.tag){case 1:return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return Ea(Fn),tt(),a=l.flags,(a&65536)!==0&&(a&128)===0?(l.flags=a&-65537|128,l):null;case 26:case 27:case 5:return vt(l),null;case 13:if(Ra(l),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Zc()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return K(Hn),null;case 4:return tt(),null;case 10:return Ea(l.type),null;case 22:case 23:return Ra(l),ag(),a!==null&&K(ps),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 24:return Ea(Fn),null;case 25:return null;default:return null}}function ww(a,l){switch(qm(l),l.tag){case 3:Ea(Fn),tt();break;case 26:case 27:case 5:vt(l);break;case 4:tt();break;case 13:Ra(l);break;case 19:K(Hn);break;case 10:Ea(l.type);break;case 22:case 23:Ra(l),ag(),a!==null&&K(ps);break;case 24:Ea(Fn)}}function mu(a,l){try{var d=l.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var x=p.next;d=x;do{if((d.tag&a)===a){p=void 0;var j=d.create,A=d.inst;p=j(),A.destroy=p}d=d.next}while(d!==x)}}catch(N){an(l,l.return,N)}}function yo(a,l,d){try{var p=l.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var j=x.next;p=j;do{if((p.tag&a)===a){var A=p.inst,N=A.destroy;if(N!==void 0){A.destroy=void 0,x=l;var B=d,ne=N;try{ne()}catch(de){an(x,B,de)}}}p=p.next}while(p!==j)}}catch(de){an(l,l.return,de)}}function jw(a){var l=a.updateQueue;if(l!==null){var d=a.stateNode;try{uS(l,d)}catch(p){an(a,a.return,p)}}}function Cw(a,l,d){d.props=gs(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(p){an(a,l,p)}}function gu(a,l){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var p=a.stateNode;break;case 30:p=a.stateNode;break;default:p=a.stateNode}typeof d=="function"?a.refCleanup=d(p):d.current=p}}catch(x){an(a,l,x)}}function Wi(a,l){var d=a.ref,p=a.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(x){an(a,l,x)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(x){an(a,l,x)}else d.current=null}function Ew(a){var l=a.type,d=a.memoizedProps,p=a.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&p.focus();break e;case"img":d.src?p.src=d.src:d.srcSet&&(p.srcset=d.srcSet)}}catch(x){an(a,a.return,x)}}function Ng(a,l,d){try{var p=a.stateNode;z4(p,a.type,d,l),p[Te]=l}catch(x){an(a,a.return,x)}}function Tw(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&To(a.type)||a.tag===4}function Og(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Tw(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&To(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Mg(a,l,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(a,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(a),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Lf));else if(p!==4&&(p===27&&To(a.type)&&(d=a.stateNode,l=null),a=a.child,a!==null))for(Mg(a,l,d),a=a.sibling;a!==null;)Mg(a,l,d),a=a.sibling}function Tf(a,l,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,l?d.insertBefore(a,l):d.appendChild(a);else if(p!==4&&(p===27&&To(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(Tf(a,l,d),a=a.sibling;a!==null;)Tf(a,l,d),a=a.sibling}function Rw(a){var l=a.stateNode,d=a.memoizedProps;try{for(var p=a.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);Zn(l,p,d),l[he]=a,l[Te]=d}catch(j){an(a,a.return,j)}}var Aa=!1,Pn=!1,Ig=!1,_w=typeof WeakSet=="function"?WeakSet:Set,Wn=null;function x4(a,l){if(a=a.containerInfo,ov=Hf,a=z1(a),Om(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var x=p.anchorOffset,j=p.focusNode;p=p.focusOffset;try{d.nodeType,j.nodeType}catch{d=null;break e}var A=0,N=-1,B=-1,ne=0,de=0,pe=a,ie=null;t:for(;;){for(var oe;pe!==d||x!==0&&pe.nodeType!==3||(N=A+x),pe!==j||p!==0&&pe.nodeType!==3||(B=A+p),pe.nodeType===3&&(A+=pe.nodeValue.length),(oe=pe.firstChild)!==null;)ie=pe,pe=oe;for(;;){if(pe===a)break t;if(ie===d&&++ne===x&&(N=A),ie===j&&++de===p&&(B=A),(oe=pe.nextSibling)!==null)break;pe=ie,ie=pe.parentNode}pe=oe}d=N===-1||B===-1?null:{start:N,end:B}}else d=null}d=d||{start:0,end:0}}else d=null;for(sv={focusedElem:a,selectionRange:d},Hf=!1,Wn=l;Wn!==null;)if(l=Wn,a=l.child,(l.subtreeFlags&1024)!==0&&a!==null)a.return=l,Wn=a;else for(;Wn!==null;){switch(l=Wn,j=l.alternate,a=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((a&1024)!==0&&j!==null){a=void 0,d=l,x=j.memoizedProps,j=j.memoizedState,p=d.stateNode;try{var ut=gs(d.type,x,d.elementType===d.type);a=p.getSnapshotBeforeUpdate(ut,j),p.__reactInternalSnapshotBeforeUpdate=a}catch(at){an(d,d.return,at)}}break;case 3:if((a&1024)!==0){if(a=l.stateNode.containerInfo,d=a.nodeType,d===9)uv(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":uv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=l.sibling,a!==null){a.return=l.return,Wn=a;break}Wn=l.return}}function Dw(a,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:xo(a,d),p&4&&mu(5,d);break;case 1:if(xo(a,d),p&4)if(a=d.stateNode,l===null)try{a.componentDidMount()}catch(A){an(d,d.return,A)}else{var x=gs(d.type,l.memoizedProps);l=l.memoizedState;try{a.componentDidUpdate(x,l,a.__reactInternalSnapshotBeforeUpdate)}catch(A){an(d,d.return,A)}}p&64&&jw(d),p&512&&gu(d,d.return);break;case 3:if(xo(a,d),p&64&&(a=d.updateQueue,a!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=d.child.stateNode;break;case 1:l=d.child.stateNode}try{uS(a,l)}catch(A){an(d,d.return,A)}}break;case 27:l===null&&p&4&&Rw(d);case 26:case 5:xo(a,d),l===null&&p&4&&Ew(d),p&512&&gu(d,d.return);break;case 12:xo(a,d);break;case 13:xo(a,d),p&4&&Pw(a,d),p&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=_4.bind(null,d),G4(a,d))));break;case 22:if(p=d.memoizedState!==null||Aa,!p){l=l!==null&&l.memoizedState!==null||Pn,x=Aa;var j=Pn;Aa=p,(Pn=l)&&!j?bo(a,d,(d.subtreeFlags&8772)!==0):xo(a,d),Aa=x,Pn=j}break;case 30:break;default:xo(a,d)}}function Aw(a){var l=a.alternate;l!==null&&(a.alternate=null,Aw(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&Xe(l)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var bn=null,Er=!1;function ka(a,l,d){for(d=d.child;d!==null;)kw(a,l,d),d=d.sibling}function kw(a,l,d){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(yt,d)}catch{}switch(d.tag){case 26:Pn||Wi(d,l),ka(a,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Pn||Wi(d,l);var p=bn,x=Er;To(d.type)&&(bn=d.stateNode,Er=!1),ka(a,l,d),Eu(d.stateNode),bn=p,Er=x;break;case 5:Pn||Wi(d,l);case 6:if(p=bn,x=Er,bn=null,ka(a,l,d),bn=p,Er=x,bn!==null)if(Er)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(d.stateNode)}catch(j){an(d,l,j)}else try{bn.removeChild(d.stateNode)}catch(j){an(d,l,j)}break;case 18:bn!==null&&(Er?(a=bn,xj(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),Nu(a)):xj(bn,d.stateNode));break;case 4:p=bn,x=Er,bn=d.stateNode.containerInfo,Er=!0,ka(a,l,d),bn=p,Er=x;break;case 0:case 11:case 14:case 15:Pn||yo(2,d,l),Pn||yo(4,d,l),ka(a,l,d);break;case 1:Pn||(Wi(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&Cw(d,l,p)),ka(a,l,d);break;case 21:ka(a,l,d);break;case 22:Pn=(p=Pn)||d.memoizedState!==null,ka(a,l,d),Pn=p;break;default:ka(a,l,d)}}function Pw(a,l){if(l.memoizedState===null&&(a=l.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Nu(a)}catch(d){an(l,l.return,d)}}function b4(a){switch(a.tag){case 13:case 19:var l=a.stateNode;return l===null&&(l=a.stateNode=new _w),l;case 22:return a=a.stateNode,l=a._retryCache,l===null&&(l=a._retryCache=new _w),l;default:throw Error(r(435,a.tag))}}function Lg(a,l){var d=b4(a);l.forEach(function(p){var x=D4.bind(null,a,p);d.has(p)||(d.add(p),p.then(x,x))})}function $r(a,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var x=d[p],j=a,A=l,N=A;e:for(;N!==null;){switch(N.tag){case 27:if(To(N.type)){bn=N.stateNode,Er=!1;break e}break;case 5:bn=N.stateNode,Er=!1;break e;case 3:case 4:bn=N.stateNode.containerInfo,Er=!0;break e}N=N.return}if(bn===null)throw Error(r(160));kw(j,A,x),bn=null,Er=!1,j=x.alternate,j!==null&&(j.return=null),x.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)Nw(l,a),l=l.sibling}var Ti=null;function Nw(a,l){var d=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:$r(l,a),zr(a),p&4&&(yo(3,a,a.return),mu(3,a),yo(5,a,a.return));break;case 1:$r(l,a),zr(a),p&512&&(Pn||d===null||Wi(d,d.return)),p&64&&Aa&&(a=a.updateQueue,a!==null&&(p=a.callbacks,p!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?p:d.concat(p))));break;case 26:var x=Ti;if($r(l,a),zr(a),p&512&&(Pn||d===null||Wi(d,d.return)),p&4){var j=d!==null?d.memoizedState:null;if(p=a.memoizedState,d===null)if(p===null)if(a.stateNode===null){e:{p=a.type,d=a.memoizedProps,x=x.ownerDocument||x;t:switch(p){case"title":j=x.getElementsByTagName("title")[0],(!j||j[it]||j[he]||j.namespaceURI==="http://www.w3.org/2000/svg"||j.hasAttribute("itemprop"))&&(j=x.createElement(p),x.head.insertBefore(j,x.querySelector("head > title"))),Zn(j,p,d),j[he]=a,Pt(j),p=j;break e;case"link":var A=Rj("link","href",x).get(p+(d.href||""));if(A){for(var N=0;N<A.length;N++)if(j=A[N],j.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&j.getAttribute("rel")===(d.rel==null?null:d.rel)&&j.getAttribute("title")===(d.title==null?null:d.title)&&j.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){A.splice(N,1);break t}}j=x.createElement(p),Zn(j,p,d),x.head.appendChild(j);break;case"meta":if(A=Rj("meta","content",x).get(p+(d.content||""))){for(N=0;N<A.length;N++)if(j=A[N],j.getAttribute("content")===(d.content==null?null:""+d.content)&&j.getAttribute("name")===(d.name==null?null:d.name)&&j.getAttribute("property")===(d.property==null?null:d.property)&&j.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&j.getAttribute("charset")===(d.charSet==null?null:d.charSet)){A.splice(N,1);break t}}j=x.createElement(p),Zn(j,p,d),x.head.appendChild(j);break;default:throw Error(r(468,p))}j[he]=a,Pt(j),p=j}a.stateNode=p}else _j(x,a.type,a.stateNode);else a.stateNode=Tj(x,p,a.memoizedProps);else j!==p?(j===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):j.count--,p===null?_j(x,a.type,a.stateNode):Tj(x,p,a.memoizedProps)):p===null&&a.stateNode!==null&&Ng(a,a.memoizedProps,d.memoizedProps)}break;case 27:$r(l,a),zr(a),p&512&&(Pn||d===null||Wi(d,d.return)),d!==null&&p&4&&Ng(a,a.memoizedProps,d.memoizedProps);break;case 5:if($r(l,a),zr(a),p&512&&(Pn||d===null||Wi(d,d.return)),a.flags&32){x=a.stateNode;try{dl(x,"")}catch(oe){an(a,a.return,oe)}}p&4&&a.stateNode!=null&&(x=a.memoizedProps,Ng(a,x,d!==null?d.memoizedProps:x)),p&1024&&(Ig=!0);break;case 6:if($r(l,a),zr(a),p&4){if(a.stateNode===null)throw Error(r(162));p=a.memoizedProps,d=a.stateNode;try{d.nodeValue=p}catch(oe){an(a,a.return,oe)}}break;case 3:if(Bf=null,x=Ti,Ti=zf(l.containerInfo),$r(l,a),Ti=x,zr(a),p&4&&d!==null&&d.memoizedState.isDehydrated)try{Nu(l.containerInfo)}catch(oe){an(a,a.return,oe)}Ig&&(Ig=!1,Ow(a));break;case 4:p=Ti,Ti=zf(a.stateNode.containerInfo),$r(l,a),zr(a),Ti=p;break;case 12:$r(l,a),zr(a);break;case 13:$r(l,a),zr(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Fg=Ee()),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Lg(a,p)));break;case 22:x=a.memoizedState!==null;var B=d!==null&&d.memoizedState!==null,ne=Aa,de=Pn;if(Aa=ne||x,Pn=de||B,$r(l,a),Pn=de,Aa=ne,zr(a),p&8192)e:for(l=a.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(d===null||B||Aa||Pn||vs(a)),d=null,l=a;;){if(l.tag===5||l.tag===26){if(d===null){B=d=l;try{if(j=B.stateNode,x)A=j.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{N=B.stateNode;var pe=B.memoizedProps.style,ie=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;N.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(oe){an(B,B.return,oe)}}}else if(l.tag===6){if(d===null){B=l;try{B.stateNode.nodeValue=x?"":B.memoizedProps}catch(oe){an(B,B.return,oe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===a)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=a.updateQueue,p!==null&&(d=p.retryQueue,d!==null&&(p.retryQueue=null,Lg(a,d))));break;case 19:$r(l,a),zr(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Lg(a,p)));break;case 30:break;case 21:break;default:$r(l,a),zr(a)}}function zr(a){var l=a.flags;if(l&2){try{for(var d,p=a.return;p!==null;){if(Tw(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var x=d.stateNode,j=Og(a);Tf(a,j,x);break;case 5:var A=d.stateNode;d.flags&32&&(dl(A,""),d.flags&=-33);var N=Og(a);Tf(a,N,A);break;case 3:case 4:var B=d.stateNode.containerInfo,ne=Og(a);Mg(a,ne,B);break;default:throw Error(r(161))}}catch(de){an(a,a.return,de)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function Ow(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var l=a;Ow(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),a=a.sibling}}function xo(a,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Dw(a,l.alternate,l),l=l.sibling}function vs(a){for(a=a.child;a!==null;){var l=a;switch(l.tag){case 0:case 11:case 14:case 15:yo(4,l,l.return),vs(l);break;case 1:Wi(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&Cw(l,l.return,d),vs(l);break;case 27:Eu(l.stateNode);case 26:case 5:Wi(l,l.return),vs(l);break;case 22:l.memoizedState===null&&vs(l);break;case 30:vs(l);break;default:vs(l)}a=a.sibling}}function bo(a,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,x=a,j=l,A=j.flags;switch(j.tag){case 0:case 11:case 15:bo(x,j,d),mu(4,j);break;case 1:if(bo(x,j,d),p=j,x=p.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ne){an(p,p.return,ne)}if(p=j,x=p.updateQueue,x!==null){var N=p.stateNode;try{var B=x.shared.hiddenCallbacks;if(B!==null)for(x.shared.hiddenCallbacks=null,x=0;x<B.length;x++)cS(B[x],N)}catch(ne){an(p,p.return,ne)}}d&&A&64&&jw(j),gu(j,j.return);break;case 27:Rw(j);case 26:case 5:bo(x,j,d),d&&p===null&&A&4&&Ew(j),gu(j,j.return);break;case 12:bo(x,j,d);break;case 13:bo(x,j,d),d&&A&4&&Pw(x,j);break;case 22:j.memoizedState===null&&bo(x,j,d),gu(j,j.return);break;case 30:break;default:bo(x,j,d)}l=l.sibling}}function $g(a,l){var d=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==d&&(a!=null&&a.refCount++,d!=null&&tu(d))}function zg(a,l){a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&tu(a))}function Qi(a,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Mw(a,l,d,p),l=l.sibling}function Mw(a,l,d,p){var x=l.flags;switch(l.tag){case 0:case 11:case 15:Qi(a,l,d,p),x&2048&&mu(9,l);break;case 1:Qi(a,l,d,p);break;case 3:Qi(a,l,d,p),x&2048&&(a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&tu(a)));break;case 12:if(x&2048){Qi(a,l,d,p),a=l.stateNode;try{var j=l.memoizedProps,A=j.id,N=j.onPostCommit;typeof N=="function"&&N(A,l.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(B){an(l,l.return,B)}}else Qi(a,l,d,p);break;case 13:Qi(a,l,d,p);break;case 23:break;case 22:j=l.stateNode,A=l.alternate,l.memoizedState!==null?j._visibility&2?Qi(a,l,d,p):vu(a,l):j._visibility&2?Qi(a,l,d,p):(j._visibility|=2,Al(a,l,d,p,(l.subtreeFlags&10256)!==0)),x&2048&&$g(A,l);break;case 24:Qi(a,l,d,p),x&2048&&zg(l.alternate,l);break;default:Qi(a,l,d,p)}}function Al(a,l,d,p,x){for(x=x&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var j=a,A=l,N=d,B=p,ne=A.flags;switch(A.tag){case 0:case 11:case 15:Al(j,A,N,B,x),mu(8,A);break;case 23:break;case 22:var de=A.stateNode;A.memoizedState!==null?de._visibility&2?Al(j,A,N,B,x):vu(j,A):(de._visibility|=2,Al(j,A,N,B,x)),x&&ne&2048&&$g(A.alternate,A);break;case 24:Al(j,A,N,B,x),x&&ne&2048&&zg(A.alternate,A);break;default:Al(j,A,N,B,x)}l=l.sibling}}function vu(a,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=a,p=l,x=p.flags;switch(p.tag){case 22:vu(d,p),x&2048&&$g(p.alternate,p);break;case 24:vu(d,p),x&2048&&zg(p.alternate,p);break;default:vu(d,p)}l=l.sibling}}var yu=8192;function kl(a){if(a.subtreeFlags&yu)for(a=a.child;a!==null;)Iw(a),a=a.sibling}function Iw(a){switch(a.tag){case 26:kl(a),a.flags&yu&&a.memoizedState!==null&&a3(Ti,a.memoizedState,a.memoizedProps);break;case 5:kl(a);break;case 3:case 4:var l=Ti;Ti=zf(a.stateNode.containerInfo),kl(a),Ti=l;break;case 22:a.memoizedState===null&&(l=a.alternate,l!==null&&l.memoizedState!==null?(l=yu,yu=16777216,kl(a),yu=l):kl(a));break;default:kl(a)}}function Lw(a){var l=a.alternate;if(l!==null&&(a=l.child,a!==null)){l.child=null;do l=a.sibling,a.sibling=null,a=l;while(a!==null)}}function xu(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Wn=p,zw(p,a)}Lw(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)$w(a),a=a.sibling}function $w(a){switch(a.tag){case 0:case 11:case 15:xu(a),a.flags&2048&&yo(9,a,a.return);break;case 3:xu(a);break;case 12:xu(a);break;case 22:var l=a.stateNode;a.memoizedState!==null&&l._visibility&2&&(a.return===null||a.return.tag!==13)?(l._visibility&=-3,Rf(a)):xu(a);break;default:xu(a)}}function Rf(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Wn=p,zw(p,a)}Lw(a)}for(a=a.child;a!==null;){switch(l=a,l.tag){case 0:case 11:case 15:yo(8,l,l.return),Rf(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Rf(l));break;default:Rf(l)}a=a.sibling}}function zw(a,l){for(;Wn!==null;){var d=Wn;switch(d.tag){case 0:case 11:case 15:yo(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var p=d.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:tu(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,Wn=p;else e:for(d=a;Wn!==null;){p=Wn;var x=p.sibling,j=p.return;if(Aw(p),p===d){Wn=null;break e}if(x!==null){x.return=j,Wn=x;break e}Wn=j}}}var S4={getCacheForType:function(a){var l=rr(Fn),d=l.data.get(a);return d===void 0&&(d=a(),l.data.set(a,d)),d}},w4=typeof WeakMap=="function"?WeakMap:Map,Yt=0,fn=null,_t=null,Mt=0,Xt=0,Ur=null,So=!1,Pl=!1,Ug=!1,Pa=0,Dn=0,wo=0,ys=0,Bg=0,oi=0,Nl=0,bu=null,Tr=null,Vg=!1,Fg=0,_f=1/0,Df=null,jo=null,Kn=0,Co=null,Ol=null,Ml=0,Hg=0,qg=null,Uw=null,Su=0,Gg=null;function Br(){if((Yt&2)!==0&&Mt!==0)return Mt&-Mt;if(P.T!==null){var a=wl;return a!==0?a:Jg()}return F()}function Bw(){oi===0&&(oi=(Mt&536870912)===0||Ft?va():536870912);var a=ai.current;return a!==null&&(a.flags|=32),oi}function Vr(a,l,d){(a===fn&&(Xt===2||Xt===9)||a.cancelPendingCommit!==null)&&(Il(a,0),Eo(a,Mt,oi,!1)),br(a,d),((Yt&2)===0||a!==fn)&&(a===fn&&((Yt&2)===0&&(ys|=d),Dn===4&&Eo(a,Mt,oi,!1)),Yi(a))}function Vw(a,l,d){if((Yt&6)!==0)throw Error(r(327));var p=!d&&(l&124)===0&&(l&a.expiredLanes)===0||Kr(a,l),x=p?E4(a,l):Yg(a,l,!0),j=p;do{if(x===0){Pl&&!p&&Eo(a,l,0,!1);break}else{if(d=a.current.alternate,j&&!j4(d)){x=Yg(a,l,!1),j=!1;continue}if(x===2){if(j=l,a.errorRecoveryDisabledLanes&j)var A=0;else A=a.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){l=A;e:{var N=a;x=bu;var B=N.current.memoizedState.isDehydrated;if(B&&(Il(N,A).flags|=256),A=Yg(N,A,!1),A!==2){if(Ug&&!B){N.errorRecoveryDisabledLanes|=j,ys|=j,x=4;break e}j=Tr,Tr=x,j!==null&&(Tr===null?Tr=j:Tr.push.apply(Tr,j))}x=A}if(j=!1,x!==2)continue}}if(x===1){Il(a,0),Eo(a,l,0,!0);break}e:{switch(p=a,j=x,j){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Eo(p,l,oi,!So);break e;case 2:Tr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=Fg+300-Ee(),10<x)){if(Eo(p,l,oi,!So),wi(p,0,!0)!==0)break e;p.timeoutHandle=vj(Fw.bind(null,p,d,Tr,Df,Vg,l,oi,ys,Nl,So,j,2,-0,0),x);break e}Fw(p,d,Tr,Df,Vg,l,oi,ys,Nl,So,j,0,-0,0)}}break}while(!0);Yi(a)}function Fw(a,l,d,p,x,j,A,N,B,ne,de,pe,ie,oe){if(a.timeoutHandle=-1,pe=l.subtreeFlags,(pe&8192||(pe&16785408)===16785408)&&(_u={stylesheets:null,count:0,unsuspend:i3},Iw(l),pe=o3(),pe!==null)){a.cancelPendingCommit=pe(Xw.bind(null,a,l,j,d,p,x,A,N,B,de,1,ie,oe)),Eo(a,j,A,!ne);return}Xw(a,l,j,d,p,x,A,N,B)}function j4(a){for(var l=a;;){var d=l.tag;if((d===0||d===11||d===15)&&l.flags&16384&&(d=l.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var p=0;p<d.length;p++){var x=d[p],j=x.getSnapshot;x=x.value;try{if(!Ir(j(),x))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Eo(a,l,d,p){l&=~Bg,l&=~ys,a.suspendedLanes|=l,a.pingedLanes&=~l,p&&(a.warmLanes|=l),p=a.expirationTimes;for(var x=l;0<x;){var j=31-kt(x),A=1<<j;p[j]=-1,x&=~A}d!==0&&ya(a,d,l)}function Af(){return(Yt&6)===0?(wu(0),!1):!0}function Wg(){if(_t!==null){if(Xt===0)var a=_t.return;else a=_t,Ca=fs=null,ug(a),_l=null,fu=0,a=_t;for(;a!==null;)ww(a.alternate,a),a=a.return;_t=null}}function Il(a,l){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,B4(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),Wg(),fn=a,_t=d=Sa(a.current,null),Mt=l,Xt=0,Ur=null,So=!1,Pl=Kr(a,l),Ug=!1,Nl=oi=Bg=ys=wo=Dn=0,Tr=bu=null,Vg=!1,(l&8)!==0&&(l|=l&32);var p=a.entangledLanes;if(p!==0)for(a=a.entanglements,p&=l;0<p;){var x=31-kt(p),j=1<<x;l|=a[x],p&=~j}return Pa=l,Kd(),d}function Hw(a,l){St=null,P.H=vf,l===ru||l===sf?(l=sS(),Xt=3):l===iS?(l=sS(),Xt=4):Xt=l===lw?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ur=l,_t===null&&(Dn=1,wf(a,ti(l,a.current)))}function qw(){var a=P.H;return P.H=vf,a===null?vf:a}function Gw(){var a=P.A;return P.A=S4,a}function Qg(){Dn=4,So||(Mt&4194048)!==Mt&&ai.current!==null||(Pl=!0),(wo&134217727)===0&&(ys&134217727)===0||fn===null||Eo(fn,Mt,oi,!1)}function Yg(a,l,d){var p=Yt;Yt|=2;var x=qw(),j=Gw();(fn!==a||Mt!==l)&&(Df=null,Il(a,l)),l=!1;var A=Dn;e:do try{if(Xt!==0&&_t!==null){var N=_t,B=Ur;switch(Xt){case 8:Wg(),A=6;break e;case 3:case 2:case 9:case 6:ai.current===null&&(l=!0);var ne=Xt;if(Xt=0,Ur=null,Ll(a,N,B,ne),d&&Pl){A=0;break e}break;default:ne=Xt,Xt=0,Ur=null,Ll(a,N,B,ne)}}C4(),A=Dn;break}catch(de){Hw(a,de)}while(!0);return l&&a.shellSuspendCounter++,Ca=fs=null,Yt=p,P.H=x,P.A=j,_t===null&&(fn=null,Mt=0,Kd()),A}function C4(){for(;_t!==null;)Ww(_t)}function E4(a,l){var d=Yt;Yt|=2;var p=qw(),x=Gw();fn!==a||Mt!==l?(Df=null,_f=Ee()+500,Il(a,l)):Pl=Kr(a,l);e:do try{if(Xt!==0&&_t!==null){l=_t;var j=Ur;t:switch(Xt){case 1:Xt=0,Ur=null,Ll(a,l,j,1);break;case 2:case 9:if(aS(j)){Xt=0,Ur=null,Qw(l);break}l=function(){Xt!==2&&Xt!==9||fn!==a||(Xt=7),Yi(a)},j.then(l,l);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:aS(j)?(Xt=0,Ur=null,Qw(l)):(Xt=0,Ur=null,Ll(a,l,j,7));break;case 5:var A=null;switch(_t.tag){case 26:A=_t.memoizedState;case 5:case 27:var N=_t;if(!A||Dj(A)){Xt=0,Ur=null;var B=N.sibling;if(B!==null)_t=B;else{var ne=N.return;ne!==null?(_t=ne,kf(ne)):_t=null}break t}}Xt=0,Ur=null,Ll(a,l,j,5);break;case 6:Xt=0,Ur=null,Ll(a,l,j,6);break;case 8:Wg(),Dn=6;break e;default:throw Error(r(462))}}T4();break}catch(de){Hw(a,de)}while(!0);return Ca=fs=null,P.H=p,P.A=x,Yt=d,_t!==null?0:(fn=null,Mt=0,Kd(),Dn)}function T4(){for(;_t!==null&&!At();)Ww(_t)}function Ww(a){var l=bw(a.alternate,a,Pa);a.memoizedProps=a.pendingProps,l===null?kf(a):_t=l}function Qw(a){var l=a,d=l.alternate;switch(l.tag){case 15:case 0:l=pw(d,l,l.pendingProps,l.type,void 0,Mt);break;case 11:l=pw(d,l,l.pendingProps,l.type.render,l.ref,Mt);break;case 5:ug(l);default:ww(d,l),l=_t=Y1(l,Pa),l=bw(d,l,Pa)}a.memoizedProps=a.pendingProps,l===null?kf(a):_t=l}function Ll(a,l,d,p){Ca=fs=null,ug(l),_l=null,fu=0;var x=l.return;try{if(m4(a,x,l,d,Mt)){Dn=1,wf(a,ti(d,a.current)),_t=null;return}}catch(j){if(x!==null)throw _t=x,j;Dn=1,wf(a,ti(d,a.current)),_t=null;return}l.flags&32768?(Ft||p===1?a=!0:Pl||(Mt&536870912)!==0?a=!1:(So=a=!0,(p===2||p===9||p===3||p===6)&&(p=ai.current,p!==null&&p.tag===13&&(p.flags|=16384))),Yw(l,a)):kf(l)}function kf(a){var l=a;do{if((l.flags&32768)!==0){Yw(l,So);return}a=l.return;var d=v4(l.alternate,l,Pa);if(d!==null){_t=d;return}if(l=l.sibling,l!==null){_t=l;return}_t=l=a}while(l!==null);Dn===0&&(Dn=5)}function Yw(a,l){do{var d=y4(a.alternate,a);if(d!==null){d.flags&=32767,_t=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(a=a.sibling,a!==null)){_t=a;return}_t=a=d}while(a!==null);Dn=6,_t=null}function Xw(a,l,d,p,x,j,A,N,B){a.cancelPendingCommit=null;do Pf();while(Kn!==0);if((Yt&6)!==0)throw Error(r(327));if(l!==null){if(l===a.current)throw Error(r(177));if(j=l.lanes|l.childLanes,j|=zm,qn(a,d,j,A,N,B),a===fn&&(_t=fn=null,Mt=0),Ol=l,Co=a,Ml=d,Hg=j,qg=x,Uw=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,A4(me,function(){return tj(),null})):(a.callbackNode=null,a.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=P.T,P.T=null,x=L.p,L.p=2,A=Yt,Yt|=4;try{x4(a,l,d)}finally{Yt=A,L.p=x,P.T=p}}Kn=1,Kw(),Zw(),Jw()}}function Kw(){if(Kn===1){Kn=0;var a=Co,l=Ol,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=P.T,P.T=null;var p=L.p;L.p=2;var x=Yt;Yt|=4;try{Nw(l,a);var j=sv,A=z1(a.containerInfo),N=j.focusedElem,B=j.selectionRange;if(A!==N&&N&&N.ownerDocument&&$1(N.ownerDocument.documentElement,N)){if(B!==null&&Om(N)){var ne=B.start,de=B.end;if(de===void 0&&(de=ne),"selectionStart"in N)N.selectionStart=ne,N.selectionEnd=Math.min(de,N.value.length);else{var pe=N.ownerDocument||document,ie=pe&&pe.defaultView||window;if(ie.getSelection){var oe=ie.getSelection(),ut=N.textContent.length,at=Math.min(B.start,ut),tn=B.end===void 0?at:Math.min(B.end,ut);!oe.extend&&at>tn&&(A=tn,tn=at,at=A);var Q=L1(N,at),q=L1(N,tn);if(Q&&q&&(oe.rangeCount!==1||oe.anchorNode!==Q.node||oe.anchorOffset!==Q.offset||oe.focusNode!==q.node||oe.focusOffset!==q.offset)){var te=pe.createRange();te.setStart(Q.node,Q.offset),oe.removeAllRanges(),at>tn?(oe.addRange(te),oe.extend(q.node,q.offset)):(te.setEnd(q.node,q.offset),oe.addRange(te))}}}}for(pe=[],oe=N;oe=oe.parentNode;)oe.nodeType===1&&pe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<pe.length;N++){var fe=pe[N];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Hf=!!ov,sv=ov=null}finally{Yt=x,L.p=p,P.T=d}}a.current=l,Kn=2}}function Zw(){if(Kn===2){Kn=0;var a=Co,l=Ol,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=P.T,P.T=null;var p=L.p;L.p=2;var x=Yt;Yt|=4;try{Dw(a,l.alternate,l)}finally{Yt=x,L.p=p,P.T=d}}Kn=3}}function Jw(){if(Kn===4||Kn===3){Kn=0,rn();var a=Co,l=Ol,d=Ml,p=Uw;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Kn=5:(Kn=0,Ol=Co=null,ej(a,a.pendingLanes));var x=a.pendingLanes;if(x===0&&(jo=null),ns(d),l=l.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(yt,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=P.T,x=L.p,L.p=2,P.T=null;try{for(var j=a.onRecoverableError,A=0;A<p.length;A++){var N=p[A];j(N.value,{componentStack:N.stack})}}finally{P.T=l,L.p=x}}(Ml&3)!==0&&Pf(),Yi(a),x=a.pendingLanes,(d&4194090)!==0&&(x&42)!==0?a===Gg?Su++:(Su=0,Gg=a):Su=0,wu(0)}}function ej(a,l){(a.pooledCacheLanes&=l)===0&&(l=a.pooledCache,l!=null&&(a.pooledCache=null,tu(l)))}function Pf(a){return Kw(),Zw(),Jw(),tj()}function tj(){if(Kn!==5)return!1;var a=Co,l=Hg;Hg=0;var d=ns(Ml),p=P.T,x=L.p;try{L.p=32>d?32:d,P.T=null,d=qg,qg=null;var j=Co,A=Ml;if(Kn=0,Ol=Co=null,Ml=0,(Yt&6)!==0)throw Error(r(331));var N=Yt;if(Yt|=4,$w(j.current),Mw(j,j.current,A,d),Yt=N,wu(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(yt,j)}catch{}return!0}finally{L.p=x,P.T=p,ej(a,l)}}function nj(a,l,d){l=ti(d,l),l=Cg(a.stateNode,l,2),a=po(a,l,2),a!==null&&(br(a,2),Yi(a))}function an(a,l,d){if(a.tag===3)nj(a,a,d);else for(;l!==null;){if(l.tag===3){nj(l,a,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(jo===null||!jo.has(p))){a=ti(d,a),d=ow(2),p=po(l,d,2),p!==null&&(sw(d,p,l,a),br(p,2),Yi(p));break}}l=l.return}}function Xg(a,l,d){var p=a.pingCache;if(p===null){p=a.pingCache=new w4;var x=new Set;p.set(l,x)}else x=p.get(l),x===void 0&&(x=new Set,p.set(l,x));x.has(d)||(Ug=!0,x.add(d),a=R4.bind(null,a,l,d),l.then(a,a))}function R4(a,l,d){var p=a.pingCache;p!==null&&p.delete(l),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,fn===a&&(Mt&d)===d&&(Dn===4||Dn===3&&(Mt&62914560)===Mt&&300>Ee()-Fg?(Yt&2)===0&&Il(a,0):Bg|=d,Nl===Mt&&(Nl=0)),Yi(a)}function rj(a,l){l===0&&(l=ro()),a=yl(a,l),a!==null&&(br(a,l),Yi(a))}function _4(a){var l=a.memoizedState,d=0;l!==null&&(d=l.retryLane),rj(a,d)}function D4(a,l){var d=0;switch(a.tag){case 13:var p=a.stateNode,x=a.memoizedState;x!==null&&(d=x.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(l),rj(a,d)}function A4(a,l){return $t(a,l)}var Nf=null,$l=null,Kg=!1,Of=!1,Zg=!1,xs=0;function Yi(a){a!==$l&&a.next===null&&($l===null?Nf=$l=a:$l=$l.next=a),Of=!0,Kg||(Kg=!0,P4())}function wu(a,l){if(!Zg&&Of){Zg=!0;do for(var d=!1,p=Nf;p!==null;){if(a!==0){var x=p.pendingLanes;if(x===0)var j=0;else{var A=p.suspendedLanes,N=p.pingedLanes;j=(1<<31-kt(42|a)+1)-1,j&=x&~(A&~N),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(d=!0,sj(p,j))}else j=Mt,j=wi(p,p===fn?j:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(j&3)===0||Kr(p,j)||(d=!0,sj(p,j));p=p.next}while(d);Zg=!1}}function k4(){ij()}function ij(){Of=Kg=!1;var a=0;xs!==0&&(U4()&&(a=xs),xs=0);for(var l=Ee(),d=null,p=Nf;p!==null;){var x=p.next,j=aj(p,l);j===0?(p.next=null,d===null?Nf=x:d.next=x,x===null&&($l=d)):(d=p,(a!==0||(j&3)!==0)&&(Of=!0)),p=x}wu(a)}function aj(a,l){for(var d=a.suspendedLanes,p=a.pingedLanes,x=a.expirationTimes,j=a.pendingLanes&-62914561;0<j;){var A=31-kt(j),N=1<<A,B=x[A];B===-1?((N&d)===0||(N&p)!==0)&&(x[A]=cl(N,l)):B<=l&&(a.expiredLanes|=N),j&=~N}if(l=fn,d=Mt,d=wi(a,a===l?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p=a.callbackNode,d===0||a===l&&(Xt===2||Xt===9)||a.cancelPendingCommit!==null)return p!==null&&p!==null&&gt(p),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||Kr(a,d)){if(l=d&-d,l===a.callbackPriority)return l;switch(p!==null&&gt(p),ns(d)){case 2:case 8:d=Re;break;case 32:d=me;break;case 268435456:d=Ne;break;default:d=me}return p=oj.bind(null,a),d=$t(d,p),a.callbackPriority=l,a.callbackNode=d,l}return p!==null&&p!==null&&gt(p),a.callbackPriority=2,a.callbackNode=null,2}function oj(a,l){if(Kn!==0&&Kn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(Pf()&&a.callbackNode!==d)return null;var p=Mt;return p=wi(a,a===fn?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p===0?null:(Vw(a,p,l),aj(a,Ee()),a.callbackNode!=null&&a.callbackNode===d?oj.bind(null,a):null)}function sj(a,l){if(Pf())return null;Vw(a,l,!0)}function P4(){V4(function(){(Yt&6)!==0?$t(We,k4):ij()})}function Jg(){return xs===0&&(xs=va()),xs}function lj(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Hd(""+a)}function cj(a,l){var d=l.ownerDocument.createElement("input");return d.name=l.name,d.value=l.value,a.id&&d.setAttribute("form",a.id),l.parentNode.insertBefore(d,l),a=new FormData(a),d.parentNode.removeChild(d),a}function N4(a,l,d,p,x){if(l==="submit"&&d&&d.stateNode===x){var j=lj((x[Te]||null).action),A=p.submitter;A&&(l=(l=A[Te]||null)?lj(l.formAction):A.getAttribute("formAction"),l!==null&&(j=l,A=null));var N=new Qd("action","action",null,p,x);a.push({event:N,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(xs!==0){var B=A?cj(x,A):new FormData(x);xg(d,{pending:!0,data:B,method:x.method,action:j},null,B)}}else typeof j=="function"&&(N.preventDefault(),B=A?cj(x,A):new FormData(x),xg(d,{pending:!0,data:B,method:x.method,action:j},j,B))},currentTarget:x}]})}}for(var ev=0;ev<$m.length;ev++){var tv=$m[ev],O4=tv.toLowerCase(),M4=tv[0].toUpperCase()+tv.slice(1);Ei(O4,"on"+M4)}Ei(V1,"onAnimationEnd"),Ei(F1,"onAnimationIteration"),Ei(H1,"onAnimationStart"),Ei("dblclick","onDoubleClick"),Ei("focusin","onFocus"),Ei("focusout","onBlur"),Ei(ZP,"onTransitionRun"),Ei(JP,"onTransitionStart"),Ei(e4,"onTransitionCancel"),Ei(q1,"onTransitionEnd"),Zr("onMouseEnter",["mouseout","mouseover"]),Zr("onMouseLeave",["mouseout","mouseover"]),Zr("onPointerEnter",["pointerout","pointerover"]),Zr("onPointerLeave",["pointerout","pointerover"]),ur("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ur("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ur("onBeforeInput",["compositionend","keypress","textInput","paste"]),ur("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ur("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ur("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ju="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(" "),I4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ju));function uj(a,l){l=(l&4)!==0;for(var d=0;d<a.length;d++){var p=a[d],x=p.event;p=p.listeners;e:{var j=void 0;if(l)for(var A=p.length-1;0<=A;A--){var N=p[A],B=N.instance,ne=N.currentTarget;if(N=N.listener,B!==j&&x.isPropagationStopped())break e;j=N,x.currentTarget=ne;try{j(x)}catch(de){Sf(de)}x.currentTarget=null,j=B}else for(A=0;A<p.length;A++){if(N=p[A],B=N.instance,ne=N.currentTarget,N=N.listener,B!==j&&x.isPropagationStopped())break e;j=N,x.currentTarget=ne;try{j(x)}catch(de){Sf(de)}x.currentTarget=null,j=B}}}}function Dt(a,l){var d=l[nt];d===void 0&&(d=l[nt]=new Set);var p=a+"__bubble";d.has(p)||(dj(l,a,2,!1),d.add(p))}function nv(a,l,d){var p=0;l&&(p|=4),dj(d,a,p,l)}var Mf="_reactListening"+Math.random().toString(36).slice(2);function rv(a){if(!a[Mf]){a[Mf]=!0,Rt.forEach(function(d){d!=="selectionchange"&&(I4.has(d)||nv(d,!1,a),nv(d,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Mf]||(l[Mf]=!0,nv("selectionchange",!1,l))}}function dj(a,l,d,p){switch(Mj(l)){case 2:var x=c3;break;case 8:x=u3;break;default:x=vv}d=x.bind(null,l,d,a),x=void 0,!Em||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),p?x!==void 0?a.addEventListener(l,d,{capture:!0,passive:x}):a.addEventListener(l,d,!0):x!==void 0?a.addEventListener(l,d,{passive:x}):a.addEventListener(l,d,!1)}function iv(a,l,d,p,x){var j=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var N=p.stateNode.containerInfo;if(N===x)break;if(A===4)for(A=p.return;A!==null;){var B=A.tag;if((B===3||B===4)&&A.stateNode.containerInfo===x)return;A=A.return}for(;N!==null;){if(A=st(N),A===null)return;if(B=A.tag,B===5||B===6||B===26||B===27){p=j=A;continue e}N=N.parentNode}}p=p.return}y1(function(){var ne=j,de=jm(d),pe=[];e:{var ie=G1.get(a);if(ie!==void 0){var oe=Qd,ut=a;switch(a){case"keypress":if(Gd(d)===0)break e;case"keydown":case"keyup":oe=AP;break;case"focusin":ut="focus",oe=Dm;break;case"focusout":ut="blur",oe=Dm;break;case"beforeblur":case"afterblur":oe=Dm;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=S1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=yP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=NP;break;case V1:case F1:case H1:oe=SP;break;case q1:oe=MP;break;case"scroll":case"scrollend":oe=gP;break;case"wheel":oe=LP;break;case"copy":case"cut":case"paste":oe=jP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=j1;break;case"toggle":case"beforetoggle":oe=zP}var at=(l&4)!==0,tn=!at&&(a==="scroll"||a==="scrollend"),Q=at?ie!==null?ie+"Capture":null:ie;at=[];for(var q=ne,te;q!==null;){var fe=q;if(te=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||te===null||Q===null||(fe=Vc(q,Q),fe!=null&&at.push(Cu(q,fe,te))),tn)break;q=q.return}0<at.length&&(ie=new oe(ie,ut,null,d,de),pe.push({event:ie,listeners:at}))}}if((l&7)===0){e:{if(ie=a==="mouseover"||a==="pointerover",oe=a==="mouseout"||a==="pointerout",ie&&d!==wm&&(ut=d.relatedTarget||d.fromElement)&&(st(ut)||ut[Be]))break e;if((oe||ie)&&(ie=de.window===de?de:(ie=de.ownerDocument)?ie.defaultView||ie.parentWindow:window,oe?(ut=d.relatedTarget||d.toElement,oe=ne,ut=ut?st(ut):null,ut!==null&&(tn=o(ut),at=ut.tag,ut!==tn||at!==5&&at!==27&&at!==6)&&(ut=null)):(oe=null,ut=ne),oe!==ut)){if(at=S1,fe="onMouseLeave",Q="onMouseEnter",q="mouse",(a==="pointerout"||a==="pointerover")&&(at=j1,fe="onPointerLeave",Q="onPointerEnter",q="pointer"),tn=oe==null?ie:Qt(oe),te=ut==null?ie:Qt(ut),ie=new at(fe,q+"leave",oe,d,de),ie.target=tn,ie.relatedTarget=te,fe=null,st(de)===ne&&(at=new at(Q,q+"enter",ut,d,de),at.target=te,at.relatedTarget=tn,fe=at),tn=fe,oe&&ut)t:{for(at=oe,Q=ut,q=0,te=at;te;te=zl(te))q++;for(te=0,fe=Q;fe;fe=zl(fe))te++;for(;0<q-te;)at=zl(at),q--;for(;0<te-q;)Q=zl(Q),te--;for(;q--;){if(at===Q||Q!==null&&at===Q.alternate)break t;at=zl(at),Q=zl(Q)}at=null}else at=null;oe!==null&&fj(pe,ie,oe,at,!1),ut!==null&&tn!==null&&fj(pe,tn,ut,at,!0)}}e:{if(ie=ne?Qt(ne):window,oe=ie.nodeName&&ie.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ie.type==="file")var He=k1;else if(D1(ie))if(P1)He=YP;else{He=WP;var Et=GP}else oe=ie.nodeName,!oe||oe.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ne&&Sm(ne.elementType)&&(He=k1):He=QP;if(He&&(He=He(a,ne))){A1(pe,He,d,de);break e}Et&&Et(a,ie,ne),a==="focusout"&&ne&&ie.type==="number"&&ne.memoizedProps.value!=null&&bm(ie,"number",ie.value)}switch(Et=ne?Qt(ne):window,a){case"focusin":(D1(Et)||Et.contentEditable==="true")&&(ml=Et,Mm=ne,Xc=null);break;case"focusout":Xc=Mm=ml=null;break;case"mousedown":Im=!0;break;case"contextmenu":case"mouseup":case"dragend":Im=!1,U1(pe,d,de);break;case"selectionchange":if(KP)break;case"keydown":case"keyup":U1(pe,d,de)}var et;if(km)e:{switch(a){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else pl?R1(a,d)&&(lt="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(lt="onCompositionStart");lt&&(C1&&d.locale!=="ko"&&(pl||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&pl&&(et=x1()):(co=de,Tm="value"in co?co.value:co.textContent,pl=!0)),Et=If(ne,lt),0<Et.length&&(lt=new w1(lt,a,null,d,de),pe.push({event:lt,listeners:Et}),et?lt.data=et:(et=_1(d),et!==null&&(lt.data=et)))),(et=BP?VP(a,d):FP(a,d))&&(lt=If(ne,"onBeforeInput"),0<lt.length&&(Et=new w1("onBeforeInput","beforeinput",null,d,de),pe.push({event:Et,listeners:lt}),Et.data=et)),N4(pe,a,ne,d,de)}uj(pe,l)})}function Cu(a,l,d){return{instance:a,listener:l,currentTarget:d}}function If(a,l){for(var d=l+"Capture",p=[];a!==null;){var x=a,j=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||j===null||(x=Vc(a,d),x!=null&&p.unshift(Cu(a,x,j)),x=Vc(a,l),x!=null&&p.push(Cu(a,x,j))),a.tag===3)return p;a=a.return}return[]}function zl(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function fj(a,l,d,p,x){for(var j=l._reactName,A=[];d!==null&&d!==p;){var N=d,B=N.alternate,ne=N.stateNode;if(N=N.tag,B!==null&&B===p)break;N!==5&&N!==26&&N!==27||ne===null||(B=ne,x?(ne=Vc(d,j),ne!=null&&A.unshift(Cu(d,ne,B))):x||(ne=Vc(d,j),ne!=null&&A.push(Cu(d,ne,B)))),d=d.return}A.length!==0&&a.push({event:l,listeners:A})}var L4=/\r\n?/g,$4=/\u0000|\uFFFD/g;function hj(a){return(typeof a=="string"?a:""+a).replace(L4,`
565
- `).replace($4,"")}function pj(a,l){return l=hj(l),hj(a)===l}function Lf(){}function en(a,l,d,p,x,j){switch(d){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||dl(a,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&dl(a,""+p);break;case"className":xa(a,"class",p);break;case"tabIndex":xa(a,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":xa(a,d,p);break;case"style":g1(a,p,j);break;case"data":if(l!=="object"){xa(a,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||d!=="href")){a.removeAttribute(d);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(d);break}p=Hd(""+p),a.setAttribute(d,p);break;case"action":case"formAction":if(typeof p=="function"){a.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof j=="function"&&(d==="formAction"?(l!=="input"&&en(a,l,"name",x.name,x,null),en(a,l,"formEncType",x.formEncType,x,null),en(a,l,"formMethod",x.formMethod,x,null),en(a,l,"formTarget",x.formTarget,x,null)):(en(a,l,"encType",x.encType,x,null),en(a,l,"method",x.method,x,null),en(a,l,"target",x.target,x,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(d);break}p=Hd(""+p),a.setAttribute(d,p);break;case"onClick":p!=null&&(a.onclick=Lf);break;case"onScroll":p!=null&&Dt("scroll",a);break;case"onScrollEnd":p!=null&&Dt("scrollend",a);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":a.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){a.removeAttribute("xlink:href");break}d=Hd(""+p),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,""+p):a.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":p===!0?a.setAttribute(d,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,p):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?a.setAttribute(d,p):a.removeAttribute(d);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?a.removeAttribute(d):a.setAttribute(d,p);break;case"popover":Dt("beforetoggle",a),Dt("toggle",a),Jr(a,"popover",p);break;case"xlinkActuate":Ct(a,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Ct(a,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Ct(a,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Ct(a,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Ct(a,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Ct(a,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Ct(a,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Ct(a,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Ct(a,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Jr(a,"is",p);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=pP.get(d)||d,Jr(a,d,p))}}function av(a,l,d,p,x,j){switch(d){case"style":g1(a,p,j);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof p=="string"?dl(a,p):(typeof p=="number"||typeof p=="bigint")&&dl(a,""+p);break;case"onScroll":p!=null&&Dt("scroll",a);break;case"onScrollEnd":p!=null&&Dt("scrollend",a);break;case"onClick":p!=null&&(a.onclick=Lf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ao.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(x=d.endsWith("Capture"),l=d.slice(2,x?d.length-7:void 0),j=a[Te]||null,j=j!=null?j[d]:null,typeof j=="function"&&a.removeEventListener(l,j,x),typeof p=="function")){typeof j!="function"&&j!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(l,p,x);break e}d in a?a[d]=p:p===!0?a.setAttribute(d,""):Jr(a,d,p)}}}function Zn(a,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Dt("error",a),Dt("load",a);var p=!1,x=!1,j;for(j in d)if(d.hasOwnProperty(j)){var A=d[j];if(A!=null)switch(j){case"src":p=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:en(a,l,j,A,d,null)}}x&&en(a,l,"srcSet",d.srcSet,d,null),p&&en(a,l,"src",d.src,d,null);return;case"input":Dt("invalid",a);var N=j=A=x=null,B=null,ne=null;for(p in d)if(d.hasOwnProperty(p)){var de=d[p];if(de!=null)switch(p){case"name":x=de;break;case"type":A=de;break;case"checked":B=de;break;case"defaultChecked":ne=de;break;case"value":j=de;break;case"defaultValue":N=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,l));break;default:en(a,l,p,de,d,null)}}f1(a,j,N,B,ne,A,x,!1),Vd(a);return;case"select":Dt("invalid",a),p=A=j=null;for(x in d)if(d.hasOwnProperty(x)&&(N=d[x],N!=null))switch(x){case"value":j=N;break;case"defaultValue":A=N;break;case"multiple":p=N;default:en(a,l,x,N,d,null)}l=j,d=A,a.multiple=!!p,l!=null?ul(a,!!p,l,!1):d!=null&&ul(a,!!p,d,!0);return;case"textarea":Dt("invalid",a),j=x=p=null;for(A in d)if(d.hasOwnProperty(A)&&(N=d[A],N!=null))switch(A){case"value":p=N;break;case"defaultValue":x=N;break;case"children":j=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:en(a,l,A,N,d,null)}p1(a,p,x,j),Vd(a);return;case"option":for(B in d)if(d.hasOwnProperty(B)&&(p=d[B],p!=null))switch(B){case"selected":a.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:en(a,l,B,p,d,null)}return;case"dialog":Dt("beforetoggle",a),Dt("toggle",a),Dt("cancel",a),Dt("close",a);break;case"iframe":case"object":Dt("load",a);break;case"video":case"audio":for(p=0;p<ju.length;p++)Dt(ju[p],a);break;case"image":Dt("error",a),Dt("load",a);break;case"details":Dt("toggle",a);break;case"embed":case"source":case"link":Dt("error",a),Dt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in d)if(d.hasOwnProperty(ne)&&(p=d[ne],p!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:en(a,l,ne,p,d,null)}return;default:if(Sm(l)){for(de in d)d.hasOwnProperty(de)&&(p=d[de],p!==void 0&&av(a,l,de,p,d,void 0));return}}for(N in d)d.hasOwnProperty(N)&&(p=d[N],p!=null&&en(a,l,N,p,d,null))}function z4(a,l,d,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,j=null,A=null,N=null,B=null,ne=null,de=null;for(oe in d){var pe=d[oe];if(d.hasOwnProperty(oe)&&pe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":B=pe;default:p.hasOwnProperty(oe)||en(a,l,oe,null,p,pe)}}for(var ie in p){var oe=p[ie];if(pe=d[ie],p.hasOwnProperty(ie)&&(oe!=null||pe!=null))switch(ie){case"type":j=oe;break;case"name":x=oe;break;case"checked":ne=oe;break;case"defaultChecked":de=oe;break;case"value":A=oe;break;case"defaultValue":N=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,l));break;default:oe!==pe&&en(a,l,ie,oe,p,pe)}}xm(a,A,N,B,ne,de,j,x);return;case"select":oe=A=N=ie=null;for(j in d)if(B=d[j],d.hasOwnProperty(j)&&B!=null)switch(j){case"value":break;case"multiple":oe=B;default:p.hasOwnProperty(j)||en(a,l,j,null,p,B)}for(x in p)if(j=p[x],B=d[x],p.hasOwnProperty(x)&&(j!=null||B!=null))switch(x){case"value":ie=j;break;case"defaultValue":N=j;break;case"multiple":A=j;default:j!==B&&en(a,l,x,j,p,B)}l=N,d=A,p=oe,ie!=null?ul(a,!!d,ie,!1):!!p!=!!d&&(l!=null?ul(a,!!d,l,!0):ul(a,!!d,d?[]:"",!1));return;case"textarea":oe=ie=null;for(N in d)if(x=d[N],d.hasOwnProperty(N)&&x!=null&&!p.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:en(a,l,N,null,p,x)}for(A in p)if(x=p[A],j=d[A],p.hasOwnProperty(A)&&(x!=null||j!=null))switch(A){case"value":ie=x;break;case"defaultValue":oe=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==j&&en(a,l,A,x,p,j)}h1(a,ie,oe);return;case"option":for(var ut in d)if(ie=d[ut],d.hasOwnProperty(ut)&&ie!=null&&!p.hasOwnProperty(ut))switch(ut){case"selected":a.selected=!1;break;default:en(a,l,ut,null,p,ie)}for(B in p)if(ie=p[B],oe=d[B],p.hasOwnProperty(B)&&ie!==oe&&(ie!=null||oe!=null))switch(B){case"selected":a.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:en(a,l,B,ie,p,oe)}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 at in d)ie=d[at],d.hasOwnProperty(at)&&ie!=null&&!p.hasOwnProperty(at)&&en(a,l,at,null,p,ie);for(ne in p)if(ie=p[ne],oe=d[ne],p.hasOwnProperty(ne)&&ie!==oe&&(ie!=null||oe!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,l));break;default:en(a,l,ne,ie,p,oe)}return;default:if(Sm(l)){for(var tn in d)ie=d[tn],d.hasOwnProperty(tn)&&ie!==void 0&&!p.hasOwnProperty(tn)&&av(a,l,tn,void 0,p,ie);for(de in p)ie=p[de],oe=d[de],!p.hasOwnProperty(de)||ie===oe||ie===void 0&&oe===void 0||av(a,l,de,ie,p,oe);return}}for(var Q in d)ie=d[Q],d.hasOwnProperty(Q)&&ie!=null&&!p.hasOwnProperty(Q)&&en(a,l,Q,null,p,ie);for(pe in p)ie=p[pe],oe=d[pe],!p.hasOwnProperty(pe)||ie===oe||ie==null&&oe==null||en(a,l,pe,ie,p,oe)}var ov=null,sv=null;function $f(a){return a.nodeType===9?a:a.ownerDocument}function mj(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gj(a,l){if(a===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&l==="foreignObject"?0:a}function lv(a,l){return a==="textarea"||a==="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 cv=null;function U4(){var a=window.event;return a&&a.type==="popstate"?a===cv?!1:(cv=a,!0):(cv=null,!1)}var vj=typeof setTimeout=="function"?setTimeout:void 0,B4=typeof clearTimeout=="function"?clearTimeout:void 0,yj=typeof Promise=="function"?Promise:void 0,V4=typeof queueMicrotask=="function"?queueMicrotask:typeof yj<"u"?function(a){return yj.resolve(null).then(a).catch(F4)}:vj;function F4(a){setTimeout(function(){throw a})}function To(a){return a==="head"}function xj(a,l){var d=l,p=0,x=0;do{var j=d.nextSibling;if(a.removeChild(d),j&&j.nodeType===8)if(d=j.data,d==="/$"){if(0<p&&8>p){d=p;var A=a.ownerDocument;if(d&1&&Eu(A.documentElement),d&2&&Eu(A.body),d&4)for(d=A.head,Eu(d),A=d.firstChild;A;){var N=A.nextSibling,B=A.nodeName;A[it]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&A.rel.toLowerCase()==="stylesheet"||d.removeChild(A),A=N}}if(x===0){a.removeChild(j),Nu(l);return}x--}else d==="$"||d==="$?"||d==="$!"?x++:p=d.charCodeAt(0)-48;else p=0;d=j}while(d);Nu(l)}function uv(a){var l=a.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var d=l;switch(l=l.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":uv(d),Xe(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function H4(a,l,d,p){for(;a.nodeType===1;){var x=d;if(a.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(p){if(!a[it])switch(l){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(j=a.getAttribute("rel"),j==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(j!==x.rel||a.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||a.getAttribute("title")!==(x.title==null?null:x.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(j=a.getAttribute("src"),(j!==(x.src==null?null:x.src)||a.getAttribute("type")!==(x.type==null?null:x.type)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&j&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(l==="input"&&a.type==="hidden"){var j=x.name==null?null:""+x.name;if(x.type==="hidden"&&a.getAttribute("name")===j)return a}else return a;if(a=Ri(a.nextSibling),a===null)break}return null}function q4(a,l,d){if(l==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=Ri(a.nextSibling),a===null))return null;return a}function dv(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState==="complete"}function G4(a,l){var d=a.ownerDocument;if(a.data!=="$?"||d.readyState==="complete")l();else{var p=function(){l(),d.removeEventListener("DOMContentLoaded",p)};d.addEventListener("DOMContentLoaded",p),a._reactRetry=p}}function Ri(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?"||l==="F!"||l==="F")break;if(l==="/$")return null}}return a}var fv=null;function bj(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return a;l--}else d==="/$"&&l++}a=a.previousSibling}return null}function Sj(a,l,d){switch(l=$f(d),a){case"html":if(a=l.documentElement,!a)throw Error(r(452));return a;case"head":if(a=l.head,!a)throw Error(r(453));return a;case"body":if(a=l.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Eu(a){for(var l=a.attributes;l.length;)a.removeAttributeNode(l[0]);Xe(a)}var si=new Map,wj=new Set;function zf(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Na=L.d;L.d={f:W4,r:Q4,D:Y4,C:X4,L:K4,m:Z4,X:e3,S:J4,M:t3};function W4(){var a=Na.f(),l=Af();return a||l}function Q4(a){var l=Ke(a);l!==null&&l.tag===5&&l.type==="form"?VS(l):Na.r(a)}var Ul=typeof document>"u"?null:document;function jj(a,l,d){var p=Ul;if(p&&typeof l=="string"&&l){var x=ei(l);x='link[rel="'+a+'"][href="'+x+'"]',typeof d=="string"&&(x+='[crossorigin="'+d+'"]'),wj.has(x)||(wj.add(x),a={rel:a,crossOrigin:d,href:l},p.querySelector(x)===null&&(l=p.createElement("link"),Zn(l,"link",a),Pt(l),p.head.appendChild(l)))}}function Y4(a){Na.D(a),jj("dns-prefetch",a,null)}function X4(a,l){Na.C(a,l),jj("preconnect",a,l)}function K4(a,l,d){Na.L(a,l,d);var p=Ul;if(p&&a&&l){var x='link[rel="preload"][as="'+ei(l)+'"]';l==="image"&&d&&d.imageSrcSet?(x+='[imagesrcset="'+ei(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(x+='[imagesizes="'+ei(d.imageSizes)+'"]')):x+='[href="'+ei(a)+'"]';var j=x;switch(l){case"style":j=Bl(a);break;case"script":j=Vl(a)}si.has(j)||(a=m({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:a,as:l},d),si.set(j,a),p.querySelector(x)!==null||l==="style"&&p.querySelector(Tu(j))||l==="script"&&p.querySelector(Ru(j))||(l=p.createElement("link"),Zn(l,"link",a),Pt(l),p.head.appendChild(l)))}}function Z4(a,l){Na.m(a,l);var d=Ul;if(d&&a){var p=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+ei(p)+'"][href="'+ei(a)+'"]',j=x;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=Vl(a)}if(!si.has(j)&&(a=m({rel:"modulepreload",href:a},l),si.set(j,a),d.querySelector(x)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Ru(j)))return}p=d.createElement("link"),Zn(p,"link",a),Pt(p),d.head.appendChild(p)}}}function J4(a,l,d){Na.S(a,l,d);var p=Ul;if(p&&a){var x=dn(p).hoistableStyles,j=Bl(a);l=l||"default";var A=x.get(j);if(!A){var N={loading:0,preload:null};if(A=p.querySelector(Tu(j)))N.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":l},d),(d=si.get(j))&&hv(a,d);var B=A=p.createElement("link");Pt(B),Zn(B,"link",a),B._p=new Promise(function(ne,de){B.onload=ne,B.onerror=de}),B.addEventListener("load",function(){N.loading|=1}),B.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Uf(A,l,p)}A={type:"stylesheet",instance:A,count:1,state:N},x.set(j,A)}}}function e3(a,l){Na.X(a,l);var d=Ul;if(d&&a){var p=dn(d).hoistableScripts,x=Vl(a),j=p.get(x);j||(j=d.querySelector(Ru(x)),j||(a=m({src:a,async:!0},l),(l=si.get(x))&&pv(a,l),j=d.createElement("script"),Pt(j),Zn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},p.set(x,j))}}function t3(a,l){Na.M(a,l);var d=Ul;if(d&&a){var p=dn(d).hoistableScripts,x=Vl(a),j=p.get(x);j||(j=d.querySelector(Ru(x)),j||(a=m({src:a,async:!0,type:"module"},l),(l=si.get(x))&&pv(a,l),j=d.createElement("script"),Pt(j),Zn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},p.set(x,j))}}function Cj(a,l,d,p){var x=(x=xe.current)?zf(x):null;if(!x)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=Bl(d.href),d=dn(x).hoistableStyles,p=d.get(l),p||(p={type:"style",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=Bl(d.href);var j=dn(x).hoistableStyles,A=j.get(a);if(A||(x=x.ownerDocument||x,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(a,A),(j=x.querySelector(Tu(a)))&&!j._p&&(A.instance=j,A.state.loading=5),si.has(a)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},si.set(a,d),j||n3(x,a,d,A.state))),l&&p===null)throw Error(r(528,""));return A}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Vl(d),d=dn(x).hoistableScripts,p=d.get(l),p||(p={type:"script",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Bl(a){return'href="'+ei(a)+'"'}function Tu(a){return'link[rel="stylesheet"]['+a+"]"}function Ej(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function n3(a,l,d,p){a.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=a.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Zn(l,"link",d),Pt(l),a.head.appendChild(l))}function Vl(a){return'[src="'+ei(a)+'"]'}function Ru(a){return"script[async]"+a}function Tj(a,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=a.querySelector('style[data-href~="'+ei(d.href)+'"]');if(p)return l.instance=p,Pt(p),p;var x=m({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),Pt(p),Zn(p,"style",x),Uf(p,d.precedence,a),l.instance=p;case"stylesheet":x=Bl(d.href);var j=a.querySelector(Tu(x));if(j)return l.state.loading|=4,l.instance=j,Pt(j),j;p=Ej(d),(x=si.get(x))&&hv(p,x),j=(a.ownerDocument||a).createElement("link"),Pt(j);var A=j;return A._p=new Promise(function(N,B){A.onload=N,A.onerror=B}),Zn(j,"link",p),l.state.loading|=4,Uf(j,d.precedence,a),l.instance=j;case"script":return j=Vl(d.src),(x=a.querySelector(Ru(j)))?(l.instance=x,Pt(x),x):(p=d,(x=si.get(j))&&(p=m({},d),pv(p,x)),a=a.ownerDocument||a,x=a.createElement("script"),Pt(x),Zn(x,"link",p),a.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&&(p=l.instance,l.state.loading|=4,Uf(p,d.precedence,a));return l.instance}function Uf(a,l,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=p.length?p[p.length-1]:null,j=x,A=0;A<p.length;A++){var N=p[A];if(N.dataset.precedence===l)j=N;else if(j!==x)break}j?j.parentNode.insertBefore(a,j.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(a,l.firstChild))}function hv(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.title==null&&(a.title=l.title)}function pv(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.integrity==null&&(a.integrity=l.integrity)}var Bf=null;function Rj(a,l,d){if(Bf===null){var p=new Map,x=Bf=new Map;x.set(d,p)}else x=Bf,p=x.get(d),p||(p=new Map,x.set(d,p));if(p.has(a))return p;for(p.set(a,null),d=d.getElementsByTagName(a),x=0;x<d.length;x++){var j=d[x];if(!(j[it]||j[he]||a==="link"&&j.getAttribute("rel")==="stylesheet")&&j.namespaceURI!=="http://www.w3.org/2000/svg"){var A=j.getAttribute(l)||"";A=a+A;var N=p.get(A);N?N.push(j):p.set(A,[j])}}return p}function _j(a,l,d){a=a.ownerDocument||a,a.head.insertBefore(d,l==="title"?a.querySelector("head > title"):null)}function r3(a,l,d){if(d===1||l.itemProp!=null)return!1;switch(a){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 a=l.disabled,typeof l.precedence=="string"&&a==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 Dj(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}var _u=null;function i3(){}function a3(a,l,d){if(_u===null)throw Error(r(475));var p=_u;if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var x=Bl(d.href),j=a.querySelector(Tu(x));if(j){a=j._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(p.count++,p=Vf.bind(p),a.then(p,p)),l.state.loading|=4,l.instance=j,Pt(j);return}j=a.ownerDocument||a,d=Ej(d),(x=si.get(x))&&hv(d,x),j=j.createElement("link"),Pt(j);var A=j;A._p=new Promise(function(N,B){A.onload=N,A.onerror=B}),Zn(j,"link",d),l.instance=j}p.stylesheets===null&&(p.stylesheets=new Map),p.stylesheets.set(l,a),(a=l.state.preload)&&(l.state.loading&3)===0&&(p.count++,l=Vf.bind(p),a.addEventListener("load",l),a.addEventListener("error",l))}}function o3(){if(_u===null)throw Error(r(475));var a=_u;return a.stylesheets&&a.count===0&&mv(a,a.stylesheets),0<a.count?function(l){var d=setTimeout(function(){if(a.stylesheets&&mv(a,a.stylesheets),a.unsuspend){var p=a.unsuspend;a.unsuspend=null,p()}},6e4);return a.unsuspend=l,function(){a.unsuspend=null,clearTimeout(d)}}:null}function Vf(){if(this.count--,this.count===0){if(this.stylesheets)mv(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ff=null;function mv(a,l){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ff=new Map,l.forEach(s3,a),Ff=null,Vf.call(a))}function s3(a,l){if(!(l.state.loading&4)){var d=Ff.get(a);if(d)var p=d.get(null);else{d=new Map,Ff.set(a,d);for(var x=a.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j<x.length;j++){var A=x[j];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(d.set(A.dataset.precedence,A),p=A)}p&&d.set(null,p)}x=l.instance,A=x.getAttribute("data-precedence"),j=d.get(A)||p,j===p&&d.set(null,x),d.set(A,x),this.count++,p=Vf.bind(this),x.addEventListener("load",p),x.addEventListener("error",p),j?j.parentNode.insertBefore(x,j.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(x,a.firstChild)),l.state.loading|=4}}var Du={$$typeof:T,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function l3(a,l,d,p,x,j,A,N){this.tag=1,this.containerInfo=a,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=Hi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hi(0),this.hiddenUpdates=Hi(null),this.identifierPrefix=p,this.onUncaughtError=x,this.onCaughtError=j,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Aj(a,l,d,p,x,j,A,N,B,ne,de,pe){return a=new l3(a,l,d,A,N,B,ne,pe),l=1,j===!0&&(l|=24),j=Lr(3,null,null,l),a.current=j,j.stateNode=a,l=Xm(),l.refCount++,a.pooledCache=l,l.refCount++,j.memoizedState={element:p,isDehydrated:d,cache:l},eg(j),a}function kj(a){return a?(a=xl,a):xl}function Pj(a,l,d,p,x,j){x=kj(x),p.context===null?p.context=x:p.pendingContext=x,p=ho(l),p.payload={element:d},j=j===void 0?null:j,j!==null&&(p.callback=j),d=po(a,p,l),d!==null&&(Vr(d,a,l),au(d,a,l))}function Nj(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<l?d:l}}function gv(a,l){Nj(a,l),(a=a.alternate)&&Nj(a,l)}function Oj(a){if(a.tag===13){var l=yl(a,67108864);l!==null&&Vr(l,a,67108864),gv(a,67108864)}}var Hf=!0;function c3(a,l,d,p){var x=P.T;P.T=null;var j=L.p;try{L.p=2,vv(a,l,d,p)}finally{L.p=j,P.T=x}}function u3(a,l,d,p){var x=P.T;P.T=null;var j=L.p;try{L.p=8,vv(a,l,d,p)}finally{L.p=j,P.T=x}}function vv(a,l,d,p){if(Hf){var x=yv(p);if(x===null)iv(a,l,p,qf,d),Ij(a,p);else if(f3(x,a,l,d,p))p.stopPropagation();else if(Ij(a,p),l&4&&-1<d3.indexOf(a)){for(;x!==null;){var j=Ke(x);if(j!==null)switch(j.tag){case 3:if(j=j.stateNode,j.current.memoizedState.isDehydrated){var A=Vn(j.pendingLanes);if(A!==0){var N=j;for(N.pendingLanes|=2,N.entangledLanes|=2;A;){var B=1<<31-kt(A);N.entanglements[1]|=B,A&=~B}Yi(j),(Yt&6)===0&&(_f=Ee()+500,wu(0))}}break;case 13:N=yl(j,2),N!==null&&Vr(N,j,2),Af(),gv(j,2)}if(j=yv(p),j===null&&iv(a,l,p,qf,d),j===x)break;x=j}x!==null&&p.stopPropagation()}else iv(a,l,p,null,d)}}function yv(a){return a=jm(a),xv(a)}var qf=null;function xv(a){if(qf=null,a=st(a),a!==null){var l=o(a);if(l===null)a=null;else{var d=l.tag;if(d===13){if(a=c(l),a!==null)return a;a=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null)}}return qf=a,null}function Mj(a){switch(a){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(De()){case We:return 2;case Re:return 8;case me:case ge:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var bv=!1,Ro=null,_o=null,Do=null,Au=new Map,ku=new Map,Ao=[],d3="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 Ij(a,l){switch(a){case"focusin":case"focusout":Ro=null;break;case"dragenter":case"dragleave":_o=null;break;case"mouseover":case"mouseout":Do=null;break;case"pointerover":case"pointerout":Au.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ku.delete(l.pointerId)}}function Pu(a,l,d,p,x,j){return a===null||a.nativeEvent!==j?(a={blockedOn:l,domEventName:d,eventSystemFlags:p,nativeEvent:j,targetContainers:[x]},l!==null&&(l=Ke(l),l!==null&&Oj(l)),a):(a.eventSystemFlags|=p,l=a.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),a)}function f3(a,l,d,p,x){switch(l){case"focusin":return Ro=Pu(Ro,a,l,d,p,x),!0;case"dragenter":return _o=Pu(_o,a,l,d,p,x),!0;case"mouseover":return Do=Pu(Do,a,l,d,p,x),!0;case"pointerover":var j=x.pointerId;return Au.set(j,Pu(Au.get(j)||null,a,l,d,p,x)),!0;case"gotpointercapture":return j=x.pointerId,ku.set(j,Pu(ku.get(j)||null,a,l,d,p,x)),!0}return!1}function Lj(a){var l=st(a.target);if(l!==null){var d=o(l);if(d!==null){if(l=d.tag,l===13){if(l=c(d),l!==null){a.blockedOn=l,Z(a.priority,function(){if(d.tag===13){var p=Br();p=ts(p);var x=yl(d,p);x!==null&&Vr(x,d,p),gv(d,p)}});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Gf(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var d=yv(a.nativeEvent);if(d===null){d=a.nativeEvent;var p=new d.constructor(d.type,d);wm=p,d.target.dispatchEvent(p),wm=null}else return l=Ke(d),l!==null&&Oj(l),a.blockedOn=d,!1;l.shift()}return!0}function $j(a,l,d){Gf(a)&&d.delete(l)}function h3(){bv=!1,Ro!==null&&Gf(Ro)&&(Ro=null),_o!==null&&Gf(_o)&&(_o=null),Do!==null&&Gf(Do)&&(Do=null),Au.forEach($j),ku.forEach($j)}function Wf(a,l){a.blockedOn===l&&(a.blockedOn=null,bv||(bv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,h3)))}var Qf=null;function zj(a){Qf!==a&&(Qf=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Qf===a&&(Qf=null);for(var l=0;l<a.length;l+=3){var d=a[l],p=a[l+1],x=a[l+2];if(typeof p!="function"){if(xv(p||d)===null)continue;break}var j=Ke(d);j!==null&&(a.splice(l,3),l-=3,xg(j,{pending:!0,data:x,method:d.method,action:p},p,x))}}))}function Nu(a){function l(B){return Wf(B,a)}Ro!==null&&Wf(Ro,a),_o!==null&&Wf(_o,a),Do!==null&&Wf(Do,a),Au.forEach(l),ku.forEach(l);for(var d=0;d<Ao.length;d++){var p=Ao[d];p.blockedOn===a&&(p.blockedOn=null)}for(;0<Ao.length&&(d=Ao[0],d.blockedOn===null);)Lj(d),d.blockedOn===null&&Ao.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var x=d[p],j=d[p+1],A=x[Te]||null;if(typeof j=="function")A||zj(d);else if(A){var N=null;if(j&&j.hasAttribute("formAction")){if(x=j,A=j[Te]||null)N=A.formAction;else if(xv(x)!==null)continue}else N=A.action;typeof N=="function"?d[p+1]=N:(d.splice(p,3),p-=3),zj(d)}}}function Sv(a){this._internalRoot=a}Yf.prototype.render=Sv.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=Br();Pj(d,p,a,l,null,null)},Yf.prototype.unmount=Sv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Pj(a.current,2,null,a,null,null),Af(),l[Be]=null}};function Yf(a){this._internalRoot=a}Yf.prototype.unstable_scheduleHydration=function(a){if(a){var l=F();a={blockedOn:null,target:a,priority:l};for(var d=0;d<Ao.length&&l!==0&&l<Ao[d].priority;d++);Ao.splice(d,0,a),d===0&&Lj(a)}};var Uj=t.version;if(Uj!=="19.1.0")throw Error(r(527,Uj,"19.1.0"));L.findDOMNode=function(a){var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=f(l),a=a!==null?h(a):null,a=a===null?null:a.stateNode,a};var p3={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xf.isDisabled&&Xf.supportsFiber)try{yt=Xf.inject(p3),ft=Xf}catch{}}return Uu.createRoot=function(a,l){if(!i(a))throw Error(r(299));var d=!1,p="",x=nw,j=rw,A=iw,N=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(j=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(N=l.unstable_transitionCallbacks)),l=Aj(a,1,!1,null,null,d,p,x,j,A,N,null),a[Be]=l.current,rv(a),new Sv(l)},Uu.hydrateRoot=function(a,l,d){if(!i(a))throw Error(r(299));var p=!1,x="",j=nw,A=rw,N=iw,B=null,ne=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onUncaughtError!==void 0&&(j=d.onUncaughtError),d.onCaughtError!==void 0&&(A=d.onCaughtError),d.onRecoverableError!==void 0&&(N=d.onRecoverableError),d.unstable_transitionCallbacks!==void 0&&(B=d.unstable_transitionCallbacks),d.formState!==void 0&&(ne=d.formState)),l=Aj(a,1,!0,l,d??null,p,x,j,A,N,B,ne),l.context=kj(null),d=l.current,p=Br(),p=ts(p),x=ho(p),x.callback=null,po(d,x,p),d=p,l.current.lanes=d,br(l,d),Yi(l),a[Be]=l.current,rv(a),new Yf(l)},Uu.version="19.1.0",Uu}var yT;function cX(){if(yT)return oy.exports;yT=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(),oy.exports=lX(),oy.exports}var uX=cX(),Bu={},xT;function dX(){if(xT)return Bu;xT=1,Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.parse=c,Bu.serialize=h;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,o=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function c(v,b){const S=new o,w=v.length;if(w<2)return S;const C=(b==null?void 0:b.decode)||m;let E=0;do{const _=v.indexOf("=",E);if(_===-1)break;const T=v.indexOf(";",E),R=T===-1?w:T;if(_>R){E=v.lastIndexOf(";",_-1)+1;continue}const D=u(v,E,_),k=f(v,_,D),M=v.slice(D,k);if(S[M]===void 0){let I=u(v,_+1,R),z=f(v,R,I);const V=C(v.slice(I,z));S[M]=V}E=R+1}while(E<w);return S}function u(v,b,S){do{const w=v.charCodeAt(b);if(w!==32&&w!==9)return b}while(++b<S);return S}function f(v,b,S){for(;b>S;){const w=v.charCodeAt(--b);if(w!==32&&w!==9)return b+1}return S}function h(v,b,S){const w=(S==null?void 0:S.encode)||encodeURIComponent;if(!e.test(v))throw new TypeError(`argument name is invalid: ${v}`);const C=w(b);if(!t.test(C))throw new TypeError(`argument val is invalid: ${b}`);let E=v+"="+C;if(!S)return E;if(S.maxAge!==void 0){if(!Number.isInteger(S.maxAge))throw new TypeError(`option maxAge is invalid: ${S.maxAge}`);E+="; Max-Age="+S.maxAge}if(S.domain){if(!n.test(S.domain))throw new TypeError(`option domain is invalid: ${S.domain}`);E+="; Domain="+S.domain}if(S.path){if(!r.test(S.path))throw new TypeError(`option path is invalid: ${S.path}`);E+="; Path="+S.path}if(S.expires){if(!g(S.expires)||!Number.isFinite(S.expires.valueOf()))throw new TypeError(`option expires is invalid: ${S.expires}`);E+="; Expires="+S.expires.toUTCString()}if(S.httpOnly&&(E+="; HttpOnly"),S.secure&&(E+="; Secure"),S.partitioned&&(E+="; Partitioned"),S.priority)switch(typeof S.priority=="string"?S.priority.toLowerCase():void 0){case"low":E+="; Priority=Low";break;case"medium":E+="; Priority=Medium";break;case"high":E+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${S.priority}`)}if(S.sameSite)switch(typeof S.sameSite=="string"?S.sameSite.toLowerCase():S.sameSite){case!0:case"strict":E+="; SameSite=Strict";break;case"lax":E+="; SameSite=Lax";break;case"none":E+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${S.sameSite}`)}return E}function m(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function g(v){return i.call(v)==="[object Date]"}return Bu}dX();/**
566
- * react-router v7.6.3
567
- *
568
- * Copyright (c) Remix Software Inc.
569
- *
570
- * This source code is licensed under the MIT license found in the
571
- * LICENSE.md file in the root directory of this source tree.
572
- *
573
- * @license MIT
574
- */var vk=e=>{throw TypeError(e)},fX=(e,t,n)=>t.has(e)||vk("Cannot "+n),cy=(e,t,n)=>(fX(e,t,"read from private field"),n?n.call(e):t.get(e)),hX=(e,t,n)=>t.has(e)?vk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),bT="popstate";function pX(e={}){function t(r,i){let{pathname:o,search:c,hash:u}=r.location;return ud("",{pathname:o,search:c,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:qo(i)}return gX(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Mn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mX(){return Math.random().toString(36).substring(2,10)}function ST(e,t){return{usr:e.state,key:e.key,idx:t}}function ud(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?no(t):t,state:n,key:t&&t.key||r||mX()}}function qo({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 no(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 gX(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,c=i.history,u="POP",f=null,h=m();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function m(){return(c.state||{idx:null}).idx}function g(){u="POP";let C=m(),E=C==null?null:C-h;h=C,f&&f({action:u,location:w.location,delta:E})}function v(C,E){u="PUSH";let _=ud(w.location,C,E);h=m()+1;let T=ST(_,h),R=w.createHref(_);try{c.pushState(T,"",R)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(R)}o&&f&&f({action:u,location:w.location,delta:1})}function b(C,E){u="REPLACE";let _=ud(w.location,C,E);h=m();let T=ST(_,h),R=w.createHref(_);c.replaceState(T,"",R),o&&f&&f({action:u,location:w.location,delta:0})}function S(C){return yk(C)}let w={get action(){return u},get location(){return e(i,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(bT,g),f=C,()=>{i.removeEventListener(bT,g),f=null}},createHref(C){return t(i,C)},createURL:S,encodeLocation(C){let E=S(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:v,replace:b,go(C){return c.go(C)}};return w}function yk(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:qo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Wu,wT=class{constructor(e){if(hX(this,Wu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(cy(this,Wu).has(e))return cy(this,Wu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){cy(this,Wu).set(e,t)}};Wu=new WeakMap;var vX=new Set(["lazy","caseSensitive","path","id","index","children"]);function yX(e){return vX.has(e)}var xX=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function bX(e){return xX.has(e)}function SX(e){return e.index===!0}function ep(e,t,n=[],r={}){return e.map((i,o)=>{let c=[...n,String(o)],u=typeof i.id=="string"?i.id:c.join("-");if(bt(i.index!==!0||!i.children,"Cannot specify children on an index route"),bt(!r[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),SX(i)){let f={...i,...t(i),id:u};return r[u]=f,f}else{let f={...i,...t(i),id:u,children:void 0};return r[u]=f,i.children&&(f.children=ep(i.children,t,c,r)),f}})}function zo(e,t,n="/"){return wh(e,t,n,!1)}function wh(e,t,n,r){let i=typeof t=="string"?no(t):t,o=vi(i.pathname||"/",n);if(o==null)return null;let c=xk(e);jX(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let h=OX(o);u=PX(c[f],h,r)}return u}function wX(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function xk(e,t=[],n=[],r=""){let i=(o,c,u)=>{let f={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};f.relativePath.startsWith("/")&&(bt(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length));let h=sa([r,f.relativePath]),m=n.concat(f);o.children&&o.children.length>0&&(bt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),xk(o.children,t,m,h)),!(o.path==null&&!o.index)&&t.push({path:h,score:AX(h,o.index),routesMeta:m})};return e.forEach((o,c)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))i(o,c);else for(let f of bk(o.path))i(o,c,f)}),t}function bk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let c=bk(r.join("/")),u=[];return u.push(...c.map(f=>f===""?o:[o,f].join("/"))),i&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function jX(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:kX(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var CX=/^:[\w-]+$/,EX=3,TX=2,RX=1,_X=10,DX=-2,jT=e=>e==="*";function AX(e,t){let n=e.split("/"),r=n.length;return n.some(jT)&&(r+=DX),t&&(r+=TX),n.filter(i=>!jT(i)).reduce((i,o)=>i+(CX.test(o)?EX:o===""?RX:_X),r)}function kX(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function PX(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],h=u===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",g=tp({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},m),v=f.route;if(!g&&h&&n&&!r[r.length-1].route.index&&(g=tp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(i,g.params),c.push({params:i,pathname:sa([o,g.pathname]),pathnameBase:LX(sa([o,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(o=sa([o,g.pathnameBase]))}return c}function tp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=NX(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],c=o.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:r.reduce((h,{paramName:m,isOptional:g},v)=>{if(m==="*"){let S=u[v]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const b=u[v];return g&&!b?h[m]=void 0:h[m]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function NX(e,t=!1,n=!0){Mn(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function OX(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Mn(!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 vi(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 MX(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?no(e):e;return{pathname:n?n.startsWith("/")?n:IX(n,t):t,search:$X(r),hash:zX(i)}}function IX(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function uy(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 Sk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Wb(e){let t=Sk(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Qb(e,t,n,r=!1){let i;typeof e=="string"?i=no(e):(i={...e},bt(!i.pathname||!i.pathname.includes("?"),uy("?","pathname","search",i)),bt(!i.pathname||!i.pathname.includes("#"),uy("#","pathname","hash",i)),bt(!i.search||!i.search.includes("#"),uy("#","search","hash",i)));let o=e===""||i.pathname==="",c=o?"/":i.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),g-=1;i.pathname=v.join("/")}u=g>=0?t[g]:"/"}let f=MX(i,u),h=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||m)&&(f.pathname+="/"),f}var sa=e=>e.join("/").replace(/\/\/+/g,"/"),LX=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$X=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zX=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,np=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 dd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var wk=["POST","PUT","PATCH","DELETE"],UX=new Set(wk),BX=["GET",...wk],VX=new Set(BX),FX=new Set([301,302,303,307,308]),HX=new Set([307,308]),dy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},qX={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Yb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,GX=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),jk="remix-router-transitions",Ck=Symbol("ResetLoaderData");function WX(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";bt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||GX,o={},c=ep(e.routes,i,void 0,o),u,f=e.basename||"/",h=e.dataStrategy||ZX,m={unstable_middleware:!1,...e.future},g=null,v=new Set,b=null,S=null,w=null,C=e.hydrationData!=null,E=zo(c,e.history.location,f),_=!1,T=null,R;if(E==null&&!e.patchRoutesOnNavigation){let F=ui(404,{pathname:e.history.location.pathname}),{matches:Z,route:re}=MT(c);R=!0,E=Z,T={[re.id]:F}}else if(E&&!e.hydrationData&&ya(E,c,e.history.location.pathname).active&&(E=null),E)if(E.some(F=>F.route.lazy))R=!1;else if(!E.some(F=>F.route.loader))R=!0;else{let F=e.hydrationData?e.hydrationData.loaderData:null,Z=e.hydrationData?e.hydrationData.errors:null;if(Z){let re=E.findIndex(he=>Z[he.route.id]!==void 0);R=E.slice(0,re+1).every(he=>!rx(he.route,F,Z))}else R=E.every(re=>!rx(re.route,F,Z))}else{R=!1,E=[];let F=ya(null,c,e.history.location.pathname);F.active&&F.matches&&(_=!0,E=F.matches)}let D,k={historyAction:e.history.action,location:e.history.location,matches:E,initialized:R,navigation:dy,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||T,fetchers:new Map,blockers:new Map},M="POP",I=!1,z,V=!1,Y=new Map,W=null,J=!1,G=!1,X=new Set,P=new Map,L=0,$=-1,H=new Map,O=new Set,U=new Map,K=new Map,ee=new Set,Se=new Map,be,xe=null;function Ge(){if(g=e.history.listen(({action:F,location:Z,delta:re})=>{if(be){be(),be=void 0;return}Mn(Se.size===0||re!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let he=cl({currentLocation:k.location,nextLocation:Z,historyAction:F});if(he&&re!=null){let Te=new Promise(Be=>{be=Be});e.history.go(re*-1),Kr(he,{state:"blocked",location:Z,proceed(){Kr(he,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),Te.then(()=>e.history.go(re))},reset(){let Be=new Map(k.blockers);Be.set(he,Vu),ke({blockers:Be})}});return}return gt(F,Z)}),n){cK(t,Y);let F=()=>uK(t,Y);t.addEventListener("pagehide",F),W=()=>t.removeEventListener("pagehide",F)}return k.initialized||gt("POP",k.location,{initialHydration:!0}),D}function Me(){g&&g(),W&&W(),v.clear(),z&&z.abort(),k.fetchers.forEach((F,Z)=>kt(Z)),k.blockers.forEach((F,Z)=>wi(Z))}function tt(F){return v.add(F),()=>v.delete(F)}function ke(F,Z={}){k={...k,...F};let re=[],he=[];k.fetchers.forEach((Te,Be)=>{Te.state==="idle"&&(ee.has(Be)?re.push(Be):he.push(Be))}),ee.forEach(Te=>{!k.fetchers.has(Te)&&!P.has(Te)&&re.push(Te)}),[...v].forEach(Te=>Te(k,{deletedFetchers:re,viewTransitionOpts:Z.viewTransitionOpts,flushSync:Z.flushSync===!0})),re.forEach(Te=>kt(Te)),he.forEach(Te=>k.fetchers.delete(Te))}function vt(F,Z,{flushSync:re}={}){var Je,it;let he=k.actionData!=null&&k.navigation.formMethod!=null&&qr(k.navigation.formMethod)&&k.navigation.state==="loading"&&((Je=F.state)==null?void 0:Je._isRedirect)!==!0,Te;Z.actionData?Object.keys(Z.actionData).length>0?Te=Z.actionData:Te=null:he?Te=k.actionData:Te=null;let Be=Z.loaderData?NT(k.loaderData,Z.loaderData,Z.matches||[],Z.errors):k.loaderData,nt=k.blockers;nt.size>0&&(nt=new Map(nt),nt.forEach((Xe,st)=>nt.set(st,Vu)));let Ue=I===!0||k.navigation.formMethod!=null&&qr(k.navigation.formMethod)&&((it=F.state)==null?void 0:it._isRedirect)!==!0;u&&(c=u,u=void 0),J||M==="POP"||(M==="PUSH"?e.history.push(F,F.state):M==="REPLACE"&&e.history.replace(F,F.state));let Ze;if(M==="POP"){let Xe=Y.get(k.location.pathname);Xe&&Xe.has(F.pathname)?Ze={currentLocation:k.location,nextLocation:F}:Y.has(F.pathname)&&(Ze={currentLocation:F,nextLocation:k.location})}else if(V){let Xe=Y.get(k.location.pathname);Xe?Xe.add(F.pathname):(Xe=new Set([F.pathname]),Y.set(k.location.pathname,Xe)),Ze={currentLocation:k.location,nextLocation:F}}ke({...Z,actionData:Te,loaderData:Be,historyAction:M,location:F,initialized:!0,navigation:dy,revalidation:"idle",restoreScrollPosition:qn(F,Z.matches||k.matches),preventScrollReset:Ue,blockers:nt},{viewTransitionOpts:Ze,flushSync:re===!0}),M="POP",I=!1,V=!1,J=!1,G=!1,xe==null||xe.resolve(),xe=null}async function Lt(F,Z){if(typeof F=="number"){e.history.go(F);return}let re=nx(k.location,k.matches,f,F,Z==null?void 0:Z.fromRouteId,Z==null?void 0:Z.relative),{path:he,submission:Te,error:Be}=CT(!1,re,Z),nt=k.location,Ue=ud(k.location,he,Z&&Z.state);Ue={...Ue,...e.history.encodeLocation(Ue)};let Ze=Z&&Z.replace!=null?Z.replace:void 0,Je="PUSH";Ze===!0?Je="REPLACE":Ze===!1||Te!=null&&qr(Te.formMethod)&&Te.formAction===k.location.pathname+k.location.search&&(Je="REPLACE");let it=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,Xe=(Z&&Z.flushSync)===!0,st=cl({currentLocation:nt,nextLocation:Ue,historyAction:Je});if(st){Kr(st,{state:"blocked",location:Ue,proceed(){Kr(st,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),Lt(F,Z)},reset(){let Ke=new Map(k.blockers);Ke.set(st,Vu),ke({blockers:Ke})}});return}await gt(Je,Ue,{submission:Te,pendingError:Be,preventScrollReset:it,replace:Z&&Z.replace,enableViewTransition:Z&&Z.viewTransition,flushSync:Xe})}function $t(){xe||(xe=dK()),ze(),ke({revalidation:"loading"});let F=xe.promise;return k.navigation.state==="submitting"?F:k.navigation.state==="idle"?(gt(k.historyAction,k.location,{startUninterruptedRevalidation:!0}),F):(gt(M||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:V===!0}),F)}async function gt(F,Z,re){z&&z.abort(),z=null,M=F,J=(re&&re.startUninterruptedRevalidation)===!0,br(k.location,k.matches),I=(re&&re.preventScrollReset)===!0,V=(re&&re.enableViewTransition)===!0;let he=u||c,Te=re&&re.overrideNavigation,Be=re!=null&&re.initialHydration&&k.matches&&k.matches.length>0&&!_?k.matches:zo(he,Z,f),nt=(re&&re.flushSync)===!0;if(Be&&k.initialized&&!G&&iK(k.location,Z)&&!(re&&re.submission&&qr(re.submission.formMethod))){vt(Z,{matches:Be},{flushSync:nt});return}let Ue=ya(Be,he,Z.pathname);if(Ue.active&&Ue.matches&&(Be=Ue.matches),!Be){let{error:dn,notFoundMatches:Pt,route:Rt}=va(Z.pathname);vt(Z,{matches:Pt,loaderData:{},errors:{[Rt.id]:dn}},{flushSync:nt});return}z=new AbortController;let Ze=nc(e.history,Z,z.signal,re&&re.submission),Je=new wT(e.unstable_getContext?await e.unstable_getContext():void 0),it;if(re&&re.pendingError)it=[Rs(Be).route.id,{type:"error",error:re.pendingError}];else if(re&&re.submission&&qr(re.submission.formMethod)){let dn=await At(Ze,Z,re.submission,Be,Je,Ue.active,re&&re.initialHydration===!0,{replace:re.replace,flushSync:nt});if(dn.shortCircuited)return;if(dn.pendingActionResult){let[Pt,Rt]=dn.pendingActionResult;if(Hr(Rt)&&dd(Rt.error)&&Rt.error.status===404){z=null,vt(Z,{matches:dn.matches,loaderData:{},errors:{[Pt]:Rt.error}});return}}Be=dn.matches||Be,it=dn.pendingActionResult,Te=fy(Z,re.submission),nt=!1,Ue.active=!1,Ze=nc(e.history,Ze.url,Ze.signal)}let{shortCircuited:Xe,matches:st,loaderData:Ke,errors:Qt}=await rn(Ze,Z,Be,Je,Ue.active,Te,re&&re.submission,re&&re.fetcherSubmission,re&&re.replace,re&&re.initialHydration===!0,nt,it);Xe||(z=null,vt(Z,{matches:st||Be,...OT(it),loaderData:Ke,errors:Qt}))}async function At(F,Z,re,he,Te,Be,nt,Ue={}){ze();let Ze=sK(Z,re);if(ke({navigation:Ze},{flushSync:Ue.flushSync===!0}),Be){let Xe=await io(he,Z.pathname,F.signal);if(Xe.type==="aborted")return{shortCircuited:!0};if(Xe.type==="error"){let st=Rs(Xe.partialMatches).route.id;return{matches:Xe.partialMatches,pendingActionResult:[st,{type:"error",error:Xe.error}]}}else if(Xe.matches)he=Xe.matches;else{let{notFoundMatches:st,error:Ke,route:Qt}=va(Z.pathname);return{matches:st,pendingActionResult:[Qt.id,{type:"error",error:Ke}]}}}let Je,it=Qu(he,Z);if(!it.route.action&&!it.route.lazy)Je={type:"error",error:ui(405,{method:F.method,pathname:Z.pathname,routeId:it.route.id})};else{let Xe=lc(i,o,F,he,it,nt?[]:r,Te),st=await Ne(F,Xe,Te,null);if(Je=st[it.route.id],!Je){for(let Ke of he)if(st[Ke.route.id]){Je=st[Ke.route.id];break}}if(F.signal.aborted)return{shortCircuited:!0}}if(Ms(Je)){let Xe;return Ue&&Ue.replace!=null?Xe=Ue.replace:Xe=AT(Je.response.headers.get("Location"),new URL(F.url),f)===k.location.pathname+k.location.search,await ge(F,Je,!0,{submission:re,replace:Xe}),{shortCircuited:!0}}if(Hr(Je)){let Xe=Rs(he,it.route.id);return(Ue&&Ue.replace)!==!0&&(M="PUSH"),{matches:he,pendingActionResult:[Xe.route.id,Je,it.route.id]}}return{matches:he,pendingActionResult:[it.route.id,Je]}}async function rn(F,Z,re,he,Te,Be,nt,Ue,Ze,Je,it,Xe){let st=Be||fy(Z,nt),Ke=nt||Ue||LT(st),Qt=!J&&!Je;if(Te){if(Qt){let nr=Ee(Xe);ke({navigation:st,...nr!==void 0?{actionData:nr}:{}},{flushSync:it})}let Ct=await io(re,Z.pathname,F.signal);if(Ct.type==="aborted")return{shortCircuited:!0};if(Ct.type==="error"){let nr=Rs(Ct.partialMatches).route.id;return{matches:Ct.partialMatches,loaderData:{},errors:{[nr]:Ct.error}}}else if(Ct.matches)re=Ct.matches;else{let{error:nr,notFoundMatches:ji,route:Ci}=va(Z.pathname);return{matches:ji,loaderData:{},errors:{[Ci.id]:nr}}}}let dn=u||c,{dsMatches:Pt,revalidatingFetchers:Rt}=ET(F,he,i,o,e.history,k,re,Ke,Z,Je?[]:r,Je===!0,G,X,ee,U,O,dn,f,e.patchRoutesOnNavigation!=null,Xe);if($=++L,!e.dataStrategy&&!Pt.some(Ct=>Ct.shouldLoad)&&Rt.length===0){let Ct=Si();return vt(Z,{matches:re,loaderData:{},errors:Xe&&Hr(Xe[1])?{[Xe[0]]:Xe[1].error}:null,...OT(Xe),...Ct?{fetchers:new Map(k.fetchers)}:{}},{flushSync:it}),{shortCircuited:!0}}if(Qt){let Ct={};if(!Te){Ct.navigation=st;let nr=Ee(Xe);nr!==void 0&&(Ct.actionData=nr)}Rt.length>0&&(Ct.fetchers=De(Rt)),ke(Ct,{flushSync:it})}Rt.forEach(Ct=>{jt(Ct.key),Ct.controller&&P.set(Ct.key,Ct.controller)});let ao=()=>Rt.forEach(Ct=>jt(Ct.key));z&&z.signal.addEventListener("abort",ao);let{loaderResults:ur,fetcherResults:Zr}=await we(Pt,Rt,F,he);if(F.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",ao),Rt.forEach(Ct=>P.delete(Ct.key));let Sr=lh(ur);if(Sr)return await ge(F,Sr.result,!0,{replace:Ze}),{shortCircuited:!0};if(Sr=lh(Zr),Sr)return O.add(Sr.key),await ge(F,Sr.result,!0,{replace:Ze}),{shortCircuited:!0};let{loaderData:oo,errors:so}=PT(k,re,ur,Xe,Rt,Zr);Je&&k.errors&&(so={...k.errors,...so});let Uc=Si(),Jr=ga($),xa=Uc||Jr||Rt.length>0;return{matches:re,loaderData:oo,errors:so,...xa?{fetchers:new Map(k.fetchers)}:{}}}function Ee(F){if(F&&!Hr(F[1]))return{[F[0]]:F[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function De(F){return F.forEach(Z=>{let re=k.fetchers.get(Z.key),he=Fu(void 0,re?re.data:void 0);k.fetchers.set(Z.key,he)}),new Map(k.fetchers)}async function We(F,Z,re,he){jt(F);let Te=(he&&he.flushSync)===!0,Be=u||c,nt=nx(k.location,k.matches,f,re,Z,he==null?void 0:he.relative),Ue=zo(Be,nt,f),Ze=ya(Ue,Be,nt);if(Ze.active&&Ze.matches&&(Ue=Ze.matches),!Ue){ft(F,Z,ui(404,{pathname:nt}),{flushSync:Te});return}let{path:Je,submission:it,error:Xe}=CT(!0,nt,he);if(Xe){ft(F,Z,Xe,{flushSync:Te});return}let st=Qu(Ue,Je),Ke=new wT(e.unstable_getContext?await e.unstable_getContext():void 0),Qt=(he&&he.preventScrollReset)===!0;if(it&&qr(it.formMethod)){await Re(F,Z,Je,st,Ue,Ke,Ze.active,Te,Qt,it);return}U.set(F,{routeId:Z,path:Je}),await me(F,Z,Je,st,Ue,Ke,Ze.active,Te,Qt,it)}async function Re(F,Z,re,he,Te,Be,nt,Ue,Ze,Je){ze(),U.delete(F);function it(xn){if(!xn.route.action&&!xn.route.lazy){let lo=ui(405,{method:Je.formMethod,pathname:re,routeId:Z});return ft(F,Z,lo,{flushSync:Ue}),!0}return!1}if(!nt&&it(he))return;let Xe=k.fetchers.get(F);yt(F,lK(Je,Xe),{flushSync:Ue});let st=new AbortController,Ke=nc(e.history,re,st.signal,Je);if(nt){let xn=await io(Te,re,Ke.signal,F);if(xn.type==="aborted")return;if(xn.type==="error"){ft(F,Z,xn.error,{flushSync:Ue});return}else if(xn.matches){if(Te=xn.matches,he=Qu(Te,re),it(he))return}else{ft(F,Z,ui(404,{pathname:re}),{flushSync:Ue});return}}P.set(F,st);let Qt=L,dn=lc(i,o,Ke,Te,he,r,Be),Rt=(await Ne(Ke,dn,Be,F))[he.route.id];if(Ke.signal.aborted){P.get(F)===st&&P.delete(F);return}if(ee.has(F)){if(Ms(Rt)||Hr(Rt)){yt(F,Oo(void 0));return}}else{if(Ms(Rt))if(P.delete(F),$>Qt){yt(F,Oo(void 0));return}else return O.add(F),yt(F,Fu(Je)),ge(Ke,Rt,!1,{fetcherSubmission:Je,preventScrollReset:Ze});if(Hr(Rt)){ft(F,Z,Rt.error);return}}let ao=k.navigation.location||k.location,ur=nc(e.history,ao,st.signal),Zr=u||c,Sr=k.navigation.state!=="idle"?zo(Zr,k.navigation.location,f):k.matches;bt(Sr,"Didn't find any matches after fetcher action");let oo=++L;H.set(F,oo);let so=Fu(Je,Rt.data);k.fetchers.set(F,so);let{dsMatches:Uc,revalidatingFetchers:Jr}=ET(ur,Be,i,o,e.history,k,Sr,Je,ao,r,!1,G,X,ee,U,O,Zr,f,e.patchRoutesOnNavigation!=null,[he.route.id,Rt]);Jr.filter(xn=>xn.key!==F).forEach(xn=>{let lo=xn.key,Bc=k.fetchers.get(lo),wr=Fu(void 0,Bc?Bc.data:void 0);k.fetchers.set(lo,wr),jt(lo),xn.controller&&P.set(lo,xn.controller)}),ke({fetchers:new Map(k.fetchers)});let xa=()=>Jr.forEach(xn=>jt(xn.key));st.signal.addEventListener("abort",xa);let{loaderResults:Ct,fetcherResults:nr}=await we(Uc,Jr,ur,Be);if(st.signal.aborted)return;if(st.signal.removeEventListener("abort",xa),H.delete(F),P.delete(F),Jr.forEach(xn=>P.delete(xn.key)),k.fetchers.has(F)){let xn=Oo(Rt.data);k.fetchers.set(F,xn)}let ji=lh(Ct);if(ji)return ge(ur,ji.result,!1,{preventScrollReset:Ze});if(ji=lh(nr),ji)return O.add(ji.key),ge(ur,ji.result,!1,{preventScrollReset:Ze});let{loaderData:Ci,errors:rs}=PT(k,Sr,Ct,void 0,Jr,nr);ga(oo),k.navigation.state==="loading"&&oo>$?(bt(M,"Expected pending action"),z&&z.abort(),vt(k.navigation.location,{matches:Sr,loaderData:Ci,errors:rs,fetchers:new Map(k.fetchers)})):(ke({errors:rs,loaderData:NT(k.loaderData,Ci,Sr,rs),fetchers:new Map(k.fetchers)}),G=!1)}async function me(F,Z,re,he,Te,Be,nt,Ue,Ze,Je){let it=k.fetchers.get(F);yt(F,Fu(Je,it?it.data:void 0),{flushSync:Ue});let Xe=new AbortController,st=nc(e.history,re,Xe.signal);if(nt){let Rt=await io(Te,re,st.signal,F);if(Rt.type==="aborted")return;if(Rt.type==="error"){ft(F,Z,Rt.error,{flushSync:Ue});return}else if(Rt.matches)Te=Rt.matches,he=Qu(Te,re);else{ft(F,Z,ui(404,{pathname:re}),{flushSync:Ue});return}}P.set(F,Xe);let Ke=L,Qt=lc(i,o,st,Te,he,r,Be),Pt=(await Ne(st,Qt,Be,F))[he.route.id];if(P.get(F)===Xe&&P.delete(F),!st.signal.aborted){if(ee.has(F)){yt(F,Oo(void 0));return}if(Ms(Pt))if($>Ke){yt(F,Oo(void 0));return}else{O.add(F),await ge(st,Pt,!1,{preventScrollReset:Ze});return}if(Hr(Pt)){ft(F,Z,Pt.error);return}yt(F,Oo(Pt.data))}}async function ge(F,Z,re,{submission:he,fetcherSubmission:Te,preventScrollReset:Be,replace:nt}={}){Z.response.headers.has("X-Remix-Revalidate")&&(G=!0);let Ue=Z.response.headers.get("Location");bt(Ue,"Expected a Location header on the redirect Response"),Ue=AT(Ue,new URL(F.url),f);let Ze=ud(k.location,Ue,{_isRedirect:!0});if(n){let Qt=!1;if(Z.response.headers.has("X-Remix-Reload-Document"))Qt=!0;else if(Yb.test(Ue)){const dn=yk(Ue,!0);Qt=dn.origin!==t.location.origin||vi(dn.pathname,f)==null}if(Qt){nt?t.location.replace(Ue):t.location.assign(Ue);return}}z=null;let Je=nt===!0||Z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:it,formAction:Xe,formEncType:st}=k.navigation;!he&&!Te&&it&&Xe&&st&&(he=LT(k.navigation));let Ke=he||Te;if(HX.has(Z.response.status)&&Ke&&qr(Ke.formMethod))await gt(Je,Ze,{submission:{...Ke,formAction:Ue},preventScrollReset:Be||I,enableViewTransition:re?V:void 0});else{let Qt=fy(Ze,he);await gt(Je,Ze,{overrideNavigation:Qt,fetcherSubmission:Te,preventScrollReset:Be||I,enableViewTransition:re?V:void 0})}}async function Ne(F,Z,re,he){let Te,Be={};try{Te=await JX(h,F,Z,he,re,!1)}catch(nt){return Z.filter(Ue=>Ue.shouldLoad).forEach(Ue=>{Be[Ue.route.id]={type:"error",error:nt}}),Be}if(F.signal.aborted)return Be;for(let[nt,Ue]of Object.entries(Te))if(aK(Ue)){let Ze=Ue.result;Be[nt]={type:"redirect",response:nK(Ze,F,nt,Z,f)}}else Be[nt]=await tK(Ue);return Be}async function we(F,Z,re,he){let Te=Ne(re,F,he,null),Be=Promise.all(Z.map(async Ze=>{if(Ze.matches&&Ze.match&&Ze.request&&Ze.controller){let it=(await Ne(Ze.request,Ze.matches,he,Ze.key))[Ze.match.route.id];return{[Ze.key]:it}}else return Promise.resolve({[Ze.key]:{type:"error",error:ui(404,{pathname:Ze.path})}})})),nt=await Te,Ue=(await Be).reduce((Ze,Je)=>Object.assign(Ze,Je),{});return{loaderResults:nt,fetcherResults:Ue}}function ze(){G=!0,U.forEach((F,Z)=>{P.has(Z)&&X.add(Z),jt(Z)})}function yt(F,Z,re={}){k.fetchers.set(F,Z),ke({fetchers:new Map(k.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function ft(F,Z,re,he={}){let Te=Rs(k.matches,Z);kt(F),ke({errors:{[Te.route.id]:re},fetchers:new Map(k.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function Gt(F){return K.set(F,(K.get(F)||0)+1),ee.has(F)&&ee.delete(F),k.fetchers.get(F)||qX}function kt(F){let Z=k.fetchers.get(F);P.has(F)&&!(Z&&Z.state==="loading"&&H.has(F))&&jt(F),U.delete(F),H.delete(F),O.delete(F),ee.delete(F),X.delete(F),k.fetchers.delete(F)}function un(F){let Z=(K.get(F)||0)-1;Z<=0?(K.delete(F),ee.add(F)):K.set(F,Z),ke({fetchers:new Map(k.fetchers)})}function jt(F){let Z=P.get(F);Z&&(Z.abort(),P.delete(F))}function Fi(F){for(let Z of F){let re=Gt(Z),he=Oo(re.data);k.fetchers.set(Z,he)}}function Si(){let F=[],Z=!1;for(let re of O){let he=k.fetchers.get(re);bt(he,`Expected fetcher: ${re}`),he.state==="loading"&&(O.delete(re),F.push(re),Z=!0)}return Fi(F),Z}function ga(F){let Z=[];for(let[re,he]of H)if(he<F){let Te=k.fetchers.get(re);bt(Te,`Expected fetcher: ${re}`),Te.state==="loading"&&(jt(re),H.delete(re),Z.push(re))}return Fi(Z),Z.length>0}function Vn(F,Z){let re=k.blockers.get(F)||Vu;return Se.get(F)!==Z&&Se.set(F,Z),re}function wi(F){k.blockers.delete(F),Se.delete(F)}function Kr(F,Z){let re=k.blockers.get(F)||Vu;bt(re.state==="unblocked"&&Z.state==="blocked"||re.state==="blocked"&&Z.state==="blocked"||re.state==="blocked"&&Z.state==="proceeding"||re.state==="blocked"&&Z.state==="unblocked"||re.state==="proceeding"&&Z.state==="unblocked",`Invalid blocker state transition: ${re.state} -> ${Z.state}`);let he=new Map(k.blockers);he.set(F,Z),ke({blockers:he})}function cl({currentLocation:F,nextLocation:Z,historyAction:re}){if(Se.size===0)return;Se.size>1&&Mn(!1,"A router only supports one blocker at a time");let he=Array.from(Se.entries()),[Te,Be]=he[he.length-1],nt=k.blockers.get(Te);if(!(nt&&nt.state==="proceeding")&&Be({currentLocation:F,nextLocation:Z,historyAction:re}))return Te}function va(F){let Z=ui(404,{pathname:F}),re=u||c,{matches:he,route:Te}=MT(re);return{notFoundMatches:he,route:Te,error:Z}}function ro(F,Z,re){if(b=F,w=Z,S=re||null,!C&&k.navigation===dy){C=!0;let he=qn(k.location,k.matches);he!=null&&ke({restoreScrollPosition:he})}return()=>{b=null,w=null,S=null}}function Hi(F,Z){return S&&S(F,Z.map(he=>wX(he,k.loaderData)))||F.key}function br(F,Z){if(b&&w){let re=Hi(F,Z);b[re]=w()}}function qn(F,Z){if(b){let re=Hi(F,Z),he=b[re];if(typeof he=="number")return he}return null}function ya(F,Z,re){if(e.patchRoutesOnNavigation)if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:wh(Z,re,f,!0)}}else return{active:!0,matches:wh(Z,re,f,!0)||[]};return{active:!1,matches:null}}async function io(F,Z,re,he){if(!e.patchRoutesOnNavigation)return{type:"success",matches:F};let Te=F;for(;;){let Be=u==null,nt=u||c,Ue=o;try{await e.patchRoutesOnNavigation({signal:re,path:Z,matches:Te,fetcherKey:he,patch:(it,Xe)=>{re.aborted||TT(it,Xe,nt,Ue,i)}})}catch(it){return{type:"error",error:it,partialMatches:Te}}finally{Be&&!re.aborted&&(c=[...c])}if(re.aborted)return{type:"aborted"};let Ze=zo(nt,Z,f);if(Ze)return{type:"success",matches:Ze};let Je=wh(nt,Z,f,!0);if(!Je||Te.length===Je.length&&Te.every((it,Xe)=>it.route.id===Je[Xe].route.id))return{type:"success",matches:null};Te=Je}}function ts(F){o={},u=ep(F,i,void 0,o)}function ns(F,Z){let re=u==null;TT(F,Z,u||c,o,i),re&&(c=[...c],ke({}))}return D={get basename(){return f},get future(){return m},get state(){return k},get routes(){return c},get window(){return t},initialize:Ge,subscribe:tt,enableScrollRestoration:ro,navigate:Lt,fetch:We,revalidate:$t,createHref:F=>e.history.createHref(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:Gt,deleteFetcher:un,dispose:Me,getBlocker:Vn,deleteBlocker:wi,patchRoutes:ns,_internalFetchControllers:P,_internalSetRoutes:ts},D}function QX(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function nx(e,t,n,r,i,o){let c,u;if(i){c=[];for(let h of t)if(c.push(h),h.route.id===i){u=h;break}}else c=t,u=t[t.length-1];let f=Qb(r||".",Wb(c),vi(e.pathname,n)||e.pathname,o==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let h=Xb(f.search);if(u.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let v=m.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=f.pathname==="/"?n:sa([n,f.pathname])),qo(f)}function CT(e,t,n){if(!n||!QX(n))return{path:t};if(n.formMethod&&!oK(n.formMethod))return{path:t,error:ui(405,{method:n.formMethod})};let r=()=>({path:t,error:ui(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),c=Ak(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!qr(o))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[b,S])=>`${v}${b}=${S}
575
- `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!qr(o))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}bt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=ax(n.formData),f=n.formData;else if(n.body instanceof FormData)u=ax(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=kT(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=kT(u)}catch{return r()}let h={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(qr(h.formMethod))return{path:t,submission:h};let m=no(t);return e&&m.search&&Xb(m.search)&&u.append("index",""),m.search=`?${u}`,{path:qo(m),submission:h}}function ET(e,t,n,r,i,o,c,u,f,h,m,g,v,b,S,w,C,E,_,T){var J;let R=T?Hr(T[1])?T[1].error:T[1].data:void 0,D=i.createURL(o.location),k=i.createURL(f),M;if(m&&o.errors){let G=Object.keys(o.errors)[0];M=c.findIndex(X=>X.route.id===G)}else if(T&&Hr(T[1])){let G=T[0];M=c.findIndex(X=>X.route.id===G)-1}let I=T?T[1].statusCode:void 0,z=I&&I>=400,V={currentUrl:D,currentParams:((J=o.matches[0])==null?void 0:J.params)||{},nextUrl:k,nextParams:c[0].params,...u,actionResult:R,actionStatus:I},Y=c.map((G,X)=>{let{route:P}=G,L=null;if(M!=null&&X>M?L=!1:P.lazy?L=!0:P.loader==null?L=!1:m?L=rx(P,o.loaderData,o.errors):YX(o.loaderData,o.matches[X],G)&&(L=!0),L!==null)return ix(n,r,e,G,h,t,L);let $=z?!1:g||D.pathname+D.search===k.pathname+k.search||D.search!==k.search||XX(o.matches[X],G),H={...V,defaultShouldRevalidate:$},O=rp(G,H);return ix(n,r,e,G,h,t,O,H)}),W=[];return S.forEach((G,X)=>{if(m||!c.some(ee=>ee.route.id===G.routeId)||b.has(X))return;let P=o.fetchers.get(X),L=P&&P.state!=="idle"&&P.data===void 0,$=zo(C,G.path,E);if(!$){if(_&&L)return;W.push({key:X,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(w.has(X))return;let H=Qu($,G.path),O=new AbortController,U=nc(i,G.path,O.signal),K=null;if(v.has(X))v.delete(X),K=lc(n,r,U,$,H,h,t);else if(L)g&&(K=lc(n,r,U,$,H,h,t));else{let ee={...V,defaultShouldRevalidate:z?!1:g};rp(H,ee)&&(K=lc(n,r,U,$,H,h,t,ee))}K&&W.push({key:X,routeId:G.routeId,path:G.path,matches:K,match:H,request:U,controller:O})}),{dsMatches:Y,revalidatingFetchers:W}}function rx(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function YX(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function XX(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function rp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function TT(e,t,n,r,i){let o;if(e){let f=r[e];bt(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),o=f.children}else o=n;let c=t.filter(f=>!o.some(h=>Ek(f,h))),u=ep(c,i,[e||"_","patch",String((o==null?void 0:o.length)||"0")],r);o.push(...u)}function Ek(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(o=>Ek(n,o))}):!1}var RT=new WeakMap,Tk=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(bt(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let o=i.lazy[e];if(!o)return;let c=RT.get(i);c||(c={},RT.set(i,c));let u=c[e];if(u)return u;let f=(async()=>{let h=yX(e),g=i[e]!==void 0&&e!=="hasErrorBoundary";if(h)Mn(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Mn(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await o();v!=null&&(Object.assign(i,{[e]:v}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(v=>v===void 0)&&(i.lazy=void 0))})();return c[e]=f,f},_T=new WeakMap;function KX(e,t,n,r,i){let o=n[e.id];if(bt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=_T.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{bt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let S in v){let w=v[S];if(w===void 0)continue;let C=bX(S),_=o[S]!==void 0&&S!=="hasErrorBoundary";C?Mn(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?Mn(!_,`Route "${o.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):b[S]=w}Object.assign(o,b),Object.assign(o,{...r(o),lazy:void 0})})();return _T.set(o,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let m of c){if(i&&i.includes(m))continue;let g=Tk({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),m===t&&(f=g))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h==null||h.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function DT(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,o)=>{n[t[o].route.id]=i}),n}async function ZX(e){return e.matches.some(t=>t.route.unstable_middleware)?Rk(e,!1,()=>DT(e),(t,n)=>({[n]:{type:"error",result:t}})):DT(e)}async function Rk(e,t,n,r){let{matches:i,request:o,params:c,context:u}=e,f={handlerResult:void 0};try{let h=i.flatMap(g=>g.route.unstable_middleware?g.route.unstable_middleware.map(v=>[g.route.id,v]):[]),m=await _k({request:o,params:c,context:u},h,t,f,n);return t?m:f.handlerResult}catch(h){if(!f.middlewareError)throw h;let m=await r(f.middlewareError.error,f.middlewareError.routeId);return f.handlerResult?Object.assign(f.handlerResult,m):m}}async function _k(e,t,n,r,i,o=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason?c.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${c.method} ${c.url}`);let u=t[o];if(!u)return r.handlerResult=await i(),r.handlerResult;let[f,h]=u,m=!1,g,v=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");m=!0,await _k(e,t,n,r,i,o+1)};try{let b=await h({request:e.request,params:e.params,context:e.context},v);return m?b===void 0?g:b:v()}catch(b){throw r.middlewareError?r.middlewareError.error!==b&&(r.middlewareError={routeId:f,error:b}):r.middlewareError={routeId:f,error:b},b}}function Dk(e,t,n,r,i){let o=Tk({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=KX(r.route,qr(n.method)?"action":"loader",t,e,i);return{middleware:o,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function ix(e,t,n,r,i,o,c,u=null){let f=!1,h=Dk(e,t,n,r,i);return{...r,_lazyPromises:h,shouldLoad:c,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler(m){return f=!0,u?typeof m=="boolean"?rp(r,{...u,defaultShouldRevalidate:m}):rp(r,u):c},resolve(m){return f||c||m&&n.method==="GET"&&(r.route.lazy||r.route.loader)?eK({request:n,match:r,lazyHandlerPromise:h==null?void 0:h.handler,lazyRoutePromise:h==null?void 0:h.route,handlerOverride:m,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function lc(e,t,n,r,i,o,c,u=null){return r.map(f=>f.route.id!==i.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:Dk(e,t,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ix(e,t,n,f,o,c,!0,u))}async function JX(e,t,n,r,i,o){n.some(h=>{var m;return(m=h._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(h=>{var m;return(m=h._lazyPromises)==null?void 0:m.middleware}));let c={request:t,params:n[0].params,context:i,matches:n},f=await e({...c,fetcherKey:r,unstable_runClientMiddleware:h=>{let m=c;return Rk(m,!1,()=>h({...m,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(g,v)=>({[v]:{type:"error",result:g}}))}});try{await Promise.all(n.flatMap(h=>{var m,g;return[(m=h._lazyPromises)==null?void 0:m.handler,(g=h._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function eK({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:i,scopedContext:o}){let c,u,f=qr(e.method),h=f?"action":"loader",m=g=>{let v,b=new Promise((C,E)=>v=E);u=()=>v(),e.signal.addEventListener("abort",u);let S=C=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${t.route.id}]`)):g({request:e,params:t.params,context:o},...C!==void 0?[C]:[]),w=(async()=>{try{return{type:"data",result:await(i?i(E=>S(E)):S())}}catch(C){return{type:"error",result:C}}})();return Promise.race([w,b])};try{let g=f?t.route.action:t.route.loader;if(n||r)if(g){let v,[b]=await Promise.all([m(g).catch(S=>{v=S}),n,r]);if(v!==void 0)throw v;c=b}else{await n;let v=f?t.route.action:t.route.loader;if(v)[c]=await Promise.all([m(v),r]);else if(h==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw ui(405,{method:e.method,pathname:S,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(g)c=await m(g);else{let v=new URL(e.url),b=v.pathname+v.search;throw ui(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{u&&e.signal.removeEventListener("abort",u)}return c}async function tK(e){var r,i,o,c,u,f;let{result:t,type:n}=e;if(kk(t)){let h;try{let m=t.headers.get("Content-Type");m&&/\bapplication\/json\b/.test(m)?t.body==null?h=null:h=await t.json():h=await t.text()}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new np(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:"data",data:h,statusCode:t.status,headers:t.headers}}return n==="error"?IT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new np(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:dd(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:dd(t)?t.status:void 0}:IT(t)?{type:"data",data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function nK(e,t,n,r,i){let o=e.headers.get("Location");if(bt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Yb.test(o)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);o=nx(new URL(t.url),c,i,o),e.headers.set("Location",o)}return e}function AT(e,t,n){if(Yb.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=vi(i.pathname,n)!=null;if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}return e}function nc(e,t,n,r){let i=e.createURL(Ak(t)).toString(),o={signal:n};if(r&&qr(r.formMethod)){let{formMethod:c,formEncType:u}=r;o.method=c.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(r.json)):u==="text/plain"?o.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?o.body=ax(r.formData):o.body=r.formData}return new Request(i,o)}function ax(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function kT(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function rK(e,t,n,r=!1,i=!1){let o={},c=null,u,f=!1,h={},m=n&&Hr(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let v=g.route.id,b=t[v];if(bt(!Ms(b),"Cannot handle redirect results in processLoaderData"),Hr(b)){let S=b.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},i)c[v]=S;else{let w=Rs(e,v);c[w.route.id]==null&&(c[w.route.id]=S)}r||(o[v]=Ck),f||(f=!0,u=dd(b.error)?b.error.status:500),b.headers&&(h[v]=b.headers)}else o[v]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(u=b.statusCode),b.headers&&(h[v]=b.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:c,statusCode:u||200,loaderHeaders:h}}function PT(e,t,n,r,i,o){let{loaderData:c,errors:u}=rK(t,n,r);return i.filter(f=>!f.matches||f.matches.some(h=>h.shouldLoad)).forEach(f=>{let{key:h,match:m,controller:g}=f,v=o[h];if(bt(v,"Did not find corresponding fetcher result"),!(g&&g.signal.aborted))if(Hr(v)){let b=Rs(e.matches,m==null?void 0:m.route.id);u&&u[b.route.id]||(u={...u,[b.route.id]:v.error}),e.fetchers.delete(h)}else if(Ms(v))bt(!1,"Unhandled fetcher revalidation redirect");else{let b=Oo(v.data);e.fetchers.set(h,b)}}),{loaderData:c,errors:u}}function NT(e,t,n,r){let i=Object.entries(t).filter(([,o])=>o!==Ck).reduce((o,[c,u])=>(o[c]=u,o),{});for(let o of n){let c=o.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&o.route.loader&&(i[c]=e[c]),r&&r.hasOwnProperty(c))break}return i}function OT(e){return e?Hr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Rs(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 MT(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 ui(e,{pathname:t,routeId:n,method:r,type:i,message:o}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new np(e||500,c,new Error(u),!0)}function lh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Ms(i))return{key:r,result:i}}}function Ak(e){let t=typeof e=="string"?no(e):e;return qo({...t,hash:""})}function iK(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function aK(e){return kk(e.result)&&FX.has(e.result.status)}function Hr(e){return e.type==="error"}function Ms(e){return(e&&e.type)==="redirect"}function IT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function kk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function oK(e){return VX.has(e.toUpperCase())}function qr(e){return UX.has(e.toUpperCase())}function Xb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qu(e,t){let n=typeof t=="string"?no(t).search:t.search;if(e[e.length-1].route.index&&Xb(n||""))return e[e.length-1];let r=Sk(e);return r[r.length-1]}function LT(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:c}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function fy(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 sK(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 Fu(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 lK(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 Oo(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 cK(e,t){try{let n=e.sessionStorage.getItem(jk);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function uK(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(jk,JSON.stringify(n))}catch(r){Mn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function dK(){let e,t,n=new Promise((r,i)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{i(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var ol=y.createContext(null);ol.displayName="DataRouter";var Ld=y.createContext(null);Ld.displayName="DataRouterState";var Kb=y.createContext({isTransitioning:!1});Kb.displayName="ViewTransition";var Pk=y.createContext(new Map);Pk.displayName="Fetchers";var fK=y.createContext(null);fK.displayName="Await";var ma=y.createContext(null);ma.displayName="Navigation";var $d=y.createContext(null);$d.displayName="Location";var Vi=y.createContext({outlet:null,matches:[],isDataRoute:!1});Vi.displayName="Route";var Zb=y.createContext(null);Zb.displayName="RouteError";function hK(e,{relative:t}={}){bt(zd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(ma),{hash:i,pathname:o,search:c}=Ud(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:sa([n,o])),r.createHref({pathname:u,search:c,hash:i})}function zd(){return y.useContext($d)!=null}function Mr(){return bt(zd(),"useLocation() may be used only in the context of a <Router> component."),y.useContext($d).location}var Nk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ok(e){y.useContext(ma).static||y.useLayoutEffect(e)}function wn(){let{isDataRoute:e}=y.useContext(Vi);return e?_K():pK()}function pK(){bt(zd(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(ol),{basename:t,navigator:n}=y.useContext(ma),{matches:r}=y.useContext(Vi),{pathname:i}=Mr(),o=JSON.stringify(Wb(r)),c=y.useRef(!1);return Ok(()=>{c.current=!0}),y.useCallback((f,h={})=>{if(Mn(c.current,Nk),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Qb(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:sa([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,o,i,e])}var mK=y.createContext(null);function gK(e){let t=y.useContext(Vi).outlet;return t&&y.createElement(mK.Provider,{value:e},t)}function qt(){let{matches:e}=y.useContext(Vi),t=e[e.length-1];return t?t.params:{}}function Ud(e,{relative:t}={}){let{matches:n}=y.useContext(Vi),{pathname:r}=Mr(),i=JSON.stringify(Wb(n));return y.useMemo(()=>Qb(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function vK(e,t){return Mk(e,t)}function Mk(e,t,n,r){var E;bt(zd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=y.useContext(ma),{matches:o}=y.useContext(Vi),c=o[o.length-1],u=c?c.params:{},f=c?c.pathname:"/",h=c?c.pathnameBase:"/",m=c&&c.route;{let _=m&&m.path||"";Ik(f,!m||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${_}">) 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.
576
-
577
- Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let g=Mr(),v;if(t){let _=typeof t=="string"?no(t):t;bt(h==="/"||((E=_.pathname)==null?void 0:E.startsWith(h)),`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 "${h}" but pathname "${_.pathname}" was given in the \`location\` prop.`),v=_}else v=g;let b=v.pathname||"/",S=b;if(h!=="/"){let _=h.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(_.length).join("/")}let w=zo(e,{pathname:S});Mn(m||w!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Mn(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 C=wK(w&&w.map(_=>Object.assign({},_,{params:Object.assign({},u,_.params),pathname:sa([h,i.encodeLocation?i.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?h:sa([h,i.encodeLocation?i.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),o,n,r);return t&&C?y.createElement($d.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},C):C}function yK(){let e=RK(),t=dd(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)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:o},"ErrorBoundary")," or"," ",y.createElement("code",{style:o},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,c)}var xK=y.createElement(yK,null),bK=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?y.createElement(Vi.Provider,{value:this.props.routeContext},y.createElement(Zb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function SK({routeContext:e,match:t,children:n}){let r=y.useContext(ol);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Vi.Provider,{value:e},n)}function wK(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=n==null?void 0:n.errors;if(o!=null){let f=i.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);bt(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let c=!1,u=-1;if(n)for(let f=0;f<i.length;f++){let h=i[f];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=f),h.route.id){let{loaderData:m,errors:g}=n,v=h.route.loader&&!m.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||v){c=!0,u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((f,h,m)=>{let g,v=!1,b=null,S=null;n&&(g=o&&h.route.id?o[h.route.id]:void 0,b=h.route.errorElement||xK,c&&(u<0&&m===0?(Ik("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,S=null):u===m&&(v=!0,S=h.route.hydrateFallbackElement||null)));let w=t.concat(i.slice(0,m+1)),C=()=>{let E;return g?E=b:v?E=S:h.route.Component?E=y.createElement(h.route.Component,null):h.route.element?E=h.route.element:E=f,y.createElement(SK,{match:h,routeContext:{outlet:f,matches:w,isDataRoute:n!=null},children:E})};return n&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?y.createElement(bK,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):C()},null)}function Jb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jK(e){let t=y.useContext(ol);return bt(t,Jb(e)),t}function CK(e){let t=y.useContext(Ld);return bt(t,Jb(e)),t}function EK(e){let t=y.useContext(Vi);return bt(t,Jb(e)),t}function e1(e){let t=EK(e),n=t.matches[t.matches.length-1];return bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function TK(){return e1("useRouteId")}function RK(){var r;let e=y.useContext(Zb),t=CK("useRouteError"),n=e1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function _K(){let{router:e}=jK("useNavigate"),t=e1("useNavigate"),n=y.useRef(!1);return Ok(()=>{n.current=!0}),y.useCallback(async(i,o={})=>{Mn(n.current,Nk),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var $T={};function Ik(e,t,n){!t&&!$T[e]&&($T[e]=!0,Mn(!1,n))}var zT={};function UT(e,t){!e&&!zT[t]&&(zT[t]=!0,console.warn(t))}function DK(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Mn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Mn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Mn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var AK=["HydrateFallback","hydrateFallbackElement"],kK=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 PK({router:e,flushSync:t}){let[n,r]=y.useState(e.state),[i,o]=y.useState(),[c,u]=y.useState({isTransitioning:!1}),[f,h]=y.useState(),[m,g]=y.useState(),[v,b]=y.useState(),S=y.useRef(new Map),w=y.useCallback((T,{deletedFetchers:R,flushSync:D,viewTransitionOpts:k})=>{T.fetchers.forEach((I,z)=>{I.data!==void 0&&S.current.set(z,I.data)}),R.forEach(I=>S.current.delete(I)),UT(D===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let M=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(UT(k==null||M,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!k||!M){t&&D?t(()=>r(T)):y.startTransition(()=>r(T));return}if(t&&D){t(()=>{m&&(f&&f.resolve(),m.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:k.currentLocation,nextLocation:k.nextLocation})});let I=e.window.document.startViewTransition(()=>{t(()=>r(T))});I.finished.finally(()=>{t(()=>{h(void 0),g(void 0),o(void 0),u({isTransitioning:!1})})}),t(()=>g(I));return}m?(f&&f.resolve(),m.skipTransition(),b({state:T,currentLocation:k.currentLocation,nextLocation:k.nextLocation})):(o(T),u({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}))},[e.window,t,m,f]);y.useLayoutEffect(()=>e.subscribe(w),[e,w]),y.useEffect(()=>{c.isTransitioning&&!c.flushSync&&h(new kK)},[c]),y.useEffect(()=>{if(f&&i&&e.window){let T=i,R=f.promise,D=e.window.document.startViewTransition(async()=>{y.startTransition(()=>r(T)),await R});D.finished.finally(()=>{h(void 0),g(void 0),o(void 0),u({isTransitioning:!1})}),g(D)}},[i,f,e.window]),y.useEffect(()=>{f&&i&&n.location.key===i.location.key&&f.resolve()},[f,m,n.location,i]),y.useEffect(()=>{!c.isTransitioning&&v&&(o(v.state),u({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[c.isTransitioning,v]);let C=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,R,D)=>e.navigate(T,{state:R,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(T,R,D)=>e.navigate(T,{replace:!0,state:R,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[e]),E=e.basename||"/",_=y.useMemo(()=>({router:e,navigator:C,static:!1,basename:E}),[e,C,E]);return y.createElement(y.Fragment,null,y.createElement(ol.Provider,{value:_},y.createElement(Ld.Provider,{value:n},y.createElement(Pk.Provider,{value:S.current},y.createElement(Kb.Provider,{value:c},y.createElement(MK,{basename:E,location:n.location,navigationType:n.historyAction,navigator:C},y.createElement(NK,{routes:e.routes,future:e.future,state:n})))))),null)}var NK=y.memo(OK);function OK({routes:e,future:t,state:n}){return Mk(e,void 0,n,t)}function t1(e){return gK(e.context)}function Fe(e){bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function MK({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1}){bt(!zd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:c,navigator:i,static:o,future:{}}),[c,i,o]);typeof n=="string"&&(n=no(n));let{pathname:f="/",search:h="",hash:m="",state:g=null,key:v="default"}=n,b=y.useMemo(()=>{let S=vi(f,c);return S==null?null:{location:{pathname:S,search:h,hash:m,state:g,key:v},navigationType:r}},[c,f,h,m,g,v,r]);return Mn(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${h}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:y.createElement(ma.Provider,{value:u},y.createElement($d.Provider,{children:t,value:b}))}function IK({children:e,location:t}){return vK(ox(e),t)}function ox(e,t=[]){let n=[];return y.Children.forEach(e,(r,i)=>{if(!y.isValidElement(r))return;let o=[...t,i];if(r.type===y.Fragment){n.push.apply(n,ox(r.props.children,o));return}bt(r.type===Fe,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=ox(r.props.children,o)),n.push(c)}),n}var jh="get",Ch="application/x-www-form-urlencoded";function gm(e){return e!=null&&typeof e.tagName=="string"}function LK(e){return gm(e)&&e.tagName.toLowerCase()==="button"}function $K(e){return gm(e)&&e.tagName.toLowerCase()==="form"}function zK(e){return gm(e)&&e.tagName.toLowerCase()==="input"}function UK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function BK(e,t){return e.button===0&&(!t||t==="_self")&&!UK(e)}function sx(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(i=>[n,i]):[[n,r]])},[]))}function VK(e,t){let n=sx(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var ch=null;function FK(){if(ch===null)try{new FormData(document.createElement("form"),0),ch=!1}catch{ch=!0}return ch}var HK=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function hy(e){return e!=null&&!HK.has(e)?(Mn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ch}"`),null):e}function qK(e,t){let n,r,i,o,c;if($K(e)){let u=e.getAttribute("action");r=u?vi(u,t):null,n=e.getAttribute("method")||jh,i=hy(e.getAttribute("enctype"))||Ch,o=new FormData(e)}else if(LK(e)||zK(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?vi(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||jh,i=hy(e.getAttribute("formenctype"))||hy(u.getAttribute("enctype"))||Ch,o=new FormData(u,e),!FK()){let{name:h,type:m,value:g}=e;if(m==="image"){let v=h?`${h}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else h&&o.append(h,g)}}else{if(gm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=jh,r=null,i=Ch,c=e}return o&&i==="text/plain"&&(c=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:c}}function n1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function GK(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 WK(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 QK(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let c=await GK(o,n);return c.links?c.links():[]}return[]}));return ZK(r.flat(1).filter(WK).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function BT(e,t,n,r,i,o){let c=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,u=(f,h)=>{var m;return n[h].pathname!==f.pathname||((m=n[h].route.path)==null?void 0:m.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,h)=>c(f,h)||u(f,h)):o==="data"?t.filter((f,h)=>{var g;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,h)||u(f,h))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function YK(e,t,{includeHydrateFallback:n}={}){return XK(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function XK(e){return[...new Set(e)]}function KK(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ZK(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(KK(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var JK=new Set([100,101,204,205]);function eZ(e,t){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&vi(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function Lk(){let e=y.useContext(ol);return n1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tZ(){let e=y.useContext(Ld);return n1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var r1=y.createContext(void 0);r1.displayName="FrameworkContext";function $k(){let e=y.useContext(r1);return n1(e,"You must render this element inside a <HydratedRouter> element"),e}function nZ(e,t){let n=y.useContext(r1),[r,i]=y.useState(!1),[o,c]=y.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:m,onTouchStart:g}=t,v=y.useRef(null);y.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let w=E=>{E.forEach(_=>{c(_.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[e]),y.useEffect(()=>{if(r){let w=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(w)}}},[r]);let b=()=>{i(!0)},S=()=>{i(!1),c(!1)};return n?e!=="intent"?[o,v,{}]:[o,v,{onFocus:Hu(u,b),onBlur:Hu(f,S),onMouseEnter:Hu(h,b),onMouseLeave:Hu(m,S),onTouchStart:Hu(g,b)}]:[!1,v,{}]}function Hu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rZ({page:e,...t}){let{router:n}=Lk(),r=y.useMemo(()=>zo(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(aZ,{page:e,matches:r,...t}):null}function iZ(e){let{manifest:t,routeModules:n}=$k(),[r,i]=y.useState([]);return y.useEffect(()=>{let o=!1;return QK(e,t,n).then(c=>{o||i(c)}),()=>{o=!0}},[e,t,n]),r}function aZ({page:e,matches:t,...n}){let r=Mr(),{manifest:i,routeModules:o}=$k(),{basename:c}=Lk(),{loaderData:u,matches:f}=tZ(),h=y.useMemo(()=>BT(e,t,f,i,r,"data"),[e,t,f,i,r]),m=y.useMemo(()=>BT(e,t,f,i,r,"assets"),[e,t,f,i,r]),g=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,w=!1;if(t.forEach(E=>{var T;let _=i.routes[E.route.id];!_||!_.hasLoader||(!h.some(R=>R.route.id===E.route.id)&&E.route.id in u&&((T=o[E.route.id])!=null&&T.shouldRevalidate)||_.hasClientLoader?w=!0:S.add(E.route.id))}),S.size===0)return[];let C=eZ(e,c);return w&&S.size>0&&C.searchParams.set("_routes",t.filter(E=>S.has(E.route.id)).map(E=>E.route.id).join(",")),[C.pathname+C.search]},[c,u,r,i,h,t,e,o]),v=y.useMemo(()=>YK(m,i),[m,i]),b=iZ(m);return y.createElement(y.Fragment,null,g.map(S=>y.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),v.map(S=>y.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),b.map(({key:S,link:w})=>y.createElement("link",{key:S,...w})))}function oZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var zk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{zk&&(window.__reactRouterVersion="7.6.3")}catch{}function sZ(e,t){return WX({basename:t==null?void 0:t.basename,unstable_getContext:t==null?void 0:t.unstable_getContext,future:t==null?void 0:t.future,history:pX({window:t==null?void 0:t.window}),hydrationData:lZ(),routes:e,mapRouteProperties:DK,hydrationRouteProperties:AK,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function lZ(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:cZ(e.errors)}),e}function cZ(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new np(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let c=new o(i.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}var Uk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bk=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:c,state:u,target:f,to:h,preventScrollReset:m,viewTransition:g,...v},b){let{basename:S}=y.useContext(ma),w=typeof h=="string"&&Uk.test(h),C,E=!1;if(typeof h=="string"&&w&&(C=h,zk))try{let z=new URL(window.location.href),V=h.startsWith("//")?new URL(z.protocol+h):new URL(h),Y=vi(V.pathname,S);V.origin===z.origin&&Y!=null?h=Y+V.search+V.hash:E=!0}catch{Mn(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=hK(h,{relative:i}),[T,R,D]=nZ(r,v),k=hZ(h,{replace:c,state:u,target:f,preventScrollReset:m,relative:i,viewTransition:g});function M(z){t&&t(z),z.defaultPrevented||k(z)}let I=y.createElement("a",{...v,...D,href:C||_,onClick:E||o?t:M,ref:oZ(b,R),target:f,"data-discover":!w&&n==="render"?"true":void 0});return T&&!w?y.createElement(y.Fragment,null,I,y.createElement(rZ,{page:_})):I});Bk.displayName="Link";var uZ=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:c,viewTransition:u,children:f,...h},m){let g=Ud(c,{relative:h.relative}),v=Mr(),b=y.useContext(Ld),{navigator:S,basename:w}=y.useContext(ma),C=b!=null&&yZ(g)&&u===!0,E=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,_=v.pathname,T=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(_=_.toLowerCase(),T=T?T.toLowerCase():null,E=E.toLowerCase()),T&&w&&(T=vi(T,w)||T);const R=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let D=_===E||!i&&_.startsWith(E)&&_.charAt(R)==="/",k=T!=null&&(T===E||!i&&T.startsWith(E)&&T.charAt(E.length)==="/"),M={isActive:D,isPending:k,isTransitioning:C},I=D?t:void 0,z;typeof r=="function"?z=r(M):z=[r,D?"active":null,k?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let V=typeof o=="function"?o(M):o;return y.createElement(Bk,{...h,"aria-current":I,className:z,ref:m,style:V,to:c,viewTransition:u},typeof f=="function"?f(M):f)});uZ.displayName="NavLink";var dZ=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:c=jh,action:u,onSubmit:f,relative:h,preventScrollReset:m,viewTransition:g,...v},b)=>{let S=gZ(),w=vZ(u,{relative:h}),C=c.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&Uk.test(u),_=T=>{if(f&&f(T),T.defaultPrevented)return;T.preventDefault();let R=T.nativeEvent.submitter,D=(R==null?void 0:R.getAttribute("formmethod"))||c;S(R||T.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:i,state:o,relative:h,preventScrollReset:m,viewTransition:g})};return y.createElement("form",{ref:b,method:C,action:w,onSubmit:r?f:_,...v,"data-discover":!E&&e==="render"?"true":void 0})});dZ.displayName="Form";function fZ(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vk(e){let t=y.useContext(ol);return bt(t,fZ(e)),t}function hZ(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:c}={}){let u=wn(),f=Mr(),h=Ud(e,{relative:o});return y.useCallback(m=>{if(BK(m,t)){m.preventDefault();let g=n!==void 0?n:qo(f)===qo(h);u(e,{replace:g,state:r,preventScrollReset:i,relative:o,viewTransition:c})}},[f,u,h,n,r,t,e,i,o,c])}function i1(e){Mn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(sx(e)),n=y.useRef(!1),r=Mr(),i=y.useMemo(()=>VK(r.search,n.current?null:t.current),[r.search]),o=wn(),c=y.useCallback((u,f)=>{const h=sx(typeof u=="function"?u(i):u);n.current=!0,o("?"+h,f)},[o,i]);return[i,c]}var pZ=0,mZ=()=>`__${String(++pZ)}__`;function gZ(){let{router:e}=Vk("useSubmit"),{basename:t}=y.useContext(ma),n=TK();return y.useCallback(async(r,i={})=>{let{action:o,method:c,encType:u,formData:f,body:h}=qK(r,t);if(i.navigate===!1){let m=i.fetcherKey||mZ();await e.fetch(m,n,i.action||o,{preventScrollReset:i.preventScrollReset,formData:f,body:h,formMethod:i.method||c,formEncType:i.encType||u,flushSync:i.flushSync})}else await e.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:f,body:h,formMethod:i.method||c,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function vZ(e,{relative:t}={}){let{basename:n}=y.useContext(ma),r=y.useContext(Vi);bt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...Ud(e||".",{relative:t})},c=Mr();if(e==null){o.search=c.search;let u=new URLSearchParams(o.search),f=u.getAll("index");if(f.some(m=>m==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let m=u.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:sa([n,o.pathname])),qo(o)}function yZ(e,t={}){let n=y.useContext(Kb);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Vk("useViewTransitionState"),i=Ud(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=vi(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=vi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return tp(i.pathname,c)!=null||tp(i.pathname,o)!=null}[...JK];const xZ=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 Sc(e,t,n){const r=bZ(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&VT(r,"path",o),VT(r,"relativePath",o),r}function bZ(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=xZ.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function VT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var sl=(e,t,n)=>new Promise((r,i)=>{var o=f=>{try{u(n.next(f))}catch(h){i(h)}},c=f=>{try{u(n.throw(f))}catch(h){i(h)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,c);u((n=n.apply(e,t)).next())});const SZ=[".DS_Store","Thumbs.db"];function wZ(e){return sl(this,null,function*(){return ip(e)&&jZ(e.dataTransfer)?RZ(e.dataTransfer,e.type):CZ(e)?EZ(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?TZ(e):[]})}function jZ(e){return ip(e)}function CZ(e){return ip(e)&&ip(e.target)}function ip(e){return typeof e=="object"&&e!==null}function EZ(e){return lx(e.target.files).map(t=>Sc(t))}function TZ(e){return sl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Sc(n))})}function RZ(e,t){return sl(this,null,function*(){if(e.items){const n=lx(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(_Z));return FT(Fk(r))}return FT(lx(e.files).map(n=>Sc(n)))})}function FT(e){return e.filter(t=>SZ.indexOf(t.name)===-1)}function lx(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 _Z(e){if(typeof e.webkitGetAsEntry!="function")return HT(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Hk(t):HT(e,t)}function Fk(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?Fk(n):[n]],[])}function HT(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(o=>sl(this,null,function*(){const c=yield o.getFile();return c.handle=o,Sc(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const i=Sc(r,(n=t==null?void 0:t.fullPath)!=null?n:void 0);return Promise.resolve(i)}function DZ(e){return sl(this,null,function*(){return e.isDirectory?Hk(e):AZ(e)})}function Hk(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(c=>sl(this,null,function*(){if(c.length){const u=Promise.all(c.map(DZ));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),c=>{r(c)})}o()})}function AZ(e){return sl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const i=Sc(r,e.fullPath);t(i)},r=>{n(r)})})})}function py(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(c=>{const u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}var kZ=Object.defineProperty,PZ=Object.defineProperties,NZ=Object.getOwnPropertyDescriptors,qT=Object.getOwnPropertySymbols,OZ=Object.prototype.hasOwnProperty,MZ=Object.prototype.propertyIsEnumerable,GT=(e,t,n)=>t in e?kZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IZ=(e,t)=>{for(var n in t||(t={}))OZ.call(t,n)&&GT(e,n,t[n]);if(qT)for(var n of qT(t))MZ.call(t,n)&&GT(e,n,t[n]);return e},LZ=(e,t)=>PZ(e,NZ(t));const $Z=typeof py=="function"?py:py.default,zZ="file-invalid-type",UZ="file-too-large",BZ="file-too-small",VZ="too-many-files",FZ=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:zZ,message:`File type must be ${n}`}},WT=e=>({code:UZ,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),QT=e=>({code:BZ,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),HZ={code:VZ,message:"Too many files"};function qk(e,t){const n=e.type==="application/x-moz-file"||$Z(e,t);return[n,n?null:FZ(t)]}function Gk(e,t,n){if(_s(e.size))if(_s(t)&&_s(n)){if(e.size>n)return[!1,WT(n)];if(e.size<t)return[!1,QT(t)]}else{if(_s(t)&&e.size<t)return[!1,QT(t)];if(_s(n)&&e.size>n)return[!1,WT(n)]}return[!0,null]}function _s(e){return e!=null}function qZ({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:o,validator:c}){return!i&&e.length>1||i&&o>=1&&e.length>o?!1:e.every(u=>{const[f]=qk(u,t),[h]=Gk(u,n,r),m=c?c(u):null;return f&&h&&!m})}function ap(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function uh(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,t=>t==="Files"||t==="application/x-moz-file"):!!e.target&&!!e.target.files}function YT(e){e.preventDefault()}function GZ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function WZ(e){return e.indexOf("Edge/")!==-1}function QZ(e=window.navigator.userAgent){return GZ(e)||WZ(e)}function Ki(...e){return(t,...n)=>e.some(r=>(!ap(t)&&r&&r(t,...n),ap(t)))}function YZ(){return"showOpenFilePicker"in window}function XZ(e){return _s(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let i=!0;return Wk(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),i=!1),(!Array.isArray(r)||!r.every(Qk))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),i=!1),i}).reduce((n,[r,i])=>LZ(IZ({},n),{[r]:i}),{})}]:e}function KZ(e){if(_s(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>Wk(t)||Qk(t)).join(",")}function ZZ(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function JZ(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Wk(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function Qk(e){return/^.*\.[\w]+$/.test(e)}var eJ=Object.defineProperty,tJ=Object.defineProperties,nJ=Object.getOwnPropertyDescriptors,op=Object.getOwnPropertySymbols,Yk=Object.prototype.hasOwnProperty,Xk=Object.prototype.propertyIsEnumerable,XT=(e,t,n)=>t in e?eJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pr=(e,t)=>{for(var n in t||(t={}))Yk.call(t,n)&&XT(e,n,t[n]);if(op)for(var n of op(t))Xk.call(t,n)&&XT(e,n,t[n]);return e},Lo=(e,t)=>tJ(e,nJ(t)),sp=(e,t)=>{var n={};for(var r in e)Yk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&op)for(var r of op(e))t.indexOf(r)<0&&Xk.call(e,r)&&(n[r]=e[r]);return n};const a1=y.forwardRef((e,t)=>{var n=e,{children:r}=n,i=sp(n,["children"]);const o=Zk(i),{open:c}=o,u=sp(o,["open"]);return y.useImperativeHandle(t,()=>({open:c}),[c]),En.createElement(y.Fragment,null,r(Lo(pr({},u),{open:c})))});a1.displayName="Dropzone";const Kk={disabled:!1,getFilesFromEvent:wZ,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};a1.defaultProps=Kk;a1.propTypes={children:on.func,accept:on.objectOf(on.arrayOf(on.string)),multiple:on.bool,preventDropOnDocument:on.bool,noClick:on.bool,noKeyboard:on.bool,noDrag:on.bool,noDragEventsBubbling:on.bool,minSize:on.number,maxSize:on.number,maxFiles:on.number,disabled:on.bool,getFilesFromEvent:on.func,onFileDialogCancel:on.func,onFileDialogOpen:on.func,useFsAccessApi:on.bool,autoFocus:on.bool,onDragEnter:on.func,onDragLeave:on.func,onDragOver:on.func,onDrop:on.func,onDropAccepted:on.func,onDropRejected:on.func,onError:on.func,validator:on.func};const cx={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Zk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:i,minSize:o,multiple:c,maxFiles:u,onDragEnter:f,onDragLeave:h,onDragOver:m,onDrop:g,onDropAccepted:v,onDropRejected:b,onFileDialogCancel:S,onFileDialogOpen:w,useFsAccessApi:C,autoFocus:E,preventDropOnDocument:_,noClick:T,noKeyboard:R,noDrag:D,noDragEventsBubbling:k,onError:M,validator:I}=pr(pr({},Kk),e),z=y.useMemo(()=>KZ(t),[t]),V=y.useMemo(()=>XZ(t),[t]),Y=y.useMemo(()=>typeof w=="function"?w:KT,[w]),W=y.useMemo(()=>typeof S=="function"?S:KT,[S]),J=y.useRef(null),G=y.useRef(null),[X,P]=y.useReducer(rJ,cx),{isFocused:L,isFileDialogActive:$}=X,H=y.useRef(typeof window<"u"&&window.isSecureContext&&C&&YZ()),O=()=>{!H.current&&$&&setTimeout(()=>{if(G.current){const{files:me}=G.current;me.length||(P({type:"closeDialog"}),W())}},300)};y.useEffect(()=>(window.addEventListener("focus",O,!1),()=>{window.removeEventListener("focus",O,!1)}),[G,$,W,H]);const U=y.useRef([]),K=me=>{J.current&&J.current.contains(me.target)||(me.preventDefault(),U.current=[])};y.useEffect(()=>(_&&(document.addEventListener("dragover",YT,!1),document.addEventListener("drop",K,!1)),()=>{_&&(document.removeEventListener("dragover",YT),document.removeEventListener("drop",K))}),[J,_]),y.useEffect(()=>(!n&&E&&J.current&&J.current.focus(),()=>{}),[J,E,n]);const ee=y.useCallback(me=>{M?M(me):console.error(me)},[M]),Se=y.useCallback(me=>{me.preventDefault(),me.persist(),Ee(me),U.current=[...U.current,me.target],uh(me)&&Promise.resolve(r(me)).then(ge=>{if(ap(me)&&!k)return;const Ne=ge.length,we=Ne>0&&qZ({files:ge,accept:z,minSize:o,maxSize:i,multiple:c,maxFiles:u,validator:I}),ze=Ne>0&&!we;P({isDragAccept:we,isDragReject:ze,isDragActive:!0,type:"setDraggedFiles"}),f&&f(me)}).catch(ge=>ee(ge))},[r,f,ee,k,z,o,i,c,u,I]),be=y.useCallback(me=>{me.preventDefault(),me.persist(),Ee(me);const ge=uh(me);if(ge&&me.dataTransfer)try{me.dataTransfer.dropEffect="copy"}catch{}return ge&&m&&m(me),!1},[m,k]),xe=y.useCallback(me=>{me.preventDefault(),me.persist(),Ee(me);const ge=U.current.filter(we=>J.current&&J.current.contains(we)),Ne=ge.indexOf(me.target);Ne!==-1&&ge.splice(Ne,1),U.current=ge,!(ge.length>0)&&(P({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(me)&&h&&h(me))},[J,h,k]),Ge=y.useCallback((me,ge)=>{const Ne=[],we=[];me.forEach(ze=>{const[yt,ft]=qk(ze,z),[Gt,kt]=Gk(ze,o,i),un=I?I(ze):null;if(yt&&Gt&&!un)Ne.push(ze);else{let jt=[ft,kt];un&&(jt=jt.concat(un)),we.push({file:ze,errors:jt.filter(Fi=>Fi)})}}),(!c&&Ne.length>1||c&&u>=1&&Ne.length>u)&&(Ne.forEach(ze=>{we.push({file:ze,errors:[HZ]})}),Ne.splice(0)),P({acceptedFiles:Ne,fileRejections:we,isDragReject:we.length>0,type:"setFiles"}),g&&g(Ne,we,ge),we.length>0&&b&&b(we,ge),Ne.length>0&&v&&v(Ne,ge)},[P,c,z,o,i,u,g,v,b,I]),Me=y.useCallback(me=>{me.preventDefault(),me.persist(),Ee(me),U.current=[],uh(me)&&Promise.resolve(r(me)).then(ge=>{ap(me)&&!k||Ge(ge,me)}).catch(ge=>ee(ge)),P({type:"reset"})},[r,Ge,ee,k]),tt=y.useCallback(()=>{if(H.current){P({type:"openDialog"}),Y();const me={multiple:c,types:V};window.showOpenFilePicker(me).then(ge=>r(ge)).then(ge=>{Ge(ge,null),P({type:"closeDialog"})}).catch(ge=>{ZZ(ge)?(W(ge),P({type:"closeDialog"})):JZ(ge)?(H.current=!1,G.current?(G.current.value=null,G.current.click()):ee(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."))):ee(ge)});return}G.current&&(P({type:"openDialog"}),Y(),G.current.value=null,G.current.click())},[P,Y,W,C,Ge,ee,V,c]),ke=y.useCallback(me=>{!J.current||!J.current.isEqualNode(me.target)||(me.key===" "||me.key==="Enter"||me.keyCode===32||me.keyCode===13)&&(me.preventDefault(),tt())},[J,tt]),vt=y.useCallback(()=>{P({type:"focus"})},[]),Lt=y.useCallback(()=>{P({type:"blur"})},[]),$t=y.useCallback(()=>{T||(QZ()?setTimeout(tt,0):tt())},[T,tt]),gt=me=>n?null:me,At=me=>R?null:gt(me),rn=me=>D?null:gt(me),Ee=me=>{k&&me.stopPropagation()},De=y.useMemo(()=>(me={})=>{var ge=me,{refKey:Ne="ref",role:we,onKeyDown:ze,onFocus:yt,onBlur:ft,onClick:Gt,onDragEnter:kt,onDragOver:un,onDragLeave:jt,onDrop:Fi}=ge,Si=sp(ge,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return pr(pr({onKeyDown:At(Ki(ze,ke)),onFocus:At(Ki(yt,vt)),onBlur:At(Ki(ft,Lt)),onClick:gt(Ki(Gt,$t)),onDragEnter:rn(Ki(kt,Se)),onDragOver:rn(Ki(un,be)),onDragLeave:rn(Ki(jt,xe)),onDrop:rn(Ki(Fi,Me)),role:typeof we=="string"&&we!==""?we:"presentation",[Ne]:J},!n&&!R?{tabIndex:0}:{}),Si)},[J,ke,vt,Lt,$t,Se,be,xe,Me,R,D,n]),We=y.useCallback(me=>{me.stopPropagation()},[]),Re=y.useMemo(()=>(me={})=>{var ge=me,{refKey:Ne="ref",onChange:we,onClick:ze}=ge,yt=sp(ge,["refKey","onChange","onClick"]);const ft={accept:z,multiple:c,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:gt(Ki(we,Me)),onClick:gt(Ki(ze,We)),tabIndex:-1,[Ne]:G};return pr(pr({},ft),yt)},[G,t,c,Me,n]);return Lo(pr({},X),{isFocused:L&&!n,getRootProps:De,getInputProps:Re,rootRef:J,inputRef:G,open:gt(tt)})}function rJ(e,t){switch(t.type){case"focus":return Lo(pr({},e),{isFocused:!0});case"blur":return Lo(pr({},e),{isFocused:!1});case"openDialog":return Lo(pr({},cx),{isFileDialogActive:!0});case"closeDialog":return Lo(pr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Lo(pr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Lo(pr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return pr({},cx);default:return e}}function KT(){}const[iJ,aJ]=vr("Dropzone component was not found in tree");function o1(e){const t=n=>{const{children:r,...i}=se(`Dropzone${Kj(e)}`,{},n),o=aJ(),c=qa(r)?r:s.jsx("span",{children:r});return o[e]?y.cloneElement(c,i):null};return t.displayName=`@mantine/dropzone/${Kj(e)}`,t}const oJ=o1("accept"),sJ=o1("reject"),lJ=o1("idle");var fd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const cJ={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},uJ=(e,{radius:t,variant:n,acceptColor:r,rejectColor:i})=>{const o=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:i||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Vt(t),"--dropzone-accept-color":o.color,"--dropzone-accept-bg":o.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},Jo=ve((e,t)=>{const n=se("Dropzone",cJ,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,radius:h,disabled:m,loading:g,multiple:v,maxSize:b,accept:S,children:w,onDropAny:C,onDrop:E,onReject:_,openRef:T,name:R,maxFiles:D,autoFocus:k,activateOnClick:M,activateOnDrag:I,dragEventsBubbling:z,activateOnKeyboard:V,onDragEnter:Y,onDragLeave:W,onDragOver:J,onFileDialogCancel:G,onFileDialogOpen:X,preventDropOnDocument:P,useFsAccessApi:L,getFilesFromEvent:$,validator:H,rejectColor:O,acceptColor:U,enablePointerEvents:K,loaderProps:ee,inputProps:Se,mod:be,...xe}=n,Ge=Ie({name:"Dropzone",classes:fd,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:uJ}),{getRootProps:Me,getInputProps:tt,isDragAccept:ke,isDragReject:vt,isDragActive:Lt,open:$t}=Zk({onDrop:C,onDropAccepted:E,onDropRejected:_,disabled:m||g,accept:Array.isArray(S)?S.reduce((Ee,De)=>({...Ee,[De]:[]}),{}):S,multiple:v,maxSize:b,maxFiles:D,autoFocus:k,noClick:!M,noDrag:!I,noDragEventsBubbling:!z,noKeyboard:!V,onDragEnter:Y,onDragLeave:W,onDragOver:J,onFileDialogCancel:G,onFileDialogOpen:X,preventDropOnDocument:P,useFsAccessApi:L,validator:H,...$?{getFilesFromEvent:$}:null});Ju(T,$t);const gt=Lt&&ke,At=Lt&&vt,rn=!gt&&!At;return s.jsx(iJ,{value:{accept:gt,reject:At,idle:rn},children:s.jsxs(ce,{...Me(),...Ge("root",{focusable:!0}),...xe,mod:[{accept:gt,reject:At,idle:rn,disabled:m,loading:g,"activate-on-click":M},be],children:[s.jsx(Dp,{visible:g,overlayProps:{radius:h},unstyled:u,loaderProps:ee}),s.jsx("input",{...tt(Se),name:R}),s.jsx("div",{...Ge("inner"),ref:t,"data-enable-pointer-events":K||void 0,children:w})]})})});Jo.classes=fd;Jo.displayName="@mantine/dropzone/Dropzone";Jo.Accept=oJ;Jo.Idle=lJ;Jo.Reject=sJ;const dJ={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Qr("max"),withinPortal:!0},s1=ve((e,t)=>{const n=se("DropzoneFullScreen",dJ,e),{classNames:r,className:i,style:o,styles:c,unstyled:u,vars:f,active:h,onDrop:m,onReject:g,zIndex:v,withinPortal:b,portalProps:S,...w}=n,C=Ie({name:"DropzoneFullScreen",classes:fd,props:n,className:i,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"fullScreen"}),{resolvedClassNames:E,resolvedStyles:_}=Xs({classNames:r,styles:c,props:n}),[T,R]=y.useState(0),[D,{open:k,close:M}]=up(!1),I=V=>{var Y;(Y=V.dataTransfer)!=null&&Y.types.includes("Files")&&(R(W=>W+1),k())},z=()=>{R(V=>V-1)};return y.useEffect(()=>{T===0&&M()},[T]),y.useEffect(()=>{if(h)return document.addEventListener("dragenter",I,!1),document.addEventListener("dragleave",z,!1),()=>{document.removeEventListener("dragenter",I,!1),document.removeEventListener("dragleave",z,!1)}},[h]),s.jsx(Wo,{...S,withinPortal:b,children:s.jsx(ce,{...C("fullScreen",{style:{opacity:D?1:0,pointerEvents:D?"all":"none",zIndex:v}}),ref:t,children:s.jsx(Jo,{...w,classNames:E,styles:_,unstyled:u,className:fd.dropzone,onDrop:V=>{m==null||m(V),M(),R(0)},onReject:V=>{g==null||g(V),M(),R(0)}})})})});s1.classes=fd;s1.displayName="@mantine/dropzone/DropzoneFullScreen";Jo.FullScreen=s1;const dh=Jo,fJ='{"resourceType": "Bundle"}';function my({id:e,title:t,message:n,color:r,icon:i,withCloseButton:o=!1,method:c="show",loading:u}){di[c]({id:e,loading:u,title:t,message:n,color:r,icon:i,withCloseButton:o,autoClose:!1})}function hJ(){const e=Sn(),t=Ae(),[n,r]=y.useState({}),i=y.useCallback(async(u,f)=>{const h="batch-upload";my({id:h,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(u);m.type!=="batch"&&m.type!=="transaction"&&(m=GD(m));const g=await t.executeBatch(m);r(v=>({...v,[f]:g})),my({id:h,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(to,{size:"1rem"}),withCloseButton:!0})}catch(m){my({id:h,title:"Batch Upload Failed",color:"red",message:Ye(m),method:"update",icon:s.jsx(qs,{size:"1rem"}),withCloseButton:!0})}},[t]),o=y.useCallback(async u=>{for(const f of u){const h=new FileReader;h.onload=m=>{var g;return i((g=m.target)==null?void 0:g.result,f.name)},h.readAsText(f)}},[i]),c=y.useCallback(async u=>{await i(u.input,"JSON Data")},[i]);return s.jsxs(ot,{children:[s.jsx(Le,{children:"Batch Create"}),s.jsxs(_e,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",s.jsx(Nt,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(Tt,{defaultValue:"upload",children:[s.jsxs(Tt.List,{children:[s.jsx(Tt.Tab,{value:"upload",children:"File Upload"}),s.jsx(Tt.Tab,{value:"json",children:"JSON"})]}),s.jsx(Tt.Panel,{value:"upload",pt:"xs",children:s.jsx(dh,{onDrop:o,accept:["application/json"],children:s.jsxs(je,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(dh.Accept,{children:s.jsx(FE,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(dh.Reject,{children:s.jsx(qs,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(dh.Idle,{children:s.jsx(FE,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(_e,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(_e,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(Tt.Panel,{value:"json",pt:"xs",children:s.jsxs(pt,{onSubmit:c,children:[s.jsx(Dc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:fJ,deserialize:JSON.parse}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(Tt,{defaultValue:Object.keys(n)[0],children:[s.jsx(Tt.List,{children:Object.keys(n).map(u=>s.jsx(Tt.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>s.jsx(Tt.Panel,{value:u,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{onClick:()=>r({}),children:"Start over"})})]})]})}function pJ(){const{resourceType:e}=qt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(i=>!!i),[r]=bc("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(ot,{children:[s.jsxs(Le,{children:["No apps for ",e]}),s.jsx(mt,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(ot,{children:s.jsx("div",{children:r.map(i=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(mt,{to:`/forms/${i.id}?subject=`+n.map(o=>`${e}/${o}`).join(","),children:i.name})}),s.jsx("p",{children:i.description})]},i.id))})}):s.jsx(gi,{})}function mJ(){const e=Ae(),[t,n]=y.useState(),[r,i]=y.useState(!1);return s.jsx(ot,{width:450,children:s.jsxs(pt,{onSubmit:o=>{n(void 0),e.post("auth/changepassword",o).then(()=>i(!0)).catch(c=>n(Zt(c)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Bi,{size:32}),s.jsx(Le,{children:"Change password"})]}),!r&&s.jsxs(qe,{gap:"xl",mt:"xl",children:[s.jsx(Ni,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Ot(t,"oldPassword")}),s.jsx(Ni,{name:"newPassword",label:"New password",required:!0,error:Ot(t,"newPassword")}),s.jsx(Ni,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ot(t,"confirmPassword")}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const ux=["Form","JSON","Profiles"],gJ=["Profiles"],gy=ux[0].toLowerCase();function vJ(){const e=wn(),t=Sn(),{resourceType:n}=qt(),[r,i]=y.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&ux.map(u=>u.toLowerCase()).includes(c)?c:gy});function o(c){var u;c||(c=gy),i(c),(u=e(`/${n}/new/${c}`))==null||u.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(lr,{children:[s.jsxs(_e,{p:"md",fw:500,children:["New ",n]}),s.jsx(Yr,{children:s.jsx(Tt,{defaultValue:gy,value:r,onChange:o,children:s.jsx(Tt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:ux.map(c=>s.jsx(Tt.Tab,{value:c.toLowerCase(),px:"md",children:gJ.includes(c)?s.jsxs(je,{gap:"xs",wrap:"nowrap",children:[c,s.jsx(_p,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),s.jsx(t1,{})]})}function yJ(){return s.jsx(ot,{children:s.jsxs(qe,{children:[s.jsx(Le,{order:1,children:"Unexpected Error"}),s.jsx(_e,{children:"We're sorry, something went wrong."}),s.jsxs(_e,{children:["Please contact ",s.jsx(Nt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function Jk(e){const t=Wt(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(mt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,u){c&&u&&n.push({key:c,value:u})}function i(c){c&&r(c.system,c.value)}function o(c,u){Array.isArray(u)?u.forEach(f=>o(c,f)):typeof u=="string"?r(c,u):u&&(Array.isArray(u.coding)?r(c,u.coding.map(f=>f.display||f.code).join(", ")):r(c,u.text))}if("name"in t){const c=Ha(t);c!==zt(t)&&r("Name",c)}return"category"in t&&o("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&o("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(i):i(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),s.jsx(ht,{children:n.map((c,u)=>s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:c.key}),s.jsx(ht.Value,{children:c.value})]},`${c.key}-${u}`))})}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 xJ(e){var t;if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return(t=e.specimen)==null?void 0:t[0]}function es(e){var t;return Vs((t=e.getActiveLogin())==null?void 0:t.project)}function bJ(){const{id:e}=qt(),t=Mr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,i=Ae(),[o,c]=y.useState(!0),[u,f]=y.useState(),[h,m]=y.useState(),[g,v]=y.useState(),[b,S]=y.useState(),[w,C]=y.useState();if(y.useEffect(()=>{const T={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const R=r.split(",").filter(D=>!!D);R.length===1&&T.entry.push({request:{method:"GET",url:R[0]}}),m(R)}i.executeBatch(T).then(R=>{var D,k,M,I,z,V,Y,W;((M=(k=(D=R.entry)==null?void 0:D[0])==null?void 0:k.response)==null?void 0:M.status)!=="200"?S((V=(z=(I=R.entry)==null?void 0:I[0])==null?void 0:z.response)==null?void 0:V.outcome):(f((Y=R.entry[0])==null?void 0:Y.resource),v((W=R.entry[1])==null?void 0:W.resource)),c(!1)}).catch(R=>{S(R),c(!1)})},[i,e,r]),b)return s.jsx(ot,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(w)return s.jsxs(ot,{children:[s.jsx(Le,{children:u==null?void 0:u.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[w.length===1&&s.jsx("li",{children:s.jsx(mt,{to:w[0],children:"Review your answers"})}),w.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:w.map(T=>s.jsx("li",{children:s.jsx(mt,{to:T,children:zt(T)})},T.id))})]}),g&&s.jsx("li",{children:s.jsxs(mt,{to:g,children:["Back to ",Ha(g)]})}),s.jsx("li",{children:s.jsx(mt,{to:"/",children:"Go back home"})})]})]});if(o||!u)return s.jsx(gi,{});const E=g&&l1(g);return s.jsxs(s.Fragment,{children:[s.jsxs(lr,{shadow:"xs",radius:0,children:[E&&s.jsx(ok,{patient:E}),g&&g.resourceType!=="Patient"&&s.jsx(Jk,{resource:g}),s.jsx(ce,{px:"xl",py:"md",children:s.jsxs(_e,{children:[Ha(u),h&&h.length>1&&s.jsxs(s.Fragment,{children:[" (for ",h.length," resources)"]})]})})]}),s.jsx(ot,{children:s.jsx(mk,{questionnaire:u,subject:g&&nn(g),onSubmit:_})})]});async function _(T){const R=[];if(!h||h.length===0)R.push(await i.createResource(T));else for(const D of h)R.push(await i.createResource({...T,subject:{reference:D}}));C(R)}}const SJ="_paper_unw9o_1",wJ={paper:SJ},jJ={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function eP(e,t){const n=e.resourceType||CJ(t),r=e.fields??EJ(n),i=e.filters??(e.resourceType?void 0:TJ(n)),o=e.sortRules??RJ(n),c=e.offset??0,u=e.count??Jp;return{...e,resourceType:n,fields:r,filters:i,sortRules:o,offset:c,count:u}}function CJ(e){var t,n;return localStorage.getItem("defaultResourceType")??((n=(t=e==null?void 0:e.option)==null?void 0:t.find(r=>r.id==="defaultResourceType"))==null?void 0:n.valueString)??"Patient"}function EJ(e){const t=c1(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AsyncJob":n.push("status","dataVersion");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function TJ(e){var t;return(t=c1(e))==null?void 0:t.filters}function RJ(e){const t=c1(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function c1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function _J(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function DJ(e,t){const n={...e,count:1e3,offset:0},r=eP(n,t.getUserConfiguration()),i=await t.search(r.resourceType,Bo({...r,total:"accurate",fields:void 0}));return GD(i)}function ZT(){const e=Ae(),t=wn(),n=Mr(),[r,i]=y.useState();return y.useEffect(()=>{var u;const o=BD(n.pathname+n.search),c=eP(o,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===Bo(c)?(_J(c),i(c)):(u=t(`/${c.resourceType}${Bo(c)}`))==null||u.catch(console.error)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(gi,{}):s.jsx(lr,{shadow:"xs",m:"md",p:"xs",className:wJ.paper,children:s.jsx(zc,{checkboxesEnabled:!0,search:r,onClick:o=>{var c;return(c=t(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onAuxClick:o=>window.open(`/${o.resource.resourceType}/${o.resource.id}`,"_blank"),onChange:o=>{var c;(c=t(`/${r.resourceType}${Bo(o.definition)}`))==null||c.catch(console.error)},onNew:()=>{var o;(o=t(jJ[r.resourceType]??`/${r.resourceType}/new`))==null||o.catch(console.error)},onExportCsv:()=>{const o=e.fhirUrl(r.resourceType,"$csv")+Bo(r);e.download(o).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Oe({color:"red",message:Ye(c),autoClose:!1}))},onExportTransactionBundle:async()=>{DJ(r,e).then(o=>wA(JSON.stringify(o,void 0,2))).catch(o=>Oe({color:"red",message:Ye(o),autoClose:!1}))},onDelete:o=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:o.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>i({...r})).catch(c=>Oe({color:"red",message:Ye(c),autoClose:!1})))},onBulk:o=>{var c;(c=t(`/bulk/${r.resourceType}?ids=${o.join(",")}`))==null||c.catch(console.error)}})})}function AJ(){const e=Ae(),[t,n]=y.useState(),[r,i]=y.useState(void 0),[o,c]=y.useState(!1),u=y.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),i(m.enrolled)}).catch(m=>Oe({color:"red",message:Ye(m),autoClose:!1}))},[e]);y.useEffect(()=>{u()},[u]);const f=y.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{i(!0),Oe({color:"green",message:"Success"})}).catch(g=>Oe({color:"red",message:Ye(g),autoClose:!1}))},[e]),h=y.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?s.jsxs(ot,{children:[s.jsx(Bn,{title:"Disable MFA",opened:o,onClose:()=>c(!1),children:s.jsx(NA,{onSubmit:async m=>{await h(m),c(!1),i(!1),Oe({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:s.jsx(PF,{})}),u()}})}),s.jsxs(je,{children:[s.jsx(Le,{children:"MFA is enabled"}),s.jsx(Pe,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):s.jsx(ot,{width:400,children:s.jsxs(pt,{onSubmit:f,children:[s.jsx(Le,{children:"Multi Factor Auth Setup"}),s.jsx(er,{children:s.jsx("img",{src:t,alt:"Multi Factor Auth QR Code"})}),s.jsx($e,{name:"token",label:"Code"}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Enroll"})})]})})}const vy={},dx={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:vy==null?void 0:vy.MEDPLUM_AWS_TEXTRACT_ENABLED};function Bd(){return dx}function tP(){return nP("registerEnabled")}function kJ(){return nP("awsTextractEnabled")}function nP(e){try{return dx[e]!==!1&&dx[e]!=="false"}catch{return!0}}function PJ(){var g,v;const e=wn(),[t]=i1(),n=Ae(),r=t.get("scope")||"openid",[i,o]=y.useState(),[c,u]=y.useState(!0),f=t.get("client_id"),h=t.get("login");if(y.useEffect(()=>{if(!f||f==="medplum-cli")return;async function b(){try{const S=await n.get(`/auth/clientinfo/${f}`);o(S)}catch(S){Oe({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ye(S),withCloseButton:!0})}finally{u(!1)}}b().catch(console.error)},[n,f]),!f)return null;function m(b){const S=new URL(t.get("redirect_uri"));for(const w of["scope","state","nonce"])t.has(w)&&S.searchParams.set(w,t.get(w));S.searchParams.set("code",b),window.location.assign(S.toString())}return s.jsx(OA,{onCode:m,onForgotPassword:()=>{var b;return(b=e("/resetpassword"))==null?void 0:b.catch(console.error)},onRegister:()=>{var b;return(b=e("/register"))==null?void 0:b.catch(console.error)},googleClientId:Bd().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:h||void 0,children:!c&&s.jsxs(s.Fragment,{children:[(g=i==null?void 0:i.logo)!=null&&g.url?s.jsx("img",{src:(v=i==null?void 0:i.logo)==null?void 0:v.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):s.jsx(Bi,{size:32}),s.jsx(Le,{children:(i==null?void 0:i.welcomeString)??"Sign in to Medplum"})]})})}function NJ(){const e=Ae(),t=wn(),n=Bd();return y.useEffect(()=>{var r;e.getProfile()&&((r=t("/signin?project=new"))==null||r.catch(console.error))},[e,t]),tP()?s.jsxs(pq,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(Bi,{size:32}),s.jsx(Le,{children:"Create a new account"})]}):s.jsx(ot,{width:450,children:s.jsx(Ka,{icon:s.jsx(il,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function OJ(){const e=wn(),t=Ae(),[n,r]=y.useState(),[i,o]=y.useState(!1),c=Bd().recaptchaSiteKey;return y.useEffect(()=>{kA(c)},[c]),s.jsx(ot,{width:450,children:s.jsxs(pt,{onSubmit:async u=>{let f="";f=await PA(c),t.post("auth/resetpassword",{...u,recaptchaToken:f}).then(()=>o(!0)).catch(h=>r(Zt(h)))},children:[s.jsxs(qe,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(Bi,{size:32}),s.jsx(Le,{children:"Medplum Password Reset"})]}),s.jsxs(qe,{gap:"xl",children:[s.jsx(Xr,{issues:Nd(n,void 0)}),!i&&s.jsxs(s.Fragment,{children:[s.jsx($e,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Ot(n,"email")}),s.jsxs(je,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Nt,{component:"button",type:"button",color:"dimmed",onClick:()=>{var u;return(u=e("/register"))==null?void 0:u.catch(console.error)},size:"xs",children:"Register"}),s.jsx(Pe,{type:"submit",children:"Reset password"})]})]}),i&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function MJ(){var o;const e=wn(),t=Ae(),[n,r]=y.useState();y.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(c=>Oe({color:"red",message:Ye(c),autoClose:!1}))},[t]);function i(c){t.post("auth/revoke",{loginId:c}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Oe({color:"green",message:"Login revoked"})).catch(u=>Oe({color:"red",message:Ye(u),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(ot,{children:[s.jsx(Le,{children:"Security"}),s.jsxs(kb,{children:[s.jsx(za,{term:"ID",children:s.jsx(Nt,{href:`/${zt(n.profile)}`,children:n.profile.id})}),s.jsx(za,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(za,{term:"Name",children:Oc((o=n.profile.name)==null?void 0:o[0])})]})]}),s.jsxs(ot,{children:[s.jsx(Le,{children:"Sessions"}),s.jsxs(ye,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:n.security.sessions.map(c=>s.jsxs("tr",{children:[s.jsx("td",{children:c.os}),s.jsx("td",{children:c.browser}),s.jsx("td",{children:c.remoteAddress}),s.jsx("td",{children:c.authMethod}),s.jsx("td",{children:gr(c.lastUpdated)}),s.jsx("td",{children:s.jsx(Nt,{href:"#",onClick:()=>i(c.id),children:"Revoke"})})]},c.id))})]})]}),s.jsxs(ot,{children:[s.jsx(Le,{children:"Password"}),s.jsx(Pe,{onClick:()=>{var c;return(c=e("/changepassword"))==null?void 0:c.catch(console.error)},children:"Change password"})]}),s.jsxs(ot,{children:[s.jsx(Le,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(Pe,{onClick:()=>{var c;return(c=e("/mfa"))==null?void 0:c.catch(console.error)},children:"Enroll"})]})]}):null}function IJ(){const{id:e,secret:t}=qt(),n=Ae(),[r,i]=y.useState(),[o,c]=y.useState(!1),u=Nd(r,void 0);return s.jsxs(ot,{width:450,children:[s.jsx(Xr,{issues:u}),s.jsxs(pt,{onSubmit:f=>{if(f.password!==f.confirmPassword){i(ia("Passwords do not match","confirmPassword"));return}i(void 0);const h={id:e,secret:t,password:f.password};n.post("auth/setpassword",h).then(()=>c(!0)).catch(m=>i(Zt(m)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Bi,{size:32}),s.jsx(Le,{children:"Set password"})]}),!o&&s.jsxs(qe,{children:[s.jsx(Ni,{name:"password",label:"New password",required:!0,error:Ot(r,"password")}),s.jsx(Ni,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ot(r,"confirmPassword")}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Set password"})})]}),o&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(mt,{to:"/signin",children:"sign in"}),"."]})]})]})}function LJ(){const e=im(),t=wn(),[n]=i1(),r=Bd(),i=y.useCallback(()=>{var c;const o=n.get("next");(c=t(o!=null&&o.startsWith("/")?o:"/"))==null||c.catch(console.error)},[n,t]);return y.useEffect(()=>{e&&n.has("next")&&i()},[e,n,i]),s.jsxs(OA,{onSuccess:()=>i(),onForgotPassword:()=>{var o;return(o=t("/resetpassword"))==null?void 0:o.catch(console.error)},onRegister:tP()?()=>{var o;return(o=t("/register"))==null?void 0:o.catch(console.error)}:void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(Bi,{size:32}),s.jsx(Le,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function $J(){const e=wn(),t=Mr(),[n,r]=y.useState(),[i,o]=y.useState(),[c,u]=y.useState();return y.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),o(f.query),u(JSON.parse(f.fields))},[t]),!n||!i||!c?null:s.jsx(fQ,{resourceType:n,checkboxesEnabled:!0,query:i,fields:c,onClick:f=>{var h;return(h=e(`/${n}/${f.resource.id}`))==null?void 0:h.catch(console.error)},onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{var h;(h=e(`/bulk/${n}?ids=${f.join(",")}`))==null||h.catch(console.error)}})}function vm(e){const t=Ae(),n=es(t),r=wn(),[i,o]=y.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ue.EQUALS,value:"Project/"+n},{code:"profile-type",operator:ue.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(zc,{search:i,onClick:c=>{var u;return(u=r(`/admin/members/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})}function zJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Bots"}),s.jsx(vm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(mt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function UJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Clients"}),s.jsx(vm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(mt,{to:"/admin/clients/new",children:"Create new client"})})]})}function ym(e){return s.jsx(al,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{pa(t)?e.onChange(nn(t)):e.onChange(void 0)}})}function BJ(){const e=Ae(),t=es(e),[n,r]=y.useState(""),[i,o]=y.useState(""),[c,u]=y.useState(),[f,h]=y.useState(),[m,g]=y.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Create new Bot"}),s.jsxs(pt,{onSubmit:()=>{const v={name:n,description:i,accessPolicy:c};e.post("admin/projects/"+t+"/bot",v).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),Oe({color:"green",message:"Bot created"})}).catch(b=>{Oe({color:"red",message:Ye(b),autoClose:!1}),h(Zt(b))})},children:[!m&&s.jsxs(qe,{children:[s.jsx(It,{title:"Name",htmlFor:"name",outcome:f,children:s.jsx($e,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:v=>r(v.currentTarget.value),error:Ot(f,"name")})}),s.jsx(It,{title:"Description",htmlFor:"description",outcome:f,children:s.jsx($e,{id:"description",name:"description",onChange:v=>o(v.currentTarget.value),error:Ot(f,"description")})}),s.jsx(It,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(ym,{name:"accessPolicy",onChange:u})}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Create Bot"})})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(_e,{children:"Bot created"}),s.jsxs(mr,{children:[s.jsx(mr.Item,{children:s.jsx(mt,{to:m,children:"Go to new bot"})}),s.jsx(mr.Item,{children:s.jsx(mt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function VJ(){const e=Ae(),t=es(e),[n,r]=y.useState(""),[i,o]=y.useState(""),[c,u]=y.useState(""),[f,h]=y.useState(),[m,g]=y.useState(),[v,b]=y.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Create new Client"}),s.jsxs(pt,{onSubmit:()=>{const S={name:n,description:i,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",S).then(w=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),b(w),Oe({color:"green",message:"Client created"})}).catch(w=>{Oe({color:"red",message:Ye(w),autoClose:!1}),g(Zt(w))})},children:[!v&&s.jsxs(qe,{children:[s.jsx(It,{title:"Name",htmlFor:"name",outcome:m,children:s.jsx($e,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:S=>r(S.currentTarget.value),error:Ot(m,"name")})}),s.jsx(It,{title:"Description",htmlFor:"description",outcome:m,children:s.jsx($e,{id:"description",name:"description",onChange:S=>o(S.currentTarget.value),error:Ot(m,"description")})}),s.jsx(It,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:s.jsx($e,{id:"redirectUri",name:"redirectUri",onChange:S=>u(S.currentTarget.value),error:Ot(m,"redirectUri")})}),s.jsx(It,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:s.jsx(ym,{name:"accessPolicy",onChange:h})}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Create Client"})})]}),v&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(_e,{children:"Client created"}),s.jsxs(mr,{children:[s.jsx(mr.Item,{children:s.jsx(mt,{to:v,children:"Go to new client"})}),s.jsx(mr.Item,{children:s.jsx(mt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function FJ(e){return s.jsx(al,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{pa(t)?e.onChange(nn(t)):e.onChange(void 0)}})}function HJ(){const{membershipId:e}=qt(),t=Ae(),n=es(t),r=wn(),i=t.get(`admin/projects/${n}/members/${e}`).read(),[o,c]=y.useState(i.accessPolicy),[u,f]=y.useState(i.userConfiguration),[h,m]=y.useState(i.admin),[g,v]=y.useState(),[b,S]=y.useState(!1);function w(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${n}/members/${e}`).then(()=>t.get(`admin/projects/${n}`,{cache:"no-cache"})).then(()=>r("/admin/project")).catch(C=>v(Zt(C)))}return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(sc,{value:i.profile,link:!0})}),s.jsxs(pt,{onSubmit:()=>{const C={...i,accessPolicy:o,userConfiguration:u,admin:h};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(E=>v(Zt(E)))},children:[!b&&s.jsxs(qe,{children:[s.jsx(It,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:s.jsx(ym,{name:"accessPolicy",defaultValue:o,onChange:c})}),s.jsx(It,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:s.jsx(FJ,{name:"userConfiguration",defaultValue:u,onChange:f})}),s.jsx(It,{title:"Admin",htmlFor:"admin",outcome:g,children:s.jsx(zn,{id:"admin",name:"admin",defaultChecked:h,onChange:C=>m(C.currentTarget.checked)})}),s.jsxs(je,{justify:"flex-end",mt:"xl",children:[s.jsx(Pe,{type:"submit",children:"Save"}),s.jsx(Pe,{type:"button",color:"red",variant:"outline",onClick:w,children:"Remove user"})]})]}),b&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(mt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function qJ(){const e=Ae(),[t,n]=y.useState(e.getProject()),[r,i]=y.useState(),[o,c]=y.useState(),[u,f]=y.useState(!1),[h,m]=y.useState(void 0),g=y.useCallback(v=>{const b={resourceType:v.resourceType,firstName:v.firstName,lastName:v.lastName,email:v.email,sendEmail:v.sendEmail==="on",accessPolicy:r,admin:v.isAdmin==="on",scope:v.isProjectScoped==="on"?"project":"server"};return e.invite(t==null?void 0:t.id,b).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Yp(S)?c(S):m(S),f(b.sendEmail??!1),Oe({color:"green",message:"Invite success"})}).catch(S=>{Oe({color:"red",message:Ye(S),autoClose:!1}),c(Zt(S))})},[e,t,r]);return s.jsxs(pt,{onSubmit:g,children:[!h&&!o&&s.jsxs(qe,{children:[s.jsx(Le,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(It,{title:"Project",htmlFor:"project",outcome:o,children:s.jsx(al,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(ln,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Ot(o,"resourceType")}),s.jsx($e,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Ot(o,"firstName")}),s.jsx($e,{name:"lastName",label:"Last Name",required:!0,error:Ot(o,"lastName")}),s.jsx($e,{name:"email",type:"email",label:"Email",required:!0,error:Ot(o,"email")}),s.jsx(It,{title:"Access Policy",htmlFor:"accessPolicy",outcome:o,children:s.jsx(ym,{name:"accessPolicy",onChange:i})}),s.jsx(zn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(zn,{name:"isAdmin",label:"Admin"}),s.jsx(zn,{name:"isProjectScoped",label:"Project scoped"}),s.jsx(je,{justify:"flex-end",children:s.jsx(xr,{children:"Invite"})})]}),o&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx(mt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(_e,{children:"User created"}),u&&s.jsx(_e,{children:"Email sent"}),s.jsxs(mr,{children:[s.jsx(mr.Item,{children:s.jsx(mt,{to:h,children:"Go to new membership"})}),s.jsx(mr.Item,{children:s.jsx(mt,{to:h.profile,children:"Go to new profile"})}),s.jsx(mr.Item,{children:s.jsx(mt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function GJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Patients"}),s.jsx(vm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(mt,{to:"/admin/invite",children:"Invite new patient"})})]})}function WJ(){const e=Ae();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(Xr,{outcome:J0});function t(n){e.post("admin/projects/setpassword",n).then(()=>Oe({color:"green",message:"Done"})).catch(r=>Oe({color:"red",message:Ye(r),autoClose:!1}))}return s.jsxs(ot,{width:600,children:[s.jsx(Le,{order:1,children:"Project Admin"}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Force Set Password"}),s.jsx(_e,{children:"Sets the password for the specified user in this project."}),s.jsx(_e,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),s.jsx(pt,{onSubmit:t,children:s.jsxs(qe,{children:[s.jsx($e,{name:"email",label:"Email",required:!0}),s.jsx(Ni,{name:"password",label:"Password",required:!0}),s.jsx(Pe,{type:"submit",children:"Force Set Password"})]})})]})}function JT(){const e=Ae(),t=es(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Details"}),s.jsxs(kb,{children:[s.jsx(za,{term:"ID",children:n.project.id}),s.jsx(za,{term:"Name",children:n.project.name})]})]})}const eR=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function QJ(){const e=wn(),n=Mr().pathname.replace("/admin/","")||eR[0],r=Ae(),i=es(r),o=y.useMemo(()=>r.get("admin/projects/"+i).read(),[r,i]);function c(u){var f;(f=e(`/admin/${u}`))==null||f.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(lr,{children:[s.jsx(ht,{children:s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Project"}),s.jsx(ht.Value,{children:o.project.name})]})}),s.jsx(Yr,{children:s.jsx(Tt,{value:n.toLowerCase(),onChange:c,children:s.jsx(Tt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:eR.map(u=>s.jsx(Tt.Tab,{value:u.toLowerCase(),children:u},u))})})})]}),s.jsx(ot,{children:s.jsx(t1,{})})]})}function YJ(){const e=Ae(),t=es(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=y.useState(!1),[o,c]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&c(Wr(n.project.secret||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Oe({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(Le,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(Md,{property:Xo("Project","secret"),name:"secret",path:"Project.secret",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Pe,{type:"submit",children:"Save"})]})}function XJ(){const e=Ae(),t=es(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=y.useState(!1),[o,c]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&c(Wr(n.project.site||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Oe({color:"green",message:"Saved"})).catch(f=>{var m,g,v,b;const h=Zt(f);Oe({color:"red",message:`Error ${(g=(m=h.issue)==null?void 0:m[0].details)==null?void 0:g.text} ${(b=(v=h.issue)==null?void 0:v[0].expression)==null?void 0:b[0]}`,autoClose:!1})})},children:[s.jsx(Le,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(Md,{property:Xo("Project","site"),name:"site",path:"Project.site",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Pe,{type:"submit",children:"Save"})]})}function rP(e,t,n,r){const i=Date.now().toString();Oe({id:i,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST",pollStatusOnAccepted:!0};return r&&(o.body=JSON.stringify(r)),e.startAsyncRequest(n,o).then(c=>{var f,h,m;let u="Done";return c.resourceType==="AsyncJob"?u=s.jsx(mt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&((m=(h=(f=c.issue)==null?void 0:f[0])==null?void 0:h.details)!=null&&m.text)&&(u=s.jsx(_e,{children:c.issue[0].details.text})),di.update({id:i,color:"green",title:t,message:u,icon:s.jsx(to,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw di.update({id:i,color:"red",title:t,message:Ye(c),icon:s.jsx(qs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function ws(e,t,n,r){rP(e,t,n,r).catch(()=>{})}const iP="System AsyncJob",aP="Post-deploy Migrations",fh=[aP,iP];function KJ(){const e=Ae(),[t,n]=y.useState(fh[0]);function r(i){i||(i=fh[0]),fh.includes(i)&&n(i)}return!e.isLoading()&&!e.isSuperAdmin()?s.jsx(Xr,{outcome:J0}):s.jsx(Lc,{miw:"1600",maw:"2000",children:s.jsxs(sm,{children:[s.jsx(Le,{order:1,children:"AsyncJob Dashboard"}),s.jsxs(Tt,{keepMounted:!1,value:t,onChange:r,children:[s.jsx(Tt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:fh.map(i=>s.jsx(Tt.Tab,{value:i,children:i},i))}),s.jsx(Tt.Panel,{value:iP,pt:"md",children:s.jsx(JJ,{})}),s.jsx(Tt.Panel,{value:aP,pt:"md",children:s.jsx(tee,{})})]})]})})}const ZJ={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function JJ(){const e=wn(),[t]=y.useState(ZJ);return s.jsxs(qe,{children:[s.jsx(mt,{to:`/${t.resourceType}/${Bo(t)}`,children:"Show in search page"}),s.jsx(zc,{checkboxesEnabled:!1,search:t,onClick:n=>{var r;return(r=e(tR(n.resource)))==null?void 0:r.catch(console.error)},onAuxClick:n=>window.open(tR(n.resource),"_blank")})]})}const eee={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"},{code:"type",operator:ue.EQUALS,value:"data-migration"}],count:1e3,sortRules:[{code:"_lastUpdated",descending:!0}]};function tee(){const e=Ae(),[t,n]=y.useState(),[r,i]=y.useState(),[o,c]=y.useState([]),[u,f]=y.useState(0),[h,m]=y.useState([]);y.useEffect(()=>{const w="info";m(C=>C.includes(w)?C:[...C,w]),e.get("admin/super/migrations",{cache:"no-cache"}).then(C=>{C.postDeployMigrations.sort((E,_)=>_-E),n(C)}).catch(C=>{Oe({color:"red",message:Ye(C),autoClose:!1})}).finally(()=>m(C=>C.filter(E=>E!==w)))},[e,u]),y.useEffect(()=>{const w="jobs";m(C=>C.includes(w)?C:[...C,w]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",Bo({...eee,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{var E;i((E=C.entry)==null?void 0:E.map(_=>_.resource))})).catch(C=>{i(void 0),Oe({color:"red",message:Ye(C),autoClose:!1})}).finally(()=>m(C=>C.filter(E=>E!==w)))},[e,u]);function g(){f(w=>w+1)}function v(w){rP(e,"Run Pending Data Migration","admin/super/migrate",{dataVersion:w}).finally(()=>{g()}).catch(()=>{}),g()}const b=h.length>0;function S(w,{isLoading:C}){return s.jsxs("div",{style:{position:"relative"},children:[s.jsx(Dp,{visible:C}),s.jsxs(ye,{children:[s.jsx(ye.Thead,{children:s.jsxs(ye.Tr,{children:[s.jsx(ye.Th,{children:"Version"}),s.jsx(ye.Th,{children:"Action"}),s.jsx(ye.Th,{children:"Status"}),s.jsx(ye.Th,{children:"AsyncJob"}),s.jsx(ye.Th,{children:"Last Updated"}),s.jsx(ye.Th,{children:"Request Time"}),s.jsx(ye.Th,{children:"Duration"}),s.jsx(ye.Th,{children:"Attempts"})]})}),s.jsx(ye.Tbody,{children:w()})]})]})}return s.jsxs(s.Fragment,{children:[s.jsx(Pe,{size:"xs",mb:"xs",variant:"subtle",leftSection:s.jsx(yA,{size:14}),onClick:g,loading:b,children:"Refresh"}),S(()=>{var w;if(!b){if(!t)return s.jsx(ye.Tr,{children:s.jsx(ye.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return s.jsx(ye.Tr,{children:s.jsx(ye.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:(w=t.postDeployMigrations)==null?void 0:w.map(C=>{var M;const{status:E,asyncJob:_,asyncJobs:T}=nee(C,r??[],t==null?void 0:t.pendingPostDeployMigration),R=o.includes(C),D=C===(t==null?void 0:t.pendingPostDeployMigration)&&(!_||(_==null?void 0:_.status)==="error"),k=[s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:C}),s.jsx(ye.Td,{children:D&&s.jsx(Pe,{color:"green",size:"xs",onClick:()=>v(C),children:"Start"})}),s.jsx(ye.Td,{children:E}),s.jsx(ye.Td,{children:_&&s.jsx(mt,{to:`/AsyncJob/${_==null?void 0:_.id}`,children:_==null?void 0:_.id})}),s.jsx(ye.Td,{children:(M=_==null?void 0:_.meta)==null?void 0:M.lastUpdated}),s.jsx(ye.Td,{children:_==null?void 0:_.requestTime}),s.jsx(ye.Td,{children:nR(_)}),s.jsx(ye.Td,{display:"flex",children:s.jsxs(je,{gap:"xs",children:[T.length?T.length:"",R&&T.length>1&&s.jsx(Pe,{leftSection:s.jsx(GF,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(C)?I.filter(z=>z!==C):I),children:"Hide all"}),!R&&T.length>1&&s.jsx(Pe,{leftSection:s.jsx(vA,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(I=>I.includes(C)?I:[...I,C]),children:"Show all"})]})})]},C)];return R&&k.push(...T.filter(I=>I.id!==(_==null?void 0:_.id)).map(I=>{var z;return s.jsxs(ye.Tr,{bg:"gray.1",children:[s.jsx(ye.Td,{children:C}),s.jsx(ye.Td,{}),s.jsx(ye.Td,{children:I.status}),s.jsx(ye.Td,{children:s.jsx(mt,{to:`/AsyncJob/${I.id}`,children:I.id})}),s.jsx(ye.Td,{children:(z=I.meta)==null?void 0:z.lastUpdated}),s.jsx(ye.Td,{children:I.requestTime}),s.jsx(ye.Td,{children:nR(I)}),s.jsx(ye.Td,{})]},I.id)})),k})},{isLoading:b})]})}function nee(e,t,n){const r=t.filter(c=>c.dataVersion===e),i=r.find(c=>c.status==="completed")??r[0];let o;return n===0?o=(i==null?void 0:i.status)??"completed":e>n?o=(i==null?void 0:i.status)??"pending":e===n?o=(i==null?void 0:i.status)??"next":o=(i==null?void 0:i.status)??"completed",{status:o,asyncJob:i,asyncJobs:r}}function tR(e){return`/${e.resourceType}/${e.id}`}function nR(e){var u;const t=e==null?void 0:e.requestTime,n=(e==null?void 0:e.transactionTime)??((u=e==null?void 0:e.meta)==null?void 0:u.lastUpdated);if(!t||!n)return"";const r=new Date(t),o=new Date(n).getTime()-r.getTime();if(o<1e3)return`${o.toFixed(0)}ms`;const c=o/1e3;return c<60?`${c.toFixed(2)}s`:c<3600?`${(c/60).toFixed(2)}m`:`${(c/3600).toFixed(2)}h`}function ree(){const e=Ae(),[t,{open:n,close:r}]=up(!1),[i,o]=y.useState(""),[c,u]=y.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(Xr,{outcome:J0});function f(){ws(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function h(){ws(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){ws(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(D){ws(e,"Reindexing Resources","admin/super/reindex",D)}function v(){ws(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){ws(e,"Run Pending Data Migration","admin/super/migrate")}function S(D){e.post("admin/super/removebotidjobsfromqueue",D).then(()=>Oe({color:"green",message:"Done"})).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))}function w(D){e.post("admin/super/purge",{...D,before:Ob(D.before)}).then(()=>Oe({color:"green",message:"Done"})).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))}function C(D){e.post("admin/super/setpassword",D).then(()=>Oe({color:"green",message:"Done"})).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))}function E(D){e.post("fhir/R4/$db-stats",D.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:D.tableNames}]}:void 0).then(k=>{var M,I;o("Database Stats"),u(s.jsx("pre",{children:(I=(M=k.parameter)==null?void 0:M.find(z=>z.name==="tableString"))==null?void 0:I.valueString})),n()}).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))}function _(){e.post("fhir/R4/$db-invalid-indexes").then(D=>{var k;o("Database Invalid Indexes"),u(s.jsx("pre",{children:(k=D.parameter)==null?void 0:k.filter(M=>M.name==="invalidIndex").map(M=>M.valueString).join(`
578
- `)})),n()}).catch(D=>Oe({color:"red",message:Ye(D),autoClose:!1}))}function T(){e.post("fhir/R4/$db-schema-diff").then(D=>{var k,M;o("Schema Diff"),u(s.jsx("pre",{children:(M=(k=D.parameter)==null?void 0:k.find(I=>I.name==="migrationString"))==null?void 0:M.valueString})),n()}).catch(D=>Oe({color:"red",message:Ye(D),autoClose:!1}))}function R(){ws(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return s.jsxs(ot,{width:600,children:[s.jsx(Le,{order:1,children:"Super Admin"}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Structure Definitions"}),s.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),s.jsx(pt,{children:s.jsx(Pe,{onClick:f,children:"Rebuild StructureDefinitions"})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Search Parameters"}),s.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),s.jsx(pt,{children:s.jsx(Pe,{onClick:h,children:"Rebuild SearchParameters"})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Value Sets"}),s.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),s.jsx(pt,{children:s.jsx(Pe,{onClick:m,children:"Rebuild ValueSets"})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Run Pending Data Migration"}),s.jsx("p",{children:"When a Medplum version releases with data migrations to apply, you can run them here. Press this button to kick off the background data migration process."}),s.jsx(pt,{onSubmit:b,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Start Migration"})})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Reindex Resources"}),s.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),s.jsx(pt,{onSubmit:g,children:s.jsxs(qe,{children:[s.jsx(It,{title:"Resource Type",htmlFor:"resourceType",children:s.jsx($e,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(It,{title:"Search Filter",htmlFor:"filter",children:s.jsx($e,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),s.jsx(It,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:s.jsx(iee,{})}),s.jsx(Pe,{type:"submit",children:"Reindex"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Purge Resources"}),s.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),s.jsx(pt,{onSubmit:w,children:s.jsxs(qe,{children:[s.jsx(It,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(ln,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(It,{title:"Purge Before",htmlFor:"before",children:s.jsx(oa,{name:"before",placeholder:"Before Date"})}),s.jsx(Pe,{type:"submit",children:"Purge"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(pt,{onSubmit:S,children:s.jsxs(qe,{children:[s.jsx(It,{title:"Bot ID",children:s.jsx($e,{name:"botId",placeholder:"Bot Id"})}),s.jsx(Pe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Force Set Password"}),s.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),s.jsx(pt,{onSubmit:C,children:s.jsxs(qe,{children:[s.jsx($e,{name:"email",label:"Email",required:!0}),s.jsx(Ni,{name:"password",label:"Password",required:!0}),s.jsx($e,{name:"projectId",label:"Project ID"}),s.jsx(Pe,{type:"submit",children:"Force Set Password"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(pt,{onSubmit:E,children:s.jsxs(qe,{children:[s.jsx(It,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:s.jsx($e,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),s.jsx(Pe,{type:"submit",children:"Get Database Stats"})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Database Invalid Indexes"}),s.jsx("p",{children:"Query invalid indexes from the database."}),s.jsx(pt,{onSubmit:_,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Get Database Invalid Indexes"})})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Database Schema Drift"}),s.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),s.jsxs(or,{children:[s.jsx(or.Col,{span:6,children:s.jsx(pt,{onSubmit:T,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Get Schema Drift"})})})}),s.jsx(or.Col,{span:6,children:s.jsx(pt,{onSubmit:R,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Reload Cron Resources"}),s.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),s.jsx(pt,{onSubmit:v,children:s.jsx(qe,{children:s.jsx(Pe,{type:"submit",children:"Reload Cron Resources"})})}),s.jsx(Bn,{opened:t,onClose:r,title:i,centered:!0,size:"auto",children:c})]})}function iee(){const[e,t]=y.useState("outdated");return s.jsxs(s.Fragment,{children:[s.jsx(ln,{id:"reindexType",name:"reindexType",value:e,onChange:n=>t(n.target.value),data:[{label:"Outdated resources",value:"outdated"},{label:"All resources",value:"all"},{label:"Less than or equal to a specific version",value:"specific"}]}),e==="specific"&&s.jsx(Up,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function aee(){return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Users"}),s.jsx(vm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(mt,{to:"/admin/invite",children:"Invite new user"})})]})}function oee(){const[e]=bc("ObservationDefinition","_count=100");return e?s.jsxs(ye,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var n,r,i,o;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(aa,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(aa,{value:t.code})}),s.jsx("td",{children:s.jsx(aa,{value:t.method})}),s.jsx("td",{children:(i=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:i.text}),s.jsx("td",{children:(o=t.quantitativeDetails)==null?void 0:o.decimalPrecision}),s.jsx("td",{children:s.jsx(fx,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(gi,{})}function fx(e){const{ranges:t}=e;if(!t)return null;const n=rR(t.map(i=>i.gender));if(n.length>1)return od(n),s.jsx(s.Fragment,{children:n.map(i=>{var o;return s.jsxs(y.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:In(i)})}),s.jsx(fx,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>c.gender===i)})]},i)})});const r=rR(t.map(i=>i.age&&sd(i.age)));return r.length>1?(od(r),s.jsx(s.Fragment,{children:r.map(i=>{var o;return s.jsxs(y.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:In(i)})}),s.jsx(fx,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>sd(c.age)===i)})]},i)})})):s.jsx(s.Fragment,{children:t.map(i=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:i.condition}),s.jsx("td",{children:s.jsx(Nb,{value:i.range})})]})})},`range-${i.condition}`))})}function rR(e){return[...new Set(e.filter(t=>!!t))]}function see(){const[e]=bc("ActivityDefinition","_count=100"),[t]=bc("ObservationDefinition","_count=100");return!e||!t?s.jsx(gi,{}):s.jsxs(ye,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(n=>s.jsx("th",{children:n.name},n.id))]})}),s.jsx("tbody",{children:t.map(n=>{var r;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(aa,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(aa,{value:n.code})}),e.map(i=>{var o;return s.jsx("td",{children:(o=i.observationResultRequirement)!=null&&o.find(c=>{var u;return(u=c.reference)==null?void 0:u.includes(n.id)})?"✅":""},i.id)})]},n.id)})})]})}function lee(e){var c;const t=Ae(),[n,r]=y.useState(),[i,o]=y.useState();return i?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx(mt,{to:i,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(mt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(pt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(o).catch(console.log)},children:s.jsxs(qe,{children:[s.jsxs(Le,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(_e,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(_e,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(c=e.planDefinition.action)==null?void 0:c.map((u,f)=>{var h;return s.jsxs("li",{children:[((h=u.definitionCanonical)==null?void 0:h.startsWith("Questionnaire/"))&&"Questionnaire request: ",u.title&&s.jsx(s.Fragment,{children:u.title}),u.code&&s.jsx(aa,{value:u.code[0]})]},`action-${f}`)})}),s.jsx(It,{title:"Subject",children:s.jsx(Od,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Go"})})]})})}function cee(){const{resourceType:e,id:t}=qt(),n=Wt({reference:e+"/"+t});return n?s.jsx(ot,{children:s.jsx(lee,{planDefinition:n})}):null}function uee(){const{resourceType:e,id:t}=qt(),n=Wt({reference:e+"/"+t}),[r,i]=bc("Questionnaire","subject-type="+e),[o,c]=bc("ClientApplication",{_count:1e3});if(!n||i||c)return s.jsx(gi,{});const u=o==null?void 0:o.filter(m=>dee(e)&&!!m.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return s.jsxs(ot,{children:[s.jsx(Le,{children:"Apps"}),s.jsxs("p",{children:["No apps found. Contact your administrator or ",s.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,h;return n.resourceType==="Patient"?f=nn(n):n.resourceType==="Encounter"&&(f=n.subject,h=nn(n)),s.jsxs(ot,{children:[r==null?void 0:r.map(m=>s.jsxs("div",{children:[s.jsx(Le,{order:3,children:s.jsx(mt,{to:`/forms/${m.id}?subject=${zt(n)}`,children:m.title||m.name})}),s.jsx(_e,{children:m.description})]},m.id)),u==null?void 0:u.map(m=>s.jsxs("div",{children:[s.jsx(Le,{order:3,children:s.jsx(aX,{client:m,patient:f,encounter:h,children:m.name})}),s.jsx(_e,{children:m.description})]},m.id))]})}function dee(e){return e==="Patient"||e==="Encounter"}function fee(){const{resourceType:e,id:t}=qt(),n=wn(),[r,i]=y.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ue.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(ot,{children:s.jsx(zc,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>i(o.definition),hideFilters:!0})})}function hee(){const e=Ae(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return s.jsx(ot,{children:s.jsx(QY,{history:r})})}const pee="_hl7Input_k5xm3_1",mee={hl7Input:pee};function gee(e){return s.jsx("iframe",{title:"Bot Runner",frameBorder:"0",src:"https://codeeditor.medplum.com/bot-runner.html",className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function vee(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),s.jsx("iframe",{title:"Code Editor",frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Xu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const yee=`{
579
- "resourceType": "Patient",
580
- "name": [
581
- {
582
- "given": [
583
- "Alice"
584
- ],
585
- "family": "Smith"
586
- }
587
- ]
588
- }`,xee="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 bee(){const e=Ae(),{id:t}=qt(),[n,r]=y.useState(),[i,o]=y.useState(),[c,u]=y.useState(yee),[f,h]=y.useState(xee),[m,g]=y.useState(hn.FHIR_JSON),v=y.useRef(null),b=y.useRef(null),[S,w]=y.useState(!1);y.useEffect(()=>{e.readResource("Bot",t).then(async k=>{r(k),o(await See(e,k))}).catch(k=>Oe({color:"red",message:Ye(k),autoClose:!1}))},[e,t]);const C=y.useCallback(async()=>Xu(v.current,{command:"getValue"}),[]),E=y.useCallback(async()=>Xu(v.current,{command:"getOutput"}),[]),_=y.useCallback(async()=>m===hn.FHIR_JSON?JSON.parse(c):f,[m,c,f]),T=y.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),w(!0);try{const M=await C(),I=await E(),z=await e.createAttachment({data:M,filename:"index.ts",contentType:"text/typescript"}),V=await e.createAttachment({data:I,filename:"index.js",contentType:"text/typescript"}),Y=[{op:"add",path:"/sourceCode",value:z},{op:"add",path:"/executableCode",value:V}];await e.patchResource("Bot",t,Y),Oe({color:"green",message:"Saved"})}catch(M){Oe({color:"red",message:Ye(M),autoClose:!1})}finally{w(!1)}},[e,t,C,E]),R=y.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),w(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Oe({color:"green",message:"Deployed"})}catch(M){Oe({color:"red",message:Ye(M),autoClose:!1})}finally{w(!1)}},[e,t]),D=y.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),w(!0);try{const M=await _(),I=await e.post(e.fhirUrl("Bot",t,"$execute"),M,m);await Xu(b.current,{command:"setValue",value:I}),Oe({color:"green",message:"Success"})}catch(M){Oe({color:"red",message:Ye(M),autoClose:!1})}finally{w(!1)}},[e,t,_,m]);return!n||i===void 0?null:s.jsxs(or,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(or.Col,{span:8,children:s.jsxs(lr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(vee,{iframeRef:v,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:i,minHeight:"528px"}),s.jsxs(je,{justify:"flex-end",gap:"xs",children:[s.jsx(Pe,{type:"button",onClick:T,loading:S,leftSection:s.jsx(MF,{size:"1rem"}),children:"Save"}),s.jsx(Pe,{type:"button",onClick:R,loading:S,leftSection:s.jsx(Cb,{size:"1rem"}),children:"Deploy"}),s.jsx(Pe,{type:"button",onClick:D,loading:S,leftSection:s.jsx(XF,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(or.Col,{span:4,children:[s.jsxs(lr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(ln,{data:[{label:"FHIR",value:hn.FHIR_JSON},{label:"HL7",value:hn.HL7_V2}],onChange:k=>g(k.currentTarget.value)}),m===hn.FHIR_JSON?s.jsx(Dc,{value:c,onChange:k=>u(k),autosize:!0,minRows:15}):s.jsx("textarea",{className:mee.hl7Input,value:f,onChange:k=>h(k.currentTarget.value),rows:15})]}),s.jsx(lr,{m:2,p:"xs",shadow:"md",children:s.jsx(gee,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function See(e,t){var n,r,i;if((n=t.sourceCode)!=null&&n.url){const o=(i=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:i.find(RD);return(await e.download(e.fhirUrl("Binary",o))).text()}return t.code??""}function ll(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function wee(){const e=Ae(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},i=y.useCallback(o=>{e.updateResource(ll(o)).then(()=>{Oe({color:"green",message:"Success"})}).catch(c=>{Oe({color:"red",message:Ye(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(ot,{children:s.jsx(AQ,{value:r,onSubmit:i})});case"Questionnaire":return s.jsx(ot,{children:s.jsx(iY,{questionnaire:r,onSubmit:i})});default:return null}}function jee(){const{resourceType:e,id:t}=qt(),n=Wt({reference:e+"/"+t}),r=wn();return n?s.jsx(ot,{children:s.jsx(AY,{value:n,onStart:(i,o)=>{var c;return(c=r(`/forms/${Vs(o)}`))==null?void 0:c.catch(console.error)},onEdit:(i,o,c)=>{var u;return(u=r(`/${c.reference}}`))==null?void 0:u.catch(console.error)}})}):null}function Cee(){const e=Ae(),{resourceType:t,id:n}=qt(),r=wn();return s.jsxs(ot,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(Pe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>{var i;return(i=r(`/${t}`))==null?void 0:i.catch(console.error)}).catch(i=>Oe({color:"red",message:Ye(i),autoClose:!1}))},children:"Delete"})]})}const Eee="_selectProfileBtn_tbaz6_1",Tee="_chevron_tbaz6_13",iR={selectProfileBtn:Eee,chevron:Tee};function Ree(){var f,h;const{resourceType:e,id:t}=qt(),n=Wt({reference:e+"/"+t}),[r,i]=y.useState(),o=xd({onDropdownClose:()=>o.resetSelectedOption()}),c=y.useMemo(()=>{var m;if(Tn((m=n==null?void 0:n.meta)==null?void 0:m.profile))return[s.jsx(ct.Option,{value:"",children:"None"},""),...n.meta.profile.map(g=>s.jsx(ct.Option,{value:g,children:g},g))]},[(f=n==null?void 0:n.meta)==null?void 0:f.profile]);if(y.useEffect(()=>{var m,g;((g=(m=n==null?void 0:n.meta)==null?void 0:m.profile)==null?void 0:g.length)===1&&i(n.meta.profile[0])},[(h=n==null?void 0:n.meta)==null?void 0:h.profile]),!n)return null;let u;return Tn(c)&&(u=s.jsx(je,{justify:"flex-end",children:s.jsxs(qe,{align:"flex-end",gap:"xs",children:[s.jsxs(ct,{store:o,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:m=>{i(m),o.closeDropdown()},children:[s.jsx(ct.Target,{children:s.jsx(tr,{onClick:()=>o.toggleDropdown(),children:s.jsxs(v0,{fw:"bold",fs:"sm",className:iR.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(jb,{stroke:1.5,className:iR.chevron})]})})}),s.jsx(ct.Dropdown,{w:"max-content",children:s.jsx(ct.Options,{children:c})})]}),s.jsx(ce,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(_e,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(_e,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(_e,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(ot,{children:s.jsxs(qe,{gap:"xl",children:[u,s.jsx(Ub,{value:n,profileUrl:r})]})})}function _ee(){const e=Ae(),{resourceType:t,id:n}=qt(),[r,i]=y.useState(),[o,c]=y.useState(),u=wn(),[f,h]=y.useState();y.useEffect(()=>{e.readResource(t,n).then(b=>{i(Wr(b)),c(Wr(b))}).catch(b=>{h(Zt(b)),Oe({color:"red",message:Ye(b),autoClose:!1})})},[e,t,n]);const m=y.useCallback(b=>{h(void 0),e.updateResource(ll(b)).then(()=>{var S;(S=u(`/${t}/${n}/details`))==null||S.catch(console.error),Oe({id:"succes",color:"green",message:"Success"})}).catch(S=>{h(Zt(S)),Oe({color:"red",message:Ye(S),autoClose:!1})})},[e,t,n,u]),g=y.useCallback(b=>{h(void 0);const S=KA.createPatch(r,b);e.patchResource(t,n,S).then(()=>{var w;(w=u(`/${t}/${n}/details`))==null||w.catch(console.error),Oe({id:"succes",color:"green",message:"Success"})}).catch(w=>{h(Zt(w)),Oe({color:"red",message:Ye(w),autoClose:!1})})},[e,t,n,r,u]),v=y.useCallback(()=>{var b;return(b=u(`/${t}/${n}/delete`))==null?void 0:b.catch(console.error)},[u,t,n]);return o?s.jsx(ot,{children:s.jsx(Jh,{defaultValue:o,onSubmit:m,onPatch:g,onDelete:v,outcome:f})}):null}function Dee(){const{resourceType:e,id:t}=qt(),n=Wt({reference:e+"/"+t});return n?s.jsx(ot,{maw:700,children:n.resourceType==="Patient"?s.jsx(CQ,{patient:n}):s.jsx(Ka,{icon:s.jsx(il,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function oP({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,i=Ae(),[o,c]=y.useState();return y.useEffect(()=>{i.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(u=>{c(u.filter(qq))}).catch(console.error)},[i,n,r]),s.jsx(Tt,{value:t==null?void 0:t.url,onChange:u=>{const f=o==null?void 0:o.find(h=>h.url===u);f&&n(f)},children:s.jsx(Tt.List,{children:o==null?void 0:o.map(u=>{var m,g;const f=(g=(m=e.meta)==null?void 0:m.profile)==null?void 0:g.includes(u.url),h=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return s.jsx(Tt.Tab,{value:u.url,title:h,rightSection:f&&s.jsx(K0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(lH,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function sP(e,t){const n=Ae(),r=wn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Zt(u)),Oe({color:"red",message:Ye(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function yy(){const{resourceType:e}=qt(),t=Mr(),[n,r]=y.useState(),{defaultValue:i,handleSubmit:o}=sP(e,r),[c,u]=y.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),h=y.useCallback(m=>{const g=ll(m);c&&PD(g,c.url),o(g)},[c,o]);return f?s.jsx(ot,{children:s.jsxs(qe,{children:[s.jsx(oP,{resource:i,currentProfile:c,onChange:u}),c?s.jsx(Jh,{defaultValue:i,onSubmit:h,outcome:n,profileUrl:c.url},c.url):s.jsx(_e,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(ot,{children:s.jsx(Jh,{defaultValue:i,onSubmit:o,outcome:n})})}function Aee(){const e=Ae(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return s.jsx(ot,{children:s.jsx(tX,{history:r})})}function kee(){const{resourceType:e}=qt(),[t,n]=y.useState(),{defaultValue:r,handleSubmit:i}=sP(e,n),o=y.useCallback(c=>{i(JSON.parse(c["new-resource"]))},[i]);return s.jsxs(ot,{children:[t&&s.jsx(Xr,{outcome:t}),s.jsxs(pt,{onSubmit:o,children:[s.jsx(Dc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Ii(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"OK"})})]})]})}function Pee(){const e=Ae(),{resourceType:t,id:n}=qt(),r=Wt({reference:t+"/"+n}),i=wn(),[o,c]=y.useState(),u=y.useCallback(f=>{e.updateResource(ll(JSON.parse(f.resource))).then(()=>{var h;c(void 0),(h=i(`/${t}/${n}/details`))==null||h.catch(console.error),Oe({color:"green",message:"Success"})}).catch(h=>{Oe({color:"red",message:Ye(h),autoClose:!1})})},[e,t,n,i]);return r?s.jsxs(ot,{children:[o&&s.jsx(Xr,{outcome:o}),s.jsxs(pt,{onSubmit:u,children:[s.jsx(Dc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Ii(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"OK"})})]})]}):null}function Nee(){const{resourceType:e,id:t}=qt();return Wt({reference:e+"/"+t})?s.jsxs(ot,{children:[s.jsxs(Ka,{icon:s.jsx(il,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Nt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(mk,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function Oee(){const e=Ae(),{resourceType:t,id:n}=qt(),[r,i]=y.useState(),[o,c]=y.useState();return y.useEffect(()=>{e.readResource(t,n).then(u=>i(Wr(u))).catch(u=>{Oe({color:"red",message:Ye(u)})})},[e,t,n]),r?s.jsxs(ot,{children:[s.jsxs(Le,{order:2,children:["Available ",t," profiles"]}),s.jsx(qe,{children:s.jsxs(s.Fragment,{children:[s.jsx(oP,{resource:r,currentProfile:o,onChange:c}),o?s.jsx(Mee,{profile:o,resource:r,onResourceUpdated:u=>i(u)},o.url):s.jsx(_e,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const Mee=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Ae(),[i,o]=y.useState(),[c,u]=y.useState(()=>{var h,m;return(m=(h=t.meta)==null?void 0:h.profile)==null?void 0:m.includes(e.url)}),f=y.useCallback(h=>{o(void 0);const m=ll(h);c?PD(m,e.url):vU(m,e.url),r.updateResource(m).then(g=>{n(g),Oe({color:"green",message:"Success"})}).catch(g=>{o(Zt(g)),Oe({color:"red",message:Ye(g),autoClose:!1})})},[r,e.url,n,c]);return s.jsxs(qe,{children:[s.jsx(Cd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:h=>u(h.currentTarget.checked),"data-testid":"profile-toggle"}),c?s.jsx(Jh,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:i}):s.jsx("form",{noValidate:!0,onSubmit:h=>{h.preventDefault(),f(t)},children:s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"OK"})})})]})},lP={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},Iee=Object.keys(lP);function Lee(){const e=Ae(),{id:t}=qt(),n=Wt({reference:`Questionnaire/${t}`}),[r,i]=y.useState(),[o,c]=y.useState("create"),[u,f]=y.useState(0),h=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>$ee(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},${zt(n)}`:zt(n)}`,channel:{type:"rest-hook",endpoint:zt(r)},...o?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:o}]}:void 0}).then(()=>{i(void 0),f(Date.now()),e.invalidateSearches("Subscription"),Oe({color:"green",message:"Success"})}).catch(g=>Oe({color:"red",message:Ye(g),autoClose:!1}))}return s.jsxs(ot,{children:[s.jsx(Le,{children:"Bots"}),s.jsxs(qe,{children:[h.length===0&&s.jsx("p",{children:"No bots found."}),h.map(g=>{var v;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx($c,{value:{reference:(v=g.channel)==null?void 0:v.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id)})]}),s.jsx(Cn,{}),s.jsxs(qe,{mt:10,children:[s.jsx(md,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),s.jsxs(je,{children:[s.jsx(al,{name:"bot",resourceType:"Bot",onChange:g=>i(g)}),s.jsx(Pe,{onClick:m,children:"Connect"})]}),s.jsx(je,{children:s.jsx(ln,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:Iee,onChange:g=>c(lP[g.target.value])})})]}),s.jsx("div",{style:{display:"none"},children:u})]})}function $ee(e,t){var i;if(!t)return!1;const n=e.criteria||"",r=((i=e.channel)==null?void 0:i.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(zt(t))||(t.url?n.includes(t.url):!1))}function zee(){const{id:e}=qt(),t=wn(),r=Ae().readReference({reference:`Questionnaire/${e}`}).read(),[i,o]=y.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ue.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return s.jsx(ot,{children:s.jsx(zc,{search:i,onClick:c=>{var u;return(u=t(`/${c.resource.resourceType}/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})})}function Uee(){const e=Ae(),{resourceType:t,id:n}=qt(),r=Wt({reference:t+"/"+n}),i=y.useCallback(o=>{e.updateResource(ll(o)).then(()=>{Oe({color:"green",message:"Success"})}).catch(c=>{Oe({color:"red",message:Ye(c),autoClose:!1})})},[e]);return r?s.jsx(ot,{children:s.jsx(wY,{onSubmit:i,definition:r})}):null}function Bee(){const{resourceType:e,id:t}=qt(),n=Wt({reference:e+"/"+t});return n?s.jsx(ot,{children:e==="MeasureReport"?s.jsx(wQ,{measureReport:n}):s.jsx(zb,{value:n})}):null}const Vee="_container_1ue98_1",Fee="_entry_1ue98_14",Hee="_active_1ue98_21",xy={container:Vee,entry:Fee,active:Hee};function qee(e){const t=Ae(),n=Wt(e.value),[r,i]=y.useState();return y.useEffect(()=>{if(!n)return;const o=l1(n);if(!o)return;const c="reference"in o?o.reference:zt(o);t.search("ServiceRequest","subject="+c).then(u=>{const h=(u.entry??[]).map(m=>m.resource);ZA(h),h.reverse(),i(h)}).catch(u=>Oe({color:"red",message:Ye(u),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:xy.container,children:r.map(o=>{var c,u,f,h,m,g,v;return s.jsxs("div",{className:Ut(xy.entry,{[xy.active]:o.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(mt,{to:o,children:Gee(o)})}),((u=(c=o.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(f=o.category[0])==null?void 0:f.text}),((g=(m=(h=o.code)==null?void 0:h.coding)==null?void 0:m[0])==null?void 0:g.code)&&s.jsx("p",{children:(v=o.code.coding[0])==null?void 0:v.code}),s.jsx("p",{children:Wee(o)})]},o.id)})}):null}function Gee(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function Wee(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const Qee="_container_1l2dh_1",Yee={container:Qee};function Xee(e){var i,o,c,u;const t=Wt(e.valueSet);if(!t)return null;const n=[""],r=(u=(c=(o=(i=t.compose)==null?void 0:i.include)==null?void 0:o[0])==null?void 0:c.concept)==null?void 0:u.map(f=>f.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:Yee.container,children:s.jsx(ln,{defaultValue:e.defaultValue,onChange:f=>e.onChange(f.currentTarget.value),data:n})})}function Kee(e){var n,r;const t=Wt(e.specimen);return t?s.jsxs(ht,{children:[s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Type"}),s.jsx(ht.Value,{children:"Specimen"})]}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Collected"}),s.jsx(ht.Value,{children:gr((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Specimen Age"}),s.jsx(ht.Value,{children:Zee(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Specimen Stability"}),s.jsx(ht.Value,{children:Jee(t)})]}):s.jsx(s.Fragment,{})]}):null}function Zee(e){var i;const t=(i=e.collection)==null?void 0:i.collectedDateTime;if(!t)return;const n=new Date(t);return cP(uP(n,new Date))}function Jee(e){var r;if(!((r=e.collection)!=null&&r.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return cP(uP(t,n))}function cP(e){return e.toString().padStart(3,"0")+"D"}function uP(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function ete(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),e==="Agent"&&t.push("Tools"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),e==="Patient"&&t.push("Export"),t}function tte(){var _,T,R,D,k,M,I;const e=Ae(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},i=wn(),[o,c]=y.useState(),u=Wt(r,c),f=ete(t),[h,m]=y.useState(()=>{const z=window.location.pathname.split("/").pop();return z&&f.map(V=>V.toLowerCase()).includes(z)?z:f[0].toLowerCase()});async function g(){var Y,W;const V=(W=(Y=(await e.readHistory(t,n)).entry)==null?void 0:Y.find(J=>!!J.resource))==null?void 0:W.resource;V?v(V):Oe({color:"red",message:"No history to restore",autoClose:!1})}function v(z){e.updateResource(ll(z)).then(()=>{c(void 0),Oe({color:"green",message:"Success"})}).catch(V=>{Oe({color:"red",message:Ye(V),autoClose:!1})})}if(o)return Ez(o)?s.jsxs(ot,{children:[s.jsx(Le,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(Pe,{color:"red",onClick:g,children:"Restore"})]}):s.jsx(Xr,{outcome:o});function b(z){var V;z||(z=f[0].toLowerCase()),m(z),(V=i(`/${t}/${n}/${z}`))==null||V.catch(console.error)}function S(z){const V=u,Y=V.orderDetail||[];Y.length===0&&Y.push({}),Y[0].text!==z&&(Y[0].text=z,v({...V,orderDetail:Y}))}const w=u&&l1(u),C=u&&xJ(u),E=(R=(T=(_=e.getUserConfiguration())==null?void 0:_.option)==null?void 0:T.find(z=>z.id==="statusValueSet"))==null?void 0:R.valueString;return s.jsxs(s.Fragment,{children:[(u==null?void 0:u.resourceType)==="ServiceRequest"&&E&&s.jsx(Xee,{valueSet:{reference:E},defaultValue:(k=(D=u.orderDetail)==null?void 0:D[0])==null?void 0:k.text,onChange:S},zt(u)+"-"+((I=(M=u.orderDetail)==null?void 0:M[0])==null?void 0:I.text)),u&&s.jsx(qee,{value:u}),u&&s.jsxs(lr,{children:[w&&s.jsx(ok,{patient:w}),C&&s.jsx(Kee,{specimen:C}),t!=="Patient"&&s.jsx(Jk,{resource:r}),s.jsx(Yr,{children:s.jsx(Tt,{value:h.toLowerCase(),onChange:b,children:s.jsx(Tt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map(z=>s.jsx(Tt.Tab,{value:z.toLowerCase(),children:z},z))})})})]}),s.jsx(t1,{})]})}function aR(){var E,_,T,R;const e=wn(),{resourceType:t,id:n,versionId:r,tab:i}=qt(),o=Ae(),[c,u]=y.useState(!0),[f,h]=y.useState(),[m,g]=y.useState();if(y.useEffect(()=>{g(void 0),u(!0),o.readHistory(t,n).then(D=>h(D)).then(()=>u(!1)).catch(D=>{g(D),u(!1)})},[o,t,n]),c)return s.jsx(gi,{});if(!f)return s.jsxs(ot,{children:[s.jsx(Le,{children:"Resource not found"}),s.jsx(mt,{to:`/${t}`,children:"Return to search page"})]});const v=f.entry??[],b=v.findIndex(D=>{var k,M;return((M=(k=D.resource)==null?void 0:k.meta)==null?void 0:M.versionId)===r});if(b===-1)return s.jsxs(ot,{children:[s.jsx(Le,{children:"Version not found"}),s.jsx(mt,{to:`/${t}/${n}`,children:"Return to resource"})]});const S=v[b].resource,w=b<v.length-1?v[b+1].resource:void 0,C="diff";return s.jsxs(Tt,{value:i||C,onChange:D=>{var k;return(k=e(`/${t}/${n}/_history/${r}/${D||C}`))==null?void 0:k.catch(console.error)},children:[s.jsxs(lr,{children:[s.jsx(Lc,{fluid:!0,p:"md",children:s.jsx(_e,{children:`${t} ${n}`})}),s.jsxs(Tt.List,{children:[s.jsx(Tt.Tab,{value:"diff",children:"Diff"}),s.jsx(Tt.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(ot,{children:[m&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),s.jsx(Tt.Panel,{value:"diff",children:w?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(E=S.meta)==null?void 0:E.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(mt,{to:`/${t}/${n}/_history/${(_=w.meta)==null?void 0:_.versionId}`,children:(T=w.meta)==null?void 0:T.versionId})]})]}),s.jsx(KY,{original:w,revised:S})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(R=S.meta)==null?void 0:R.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(S,void 0,2)})]})}),s.jsx(Tt.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(S,void 0,2)})})]})]})}function nte(){const{resourceType:e,id:t}=qt(),n=wn(),[r,i]=y.useState({resourceType:"Subscription",filters:[{code:"url",operator:ue.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(ot,{children:s.jsx(oQ,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>i(o.definition),hideFilters:!0})})}function rte(e){const t=Ae(),{resource:n,opened:r,onClose:i}=e,[o,c]=y.useState(!1),[u,f]=y.useState(),[h,m]=y.useState(!1),g=y.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:o&&u?zt(u):void 0,verbose:h}),Oe({color:"green",message:"Done"}),i()}catch(v){Oe({color:"red",message:Ye(v),autoClose:!1})}},[t,n,i,o,u,h]);return s.jsx(Bn,{opened:r,onClose:i,title:"Resend Subscriptions",children:s.jsx(pt,{onSubmit:g,children:s.jsxs(qe,{children:[s.jsx(zn,{label:"Choose subscription (all subscriptions by default)",onChange:v=>c(v.currentTarget.checked)}),o&&s.jsx(al,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),s.jsx(zn,{label:"Verbose mode",onChange:v=>m(v.currentTarget.checked)}),s.jsx(je,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Resend"})})]})})})}function oR(){const e=Ae(),t=rm(),{resourceType:n,id:r}=qt(),i={reference:n+"/"+r},[o,c]=y.useState(),u=up(!1);function f(_,T){return e.updateResource({..._,priority:T})}function h(_,T){f(_,"stat").then(T).catch(console.error)}function m(_,T){f(_,"routine").then(T).catch(console.error)}function g(_){t(`/${_.resourceType}/${_.id}`)}function v(_){t(`/${_.resourceType}/${_.id}/edit`)}function b(_){t(`/${_.resourceType}/${_.id}/delete`)}function S(_){c(_),u[1].open()}function w(_){var T;t(`/${_.resourceType}/${_.id}/_history/${(T=_.meta)==null?void 0:T.versionId}`)}function C(_,T){const R="aws-textract";Oe({id:R,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(_.resourceType,_.id,"$aws-textract"),{}).then(()=>{T(),As({id:R,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:s.jsx(to,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(D=>As({id:R,title:"AWS Textract Error",color:"red",message:Ye(D),icon:s.jsx(qs,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function E(_){var P;const{primaryResource:T,currentResource:R,reloadTimeline:D}=_,k=R.resourceType===T.resourceType&&R.id===T.id,M=R.resourceType==="Communication"&&R.priority!=="stat",I=R.resourceType==="Communication"&&R.priority==="stat",z=k,V=!k,Y=!k,W=!k,J=(P=e.getProjectMembership())==null?void 0:P.admin,G=J,X=kJ()&&(R.resourceType==="DocumentReference"||R.resourceType==="Media");return s.jsxs(Ce.Dropdown,{children:[s.jsx(Ce.Label,{children:"Resource"}),M&&s.jsx(Ce.Item,{leftSection:s.jsx(QF,{size:14}),onClick:()=>h(R,D),"aria-label":`Pin ${zt(R)}`,children:"Pin"}),I&&s.jsx(Ce.Item,{leftSection:s.jsx(YF,{size:14}),onClick:()=>m(R,D),"aria-label":`Unpin ${zt(R)}`,children:"Unpin"}),V&&s.jsx(Ce.Item,{leftSection:s.jsx(VE,{size:14}),onClick:()=>g(R),"aria-label":`Details ${zt(R)}`,children:"Details"}),z&&s.jsx(Ce.Item,{leftSection:s.jsx(VE,{size:14}),onClick:()=>w(R),"aria-label":`Details ${zt(R)}`,children:"Details"}),Y&&s.jsx(Ce.Item,{leftSection:s.jsx(pA,{size:14}),onClick:()=>v(R),"aria-label":`Edit ${zt(R)}`,children:"Edit"}),J&&s.jsxs(s.Fragment,{children:[s.jsx(Ce.Divider,{}),s.jsx(Ce.Label,{children:"Admin"}),G&&s.jsx(Ce.Item,{leftSection:s.jsx(ZF,{size:14}),onClick:()=>S(R),"aria-label":`Resend Subscriptions ${zt(R)}`,children:"Resend Subscriptions"})]}),X&&s.jsxs(s.Fragment,{children:[s.jsx(Ce.Divider,{}),s.jsx(Ce.Label,{children:"AWS AI"}),s.jsx(Ce.Item,{leftSection:s.jsx(oH,{size:14}),onClick:()=>C(R,D),"aria-label":`AWS Textract ${zt(R)}`,children:"AWS Textract"})]}),W&&s.jsxs(s.Fragment,{children:[s.jsx(Ce.Divider,{}),s.jsx(Ce.Label,{children:"Danger zone"}),s.jsx(Ce.Item,{color:"red",leftSection:s.jsx(am,{size:14}),onClick:()=>b(R),"aria-label":`Delete ${zt(R)}`,children:"Delete"})]})]})}return s.jsxs(s.Fragment,{children:[n==="Encounter"&&s.jsx(pW,{encounter:i,getMenu:E}),n==="Patient"&&s.jsx(RQ,{patient:i,getMenu:E}),n==="ServiceRequest"&&s.jsx(iX,{serviceRequest:i,getMenu:E}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&s.jsx(hW,{resource:i,getMenu:E}),s.jsx(rte,{resource:o,opened:u[0],onClose:u[1].close},`resend-subscriptions-${o==null?void 0:o.id}`)]})}function ite(e){const{opened:t,close:n,version:r,loadingStatus:i,handleStatus:o,handleUpgrade:c}=e,[u,f]=y.useState(),[h,m]=y.useState(!1);return y.useEffect(()=>{t&&(u||zV("app-tools-page").then(f).catch(console.error),o())},[t,u,o]),u&&r&&!i?r==="unknown"?s.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(u)?s.jsxs("p",{children:["This agent is already on the latest version (",u,")."]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",u,"?"]}),s.jsxs(je,{children:[s.jsx(Pe,{onClick:()=>{c(h),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),s.jsx(zn,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):s.jsx(gi,{})}function ate(){const e=Ae(),{id:t}=qt(),n=y.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,i]=y.useState(!1),[o,c]=y.useState(!1),[u,f]=y.useState(!1),[h,m]=y.useState(),[g,v]=y.useState(),[b,S]=y.useState(),[w,C]=y.useState(),[E,_]=y.useState(!1),[T,R]=y.useState(!1),[D,{open:k,close:M}]=up(!1);y.useEffect(()=>{if(r||o||u||E){R(!0);return}R(!1)},[r,o,u,E]);const I=y.useCallback(()=>{i(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(G=>{var X,P,L,$,H,O;m((P=(X=G.parameter)==null?void 0:X.find(U=>U.name==="status"))==null?void 0:P.valueCode),v(($=(L=G.parameter)==null?void 0:L.find(U=>U.name==="version"))==null?void 0:$.valueString),S((O=(H=G.parameter)==null?void 0:H.find(U=>U.name==="lastUpdated"))==null?void 0:O.valueInstant)}).catch(G=>J(Ye(G))).finally(()=>i(!1))},[e,t]),z=y.useCallback(G=>{const X=G.host,P=G.pingCount||1;X&&(_(!0),e.pushToAgent(n,X,`PING ${P}`,hn.PING,!0).then(L=>C(L)).catch(L=>J(Ye(L))).finally(()=>_(!1)))},[e,n]),V=y.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(G=>{W("Agent config reloaded successfully.")}).catch(G=>J(Ye(G))).finally(()=>c(!1))},[e,t]),Y=y.useCallback(G=>{f(!0),e.get(e.fhirUrl("Agent",t,"$upgrade",`?force=${G}`),{cache:"reload"}).then(X=>{W("Agent upgraded successfully.")}).catch(X=>J(Ye(X))).finally(()=>f(!1))},[e,t]);function W(G){Oe({color:"green",title:"Success",icon:s.jsx(to,{size:"1rem"}),message:G})}function J(G){Oe({color:"red",title:"Error",message:G,autoClose:!1})}return s.jsxs(ot,{children:[s.jsx(Bn,{opened:D,onClose:M,title:"Upgrade Agent",centered:!0,children:s.jsx(ite,{opened:D,close:M,version:g,loadingStatus:r,handleStatus:I,handleUpgrade:Y})}),s.jsx(Le,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx($c,{value:n,link:!0})]}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Agent Status"}),s.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),s.jsx(Pe,{onClick:I,loading:r,disabled:T&&!r,children:"Get Status"}),!r&&h&&s.jsx(ye,{children:s.jsxs(ye.Tbody,{children:[s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:"Status"}),s.jsx(ye.Td,{children:s.jsx(um,{status:h})})]}),s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:"Version"}),s.jsx(ye.Td,{children:g})]}),s.jsxs(ye.Tr,{children:[s.jsx(ye.Td,{children:"Last Updated"}),s.jsx(ye.Td,{children:gr(b,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Reload Config"}),s.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),s.jsx(Pe,{onClick:V,loading:o,disabled:T&&!o,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Upgrade Agent"}),s.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),s.jsx(Pe,{onClick:k,loading:u,disabled:T&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),s.jsx(Cn,{my:"lg"}),s.jsx(Le,{order:2,children:"Ping from Agent"}),s.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),s.jsx(pt,{onSubmit:z,children:s.jsxs(je,{children:[s.jsx($e,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(An,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:E,disabled:T&&!E,children:s.jsx(eH,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(Up,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!E&&w&&s.jsxs(s.Fragment,{children:[s.jsx(Le,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:w})]})]})}function ote(){return s.jsx(IK,{children:s.jsxs(Fe,{errorElement:s.jsx(yJ,{}),children:[s.jsx(Fe,{path:"/signin",element:s.jsx(LJ,{})}),s.jsx(Fe,{path:"/oauth",element:s.jsx(PJ,{})}),s.jsx(Fe,{path:"/resetpassword",element:s.jsx(OJ,{})}),s.jsx(Fe,{path:"/setpassword/:id/:secret",element:s.jsx(IJ,{})}),s.jsx(Fe,{path:"/register",element:s.jsx(NJ,{})}),s.jsx(Fe,{path:"/changepassword",element:s.jsx(mJ,{})}),s.jsx(Fe,{path:"/security",element:s.jsx(MJ,{})}),s.jsx(Fe,{path:"/mfa",element:s.jsx(AJ,{})}),s.jsx(Fe,{path:"/batch",element:s.jsx(hJ,{})}),s.jsx(Fe,{path:"/bulk/:resourceType",element:s.jsx(pJ,{})}),s.jsx(Fe,{path:"/smart",element:s.jsx($J,{})}),s.jsx(Fe,{path:"/forms/:id",element:s.jsx(bJ,{})}),s.jsx(Fe,{path:"/admin/super",element:s.jsx(ree,{})}),s.jsx(Fe,{path:"/admin/super/asyncjob",element:s.jsx(KJ,{})}),s.jsx(Fe,{path:"/admin/config",element:s.jsx(WJ,{})}),s.jsxs(Fe,{path:"/admin",element:s.jsx(QJ,{}),children:[s.jsx(Fe,{path:"patients",element:s.jsx(GJ,{})}),s.jsx(Fe,{path:"bots/new",element:s.jsx(BJ,{})}),s.jsx(Fe,{path:"bots",element:s.jsx(zJ,{})}),s.jsx(Fe,{path:"clients/new",element:s.jsx(VJ,{})}),s.jsx(Fe,{path:"clients",element:s.jsx(UJ,{})}),s.jsx(Fe,{path:"details",element:s.jsx(JT,{})}),s.jsx(Fe,{path:"invite",element:s.jsx(qJ,{})}),s.jsx(Fe,{path:"users",element:s.jsx(aee,{})}),s.jsx(Fe,{path:"project",element:s.jsx(JT,{})}),s.jsx(Fe,{path:"secrets",element:s.jsx(YJ,{})}),s.jsx(Fe,{path:"sites",element:s.jsx(XJ,{})}),s.jsx(Fe,{path:"members/:membershipId",element:s.jsx(HJ,{})})]}),s.jsx(Fe,{path:"/lab/assays",element:s.jsx(oee,{})}),s.jsx(Fe,{path:"/lab/panels",element:s.jsx(see,{})}),s.jsx(Fe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(aR,{})}),s.jsx(Fe,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(aR,{})}),s.jsxs(Fe,{path:"/:resourceType/new",element:s.jsx(vJ,{}),children:[s.jsx(Fe,{index:!0,element:s.jsx(yy,{})}),s.jsx(Fe,{path:"form",element:s.jsx(yy,{})}),s.jsx(Fe,{path:"json",element:s.jsx(kee,{})}),s.jsx(Fe,{path:"profiles",element:s.jsx(yy,{})})]}),s.jsxs(Fe,{path:"/:resourceType/:id",element:s.jsx(tte,{}),children:[s.jsx(Fe,{index:!0,element:s.jsx(oR,{})}),s.jsx(Fe,{path:"apply",element:s.jsx(cee,{})}),s.jsx(Fe,{path:"apps",element:s.jsx(uee,{})}),s.jsx(Fe,{path:"event",element:s.jsx(fee,{})}),s.jsx(Fe,{path:"blame",element:s.jsx(hee,{})}),s.jsx(Fe,{path:"bots",element:s.jsx(Lee,{})}),s.jsx(Fe,{path:"builder",element:s.jsx(wee,{})}),s.jsx(Fe,{path:"checklist",element:s.jsx(jee,{})}),s.jsx(Fe,{path:"delete",element:s.jsx(Cee,{})}),s.jsx(Fe,{path:"details",element:s.jsx(Ree,{})}),s.jsx(Fe,{path:"edit",element:s.jsx(_ee,{})}),s.jsx(Fe,{path:"editor",element:s.jsx(bee,{})}),s.jsx(Fe,{path:"history",element:s.jsx(Aee,{})}),s.jsx(Fe,{path:"json",element:s.jsx(Pee,{})}),s.jsx(Fe,{path:"preview",element:s.jsx(Nee,{})}),s.jsx(Fe,{path:"responses",element:s.jsx(zee,{})}),s.jsx(Fe,{path:"report",element:s.jsx(Bee,{})}),s.jsx(Fe,{path:"ranges",element:s.jsx(Uee,{})}),s.jsx(Fe,{path:"subscriptions",element:s.jsx(nte,{})}),s.jsx(Fe,{path:"timeline",element:s.jsx(oR,{})}),s.jsx(Fe,{path:"tools",element:s.jsx(ate,{})}),s.jsx(Fe,{path:"profiles",element:s.jsx(Oee,{})}),s.jsx(Fe,{path:"export",element:s.jsx(Dee,{})})]}),s.jsx(Fe,{path:"/:resourceType",element:s.jsx(ZT,{})}),s.jsx(Fe,{path:"/",element:s.jsx(ZT,{})})]})})}function ste(){const e=Ae(),t=e.getUserConfiguration(),n=Mr(),[r]=i1();return e.isLoading()?s.jsx(gi,{}):s.jsx(eq,{logo:s.jsx(Bi,{size:24}),pathname:n.pathname,searchParams:r,version:XD,menus:lte(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(y.Suspense,{fallback:s.jsx(gi,{}),children:s.jsx(ote,{})})})}function lte(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var i;return{title:r.title,links:((i=r.link)==null?void 0:i.map(o=>({label:o.name,href:o.target,icon:cte(o.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(VF,{})}]}),t}const sR={Patient:rH,Practitioner:UF,Organization:AF,ServiceRequest:KF,DiagnosticReport:JF,Questionnaire:zF,admin:RF,AccessPolicy:BF,Subscription:sH,batch:WF,Observation:qF};function cte(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in sR){const n=sR[t];return s.jsx(n,{})}}catch{}return s.jsx(Qp,{w:30})}"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister()))).catch(e=>console.error("SW registration failed: ",e))});async function ute(){const e=Bd(),t=new KD({baseUrl:e.baseUrl,clientId:e.clientId,cacheTime:6e4,autoBatchTime:100,onUnauthenticated:()=>{window.location.pathname!=="/signin"&&window.location.pathname!=="/oauth"&&(window.location.href="/signin?next="+encodeURIComponent(window.location.pathname+window.location.search))}}),n={headings:{sizes:{h1:{fontSize:"1.125rem",fontWeight:"500",lineHeight:"2.0"}}},fontSizes:{xs:"0.6875rem",sm:"0.875rem",md:"0.875rem",lg:"1.0rem",xl:"1.125rem"}},r=sZ([{path:"*",element:s.jsx(ste,{})}]),i=c=>r.navigate(c);uX.createRoot(document.getElementById("root")).render(s.jsx(y.StrictMode,{children:s.jsx(UV,{medplum:t,navigate:i,children:s.jsxs(PR,{theme:n,children:[s.jsx(eo,{position:"bottom-right"}),s.jsx(PK,{router:r})]})})}))}ute().catch(console.error);
589
- //# sourceMappingURL=index-8LS3BIwK.js.map