@medplum/app 2.2.4 → 2.2.6

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.
@@ -0,0 +1,243 @@
1
+ function vE(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(n,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>n[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var O1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function By(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yE={exports:{}},Ch={},xE={exports:{}},Te={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var bc=Symbol.for("react.element"),zA=Symbol.for("react.portal"),FA=Symbol.for("react.fragment"),VA=Symbol.for("react.strict_mode"),BA=Symbol.for("react.profiler"),UA=Symbol.for("react.provider"),WA=Symbol.for("react.context"),HA=Symbol.for("react.forward_ref"),qA=Symbol.for("react.suspense"),GA=Symbol.for("react.memo"),QA=Symbol.for("react.lazy"),C1=Symbol.iterator;function KA(e){return e===null||typeof e!="object"?null:(e=C1&&e[C1]||e["@@iterator"],typeof e=="function"?e:null)}var wE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bE=Object.assign,_E={};function $s(e,t,r){this.props=e,this.context=t,this.refs=_E,this.updater=r||wE}$s.prototype.isReactComponent={};$s.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};$s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function SE(){}SE.prototype=$s.prototype;function Uy(e,t,r){this.props=e,this.context=t,this.refs=_E,this.updater=r||wE}var Wy=Uy.prototype=new SE;Wy.constructor=Uy;bE(Wy,$s.prototype);Wy.isPureReactComponent=!0;var E1=Array.isArray,PE=Object.prototype.hasOwnProperty,Hy={current:null},jE={key:!0,ref:!0,__self:!0,__source:!0};function OE(e,t,r){var n,o={},i=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)PE.call(t,n)&&!jE.hasOwnProperty(n)&&(o[n]=t[n]);var l=arguments.length-2;if(l===1)o.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)o[n]===void 0&&(o[n]=l[n]);return{$$typeof:bc,type:e,key:i,ref:a,props:o,_owner:Hy.current}}function YA(e,t){return{$$typeof:bc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function qy(e){return typeof e=="object"&&e!==null&&e.$$typeof===bc}function XA(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var $1=/\/+/g;function Hm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?XA(""+e.key):t.toString(36)}function Ju(e,t,r,n,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case bc:case zA:a=!0}}if(a)return a=e,o=o(a),e=n===""?"."+Hm(a,0):n,E1(o)?(r="",e!=null&&(r=e.replace($1,"$&/")+"/"),Ju(o,t,r,"",function(u){return u})):o!=null&&(qy(o)&&(o=YA(o,r+(!o.key||a&&a.key===o.key?"":(""+o.key).replace($1,"$&/")+"/")+e)),t.push(o)),1;if(a=0,n=n===""?".":n+":",E1(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+Hm(i,l);a+=Ju(i,t,r,c,o)}else if(c=KA(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+Hm(i,l++),a+=Ju(i,t,r,c,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function tu(e,t,r){if(e==null)return e;var n=[],o=0;return Ju(e,n,"","",function(i){return t.call(r,i,o++)}),n}function JA(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var br={current:null},Zu={transition:null},ZA={ReactCurrentDispatcher:br,ReactCurrentBatchConfig:Zu,ReactCurrentOwner:Hy};Te.Children={map:tu,forEach:function(e,t,r){tu(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return tu(e,function(){t++}),t},toArray:function(e){return tu(e,function(t){return t})||[]},only:function(e){if(!qy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Te.Component=$s;Te.Fragment=FA;Te.Profiler=BA;Te.PureComponent=Uy;Te.StrictMode=VA;Te.Suspense=qA;Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZA;Te.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=bE({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=Hy.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)PE.call(t,c)&&!jE.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:bc,type:e.type,key:o,ref:i,props:n,_owner:a}};Te.createContext=function(e){return e={$$typeof:WA,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:UA,_context:e},e.Consumer=e};Te.createElement=OE;Te.createFactory=function(e){var t=OE.bind(null,e);return t.type=e,t};Te.createRef=function(){return{current:null}};Te.forwardRef=function(e){return{$$typeof:HA,render:e}};Te.isValidElement=qy;Te.lazy=function(e){return{$$typeof:QA,_payload:{_status:-1,_result:e},_init:JA}};Te.memo=function(e,t){return{$$typeof:GA,type:e,compare:t===void 0?null:t}};Te.startTransition=function(e){var t=Zu.transition;Zu.transition={};try{e()}finally{Zu.transition=t}};Te.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Te.useCallback=function(e,t){return br.current.useCallback(e,t)};Te.useContext=function(e){return br.current.useContext(e)};Te.useDebugValue=function(){};Te.useDeferredValue=function(e){return br.current.useDeferredValue(e)};Te.useEffect=function(e,t){return br.current.useEffect(e,t)};Te.useId=function(){return br.current.useId()};Te.useImperativeHandle=function(e,t,r){return br.current.useImperativeHandle(e,t,r)};Te.useInsertionEffect=function(e,t){return br.current.useInsertionEffect(e,t)};Te.useLayoutEffect=function(e,t){return br.current.useLayoutEffect(e,t)};Te.useMemo=function(e,t){return br.current.useMemo(e,t)};Te.useReducer=function(e,t,r){return br.current.useReducer(e,t,r)};Te.useRef=function(e){return br.current.useRef(e)};Te.useState=function(e){return br.current.useState(e)};Te.useSyncExternalStore=function(e,t,r){return br.current.useSyncExternalStore(e,t,r)};Te.useTransition=function(){return br.current.useTransition()};Te.version="18.2.0";xE.exports=Te;var f=xE.exports;const S=By(f),Hl=vE({__proto__:null,default:S},[f]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var e9=f,t9=Symbol.for("react.element"),r9=Symbol.for("react.fragment"),n9=Object.prototype.hasOwnProperty,o9=e9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i9={key:!0,ref:!0,__self:!0,__source:!0};function CE(e,t,r){var n,o={},i=null,a=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)n9.call(t,n)&&!i9.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:t9,type:e,key:i,ref:a,props:o,_owner:o9.current}}Ch.Fragment=r9;Ch.jsx=CE;Ch.jsxs=CE;yE.exports=Ch;var s=yE.exports,Kn=function(){return Kn=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Kn.apply(this,arguments)};function EE(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function ks(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(d){try{u(n.next(d))}catch(p){a(p)}}function c(d){try{u(n.throw(d))}catch(p){a(p)}}function u(d){d.done?i(d.value):o(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}function Rs(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function k1(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function iv(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var ed="right-scroll-bar-position",td="width-before-scroll-bar",a9="with-scroll-bars-hidden",s9="--removed-body-scroll-bar-size";function l9(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function c9(e,t){var r=f.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}function u9(e,t){return c9(t||null,function(r){return e.forEach(function(n){return l9(n,r)})})}function d9(e){return e}function f9(e,t){t===void 0&&(t=d9);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var a=t(i,n);return r.push(a),function(){r=r.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(n=!0;r.length;){var a=r;r=[],a.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var a=[];if(r.length){var l=r;r=[],l.forEach(i),a=r}var c=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),r}}}};return o}function p9(e){e===void 0&&(e={});var t=f9(null);return t.options=Kn({async:!0,ssr:!1},e),t}var $E=function(e){var t=e.sideCar,r=EE(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return f.createElement(n,Kn({},r))};$E.isSideCarExport=!0;function h9(e,t){return e.useMedium(t),$E}var kE=p9(),qm=function(){},Eh=f.forwardRef(function(e,t){var r=f.useRef(null),n=f.useState({onScrollCapture:qm,onWheelCapture:qm,onTouchMoveCapture:qm}),o=n[0],i=n[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,_=e.as,y=_===void 0?"div":_,x=e.gapMode,w=EE(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=h,j=u9([r,t]),C=Kn(Kn({},w),o);return f.createElement(f.Fragment,null,d&&f.createElement(b,{sideCar:kE,removeScrollBar:u,shards:p,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:x}),a?f.cloneElement(f.Children.only(l),Kn(Kn({},C),{ref:j})):f.createElement(y,Kn({},C,{className:c,ref:j}),l))});Eh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Eh.classNames={fullWidth:td,zeroRight:ed};var R1,m9=function(){if(R1)return R1;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function g9(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=m9();return t&&e.setAttribute("nonce",t),e}function v9(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function y9(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var x9=function(){var e=0,t=null;return{add:function(r){e==0&&(t=g9())&&(v9(t,r),y9(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},w9=function(){var e=x9();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},RE=function(){var e=w9(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},b9={left:0,top:0,right:0,gap:0},Gm=function(e){return parseInt(e||"",10)||0},_9=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Gm(r),Gm(n),Gm(o)]},S9=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return b9;var t=_9(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},P9=RE(),j9=function(e,t,r,n){var o=e.left,i=e.top,a=e.right,l=e.gap;return r===void 0&&(r="margin"),`
18
+ .`.concat(a9,` {
19
+ overflow: hidden `).concat(n,`;
20
+ padding-right: `).concat(l,"px ").concat(n,`;
21
+ }
22
+ body {
23
+ overflow: hidden `).concat(n,`;
24
+ overscroll-behavior: contain;
25
+ `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
26
+ padding-left: `.concat(o,`px;
27
+ padding-top: `).concat(i,`px;
28
+ padding-right: `).concat(a,`px;
29
+ margin-left:0;
30
+ margin-top:0;
31
+ margin-right: `).concat(l,"px ").concat(n,`;
32
+ `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),`
33
+ }
34
+
35
+ .`).concat(ed,` {
36
+ right: `).concat(l,"px ").concat(n,`;
37
+ }
38
+
39
+ .`).concat(td,` {
40
+ margin-right: `).concat(l,"px ").concat(n,`;
41
+ }
42
+
43
+ .`).concat(ed," .").concat(ed,` {
44
+ right: 0 `).concat(n,`;
45
+ }
46
+
47
+ .`).concat(td," .").concat(td,` {
48
+ margin-right: 0 `).concat(n,`;
49
+ }
50
+
51
+ body {
52
+ `).concat(s9,": ").concat(l,`px;
53
+ }
54
+ `)},O9=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,i=f.useMemo(function(){return S9(o)},[o]);return f.createElement(P9,{styles:j9(i,!t,o,r?"":"!important")})},av=!1;if(typeof window<"u")try{var ru=Object.defineProperty({},"passive",{get:function(){return av=!0,!0}});window.addEventListener("test",ru,ru),window.removeEventListener("test",ru,ru)}catch{av=!1}var Ea=av?{passive:!1}:!1,C9=function(e){return e.tagName==="TEXTAREA"},TE=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!C9(e)&&r[t]==="visible")},E9=function(e){return TE(e,"overflowY")},$9=function(e){return TE(e,"overflowX")},T1=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=IE(e,n);if(o){var i=DE(e,n),a=i[1],l=i[2];if(a>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},k9=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},R9=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},IE=function(e,t){return e==="v"?E9(t):$9(t)},DE=function(e,t){return e==="v"?k9(t):R9(t)},T9=function(e,t){return e==="h"&&t==="rtl"?-1:1},I9=function(e,t,r,n,o){var i=T9(e,window.getComputedStyle(t).direction),a=i*n,l=r.target,c=t.contains(l),u=!1,d=a>0,p=0,h=0;do{var m=DE(e,l),g=m[0],v=m[1],_=m[2],y=v-_-i*g;(g||y)&&IE(e,l)&&(p+=y,h+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(o&&Math.abs(p)<1||!o&&a>p)||!d&&(o&&Math.abs(h)<1||!o&&-a>h))&&(u=!0),u},nu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},I1=function(e){return[e.deltaX,e.deltaY]},D1=function(e){return e&&"current"in e?e.current:e},D9=function(e,t){return e[0]===t[0]&&e[1]===t[1]},N9=function(e){return`
55
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
56
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
+ `)},A9=0,$a=[];function M9(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(A9++)[0],i=f.useState(RE)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=iv([e.lockRef.current],(e.shards||[]).map(D1),!0).filter(Boolean);return v.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(v,_){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var y=nu(v),x=r.current,w="deltaX"in v?v.deltaX:x[0]-y[0],b="deltaY"in v?v.deltaY:x[1]-y[1],j,C=v.target,P=Math.abs(w)>Math.abs(b)?"h":"v";if("touches"in v&&P==="h"&&C.type==="range")return!1;var E=T1(P,C);if(!E)return!0;if(E?j=P:(j=P==="v"?"h":"v",E=T1(P,C)),!E)return!1;if(!n.current&&"changedTouches"in v&&(w||b)&&(n.current=j),!j)return!0;var k=n.current||j;return I9(k,_,v,k==="h"?w:b,!0)},[]),c=f.useCallback(function(v){var _=v;if(!(!$a.length||$a[$a.length-1]!==i)){var y="deltaY"in _?I1(_):nu(_),x=t.current.filter(function(j){return j.name===_.type&&(j.target===_.target||_.target===j.shadowParent)&&D9(j.delta,y)})[0];if(x&&x.should){_.cancelable&&_.preventDefault();return}if(!x){var w=(a.current.shards||[]).map(D1).filter(Boolean).filter(function(j){return j.contains(_.target)}),b=w.length>0?l(_,w[0]):!a.current.noIsolation;b&&_.cancelable&&_.preventDefault()}}},[]),u=f.useCallback(function(v,_,y,x){var w={name:v,delta:_,target:y,should:x,shadowParent:L9(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(b){return b!==w})},1)},[]),d=f.useCallback(function(v){r.current=nu(v),n.current=void 0},[]),p=f.useCallback(function(v){u(v.type,I1(v),v.target,l(v,e.lockRef.current))},[]),h=f.useCallback(function(v){u(v.type,nu(v),v.target,l(v,e.lockRef.current))},[]);f.useEffect(function(){return $a.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ea),document.addEventListener("touchmove",c,Ea),document.addEventListener("touchstart",d,Ea),function(){$a=$a.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ea),document.removeEventListener("touchmove",c,Ea),document.removeEventListener("touchstart",d,Ea)}},[]);var m=e.removeScrollBar,g=e.inert;return f.createElement(f.Fragment,null,g?f.createElement(i,{styles:N9(o)}):null,m?f.createElement(O9,{gapMode:e.gapMode}):null)}function L9(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const z9=h9(kE,M9);var NE=f.forwardRef(function(e,t){return f.createElement(Eh,Kn({},e,{ref:t,sideCar:z9}))});NE.classNames=Eh.classNames;const F9=NE;function Sd(e,t){let r=e;for(;(r=r.parentElement)&&!r.matches(t););return r}function V9(e,t,r){for(let n=e-1;n>=0;n-=1)if(!t[n].disabled)return n;if(r){for(let n=t.length-1;n>-1;n-=1)if(!t[n].disabled)return n}return e}function B9(e,t,r){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(r){for(let n=0;n<t.length;n+=1)if(!t[n].disabled)return n}return e}function U9(e,t,r){return Sd(e,r)===Sd(t,r)}function AE({parentSelector:e,siblingSelector:t,onKeyDown:r,loop:n=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:a}){return l=>{var c;r==null||r(l);const u=Array.from(((c=Sd(l.currentTarget,e))==null?void 0:c.querySelectorAll(t))||[]).filter(v=>U9(l.currentTarget,v,e)),d=u.findIndex(v=>l.currentTarget===v),p=B9(d,u,n),h=V9(d,u,n),m=i==="rtl"?h:p,g=i==="rtl"?p:h;switch(l.key){case"ArrowRight":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[m].focus(),o&&u[m].click());break}case"ArrowLeft":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[g].focus(),o&&u[g].click());break}case"ArrowUp":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[h].focus(),o&&u[h].click());break}case"ArrowDown":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[p].focus(),o&&u[p].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!u[0].disabled&&u[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const v=u.length-1;!u[v].disabled&&u[v].focus();break}}}}function W9(e,t,r){var n;return r?Array.from(((n=Sd(r,t))==null?void 0:n.querySelectorAll(e))||[]).findIndex(o=>o===r):null}function No(e){const t=f.createContext(null);return[({children:o,value:i})=>S.createElement(t.Provider,{value:i},o),()=>{const o=f.useContext(t);if(o===null)throw new Error(e);return o}]}function _c(e){return Array.isArray(e)?e:[e]}function N1(e,t){return r=>{if(typeof r!="string"||r.trim().length===0)throw new Error(t);return`${e}-${r}`}}const H9=()=>{};function q9(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||H9:r=>{var n;r.key==="Escape"&&(e(r),(n=t.onTrigger)==null||n.call(t))}}function Hr(e,t){return r=>{e==null||e(r),t==null||t(r)}}function G9(){const[e,t]=f.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function Q9({data:e}){const t=[],r=[],n=e.reduce((o,i,a)=>(i.group?o[i.group]?o[i.group].push(a):o[i.group]=[a]:r.push(a),o),{});return Object.keys(n).forEach(o=>{t.push(...n[o].map(i=>e[i]))}),t.push(...r.map(o=>e[o])),t}function K9(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const Y9=typeof window<"u"?f.useLayoutEffect:f.useEffect;function X9(e){function t(n){const o=Object.keys(n).reduce((i,a)=>(i[`${e}:${a}`]=l=>n[a](l.detail),i),{});Y9(()=>(Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i]),window.addEventListener(i,o[i])}),()=>Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i])})),[o])}function r(n){return(...o)=>K9(`${e}:${String(n)}`,o[0])}return[t,r]}function Ts(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==S.Fragment:!1}function ME(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=ME(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function LE(){for(var e=0,t,r,n="";e<arguments.length;)(t=arguments[e++])&&(r=ME(t))&&(n&&(n+=" "),n+=r);return n}const J9={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function Z9(e){return()=>({fontFamily:e.fontFamily||"sans-serif"})}var eM=Object.defineProperty,A1=Object.getOwnPropertySymbols,tM=Object.prototype.hasOwnProperty,rM=Object.prototype.propertyIsEnumerable,M1=(e,t,r)=>t in e?eM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L1=(e,t)=>{for(var r in t||(t={}))tM.call(t,r)&&M1(e,r,t[r]);if(A1)for(var r of A1(t))rM.call(t,r)&&M1(e,r,t[r]);return e};function nM(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:L1({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:L1({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function Sc(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function Gy(e){const t=Sc(e);return(r,n,o=!0,i=!0)=>{if(typeof r=="string"&&r.includes(".")){const[l,c]=r.split("."),u=parseInt(c,10);if(l in e.colors&&u>=0&&u<10)return e.colors[l][typeof n=="number"&&!i?n:u]}const a=typeof n=="number"?n:t();return r in e.colors?e.colors[r][a]:o?e.colors[e.primaryColor][a]:r}}function zE(e){let t="";for(let r=1;r<e.length-1;r+=1)t+=`${e[r]} ${r/(e.length-1)*100}%, `;return`${e[0]} 0%, ${t}${e[e.length-1]} 100%`}function oM(e,...t){return`linear-gradient(${e}deg, ${zE(t)})`}function iM(...e){return`radial-gradient(circle, ${zE(e)})`}function FE(e){const t=Gy(e),r=Sc(e);return n=>{const o={from:(n==null?void 0:n.from)||e.defaultGradient.from,to:(n==null?void 0:n.to)||e.defaultGradient.to,deg:(n==null?void 0:n.deg)||e.defaultGradient.deg};return`linear-gradient(${o.deg}deg, ${t(o.from,r(),!1)} 0%, ${t(o.to,r(),!1)} 100%)`}}function VE(e){return t=>{if(typeof t=="number")return`${t/16}${e}`;if(typeof t=="string"){const r=t.replace("px","");if(!Number.isNaN(Number(r)))return`${Number(r)/16}${e}`}return t}}const O=VE("rem"),sr=VE("em");function A({size:e,sizes:t,units:r}){return e in t?t[e]:typeof e=="number"?r==="em"?sr(e):O(e):e||t.md}function wr(e){return typeof e=="number"?e:typeof e=="string"&&e.includes("rem")?Number(e.replace("rem",""))*16:typeof e=="string"&&e.includes("em")?Number(e.replace("em",""))*16:Number(e)}function aM(e){return t=>`@media (min-width: ${sr(wr(A({size:t,sizes:e.breakpoints})))})`}function sM(e){return t=>`@media (max-width: ${sr(wr(A({size:t,sizes:e.breakpoints}))-1)})`}function lM(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function cM(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}const r=parseInt(t,16),n=r>>16&255,o=r>>8&255,i=r&255;return{r:n,g:o,b:i,a:1}}function uM(e){const[t,r,n,o]=e.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:t,g:r,b:n,a:o||1}}function Qy(e){return lM(e)?cM(e):e.startsWith("rgb")?uM(e):{r:0,g:0,b:0,a:1}}function za(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(--"))return e;const{r,g:n,b:o}=Qy(e);return`rgba(${r}, ${n}, ${o}, ${t})`}function dM(e=0){return{position:"absolute",top:O(e),right:O(e),left:O(e),bottom:O(e)}}function fM(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a:i}=Qy(e),a=1-t,l=c=>Math.round(c*a);return`rgba(${l(r)}, ${l(n)}, ${l(o)}, ${i})`}function pM(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a:i}=Qy(e),a=l=>Math.round(l+(255-l)*t);return`rgba(${a(r)}, ${a(n)}, ${a(o)}, ${i})`}function hM(e){return t=>{if(typeof t=="number")return O(t);const r=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||r}}function mM(e,t){if(typeof e=="string"&&e.includes(".")){const[r,n]=e.split("."),o=parseInt(n,10);if(r in t.colors&&o>=0&&o<10)return{isSplittedColor:!0,key:r,shade:o}}return{isSplittedColor:!1}}function gM(e){const t=Gy(e),r=Sc(e),n=FE(e);return({variant:o,color:i,gradient:a,primaryFallback:l})=>{const c=mM(i,e);switch(o){case"light":return{border:"transparent",background:za(t(i,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1),color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),hover:za(t(i,e.colorScheme==="dark"?7:1,l,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),hover:za(t(i,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(i,e.colorScheme==="dark"?5:r("light")),background:"transparent",color:t(i,e.colorScheme==="dark"?5:r("light")),hover:e.colorScheme==="dark"?za(t(i,5,l,!1),.05):za(t(i,0,l,!1),.35)};case"default":return{border:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4],background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,color:e.colorScheme==="dark"?e.white:e.black,hover:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(i,r()),hover:null};case"transparent":return{border:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),background:"transparent",hover:null};case"gradient":return{background:n(a),color:e.white,border:"transparent",hover:null};default:{const u=r(),d=c.isSplittedColor?c.shade:u,p=c.isSplittedColor?c.key:i;return{border:"transparent",background:t(p,d,l),color:e.white,hover:t(p,d===9?8:d+1)}}}}}function vM(e){return t=>{const r=Sc(e)(t);return e.colors[e.primaryColor][r]}}function yM(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function xM(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}function wM(e){return()=>e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}const Mt={fontStyles:Z9,themeColor:Gy,focusStyles:nM,linearGradient:oM,radialGradient:iM,smallerThan:sM,largerThan:aM,rgba:za,cover:dM,darken:fM,lighten:pM,radius:hM,variant:gM,primaryShade:Sc,hover:yM,gradient:FE,primaryColor:vM,placeholderStyles:xM,dimmed:wM};var bM=Object.defineProperty,_M=Object.defineProperties,SM=Object.getOwnPropertyDescriptors,z1=Object.getOwnPropertySymbols,PM=Object.prototype.hasOwnProperty,jM=Object.prototype.propertyIsEnumerable,F1=(e,t,r)=>t in e?bM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OM=(e,t)=>{for(var r in t||(t={}))PM.call(t,r)&&F1(e,r,t[r]);if(z1)for(var r of z1(t))jM.call(t,r)&&F1(e,r,t[r]);return e},CM=(e,t)=>_M(e,SM(t));function BE(e){return CM(OM({},e),{fn:{fontStyles:Mt.fontStyles(e),themeColor:Mt.themeColor(e),focusStyles:Mt.focusStyles(e),largerThan:Mt.largerThan(e),smallerThan:Mt.smallerThan(e),radialGradient:Mt.radialGradient,linearGradient:Mt.linearGradient,gradient:Mt.gradient(e),rgba:Mt.rgba,cover:Mt.cover,lighten:Mt.lighten,darken:Mt.darken,primaryShade:Mt.primaryShade(e),radius:Mt.radius(e),variant:Mt.variant(e),hover:Mt.hover,primaryColor:Mt.primaryColor(e),placeholderStyles:Mt.placeholderStyles(e),dimmed:Mt.dimmed(e)}})}const UE=["xs","sm","md","lg","xl"],EM={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:J9,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)",sm:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem",md:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem",lg:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem",xl:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"},fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},radius:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"2rem"},spacing:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:"2.125rem",lineHeight:1.3,fontWeight:void 0},h2:{fontSize:"1.625rem",lineHeight:1.35,fontWeight:void 0},h3:{fontSize:"1.375rem",lineHeight:1.4,fontWeight:void 0},h4:{fontSize:"1.125rem",lineHeight:1.45,fontWeight:void 0},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:void 0},h6:{fontSize:"0.875rem",lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(0.0625rem)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:e=>({outlineOffset:"0.125rem",outline:`0.125rem solid ${e.colors[e.primaryColor][e.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:e=>({outline:"none",borderColor:e.colors[e.primaryColor][typeof e.primaryShade=="object"?e.primaryShade[e.colorScheme]:e.primaryShade]})}},Ky=BE(EM);function $M(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function kM(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var RM=function(){function e(r){var n=this;this._insertTag=function(o){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,i),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(kM(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=$M(o);try{i.insertRule(n,i.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e}(),nr="-ms-",Pd="-moz-",Ve="-webkit-",WE="comm",Yy="rule",Xy="decl",TM="@import",HE="@keyframes",IM="@layer",DM=Math.abs,$h=String.fromCharCode,NM=Object.assign;function AM(e,t){return Yt(e,0)^45?(((t<<2^Yt(e,0))<<2^Yt(e,1))<<2^Yt(e,2))<<2^Yt(e,3):0}function qE(e){return e.trim()}function MM(e,t){return(e=t.exec(e))?e[0]:e}function Be(e,t,r){return e.replace(t,r)}function sv(e,t){return e.indexOf(t)}function Yt(e,t){return e.charCodeAt(t)|0}function ql(e,t,r){return e.slice(t,r)}function Gn(e){return e.length}function Jy(e){return e.length}function ou(e,t){return t.push(e),e}function LM(e,t){return e.map(t).join("")}var kh=1,ps=1,GE=0,Tr=0,It=0,Is="";function Rh(e,t,r,n,o,i,a){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:kh,column:ps,length:a,return:""}}function Qs(e,t){return NM(Rh("",null,null,"",null,null,0),e,{length:-e.length},t)}function zM(){return It}function FM(){return It=Tr>0?Yt(Is,--Tr):0,ps--,It===10&&(ps=1,kh--),It}function Gr(){return It=Tr<GE?Yt(Is,Tr++):0,ps++,It===10&&(ps=1,kh++),It}function Jn(){return Yt(Is,Tr)}function rd(){return Tr}function Pc(e,t){return ql(Is,e,t)}function Gl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function QE(e){return kh=ps=1,GE=Gn(Is=e),Tr=0,[]}function KE(e){return Is="",e}function nd(e){return qE(Pc(Tr-1,lv(e===91?e+2:e===40?e+1:e)))}function VM(e){for(;(It=Jn())&&It<33;)Gr();return Gl(e)>2||Gl(It)>3?"":" "}function BM(e,t){for(;--t&&Gr()&&!(It<48||It>102||It>57&&It<65||It>70&&It<97););return Pc(e,rd()+(t<6&&Jn()==32&&Gr()==32))}function lv(e){for(;Gr();)switch(It){case e:return Tr;case 34:case 39:e!==34&&e!==39&&lv(It);break;case 40:e===41&&lv(e);break;case 92:Gr();break}return Tr}function UM(e,t){for(;Gr()&&e+It!==57;)if(e+It===84&&Jn()===47)break;return"/*"+Pc(t,Tr-1)+"*"+$h(e===47?e:Gr())}function WM(e){for(;!Gl(Jn());)Gr();return Pc(e,Tr)}function HM(e){return KE(od("",null,null,null,[""],e=QE(e),0,[0],e))}function od(e,t,r,n,o,i,a,l,c){for(var u=0,d=0,p=a,h=0,m=0,g=0,v=1,_=1,y=1,x=0,w="",b=o,j=i,C=n,P=w;_;)switch(g=x,x=Gr()){case 40:if(g!=108&&Yt(P,p-1)==58){sv(P+=Be(nd(x),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:P+=nd(x);break;case 9:case 10:case 13:case 32:P+=VM(g);break;case 92:P+=BM(rd()-1,7);continue;case 47:switch(Jn()){case 42:case 47:ou(qM(UM(Gr(),rd()),t,r),c);break;default:P+="/"}break;case 123*v:l[u++]=Gn(P)*y;case 125*v:case 59:case 0:switch(x){case 0:case 125:_=0;case 59+d:y==-1&&(P=Be(P,/\f/g,"")),m>0&&Gn(P)-p&&ou(m>32?B1(P+";",n,r,p-1):B1(Be(P," ","")+";",n,r,p-2),c);break;case 59:P+=";";default:if(ou(C=V1(P,t,r,u,d,o,l,w,b=[],j=[],p),i),x===123)if(d===0)od(P,t,C,C,b,i,p,l,j);else switch(h===99&&Yt(P,3)===110?100:h){case 100:case 108:case 109:case 115:od(e,C,C,n&&ou(V1(e,C,C,0,0,o,l,w,o,b=[],p),j),o,j,p,l,n?b:j);break;default:od(P,C,C,C,[""],j,0,l,j)}}u=d=m=0,v=y=1,w=P="",p=a;break;case 58:p=1+Gn(P),m=g;default:if(v<1){if(x==123)--v;else if(x==125&&v++==0&&FM()==125)continue}switch(P+=$h(x),x*v){case 38:y=d>0?1:(P+="\f",-1);break;case 44:l[u++]=(Gn(P)-1)*y,y=1;break;case 64:Jn()===45&&(P+=nd(Gr())),h=Jn(),d=p=Gn(w=P+=WM(rd())),x++;break;case 45:g===45&&Gn(P)==2&&(v=0)}}return i}function V1(e,t,r,n,o,i,a,l,c,u,d){for(var p=o-1,h=o===0?i:[""],m=Jy(h),g=0,v=0,_=0;g<n;++g)for(var y=0,x=ql(e,p+1,p=DM(v=a[g])),w=e;y<m;++y)(w=qE(v>0?h[y]+" "+x:Be(x,/&\f/g,h[y])))&&(c[_++]=w);return Rh(e,t,r,o===0?Yy:l,c,u,d)}function qM(e,t,r){return Rh(e,t,r,WE,$h(zM()),ql(e,2,-2),0)}function B1(e,t,r,n){return Rh(e,t,r,Xy,ql(e,0,n),ql(e,n+1,-1),n)}function rs(e,t){for(var r="",n=Jy(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function GM(e,t,r,n){switch(e.type){case IM:if(e.children.length)break;case TM:case Xy:return e.return=e.return||e.value;case WE:return"";case HE:return e.return=e.value+"{"+rs(e.children,n)+"}";case Yy:e.value=e.props.join(",")}return Gn(r=rs(e.children,n))?e.return=e.value+"{"+r+"}":""}function QM(e){var t=Jy(e);return function(r,n,o,i){for(var a="",l=0;l<t;l++)a+=e[l](r,n,o,i)||"";return a}}function KM(e){return function(t){t.root||(t=t.return)&&e(t)}}var U1=function(t){var r=new WeakMap;return function(n){if(r.has(n))return r.get(n);var o=t(n);return r.set(n,o),o}};function YM(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var XM=function(t,r,n){for(var o=0,i=0;o=i,i=Jn(),o===38&&i===12&&(r[n]=1),!Gl(i);)Gr();return Pc(t,Tr)},JM=function(t,r){var n=-1,o=44;do switch(Gl(o)){case 0:o===38&&Jn()===12&&(r[n]=1),t[n]+=XM(Tr-1,r,n);break;case 2:t[n]+=nd(o);break;case 4:if(o===44){t[++n]=Jn()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=$h(o)}while(o=Gr());return t},ZM=function(t,r){return KE(JM(QE(t),r))},W1=new WeakMap,e6=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,o=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!W1.get(n))&&!o){W1.set(t,!0);for(var i=[],a=ZM(r,i),l=n.props,c=0,u=0;c<a.length;c++)for(var d=0;d<l.length;d++,u++)t.props[u]=i[c]?a[c].replace(/&\f/g,l[d]):l[d]+" "+a[c]}}},t6=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function YE(e,t){switch(AM(e,t)){case 5103:return Ve+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ve+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ve+e+Pd+e+nr+e+e;case 6828:case 4268:return Ve+e+nr+e+e;case 6165:return Ve+e+nr+"flex-"+e+e;case 5187:return Ve+e+Be(e,/(\w+).+(:[^]+)/,Ve+"box-$1$2"+nr+"flex-$1$2")+e;case 5443:return Ve+e+nr+"flex-item-"+Be(e,/flex-|-self/,"")+e;case 4675:return Ve+e+nr+"flex-line-pack"+Be(e,/align-content|flex-|-self/,"")+e;case 5548:return Ve+e+nr+Be(e,"shrink","negative")+e;case 5292:return Ve+e+nr+Be(e,"basis","preferred-size")+e;case 6060:return Ve+"box-"+Be(e,"-grow","")+Ve+e+nr+Be(e,"grow","positive")+e;case 4554:return Ve+Be(e,/([^-])(transform)/g,"$1"+Ve+"$2")+e;case 6187:return Be(Be(Be(e,/(zoom-|grab)/,Ve+"$1"),/(image-set)/,Ve+"$1"),e,"")+e;case 5495:case 3959:return Be(e,/(image-set\([^]*)/,Ve+"$1$`$1");case 4968:return Be(Be(e,/(.+:)(flex-)?(.*)/,Ve+"box-pack:$3"+nr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ve+e+e;case 4095:case 3583:case 4068:case 2532:return Be(e,/(.+)-inline(.+)/,Ve+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Gn(e)-1-t>6)switch(Yt(e,t+1)){case 109:if(Yt(e,t+4)!==45)break;case 102:return Be(e,/(.+:)(.+)-([^]+)/,"$1"+Ve+"$2-$3$1"+Pd+(Yt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~sv(e,"stretch")?YE(Be(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Yt(e,t+1)!==115)break;case 6444:switch(Yt(e,Gn(e)-3-(~sv(e,"!important")&&10))){case 107:return Be(e,":",":"+Ve)+e;case 101:return Be(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ve+(Yt(e,14)===45?"inline-":"")+"box$3$1"+Ve+"$2$3$1"+nr+"$2box$3")+e}break;case 5936:switch(Yt(e,t+11)){case 114:return Ve+e+nr+Be(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ve+e+nr+Be(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ve+e+nr+Be(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ve+e+nr+e+e}return e}var r6=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case Xy:t.return=YE(t.value,t.length);break;case HE:return rs([Qs(t,{value:Be(t.value,"@","@"+Ve)})],o);case Yy:if(t.length)return LM(t.props,function(i){switch(MM(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return rs([Qs(t,{props:[Be(i,/:(read-\w+)/,":"+Pd+"$1")]})],o);case"::placeholder":return rs([Qs(t,{props:[Be(i,/:(plac\w+)/,":"+Ve+"input-$1")]}),Qs(t,{props:[Be(i,/:(plac\w+)/,":"+Pd+"$1")]}),Qs(t,{props:[Be(i,/:(plac\w+)/,nr+"input-$1")]})],o)}return""})}},n6=[r6],XE=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(v){var _=v.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var o=t.stylisPlugins||n6,i={},a,l=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(v){for(var _=v.getAttribute("data-emotion").split(" "),y=1;y<_.length;y++)i[_[y]]=!0;l.push(v)});var c,u=[e6,t6];{var d,p=[GM,KM(function(v){d.insert(v)})],h=QM(u.concat(o,p)),m=function(_){return rs(HM(_),h)};c=function(_,y,x,w){d=x,m(_?_+"{"+y.styles+"}":y.styles),w&&(g.inserted[y.name]=!0)}}var g={key:r,sheet:new RM({key:r,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return g.sheet.hydrate(l),g};function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},st.apply(this,arguments)}var JE={exports:{}},qe={};/** @license React v16.13.1
58
+ * react-is.production.min.js
59
+ *
60
+ * Copyright (c) Facebook, Inc. and its affiliates.
61
+ *
62
+ * This source code is licensed under the MIT license found in the
63
+ * LICENSE file in the root directory of this source tree.
64
+ */var Wt=typeof Symbol=="function"&&Symbol.for,Zy=Wt?Symbol.for("react.element"):60103,e0=Wt?Symbol.for("react.portal"):60106,Th=Wt?Symbol.for("react.fragment"):60107,Ih=Wt?Symbol.for("react.strict_mode"):60108,Dh=Wt?Symbol.for("react.profiler"):60114,Nh=Wt?Symbol.for("react.provider"):60109,Ah=Wt?Symbol.for("react.context"):60110,t0=Wt?Symbol.for("react.async_mode"):60111,Mh=Wt?Symbol.for("react.concurrent_mode"):60111,Lh=Wt?Symbol.for("react.forward_ref"):60112,zh=Wt?Symbol.for("react.suspense"):60113,o6=Wt?Symbol.for("react.suspense_list"):60120,Fh=Wt?Symbol.for("react.memo"):60115,Vh=Wt?Symbol.for("react.lazy"):60116,i6=Wt?Symbol.for("react.block"):60121,a6=Wt?Symbol.for("react.fundamental"):60117,s6=Wt?Symbol.for("react.responder"):60118,l6=Wt?Symbol.for("react.scope"):60119;function Xr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Zy:switch(e=e.type,e){case t0:case Mh:case Th:case Dh:case Ih:case zh:return e;default:switch(e=e&&e.$$typeof,e){case Ah:case Lh:case Vh:case Fh:case Nh:return e;default:return t}}case e0:return t}}}function ZE(e){return Xr(e)===Mh}qe.AsyncMode=t0;qe.ConcurrentMode=Mh;qe.ContextConsumer=Ah;qe.ContextProvider=Nh;qe.Element=Zy;qe.ForwardRef=Lh;qe.Fragment=Th;qe.Lazy=Vh;qe.Memo=Fh;qe.Portal=e0;qe.Profiler=Dh;qe.StrictMode=Ih;qe.Suspense=zh;qe.isAsyncMode=function(e){return ZE(e)||Xr(e)===t0};qe.isConcurrentMode=ZE;qe.isContextConsumer=function(e){return Xr(e)===Ah};qe.isContextProvider=function(e){return Xr(e)===Nh};qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zy};qe.isForwardRef=function(e){return Xr(e)===Lh};qe.isFragment=function(e){return Xr(e)===Th};qe.isLazy=function(e){return Xr(e)===Vh};qe.isMemo=function(e){return Xr(e)===Fh};qe.isPortal=function(e){return Xr(e)===e0};qe.isProfiler=function(e){return Xr(e)===Dh};qe.isStrictMode=function(e){return Xr(e)===Ih};qe.isSuspense=function(e){return Xr(e)===zh};qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Th||e===Mh||e===Dh||e===Ih||e===zh||e===o6||typeof e=="object"&&e!==null&&(e.$$typeof===Vh||e.$$typeof===Fh||e.$$typeof===Nh||e.$$typeof===Ah||e.$$typeof===Lh||e.$$typeof===a6||e.$$typeof===s6||e.$$typeof===l6||e.$$typeof===i6)};qe.typeOf=Xr;JE.exports=qe;var c6=JE.exports,e$=c6,u6={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},d6={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},t$={};t$[e$.ForwardRef]=u6;t$[e$.Memo]=d6;var f6=!0;function p6(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):n+=o+" "}),n}var h6=function(t,r,n){var o=t.key+"-"+r.name;(n===!1||f6===!1)&&t.registered[o]===void 0&&(t.registered[o]=r.styles)},r$=function(t,r,n){h6(t,r,n);var o=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+o:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function m6(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var g6={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},v6=/[A-Z]|^ms/g,y6=/_EMO_([^_]+?)_([^]*?)_EMO_/g,n$=function(t){return t.charCodeAt(1)===45},H1=function(t){return t!=null&&typeof t!="boolean"},Qm=YM(function(e){return n$(e)?e:e.replace(v6,"-$&").toLowerCase()}),q1=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(y6,function(n,o,i){return Qn={name:o,styles:i,next:Qn},o})}return g6[t]!==1&&!n$(t)&&typeof r=="number"&&r!==0?r+"px":r};function Ql(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return Qn={name:r.name,styles:r.styles,next:Qn},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)Qn={name:n.name,styles:n.styles,next:Qn},n=n.next;var o=r.styles+";";return o}return x6(e,t,r)}case"function":{if(e!==void 0){var i=Qn,a=r(e);return Qn=i,Ql(e,t,a)}break}}if(t==null)return r;var l=t[r];return l!==void 0?l:r}function x6(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Ql(e,t,r[o])+";";else for(var i in r){var a=r[i];if(typeof a!="object")t!=null&&t[a]!==void 0?n+=i+"{"+t[a]+"}":H1(a)&&(n+=Qm(i)+":"+q1(i,a)+";");else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)H1(a[l])&&(n+=Qm(i)+":"+q1(i,a[l])+";");else{var c=Ql(e,t,a);switch(i){case"animation":case"animationName":{n+=Qm(i)+":"+c+";";break}default:n+=i+"{"+c+"}"}}}return n}var G1=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Qn,r0=function(t,r,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var o=!0,i="";Qn=void 0;var a=t[0];a==null||a.raw===void 0?(o=!1,i+=Ql(n,r,a)):i+=a[0];for(var l=1;l<t.length;l++)i+=Ql(n,r,t[l]),o&&(i+=a[l]);G1.lastIndex=0;for(var c="",u;(u=G1.exec(i))!==null;)c+="-"+u[1];var d=m6(i)+c;return{name:d,styles:i,next:Qn}},w6=Hl.useInsertionEffect?Hl.useInsertionEffect:!1,Q1=w6||f.useLayoutEffect,o$=f.createContext(typeof HTMLElement<"u"?XE({key:"css"}):null);o$.Provider;var b6=function(t){return f.forwardRef(function(r,n){var o=f.useContext(o$);return t(r,o,n)})},cv=f.createContext({}),_6=function(t,r){if(typeof r=="function"){var n=r(t);return n}return st({},t,r)},S6=U1(function(e){return U1(function(t){return _6(e,t)})}),P6=function(t){var r=f.useContext(cv);return t.theme!==r&&(r=S6(r)(t.theme)),f.createElement(cv.Provider,{value:r},t.children)},jc=b6(function(e,t){var r=e.styles,n=r0([r],void 0,f.useContext(cv)),o=f.useRef();return Q1(function(){var i=t.key+"-global",a=new t.sheet.constructor({key:i,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),l=!1,c=document.querySelector('style[data-emotion="'+i+" "+n.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),c!==null&&(l=!0,c.setAttribute("data-emotion",i),a.hydrate([c])),o.current=[a,l],function(){a.flush()}},[t]),Q1(function(){var i=o.current,a=i[0],l=i[1];if(l){i[1]=!1;return}if(n.next!==void 0&&r$(t,n.next,!0),a.tags.length){var c=a.tags[a.tags.length-1].nextElementSibling;a.before=c,a.flush()}t.insert("",n,a,!1)},[t,n.name]),null});function j6(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return r0(t)}var O6=Object.defineProperty,C6=Object.defineProperties,E6=Object.getOwnPropertyDescriptors,K1=Object.getOwnPropertySymbols,$6=Object.prototype.hasOwnProperty,k6=Object.prototype.propertyIsEnumerable,Y1=(e,t,r)=>t in e?O6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R6=(e,t)=>{for(var r in t||(t={}))$6.call(t,r)&&Y1(e,r,t[r]);if(K1)for(var r of K1(t))k6.call(t,r)&&Y1(e,r,t[r]);return e},T6=(e,t)=>C6(e,E6(t));function I6({theme:e}){return S.createElement(jc,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:T6(R6({},e.fn.fontStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function Ks(e,t,r,n=O){Object.keys(t).forEach(o=>{e[`--mantine-${r}-${o}`]=n(t[o])})}function D6({theme:e}){const t={"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-transition-timing-function":e.transitionTimingFunction,"--mantine-line-height":`${e.lineHeight}`,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":`${e.headings.fontWeight}`};Ks(t,e.shadows,"shadow"),Ks(t,e.fontSizes,"font-size"),Ks(t,e.radius,"radius"),Ks(t,e.spacing,"spacing"),Ks(t,e.breakpoints,"breakpoints",sr),Object.keys(e.colors).forEach(n=>{e.colors[n].forEach((o,i)=>{t[`--mantine-color-${n}-${i}`]=o})});const r=e.headings.sizes;return Object.keys(r).forEach(n=>{t[`--mantine-${n}-font-size`]=r[n].fontSize,t[`--mantine-${n}-line-height`]=`${r[n].lineHeight}`}),S.createElement(jc,{styles:{":root":t}})}var N6=Object.defineProperty,A6=Object.defineProperties,M6=Object.getOwnPropertyDescriptors,X1=Object.getOwnPropertySymbols,L6=Object.prototype.hasOwnProperty,z6=Object.prototype.propertyIsEnumerable,J1=(e,t,r)=>t in e?N6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vn=(e,t)=>{for(var r in t||(t={}))L6.call(t,r)&&J1(e,r,t[r]);if(X1)for(var r of X1(t))z6.call(t,r)&&J1(e,r,t[r]);return e},Km=(e,t)=>A6(e,M6(t));function F6(e,t){var r;if(!t)return e;const n=Object.keys(e).reduce((o,i)=>{if(i==="headings"&&t.headings){const a=t.headings.sizes?Object.keys(e.headings.sizes).reduce((l,c)=>(l[c]=Vn(Vn({},e.headings.sizes[c]),t.headings.sizes[c]),l),{}):e.headings.sizes;return Km(Vn({},o),{headings:Km(Vn(Vn({},e.headings),t.headings),{sizes:a})})}if(i==="breakpoints"&&t.breakpoints){const a=Vn(Vn({},e.breakpoints),t.breakpoints);return Km(Vn({},o),{breakpoints:Object.fromEntries(Object.entries(a).sort((l,c)=>wr(l[1])-wr(c[1])))})}return o[i]=typeof t[i]=="object"?Vn(Vn({},e[i]),t[i]):typeof t[i]=="number"||typeof t[i]=="boolean"||typeof t[i]=="function"?t[i]:t[i]||e[i],o},{});if(t!=null&&t.fontFamily&&!((r=t==null?void 0:t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),!(n.primaryColor in n.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return n}function V6(e,t){return BE(F6(e,t))}function i$(e){return Object.keys(e).reduce((t,r)=>(e[r]!==void 0&&(t[r]=e[r]),t),{})}const B6={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:`${O(1)} dotted ButtonText`},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"}};function U6(){return S.createElement(jc,{styles:B6})}var W6=Object.defineProperty,Z1=Object.getOwnPropertySymbols,H6=Object.prototype.hasOwnProperty,q6=Object.prototype.propertyIsEnumerable,ew=(e,t,r)=>t in e?W6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kl=(e,t)=>{for(var r in t||(t={}))H6.call(t,r)&&ew(e,r,t[r]);if(Z1)for(var r of Z1(t))q6.call(t,r)&&ew(e,r,t[r]);return e};const jd=f.createContext({theme:Ky});function Ht(){var e;return((e=f.useContext(jd))==null?void 0:e.theme)||Ky}function G6(e){const t=Ht(),r=n=>{var o,i,a,l;return{styles:((o=t.components[n])==null?void 0:o.styles)||{},classNames:((i=t.components[n])==null?void 0:i.classNames)||{},variants:(a=t.components[n])==null?void 0:a.variants,sizes:(l=t.components[n])==null?void 0:l.sizes}};return Array.isArray(e)?e.map(r):[r(e)]}function a$(){var e;return(e=f.useContext(jd))==null?void 0:e.emotionCache}function H(e,t,r){var n;const o=Ht(),i=(n=o.components[e])==null?void 0:n.defaultProps,a=typeof i=="function"?i(o):i;return kl(kl(kl({},t),a),i$(r))}function s$({theme:e,emotionCache:t,withNormalizeCSS:r=!1,withGlobalStyles:n=!1,withCSSVariables:o=!1,inherit:i=!1,children:a}){const l=f.useContext(jd),c=V6(Ky,i?kl(kl({},l.theme),e):e);return S.createElement(P6,{theme:c},S.createElement(jd.Provider,{value:{theme:c,emotionCache:t}},r&&S.createElement(U6,null),n&&S.createElement(I6,{theme:c}),o&&S.createElement(D6,{theme:c}),typeof c.globalStyles=="function"&&S.createElement(jc,{styles:c.globalStyles(c)}),a))}s$.displayName="@mantine/core/MantineProvider";const Q6={app:100,modal:200,popover:300,overlay:400,max:9999};function Dn(e){return Q6[e]}function K6(e,t){const r=f.useRef();return(!r.current||t.length!==r.current.prevDeps.length||r.current.prevDeps.map((n,o)=>n===t[o]).indexOf(!1)>=0)&&(r.current={v:e(),prevDeps:[...t]}),r.current.v}const Y6=XE({key:"mantine",prepend:!0});function X6(){return a$()||Y6}var J6=Object.defineProperty,tw=Object.getOwnPropertySymbols,Z6=Object.prototype.hasOwnProperty,eL=Object.prototype.propertyIsEnumerable,rw=(e,t,r)=>t in e?J6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tL=(e,t)=>{for(var r in t||(t={}))Z6.call(t,r)&&rw(e,r,t[r]);if(tw)for(var r of tw(t))eL.call(t,r)&&rw(e,r,t[r]);return e};const Ym="ref";function rL(e){let t;if(e.length!==1)return{args:e,ref:t};const[r]=e;if(!(r instanceof Object))return{args:e,ref:t};if(!(Ym in r))return{args:e,ref:t};t=r[Ym];const n=tL({},r);return delete n[Ym],{args:[n],ref:t}}const{cssFactory:nL}=(()=>{function e(r,n,o){const i=[],a=p6(r,i,o);return i.length<2?o:a+n(i)}function t(r){const{cache:n}=r,o=(...a)=>{const{ref:l,args:c}=rL(a),u=r0(c,n.registered);return r$(n,u,!1),`${n.key}-${u.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...a)=>e(n.registered,o,LE(a))}}return{cssFactory:t}})();function l$(){const e=X6();return K6(()=>nL({cache:e}),[e])}function oL({cx:e,classes:t,context:r,classNames:n,name:o,cache:i}){const a=r.reduce((l,c)=>(Object.keys(c.classNames).forEach(u=>{typeof l[u]!="string"?l[u]=`${c.classNames[u]}`:l[u]=`${l[u]} ${c.classNames[u]}`}),l),{});return Object.keys(t).reduce((l,c)=>(l[c]=e(t[c],a[c],n!=null&&n[c],Array.isArray(o)?o.filter(Boolean).map(u=>`${(i==null?void 0:i.key)||"mantine"}-${u}-${c}`).join(" "):o?`${(i==null?void 0:i.key)||"mantine"}-${o}-${c}`:null),l),{})}var iL=Object.defineProperty,nw=Object.getOwnPropertySymbols,aL=Object.prototype.hasOwnProperty,sL=Object.prototype.propertyIsEnumerable,ow=(e,t,r)=>t in e?iL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xm=(e,t)=>{for(var r in t||(t={}))aL.call(t,r)&&ow(e,r,t[r]);if(nw)for(var r of nw(t))sL.call(t,r)&&ow(e,r,t[r]);return e};function uv(e,t){return t&&Object.keys(t).forEach(r=>{e[r]?e[r]=Xm(Xm({},e[r]),t[r]):e[r]=Xm({},t[r])}),e}function iw(e,t,r,n){const o=i=>typeof i=="function"?i(t,r||{},n):i||{};return Array.isArray(e)?e.map(i=>o(i.styles)).reduce((i,a)=>uv(i,a),{}):o(e)}function lL({ctx:e,theme:t,params:r,variant:n,size:o}){return e.reduce((i,a)=>(a.variants&&n in a.variants&&uv(i,a.variants[n](t,r,{variant:n,size:o})),a.sizes&&o in a.sizes&&uv(i,a.sizes[o](t,r,{variant:n,size:o})),i),{})}function W(e){const t=typeof e=="function"?e:()=>e;function r(n,o){const i=Ht(),a=G6(o==null?void 0:o.name),l=a$(),c={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:u,cx:d}=l$(),p=t(i,n,c),h=iw(o==null?void 0:o.styles,i,n,c),m=iw(a,i,n,c),g=lL({ctx:a,theme:i,params:n,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),v=Object.fromEntries(Object.keys(p).map(_=>{const y=d({[u(p[_])]:!(o!=null&&o.unstyled)},u(g[_]),u(m[_]),u(h[_]));return[_,y]}));return{classes:oL({cx:d,classes:v,context:a,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:d,theme:i}}return r}function Vt(e){return`___ref-${e||""}`}function c$({styles:e}){const t=Ht();return S.createElement(jc,{styles:j6(typeof e=="function"?e(t):e)})}var cL=Object.defineProperty,uL=Object.defineProperties,dL=Object.getOwnPropertyDescriptors,aw=Object.getOwnPropertySymbols,fL=Object.prototype.hasOwnProperty,pL=Object.prototype.propertyIsEnumerable,sw=(e,t,r)=>t in e?cL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ys=(e,t)=>{for(var r in t||(t={}))fL.call(t,r)&&sw(e,r,t[r]);if(aw)for(var r of aw(t))pL.call(t,r)&&sw(e,r,t[r]);return e},Xs=(e,t)=>uL(e,dL(t));const Js={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${O(10)})`},transitionProperty:"transform, opacity"},iu={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${O(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${O(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${O(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${O(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Xs(Ys({},Js),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Xs(Ys({},Js),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Xs(Ys({},Js),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Xs(Ys({},Js),{common:{transformOrigin:"top left"}}),"pop-top-right":Xs(Ys({},Js),{common:{transformOrigin:"top right"}})},lw=["mousedown","touchstart"];function hL(e,t,r){const n=f.useRef();return f.useEffect(()=>{const o=i=>{const{target:a}=i??{};if(Array.isArray(r)){const l=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";r.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else n.current&&!n.current.contains(a)&&e()};return(t||lw).forEach(i=>document.addEventListener(i,o)),()=>{(t||lw).forEach(i=>document.removeEventListener(i,o))}},[n,e,r]),n}function mL({timeout:e=2e3}={}){const[t,r]=f.useState(null),[n,o]=f.useState(!1),[i,a]=f.useState(null),l=d=>{clearTimeout(i),a(setTimeout(()=>o(!1),e)),o(d)};return{copy:d=>{"clipboard"in navigator?navigator.clipboard.writeText(d).then(()=>l(!0)).catch(p=>r(p)):r(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),r(null),clearTimeout(i)},error:t,copied:n}}function gL(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function vL(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function yL(e,t,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){const[n,o]=f.useState(r?t:vL(e,t)),i=f.useRef();return f.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),gL(i.current,a=>o(a.matches))},[e]),n}const u$=typeof document<"u"?f.useLayoutEffect:f.useEffect;function cn(e,t){const r=f.useRef(!1);f.useEffect(()=>()=>{r.current=!1},[]),f.useEffect(()=>{if(r.current)return e();r.current=!0},t)}function d$({opened:e,shouldReturnFocus:t=!0}){const r=f.useRef(),n=()=>{var o;r.current&&"focus"in r.current&&typeof r.current.focus=="function"&&((o=r.current)==null||o.focus({preventScroll:!0}))};return cn(()=>{let o=-1;const i=a=>{a.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?r.current=document.activeElement:t&&(o=window.setTimeout(n,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),n}const xL=/input|select|textarea|button|object/,f$="a, input, select, textarea, button, object, [tabindex]";function wL(e){return e.style.display==="none"}function bL(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(wL(r))return!1;r=r.parentNode}return!0}function p$(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function dv(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(p$(e));return(xL.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&bL(e)}function h$(e){const t=p$(e);return(Number.isNaN(t)||t>=0)&&dv(e)}function _L(e){return Array.from(e.querySelectorAll(f$)).filter(h$)}function SL(e,t){const r=_L(e);if(!r.length){t.preventDefault();return}const n=r[t.shiftKey?0:r.length-1],o=e.getRootNode();if(!(n===o.activeElement||e===o.activeElement))return;t.preventDefault();const a=r[t.shiftKey?r.length-1:0];a&&a.focus()}function Bh(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function PL(e,t="body > :not(script)"){const r=Bh(),n=Array.from(document.querySelectorAll(t)).map(o=>{var i;if((i=o==null?void 0:o.shadowRoot)!=null&&i.contains(e)||o.contains(e))return;const a=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),c=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",r),a===null||a==="false"?o.setAttribute("aria-hidden","true"):!l&&!c&&o.setAttribute("data-hidden",a),{node:o,ariaHidden:l||null}});return()=>{n.forEach(o=>{!o||r!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function jL(e=!0){const t=f.useRef(),r=f.useRef(null),n=i=>{let a=i.querySelector("[data-autofocus]");if(!a){const l=Array.from(i.querySelectorAll(f$));a=l.find(h$)||l.find(dv)||null,!a&&dv(i)&&(a=i)}a&&a.focus({preventScroll:!0})},o=f.useCallback(i=>{if(e){if(i===null){r.current&&(r.current(),r.current=null);return}r.current=PL(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),t.current=i):t.current=null)}},[e]);return f.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const i=a=>{a.key==="Tab"&&t.current&&SL(t.current,a)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),r.current&&r.current()}},[e]),o}const OL=e=>(e+1)%1e6;function CL(){const[,e]=f.useReducer(OL,0);return e}const EL=S.useId||(()=>{});function $L(){const e=EL();return e?`mantine-${e.replace(/:/g,"")}`:""}function Ar(e){const t=$L(),[r,n]=f.useState(t);return u$(()=>{n(Bh())},[]),typeof e=="string"?e:typeof window>"u"?t:r}function fv(e,t,r){f.useEffect(()=>(window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)),[e,t])}function m$(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function kL(...e){return t=>{e.forEach(r=>m$(r,t))}}function Ds(...e){return f.useCallback(kL(...e),e)}function Ir({value:e,defaultValue:t,finalValue:r,onChange:n=()=>{}}){const[o,i]=f.useState(t!==void 0?t:r),a=l=>{i(l),n==null||n(l)};return e!==void 0?[e,n,!0]:[o,a,!1]}function Qo(e,t){const r=t-e+1;return Array.from({length:r},(n,o)=>o+e)}const au="dots";function RL({total:e,siblings:t=1,boundaries:r=1,page:n,initialPage:o=1,onChange:i}){const a=Math.max(Math.trunc(e),0),[l,c]=Ir({value:n,onChange:i,defaultValue:o,finalValue:o}),u=v=>{v<=0?c(1):v>a?c(a):c(v)},d=()=>u(l+1),p=()=>u(l-1),h=()=>u(1),m=()=>u(a);return{range:f.useMemo(()=>{if(t*2+3+r*2>=a)return Qo(1,a);const _=Math.max(l-t,r),y=Math.min(l+t,a-r),x=_>r+2,w=y<a-(r+1);if(!x&&w){const b=t*2+r+2;return[...Qo(1,b),au,...Qo(a-(r-1),a)]}if(x&&!w){const b=r+1+2*t;return[...Qo(1,r),au,...Qo(a-b,a)]}return[...Qo(1,r),au,...Qo(_,y),au,...Qo(a-r+1,a)]},[a,t,l]),active:l,setPage:u,next:d,previous:p,first:h,last:m}}function TL({initialValues:e=[],limit:t}){const[{state:r,queue:n},o]=f.useState({state:e.slice(0,t),queue:e.slice(t)});return{state:r,queue:n,add:(...c)=>o(u=>{const d=[...u.state,...u.queue,...c];return{state:d.slice(0,t),queue:d.slice(t)}}),update:c=>o(u=>{const d=c([...u.state,...u.queue]);return{state:d.slice(0,t),queue:d.slice(t)}}),cleanQueue:()=>o(c=>({state:c.state,queue:[]}))}}function Uh(e,t){return yL("(prefers-reduced-motion: reduce)",e,t)}const IL=e=>e<.5?2*e*e:-1+(4-2*e)*e,DL=({axis:e,target:t,parent:r,alignment:n,offset:o,isList:i})=>{if(!t||!r&&typeof document>"u")return 0;const a=!!r,c=(r||document.body).getBoundingClientRect(),u=t.getBoundingClientRect(),d=p=>u[p]-c[p];if(e==="y"){const p=d("top");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.height*(i?0:1)||!i?m:0}const h=a?c.height:window.innerHeight;if(n==="end"){const m=p+o-h+u.height;return m>=-u.height*(i?0:1)||!i?m:0}return n==="center"?p-h/2+u.height/2:0}if(e==="x"){const p=d("left");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.width||!i?m:0}const h=a?c.width:window.innerWidth;if(n==="end"){const m=p+o-h+u.width;return m>=-u.width||!i?m:0}return n==="center"?p-h/2+u.width/2:0}return 0},NL=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const r=e==="y"?"scrollTop":"scrollLeft";if(t)return t[r];const{body:n,documentElement:o}=document;return n[r]+o[r]},AL=({axis:e,parent:t,distance:r})=>{if(!t&&typeof document>"u")return;const n=e==="y"?"scrollTop":"scrollLeft";if(t)t[n]=r;else{const{body:o,documentElement:i}=document;o[n]=r,i[n]=r}};function ML({duration:e=1250,axis:t="y",onScrollFinish:r,easing:n=IL,offset:o=0,cancelable:i=!0,isList:a=!1}={}){const l=f.useRef(0),c=f.useRef(0),u=f.useRef(!1),d=f.useRef(null),p=f.useRef(null),h=Uh(),m=()=>{l.current&&cancelAnimationFrame(l.current)},g=f.useCallback(({alignment:_="start"}={})=>{var y;u.current=!1,l.current&&m();const x=(y=NL({parent:d.current,axis:t}))!=null?y:0,w=DL({parent:d.current,target:p.current,axis:t,alignment:_,offset:o,isList:a})-(d.current?0:x);function b(){c.current===0&&(c.current=performance.now());const C=performance.now()-c.current,P=h||e===0?1:C/e,E=x+w*n(P);AL({parent:d.current,axis:t,distance:E}),!u.current&&P<1?l.current=requestAnimationFrame(b):(typeof r=="function"&&r(),c.current=0,l.current=0,m())}b()},[t,e,n,a,o,r,h]),v=()=>{i&&(u.current=!0)};return fv("wheel",v,{passive:!0}),fv("touchmove",v,{passive:!0}),f.useEffect(()=>m,[]),{scrollableRef:d,targetRef:p,scrollIntoView:g,cancel:m}}function LL(e=!1,t){const{onOpen:r,onClose:n}=t||{},[o,i]=f.useState(e),a=f.useCallback(()=>{i(u=>u||(r==null||r(),!0))},[r]),l=f.useCallback(()=>{i(u=>u&&(n==null||n(),!1))},[n]),c=f.useCallback(()=>{o?l():a()},[l,a,o]);return[o,{open:a,close:l,toggle:c}]}function cw(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var uw=Object.getOwnPropertySymbols,zL=Object.prototype.hasOwnProperty,FL=Object.prototype.propertyIsEnumerable,VL=(e,t)=>{var r={};for(var n in e)zL.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&uw)for(var n of uw(e))t.indexOf(n)<0&&FL.call(e,n)&&(r[n]=e[n]);return r};function ao(e){const t=e,{m:r,mx:n,my:o,mt:i,mb:a,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:g,pr:v,bg:_,c:y,opacity:x,ff:w,fz:b,fw:j,lts:C,ta:P,lh:E,fs:k,tt:$,td:I,w:R,miw:N,maw:M,h:L,mih:Q,mah:G,bgsz:T,bgp:F,bgr:V,bga:X,pos:J,top:_e,left:Se,bottom:Xe,right:Le,inset:gt,display:Nt}=t,ke=VL(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:i$({m:r,mx:n,my:o,mt:i,mb:a,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:g,pr:v,bg:_,c:y,opacity:x,ff:w,fz:b,fw:j,lts:C,ta:P,lh:E,fs:k,tt:$,td:I,w:R,miw:N,maw:M,h:L,mih:Q,mah:G,bgsz:T,bgp:F,bgr:V,bga:X,pos:J,top:_e,left:Se,bottom:Xe,right:Le,inset:gt,display:Nt}),rest:ke}}function BL(e,t){const r=Object.keys(e).filter(n=>n!=="base").sort((n,o)=>wr(A({size:n,sizes:t.breakpoints}))-wr(A({size:o,sizes:t.breakpoints})));return"base"in e?["base",...r]:r}function UL({value:e,theme:t,getValue:r,property:n}){if(e==null)return;if(typeof e=="object")return BL(e,t).reduce((a,l)=>{if(l==="base"&&e.base!==void 0){const u=r(e.base,t);return Array.isArray(n)?(n.forEach(d=>{a[d]=u}),a):(a[n]=u,a)}const c=r(e[l],t);return Array.isArray(n)?(a[t.fn.largerThan(l)]={},n.forEach(u=>{a[t.fn.largerThan(l)][u]=c}),a):(a[t.fn.largerThan(l)]={[n]:c},a)},{});const o=r(e,t);return Array.isArray(n)?n.reduce((i,a)=>(i[a]=o,i),{}):{[n]:o}}function WL(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function HL(e){return O(e)}function qL(e){return e}function GL(e,t){return A({size:e,sizes:t.fontSizes})}const QL=["-xs","-sm","-md","-lg","-xl"];function KL(e,t){return QL.includes(e)?`calc(${A({size:e.replace("-",""),sizes:t.spacing})} * -1)`:A({size:e,sizes:t.spacing})}const YL={identity:qL,color:WL,size:HL,fontSize:GL,spacing:KL},XL={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};var JL=Object.defineProperty,dw=Object.getOwnPropertySymbols,ZL=Object.prototype.hasOwnProperty,e7=Object.prototype.propertyIsEnumerable,fw=(e,t,r)=>t in e?JL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pw=(e,t)=>{for(var r in t||(t={}))ZL.call(t,r)&&fw(e,r,t[r]);if(dw)for(var r of dw(t))e7.call(t,r)&&fw(e,r,t[r]);return e};function pv(e,t,r=XL){return Object.keys(r).reduce((o,i)=>(i in e&&e[i]!==void 0&&o.push(UL({value:e[i],getValue:YL[r[i].type],property:r[i].property,theme:t})),o),[]).reduce((o,i)=>(Object.keys(i).forEach(a=>{typeof i[a]=="object"&&i[a]!==null&&a in o?o[a]=pw(pw({},o[a]),i[a]):o[a]=i[a]}),o),{})}function hw(e,t){return typeof e=="function"?e(t):e}function t7(e,t,r){const n=Ht(),{css:o,cx:i}=l$();return Array.isArray(e)?i(r,o(pv(t,n)),e.map(a=>o(hw(a,n)))):i(r,o(hw(e,n)),o(pv(t,n)))}var r7=Object.defineProperty,Od=Object.getOwnPropertySymbols,g$=Object.prototype.hasOwnProperty,v$=Object.prototype.propertyIsEnumerable,mw=(e,t,r)=>t in e?r7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,n7=(e,t)=>{for(var r in t||(t={}))g$.call(t,r)&&mw(e,r,t[r]);if(Od)for(var r of Od(t))v$.call(t,r)&&mw(e,r,t[r]);return e},o7=(e,t)=>{var r={};for(var n in e)g$.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Od)for(var n of Od(e))t.indexOf(n)<0&&v$.call(e,n)&&(r[n]=e[n]);return r};const y$=f.forwardRef((e,t)=>{var r=e,{className:n,component:o,style:i,sx:a}=r,l=o7(r,["className","component","style","sx"]);const{systemStyles:c,rest:u}=ao(l),d=o||"div";return S.createElement(d,n7({ref:t,className:t7(a,c,n),style:i},u))});y$.displayName="@mantine/core/Box";const ae=y$;var i7=Object.defineProperty,a7=Object.defineProperties,s7=Object.getOwnPropertyDescriptors,gw=Object.getOwnPropertySymbols,l7=Object.prototype.hasOwnProperty,c7=Object.prototype.propertyIsEnumerable,vw=(e,t,r)=>t in e?i7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yw=(e,t)=>{for(var r in t||(t={}))l7.call(t,r)&&vw(e,r,t[r]);if(gw)for(var r of gw(t))c7.call(t,r)&&vw(e,r,t[r]);return e},u7=(e,t)=>a7(e,s7(t)),d7=W(e=>({root:u7(yw(yw({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const f7=d7;var p7=Object.defineProperty,Cd=Object.getOwnPropertySymbols,x$=Object.prototype.hasOwnProperty,w$=Object.prototype.propertyIsEnumerable,xw=(e,t,r)=>t in e?p7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h7=(e,t)=>{for(var r in t||(t={}))x$.call(t,r)&&xw(e,r,t[r]);if(Cd)for(var r of Cd(t))w$.call(t,r)&&xw(e,r,t[r]);return e},m7=(e,t)=>{var r={};for(var n in e)x$.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cd)for(var n of Cd(e))t.indexOf(n)<0&&w$.call(e,n)&&(r[n]=e[n]);return r};const b$=f.forwardRef((e,t)=>{const r=H("UnstyledButton",{},e),{className:n,component:o="button",unstyled:i,variant:a}=r,l=m7(r,["className","component","unstyled","variant"]),{classes:c,cx:u}=f7(null,{name:"UnstyledButton",unstyled:i,variant:a});return S.createElement(ae,h7({component:o,ref:t,className:u(c.root,n),type:o==="button"?"button":void 0},l))});b$.displayName="@mantine/core/UnstyledButton";const Po=b$;var _$={exports:{}},Jr={},S$={exports:{}},P$={};/**
65
+ * @license React
66
+ * scheduler.production.min.js
67
+ *
68
+ * Copyright (c) Facebook, Inc. and its affiliates.
69
+ *
70
+ * This source code is licensed under the MIT license found in the
71
+ * LICENSE file in the root directory of this source tree.
72
+ */(function(e){function t(T,F){var V=T.length;T.push(F);e:for(;0<V;){var X=V-1>>>1,J=T[X];if(0<o(J,F))T[X]=F,T[V]=J,V=X;else break e}}function r(T){return T.length===0?null:T[0]}function n(T){if(T.length===0)return null;var F=T[0],V=T.pop();if(V!==F){T[0]=V;e:for(var X=0,J=T.length,_e=J>>>1;X<_e;){var Se=2*(X+1)-1,Xe=T[Se],Le=Se+1,gt=T[Le];if(0>o(Xe,V))Le<J&&0>o(gt,Xe)?(T[X]=gt,T[Le]=V,X=Le):(T[X]=Xe,T[Se]=V,X=Se);else if(Le<J&&0>o(gt,V))T[X]=gt,T[Le]=V,X=Le;else break e}}return F}function o(T,F){var V=T.sortIndex-F.sortIndex;return V!==0?V:T.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,p=null,h=3,m=!1,g=!1,v=!1,_=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(T){for(var F=r(u);F!==null;){if(F.callback===null)n(u);else if(F.startTime<=T)n(u),F.sortIndex=F.expirationTime,t(c,F);else break;F=r(u)}}function b(T){if(v=!1,w(T),!g)if(r(c)!==null)g=!0,Q(j);else{var F=r(u);F!==null&&G(b,F.startTime-T)}}function j(T,F){g=!1,v&&(v=!1,y(E),E=-1),m=!0;var V=h;try{for(w(F),p=r(c);p!==null&&(!(p.expirationTime>F)||T&&!I());){var X=p.callback;if(typeof X=="function"){p.callback=null,h=p.priorityLevel;var J=X(p.expirationTime<=F);F=e.unstable_now(),typeof J=="function"?p.callback=J:p===r(c)&&n(c),w(F)}else n(c);p=r(c)}if(p!==null)var _e=!0;else{var Se=r(u);Se!==null&&G(b,Se.startTime-F),_e=!1}return _e}finally{p=null,h=V,m=!1}}var C=!1,P=null,E=-1,k=5,$=-1;function I(){return!(e.unstable_now()-$<k)}function R(){if(P!==null){var T=e.unstable_now();$=T;var F=!0;try{F=P(!0,T)}finally{F?N():(C=!1,P=null)}}else C=!1}var N;if(typeof x=="function")N=function(){x(R)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,L=M.port2;M.port1.onmessage=R,N=function(){L.postMessage(null)}}else N=function(){_(R,0)};function Q(T){P=T,C||(C=!0,N())}function G(T,F){E=_(function(){T(e.unstable_now())},F)}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(T){T.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,Q(j))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var F=3;break;default:F=h}var V=h;h=F;try{return T()}finally{h=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,F){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var V=h;h=T;try{return F()}finally{h=V}},e.unstable_scheduleCallback=function(T,F,V){var X=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?X+V:X):V=X,T){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=V+J,T={id:d++,callback:F,priorityLevel:T,startTime:V,expirationTime:J,sortIndex:-1},V>X?(T.sortIndex=V,t(u,T),r(c)===null&&T===r(u)&&(v?(y(E),E=-1):v=!0,G(b,V-X))):(T.sortIndex=J,t(c,T),g||m||(g=!0,Q(j))),T},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(T){var F=h;return function(){var V=h;h=F;try{return T.apply(this,arguments)}finally{h=V}}}})(P$);S$.exports=P$;var g7=S$.exports;/**
73
+ * @license React
74
+ * react-dom.production.min.js
75
+ *
76
+ * Copyright (c) Facebook, Inc. and its affiliates.
77
+ *
78
+ * This source code is licensed under the MIT license found in the
79
+ * LICENSE file in the root directory of this source tree.
80
+ */var j$=f,Yr=g7;function q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var O$=new Set,Kl={};function pa(e,t){hs(e,t),hs(e+"Capture",t)}function hs(e,t){for(Kl[e]=t,e=0;e<t.length;e++)O$.add(t[e])}var jo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hv=Object.prototype.hasOwnProperty,v7=/^[: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]*$/,ww={},bw={};function y7(e){return hv.call(bw,e)?!0:hv.call(ww,e)?!1:v7.test(e)?bw[e]=!0:(ww[e]=!0,!1)}function x7(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function w7(e,t,r,n){if(t===null||typeof t>"u"||x7(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function _r(e,t,r,n,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Zt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Zt[e]=new _r(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Zt[t]=new _r(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Zt[e]=new _r(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Zt[e]=new _r(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Zt[e]=new _r(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Zt[e]=new _r(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Zt[e]=new _r(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Zt[e]=new _r(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Zt[e]=new _r(e,5,!1,e.toLowerCase(),null,!1,!1)});var n0=/[\-:]([a-z])/g;function o0(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(n0,o0);Zt[t]=new _r(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(n0,o0);Zt[t]=new _r(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(n0,o0);Zt[t]=new _r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Zt[e]=new _r(e,1,!1,e.toLowerCase(),null,!1,!1)});Zt.xlinkHref=new _r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Zt[e]=new _r(e,1,!1,e.toLowerCase(),null,!0,!0)});function i0(e,t,r,n){var o=Zt.hasOwnProperty(t)?Zt[t]:null;(o!==null?o.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(w7(t,r,o,n)&&(r=null),n||o===null?y7(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=r===null?o.type===3?!1:"":r:(t=o.attributeName,n=o.attributeNamespace,r===null?e.removeAttribute(t):(o=o.type,r=o===3||o===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Ao=j$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,su=Symbol.for("react.element"),Va=Symbol.for("react.portal"),Ba=Symbol.for("react.fragment"),a0=Symbol.for("react.strict_mode"),mv=Symbol.for("react.profiler"),C$=Symbol.for("react.provider"),E$=Symbol.for("react.context"),s0=Symbol.for("react.forward_ref"),gv=Symbol.for("react.suspense"),vv=Symbol.for("react.suspense_list"),l0=Symbol.for("react.memo"),Zo=Symbol.for("react.lazy"),$$=Symbol.for("react.offscreen"),_w=Symbol.iterator;function Zs(e){return e===null||typeof e!="object"?null:(e=_w&&e[_w]||e["@@iterator"],typeof e=="function"?e:null)}var wt=Object.assign,Jm;function Sl(e){if(Jm===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Jm=t&&t[1]||""}return`
81
+ `+Jm+e}var Zm=!1;function eg(e,t){if(!e||Zm)return"";Zm=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var o=u.stack.split(`
82
+ `),i=n.stack.split(`
83
+ `),a=o.length-1,l=i.length-1;1<=a&&0<=l&&o[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(o[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||o[a]!==i[l]){var c=`
84
+ `+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Zm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Sl(e):""}function b7(e){switch(e.tag){case 5:return Sl(e.type);case 16:return Sl("Lazy");case 13:return Sl("Suspense");case 19:return Sl("SuspenseList");case 0:case 2:case 15:return e=eg(e.type,!1),e;case 11:return e=eg(e.type.render,!1),e;case 1:return e=eg(e.type,!0),e;default:return""}}function yv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ba:return"Fragment";case Va:return"Portal";case mv:return"Profiler";case a0:return"StrictMode";case gv:return"Suspense";case vv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E$:return(e.displayName||"Context")+".Consumer";case C$:return(e._context.displayName||"Context")+".Provider";case s0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case l0:return t=e.displayName||null,t!==null?t:yv(e.type)||"Memo";case Zo:t=e._payload,e=e._init;try{return yv(e(t))}catch{}}return null}function _7(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return yv(t);case 8:return t===a0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function wi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function k$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function S7(e){var t=k$(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lu(e){e._valueTracker||(e._valueTracker=S7(e))}function R$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=k$(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Ed(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function xv(e,t){var r=t.checked;return wt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Sw(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=wi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function T$(e,t){t=t.checked,t!=null&&i0(e,"checked",t,!1)}function wv(e,t){T$(e,t);var r=wi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?bv(e,t.type,r):t.hasOwnProperty("defaultValue")&&bv(e,t.type,wi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function bv(e,t,r){(t!=="number"||Ed(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Pl=Array.isArray;function ns(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&n&&(e[r].defaultSelected=!0)}else{for(r=""+wi(r),t=null,o=0;o<e.length;o++){if(e[o].value===r){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function _v(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(q(91));return wt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function jw(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(q(92));if(Pl(r)){if(1<r.length)throw Error(q(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:wi(r)}}function I$(e,t){var r=wi(t.value),n=wi(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Ow(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function D$(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Sv(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?D$(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var cu,N$=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,o){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(cu=cu||document.createElement("div"),cu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=cu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Rl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},P7=["Webkit","ms","Moz","O"];Object.keys(Rl).forEach(function(e){P7.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Rl[t]=Rl[e]})});function A$(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Rl.hasOwnProperty(e)&&Rl[e]?(""+t).trim():t+"px"}function M$(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=A$(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var j7=wt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Pv(e,t){if(t){if(j7[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(q(62))}}function jv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ov=null;function c0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cv=null,os=null,is=null;function Cw(e){if(e=Ec(e)){if(typeof Cv!="function")throw Error(q(280));var t=e.stateNode;t&&(t=Qh(t),Cv(e.stateNode,e.type,t))}}function L$(e){os?is?is.push(e):is=[e]:os=e}function z$(){if(os){var e=os,t=is;if(is=os=null,Cw(e),t)for(e=0;e<t.length;e++)Cw(t[e])}}function F$(e,t){return e(t)}function V$(){}var tg=!1;function B$(e,t,r){if(tg)return e(t,r);tg=!0;try{return F$(e,t,r)}finally{tg=!1,(os!==null||is!==null)&&(V$(),z$())}}function Xl(e,t){var r=e.stateNode;if(r===null)return null;var n=Qh(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(q(231,t,typeof r));return r}var Ev=!1;if(jo)try{var el={};Object.defineProperty(el,"passive",{get:function(){Ev=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{Ev=!1}function O7(e,t,r,n,o,i,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Tl=!1,$d=null,kd=!1,$v=null,C7={onError:function(e){Tl=!0,$d=e}};function E7(e,t,r,n,o,i,a,l,c){Tl=!1,$d=null,O7.apply(C7,arguments)}function $7(e,t,r,n,o,i,a,l,c){if(E7.apply(this,arguments),Tl){if(Tl){var u=$d;Tl=!1,$d=null}else throw Error(q(198));kd||(kd=!0,$v=u)}}function ha(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function U$(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ew(e){if(ha(e)!==e)throw Error(q(188))}function k7(e){var t=e.alternate;if(!t){if(t=ha(e),t===null)throw Error(q(188));return t!==e?null:e}for(var r=e,n=t;;){var o=r.return;if(o===null)break;var i=o.alternate;if(i===null){if(n=o.return,n!==null){r=n;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===r)return Ew(o),e;if(i===n)return Ew(o),t;i=i.sibling}throw Error(q(188))}if(r.return!==n.return)r=o,n=i;else{for(var a=!1,l=o.child;l;){if(l===r){a=!0,r=o,n=i;break}if(l===n){a=!0,n=o,r=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===r){a=!0,r=i,n=o;break}if(l===n){a=!0,n=i,r=o;break}l=l.sibling}if(!a)throw Error(q(189))}}if(r.alternate!==n)throw Error(q(190))}if(r.tag!==3)throw Error(q(188));return r.stateNode.current===r?e:t}function W$(e){return e=k7(e),e!==null?H$(e):null}function H$(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=H$(e);if(t!==null)return t;e=e.sibling}return null}var q$=Yr.unstable_scheduleCallback,$w=Yr.unstable_cancelCallback,R7=Yr.unstable_shouldYield,T7=Yr.unstable_requestPaint,$t=Yr.unstable_now,I7=Yr.unstable_getCurrentPriorityLevel,u0=Yr.unstable_ImmediatePriority,G$=Yr.unstable_UserBlockingPriority,Rd=Yr.unstable_NormalPriority,D7=Yr.unstable_LowPriority,Q$=Yr.unstable_IdlePriority,Wh=null,Zn=null;function N7(e){if(Zn&&typeof Zn.onCommitFiberRoot=="function")try{Zn.onCommitFiberRoot(Wh,e,void 0,(e.current.flags&128)===128)}catch{}}var Cn=Math.clz32?Math.clz32:L7,A7=Math.log,M7=Math.LN2;function L7(e){return e>>>=0,e===0?32:31-(A7(e)/M7|0)|0}var uu=64,du=4194304;function jl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Td(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,a=r&268435455;if(a!==0){var l=a&~o;l!==0?n=jl(l):(i&=a,i!==0&&(n=jl(i)))}else a=r&~o,a!==0?n=jl(a):i!==0&&(n=jl(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Cn(t),o=1<<r,n|=e[r],t&=~o;return n}function z7(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function F7(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-Cn(i),l=1<<a,c=o[a];c===-1?(!(l&r)||l&n)&&(o[a]=z7(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function kv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function K$(){var e=uu;return uu<<=1,!(uu&4194240)&&(uu=64),e}function rg(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Oc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Cn(t),e[t]=r}function V7(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var o=31-Cn(r),i=1<<o;t[o]=0,n[o]=-1,e[o]=-1,r&=~i}}function d0(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Cn(r),o=1<<n;o&t|e[n]&t&&(e[n]|=t),r&=~o}}var He=0;function Y$(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var X$,f0,J$,Z$,e2,Rv=!1,fu=[],ui=null,di=null,fi=null,Jl=new Map,Zl=new Map,ni=[],B7="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function kw(e,t){switch(e){case"focusin":case"focusout":ui=null;break;case"dragenter":case"dragleave":di=null;break;case"mouseover":case"mouseout":fi=null;break;case"pointerover":case"pointerout":Jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zl.delete(t.pointerId)}}function tl(e,t,r,n,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Ec(t),t!==null&&f0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function U7(e,t,r,n,o){switch(t){case"focusin":return ui=tl(ui,e,t,r,n,o),!0;case"dragenter":return di=tl(di,e,t,r,n,o),!0;case"mouseover":return fi=tl(fi,e,t,r,n,o),!0;case"pointerover":var i=o.pointerId;return Jl.set(i,tl(Jl.get(i)||null,e,t,r,n,o)),!0;case"gotpointercapture":return i=o.pointerId,Zl.set(i,tl(Zl.get(i)||null,e,t,r,n,o)),!0}return!1}function t2(e){var t=Gi(e.target);if(t!==null){var r=ha(t);if(r!==null){if(t=r.tag,t===13){if(t=U$(r),t!==null){e.blockedOn=t,e2(e.priority,function(){J$(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function id(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Tv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Ov=n,r.target.dispatchEvent(n),Ov=null}else return t=Ec(r),t!==null&&f0(t),e.blockedOn=r,!1;t.shift()}return!0}function Rw(e,t,r){id(e)&&r.delete(t)}function W7(){Rv=!1,ui!==null&&id(ui)&&(ui=null),di!==null&&id(di)&&(di=null),fi!==null&&id(fi)&&(fi=null),Jl.forEach(Rw),Zl.forEach(Rw)}function rl(e,t){e.blockedOn===t&&(e.blockedOn=null,Rv||(Rv=!0,Yr.unstable_scheduleCallback(Yr.unstable_NormalPriority,W7)))}function ec(e){function t(o){return rl(o,e)}if(0<fu.length){rl(fu[0],e);for(var r=1;r<fu.length;r++){var n=fu[r];n.blockedOn===e&&(n.blockedOn=null)}}for(ui!==null&&rl(ui,e),di!==null&&rl(di,e),fi!==null&&rl(fi,e),Jl.forEach(t),Zl.forEach(t),r=0;r<ni.length;r++)n=ni[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ni.length&&(r=ni[0],r.blockedOn===null);)t2(r),r.blockedOn===null&&ni.shift()}var as=Ao.ReactCurrentBatchConfig,Id=!0;function H7(e,t,r,n){var o=He,i=as.transition;as.transition=null;try{He=1,p0(e,t,r,n)}finally{He=o,as.transition=i}}function q7(e,t,r,n){var o=He,i=as.transition;as.transition=null;try{He=4,p0(e,t,r,n)}finally{He=o,as.transition=i}}function p0(e,t,r,n){if(Id){var o=Tv(e,t,r,n);if(o===null)fg(e,t,n,Dd,r),kw(e,n);else if(U7(o,e,t,r,n))n.stopPropagation();else if(kw(e,n),t&4&&-1<B7.indexOf(e)){for(;o!==null;){var i=Ec(o);if(i!==null&&X$(i),i=Tv(e,t,r,n),i===null&&fg(e,t,n,Dd,r),i===o)break;o=i}o!==null&&n.stopPropagation()}else fg(e,t,n,null,r)}}var Dd=null;function Tv(e,t,r,n){if(Dd=null,e=c0(n),e=Gi(e),e!==null)if(t=ha(e),t===null)e=null;else if(r=t.tag,r===13){if(e=U$(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Dd=e,null}function r2(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(I7()){case u0:return 1;case G$:return 4;case Rd:case D7:return 16;case Q$:return 536870912;default:return 16}default:return 16}}var ii=null,h0=null,ad=null;function n2(){if(ad)return ad;var e,t=h0,r=t.length,n,o="value"in ii?ii.value:ii.textContent,i=o.length;for(e=0;e<r&&t[e]===o[e];e++);var a=r-e;for(n=1;n<=a&&t[r-n]===o[i-n];n++);return ad=o.slice(e,1<n?1-n:void 0)}function sd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pu(){return!0}function Tw(){return!1}function Zr(e){function t(r,n,o,i,a){this._reactName=r,this._targetInst=o,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?pu:Tw,this.isPropagationStopped=Tw,this}return wt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=pu)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=pu)},persist:function(){},isPersistent:pu}),t}var Ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},m0=Zr(Ns),Cc=wt({},Ns,{view:0,detail:0}),G7=Zr(Cc),ng,og,nl,Hh=wt({},Cc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:g0,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nl&&(nl&&e.type==="mousemove"?(ng=e.screenX-nl.screenX,og=e.screenY-nl.screenY):og=ng=0,nl=e),ng)},movementY:function(e){return"movementY"in e?e.movementY:og}}),Iw=Zr(Hh),Q7=wt({},Hh,{dataTransfer:0}),K7=Zr(Q7),Y7=wt({},Cc,{relatedTarget:0}),ig=Zr(Y7),X7=wt({},Ns,{animationName:0,elapsedTime:0,pseudoElement:0}),J7=Zr(X7),Z7=wt({},Ns,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ez=Zr(Z7),tz=wt({},Ns,{data:0}),Dw=Zr(tz),rz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nz={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"},oz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iz(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=oz[e])?!!t[e]:!1}function g0(){return iz}var az=wt({},Cc,{key:function(e){if(e.key){var t=rz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nz[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:g0,charCode:function(e){return e.type==="keypress"?sd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sz=Zr(az),lz=wt({},Hh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nw=Zr(lz),cz=wt({},Cc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:g0}),uz=Zr(cz),dz=wt({},Ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),fz=Zr(dz),pz=wt({},Hh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),hz=Zr(pz),mz=[9,13,27,32],v0=jo&&"CompositionEvent"in window,Il=null;jo&&"documentMode"in document&&(Il=document.documentMode);var gz=jo&&"TextEvent"in window&&!Il,o2=jo&&(!v0||Il&&8<Il&&11>=Il),Aw=" ",Mw=!1;function i2(e,t){switch(e){case"keyup":return mz.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function a2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ua=!1;function vz(e,t){switch(e){case"compositionend":return a2(t);case"keypress":return t.which!==32?null:(Mw=!0,Aw);case"textInput":return e=t.data,e===Aw&&Mw?null:e;default:return null}}function yz(e,t){if(Ua)return e==="compositionend"||!v0&&i2(e,t)?(e=n2(),ad=h0=ii=null,Ua=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return o2&&t.locale!=="ko"?null:t.data;default:return null}}var xz={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 Lw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xz[e.type]:t==="textarea"}function s2(e,t,r,n){L$(n),t=Nd(t,"onChange"),0<t.length&&(r=new m0("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Dl=null,tc=null;function wz(e){y2(e,0)}function qh(e){var t=qa(e);if(R$(t))return e}function bz(e,t){if(e==="change")return t}var l2=!1;if(jo){var ag;if(jo){var sg="oninput"in document;if(!sg){var zw=document.createElement("div");zw.setAttribute("oninput","return;"),sg=typeof zw.oninput=="function"}ag=sg}else ag=!1;l2=ag&&(!document.documentMode||9<document.documentMode)}function Fw(){Dl&&(Dl.detachEvent("onpropertychange",c2),tc=Dl=null)}function c2(e){if(e.propertyName==="value"&&qh(tc)){var t=[];s2(t,tc,e,c0(e)),B$(wz,t)}}function _z(e,t,r){e==="focusin"?(Fw(),Dl=t,tc=r,Dl.attachEvent("onpropertychange",c2)):e==="focusout"&&Fw()}function Sz(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qh(tc)}function Pz(e,t){if(e==="click")return qh(t)}function jz(e,t){if(e==="input"||e==="change")return qh(t)}function Oz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $n=typeof Object.is=="function"?Object.is:Oz;function rc(e,t){if($n(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var o=r[n];if(!hv.call(t,o)||!$n(e[o],t[o]))return!1}return!0}function Vw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bw(e,t){var r=Vw(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Vw(r)}}function u2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?u2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function d2(){for(var e=window,t=Ed();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ed(e.document)}return t}function y0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Cz(e){var t=d2(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&u2(r.ownerDocument.documentElement,r)){if(n!==null&&y0(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=Bw(r,i);var a=Bw(r,n);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ez=jo&&"documentMode"in document&&11>=document.documentMode,Wa=null,Iv=null,Nl=null,Dv=!1;function Uw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Dv||Wa==null||Wa!==Ed(n)||(n=Wa,"selectionStart"in n&&y0(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Nl&&rc(Nl,n)||(Nl=n,n=Nd(Iv,"onSelect"),0<n.length&&(t=new m0("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Wa)))}function hu(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ha={animationend:hu("Animation","AnimationEnd"),animationiteration:hu("Animation","AnimationIteration"),animationstart:hu("Animation","AnimationStart"),transitionend:hu("Transition","TransitionEnd")},lg={},f2={};jo&&(f2=document.createElement("div").style,"AnimationEvent"in window||(delete Ha.animationend.animation,delete Ha.animationiteration.animation,delete Ha.animationstart.animation),"TransitionEvent"in window||delete Ha.transitionend.transition);function Gh(e){if(lg[e])return lg[e];if(!Ha[e])return e;var t=Ha[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in f2)return lg[e]=t[r];return e}var p2=Gh("animationend"),h2=Gh("animationiteration"),m2=Gh("animationstart"),g2=Gh("transitionend"),v2=new Map,Ww="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ci(e,t){v2.set(e,t),pa(t,[e])}for(var cg=0;cg<Ww.length;cg++){var ug=Ww[cg],$z=ug.toLowerCase(),kz=ug[0].toUpperCase()+ug.slice(1);Ci($z,"on"+kz)}Ci(p2,"onAnimationEnd");Ci(h2,"onAnimationIteration");Ci(m2,"onAnimationStart");Ci("dblclick","onDoubleClick");Ci("focusin","onFocus");Ci("focusout","onBlur");Ci(g2,"onTransitionEnd");hs("onMouseEnter",["mouseout","mouseover"]);hs("onMouseLeave",["mouseout","mouseover"]);hs("onPointerEnter",["pointerout","pointerover"]);hs("onPointerLeave",["pointerout","pointerover"]);pa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pa("onBeforeInput",["compositionend","keypress","textInput","paste"]);pa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ol="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(" "),Rz=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ol));function Hw(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,$7(n,t,void 0,e),e.currentTarget=null}function y2(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],o=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var a=n.length-1;0<=a;a--){var l=n[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;Hw(o,l,u),i=c}else for(a=0;a<n.length;a++){if(l=n[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;Hw(o,l,u),i=c}}}if(kd)throw e=$v,kd=!1,$v=null,e}function ct(e,t){var r=t[zv];r===void 0&&(r=t[zv]=new Set);var n=e+"__bubble";r.has(n)||(x2(t,e,2,!1),r.add(n))}function dg(e,t,r){var n=0;t&&(n|=4),x2(r,e,n,t)}var mu="_reactListening"+Math.random().toString(36).slice(2);function nc(e){if(!e[mu]){e[mu]=!0,O$.forEach(function(r){r!=="selectionchange"&&(Rz.has(r)||dg(r,!1,e),dg(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mu]||(t[mu]=!0,dg("selectionchange",!1,t))}}function x2(e,t,r,n){switch(r2(t)){case 1:var o=H7;break;case 4:o=q7;break;default:o=p0}r=o.bind(null,t,r,e),o=void 0,!Ev||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(t,r,{capture:!0,passive:o}):e.addEventListener(t,r,!0):o!==void 0?e.addEventListener(t,r,{passive:o}):e.addEventListener(t,r,!1)}function fg(e,t,r,n,o){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var l=n.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(a===4)for(a=n.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;l!==null;){if(a=Gi(l),a===null)return;if(c=a.tag,c===5||c===6){n=i=a;continue e}l=l.parentNode}}n=n.return}B$(function(){var u=i,d=c0(r),p=[];e:{var h=v2.get(e);if(h!==void 0){var m=m0,g=e;switch(e){case"keypress":if(sd(r)===0)break e;case"keydown":case"keyup":m=sz;break;case"focusin":g="focus",m=ig;break;case"focusout":g="blur",m=ig;break;case"beforeblur":case"afterblur":m=ig;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Iw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=K7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=uz;break;case p2:case h2:case m2:m=J7;break;case g2:m=fz;break;case"scroll":m=G7;break;case"wheel":m=hz;break;case"copy":case"cut":case"paste":m=ez;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Nw}var v=(t&4)!==0,_=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var x=u,w;x!==null;){w=x;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,y!==null&&(b=Xl(x,y),b!=null&&v.push(oc(x,b,w)))),_)break;x=x.return}0<v.length&&(h=new m(h,g,null,r,d),p.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&r!==Ov&&(g=r.relatedTarget||r.fromElement)&&(Gi(g)||g[Oo]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=r.relatedTarget||r.toElement,m=u,g=g?Gi(g):null,g!==null&&(_=ha(g),g!==_||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=Iw,b="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=Nw,b="onPointerLeave",y="onPointerEnter",x="pointer"),_=m==null?h:qa(m),w=g==null?h:qa(g),h=new v(b,x+"leave",m,r,d),h.target=_,h.relatedTarget=w,b=null,Gi(d)===u&&(v=new v(y,x+"enter",g,r,d),v.target=w,v.relatedTarget=_,b=v),_=b,m&&g)t:{for(v=m,y=g,x=0,w=v;w;w=ka(w))x++;for(w=0,b=y;b;b=ka(b))w++;for(;0<x-w;)v=ka(v),x--;for(;0<w-x;)y=ka(y),w--;for(;x--;){if(v===y||y!==null&&v===y.alternate)break t;v=ka(v),y=ka(y)}v=null}else v=null;m!==null&&qw(p,h,m,v,!1),g!==null&&_!==null&&qw(p,_,g,v,!0)}}e:{if(h=u?qa(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var j=bz;else if(Lw(h))if(l2)j=jz;else{j=Sz;var C=_z}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=Pz);if(j&&(j=j(e,u))){s2(p,j,r,d);break e}C&&C(e,h,u),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&bv(h,"number",h.value)}switch(C=u?qa(u):window,e){case"focusin":(Lw(C)||C.contentEditable==="true")&&(Wa=C,Iv=u,Nl=null);break;case"focusout":Nl=Iv=Wa=null;break;case"mousedown":Dv=!0;break;case"contextmenu":case"mouseup":case"dragend":Dv=!1,Uw(p,r,d);break;case"selectionchange":if(Ez)break;case"keydown":case"keyup":Uw(p,r,d)}var P;if(v0)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Ua?i2(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(o2&&r.locale!=="ko"&&(Ua||E!=="onCompositionStart"?E==="onCompositionEnd"&&Ua&&(P=n2()):(ii=d,h0="value"in ii?ii.value:ii.textContent,Ua=!0)),C=Nd(u,E),0<C.length&&(E=new Dw(E,e,null,r,d),p.push({event:E,listeners:C}),P?E.data=P:(P=a2(r),P!==null&&(E.data=P)))),(P=gz?vz(e,r):yz(e,r))&&(u=Nd(u,"onBeforeInput"),0<u.length&&(d=new Dw("onBeforeInput","beforeinput",null,r,d),p.push({event:d,listeners:u}),d.data=P))}y2(p,t)})}function oc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Nd(e,t){for(var r=t+"Capture",n=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Xl(e,r),i!=null&&n.unshift(oc(e,i,o)),i=Xl(e,t),i!=null&&n.push(oc(e,i,o))),e=e.return}return n}function ka(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function qw(e,t,r,n,o){for(var i=t._reactName,a=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,o?(c=Xl(r,i),c!=null&&a.unshift(oc(r,c,l))):o||(c=Xl(r,i),c!=null&&a.push(oc(r,c,l)))),r=r.return}a.length!==0&&e.push({event:t,listeners:a})}var Tz=/\r\n?/g,Iz=/\u0000|\uFFFD/g;function Gw(e){return(typeof e=="string"?e:""+e).replace(Tz,`
85
+ `).replace(Iz,"")}function gu(e,t,r){if(t=Gw(t),Gw(e)!==t&&r)throw Error(q(425))}function Ad(){}var Nv=null,Av=null;function Mv(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Lv=typeof setTimeout=="function"?setTimeout:void 0,Dz=typeof clearTimeout=="function"?clearTimeout:void 0,Qw=typeof Promise=="function"?Promise:void 0,Nz=typeof queueMicrotask=="function"?queueMicrotask:typeof Qw<"u"?function(e){return Qw.resolve(null).then(e).catch(Az)}:Lv;function Az(e){setTimeout(function(){throw e})}function pg(e,t){var r=t,n=0;do{var o=r.nextSibling;if(e.removeChild(r),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(n===0){e.removeChild(o),ec(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=o}while(r);ec(t)}function pi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Kw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var As=Math.random().toString(36).slice(2),Yn="__reactFiber$"+As,ic="__reactProps$"+As,Oo="__reactContainer$"+As,zv="__reactEvents$"+As,Mz="__reactListeners$"+As,Lz="__reactHandles$"+As;function Gi(e){var t=e[Yn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Oo]||r[Yn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Kw(e);e!==null;){if(r=e[Yn])return r;e=Kw(e)}return t}e=r,r=e.parentNode}return null}function Ec(e){return e=e[Yn]||e[Oo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(q(33))}function Qh(e){return e[ic]||null}var Fv=[],Ga=-1;function Ei(e){return{current:e}}function dt(e){0>Ga||(e.current=Fv[Ga],Fv[Ga]=null,Ga--)}function it(e,t){Ga++,Fv[Ga]=e.current,e.current=t}var bi={},lr=Ei(bi),$r=Ei(!1),ta=bi;function ms(e,t){var r=e.type.contextTypes;if(!r)return bi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function kr(e){return e=e.childContextTypes,e!=null}function Md(){dt($r),dt(lr)}function Yw(e,t,r){if(lr.current!==bi)throw Error(q(168));it(lr,t),it($r,r)}function w2(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(q(108,_7(e)||"Unknown",o));return wt({},r,n)}function Ld(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bi,ta=lr.current,it(lr,e),it($r,$r.current),!0}function Xw(e,t,r){var n=e.stateNode;if(!n)throw Error(q(169));r?(e=w2(e,t,ta),n.__reactInternalMemoizedMergedChildContext=e,dt($r),dt(lr),it(lr,e)):dt($r),it($r,r)}var vo=null,Kh=!1,hg=!1;function b2(e){vo===null?vo=[e]:vo.push(e)}function zz(e){Kh=!0,b2(e)}function $i(){if(!hg&&vo!==null){hg=!0;var e=0,t=He;try{var r=vo;for(He=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}vo=null,Kh=!1}catch(o){throw vo!==null&&(vo=vo.slice(e+1)),q$(u0,$i),o}finally{He=t,hg=!1}}return null}var Qa=[],Ka=0,zd=null,Fd=0,on=[],an=0,ra=null,xo=1,wo="";function Vi(e,t){Qa[Ka++]=Fd,Qa[Ka++]=zd,zd=e,Fd=t}function _2(e,t,r){on[an++]=xo,on[an++]=wo,on[an++]=ra,ra=e;var n=xo;e=wo;var o=32-Cn(n)-1;n&=~(1<<o),r+=1;var i=32-Cn(t)+o;if(30<i){var a=o-o%5;i=(n&(1<<a)-1).toString(32),n>>=a,o-=a,xo=1<<32-Cn(t)+o|r<<o|n,wo=i+e}else xo=1<<i|r<<o|n,wo=e}function x0(e){e.return!==null&&(Vi(e,1),_2(e,1,0))}function w0(e){for(;e===zd;)zd=Qa[--Ka],Qa[Ka]=null,Fd=Qa[--Ka],Qa[Ka]=null;for(;e===ra;)ra=on[--an],on[an]=null,wo=on[--an],on[an]=null,xo=on[--an],on[an]=null}var Qr=null,qr=null,pt=!1,jn=null;function S2(e,t){var r=sn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Jw(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Qr=e,qr=pi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qr=e,qr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ra!==null?{id:xo,overflow:wo}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=sn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Qr=e,qr=null,!0):!1;default:return!1}}function Vv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Bv(e){if(pt){var t=qr;if(t){var r=t;if(!Jw(e,t)){if(Vv(e))throw Error(q(418));t=pi(r.nextSibling);var n=Qr;t&&Jw(e,t)?S2(n,r):(e.flags=e.flags&-4097|2,pt=!1,Qr=e)}}else{if(Vv(e))throw Error(q(418));e.flags=e.flags&-4097|2,pt=!1,Qr=e}}}function Zw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qr=e}function vu(e){if(e!==Qr)return!1;if(!pt)return Zw(e),pt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Mv(e.type,e.memoizedProps)),t&&(t=qr)){if(Vv(e))throw P2(),Error(q(418));for(;t;)S2(e,t),t=pi(t.nextSibling)}if(Zw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){qr=pi(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}qr=null}}else qr=Qr?pi(e.stateNode.nextSibling):null;return!0}function P2(){for(var e=qr;e;)e=pi(e.nextSibling)}function gs(){qr=Qr=null,pt=!1}function b0(e){jn===null?jn=[e]:jn.push(e)}var Fz=Ao.ReactCurrentBatchConfig;function _n(e,t){if(e&&e.defaultProps){t=wt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var Vd=Ei(null),Bd=null,Ya=null,_0=null;function S0(){_0=Ya=Bd=null}function P0(e){var t=Vd.current;dt(Vd),e._currentValue=t}function Uv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ss(e,t){Bd=e,_0=Ya=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Cr=!0),e.firstContext=null)}function pn(e){var t=e._currentValue;if(_0!==e)if(e={context:e,memoizedValue:t,next:null},Ya===null){if(Bd===null)throw Error(q(308));Ya=e,Bd.dependencies={lanes:0,firstContext:e}}else Ya=Ya.next=e;return t}var Qi=null;function j0(e){Qi===null?Qi=[e]:Qi.push(e)}function j2(e,t,r,n){var o=t.interleaved;return o===null?(r.next=r,j0(t)):(r.next=o.next,o.next=r),t.interleaved=r,Co(e,n)}function Co(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var ei=!1;function O0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function O2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Me&2){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,Co(e,r)}return o=n.interleaved,o===null?(t.next=t,j0(n)):(t.next=o.next,o.next=t),n.interleaved=t,Co(e,r)}function ld(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,d0(e,r)}}function eb(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var o=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?o=i=a:i=i.next=a,r=r.next}while(r!==null);i===null?o=i=t:i=i.next=t}else o=i=t;r={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ud(e,t,r,n){var o=e.updateQueue;ei=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var p=o.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(h=t,m=r,v.tag){case 1:if(g=v.payload,typeof g=="function"){p=g.call(m,p,h);break e}p=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(m,p,h):g,h==null)break e;p=wt({},p,h);break e;case 2:ei=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=p):d=d.next=m,a|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(d===null&&(c=p),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);oa|=a,e.lanes=a,e.memoizedState=p}}function tb(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],o=n.callback;if(o!==null){if(n.callback=null,n=r,typeof o!="function")throw Error(q(191,o));o.call(n)}}}var C2=new j$.Component().refs;function Wv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:wt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Yh={isMounted:function(e){return(e=e._reactInternals)?ha(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=vr(),o=gi(e),i=bo(n,o);i.payload=t,r!=null&&(i.callback=r),t=hi(e,i,o),t!==null&&(En(t,e,o,n),ld(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=vr(),o=gi(e),i=bo(n,o);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=hi(e,i,o),t!==null&&(En(t,e,o,n),ld(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=vr(),n=gi(e),o=bo(r,n);o.tag=2,t!=null&&(o.callback=t),t=hi(e,o,n),t!==null&&(En(t,e,n,r),ld(t,e,n))}};function rb(e,t,r,n,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,a):t.prototype&&t.prototype.isPureReactComponent?!rc(r,n)||!rc(o,i):!0}function E2(e,t,r){var n=!1,o=bi,i=t.contextType;return typeof i=="object"&&i!==null?i=pn(i):(o=kr(t)?ta:lr.current,n=t.contextTypes,i=(n=n!=null)?ms(e,o):bi),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Yh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function nb(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Yh.enqueueReplaceState(t,t.state,null)}function Hv(e,t,r,n){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs=C2,O0(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=pn(i):(i=kr(t)?ta:lr.current,o.context=ms(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Wv(e,t,i,r),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Yh.enqueueReplaceState(o,o.state,null),Ud(e,r,o,n),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ol(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(q(309));var n=r.stateNode}if(!n)throw Error(q(147,e));var o=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=o.refs;l===C2&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(q(284));if(!r._owner)throw Error(q(290,e))}return e}function yu(e,t){throw e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ob(e){var t=e._init;return t(e._payload)}function $2(e){function t(y,x){if(e){var w=y.deletions;w===null?(y.deletions=[x],y.flags|=16):w.push(x)}}function r(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function n(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function o(y,x){return y=vi(y,x),y.index=0,y.sibling=null,y}function i(y,x,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<x?(y.flags|=2,x):w):(y.flags|=2,x)):(y.flags|=1048576,x)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,x,w,b){return x===null||x.tag!==6?(x=bg(w,y.mode,b),x.return=y,x):(x=o(x,w),x.return=y,x)}function c(y,x,w,b){var j=w.type;return j===Ba?d(y,x,w.props.children,b,w.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Zo&&ob(j)===x.type)?(b=o(x,w.props),b.ref=ol(y,x,w),b.return=y,b):(b=hd(w.type,w.key,w.props,null,y.mode,b),b.ref=ol(y,x,w),b.return=y,b)}function u(y,x,w,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=_g(w,y.mode,b),x.return=y,x):(x=o(x,w.children||[]),x.return=y,x)}function d(y,x,w,b,j){return x===null||x.tag!==7?(x=Zi(w,y.mode,b,j),x.return=y,x):(x=o(x,w),x.return=y,x)}function p(y,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=bg(""+x,y.mode,w),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case su:return w=hd(x.type,x.key,x.props,null,y.mode,w),w.ref=ol(y,null,x),w.return=y,w;case Va:return x=_g(x,y.mode,w),x.return=y,x;case Zo:var b=x._init;return p(y,b(x._payload),w)}if(Pl(x)||Zs(x))return x=Zi(x,y.mode,w,null),x.return=y,x;yu(y,x)}return null}function h(y,x,w,b){var j=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(y,x,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case su:return w.key===j?c(y,x,w,b):null;case Va:return w.key===j?u(y,x,w,b):null;case Zo:return j=w._init,h(y,x,j(w._payload),b)}if(Pl(w)||Zs(w))return j!==null?null:d(y,x,w,b,null);yu(y,w)}return null}function m(y,x,w,b,j){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(w)||null,l(x,y,""+b,j);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case su:return y=y.get(b.key===null?w:b.key)||null,c(x,y,b,j);case Va:return y=y.get(b.key===null?w:b.key)||null,u(x,y,b,j);case Zo:var C=b._init;return m(y,x,w,C(b._payload),j)}if(Pl(b)||Zs(b))return y=y.get(w)||null,d(x,y,b,j,null);yu(x,b)}return null}function g(y,x,w,b){for(var j=null,C=null,P=x,E=x=0,k=null;P!==null&&E<w.length;E++){P.index>E?(k=P,P=null):k=P.sibling;var $=h(y,P,w[E],b);if($===null){P===null&&(P=k);break}e&&P&&$.alternate===null&&t(y,P),x=i($,x,E),C===null?j=$:C.sibling=$,C=$,P=k}if(E===w.length)return r(y,P),pt&&Vi(y,E),j;if(P===null){for(;E<w.length;E++)P=p(y,w[E],b),P!==null&&(x=i(P,x,E),C===null?j=P:C.sibling=P,C=P);return pt&&Vi(y,E),j}for(P=n(y,P);E<w.length;E++)k=m(P,y,E,w[E],b),k!==null&&(e&&k.alternate!==null&&P.delete(k.key===null?E:k.key),x=i(k,x,E),C===null?j=k:C.sibling=k,C=k);return e&&P.forEach(function(I){return t(y,I)}),pt&&Vi(y,E),j}function v(y,x,w,b){var j=Zs(w);if(typeof j!="function")throw Error(q(150));if(w=j.call(w),w==null)throw Error(q(151));for(var C=j=null,P=x,E=x=0,k=null,$=w.next();P!==null&&!$.done;E++,$=w.next()){P.index>E?(k=P,P=null):k=P.sibling;var I=h(y,P,$.value,b);if(I===null){P===null&&(P=k);break}e&&P&&I.alternate===null&&t(y,P),x=i(I,x,E),C===null?j=I:C.sibling=I,C=I,P=k}if($.done)return r(y,P),pt&&Vi(y,E),j;if(P===null){for(;!$.done;E++,$=w.next())$=p(y,$.value,b),$!==null&&(x=i($,x,E),C===null?j=$:C.sibling=$,C=$);return pt&&Vi(y,E),j}for(P=n(y,P);!$.done;E++,$=w.next())$=m(P,y,E,$.value,b),$!==null&&(e&&$.alternate!==null&&P.delete($.key===null?E:$.key),x=i($,x,E),C===null?j=$:C.sibling=$,C=$);return e&&P.forEach(function(R){return t(y,R)}),pt&&Vi(y,E),j}function _(y,x,w,b){if(typeof w=="object"&&w!==null&&w.type===Ba&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case su:e:{for(var j=w.key,C=x;C!==null;){if(C.key===j){if(j=w.type,j===Ba){if(C.tag===7){r(y,C.sibling),x=o(C,w.props.children),x.return=y,y=x;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Zo&&ob(j)===C.type){r(y,C.sibling),x=o(C,w.props),x.ref=ol(y,C,w),x.return=y,y=x;break e}r(y,C);break}else t(y,C);C=C.sibling}w.type===Ba?(x=Zi(w.props.children,y.mode,b,w.key),x.return=y,y=x):(b=hd(w.type,w.key,w.props,null,y.mode,b),b.ref=ol(y,x,w),b.return=y,y=b)}return a(y);case Va:e:{for(C=w.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){r(y,x.sibling),x=o(x,w.children||[]),x.return=y,y=x;break e}else{r(y,x);break}else t(y,x);x=x.sibling}x=_g(w,y.mode,b),x.return=y,y=x}return a(y);case Zo:return C=w._init,_(y,x,C(w._payload),b)}if(Pl(w))return g(y,x,w,b);if(Zs(w))return v(y,x,w,b);yu(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(r(y,x.sibling),x=o(x,w),x.return=y,y=x):(r(y,x),x=bg(w,y.mode,b),x.return=y,y=x),a(y)):r(y,x)}return _}var vs=$2(!0),k2=$2(!1),$c={},eo=Ei($c),ac=Ei($c),sc=Ei($c);function Ki(e){if(e===$c)throw Error(q(174));return e}function C0(e,t){switch(it(sc,t),it(ac,e),it(eo,$c),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Sv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Sv(t,e)}dt(eo),it(eo,t)}function ys(){dt(eo),dt(ac),dt(sc)}function R2(e){Ki(sc.current);var t=Ki(eo.current),r=Sv(t,e.type);t!==r&&(it(ac,e),it(eo,r))}function E0(e){ac.current===e&&(dt(eo),dt(ac))}var yt=Ei(0);function Wd(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mg=[];function $0(){for(var e=0;e<mg.length;e++)mg[e]._workInProgressVersionPrimary=null;mg.length=0}var cd=Ao.ReactCurrentDispatcher,gg=Ao.ReactCurrentBatchConfig,na=0,xt=null,Lt=null,Ft=null,Hd=!1,Al=!1,lc=0,Vz=0;function tr(){throw Error(q(321))}function k0(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!$n(e[r],t[r]))return!1;return!0}function R0(e,t,r,n,o,i){if(na=i,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,cd.current=e===null||e.memoizedState===null?Hz:qz,e=r(n,o),Al){i=0;do{if(Al=!1,lc=0,25<=i)throw Error(q(301));i+=1,Ft=Lt=null,t.updateQueue=null,cd.current=Gz,e=r(n,o)}while(Al)}if(cd.current=qd,t=Lt!==null&&Lt.next!==null,na=0,Ft=Lt=xt=null,Hd=!1,t)throw Error(q(300));return e}function T0(){var e=lc!==0;return lc=0,e}function Hn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ft===null?xt.memoizedState=Ft=e:Ft=Ft.next=e,Ft}function hn(){if(Lt===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Lt.next;var t=Ft===null?xt.memoizedState:Ft.next;if(t!==null)Ft=t,Lt=e;else{if(e===null)throw Error(q(310));Lt=e,e={memoizedState:Lt.memoizedState,baseState:Lt.baseState,baseQueue:Lt.baseQueue,queue:Lt.queue,next:null},Ft===null?xt.memoizedState=Ft=e:Ft=Ft.next=e}return Ft}function cc(e,t){return typeof t=="function"?t(e):t}function vg(e){var t=hn(),r=t.queue;if(r===null)throw Error(q(311));r.lastRenderedReducer=e;var n=Lt,o=n.baseQueue,i=r.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}n.baseQueue=o=i,r.pending=null}if(o!==null){i=o.next,n=n.baseState;var l=a=null,c=null,u=i;do{var d=u.lane;if((na&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var p={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=p,a=n):c=c.next=p,xt.lanes|=d,oa|=d}u=u.next}while(u!==null&&u!==i);c===null?a=n:c.next=l,$n(n,t.memoizedState)||(Cr=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){o=e;do i=o.lane,xt.lanes|=i,oa|=i,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function yg(e){var t=hn(),r=t.queue;if(r===null)throw Error(q(311));r.lastRenderedReducer=e;var n=r.dispatch,o=r.pending,i=t.memoizedState;if(o!==null){r.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);$n(i,t.memoizedState)||(Cr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function T2(){}function I2(e,t){var r=xt,n=hn(),o=t(),i=!$n(n.memoizedState,o);if(i&&(n.memoizedState=o,Cr=!0),n=n.queue,I0(A2.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Ft!==null&&Ft.memoizedState.tag&1){if(r.flags|=2048,uc(9,N2.bind(null,r,n,o,t),void 0,null),Bt===null)throw Error(q(349));na&30||D2(r,t,o)}return o}function D2(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function N2(e,t,r,n){t.value=r,t.getSnapshot=n,M2(t)&&L2(e)}function A2(e,t,r){return r(function(){M2(t)&&L2(e)})}function M2(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!$n(e,r)}catch{return!0}}function L2(e){var t=Co(e,1);t!==null&&En(t,e,1,-1)}function ib(e){var t=Hn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:cc,lastRenderedState:e},t.queue=e,e=e.dispatch=Wz.bind(null,xt,e),[t.memoizedState,e]}function uc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function z2(){return hn().memoizedState}function ud(e,t,r,n){var o=Hn();xt.flags|=e,o.memoizedState=uc(1|t,r,void 0,n===void 0?null:n)}function Xh(e,t,r,n){var o=hn();n=n===void 0?null:n;var i=void 0;if(Lt!==null){var a=Lt.memoizedState;if(i=a.destroy,n!==null&&k0(n,a.deps)){o.memoizedState=uc(t,r,i,n);return}}xt.flags|=e,o.memoizedState=uc(1|t,r,i,n)}function ab(e,t){return ud(8390656,8,e,t)}function I0(e,t){return Xh(2048,8,e,t)}function F2(e,t){return Xh(4,2,e,t)}function V2(e,t){return Xh(4,4,e,t)}function B2(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function U2(e,t,r){return r=r!=null?r.concat([e]):null,Xh(4,4,B2.bind(null,t,e),r)}function D0(){}function W2(e,t){var r=hn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&k0(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function H2(e,t){var r=hn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&k0(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function q2(e,t,r){return na&21?($n(r,t)||(r=K$(),xt.lanes|=r,oa|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Cr=!0),e.memoizedState=r)}function Bz(e,t){var r=He;He=r!==0&&4>r?r:4,e(!0);var n=gg.transition;gg.transition={};try{e(!1),t()}finally{He=r,gg.transition=n}}function G2(){return hn().memoizedState}function Uz(e,t,r){var n=gi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Q2(e))K2(t,r);else if(r=j2(e,t,r,n),r!==null){var o=vr();En(r,e,n,o),Y2(r,t,n)}}function Wz(e,t,r){var n=gi(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Q2(e))K2(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,r);if(o.hasEagerState=!0,o.eagerState=l,$n(l,a)){var c=t.interleaved;c===null?(o.next=o,j0(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}r=j2(e,t,o,n),r!==null&&(o=vr(),En(r,e,n,o),Y2(r,t,n))}}function Q2(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function K2(e,t){Al=Hd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Y2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,d0(e,r)}}var qd={readContext:pn,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useInsertionEffect:tr,useLayoutEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useMutableSource:tr,useSyncExternalStore:tr,useId:tr,unstable_isNewReconciler:!1},Hz={readContext:pn,useCallback:function(e,t){return Hn().memoizedState=[e,t===void 0?null:t],e},useContext:pn,useEffect:ab,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ud(4194308,4,B2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ud(4194308,4,e,t)},useInsertionEffect:function(e,t){return ud(4,2,e,t)},useMemo:function(e,t){var r=Hn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Hn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=Uz.bind(null,xt,e),[n.memoizedState,e]},useRef:function(e){var t=Hn();return e={current:e},t.memoizedState=e},useState:ib,useDebugValue:D0,useDeferredValue:function(e){return Hn().memoizedState=e},useTransition:function(){var e=ib(!1),t=e[0];return e=Bz.bind(null,e[1]),Hn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=xt,o=Hn();if(pt){if(r===void 0)throw Error(q(407));r=r()}else{if(r=t(),Bt===null)throw Error(q(349));na&30||D2(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,ab(A2.bind(null,n,i,e),[e]),n.flags|=2048,uc(9,N2.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Hn(),t=Bt.identifierPrefix;if(pt){var r=wo,n=xo;r=(n&~(1<<32-Cn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=lc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Vz++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},qz={readContext:pn,useCallback:W2,useContext:pn,useEffect:I0,useImperativeHandle:U2,useInsertionEffect:F2,useLayoutEffect:V2,useMemo:H2,useReducer:vg,useRef:z2,useState:function(){return vg(cc)},useDebugValue:D0,useDeferredValue:function(e){var t=hn();return q2(t,Lt.memoizedState,e)},useTransition:function(){var e=vg(cc)[0],t=hn().memoizedState;return[e,t]},useMutableSource:T2,useSyncExternalStore:I2,useId:G2,unstable_isNewReconciler:!1},Gz={readContext:pn,useCallback:W2,useContext:pn,useEffect:I0,useImperativeHandle:U2,useInsertionEffect:F2,useLayoutEffect:V2,useMemo:H2,useReducer:yg,useRef:z2,useState:function(){return yg(cc)},useDebugValue:D0,useDeferredValue:function(e){var t=hn();return Lt===null?t.memoizedState=e:q2(t,Lt.memoizedState,e)},useTransition:function(){var e=yg(cc)[0],t=hn().memoizedState;return[e,t]},useMutableSource:T2,useSyncExternalStore:I2,useId:G2,unstable_isNewReconciler:!1};function xs(e,t){try{var r="",n=t;do r+=b7(n),n=n.return;while(n);var o=r}catch(i){o=`
86
+ Error generating stack: `+i.message+`
87
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function xg(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function qv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Qz=typeof WeakMap=="function"?WeakMap:Map;function X2(e,t,r){r=bo(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Qd||(Qd=!0,ry=n),qv(e,t)},r}function J2(e,t,r){r=bo(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var o=t.value;r.payload=function(){return n(o)},r.callback=function(){qv(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){qv(e,t),typeof n!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),r}function sb(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Qz;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(r)||(o.add(r),e=l8.bind(null,e,t,r),t.then(e,e))}function lb(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function cb(e,t,r,n,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=bo(-1,1),t.tag=2,hi(r,t,1))),r.lanes|=1),e)}var Kz=Ao.ReactCurrentOwner,Cr=!1;function hr(e,t,r,n){t.child=e===null?k2(t,null,r,n):vs(t,e.child,r,n)}function ub(e,t,r,n,o){r=r.render;var i=t.ref;return ss(t,o),n=R0(e,t,r,n,i,o),r=T0(),e!==null&&!Cr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Eo(e,t,o)):(pt&&r&&x0(t),t.flags|=1,hr(e,t,n,o),t.child)}function db(e,t,r,n,o){if(e===null){var i=r.type;return typeof i=="function"&&!B0(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,Z2(e,t,i,n,o)):(e=hd(r.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(r=r.compare,r=r!==null?r:rc,r(a,n)&&e.ref===t.ref)return Eo(e,t,o)}return t.flags|=1,e=vi(i,n),e.ref=t.ref,e.return=t,t.child=e}function Z2(e,t,r,n,o){if(e!==null){var i=e.memoizedProps;if(rc(i,n)&&e.ref===t.ref)if(Cr=!1,t.pendingProps=n=i,(e.lanes&o)!==0)e.flags&131072&&(Cr=!0);else return t.lanes=e.lanes,Eo(e,t,o)}return Gv(e,t,r,n,o)}function ek(e,t,r){var n=t.pendingProps,o=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},it(Ja,Wr),Wr|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,it(Ja,Wr),Wr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,it(Ja,Wr),Wr|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,it(Ja,Wr),Wr|=n;return hr(e,t,o,r),t.child}function tk(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Gv(e,t,r,n,o){var i=kr(r)?ta:lr.current;return i=ms(t,i),ss(t,o),r=R0(e,t,r,n,i,o),n=T0(),e!==null&&!Cr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Eo(e,t,o)):(pt&&n&&x0(t),t.flags|=1,hr(e,t,r,o),t.child)}function fb(e,t,r,n,o){if(kr(r)){var i=!0;Ld(t)}else i=!1;if(ss(t,o),t.stateNode===null)dd(e,t),E2(t,r,n),Hv(t,r,n,o),n=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=r.contextType;typeof u=="object"&&u!==null?u=pn(u):(u=kr(r)?ta:lr.current,u=ms(t,u));var d=r.getDerivedStateFromProps,p=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";p||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==n||c!==u)&&nb(t,a,n,u),ei=!1;var h=t.memoizedState;a.state=h,Ud(t,n,a,o),c=t.memoizedState,l!==n||h!==c||$r.current||ei?(typeof d=="function"&&(Wv(t,r,d,n),c=t.memoizedState),(l=ei||rb(t,r,l,n,h,c,u))?(p||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),a.props=n,a.state=c,a.context=u,n=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,O2(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:_n(t.type,l),a.props=u,p=t.pendingProps,h=a.context,c=r.contextType,typeof c=="object"&&c!==null?c=pn(c):(c=kr(r)?ta:lr.current,c=ms(t,c));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==p||h!==c)&&nb(t,a,n,c),ei=!1,h=t.memoizedState,a.state=h,Ud(t,n,a,o);var g=t.memoizedState;l!==p||h!==g||$r.current||ei?(typeof m=="function"&&(Wv(t,r,m,n),g=t.memoizedState),(u=ei||rb(t,r,u,n,h,g,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,g,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,g,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),a.props=n,a.state=g,a.context=c,n=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Qv(e,t,r,n,i,o)}function Qv(e,t,r,n,o,i){tk(e,t);var a=(t.flags&128)!==0;if(!n&&!a)return o&&Xw(t,r,!1),Eo(e,t,i);n=t.stateNode,Kz.current=t;var l=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&a?(t.child=vs(t,e.child,null,i),t.child=vs(t,null,l,i)):hr(e,t,l,i),t.memoizedState=n.state,o&&Xw(t,r,!0),t.child}function rk(e){var t=e.stateNode;t.pendingContext?Yw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Yw(e,t.context,!1),C0(e,t.containerInfo)}function pb(e,t,r,n,o){return gs(),b0(o),t.flags|=256,hr(e,t,r,n),t.child}var Kv={dehydrated:null,treeContext:null,retryLane:0};function Yv(e){return{baseLanes:e,cachePool:null,transitions:null}}function nk(e,t,r){var n=t.pendingProps,o=yt.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),it(yt,o&1),e===null)return Bv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=n.children,e=n.fallback,i?(n=t.mode,i=t.child,a={mode:"hidden",children:a},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=em(a,n,0,null),e=Zi(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Yv(r),t.memoizedState=Kv,e):N0(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return Yz(e,t,a,n,l,o,r);if(i){i=n.fallback,a=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:n.children};return!(a&1)&&t.child!==o?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=vi(o,c),n.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=vi(l,i):(i=Zi(i,a,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,a=e.child.memoizedState,a=a===null?Yv(r):{baseLanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~r,t.memoizedState=Kv,n}return i=e.child,e=i.sibling,n=vi(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function N0(e,t){return t=em({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xu(e,t,r,n){return n!==null&&b0(n),vs(t,e.child,null,r),e=N0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yz(e,t,r,n,o,i,a){if(r)return t.flags&256?(t.flags&=-257,n=xg(Error(q(422))),xu(e,t,a,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,o=t.mode,n=em({mode:"visible",children:n.children},o,0,null),i=Zi(i,o,a,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&vs(t,e.child,null,a),t.child.memoizedState=Yv(a),t.memoizedState=Kv,i);if(!(t.mode&1))return xu(e,t,a,null);if(o.data==="$!"){if(n=o.nextSibling&&o.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(q(419)),n=xg(i,n,void 0),xu(e,t,a,n)}if(l=(a&e.childLanes)!==0,Cr||l){if(n=Bt,n!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(n.suspendedLanes|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Co(e,o),En(n,e,o,-1))}return V0(),n=xg(Error(q(421))),xu(e,t,a,n)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=c8.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,qr=pi(o.nextSibling),Qr=t,pt=!0,jn=null,e!==null&&(on[an++]=xo,on[an++]=wo,on[an++]=ra,xo=e.id,wo=e.overflow,ra=t),t=N0(t,n.children),t.flags|=4096,t)}function hb(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Uv(e.return,t,r)}function wg(e,t,r,n,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=o)}function ok(e,t,r){var n=t.pendingProps,o=n.revealOrder,i=n.tail;if(hr(e,t,n.children,r),n=yt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hb(e,r,t);else if(e.tag===19)hb(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(it(yt,n),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(r=t.child,o=null;r!==null;)e=r.alternate,e!==null&&Wd(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),wg(t,!1,o,r,i);break;case"backwards":for(r=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Wd(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}wg(t,!0,r,null,i);break;case"together":wg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function dd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Eo(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),oa|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,r=vi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=vi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Xz(e,t,r){switch(t.tag){case 3:rk(t),gs();break;case 5:R2(t);break;case 1:kr(t.type)&&Ld(t);break;case 4:C0(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,o=t.memoizedProps.value;it(Vd,n._currentValue),n._currentValue=o;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(it(yt,yt.current&1),t.flags|=128,null):r&t.child.childLanes?nk(e,t,r):(it(yt,yt.current&1),e=Eo(e,t,r),e!==null?e.sibling:null);it(yt,yt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return ok(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),it(yt,yt.current),n)break;return null;case 22:case 23:return t.lanes=0,ek(e,t,r)}return Eo(e,t,r)}var ik,Xv,ak,sk;ik=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Xv=function(){};ak=function(e,t,r,n){var o=e.memoizedProps;if(o!==n){e=t.stateNode,Ki(eo.current);var i=null;switch(r){case"input":o=xv(e,o),n=xv(e,n),i=[];break;case"select":o=wt({},o,{value:void 0}),n=wt({},n,{value:void 0}),i=[];break;case"textarea":o=_v(e,o),n=_v(e,n),i=[];break;default:typeof o.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Ad)}Pv(r,n);var a;r=null;for(u in o)if(!n.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Kl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=o!=null?o[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Kl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ct("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};sk=function(e,t,r,n){r!==n&&(t.flags|=4)};function il(e,t){if(!pt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function rr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var o=e.child;o!==null;)r|=o.lanes|o.childLanes,n|=o.subtreeFlags&14680064,n|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)r|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Jz(e,t,r){var n=t.pendingProps;switch(w0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rr(t),null;case 1:return kr(t.type)&&Md(),rr(t),null;case 3:return n=t.stateNode,ys(),dt($r),dt(lr),$0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(vu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,jn!==null&&(iy(jn),jn=null))),Xv(e,t),rr(t),null;case 5:E0(t);var o=Ki(sc.current);if(r=t.type,e!==null&&t.stateNode!=null)ak(e,t,r,n,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(q(166));return rr(t),null}if(e=Ki(eo.current),vu(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Yn]=t,n[ic]=i,e=(t.mode&1)!==0,r){case"dialog":ct("cancel",n),ct("close",n);break;case"iframe":case"object":case"embed":ct("load",n);break;case"video":case"audio":for(o=0;o<Ol.length;o++)ct(Ol[o],n);break;case"source":ct("error",n);break;case"img":case"image":case"link":ct("error",n),ct("load",n);break;case"details":ct("toggle",n);break;case"input":Sw(n,i),ct("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},ct("invalid",n);break;case"textarea":jw(n,i),ct("invalid",n)}Pv(r,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&gu(n.textContent,l,e),o=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&gu(n.textContent,l,e),o=["children",""+l]):Kl.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&ct("scroll",n)}switch(r){case"input":lu(n),Pw(n,i,!0);break;case"textarea":lu(n),Ow(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Ad)}n=o,t.updateQueue=n,n!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=D$(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[Yn]=t,e[ic]=n,ik(e,t,!1,!1),t.stateNode=e;e:{switch(a=jv(r,n),r){case"dialog":ct("cancel",e),ct("close",e),o=n;break;case"iframe":case"object":case"embed":ct("load",e),o=n;break;case"video":case"audio":for(o=0;o<Ol.length;o++)ct(Ol[o],e);o=n;break;case"source":ct("error",e),o=n;break;case"img":case"image":case"link":ct("error",e),ct("load",e),o=n;break;case"details":ct("toggle",e),o=n;break;case"input":Sw(e,n),o=xv(e,n),ct("invalid",e);break;case"option":o=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},o=wt({},n,{value:void 0}),ct("invalid",e);break;case"textarea":jw(e,n),o=_v(e,n),ct("invalid",e);break;default:o=n}Pv(r,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?M$(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&N$(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Yl(e,c):typeof c=="number"&&Yl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Kl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&ct("scroll",e):c!=null&&i0(e,i,c,a))}switch(r){case"input":lu(e),Pw(e,n,!1);break;case"textarea":lu(e),Ow(e);break;case"option":n.value!=null&&e.setAttribute("value",""+wi(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?ns(e,!!n.multiple,i,!1):n.defaultValue!=null&&ns(e,!!n.multiple,n.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ad)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return rr(t),null;case 6:if(e&&t.stateNode!=null)sk(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(q(166));if(r=Ki(sc.current),Ki(eo.current),vu(t)){if(n=t.stateNode,r=t.memoizedProps,n[Yn]=t,(i=n.nodeValue!==r)&&(e=Qr,e!==null))switch(e.tag){case 3:gu(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gu(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Yn]=t,t.stateNode=n}return rr(t),null;case 13:if(dt(yt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pt&&qr!==null&&t.mode&1&&!(t.flags&128))P2(),gs(),t.flags|=98560,i=!1;else if(i=vu(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(q(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(q(317));i[Yn]=t}else gs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;rr(t),i=!1}else jn!==null&&(iy(jn),jn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||yt.current&1?zt===0&&(zt=3):V0())),t.updateQueue!==null&&(t.flags|=4),rr(t),null);case 4:return ys(),Xv(e,t),e===null&&nc(t.stateNode.containerInfo),rr(t),null;case 10:return P0(t.type._context),rr(t),null;case 17:return kr(t.type)&&Md(),rr(t),null;case 19:if(dt(yt),i=t.memoizedState,i===null)return rr(t),null;if(n=(t.flags&128)!==0,a=i.rendering,a===null)if(n)il(i,!1);else{if(zt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Wd(e),a!==null){for(t.flags|=128,il(i,!1),n=a.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return it(yt,yt.current&1|2),t.child}e=e.sibling}i.tail!==null&&$t()>ws&&(t.flags|=128,n=!0,il(i,!1),t.lanes=4194304)}else{if(!n)if(e=Wd(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),il(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!pt)return rr(t),null}else 2*$t()-i.renderingStartTime>ws&&r!==1073741824&&(t.flags|=128,n=!0,il(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(r=i.last,r!==null?r.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$t(),t.sibling=null,r=yt.current,it(yt,n?r&1|2:r&1),t):(rr(t),null);case 22:case 23:return F0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Wr&1073741824&&(rr(t),t.subtreeFlags&6&&(t.flags|=8192)):rr(t),null;case 24:return null;case 25:return null}throw Error(q(156,t.tag))}function Zz(e,t){switch(w0(t),t.tag){case 1:return kr(t.type)&&Md(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ys(),dt($r),dt(lr),$0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return E0(t),null;case 13:if(dt(yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return dt(yt),null;case 4:return ys(),null;case 10:return P0(t.type._context),null;case 22:case 23:return F0(),null;case 24:return null;default:return null}}var wu=!1,or=!1,e8=typeof WeakSet=="function"?WeakSet:Set,se=null;function Xa(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){St(e,t,n)}else r.current=null}function Jv(e,t,r){try{r()}catch(n){St(e,t,n)}}var mb=!1;function t8(e,t){if(Nv=Id,e=d2(),y0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var a=0,l=-1,c=-1,u=0,d=0,p=e,h=null;t:for(;;){for(var m;p!==r||o!==0&&p.nodeType!==3||(l=a+o),p!==i||n!==0&&p.nodeType!==3||(c=a+n),p.nodeType===3&&(a+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===r&&++u===o&&(l=a),h===i&&++d===n&&(c=a),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Av={focusedElem:e,selectionRange:r},Id=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,_=g.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:_n(t.type,v),_);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(b){St(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return g=mb,mb=!1,g}function Ml(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Jv(t,r,i)}o=o.next}while(o!==n)}}function Jh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Zv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function lk(e){var t=e.alternate;t!==null&&(e.alternate=null,lk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yn],delete t[ic],delete t[zv],delete t[Mz],delete t[Lz])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ck(e){return e.tag===5||e.tag===3||e.tag===4}function gb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ck(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ey(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ad));else if(n!==4&&(e=e.child,e!==null))for(ey(e,t,r),e=e.sibling;e!==null;)ey(e,t,r),e=e.sibling}function ty(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(ty(e,t,r),e=e.sibling;e!==null;)ty(e,t,r),e=e.sibling}var Qt=null,Sn=!1;function Ko(e,t,r){for(r=r.child;r!==null;)uk(e,t,r),r=r.sibling}function uk(e,t,r){if(Zn&&typeof Zn.onCommitFiberUnmount=="function")try{Zn.onCommitFiberUnmount(Wh,r)}catch{}switch(r.tag){case 5:or||Xa(r,t);case 6:var n=Qt,o=Sn;Qt=null,Ko(e,t,r),Qt=n,Sn=o,Qt!==null&&(Sn?(e=Qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Qt.removeChild(r.stateNode));break;case 18:Qt!==null&&(Sn?(e=Qt,r=r.stateNode,e.nodeType===8?pg(e.parentNode,r):e.nodeType===1&&pg(e,r),ec(e)):pg(Qt,r.stateNode));break;case 4:n=Qt,o=Sn,Qt=r.stateNode.containerInfo,Sn=!0,Ko(e,t,r),Qt=n,Sn=o;break;case 0:case 11:case 14:case 15:if(!or&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Jv(r,t,a),o=o.next}while(o!==n)}Ko(e,t,r);break;case 1:if(!or&&(Xa(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){St(r,t,l)}Ko(e,t,r);break;case 21:Ko(e,t,r);break;case 22:r.mode&1?(or=(n=or)||r.memoizedState!==null,Ko(e,t,r),or=n):Ko(e,t,r);break;default:Ko(e,t,r)}}function vb(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new e8),t.forEach(function(n){var o=u8.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function xn(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var o=r[n];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:Qt=l.stateNode,Sn=!1;break e;case 3:Qt=l.stateNode.containerInfo,Sn=!0;break e;case 4:Qt=l.stateNode.containerInfo,Sn=!0;break e}l=l.return}if(Qt===null)throw Error(q(160));uk(i,a,o),Qt=null,Sn=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){St(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)dk(t,e),t=t.sibling}function dk(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xn(t,e),Bn(e),n&4){try{Ml(3,e,e.return),Jh(3,e)}catch(v){St(e,e.return,v)}try{Ml(5,e,e.return)}catch(v){St(e,e.return,v)}}break;case 1:xn(t,e),Bn(e),n&512&&r!==null&&Xa(r,r.return);break;case 5:if(xn(t,e),Bn(e),n&512&&r!==null&&Xa(r,r.return),e.flags&32){var o=e.stateNode;try{Yl(o,"")}catch(v){St(e,e.return,v)}}if(n&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&T$(o,i),jv(l,a);var u=jv(l,i);for(a=0;a<c.length;a+=2){var d=c[a],p=c[a+1];d==="style"?M$(o,p):d==="dangerouslySetInnerHTML"?N$(o,p):d==="children"?Yl(o,p):i0(o,d,p,u)}switch(l){case"input":wv(o,i);break;case"textarea":I$(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?ns(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?ns(o,!!i.multiple,i.defaultValue,!0):ns(o,!!i.multiple,i.multiple?[]:"",!1))}o[ic]=i}catch(v){St(e,e.return,v)}}break;case 6:if(xn(t,e),Bn(e),n&4){if(e.stateNode===null)throw Error(q(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){St(e,e.return,v)}}break;case 3:if(xn(t,e),Bn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ec(t.containerInfo)}catch(v){St(e,e.return,v)}break;case 4:xn(t,e),Bn(e);break;case 13:xn(t,e),Bn(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(L0=$t())),n&4&&vb(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(or=(u=or)||d,xn(t,e),or=u):xn(t,e),Bn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(se=e,d=e.child;d!==null;){for(p=se=d;se!==null;){switch(h=se,m=h.child,h.tag){case 0:case 11:case 14:case 15:Ml(4,h,h.return);break;case 1:Xa(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){St(n,r,v)}}break;case 5:Xa(h,h.return);break;case 22:if(h.memoizedState!==null){xb(p);continue}}m!==null?(m.return=h,se=m):xb(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{o=p.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=p.stateNode,c=p.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=A$("display",a))}catch(v){St(e,e.return,v)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(v){St(e,e.return,v)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:xn(t,e),Bn(e),n&4&&vb(e);break;case 21:break;default:xn(t,e),Bn(e)}}function Bn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(ck(r)){var n=r;break e}r=r.return}throw Error(q(160))}switch(n.tag){case 5:var o=n.stateNode;n.flags&32&&(Yl(o,""),n.flags&=-33);var i=gb(e);ty(e,i,o);break;case 3:case 4:var a=n.stateNode.containerInfo,l=gb(e);ey(e,l,a);break;default:throw Error(q(161))}}catch(c){St(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function r8(e,t,r){se=e,fk(e)}function fk(e,t,r){for(var n=(e.mode&1)!==0;se!==null;){var o=se,i=o.child;if(o.tag===22&&n){var a=o.memoizedState!==null||wu;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||or;l=wu;var u=or;if(wu=a,(or=c)&&!u)for(se=o;se!==null;)a=se,c=a.child,a.tag===22&&a.memoizedState!==null?wb(o):c!==null?(c.return=a,se=c):wb(o);for(;i!==null;)se=i,fk(i),i=i.sibling;se=o,wu=l,or=u}yb(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,se=i):yb(e)}}function yb(e){for(;se!==null;){var t=se;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:or||Jh(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!or)if(r===null)n.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:_n(t.type,r.memoizedProps);n.componentDidUpdate(o,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&tb(t,i,n);break;case 3:var a=t.updateQueue;if(a!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}tb(t,a,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&ec(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}or||t.flags&512&&Zv(t)}catch(h){St(t,t.return,h)}}if(t===e){se=null;break}if(r=t.sibling,r!==null){r.return=t.return,se=r;break}se=t.return}}function xb(e){for(;se!==null;){var t=se;if(t===e){se=null;break}var r=t.sibling;if(r!==null){r.return=t.return,se=r;break}se=t.return}}function wb(e){for(;se!==null;){var t=se;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Jh(4,t)}catch(c){St(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var o=t.return;try{n.componentDidMount()}catch(c){St(t,o,c)}}var i=t.return;try{Zv(t)}catch(c){St(t,i,c)}break;case 5:var a=t.return;try{Zv(t)}catch(c){St(t,a,c)}}}catch(c){St(t,t.return,c)}if(t===e){se=null;break}var l=t.sibling;if(l!==null){l.return=t.return,se=l;break}se=t.return}}var n8=Math.ceil,Gd=Ao.ReactCurrentDispatcher,A0=Ao.ReactCurrentOwner,un=Ao.ReactCurrentBatchConfig,Me=0,Bt=null,Dt=null,Jt=0,Wr=0,Ja=Ei(0),zt=0,dc=null,oa=0,Zh=0,M0=0,Ll=null,Or=null,L0=0,ws=1/0,go=null,Qd=!1,ry=null,mi=null,bu=!1,ai=null,Kd=0,zl=0,ny=null,fd=-1,pd=0;function vr(){return Me&6?$t():fd!==-1?fd:fd=$t()}function gi(e){return e.mode&1?Me&2&&Jt!==0?Jt&-Jt:Fz.transition!==null?(pd===0&&(pd=K$()),pd):(e=He,e!==0||(e=window.event,e=e===void 0?16:r2(e.type)),e):1}function En(e,t,r,n){if(50<zl)throw zl=0,ny=null,Error(q(185));Oc(e,r,n),(!(Me&2)||e!==Bt)&&(e===Bt&&(!(Me&2)&&(Zh|=r),zt===4&&oi(e,Jt)),Rr(e,n),r===1&&Me===0&&!(t.mode&1)&&(ws=$t()+500,Kh&&$i()))}function Rr(e,t){var r=e.callbackNode;F7(e,t);var n=Td(e,e===Bt?Jt:0);if(n===0)r!==null&&$w(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&$w(r),t===1)e.tag===0?zz(bb.bind(null,e)):b2(bb.bind(null,e)),Nz(function(){!(Me&6)&&$i()}),r=null;else{switch(Y$(n)){case 1:r=u0;break;case 4:r=G$;break;case 16:r=Rd;break;case 536870912:r=Q$;break;default:r=Rd}r=wk(r,pk.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function pk(e,t){if(fd=-1,pd=0,Me&6)throw Error(q(327));var r=e.callbackNode;if(ls()&&e.callbackNode!==r)return null;var n=Td(e,e===Bt?Jt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Yd(e,n);else{t=n;var o=Me;Me|=2;var i=mk();(Bt!==e||Jt!==t)&&(go=null,ws=$t()+500,Ji(e,t));do try{a8();break}catch(l){hk(e,l)}while(!0);S0(),Gd.current=i,Me=o,Dt!==null?t=0:(Bt=null,Jt=0,t=zt)}if(t!==0){if(t===2&&(o=kv(e),o!==0&&(n=o,t=oy(e,o))),t===1)throw r=dc,Ji(e,0),oi(e,n),Rr(e,$t()),r;if(t===6)oi(e,n);else{if(o=e.current.alternate,!(n&30)&&!o8(o)&&(t=Yd(e,n),t===2&&(i=kv(e),i!==0&&(n=i,t=oy(e,i))),t===1))throw r=dc,Ji(e,0),oi(e,n),Rr(e,$t()),r;switch(e.finishedWork=o,e.finishedLanes=n,t){case 0:case 1:throw Error(q(345));case 2:Bi(e,Or,go);break;case 3:if(oi(e,n),(n&130023424)===n&&(t=L0+500-$t(),10<t)){if(Td(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){vr(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Lv(Bi.bind(null,e,Or,go),t);break}Bi(e,Or,go);break;case 4:if(oi(e,n),(n&4194240)===n)break;for(t=e.eventTimes,o=-1;0<n;){var a=31-Cn(n);i=1<<a,a=t[a],a>o&&(o=a),n&=~i}if(n=o,n=$t()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*n8(n/1960))-n,10<n){e.timeoutHandle=Lv(Bi.bind(null,e,Or,go),n);break}Bi(e,Or,go);break;case 5:Bi(e,Or,go);break;default:throw Error(q(329))}}}return Rr(e,$t()),e.callbackNode===r?pk.bind(null,e):null}function oy(e,t){var r=Ll;return e.current.memoizedState.isDehydrated&&(Ji(e,t).flags|=256),e=Yd(e,t),e!==2&&(t=Or,Or=r,t!==null&&iy(t)),e}function iy(e){Or===null?Or=e:Or.push.apply(Or,e)}function o8(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var o=r[n],i=o.getSnapshot;o=o.value;try{if(!$n(i(),o))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function oi(e,t){for(t&=~M0,t&=~Zh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Cn(t),n=1<<r;e[r]=-1,t&=~n}}function bb(e){if(Me&6)throw Error(q(327));ls();var t=Td(e,0);if(!(t&1))return Rr(e,$t()),null;var r=Yd(e,t);if(e.tag!==0&&r===2){var n=kv(e);n!==0&&(t=n,r=oy(e,n))}if(r===1)throw r=dc,Ji(e,0),oi(e,t),Rr(e,$t()),r;if(r===6)throw Error(q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Bi(e,Or,go),Rr(e,$t()),null}function z0(e,t){var r=Me;Me|=1;try{return e(t)}finally{Me=r,Me===0&&(ws=$t()+500,Kh&&$i())}}function ia(e){ai!==null&&ai.tag===0&&!(Me&6)&&ls();var t=Me;Me|=1;var r=un.transition,n=He;try{if(un.transition=null,He=1,e)return e()}finally{He=n,un.transition=r,Me=t,!(Me&6)&&$i()}}function F0(){Wr=Ja.current,dt(Ja)}function Ji(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Dz(r)),Dt!==null)for(r=Dt.return;r!==null;){var n=r;switch(w0(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Md();break;case 3:ys(),dt($r),dt(lr),$0();break;case 5:E0(n);break;case 4:ys();break;case 13:dt(yt);break;case 19:dt(yt);break;case 10:P0(n.type._context);break;case 22:case 23:F0()}r=r.return}if(Bt=e,Dt=e=vi(e.current,null),Jt=Wr=t,zt=0,dc=null,M0=Zh=oa=0,Or=Ll=null,Qi!==null){for(t=0;t<Qi.length;t++)if(r=Qi[t],n=r.interleaved,n!==null){r.interleaved=null;var o=n.next,i=r.pending;if(i!==null){var a=i.next;i.next=o,n.next=a}r.pending=n}Qi=null}return e}function hk(e,t){do{var r=Dt;try{if(S0(),cd.current=qd,Hd){for(var n=xt.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}Hd=!1}if(na=0,Ft=Lt=xt=null,Al=!1,lc=0,A0.current=null,r===null||r.return===null){zt=1,dc=t,Dt=null;break}e:{var i=e,a=r.return,l=r,c=t;if(t=Jt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=lb(a);if(m!==null){m.flags&=-257,cb(m,a,l,i,t),m.mode&1&&sb(i,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){sb(i,u,t),V0();break e}c=Error(q(426))}}else if(pt&&l.mode&1){var _=lb(a);if(_!==null){!(_.flags&65536)&&(_.flags|=256),cb(_,a,l,i,t),b0(xs(c,l));break e}}i=c=xs(c,l),zt!==4&&(zt=2),Ll===null?Ll=[i]:Ll.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=X2(i,c,t);eb(i,y);break e;case 1:l=c;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(mi===null||!mi.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=J2(i,l,t);eb(i,b);break e}}i=i.return}while(i!==null)}vk(r)}catch(j){t=j,Dt===r&&r!==null&&(Dt=r=r.return);continue}break}while(!0)}function mk(){var e=Gd.current;return Gd.current=qd,e===null?qd:e}function V0(){(zt===0||zt===3||zt===2)&&(zt=4),Bt===null||!(oa&268435455)&&!(Zh&268435455)||oi(Bt,Jt)}function Yd(e,t){var r=Me;Me|=2;var n=mk();(Bt!==e||Jt!==t)&&(go=null,Ji(e,t));do try{i8();break}catch(o){hk(e,o)}while(!0);if(S0(),Me=r,Gd.current=n,Dt!==null)throw Error(q(261));return Bt=null,Jt=0,zt}function i8(){for(;Dt!==null;)gk(Dt)}function a8(){for(;Dt!==null&&!R7();)gk(Dt)}function gk(e){var t=xk(e.alternate,e,Wr);e.memoizedProps=e.pendingProps,t===null?vk(e):Dt=t,A0.current=null}function vk(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Zz(r,t),r!==null){r.flags&=32767,Dt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{zt=6,Dt=null;return}}else if(r=Jz(r,t,Wr),r!==null){Dt=r;return}if(t=t.sibling,t!==null){Dt=t;return}Dt=t=e}while(t!==null);zt===0&&(zt=5)}function Bi(e,t,r){var n=He,o=un.transition;try{un.transition=null,He=1,s8(e,t,r,n)}finally{un.transition=o,He=n}return null}function s8(e,t,r,n){do ls();while(ai!==null);if(Me&6)throw Error(q(327));r=e.finishedWork;var o=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(q(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(V7(e,i),e===Bt&&(Dt=Bt=null,Jt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||bu||(bu=!0,wk(Rd,function(){return ls(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=un.transition,un.transition=null;var a=He;He=1;var l=Me;Me|=4,A0.current=null,t8(e,r),dk(r,e),Cz(Av),Id=!!Nv,Av=Nv=null,e.current=r,r8(r),T7(),Me=l,He=a,un.transition=i}else e.current=r;if(bu&&(bu=!1,ai=e,Kd=o),i=e.pendingLanes,i===0&&(mi=null),N7(r.stateNode),Rr(e,$t()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],n(o.value,{componentStack:o.stack,digest:o.digest});if(Qd)throw Qd=!1,e=ry,ry=null,e;return Kd&1&&e.tag!==0&&ls(),i=e.pendingLanes,i&1?e===ny?zl++:(zl=0,ny=e):zl=0,$i(),null}function ls(){if(ai!==null){var e=Y$(Kd),t=un.transition,r=He;try{if(un.transition=null,He=16>e?16:e,ai===null)var n=!1;else{if(e=ai,ai=null,Kd=0,Me&6)throw Error(q(331));var o=Me;for(Me|=4,se=e.current;se!==null;){var i=se,a=i.child;if(se.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(se=u;se!==null;){var d=se;switch(d.tag){case 0:case 11:case 15:Ml(8,d,i)}var p=d.child;if(p!==null)p.return=d,se=p;else for(;se!==null;){d=se;var h=d.sibling,m=d.return;if(lk(d),d===u){se=null;break}if(h!==null){h.return=m,se=h;break}se=m}}}var g=i.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var _=v.sibling;v.sibling=null,v=_}while(v!==null)}}se=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,se=a;else e:for(;se!==null;){if(i=se,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ml(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,se=y;break e}se=i.return}}var x=e.current;for(se=x;se!==null;){a=se;var w=a.child;if(a.subtreeFlags&2064&&w!==null)w.return=a,se=w;else e:for(a=x;se!==null;){if(l=se,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Jh(9,l)}}catch(j){St(l,l.return,j)}if(l===a){se=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,se=b;break e}se=l.return}}if(Me=o,$i(),Zn&&typeof Zn.onPostCommitFiberRoot=="function")try{Zn.onPostCommitFiberRoot(Wh,e)}catch{}n=!0}return n}finally{He=r,un.transition=t}}return!1}function _b(e,t,r){t=xs(r,t),t=X2(e,t,1),e=hi(e,t,1),t=vr(),e!==null&&(Oc(e,1,t),Rr(e,t))}function St(e,t,r){if(e.tag===3)_b(e,e,r);else for(;t!==null;){if(t.tag===3){_b(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(mi===null||!mi.has(n))){e=xs(r,e),e=J2(t,e,1),t=hi(t,e,1),e=vr(),t!==null&&(Oc(t,1,e),Rr(t,e));break}}t=t.return}}function l8(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=vr(),e.pingedLanes|=e.suspendedLanes&r,Bt===e&&(Jt&r)===r&&(zt===4||zt===3&&(Jt&130023424)===Jt&&500>$t()-L0?Ji(e,0):M0|=r),Rr(e,t)}function yk(e,t){t===0&&(e.mode&1?(t=du,du<<=1,!(du&130023424)&&(du=4194304)):t=1);var r=vr();e=Co(e,t),e!==null&&(Oc(e,t,r),Rr(e,r))}function c8(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),yk(e,r)}function u8(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(q(314))}n!==null&&n.delete(t),yk(e,r)}var xk;xk=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||$r.current)Cr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Cr=!1,Xz(e,t,r);Cr=!!(e.flags&131072)}else Cr=!1,pt&&t.flags&1048576&&_2(t,Fd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;dd(e,t),e=t.pendingProps;var o=ms(t,lr.current);ss(t,r),o=R0(null,t,n,e,o,r);var i=T0();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kr(n)?(i=!0,Ld(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,O0(t),o.updater=Yh,t.stateNode=o,o._reactInternals=t,Hv(t,n,e,r),t=Qv(null,t,n,!0,i,r)):(t.tag=0,pt&&i&&x0(t),hr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(dd(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=f8(n),e=_n(n,e),o){case 0:t=Gv(null,t,n,e,r);break e;case 1:t=fb(null,t,n,e,r);break e;case 11:t=ub(null,t,n,e,r);break e;case 14:t=db(null,t,n,_n(n.type,e),r);break e}throw Error(q(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:_n(n,o),Gv(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:_n(n,o),fb(e,t,n,o,r);case 3:e:{if(rk(t),e===null)throw Error(q(387));n=t.pendingProps,i=t.memoizedState,o=i.element,O2(e,t),Ud(t,n,null,r);var a=t.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=xs(Error(q(423)),t),t=pb(e,t,n,r,o);break e}else if(n!==o){o=xs(Error(q(424)),t),t=pb(e,t,n,r,o);break e}else for(qr=pi(t.stateNode.containerInfo.firstChild),Qr=t,pt=!0,jn=null,r=k2(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(gs(),n===o){t=Eo(e,t,r);break e}hr(e,t,n,r)}t=t.child}return t;case 5:return R2(t),e===null&&Bv(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Mv(n,o)?a=null:i!==null&&Mv(n,i)&&(t.flags|=32),tk(e,t),hr(e,t,a,r),t.child;case 6:return e===null&&Bv(t),null;case 13:return nk(e,t,r);case 4:return C0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=vs(t,null,n,r):hr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:_n(n,o),ub(e,t,n,o,r);case 7:return hr(e,t,t.pendingProps,r),t.child;case 8:return hr(e,t,t.pendingProps.children,r),t.child;case 12:return hr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,it(Vd,n._currentValue),n._currentValue=a,i!==null)if($n(i.value,a)){if(i.children===o.children&&!$r.current){t=Eo(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=bo(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Uv(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(q(341));a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Uv(a,r,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}hr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,ss(t,r),o=pn(o),n=n(o),t.flags|=1,hr(e,t,n,r),t.child;case 14:return n=t.type,o=_n(n,t.pendingProps),o=_n(n.type,o),db(e,t,n,o,r);case 15:return Z2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:_n(n,o),dd(e,t),t.tag=1,kr(n)?(e=!0,Ld(t)):e=!1,ss(t,r),E2(t,n,o),Hv(t,n,o,r),Qv(null,t,n,!0,e,r);case 19:return ok(e,t,r);case 22:return ek(e,t,r)}throw Error(q(156,t.tag))};function wk(e,t){return q$(e,t)}function d8(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(e,t,r,n){return new d8(e,t,r,n)}function B0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function f8(e){if(typeof e=="function")return B0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===s0)return 11;if(e===l0)return 14}return 2}function vi(e,t){var r=e.alternate;return r===null?(r=sn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function hd(e,t,r,n,o,i){var a=2;if(n=e,typeof e=="function")B0(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ba:return Zi(r.children,o,i,t);case a0:a=8,o|=8;break;case mv:return e=sn(12,r,t,o|2),e.elementType=mv,e.lanes=i,e;case gv:return e=sn(13,r,t,o),e.elementType=gv,e.lanes=i,e;case vv:return e=sn(19,r,t,o),e.elementType=vv,e.lanes=i,e;case $$:return em(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case C$:a=10;break e;case E$:a=9;break e;case s0:a=11;break e;case l0:a=14;break e;case Zo:a=16,n=null;break e}throw Error(q(130,e==null?e:typeof e,""))}return t=sn(a,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function Zi(e,t,r,n){return e=sn(7,e,n,t),e.lanes=r,e}function em(e,t,r,n){return e=sn(22,e,n,t),e.elementType=$$,e.lanes=r,e.stateNode={isHidden:!1},e}function bg(e,t,r){return e=sn(6,e,null,t),e.lanes=r,e}function _g(e,t,r){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function p8(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rg(0),this.expirationTimes=rg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rg(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function U0(e,t,r,n,o,i,a,l,c){return e=new p8(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=sn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},O0(i),e}function h8(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Va,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function bk(e){if(!e)return bi;e=e._reactInternals;e:{if(ha(e)!==e||e.tag!==1)throw Error(q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(kr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(q(171))}if(e.tag===1){var r=e.type;if(kr(r))return w2(e,r,t)}return t}function _k(e,t,r,n,o,i,a,l,c){return e=U0(r,n,!0,e,o,i,a,l,c),e.context=bk(null),r=e.current,n=vr(),o=gi(r),i=bo(n,o),i.callback=t??null,hi(r,i,o),e.current.lanes=o,Oc(e,o,n),Rr(e,n),e}function tm(e,t,r,n){var o=t.current,i=vr(),a=gi(o);return r=bk(r),t.context===null?t.context=r:t.pendingContext=r,t=bo(i,a),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=hi(o,t,a),e!==null&&(En(e,o,a,i),ld(e,o,a)),a}function Xd(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Sb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function W0(e,t){Sb(e,t),(e=e.alternate)&&Sb(e,t)}function m8(){return null}var Sk=typeof reportError=="function"?reportError:function(e){console.error(e)};function H0(e){this._internalRoot=e}rm.prototype.render=H0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));tm(e,t,null,null)};rm.prototype.unmount=H0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ia(function(){tm(null,e,null,null)}),t[Oo]=null}};function rm(e){this._internalRoot=e}rm.prototype.unstable_scheduleHydration=function(e){if(e){var t=Z$();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ni.length&&t!==0&&t<ni[r].priority;r++);ni.splice(r,0,e),r===0&&t2(e)}};function q0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function nm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Pb(){}function g8(e,t,r,n,o){if(o){if(typeof n=="function"){var i=n;n=function(){var u=Xd(a);i.call(u)}}var a=_k(t,n,e,0,null,!1,!1,"",Pb);return e._reactRootContainer=a,e[Oo]=a.current,nc(e.nodeType===8?e.parentNode:e),ia(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof n=="function"){var l=n;n=function(){var u=Xd(c);l.call(u)}}var c=U0(e,0,!1,null,null,!1,!1,"",Pb);return e._reactRootContainer=c,e[Oo]=c.current,nc(e.nodeType===8?e.parentNode:e),ia(function(){tm(t,c,r,n)}),c}function om(e,t,r,n,o){var i=r._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var l=o;o=function(){var c=Xd(a);l.call(c)}}tm(t,a,e,o)}else a=g8(r,t,e,o,n);return Xd(a)}X$=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=jl(t.pendingLanes);r!==0&&(d0(t,r|1),Rr(t,$t()),!(Me&6)&&(ws=$t()+500,$i()))}break;case 13:ia(function(){var n=Co(e,1);if(n!==null){var o=vr();En(n,e,1,o)}}),W0(e,1)}};f0=function(e){if(e.tag===13){var t=Co(e,134217728);if(t!==null){var r=vr();En(t,e,134217728,r)}W0(e,134217728)}};J$=function(e){if(e.tag===13){var t=gi(e),r=Co(e,t);if(r!==null){var n=vr();En(r,e,t,n)}W0(e,t)}};Z$=function(){return He};e2=function(e,t){var r=He;try{return He=e,t()}finally{He=r}};Cv=function(e,t,r){switch(t){case"input":if(wv(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var o=Qh(n);if(!o)throw Error(q(90));R$(n),wv(n,o)}}}break;case"textarea":I$(e,r);break;case"select":t=r.value,t!=null&&ns(e,!!r.multiple,t,!1)}};F$=z0;V$=ia;var v8={usingClientEntryPoint:!1,Events:[Ec,qa,Qh,L$,z$,z0]},al={findFiberByHostInstance:Gi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},y8={bundleType:al.bundleType,version:al.version,rendererPackageName:al.rendererPackageName,rendererConfig:al.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ao.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=W$(e),e===null?null:e.stateNode},findFiberByHostInstance:al.findFiberByHostInstance||m8,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_u.isDisabled&&_u.supportsFiber)try{Wh=_u.inject(y8),Zn=_u}catch{}}Jr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=v8;Jr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!q0(t))throw Error(q(200));return h8(e,t,null,r)};Jr.createRoot=function(e,t){if(!q0(e))throw Error(q(299));var r=!1,n="",o=Sk;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=U0(e,1,!1,null,null,r,!1,n,o),e[Oo]=t.current,nc(e.nodeType===8?e.parentNode:e),new H0(t)};Jr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=W$(t),e=e===null?null:e.stateNode,e};Jr.flushSync=function(e){return ia(e)};Jr.hydrate=function(e,t,r){if(!nm(t))throw Error(q(200));return om(null,e,t,!0,r)};Jr.hydrateRoot=function(e,t,r){if(!q0(e))throw Error(q(405));var n=r!=null&&r.hydratedSources||null,o=!1,i="",a=Sk;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(a=r.onRecoverableError)),t=_k(t,null,e,1,r??null,o,!1,i,a),e[Oo]=t.current,nc(e),n)for(e=0;e<n.length;e++)r=n[e],o=r._getVersion,o=o(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new rm(t)};Jr.render=function(e,t,r){if(!nm(t))throw Error(q(200));return om(null,e,t,!1,r)};Jr.unmountComponentAtNode=function(e){if(!nm(e))throw Error(q(40));return e._reactRootContainer?(ia(function(){om(null,null,e,!1,function(){e._reactRootContainer=null,e[Oo]=null})}),!0):!1};Jr.unstable_batchedUpdates=z0;Jr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!nm(r))throw Error(q(200));if(e==null||e._reactInternals===void 0)throw Error(q(38));return om(e,t,r,!1,n)};Jr.version="18.2.0-next-9e3b772b8-20220608";function Pk(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pk)}catch(e){console.error(e)}}Pk(),_$.exports=Jr;var Ms=_$.exports;const md=By(Ms),x8=vE({__proto__:null,default:md},[Ms]);var w8=Object.defineProperty,b8=Object.defineProperties,_8=Object.getOwnPropertyDescriptors,jb=Object.getOwnPropertySymbols,S8=Object.prototype.hasOwnProperty,P8=Object.prototype.propertyIsEnumerable,Ob=(e,t,r)=>t in e?w8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ay=(e,t)=>{for(var r in t||(t={}))S8.call(t,r)&&Ob(e,r,t[r]);if(jb)for(var r of jb(t))P8.call(t,r)&&Ob(e,r,t[r]);return e},Cb=(e,t)=>b8(e,_8(t));const j8=["subtle","filled","outline","light","default","transparent","gradient"],Su={xs:O(18),sm:O(22),md:O(28),lg:O(34),xl:O(44)};function O8({variant:e,theme:t,color:r,gradient:n}){const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:j8.includes(e)?ay({border:`${O(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var C8=W((e,{radius:t,color:r,gradient:n},{variant:o,size:i})=>({root:Cb(ay({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:A({size:i,sizes:Su}),minHeight:A({size:i,sizes:Su}),width:A({size:i,sizes:Su}),minWidth:A({size:i,sizes:Su})},O8({variant:o,theme:e,color:r,gradient:n})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":Cb(ay({content:'""'},e.fn.cover(O(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const E8=C8;var $8=Object.defineProperty,Jd=Object.getOwnPropertySymbols,jk=Object.prototype.hasOwnProperty,Ok=Object.prototype.propertyIsEnumerable,Eb=(e,t,r)=>t in e?$8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$b=(e,t)=>{for(var r in t||(t={}))jk.call(t,r)&&Eb(e,r,t[r]);if(Jd)for(var r of Jd(t))Ok.call(t,r)&&Eb(e,r,t[r]);return e},kb=(e,t)=>{var r={};for(var n in e)jk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Jd)for(var n of Jd(e))t.indexOf(n)<0&&Ok.call(e,n)&&(r[n]=e[n]);return r};function k8(e){var t=e,{size:r,color:n}=t,o=kb(t,["size","color"]);const i=o,{style:a}=i,l=kb(i,["style"]);return S.createElement("svg",$b({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:n,style:$b({width:r},a)},l),S.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var R8=Object.defineProperty,Zd=Object.getOwnPropertySymbols,Ck=Object.prototype.hasOwnProperty,Ek=Object.prototype.propertyIsEnumerable,Rb=(e,t,r)=>t in e?R8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tb=(e,t)=>{for(var r in t||(t={}))Ck.call(t,r)&&Rb(e,r,t[r]);if(Zd)for(var r of Zd(t))Ek.call(t,r)&&Rb(e,r,t[r]);return e},Ib=(e,t)=>{var r={};for(var n in e)Ck.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zd)for(var n of Zd(e))t.indexOf(n)<0&&Ek.call(e,n)&&(r[n]=e[n]);return r};function T8(e){var t=e,{size:r,color:n}=t,o=Ib(t,["size","color"]);const i=o,{style:a}=i,l=Ib(i,["style"]);return S.createElement("svg",Tb({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:n,style:Tb({width:r,height:r},a)},l),S.createElement("g",{fill:"none",fillRule:"evenodd"},S.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},S.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),S.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},S.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var I8=Object.defineProperty,ef=Object.getOwnPropertySymbols,$k=Object.prototype.hasOwnProperty,kk=Object.prototype.propertyIsEnumerable,Db=(e,t,r)=>t in e?I8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nb=(e,t)=>{for(var r in t||(t={}))$k.call(t,r)&&Db(e,r,t[r]);if(ef)for(var r of ef(t))kk.call(t,r)&&Db(e,r,t[r]);return e},Ab=(e,t)=>{var r={};for(var n in e)$k.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ef)for(var n of ef(e))t.indexOf(n)<0&&kk.call(e,n)&&(r[n]=e[n]);return r};function D8(e){var t=e,{size:r,color:n}=t,o=Ab(t,["size","color"]);const i=o,{style:a}=i,l=Ab(i,["style"]);return S.createElement("svg",Nb({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:n,style:Nb({width:r},a)},l),S.createElement("circle",{cx:"15",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},S.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"105",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var N8=Object.defineProperty,tf=Object.getOwnPropertySymbols,Rk=Object.prototype.hasOwnProperty,Tk=Object.prototype.propertyIsEnumerable,Mb=(e,t,r)=>t in e?N8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,A8=(e,t)=>{for(var r in t||(t={}))Rk.call(t,r)&&Mb(e,r,t[r]);if(tf)for(var r of tf(t))Tk.call(t,r)&&Mb(e,r,t[r]);return e},M8=(e,t)=>{var r={};for(var n in e)Rk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tf)for(var n of tf(e))t.indexOf(n)<0&&Tk.call(e,n)&&(r[n]=e[n]);return r};const Sg={bars:k8,oval:T8,dots:D8},L8={xs:O(18),sm:O(22),md:O(36),lg:O(44),xl:O(58)},z8={size:"md"};function mn(e){const t=H("Loader",z8,e),{size:r,color:n,variant:o}=t,i=M8(t,["size","color","variant"]),a=Ht(),l=o in Sg?o:a.loader;return S.createElement(ae,A8({role:"presentation",component:Sg[l]||Sg.bars,size:A({size:r,sizes:L8}),color:a.fn.variant({variant:"filled",primaryFallback:!1,color:n||a.primaryColor}).background},i))}mn.displayName="@mantine/core/Loader";var F8=Object.defineProperty,rf=Object.getOwnPropertySymbols,Ik=Object.prototype.hasOwnProperty,Dk=Object.prototype.propertyIsEnumerable,Lb=(e,t,r)=>t in e?F8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zb=(e,t)=>{for(var r in t||(t={}))Ik.call(t,r)&&Lb(e,r,t[r]);if(rf)for(var r of rf(t))Dk.call(t,r)&&Lb(e,r,t[r]);return e},V8=(e,t)=>{var r={};for(var n in e)Ik.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rf)for(var n of rf(e))t.indexOf(n)<0&&Dk.call(e,n)&&(r[n]=e[n]);return r};const B8={color:"gray",size:"md",variant:"subtle"},Nk=f.forwardRef((e,t)=>{const r=H("ActionIcon",B8,e),{className:n,color:o,children:i,radius:a,size:l,variant:c,gradient:u,disabled:d,loaderProps:p,loading:h,unstyled:m,__staticSelector:g}=r,v=V8(r,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:_,cx:y,theme:x}=E8({radius:a,color:o,gradient:u},{name:["ActionIcon",g],unstyled:m,size:l,variant:c}),w=S.createElement(mn,zb({color:x.fn.variant({color:o,variant:c}).color,size:"100%","data-action-icon-loader":!0},p));return S.createElement(Po,zb({className:y(_.root,n),ref:t,disabled:d,"data-disabled":d||void 0,"data-loading":h||void 0,unstyled:m},v),h?w:i)});Nk.displayName="@mantine/core/ActionIcon";const yr=Nk;var U8=Object.defineProperty,W8=Object.defineProperties,H8=Object.getOwnPropertyDescriptors,nf=Object.getOwnPropertySymbols,Ak=Object.prototype.hasOwnProperty,Mk=Object.prototype.propertyIsEnumerable,Fb=(e,t,r)=>t in e?U8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,q8=(e,t)=>{for(var r in t||(t={}))Ak.call(t,r)&&Fb(e,r,t[r]);if(nf)for(var r of nf(t))Mk.call(t,r)&&Fb(e,r,t[r]);return e},G8=(e,t)=>W8(e,H8(t)),Q8=(e,t)=>{var r={};for(var n in e)Ak.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nf)for(var n of nf(e))t.indexOf(n)<0&&Mk.call(e,n)&&(r[n]=e[n]);return r};function G0(e){const t=H("Portal",{},e),{children:r,target:n,className:o,innerRef:i}=t,a=Q8(t,["children","target","className","innerRef"]),l=Ht(),[c,u]=f.useState(!1),d=f.useRef();return u$(()=>(u(!0),d.current=n?typeof n=="string"?document.querySelector(n):n:document.createElement("div"),n||document.body.appendChild(d.current),()=>{!n&&document.body.removeChild(d.current)}),[n]),c?Ms.createPortal(S.createElement("div",G8(q8({className:o,dir:l.dir},a),{ref:i}),r),d.current):null}G0.displayName="@mantine/core/Portal";var K8=Object.defineProperty,of=Object.getOwnPropertySymbols,Lk=Object.prototype.hasOwnProperty,zk=Object.prototype.propertyIsEnumerable,Vb=(e,t,r)=>t in e?K8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y8=(e,t)=>{for(var r in t||(t={}))Lk.call(t,r)&&Vb(e,r,t[r]);if(of)for(var r of of(t))zk.call(t,r)&&Vb(e,r,t[r]);return e},X8=(e,t)=>{var r={};for(var n in e)Lk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&of)for(var n of of(e))t.indexOf(n)<0&&zk.call(e,n)&&(r[n]=e[n]);return r};function Ls(e){var t=e,{withinPortal:r=!0,children:n}=t,o=X8(t,["withinPortal","children"]);return r?S.createElement(G0,Y8({},o),n):S.createElement(S.Fragment,null,n)}Ls.displayName="@mantine/core/OptionalPortal";var J8=Object.defineProperty,Z8=Object.defineProperties,eF=Object.getOwnPropertyDescriptors,Bb=Object.getOwnPropertySymbols,tF=Object.prototype.hasOwnProperty,rF=Object.prototype.propertyIsEnumerable,Ub=(e,t,r)=>t in e?J8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pg=(e,t)=>{for(var r in t||(t={}))tF.call(t,r)&&Ub(e,r,t[r]);if(Bb)for(var r of Bb(t))rF.call(t,r)&&Ub(e,r,t[r]);return e},Wb=(e,t)=>Z8(e,eF(t));function nF({variant:e,color:t,theme:r}){if(e==="filled")return{backgroundColor:r.fn.variant({variant:"filled",color:t}).background,color:r.white};if(e==="outline"){const n=r.fn.variant({variant:"outline",color:t});return{color:n.color,borderColor:n.border,backgroundColor:r.colorScheme==="dark"?r.colors.dark[6]:r.white}}if(e==="light"){const n=r.fn.variant({variant:"light",color:t});return{backgroundColor:n.background,color:n.color}}return null}var oF=W((e,{radius:t,color:r},{variant:n})=>({root:Pg(Wb(Pg({},e.fn.fontStyles()),{position:"relative",overflow:"hidden",paddingTop:e.spacing.sm,paddingBottom:e.spacing.sm,paddingLeft:e.spacing.md,paddingRight:e.spacing.sm,borderRadius:e.fn.radius(t),border:`${O(1)} solid transparent`}),nF({variant:n,color:r,theme:e})),wrapper:{display:"flex"},body:{flex:1},title:{boxSizing:"border-box",margin:0,marginBottom:e.spacing.xs,display:"flex",alignItems:"center",justifyContent:"space-between",lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,fontWeight:700,"&[data-with-close-button]":{paddingRight:e.spacing.md}},label:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},icon:{lineHeight:1,width:O(20),height:O(20),display:"flex",alignItems:"center",justifyContent:"flex-start",marginRight:e.spacing.md,marginTop:1},message:Wb(Pg({},e.fn.fontStyles()),{lineHeight:e.lineHeight,textOverflow:"ellipsis",overflow:"hidden",fontSize:e.fontSizes.sm,color:n==="filled"?e.white:e.colorScheme==="dark"?n==="light"?e.white:e.colors.dark[0]:e.black}),closeButton:{width:O(10),height:O(10),color:n==="filled"?e.white:e.colorScheme==="dark"?n==="light"?e.white:e.colors.dark[0]:e.black}}));const iF=oF;var aF=Object.defineProperty,af=Object.getOwnPropertySymbols,Fk=Object.prototype.hasOwnProperty,Vk=Object.prototype.propertyIsEnumerable,Hb=(e,t,r)=>t in e?aF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qb=(e,t)=>{for(var r in t||(t={}))Fk.call(t,r)&&Hb(e,r,t[r]);if(af)for(var r of af(t))Vk.call(t,r)&&Hb(e,r,t[r]);return e},sF=(e,t)=>{var r={};for(var n in e)Fk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&af)for(var n of af(e))t.indexOf(n)<0&&Vk.call(e,n)&&(r[n]=e[n]);return r};function Bk(e){const t=e,{width:r,height:n,style:o}=t,i=sF(t,["width","height","style"]);return S.createElement("svg",qb({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:qb({width:r,height:n},o)},i),S.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}Bk.displayName="@mantine/core/CloseIcon";var lF=Object.defineProperty,sf=Object.getOwnPropertySymbols,Uk=Object.prototype.hasOwnProperty,Wk=Object.prototype.propertyIsEnumerable,Gb=(e,t,r)=>t in e?lF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cF=(e,t)=>{for(var r in t||(t={}))Uk.call(t,r)&&Gb(e,r,t[r]);if(sf)for(var r of sf(t))Wk.call(t,r)&&Gb(e,r,t[r]);return e},uF=(e,t)=>{var r={};for(var n in e)Uk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sf)for(var n of sf(e))t.indexOf(n)<0&&Wk.call(e,n)&&(r[n]=e[n]);return r};const dF={xs:O(12),sm:O(16),md:O(20),lg:O(28),xl:O(34)},fF={size:"sm"},Hk=f.forwardRef((e,t)=>{const r=H("CloseButton",fF,e),{iconSize:n,size:o,children:i}=r,a=uF(r,["iconSize","size","children"]),l=O(n||dF[o]);return S.createElement(yr,cF({ref:t,__staticSelector:"CloseButton",size:o},a),i||S.createElement(Bk,{width:l,height:l}))});Hk.displayName="@mantine/core/CloseButton";const kc=Hk;var pF=Object.defineProperty,lf=Object.getOwnPropertySymbols,qk=Object.prototype.hasOwnProperty,Gk=Object.prototype.propertyIsEnumerable,Qb=(e,t,r)=>t in e?pF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hF=(e,t)=>{for(var r in t||(t={}))qk.call(t,r)&&Qb(e,r,t[r]);if(lf)for(var r of lf(t))Gk.call(t,r)&&Qb(e,r,t[r]);return e},mF=(e,t)=>{var r={};for(var n in e)qk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&lf)for(var n of lf(e))t.indexOf(n)<0&&Gk.call(e,n)&&(r[n]=e[n]);return r};const gF={variant:"light"},Rc=f.forwardRef((e,t)=>{const r=H("Alert",gF,e),{id:n,className:o,title:i,variant:a,children:l,color:c,classNames:u,icon:d,styles:p,onClose:h,radius:m,withCloseButton:g,closeButtonLabel:v,unstyled:_}=r,y=mF(r,["id","className","title","variant","children","color","classNames","icon","styles","onClose","radius","withCloseButton","closeButtonLabel","unstyled"]),{classes:x,cx:w}=iF({color:c,radius:m},{classNames:u,styles:p,unstyled:_,variant:a,name:"Alert"}),b=Ar(n),j=i&&`${b}-title`,C=`${b}-body`;return S.createElement(ae,hF({id:b,role:"alert","aria-labelledby":j,"aria-describedby":C,className:w(x.root,x[a],o),ref:t},y),S.createElement("div",{className:x.wrapper},d&&S.createElement("div",{className:x.icon},d),S.createElement("div",{className:x.body},i&&S.createElement("div",{className:x.title,"data-with-close-button":g||void 0},S.createElement("span",{id:j,className:x.label},i)),S.createElement("div",{id:C,className:x.message},l)),g&&S.createElement(kc,{className:x.closeButton,onClick:h,variant:"transparent",size:16,iconSize:16,"aria-label":v})))});Rc.displayName="@mantine/core/Alert";var vF=Object.defineProperty,yF=Object.defineProperties,xF=Object.getOwnPropertyDescriptors,Kb=Object.getOwnPropertySymbols,wF=Object.prototype.hasOwnProperty,bF=Object.prototype.propertyIsEnumerable,Yb=(e,t,r)=>t in e?vF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pu=(e,t)=>{for(var r in t||(t={}))wF.call(t,r)&&Yb(e,r,t[r]);if(Kb)for(var r of Kb(t))bF.call(t,r)&&Yb(e,r,t[r]);return e},_F=(e,t)=>yF(e,xF(t));function SF({underline:e,strikethrough:t}){const r=[];return e&&r.push("underline"),t&&r.push("line-through"),r.length>0?r.join(" "):"none"}function PF({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function jF(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function OF({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var CF=W((e,{color:t,lineClamp:r,truncate:n,inline:o,inherit:i,underline:a,gradient:l,weight:c,transform:u,align:d,strikethrough:p,italic:h},{size:m})=>{const g=e.fn.variant({variant:"gradient",gradient:l});return{root:_F(Pu(Pu(Pu(Pu({},e.fn.fontStyles()),e.fn.focusStyles()),jF(r)),OF({theme:e,truncate:n})),{color:PF({color:t,theme:e}),fontFamily:i?"inherit":e.fontFamily,fontSize:i||m===void 0?"inherit":A({size:m,sizes:e.fontSizes}),lineHeight:i?"inherit":o?1:e.lineHeight,textDecoration:SF({underline:a,strikethrough:p}),WebkitTapHighlightColor:"transparent",fontWeight:i?"inherit":c,textTransform:u,textAlign:d,fontStyle:h?"italic":void 0}),gradient:{backgroundImage:g.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const EF=CF;var $F=Object.defineProperty,cf=Object.getOwnPropertySymbols,Qk=Object.prototype.hasOwnProperty,Kk=Object.prototype.propertyIsEnumerable,Xb=(e,t,r)=>t in e?$F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kF=(e,t)=>{for(var r in t||(t={}))Qk.call(t,r)&&Xb(e,r,t[r]);if(cf)for(var r of cf(t))Kk.call(t,r)&&Xb(e,r,t[r]);return e},RF=(e,t)=>{var r={};for(var n in e)Qk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&cf)for(var n of cf(e))t.indexOf(n)<0&&Kk.call(e,n)&&(r[n]=e[n]);return r};const TF={variant:"text"},Yk=f.forwardRef((e,t)=>{const r=H("Text",TF,e),{className:n,size:o,weight:i,transform:a,color:l,align:c,variant:u,lineClamp:d,truncate:p,gradient:h,inline:m,inherit:g,underline:v,strikethrough:_,italic:y,classNames:x,styles:w,unstyled:b,span:j,__staticSelector:C}=r,P=RF(r,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:E,cx:k}=EF({color:l,lineClamp:d,truncate:p,inline:m,inherit:g,underline:v,strikethrough:_,italic:y,weight:i,transform:a,align:c,gradient:h},{unstyled:b,name:C||"Text",variant:u,size:o});return S.createElement(ae,kF({ref:t,className:k(E.root,{[E.gradient]:u==="gradient"},n),component:j?"span":"div"},P))});Yk.displayName="@mantine/core/Text";const oe=Yk;var IF=Object.defineProperty,Jb=Object.getOwnPropertySymbols,DF=Object.prototype.hasOwnProperty,NF=Object.prototype.propertyIsEnumerable,Zb=(e,t,r)=>t in e?IF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,AF=(e,t)=>{for(var r in t||(t={}))DF.call(t,r)&&Zb(e,r,t[r]);if(Jb)for(var r of Jb(t))NF.call(t,r)&&Zb(e,r,t[r]);return e};function MF({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():e.fn.themeColor(t||e.primaryColor,e.colorScheme==="dark"?4:7,!1,!0)}var LF=W((e,{color:t,underline:r})=>({root:AF({backgroundColor:"transparent",cursor:"pointer",padding:0,border:0,color:MF({theme:e,color:t})},e.fn.hover({textDecoration:r?"underline":"none"}))}));const zF=LF;var FF=Object.defineProperty,uf=Object.getOwnPropertySymbols,Xk=Object.prototype.hasOwnProperty,Jk=Object.prototype.propertyIsEnumerable,e_=(e,t,r)=>t in e?FF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,t_=(e,t)=>{for(var r in t||(t={}))Xk.call(t,r)&&e_(e,r,t[r]);if(uf)for(var r of uf(t))Jk.call(t,r)&&e_(e,r,t[r]);return e},VF=(e,t)=>{var r={};for(var n in e)Xk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&uf)for(var n of uf(e))t.indexOf(n)<0&&Jk.call(e,n)&&(r[n]=e[n]);return r};const BF={underline:!0},Zk=f.forwardRef((e,t)=>{const r=H("Anchor",BF,e),{component:n,className:o,unstyled:i,variant:a,size:l,color:c,underline:u}=r,d=VF(r,["component","className","unstyled","variant","size","color","underline"]),{classes:p,cx:h}=zF({color:c,underline:u},{name:"Anchor",unstyled:i,variant:a,size:l}),m=n==="button"?{type:"button"}:null;return S.createElement(oe,t_(t_({component:n||"a",ref:t,className:h(p.root,o),size:l},m),d))});Zk.displayName="@mantine/core/Anchor";const Fe=Zk,eR=f.createContext({zIndex:1e3,fixed:!1,layout:"default"}),UF=eR.Provider;function tR(){return f.useContext(eR)}function im(e,t){if(!e)return[];const r=Object.keys(e).filter(n=>n!=="base").map(n=>[A({size:n,sizes:t.breakpoints,units:"em"}),e[n]]);return r.sort((n,o)=>wr(n[0])-wr(o[0])),r}var WF=Object.defineProperty,HF=Object.defineProperties,qF=Object.getOwnPropertyDescriptors,r_=Object.getOwnPropertySymbols,GF=Object.prototype.hasOwnProperty,QF=Object.prototype.propertyIsEnumerable,n_=(e,t,r)=>t in e?WF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ju=(e,t)=>{for(var r in t||(t={}))GF.call(t,r)&&n_(e,r,t[r]);if(r_)for(var r of r_(t))QF.call(t,r)&&n_(e,r,t[r]);return e},o_=(e,t)=>HF(e,qF(t)),KF=W((e,{height:t,width:r,fixed:n,position:o,hiddenBreakpoint:i,zIndex:a,section:l,withBorder:c,layout:u})=>{const d=typeof r=="object"&&r!==null?im(r,e).reduce((h,[m,g])=>(h[`@media (min-width: ${sr(m)})`]={width:O(g),minWidth:O(g)},h),{}):null,p=c?{[l==="navbar"?"borderRight":"borderLeft"]:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`}:{};return{root:o_(ju(ju(o_(ju(ju({},e.fn.fontStyles()),o),{top:u==="alt"?0:(o==null?void 0:o.top)||"var(--mantine-header-height)",bottom:0,zIndex:a,height:t?O(t):u==="alt"?"auto":"calc(100vh - var(--mantine-header-height, 0rem) - var(--mantine-footer-height, 0rem))",width:r!=null&&r.base?O(r==null?void 0:r.base):"100%",position:n?"fixed":"static",boxSizing:"border-box",display:"flex",flexDirection:"column",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),p),d),{"&[data-hidden]":{[`@media (max-width: ${sr(wr(A({size:i,sizes:e.breakpoints}))-1)})`]:{display:"none"}}})}});const YF=KF;var XF=Object.defineProperty,df=Object.getOwnPropertySymbols,rR=Object.prototype.hasOwnProperty,nR=Object.prototype.propertyIsEnumerable,i_=(e,t,r)=>t in e?XF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a_=(e,t)=>{for(var r in t||(t={}))rR.call(t,r)&&i_(e,r,t[r]);if(df)for(var r of df(t))nR.call(t,r)&&i_(e,r,t[r]);return e},JF=(e,t)=>{var r={};for(var n in e)rR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&df)for(var n of df(e))t.indexOf(n)<0&&nR.call(e,n)&&(r[n]=e[n]);return r};const oR=f.forwardRef((e,t)=>{var r=e,{width:n,height:o,fixed:i=!1,position:a,zIndex:l,hiddenBreakpoint:c="md",hidden:u=!1,withBorder:d=!0,className:p,classNames:h,styles:m,children:g,section:v,__staticSelector:_,unstyled:y,variant:x}=r,w=JF(r,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled","variant"]);const b=tR(),{classes:j,cx:C,theme:P}=YF({width:n,height:o,fixed:b.fixed||i,position:a,hiddenBreakpoint:c,zIndex:l||b.zIndex||Dn("app"),section:v,withBorder:d,layout:b.layout},{classNames:h,styles:m,name:_,unstyled:y,variant:x}),E=im(n,P).reduce((k,[$,I])=>(k[`@media (min-width: ${sr($)})`]={[`--mantine-${v}-width`]:O(I)},k),{});return S.createElement(ae,a_({component:v==="navbar"?"nav":"aside",ref:t,"data-hidden":u||void 0,className:C(j.root,p)},w),g,S.createElement(c$,{styles:()=>({":root":a_({[`--mantine-${v}-width`]:n!=null&&n.base?O(n.base):"0rem"},E)})}))});oR.displayName="@mantine/core/HorizontalSection";var ZF=Object.defineProperty,ff=Object.getOwnPropertySymbols,iR=Object.prototype.hasOwnProperty,aR=Object.prototype.propertyIsEnumerable,s_=(e,t,r)=>t in e?ZF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eV=(e,t)=>{for(var r in t||(t={}))iR.call(t,r)&&s_(e,r,t[r]);if(ff)for(var r of ff(t))aR.call(t,r)&&s_(e,r,t[r]);return e},tV=(e,t)=>{var r={};for(var n in e)iR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ff)for(var n of ff(e))t.indexOf(n)<0&&aR.call(e,n)&&(r[n]=e[n]);return r};const sR=f.forwardRef((e,t)=>{var r=e,{children:n,grow:o=!1,sx:i}=r,a=tV(r,["children","grow","sx"]);return S.createElement(ae,eV({ref:t,sx:[{flex:o?1:0,boxSizing:"border-box"},..._c(i)]},a),n)});sR.displayName="@mantine/core/Section";const rV=sR;var nV=Object.defineProperty,l_=Object.getOwnPropertySymbols,oV=Object.prototype.hasOwnProperty,iV=Object.prototype.propertyIsEnumerable,c_=(e,t,r)=>t in e?nV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aV=(e,t)=>{for(var r in t||(t={}))oV.call(t,r)&&c_(e,r,t[r]);if(l_)for(var r of l_(t))iV.call(t,r)&&c_(e,r,t[r]);return e};const sV={fixed:!1,position:{top:0,left:0},hiddenBreakpoint:"md",hidden:!1},Fl=f.forwardRef((e,t)=>{const r=H("Navbar",sV,e);return S.createElement(oR,aV({section:"navbar",__staticSelector:"Navbar",ref:t},r))});Fl.Section=rV;Fl.displayName="@mantine/core/Navbar";var lV=Object.defineProperty,cV=Object.defineProperties,uV=Object.getOwnPropertyDescriptors,u_=Object.getOwnPropertySymbols,dV=Object.prototype.hasOwnProperty,fV=Object.prototype.propertyIsEnumerable,d_=(e,t,r)=>t in e?lV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jg=(e,t)=>{for(var r in t||(t={}))dV.call(t,r)&&d_(e,r,t[r]);if(u_)for(var r of u_(t))fV.call(t,r)&&d_(e,r,t[r]);return e},f_=(e,t)=>cV(e,uV(t)),pV=W((e,{height:t,fixed:r,position:n,zIndex:o,borderPosition:i,layout:a})=>{const l=typeof t=="object"&&t!==null?im(t,e).reduce((c,[u,d])=>(c[`@media (min-width: ${sr(u)})`]={height:O(d),minHeight:O(d)},c),{}):null;return{root:f_(jg(f_(jg(jg({},e.fn.fontStyles()),n),{zIndex:o,left:a==="alt"?"var(--mantine-navbar-width, 0)":0,right:a==="alt"?"var(--mantine-aside-width, 0)":0,height:typeof t=="object"?O(t==null?void 0:t.base)||"100%":O(t),maxHeight:typeof t=="object"?O(t==null?void 0:t.base)||"100%":O(t),position:r?"fixed":"static",boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),l),{borderBottom:i==="bottom"?`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0,borderTop:i==="top"?`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0})}});const hV=pV;var mV=Object.defineProperty,pf=Object.getOwnPropertySymbols,lR=Object.prototype.hasOwnProperty,cR=Object.prototype.propertyIsEnumerable,p_=(e,t,r)=>t in e?mV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h_=(e,t)=>{for(var r in t||(t={}))lR.call(t,r)&&p_(e,r,t[r]);if(pf)for(var r of pf(t))cR.call(t,r)&&p_(e,r,t[r]);return e},gV=(e,t)=>{var r={};for(var n in e)lR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pf)for(var n of pf(e))t.indexOf(n)<0&&cR.call(e,n)&&(r[n]=e[n]);return r};const uR=f.forwardRef((e,t)=>{var r=e,{children:n,className:o,classNames:i,styles:a,height:l,fixed:c=!1,withBorder:u=!0,position:d,zIndex:p,section:h,unstyled:m,__staticSelector:g,variant:v}=r,_=gV(r,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector","variant"]);const y=tR(),x=p||y.zIndex||Dn("app"),{classes:w,cx:b,theme:j}=hV({height:l,fixed:y.fixed||c,position:d,zIndex:typeof x=="number"&&y.layout==="default"?x+1:x,layout:y.layout,borderPosition:u?h==="header"?"bottom":"top":"none"},{name:g,classNames:i,styles:a,unstyled:m,variant:v}),C=typeof l=="object"&&l!==null?im(l,j).reduce((P,[E,k])=>(P[`@media (min-width: ${sr(E)})`]={[`--mantine-${h}-height`]:O(k)},P),{}):null;return S.createElement(ae,h_({component:h==="header"?"header":"footer",className:b(w.root,o),ref:t},_),n,S.createElement(c$,{styles:()=>({":root":h_({[`--mantine-${h}-height`]:typeof l=="object"?O(l==null?void 0:l.base)||"100%":O(l)},C)})}))});uR.displayName="@mantine/core/VerticalSection";var vV=Object.defineProperty,yV=Object.defineProperties,xV=Object.getOwnPropertyDescriptors,m_=Object.getOwnPropertySymbols,wV=Object.prototype.hasOwnProperty,bV=Object.prototype.propertyIsEnumerable,g_=(e,t,r)=>t in e?vV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_V=(e,t)=>{for(var r in t||(t={}))wV.call(t,r)&&g_(e,r,t[r]);if(m_)for(var r of m_(t))bV.call(t,r)&&g_(e,r,t[r]);return e},SV=(e,t)=>yV(e,xV(t));const PV={fixed:!1,position:{top:0,left:0,right:0}},dR=f.forwardRef((e,t)=>{const r=H("Header",PV,e);return S.createElement(uR,SV(_V({section:"header",__staticSelector:"Header"},r),{ref:t}))});dR.displayName="@mantine/core/Header";var jV=Object.defineProperty,v_=Object.getOwnPropertySymbols,OV=Object.prototype.hasOwnProperty,CV=Object.prototype.propertyIsEnumerable,y_=(e,t,r)=>t in e?jV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fR=(e,t)=>{for(var r in t||(t={}))OV.call(t,r)&&y_(e,r,t[r]);if(v_)for(var r of v_(t))CV.call(t,r)&&y_(e,r,t[r]);return e};function EV(e,t){const r=A({size:e.padding,sizes:t.spacing}),n=e.navbarOffsetBreakpoint?A({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,o=e.asideOffsetBreakpoint?A({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;if(!e.fixed)return{padding:r};const i=wr(n),a=wr(o);return fR({minHeight:"100vh",paddingTop:`calc(var(--mantine-header-height, 0px) + ${r})`,paddingBottom:`calc(var(--mantine-footer-height, 0px) + ${r})`,paddingLeft:`calc(var(--mantine-navbar-width, 0px) + ${r})`,paddingRight:`calc(var(--mantine-aside-width, 0px) + ${r})`},i===a?{[`@media (max-width: ${sr(i-1)})`]:{paddingLeft:r,paddingRight:r}}:{[`@media (max-width: ${sr(i-1)})`]:{paddingLeft:r},[`@media (max-width: ${sr(a-1)})`]:{paddingRight:r}})}var $V=W((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:fR({flex:1,width:"100vw",boxSizing:"border-box"},EV(t,e))}));const kV=$V;var RV=Object.defineProperty,hf=Object.getOwnPropertySymbols,pR=Object.prototype.hasOwnProperty,hR=Object.prototype.propertyIsEnumerable,x_=(e,t,r)=>t in e?RV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,TV=(e,t)=>{for(var r in t||(t={}))pR.call(t,r)&&x_(e,r,t[r]);if(hf)for(var r of hf(t))hR.call(t,r)&&x_(e,r,t[r]);return e},IV=(e,t)=>{var r={};for(var n in e)pR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&hf)for(var n of hf(e))t.indexOf(n)<0&&hR.call(e,n)&&(r[n]=e[n]);return r};const DV={fixed:!0,padding:"md"},mR=f.forwardRef((e,t)=>{const r=H("AppShell",DV,e),{children:n,navbar:o,header:i,footer:a,aside:l,fixed:c,zIndex:u,padding:d,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h,className:m,styles:g,classNames:v,unstyled:_,hidden:y,layout:x,variant:w}=r,b=IV(r,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden","layout","variant"]),{classes:j,cx:C}=kV({padding:d,fixed:c,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h},{styles:g,classNames:v,unstyled:_,name:"AppShell",variant:w});return y?S.createElement(S.Fragment,null,n):S.createElement(UF,{value:{fixed:c,zIndex:u,layout:x}},S.createElement(ae,TV({className:C(j.root,m),ref:t},b),i,S.createElement("div",{className:j.body},o,S.createElement("main",{className:j.main},n),l),a))});mR.displayName="@mantine/core/AppShell";const Ou={xs:O(1),sm:O(2),md:O(3),lg:O(4),xl:O(5)};function Cu(e,t){const r=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?r:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var NV=W((e,{color:t},{size:r,variant:n})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:O(1),borderTop:`${A({size:r,sizes:Ou})} ${n} ${Cu(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${A({size:r,sizes:Ou})} ${n} ${Cu(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:O(A({size:r,sizes:Ou})),borderTopColor:Cu(e,t),borderTopStyle:n,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:O(A({size:r,sizes:Ou})),borderLeftColor:Cu(e,t),borderLeftStyle:n}}));const AV=NV;var MV=Object.defineProperty,LV=Object.defineProperties,zV=Object.getOwnPropertyDescriptors,mf=Object.getOwnPropertySymbols,gR=Object.prototype.hasOwnProperty,vR=Object.prototype.propertyIsEnumerable,w_=(e,t,r)=>t in e?MV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b_=(e,t)=>{for(var r in t||(t={}))gR.call(t,r)&&w_(e,r,t[r]);if(mf)for(var r of mf(t))vR.call(t,r)&&w_(e,r,t[r]);return e},FV=(e,t)=>LV(e,zV(t)),VV=(e,t)=>{var r={};for(var n in e)gR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&mf)for(var n of mf(e))t.indexOf(n)<0&&vR.call(e,n)&&(r[n]=e[n]);return r};const BV={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},mr=f.forwardRef((e,t)=>{const r=H("Divider",BV,e),{className:n,color:o,orientation:i,size:a,label:l,labelPosition:c,labelProps:u,variant:d,styles:p,classNames:h,unstyled:m}=r,g=VV(r,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:v,cx:_}=AV({color:o},{classNames:h,styles:p,unstyled:m,name:"Divider",variant:d,size:a}),y=i==="vertical",x=i==="horizontal",w=!!l&&x,b=!(u!=null&&u.color);return S.createElement(ae,b_({ref:t,className:_(v.root,{[v.vertical]:y,[v.horizontal]:x,[v.withLabel]:w},n),role:"separator"},g),w&&S.createElement(oe,FV(b_({},u),{size:(u==null?void 0:u.size)||"xs",mt:O(2),className:_(v.label,v[c],{[v.labelDefaultStyles]:b})}),l))});mr.displayName="@mantine/core/Divider";var UV=Object.defineProperty,WV=Object.defineProperties,HV=Object.getOwnPropertyDescriptors,__=Object.getOwnPropertySymbols,qV=Object.prototype.hasOwnProperty,GV=Object.prototype.propertyIsEnumerable,S_=(e,t,r)=>t in e?UV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P_=(e,t)=>{for(var r in t||(t={}))qV.call(t,r)&&S_(e,r,t[r]);if(__)for(var r of __(t))GV.call(t,r)&&S_(e,r,t[r]);return e},QV=(e,t)=>WV(e,HV(t)),KV=W((e,t,{size:r})=>({item:QV(P_({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`,cursor:"pointer",fontSize:A({size:r,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":P_({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${A({size:r,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${A({size:r,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const YV=KV;var XV=Object.defineProperty,j_=Object.getOwnPropertySymbols,JV=Object.prototype.hasOwnProperty,ZV=Object.prototype.propertyIsEnumerable,O_=(e,t,r)=>t in e?XV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eB=(e,t)=>{for(var r in t||(t={}))JV.call(t,r)&&O_(e,r,t[r]);if(j_)for(var r of j_(t))ZV.call(t,r)&&O_(e,r,t[r]);return e};function yR({data:e,hovered:t,classNames:r,styles:n,isItemSelected:o,uuid:i,__staticSelector:a,onItemHover:l,onItemSelect:c,itemsRefs:u,itemComponent:d,size:p,nothingFound:h,creatable:m,createLabel:g,unstyled:v,variant:_}){const{classes:y}=YV(null,{classNames:r,styles:n,unstyled:v,name:a,variant:_,size:p}),x=[],w=[];let b=null;const j=(P,E)=>{const k=typeof o=="function"?o(P.value):!1;return S.createElement(d,eB({key:P.value,className:y.item,"data-disabled":P.disabled||void 0,"data-hovered":!P.disabled&&t===E||void 0,"data-selected":!P.disabled&&k||void 0,selected:k,onMouseEnter:()=>l(E),id:`${i}-${E}`,role:"option",tabIndex:-1,"aria-selected":t===E,ref:$=>{u&&u.current&&(u.current[P.value]=$)},onMouseDown:P.disabled?null:$=>{$.preventDefault(),c(P)},disabled:P.disabled,variant:_},P))};let C=null;if(e.forEach((P,E)=>{P.creatable?b=E:P.group?(C!==P.group&&(C=P.group,w.push(S.createElement("div",{className:y.separator,key:`__mantine-divider-${E}`},S.createElement(mr,{classNames:{label:y.separatorLabel},label:P.group})))),w.push(j(P,E))):x.push(j(P,E))}),m){const P=e[b];x.push(S.createElement("div",{key:Bh(),className:y.item,"data-hovered":t===b||void 0,onMouseEnter:()=>l(b),onMouseDown:E=>{E.preventDefault(),c(P)},tabIndex:-1,ref:E=>{u&&u.current&&(u.current[P.value]=E)}},g))}return w.length>0&&x.length>0&&x.unshift(S.createElement("div",{className:y.separator,key:"empty-group-separator"},S.createElement(mr,null))),w.length>0||x.length>0?S.createElement(S.Fragment,null,w,x):S.createElement(oe,{size:p,unstyled:v,className:y.nothingFound},h)}yR.displayName="@mantine/core/SelectItems";var tB=Object.defineProperty,gf=Object.getOwnPropertySymbols,xR=Object.prototype.hasOwnProperty,wR=Object.prototype.propertyIsEnumerable,C_=(e,t,r)=>t in e?tB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rB=(e,t)=>{for(var r in t||(t={}))xR.call(t,r)&&C_(e,r,t[r]);if(gf)for(var r of gf(t))wR.call(t,r)&&C_(e,r,t[r]);return e},nB=(e,t)=>{var r={};for(var n in e)xR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&gf)for(var n of gf(e))t.indexOf(n)<0&&wR.call(e,n)&&(r[n]=e[n]);return r};const bR=f.forwardRef((e,t)=>{var r=e,{label:n,value:o}=r,i=nB(r,["label","value"]);return S.createElement("div",rB({ref:t},i),n||o)});bR.displayName="@mantine/core/DefaultItem";function oB(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _R(...e){return t=>e.forEach(r=>oB(r,t))}function ma(...e){return f.useCallback(_R(...e),e)}const SR=f.forwardRef((e,t)=>{const{children:r,...n}=e,o=f.Children.toArray(r),i=o.find(aB);if(i){const a=i.props.children,l=o.map(c=>c===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:c);return f.createElement(sy,st({},n,{ref:t}),f.isValidElement(a)?f.cloneElement(a,void 0,l):null)}return f.createElement(sy,st({},n,{ref:t}),r)});SR.displayName="Slot";const sy=f.forwardRef((e,t)=>{const{children:r,...n}=e;return f.isValidElement(r)?f.cloneElement(r,{...sB(n,r.props),ref:_R(t,r.ref)}):f.Children.count(r)>1?f.Children.only(null):null});sy.displayName="SlotClone";const iB=({children:e})=>f.createElement(f.Fragment,null,e);function aB(e){return f.isValidElement(e)&&e.type===iB}function sB(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{i(...l),o(...l)}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}const lB=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Tc=lB.reduce((e,t)=>{const r=f.forwardRef((n,o)=>{const{asChild:i,...a}=n,l=i?SR:t;return f.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),f.createElement(l,st({},a,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ly=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function cB(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const Ic=e=>{const{present:t,children:r}=e,n=uB(t),o=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),i=ma(n.ref,o.ref);return typeof r=="function"||n.isPresent?f.cloneElement(o,{ref:i}):null};Ic.displayName="Presence";function uB(e){const[t,r]=f.useState(),n=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),a=e?"mounted":"unmounted",[l,c]=cB(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=Eu(n.current);i.current=l==="mounted"?u:"none"},[l]),ly(()=>{const u=n.current,d=o.current;if(d!==e){const h=i.current,m=Eu(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),ly(()=>{if(t){const u=p=>{const m=Eu(n.current).includes(p.animationName);p.target===t&&m&&Ms.flushSync(()=>c("ANIMATION_END"))},d=p=>{p.target===t&&(i.current=Eu(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function Eu(e){return(e==null?void 0:e.animationName)||"none"}function dB(e,t=[]){let r=[];function n(i,a){const l=f.createContext(a),c=r.length;r=[...r,a];function u(p){const{scope:h,children:m,...g}=p,v=(h==null?void 0:h[e][c])||l,_=f.useMemo(()=>g,Object.values(g));return f.createElement(v.Provider,{value:_},m)}function d(p,h){const m=(h==null?void 0:h[e][c])||l,g=f.useContext(m);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=r.map(a=>f.createContext(a));return function(l){const c=(l==null?void 0:l[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,fB(o,...t)]}function fB(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=n.reduce((l,{useScope:c,scopeName:u})=>{const p=c(i)[`__scope${u}`];return{...l,...p}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Hi(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}const pB=f.createContext(void 0);function hB(e){const t=f.useContext(pB);return e||t||"ltr"}function mB(e,[t,r]){return Math.min(r,Math.max(t,e))}function ea(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function gB(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const PR="ScrollArea",[jR,k0e]=dB(PR),[vB,vn]=jR(PR),yB=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...a}=e,[l,c]=f.useState(null),[u,d]=f.useState(null),[p,h]=f.useState(null),[m,g]=f.useState(null),[v,_]=f.useState(null),[y,x]=f.useState(0),[w,b]=f.useState(0),[j,C]=f.useState(!1),[P,E]=f.useState(!1),k=ma(t,I=>c(I)),$=hB(o);return f.createElement(vB,{scope:r,type:n,dir:$,scrollHideDelay:i,scrollArea:l,viewport:u,onViewportChange:d,content:p,onContentChange:h,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:j,onScrollbarXEnabledChange:C,scrollbarY:v,onScrollbarYChange:_,scrollbarYEnabled:P,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeightChange:b},f.createElement(Tc.div,st({dir:$},a,{ref:k,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})))}),xB="ScrollAreaViewport",wB=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,...o}=e,i=vn(xB,r),a=f.useRef(null),l=ma(t,a,i.onViewportChange);return f.createElement(f.Fragment,null,f.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),f.createElement(Tc.div,st({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),f.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},n)))}),Mo="ScrollAreaScrollbar",bB=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=vn(Mo,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,l=e.orientation==="horizontal";return f.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),o.type==="hover"?f.createElement(_B,st({},n,{ref:t,forceMount:r})):o.type==="scroll"?f.createElement(SB,st({},n,{ref:t,forceMount:r})):o.type==="auto"?f.createElement(OR,st({},n,{ref:t,forceMount:r})):o.type==="always"?f.createElement(Q0,st({},n,{ref:t})):null}),_B=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=vn(Mo,e.__scopeScrollArea),[i,a]=f.useState(!1);return f.useEffect(()=>{const l=o.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),f.createElement(Ic,{present:r||i},f.createElement(OR,st({"data-state":i?"visible":"hidden"},n,{ref:t})))}),SB=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=vn(Mo,e.__scopeScrollArea),i=e.orientation==="horizontal",a=sm(()=>c("SCROLL_END"),100),[l,c]=gB("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return f.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,o.scrollHideDelay,c]),f.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let p=u[d];const h=()=>{const m=u[d];p!==m&&(c("SCROLL"),a()),p=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c,a]),f.createElement(Ic,{present:r||l!=="hidden"},f.createElement(Q0,st({"data-state":l==="hidden"?"hidden":"visible"},n,{ref:t,onPointerEnter:ea(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ea(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),OR=f.forwardRef((e,t)=>{const r=vn(Mo,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,a]=f.useState(!1),l=e.orientation==="horizontal",c=sm(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;a(l?u:d)}},10);return bs(r.viewport,c),bs(r.content,c),f.createElement(Ic,{present:n||i},f.createElement(Q0,st({"data-state":i?"visible":"hidden"},o,{ref:t})))}),Q0=f.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=vn(Mo,e.__scopeScrollArea),i=f.useRef(null),a=f.useRef(0),[l,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=kR(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function p(h,m){return RB(h,a.current,l,m)}return r==="horizontal"?f.createElement(PB,st({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,m=E_(h,l,o.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=p(h,o.dir))}})):r==="vertical"?f.createElement(jB,st({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,m=E_(h,l);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=p(h))}})):null}),PB=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=vn(Mo,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ma(t,c,i.onScrollbarXChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(ER,st({"data-orientation":"horizontal"},o,{ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":am(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),TR(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:vf(a.paddingLeft),paddingEnd:vf(a.paddingRight)}})}}))}),jB=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=vn(Mo,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ma(t,c,i.onScrollbarYChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(ER,st({"data-orientation":"vertical"},o,{ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":am(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),TR(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:vf(a.paddingTop),paddingEnd:vf(a.paddingBottom)}})}}))}),[OB,CR]=jR(Mo),ER=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:p,...h}=e,m=vn(Mo,r),[g,v]=f.useState(null),_=ma(t,k=>v(k)),y=f.useRef(null),x=f.useRef(""),w=m.viewport,b=n.content-n.viewport,j=Hi(d),C=Hi(c),P=sm(p,10);function E(k){if(y.current){const $=k.clientX-y.current.left,I=k.clientY-y.current.top;u({x:$,y:I})}}return f.useEffect(()=>{const k=$=>{const I=$.target;(g==null?void 0:g.contains(I))&&j($,b)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[w,g,b,j]),f.useEffect(C,[n,C]),bs(g,P),bs(m.content,P),f.createElement(OB,{scope:r,scrollbar:g,hasThumb:o,onThumbChange:Hi(i),onThumbPointerUp:Hi(a),onThumbPositionChange:C,onThumbPointerDown:Hi(l)},f.createElement(Tc.div,st({},h,{ref:_,style:{position:"absolute",...h.style},onPointerDown:ea(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),y.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",E(k))}),onPointerMove:ea(e.onPointerMove,E),onPointerUp:ea(e.onPointerUp,k=>{const $=k.target;$.hasPointerCapture(k.pointerId)&&$.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=x.current,y.current=null})})))}),cy="ScrollAreaThumb",CB=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=CR(cy,e.__scopeScrollArea);return f.createElement(Ic,{present:r||o.hasThumb},f.createElement(EB,st({ref:t},n)))}),EB=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=vn(cy,r),a=CR(cy,r),{onThumbPositionChange:l}=a,c=ma(t,p=>a.onThumbChange(p)),u=f.useRef(),d=sm(()=>{u.current&&(u.current(),u.current=void 0)},100);return f.useEffect(()=>{const p=i.viewport;if(p){const h=()=>{if(d(),!u.current){const m=TB(p,l);u.current=m,l()}};return l(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[i.viewport,d,l]),f.createElement(Tc.div,st({"data-state":a.hasThumb?"visible":"hidden"},o,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ea(e.onPointerDownCapture,p=>{const m=p.target.getBoundingClientRect(),g=p.clientX-m.left,v=p.clientY-m.top;a.onThumbPointerDown({x:g,y:v})}),onPointerUp:ea(e.onPointerUp,a.onThumbPointerUp)}))}),$R="ScrollAreaCorner",$B=f.forwardRef((e,t)=>{const r=vn($R,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?f.createElement(kB,st({},e,{ref:t})):null}),kB=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=vn($R,r),[i,a]=f.useState(0),[l,c]=f.useState(0),u=!!(i&&l);return bs(o.scrollbarX,()=>{var d;const p=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(p),c(p)}),bs(o.scrollbarY,()=>{var d;const p=((d=o.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;o.onCornerWidthChange(p),a(p)}),u?f.createElement(Tc.div,st({},n,{ref:t,style:{width:i,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function vf(e){return e?parseInt(e,10):0}function kR(e,t){const r=e/t;return isNaN(r)?0:r}function am(e){const t=kR(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function RB(e,t,r,n="ltr"){const o=am(r),i=o/2,a=t||i,l=o-a,c=r.scrollbar.paddingStart+a,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,p=n==="ltr"?[0,d]:[d*-1,0];return RR([c,u],p)(e)}function E_(e,t,r="ltr"){const n=am(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,l=i-n,c=r==="ltr"?[0,a]:[a*-1,0],u=mB(e,c);return RR([0,a],[0,l])(u)}function RR(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function TR(e,t){return e>0&&e<t}const TB=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=r.left!==i.left,l=r.top!==i.top;(a||l)&&t(),r=i,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function sm(e,t){const r=Hi(e),n=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),f.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function bs(e,t){const r=Hi(t);ly(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}const IB=yB,DB=wB,$_=bB,k_=CB,NB=$B;var AB=W((e,{scrollbarSize:t,offsetScrollbars:r,scrollbarHovered:n,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:r?O(t):void 0,paddingBottom:r?O(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${O(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${Vt("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:O(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:O(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:Vt("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:O(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:O(44),minHeight:O(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:n?1:0,display:o?"none":void 0}}));const MB=AB;var LB=Object.defineProperty,zB=Object.defineProperties,FB=Object.getOwnPropertyDescriptors,yf=Object.getOwnPropertySymbols,IR=Object.prototype.hasOwnProperty,DR=Object.prototype.propertyIsEnumerable,R_=(e,t,r)=>t in e?LB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uy=(e,t)=>{for(var r in t||(t={}))IR.call(t,r)&&R_(e,r,t[r]);if(yf)for(var r of yf(t))DR.call(t,r)&&R_(e,r,t[r]);return e},NR=(e,t)=>zB(e,FB(t)),AR=(e,t)=>{var r={};for(var n in e)IR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&yf)for(var n of yf(e))t.indexOf(n)<0&&DR.call(e,n)&&(r[n]=e[n]);return r};const MR={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},lm=f.forwardRef((e,t)=>{const r=H("ScrollArea",MR,e),{children:n,className:o,classNames:i,styles:a,scrollbarSize:l,scrollHideDelay:c,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:g,variant:v,viewportProps:_}=r,y=AR(r,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[x,w]=f.useState(!1),b=Ht(),{classes:j,cx:C}=MB({scrollbarSize:l,offsetScrollbars:p,scrollbarHovered:x,hidden:u==="never"},{name:"ScrollArea",classNames:i,styles:a,unstyled:g,variant:v});return S.createElement(IB,{type:u==="never"?"always":u,scrollHideDelay:c,dir:d||b.dir,ref:t,asChild:!0},S.createElement(ae,uy({className:C(j.root,o)},y),S.createElement(DB,NR(uy({},_),{className:j.viewport,ref:h,onScroll:typeof m=="function"?({currentTarget:P})=>m({x:P.scrollLeft,y:P.scrollTop}):void 0}),n),S.createElement($_,{orientation:"horizontal",className:j.scrollbar,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1)},S.createElement(k_,{className:j.thumb})),S.createElement($_,{orientation:"vertical",className:j.scrollbar,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1)},S.createElement(k_,{className:j.thumb})),S.createElement(NB,{className:j.corner})))}),LR=f.forwardRef((e,t)=>{const r=H("ScrollAreaAutosize",MR,e),{children:n,classNames:o,styles:i,scrollbarSize:a,scrollHideDelay:l,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,sx:g,variant:v,viewportProps:_}=r,y=AR(r,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return S.createElement(ae,NR(uy({},y),{ref:t,sx:[{display:"flex"},..._c(g)]}),S.createElement(ae,{sx:{display:"flex",flexDirection:"column",flex:1}},S.createElement(lm,{classNames:o,styles:i,scrollHideDelay:l,scrollbarSize:a,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,variant:v,viewportProps:_},n)))});LR.displayName="@mantine/core/ScrollAreaAutosize";lm.displayName="@mantine/core/ScrollArea";lm.Autosize=LR;const ga=lm;var VB=Object.defineProperty,BB=Object.defineProperties,UB=Object.getOwnPropertyDescriptors,xf=Object.getOwnPropertySymbols,zR=Object.prototype.hasOwnProperty,FR=Object.prototype.propertyIsEnumerable,T_=(e,t,r)=>t in e?VB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,I_=(e,t)=>{for(var r in t||(t={}))zR.call(t,r)&&T_(e,r,t[r]);if(xf)for(var r of xf(t))FR.call(t,r)&&T_(e,r,t[r]);return e},WB=(e,t)=>BB(e,UB(t)),HB=(e,t)=>{var r={};for(var n in e)zR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&xf)for(var n of xf(e))t.indexOf(n)<0&&FR.call(e,n)&&(r[n]=e[n]);return r};const K0=f.forwardRef((e,t)=>{var r=e,{style:n}=r,o=HB(r,["style"]);return S.createElement(ga,WB(I_({},o),{style:I_({width:"100%"},n),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});K0.displayName="@mantine/core/SelectScrollArea";var qB=W(()=>({dropdown:{},itemsWrapper:{padding:O(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const GB=qB,kn=Math.min,ir=Math.max,wf=Math.round,$u=Math.floor,_i=e=>({x:e,y:e}),QB={left:"right",right:"left",bottom:"top",top:"bottom"},KB={start:"end",end:"start"};function dy(e,t,r){return ir(e,kn(t,r))}function $o(e,t){return typeof e=="function"?e(t):e}function Rn(e){return e.split("-")[0]}function zs(e){return e.split("-")[1]}function Y0(e){return e==="x"?"y":"x"}function X0(e){return e==="y"?"height":"width"}function va(e){return["top","bottom"].includes(Rn(e))?"y":"x"}function J0(e){return Y0(va(e))}function YB(e,t,r){r===void 0&&(r=!1);const n=zs(e),o=J0(e),i=X0(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=bf(a)),[a,bf(a)]}function XB(e){const t=bf(e);return[fy(e),t,fy(t)]}function fy(e){return e.replace(/start|end/g,t=>KB[t])}function JB(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:a;default:return[]}}function ZB(e,t,r,n){const o=zs(e);let i=JB(Rn(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(fy)))),i}function bf(e){return e.replace(/left|right|bottom|top/g,t=>QB[t])}function eU(e){return{top:0,right:0,bottom:0,left:0,...e}}function Z0(e){return typeof e!="number"?eU(e):{top:e,right:e,bottom:e,left:e}}function _s(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function D_(e,t,r){let{reference:n,floating:o}=e;const i=va(t),a=J0(t),l=X0(a),c=Rn(t),u=i==="y",d=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,h=n[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:n.y-o.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-o.width,y:p};break;default:m={x:n.x,y:n.y}}switch(zs(t)){case"start":m[a]-=h*(r&&u?-1:1);break;case"end":m[a]+=h*(r&&u?-1:1);break}return m}const tU=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=D_(u,n,c),h=n,m={},g=0;for(let v=0;v<l.length;v++){const{name:_,fn:y}=l[v],{x,y:w,data:b,reset:j}=await y({x:d,y:p,initialPlacement:n,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});if(d=x??d,p=w??p,m={...m,[_]:{...m[_],...b}},j&&g<=50){g++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(u=j.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:p}=D_(u,h,c)),v=-1;continue}}return{x:d,y:p,placement:h,strategy:o,middlewareData:m}};async function ex(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=$o(t,e),g=Z0(m),_=l[h?p==="floating"?"reference":"floating":p],y=_s(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(_)))==null||r?_:_.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=p==="floating"?{...a.floating,x:n,y:o}:a.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),b=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},j=_s(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:w,strategy:c}):x);return{top:(y.top-j.top+g.top)/b.y,bottom:(j.bottom-y.bottom+g.bottom)/b.y,left:(y.left-j.left+g.left)/b.x,right:(j.right-y.right+g.right)/b.x}}const N_=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=$o(e,t)||{};if(u==null)return{};const p=Z0(d),h={x:r,y:n},m=J0(o),g=X0(m),v=await a.getDimensions(u),_=m==="y",y=_?"top":"left",x=_?"bottom":"right",w=_?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[m]-h[m]-i.floating[g],j=h[m]-i.reference[m],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let P=C?C[w]:0;(!P||!await(a.isElement==null?void 0:a.isElement(C)))&&(P=l.floating[w]||i.floating[g]);const E=b/2-j/2,k=P/2-v[g]/2-1,$=kn(p[y],k),I=kn(p[x],k),R=$,N=P-v[g]-I,M=P/2-v[g]/2+E,L=dy(R,M,N),Q=!c.arrow&&zs(o)!=null&&M!=L&&i.reference[g]/2-(M<R?$:I)-v[g]/2<0,G=Q?M<R?M-R:M-N:0;return{[m]:h[m]+G,data:{[m]:L,centerOffset:M-L-G,...Q&&{alignmentOffset:G}},reset:Q}}}),VR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,..._}=$o(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=Rn(o),x=Rn(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=h||(x||!v?[bf(l)]:XB(l));!h&&g!=="none"&&b.push(...ZB(l,v,g,w));const j=[l,...b],C=await ex(t,_),P=[];let E=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&P.push(C[y]),p){const R=YB(o,a,w);P.push(C[R[0]],C[R[1]])}if(E=[...E,{placement:o,overflows:P}],!P.every(R=>R<=0)){var k,$;const R=(((k=i.flip)==null?void 0:k.index)||0)+1,N=j[R];if(N)return{data:{index:R,overflows:E},reset:{placement:N}};let M=($=E.filter(L=>L.overflows[0]<=0).sort((L,Q)=>L.overflows[1]-Q.overflows[1])[0])==null?void 0:$.placement;if(!M)switch(m){case"bestFit":{var I;const L=(I=E.map(Q=>[Q.placement,Q.overflows.filter(G=>G>0).reduce((G,T)=>G+T,0)]).sort((Q,G)=>Q[1]-G[1])[0])==null?void 0:I[0];L&&(M=L);break}case"initialPlacement":M=l;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function BR(e){const t=kn(...e.map(i=>i.left)),r=kn(...e.map(i=>i.top)),n=ir(...e.map(i=>i.right)),o=ir(...e.map(i=>i.bottom));return{x:t,y:r,width:n-t,height:o-r}}function rU(e){const t=e.slice().sort((o,i)=>o.y-i.y),r=[];let n=null;for(let o=0;o<t.length;o++){const i=t[o];!n||i.y-n.y>n.height/2?r.push([i]):r[r.length-1].push(i),n=i}return r.map(o=>_s(BR(o)))}const UR=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:n,rects:o,platform:i,strategy:a}=t,{padding:l=2,x:c,y:u}=$o(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(n.reference))||[]),p=rU(d),h=_s(BR(d)),m=Z0(l);function g(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&u!=null)return p.find(_=>c>_.left-m.left&&c<_.right+m.right&&u>_.top-m.top&&u<_.bottom+m.bottom)||h;if(p.length>=2){if(va(r)==="y"){const $=p[0],I=p[p.length-1],R=Rn(r)==="top",N=$.top,M=I.bottom,L=R?$.left:I.left,Q=R?$.right:I.right,G=Q-L,T=M-N;return{top:N,bottom:M,left:L,right:Q,width:G,height:T,x:L,y:N}}const _=Rn(r)==="left",y=ir(...p.map($=>$.right)),x=kn(...p.map($=>$.left)),w=p.filter($=>_?$.left===x:$.right===y),b=w[0].top,j=w[w.length-1].bottom,C=x,P=y,E=P-C,k=j-b;return{top:b,bottom:j,left:C,right:P,width:E,height:k,x:C,y:b}}return h}const v=await i.getElementRects({reference:{getBoundingClientRect:g},floating:n.floating,strategy:a});return o.reference.x!==v.reference.x||o.reference.y!==v.reference.y||o.reference.width!==v.reference.width||o.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};async function nU(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=Rn(r),l=zs(r),c=va(r)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,p=$o(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const WR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:a,middlewareData:l}=t,c=await nU(t,e);return a===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},tx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:_=>{let{x:y,y:x}=_;return{x:y,y:x}}},...c}=$o(e,t),u={x:r,y:n},d=await ex(t,c),p=va(Rn(o)),h=Y0(p);let m=u[h],g=u[p];if(i){const _=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=m+d[_],w=m-d[y];m=dy(x,m,w)}if(a){const _=p==="y"?"top":"left",y=p==="y"?"bottom":"right",x=g+d[_],w=g-d[y];g=dy(x,g,w)}const v=l.fn({...t,[h]:m,[p]:g});return{...v,data:{x:v.x-r,y:v.y-n}}}}},oU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=$o(e,t),d={x:r,y:n},p=va(o),h=Y0(p);let m=d[h],g=d[p];const v=$o(l,t),_=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const w=h==="y"?"height":"width",b=i.reference[h]-i.floating[w]+_.mainAxis,j=i.reference[h]+i.reference[w]-_.mainAxis;m<b?m=b:m>j&&(m=j)}if(u){var y,x;const w=h==="y"?"width":"height",b=["top","left"].includes(Rn(o)),j=i.reference[p]-i.floating[w]+(b&&((y=a.offset)==null?void 0:y[p])||0)+(b?0:_.crossAxis),C=i.reference[p]+i.reference[w]+(b?0:((x=a.offset)==null?void 0:x[p])||0)-(b?_.crossAxis:0);g<j?g=j:g>C&&(g=C)}return{[h]:m,[p]:g}}}},iU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:o,elements:i}=t,{apply:a=()=>{},...l}=$o(e,t),c=await ex(t,l),u=Rn(r),d=zs(r),p=va(r)==="y",{width:h,height:m}=n.floating;let g,v;u==="top"||u==="bottom"?(g=u,v=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(v=u,g=d==="end"?"top":"bottom");const _=m-c[g],y=h-c[v],x=!t.middlewareData.shift;let w=_,b=y;if(p){const C=h-c.left-c.right;b=d||x?kn(y,C):C}else{const C=m-c.top-c.bottom;w=d||x?kn(_,C):C}if(x&&!d){const C=ir(c.left,0),P=ir(c.right,0),E=ir(c.top,0),k=ir(c.bottom,0);p?b=h-2*(C!==0||P!==0?C+P:ir(c.left,c.right)):w=m-2*(E!==0||k!==0?E+k:ir(c.top,c.bottom))}await a({...t,availableWidth:b,availableHeight:w});const j=await o.getDimensions(i.floating);return h!==j.width||m!==j.height?{reset:{rects:!0}}:{}}}};function Si(e){return HR(e)?(e.nodeName||"").toLowerCase():"#document"}function Kr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lo(e){var t;return(t=(HR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function HR(e){return e instanceof Node||e instanceof Kr(e).Node}function ko(e){return e instanceof Element||e instanceof Kr(e).Element}function oo(e){return e instanceof HTMLElement||e instanceof Kr(e).HTMLElement}function A_(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Kr(e).ShadowRoot}function Dc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=gn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function aU(e){return["table","td","th"].includes(Si(e))}function rx(e){const t=nx(),r=gn(e);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function sU(e){let t=Ss(e);for(;oo(t)&&!cm(t);){if(rx(t))return t;t=Ss(t)}return null}function nx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function cm(e){return["html","body","#document"].includes(Si(e))}function gn(e){return Kr(e).getComputedStyle(e)}function um(e){return ko(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ss(e){if(Si(e)==="html")return e;const t=e.assignedSlot||e.parentNode||A_(e)&&e.host||Lo(e);return A_(t)?t.host:t}function qR(e){const t=Ss(e);return cm(t)?e.ownerDocument?e.ownerDocument.body:e.body:oo(t)&&Dc(t)?t:qR(t)}function _o(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=qR(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=Kr(o);return i?t.concat(a,a.visualViewport||[],Dc(o)?o:[],a.frameElement&&r?_o(a.frameElement):[]):t.concat(o,_o(o,[],r))}function GR(e){const t=gn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=oo(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,l=wf(r)!==i||wf(n)!==a;return l&&(r=i,n=a),{width:r,height:n,$:l}}function ox(e){return ko(e)?e:e.contextElement}function cs(e){const t=ox(e);if(!oo(t))return _i(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=GR(t);let a=(i?wf(r.width):r.width)/n,l=(i?wf(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const lU=_i(0);function QR(e){const t=Kr(e);return!nx()||!t.visualViewport?lU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cU(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Kr(e)?!1:t}function aa(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=ox(e);let a=_i(1);t&&(n?ko(n)&&(a=cs(n)):a=cs(e));const l=cU(i,r,n)?QR(i):_i(0);let c=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,d=o.width/a.x,p=o.height/a.y;if(i){const h=Kr(i),m=n&&ko(n)?Kr(n):n;let g=h.frameElement;for(;g&&n&&m!==h;){const v=cs(g),_=g.getBoundingClientRect(),y=gn(g),x=_.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,w=_.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,p*=v.y,c+=x,u+=w,g=Kr(g).frameElement}}return _s({width:d,height:p,x:c,y:u})}function uU(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=oo(r),i=Lo(r);if(r===i)return t;let a={scrollLeft:0,scrollTop:0},l=_i(1);const c=_i(0);if((o||!o&&n!=="fixed")&&((Si(r)!=="body"||Dc(i))&&(a=um(r)),oo(r))){const u=aa(r);l=cs(r),c.x=u.x+r.clientLeft,c.y=u.y+r.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+c.x,y:t.y*l.y-a.scrollTop*l.y+c.y}}function dU(e){return Array.from(e.getClientRects())}function KR(e){return aa(Lo(e)).left+um(e).scrollLeft}function fU(e){const t=Lo(e),r=um(e),n=e.ownerDocument.body,o=ir(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ir(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+KR(e);const l=-r.scrollTop;return gn(n).direction==="rtl"&&(a+=ir(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:l}}function pU(e,t){const r=Kr(e),n=Lo(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const u=nx();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function hU(e,t){const r=aa(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=oo(e)?cs(e):_i(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=n*i.y;return{width:a,height:l,x:c,y:u}}function M_(e,t,r){let n;if(t==="viewport")n=pU(e,r);else if(t==="document")n=fU(Lo(e));else if(ko(t))n=hU(t,r);else{const o=QR(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return _s(n)}function YR(e,t){const r=Ss(e);return r===t||!ko(r)||cm(r)?!1:gn(r).position==="fixed"||YR(r,t)}function mU(e,t){const r=t.get(e);if(r)return r;let n=_o(e,[],!1).filter(l=>ko(l)&&Si(l)!=="body"),o=null;const i=gn(e).position==="fixed";let a=i?Ss(e):e;for(;ko(a)&&!cm(a);){const l=gn(a),c=rx(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Dc(a)&&!c&&YR(e,a))?n=n.filter(d=>d!==a):o=l,a=Ss(a)}return t.set(e,n),n}function gU(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?mU(t,this._c):[].concat(r),n],l=a[0],c=a.reduce((u,d)=>{const p=M_(t,d,o);return u.top=ir(p.top,u.top),u.right=kn(p.right,u.right),u.bottom=kn(p.bottom,u.bottom),u.left=ir(p.left,u.left),u},M_(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function vU(e){return GR(e)}function yU(e,t,r){const n=oo(t),o=Lo(t),i=r==="fixed",a=aa(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=_i(0);if(n||!n&&!i)if((Si(t)!=="body"||Dc(o))&&(l=um(t)),n){const u=aa(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else o&&(c.x=KR(o));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function L_(e,t){return!oo(e)||gn(e).position==="fixed"?null:t?t(e):e.offsetParent}function XR(e,t){const r=Kr(e);if(!oo(e))return r;let n=L_(e,t);for(;n&&aU(n)&&gn(n).position==="static";)n=L_(n,t);return n&&(Si(n)==="html"||Si(n)==="body"&&gn(n).position==="static"&&!rx(n))?r:n||sU(e)||r}const xU=async function(e){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||XR,i=this.getDimensions;return{reference:yU(t,await o(r),n),floating:{x:0,y:0,...await i(r)}}};function wU(e){return gn(e).direction==="rtl"}const bU={convertOffsetParentRelativeRectToViewportRelativeRect:uU,getDocumentElement:Lo,getClippingRect:gU,getOffsetParent:XR,getElementRects:xU,getClientRects:dU,getDimensions:vU,getScale:cs,isElement:ko,isRTL:wU};function _U(e,t){let r=null,n;const o=Lo(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:p,height:h}=e.getBoundingClientRect();if(l||t(),!p||!h)return;const m=$u(d),g=$u(o.clientWidth-(u+p)),v=$u(o.clientHeight-(d+h)),_=$u(u),x={rootMargin:-m+"px "+-g+"px "+-v+"px "+-_+"px",threshold:ir(0,kn(1,c))||1};let w=!0;function b(j){const C=j[0].intersectionRatio;if(C!==c){if(!w)return a();C?a(!1,C):n=setTimeout(()=>{a(!1,1e-7)},100)}w=!1}try{r=new IntersectionObserver(b,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(b,x)}r.observe(e)}return a(!0),i}function SU(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=ox(e),d=o||i?[...u?_o(u):[],..._o(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const p=u&&l?_U(u,r):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let g,v=c?aa(e):null;c&&_();function _(){const y=aa(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&r(),v=y,g=requestAnimationFrame(_)}return r(),()=>{d.forEach(y=>{o&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),p&&p(),m&&m.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const PU=(e,t,r)=>{const n=new Map,o={platform:bU,...r},i={...o.platform,_c:n};return tU(e,t,{...o,platform:i})},JR=e=>{const{element:t,padding:r}=e;function n(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return n(t)?t.current!=null?N_({element:t.current,padding:r}).fn(o):{}:t?N_({element:t,padding:r}).fn(o):{}}}};var gd=typeof document<"u"?f.useLayoutEffect:f.useEffect;function _f(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!_f(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!_f(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function z_(e){const t=f.useRef(e);return gd(()=>{t.current=e}),t}function jU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,whileElementsMounted:i,open:a}=e,[l,c]=f.useState({x:null,y:null,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[u,d]=f.useState(n);_f(u,n)||d(n);const p=f.useRef(null),h=f.useRef(null),m=f.useRef(l),g=z_(i),v=z_(o),[_,y]=f.useState(null),[x,w]=f.useState(null),b=f.useCallback($=>{p.current!==$&&(p.current=$,y($))},[]),j=f.useCallback($=>{h.current!==$&&(h.current=$,w($))},[]),C=f.useCallback(()=>{if(!p.current||!h.current)return;const $={placement:t,strategy:r,middleware:u};v.current&&($.platform=v.current),PU(p.current,h.current,$).then(I=>{const R={...I,isPositioned:!0};P.current&&!_f(m.current,R)&&(m.current=R,Ms.flushSync(()=>{c(R)}))})},[u,t,r,v]);gd(()=>{a===!1&&m.current.isPositioned&&(m.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[a]);const P=f.useRef(!1);gd(()=>(P.current=!0,()=>{P.current=!1}),[]),gd(()=>{if(_&&x){if(g.current)return g.current(_,x,C);C()}},[_,x,C,g]);const E=f.useMemo(()=>({reference:p,floating:h,setReference:b,setFloating:j}),[b,j]),k=f.useMemo(()=>({reference:_,floating:x}),[_,x]);return f.useMemo(()=>({...l,update:C,refs:E,elements:k,reference:b,floating:j}),[l,C,E,k,b,j])}var Ps=typeof document<"u"?f.useLayoutEffect:f.useEffect;let Og=!1,OU=0;const F_=()=>"floating-ui-"+OU++;function CU(){const[e,t]=f.useState(()=>Og?F_():void 0);return Ps(()=>{e==null&&t(F_())},[]),f.useEffect(()=>{Og||(Og=!0)},[]),e}const EU=Hl.useId,V_=EU||CU;function $U(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){e.set(t,(e.get(t)||[]).filter(n=>n!==r))}}}const kU=f.createContext(null),RU=f.createContext(null),ZR=()=>{var e;return((e=f.useContext(kU))==null?void 0:e.id)||null},ix=()=>f.useContext(RU);function si(e){return(e==null?void 0:e.ownerDocument)||document}function TU(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function IU(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}function ax(e){return si(e).defaultView||window}function Xn(e){return e?e instanceof ax(e).Element:!1}function eT(e){return e?e instanceof ax(e).HTMLElement:!1}function DU(e){if(typeof ShadowRoot>"u")return!1;const t=ax(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function NU(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(TU())||t.test(IU()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function AU(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function tT(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function B_(e){const t=f.useRef(e);return Ps(()=>{t.current=e}),t}const U_="data-floating-ui-safe-polygon";function vd(e,t,r){return r&&!tT(r)?0:typeof e=="number"?e:e==null?void 0:e[t]}const MU=function(e,t){let{enabled:r=!0,delay:n=0,handleClose:o=null,mouseOnly:i=!1,restMs:a=0,move:l=!0}=t===void 0?{}:t;const{open:c,onOpenChange:u,dataRef:d,events:p,elements:{domReference:h,floating:m},refs:g}=e,v=ix(),_=ZR(),y=B_(o),x=B_(n),w=f.useRef(),b=f.useRef(),j=f.useRef(),C=f.useRef(),P=f.useRef(!0),E=f.useRef(!1),k=f.useRef(()=>{}),$=f.useCallback(()=>{var M;const L=(M=d.current.openEvent)==null?void 0:M.type;return(L==null?void 0:L.includes("mouse"))&&L!=="mousedown"},[d]);f.useEffect(()=>{if(!r)return;function M(){clearTimeout(b.current),clearTimeout(C.current),P.current=!0}return p.on("dismiss",M),()=>{p.off("dismiss",M)}},[r,p]),f.useEffect(()=>{if(!r||!y.current||!c)return;function M(){$()&&u(!1)}const L=si(m).documentElement;return L.addEventListener("mouseleave",M),()=>{L.removeEventListener("mouseleave",M)}},[m,c,u,r,y,d,$]);const I=f.useCallback(function(M){M===void 0&&(M=!0);const L=vd(x.current,"close",w.current);L&&!j.current?(clearTimeout(b.current),b.current=setTimeout(()=>u(!1),L)):M&&(clearTimeout(b.current),u(!1))},[x,u]),R=f.useCallback(()=>{k.current(),j.current=void 0},[]),N=f.useCallback(()=>{if(E.current){const M=si(g.floating.current).body;M.style.pointerEvents="",M.removeAttribute(U_),E.current=!1}},[g]);return f.useEffect(()=>{if(!r)return;function M(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function L(T){if(clearTimeout(b.current),P.current=!1,i&&!tT(w.current)||a>0&&vd(x.current,"open")===0)return;d.current.openEvent=T;const F=vd(x.current,"open",w.current);F?b.current=setTimeout(()=>{u(!0)},F):u(!0)}function Q(T){if(M())return;k.current();const F=si(m);if(clearTimeout(C.current),y.current){c||clearTimeout(b.current),j.current=y.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){N(),R(),I()}});const V=j.current;F.addEventListener("mousemove",V),k.current=()=>{F.removeEventListener("mousemove",V)};return}I()}function G(T){M()||y.current==null||y.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){N(),R(),I()}})(T)}if(Xn(h)){const T=h;return c&&T.addEventListener("mouseleave",G),m==null||m.addEventListener("mouseleave",G),l&&T.addEventListener("mousemove",L,{once:!0}),T.addEventListener("mouseenter",L),T.addEventListener("mouseleave",Q),()=>{c&&T.removeEventListener("mouseleave",G),m==null||m.removeEventListener("mouseleave",G),l&&T.removeEventListener("mousemove",L),T.removeEventListener("mouseenter",L),T.removeEventListener("mouseleave",Q)}}},[h,m,r,e,i,a,l,I,R,N,u,c,v,x,y,d]),Ps(()=>{var M;if(r&&c&&(M=y.current)!=null&&M.__options.blockPointerEvents&&$()){const G=si(m).body;if(G.setAttribute(U_,""),G.style.pointerEvents="none",E.current=!0,Xn(h)&&m){var L,Q;const T=h,F=v==null||(L=v.nodesRef.current.find(V=>V.id===_))==null||(Q=L.context)==null?void 0:Q.elements.floating;return F&&(F.style.pointerEvents=""),T.style.pointerEvents="auto",m.style.pointerEvents="auto",()=>{T.style.pointerEvents="",m.style.pointerEvents=""}}}},[r,c,_,m,h,v,y,d,$]),Ps(()=>{c||(w.current=void 0,R(),N())},[c,R,N]),f.useEffect(()=>()=>{R(),clearTimeout(b.current),clearTimeout(C.current),N()},[r,R,N]),f.useMemo(()=>{if(!r)return{};function M(L){w.current=L.pointerType}return{reference:{onPointerDown:M,onPointerEnter:M,onMouseMove(){c||a===0||(clearTimeout(C.current),C.current=setTimeout(()=>{P.current||u(!0)},a))}},floating:{onMouseEnter(){clearTimeout(b.current)},onMouseLeave(){p.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),I(!1)}}}},[p,r,a,c,u,I])},rT=f.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),nT=()=>f.useContext(rT),LU=e=>{let{children:t,delay:r,timeoutMs:n=0}=e;const[o,i]=f.useReducer((c,u)=>({...c,...u}),{delay:r,timeoutMs:n,initialDelay:r,currentId:null,isInstantPhase:!1}),a=f.useRef(null),l=f.useCallback(c=>{i({currentId:c})},[]);return Ps(()=>{o.currentId?a.current===null?a.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),a.current=null)},[o.currentId]),f.createElement(rT.Provider,{value:f.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,i,l])},t)},zU=(e,t)=>{let{open:r,onOpenChange:n}=e,{id:o}=t;const{currentId:i,setCurrentId:a,initialDelay:l,setState:c,timeoutMs:u}=nT();f.useEffect(()=>{i&&(c({delay:{open:1,close:vd(l,"close")}}),i!==o&&n(!1))},[o,n,c,i,l]),f.useEffect(()=>{function d(){n(!1),c({delay:l,currentId:null})}if(!r&&i===o)if(u){const p=window.setTimeout(d,u);return()=>{clearTimeout(p)}}else d()},[r,c,i,o,n,l,u]),f.useEffect(()=>{r&&a(o)},[r,a,o])};function FU(e){let t=e.activeElement;for(;((r=t)==null||(n=r.shadowRoot)==null?void 0:n.activeElement)!=null;){var r,n;t=t.shadowRoot.activeElement}return t}function W_(e,t){if(!e||!t)return!1;const r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&DU(r)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function Cg(e,t){let r=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],n=r;for(;n.length;)n=e.filter(o=>{var i;return(i=n)==null?void 0:i.some(a=>{var l;return o.parentId===a.id&&((l=o.context)==null?void 0:l.open)})})||[],r=r.concat(n);return r}function VU(e){return"composedPath"in e?e.composedPath()[0]:e.target}const BU=Hl.useInsertionEffect,UU=BU||(e=>e());function oT(e){const t=f.useRef(()=>{});return UU(()=>{t.current=e}),f.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function yd(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}const WU={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},HU={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},qU=function(e){var t,r;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(r=e.outsidePress)!=null?r:!0}},GU=function(e,t){let{open:r,onOpenChange:n,events:o,nodeId:i,elements:{reference:a,domReference:l,floating:c},dataRef:u}=e,{enabled:d=!0,escapeKey:p=!0,outsidePress:h=!0,outsidePressEvent:m="pointerdown",referencePress:g=!1,referencePressEvent:v="pointerdown",ancestorScroll:_=!1,bubbles:y=!0}=t===void 0?{}:t;const x=ix(),w=ZR()!=null,b=oT(typeof h=="function"?h:()=>!1),j=typeof h=="function"?b:h,C=f.useRef(!1),{escapeKeyBubbles:P,outsidePressBubbles:E}=qU(y);return f.useEffect(()=>{if(!r||!d)return;u.current.__escapeKeyBubbles=P,u.current.__outsidePressBubbles=E;function k(M){if(M.key==="Escape"){const L=x?Cg(x.nodesRef.current,i):[];if(L.length>0){let Q=!0;if(L.forEach(G=>{var T;if((T=G.context)!=null&&T.open&&!G.context.dataRef.current.__escapeKeyBubbles){Q=!1;return}}),!Q)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),n(!1)}}function $(M){const L=C.current;if(C.current=!1,L||typeof j=="function"&&!j(M))return;const Q=VU(M);if(eT(Q)&&c){const F=c.ownerDocument.defaultView||window,V=Q.scrollWidth>Q.clientWidth,X=Q.scrollHeight>Q.clientHeight;let J=X&&M.offsetX>Q.clientWidth;if(X&&F.getComputedStyle(Q).direction==="rtl"&&(J=M.offsetX<=Q.offsetWidth-Q.clientWidth),J||V&&M.offsetY>Q.clientHeight)return}const G=x&&Cg(x.nodesRef.current,i).some(F=>{var V;return yd(M,(V=F.context)==null?void 0:V.elements.floating)});if(yd(M,c)||yd(M,l)||G)return;const T=x?Cg(x.nodesRef.current,i):[];if(T.length>0){let F=!0;if(T.forEach(V=>{var X;if((X=V.context)!=null&&X.open&&!V.context.dataRef.current.__outsidePressBubbles){F=!1;return}}),!F)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:NU(M)||AU(M)}}),n(!1)}function I(){n(!1)}const R=si(c);p&&R.addEventListener("keydown",k),j&&R.addEventListener(m,$);let N=[];return _&&(Xn(l)&&(N=_o(l)),Xn(c)&&(N=N.concat(_o(c))),!Xn(a)&&a&&a.contextElement&&(N=N.concat(_o(a.contextElement)))),N=N.filter(M=>{var L;return M!==((L=R.defaultView)==null?void 0:L.visualViewport)}),N.forEach(M=>{M.addEventListener("scroll",I,{passive:!0})}),()=>{p&&R.removeEventListener("keydown",k),j&&R.removeEventListener(m,$),N.forEach(M=>{M.removeEventListener("scroll",I)})}},[u,c,l,a,p,j,m,o,x,i,r,n,_,d,P,E,w]),f.useEffect(()=>{C.current=!1},[j,m]),f.useMemo(()=>d?{reference:{[WU[v]]:()=>{g&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),n(!1))}},floating:{[HU[m]]:()=>{C.current=!0}}}:{},[d,o,g,m,v,n])},QU=function(e,t){let{open:r,onOpenChange:n,dataRef:o,events:i,refs:a,elements:{floating:l,domReference:c}}=e,{enabled:u=!0,keyboardOnly:d=!0}=t===void 0?{}:t;const p=f.useRef(""),h=f.useRef(!1),m=f.useRef();return f.useEffect(()=>{if(!u)return;const v=si(l).defaultView||window;function _(){!r&&eT(c)&&c===FU(si(c))&&(h.current=!0)}return v.addEventListener("blur",_),()=>{v.removeEventListener("blur",_)}},[l,c,r,u]),f.useEffect(()=>{if(!u)return;function g(v){(v.type==="referencePress"||v.type==="escapeKey")&&(h.current=!0)}return i.on("dismiss",g),()=>{i.off("dismiss",g)}},[i,u]),f.useEffect(()=>()=>{clearTimeout(m.current)},[]),f.useMemo(()=>u?{reference:{onPointerDown(g){let{pointerType:v}=g;p.current=v,h.current=!!(v&&d)},onMouseLeave(){h.current=!1},onFocus(g){var v;h.current||g.type==="focus"&&((v=o.current.openEvent)==null?void 0:v.type)==="mousedown"&&o.current.openEvent&&yd(o.current.openEvent,c)||(o.current.openEvent=g.nativeEvent,n(!0))},onBlur(g){h.current=!1;const v=g.relatedTarget,_=Xn(v)&&v.hasAttribute("data-floating-ui-focus-guard")&&v.getAttribute("data-type")==="outside";m.current=setTimeout(()=>{W_(a.floating.current,v)||W_(c,v)||_||n(!1)})}}}:{},[u,d,c,a,o,n])},KU=function(e,t){let{open:r}=e,{enabled:n=!0,role:o="dialog"}=t===void 0?{}:t;const i=V_(),a=V_();return f.useMemo(()=>{const l={id:i,role:o};return n?o==="tooltip"?{reference:{"aria-describedby":r?i:void 0},floating:l}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":r?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:a}},floating:{...l,...o==="menu"&&{"aria-labelledby":a}}}:{}},[n,o,r,i,a])};function sx(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:r,nodeId:n}=e,o=jU(e),i=ix(),a=f.useRef(null),l=f.useRef({}),c=f.useState(()=>$U())[0],[u,d]=f.useState(null),p=f.useCallback(y=>{const x=Xn(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;o.refs.setReference(x)},[o.refs]),h=f.useCallback(y=>{(Xn(y)||y===null)&&(a.current=y,d(y)),(Xn(o.refs.reference.current)||o.refs.reference.current===null||y!==null&&!Xn(y))&&o.refs.setReference(y)},[o.refs]),m=f.useMemo(()=>({...o.refs,setReference:h,setPositionReference:p,domReference:a}),[o.refs,h,p]),g=f.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),v=oT(r),_=f.useMemo(()=>({...o,refs:m,elements:g,dataRef:l,nodeId:n,events:c,open:t,onOpenChange:v}),[o,n,c,t,v,m,g]);return Ps(()=>{const y=i==null?void 0:i.nodesRef.current.find(x=>x.id===n);y&&(y.context=_)}),f.useMemo(()=>({...o,context:_,refs:m,reference:h,positionReference:p}),[o,m,_,h,p])}function Eg(e,t,r){const n=new Map;return{...r==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[r]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(a=>{let[l,c]=a;if(l.indexOf("on")===0){if(n.has(l)||n.set(l,[]),typeof c=="function"){var u;(u=n.get(l))==null||u.push(c),o[l]=function(){for(var d,p=arguments.length,h=new Array(p),m=0;m<p;m++)h[m]=arguments[m];(d=n.get(l))==null||d.forEach(g=>g(...h))}}}else o[l]=c}),o),{})}}const YU=function(e){e===void 0&&(e=[]);const t=e,r=f.useCallback(i=>Eg(i,e,"reference"),t),n=f.useCallback(i=>Eg(i,e,"floating"),t),o=f.useCallback(i=>Eg(i,e,"item"),e.map(i=>i==null?void 0:i.item));return f.useMemo(()=>({getReferenceProps:r,getFloatingProps:n,getItemProps:o}),[r,n,o])};function iT({opened:e,floating:t,position:r,positionDependencies:n}){const[o,i]=f.useState(0);f.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return SU(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,r]),cn(()=>{t.update()},n),cn(()=>{i(a=>a+1)},[e])}function XU(e){const t=[WR(e.offset)];return e.middlewares.shift&&t.push(tx({limiter:oU()})),e.middlewares.flip&&t.push(VR()),e.middlewares.inline&&t.push(UR()),t.push(JR({element:e.arrowRef,padding:e.arrowOffset})),t}function JU(e){const[t,r]=Ir({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),n=()=>{var a;(a=e.onClose)==null||a.call(e),r(!1)},o=()=>{var a,l;t?((a=e.onClose)==null||a.call(e),r(!1)):((l=e.onOpen)==null||l.call(e),r(!0))},i=sx({placement:e.position,middleware:[...XU(e),...e.width==="target"?[iU({apply({rects:a}){var l,c;Object.assign((c=(l=i.refs.floating.current)==null?void 0:l.style)!=null?c:{},{width:`${a.reference.width}px`})}})]:[]]});return iT({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:i}),cn(()=>{var a;(a=e.onPositionChange)==null||a.call(e,i.placement)},[i.placement]),cn(()=>{var a,l;e.opened?(l=e.onOpen)==null||l.call(e):(a=e.onClose)==null||a.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:n,onToggle:o}}const aT={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[ZU,sT]=No(aT.context);var eW=Object.defineProperty,tW=Object.defineProperties,rW=Object.getOwnPropertyDescriptors,Sf=Object.getOwnPropertySymbols,lT=Object.prototype.hasOwnProperty,cT=Object.prototype.propertyIsEnumerable,H_=(e,t,r)=>t in e?eW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ku=(e,t)=>{for(var r in t||(t={}))lT.call(t,r)&&H_(e,r,t[r]);if(Sf)for(var r of Sf(t))cT.call(t,r)&&H_(e,r,t[r]);return e},nW=(e,t)=>tW(e,rW(t)),oW=(e,t)=>{var r={};for(var n in e)lT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Sf)for(var n of Sf(e))t.indexOf(n)<0&&cT.call(e,n)&&(r[n]=e[n]);return r};const iW={refProp:"ref",popupType:"dialog",shouldOverrideDefaultTargetId:!0},uT=f.forwardRef((e,t)=>{const r=H("PopoverTarget",iW,e),{children:n,refProp:o,popupType:i,shouldOverrideDefaultTargetId:a}=r,l=oW(r,["children","refProp","popupType","shouldOverrideDefaultTargetId"]);if(!Ts(n))throw new Error(aT.children);const c=l,u=sT(),d=Ds(u.reference,n.ref,t),p=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:a?u.getTargetId():n.props.id}:{};return f.cloneElement(n,ku(nW(ku(ku(ku({},c),p),u.targetProps),{className:LE(u.targetProps.className,c.className,n.props.className),[o]:d}),u.controlled?null:{onClick:u.onToggle}))});uT.displayName="@mantine/core/PopoverTarget";var aW=W((e,{radius:t,shadow:r})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[r]||r||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const sW=aW;var lW=Object.defineProperty,q_=Object.getOwnPropertySymbols,cW=Object.prototype.hasOwnProperty,uW=Object.prototype.propertyIsEnumerable,G_=(e,t,r)=>t in e?lW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ra=(e,t)=>{for(var r in t||(t={}))cW.call(t,r)&&G_(e,r,t[r]);if(q_)for(var r of q_(t))uW.call(t,r)&&G_(e,r,t[r]);return e};const Q_={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function dW({transition:e,state:t,duration:r,timingFunction:n}){const o={transitionDuration:`${r}ms`,transitionTimingFunction:n};return typeof e=="string"?e in iu?Ra(Ra(Ra({transitionProperty:iu[e].transitionProperty},o),iu[e].common),iu[e][Q_[t]]):null:Ra(Ra(Ra({transitionProperty:e.transitionProperty},o),e.common),e[Q_[t]])}function fW({duration:e,exitDuration:t,timingFunction:r,mounted:n,onEnter:o,onExit:i,onEntered:a,onExited:l}){const c=Ht(),u=Uh(),d=c.respectReducedMotion?u:!1,[p,h]=f.useState(d?0:e),[m,g]=f.useState(n?"entered":"exited"),v=f.useRef(-1),_=y=>{const x=y?o:i,w=y?a:l;g(y?"pre-entering":"pre-exiting"),window.clearTimeout(v.current);const b=d?0:y?e:t;if(h(b),b===0)typeof x=="function"&&x(),typeof w=="function"&&w(),g(y?"entered":"exited");else{const j=window.setTimeout(()=>{typeof x=="function"&&x(),g(y?"entering":"exiting")},10);v.current=window.setTimeout(()=>{window.clearTimeout(j),typeof w=="function"&&w(),g(y?"entered":"exited")},b)}};return cn(()=>{_(n)},[n]),f.useEffect(()=>()=>window.clearTimeout(v.current),[]),{transitionDuration:p,transitionStatus:m,transitionTimingFunction:r||c.transitionTimingFunction}}function ya({keepMounted:e,transition:t,duration:r=250,exitDuration:n=r,mounted:o,children:i,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d}){const{transitionDuration:p,transitionStatus:h,transitionTimingFunction:m}=fW({mounted:o,exitDuration:n,duration:r,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d});return p===0?o?S.createElement(S.Fragment,null,i({})):e?i({display:"none"}):null:h==="exited"?e?i({display:"none"}):null:S.createElement(S.Fragment,null,i(dW({transition:t,duration:p,state:h,timingFunction:m})))}ya.displayName="@mantine/core/Transition";function lx({children:e,active:t=!0,refProp:r="ref"}){const n=jL(t),o=Ds(n,e==null?void 0:e.ref);return Ts(e)?f.cloneElement(e,{[r]:o}):e}lx.displayName="@mantine/core/FocusTrap";var pW=Object.defineProperty,hW=Object.defineProperties,mW=Object.getOwnPropertyDescriptors,K_=Object.getOwnPropertySymbols,gW=Object.prototype.hasOwnProperty,vW=Object.prototype.propertyIsEnumerable,Y_=(e,t,r)=>t in e?pW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yo=(e,t)=>{for(var r in t||(t={}))gW.call(t,r)&&Y_(e,r,t[r]);if(K_)for(var r of K_(t))vW.call(t,r)&&Y_(e,r,t[r]);return e},Ru=(e,t)=>hW(e,mW(t));function X_(e,t,r,n){return e==="center"||n==="center"?{top:t}:e==="end"?{bottom:r}:e==="start"?{top:r}:{}}function J_(e,t,r,n,o){return e==="center"||n==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:r}:e==="start"?{[o==="ltr"?"left":"right"]:r}:{}}const yW={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function xW({position:e,arrowSize:t,arrowOffset:r,arrowRadius:n,arrowPosition:o,arrowX:i,arrowY:a,dir:l}){const[c,u="center"]=e.split("-"),d={width:O(t),height:O(t),transform:"rotate(45deg)",position:"absolute",[yW[c]]:O(n)},p=O(-t/2);return c==="left"?Ru(Yo(Yo({},d),X_(u,a,r,o)),{right:p,borderLeftColor:"transparent",borderBottomColor:"transparent"}):c==="right"?Ru(Yo(Yo({},d),X_(u,a,r,o)),{left:p,borderRightColor:"transparent",borderTopColor:"transparent"}):c==="top"?Ru(Yo(Yo({},d),J_(u,i,r,o,l)),{bottom:p,borderTopColor:"transparent",borderLeftColor:"transparent"}):c==="bottom"?Ru(Yo(Yo({},d),J_(u,i,r,o,l)),{top:p,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var wW=Object.defineProperty,bW=Object.defineProperties,_W=Object.getOwnPropertyDescriptors,Pf=Object.getOwnPropertySymbols,dT=Object.prototype.hasOwnProperty,fT=Object.prototype.propertyIsEnumerable,Z_=(e,t,r)=>t in e?wW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SW=(e,t)=>{for(var r in t||(t={}))dT.call(t,r)&&Z_(e,r,t[r]);if(Pf)for(var r of Pf(t))fT.call(t,r)&&Z_(e,r,t[r]);return e},PW=(e,t)=>bW(e,_W(t)),jW=(e,t)=>{var r={};for(var n in e)dT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pf)for(var n of Pf(e))t.indexOf(n)<0&&fT.call(e,n)&&(r[n]=e[n]);return r};const cx=f.forwardRef((e,t)=>{var r=e,{position:n,arrowSize:o,arrowOffset:i,arrowRadius:a,arrowPosition:l,visible:c,arrowX:u,arrowY:d}=r,p=jW(r,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const h=Ht();return c?S.createElement("div",PW(SW({},p),{ref:t,style:xW({position:n,arrowSize:o,arrowOffset:i,arrowRadius:a,arrowPosition:l,dir:h.dir,arrowX:u,arrowY:d})})):null});cx.displayName="@mantine/core/FloatingArrow";var OW=Object.defineProperty,CW=Object.defineProperties,EW=Object.getOwnPropertyDescriptors,jf=Object.getOwnPropertySymbols,pT=Object.prototype.hasOwnProperty,hT=Object.prototype.propertyIsEnumerable,eS=(e,t,r)=>t in e?OW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ta=(e,t)=>{for(var r in t||(t={}))pT.call(t,r)&&eS(e,r,t[r]);if(jf)for(var r of jf(t))hT.call(t,r)&&eS(e,r,t[r]);return e},Tu=(e,t)=>CW(e,EW(t)),$W=(e,t)=>{var r={};for(var n in e)pT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&jf)for(var n of jf(e))t.indexOf(n)<0&&hT.call(e,n)&&(r[n]=e[n]);return r};const kW={};function mT(e){var t;const r=H("PopoverDropdown",kW,e),{style:n,className:o,children:i,onKeyDownCapture:a}=r,l=$W(r,["style","className","children","onKeyDownCapture"]),c=sT(),{classes:u,cx:d}=sW({radius:c.radius,shadow:c.shadow},{name:c.__staticSelector,classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant}),p=d$({opened:c.opened,shouldReturnFocus:c.returnFocus}),h=c.withRoles?{"aria-labelledby":c.getTargetId(),id:c.getDropdownId(),role:"dialog"}:{};return c.disabled?null:S.createElement(Ls,Tu(Ta({},c.portalProps),{withinPortal:c.withinPortal}),S.createElement(ya,Tu(Ta({mounted:c.opened},c.transitionProps),{transition:c.transitionProps.transition||"fade",duration:(t=c.transitionProps.duration)!=null?t:150,keepMounted:c.keepMounted,exitDuration:typeof c.transitionProps.exitDuration=="number"?c.transitionProps.exitDuration:c.transitionProps.duration}),m=>{var g,v;return S.createElement(lx,{active:c.trapFocus},S.createElement(ae,Ta(Tu(Ta({},h),{tabIndex:-1,ref:c.floating,style:Tu(Ta(Ta({},n),m),{zIndex:c.zIndex,top:(g=c.y)!=null?g:0,left:(v=c.x)!=null?v:0,width:c.width==="target"?void 0:O(c.width)}),className:d(u.dropdown,o),onKeyDownCapture:q9(c.onClose,{active:c.closeOnEscape,onTrigger:p,onKeyDown:a}),"data-position":c.placement}),l),i,S.createElement(cx,{ref:c.arrowRef,arrowX:c.arrowX,arrowY:c.arrowY,visible:c.withArrow,position:c.placement,arrowSize:c.arrowSize,arrowRadius:c.arrowRadius,arrowOffset:c.arrowOffset,arrowPosition:c.arrowPosition,className:u.arrow})))}))}mT.displayName="@mantine/core/PopoverDropdown";function gT(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[r,n]=t.split("-"),o=r==="right"?"left":"right";return n===void 0?o:`${o}-${n}`}return t}var tS=Object.getOwnPropertySymbols,RW=Object.prototype.hasOwnProperty,TW=Object.prototype.propertyIsEnumerable,IW=(e,t)=>{var r={};for(var n in e)RW.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tS)for(var n of tS(e))t.indexOf(n)<0&&TW.call(e,n)&&(r[n]=e[n]);return r};const DW={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Dn("popover"),__staticSelector:"Popover",width:"max-content"};function zo(e){var t,r,n,o,i,a;const l=f.useRef(null),c=H("Popover",DW,e),{children:u,position:d,offset:p,onPositionChange:h,positionDependencies:m,opened:g,transitionProps:v,width:_,middlewares:y,withArrow:x,arrowSize:w,arrowOffset:b,arrowRadius:j,arrowPosition:C,unstyled:P,classNames:E,styles:k,closeOnClickOutside:$,withinPortal:I,portalProps:R,closeOnEscape:N,clickOutsideEvents:M,trapFocus:L,onClose:Q,onOpen:G,onChange:T,zIndex:F,radius:V,shadow:X,id:J,defaultOpened:_e,__staticSelector:Se,withRoles:Xe,disabled:Le,returnFocus:gt,variant:Nt,keepMounted:ke}=c,qt=IW(c,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[zr,cr]=f.useState(null),[Gt,At]=f.useState(null),co=Ar(J),Uo=Ht(),tt=JU({middlewares:y,width:_,position:gT(Uo.dir,d),offset:typeof p=="number"?p+(x?w/2:0):p,arrowRef:l,arrowOffset:b,onPositionChange:h,positionDependencies:m,opened:g,defaultOpened:_e,onChange:T,onOpen:G,onClose:Q});hL(()=>tt.opened&&$&&tt.onClose(),M,[zr,Gt]);const uo=f.useCallback(ur=>{cr(ur),tt.floating.reference(ur)},[tt.floating.reference]),Sr=f.useCallback(ur=>{At(ur),tt.floating.floating(ur)},[tt.floating.floating]);return S.createElement(ZU,{value:{returnFocus:gt,disabled:Le,controlled:tt.controlled,reference:uo,floating:Sr,x:tt.floating.x,y:tt.floating.y,arrowX:(n=(r=(t=tt.floating)==null?void 0:t.middlewareData)==null?void 0:r.arrow)==null?void 0:n.x,arrowY:(a=(i=(o=tt.floating)==null?void 0:o.middlewareData)==null?void 0:i.arrow)==null?void 0:a.y,opened:tt.opened,arrowRef:l,transitionProps:v,width:_,withArrow:x,arrowSize:w,arrowOffset:b,arrowRadius:j,arrowPosition:C,placement:tt.floating.placement,trapFocus:L,withinPortal:I,portalProps:R,zIndex:F,radius:V,shadow:X,closeOnEscape:N,onClose:tt.onClose,onToggle:tt.onToggle,getTargetId:()=>`${co}-target`,getDropdownId:()=>`${co}-dropdown`,withRoles:Xe,targetProps:qt,__staticSelector:Se,classNames:E,styles:k,unstyled:P,variant:Nt,keepMounted:ke}},u)}zo.Target=uT;zo.Dropdown=mT;zo.displayName="@mantine/core/Popover";var NW=Object.defineProperty,Of=Object.getOwnPropertySymbols,vT=Object.prototype.hasOwnProperty,yT=Object.prototype.propertyIsEnumerable,rS=(e,t,r)=>t in e?NW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,AW=(e,t)=>{for(var r in t||(t={}))vT.call(t,r)&&rS(e,r,t[r]);if(Of)for(var r of Of(t))yT.call(t,r)&&rS(e,r,t[r]);return e},MW=(e,t)=>{var r={};for(var n in e)vT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Of)for(var n of Of(e))t.indexOf(n)<0&&yT.call(e,n)&&(r[n]=e[n]);return r};function LW(e){var t=e,{children:r,component:n="div",maxHeight:o=220,direction:i="column",id:a,innerRef:l,__staticSelector:c,styles:u,classNames:d,unstyled:p}=t,h=MW(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:m}=GB(null,{name:c,styles:u,classNames:d,unstyled:p});return S.createElement(zo.Dropdown,AW({p:0,onMouseDown:g=>g.preventDefault()},h),S.createElement("div",{style:{maxHeight:O(o),display:"flex"}},S.createElement(ae,{component:n||"div",id:`${a}-items`,"aria-labelledby":`${a}-label`,role:"listbox",onMouseDown:g=>g.preventDefault(),style:{flex:1,overflowY:n!==K0?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},S.createElement("div",{className:m.itemsWrapper,style:{flexDirection:i}},r))))}function Vl({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:r,withinPortal:n,portalProps:o,children:i,__staticSelector:a,onDirectionChange:l,switchDirectionOnFlip:c,zIndex:u,dropdownPosition:d,positionDependencies:p=[],classNames:h,styles:m,unstyled:g,readOnly:v,variant:_}){return S.createElement(zo,{unstyled:g,classNames:h,styles:m,width:"target",withRoles:!1,opened:e,middlewares:{flip:d==="flip",shift:!1},position:d==="flip"?"bottom":d,positionDependencies:p,zIndex:u,__staticSelector:a,withinPortal:n,portalProps:o,transitionProps:t,shadow:r,disabled:v,onPositionChange:y=>c&&(l==null?void 0:l(y==="top"?"column-reverse":"column")),variant:_},i)}Vl.Target=zo.Target;Vl.Dropdown=LW;var zW=Object.defineProperty,FW=Object.defineProperties,VW=Object.getOwnPropertyDescriptors,Cf=Object.getOwnPropertySymbols,xT=Object.prototype.hasOwnProperty,wT=Object.prototype.propertyIsEnumerable,nS=(e,t,r)=>t in e?zW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Iu=(e,t)=>{for(var r in t||(t={}))xT.call(t,r)&&nS(e,r,t[r]);if(Cf)for(var r of Cf(t))wT.call(t,r)&&nS(e,r,t[r]);return e},BW=(e,t)=>FW(e,VW(t)),UW=(e,t)=>{var r={};for(var n in e)xT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cf)for(var n of Cf(e))t.indexOf(n)<0&&wT.call(e,n)&&(r[n]=e[n]);return r};function bT(e,t,r){const n=H(e,t,r),{label:o,description:i,error:a,required:l,classNames:c,styles:u,className:d,unstyled:p,__staticSelector:h,sx:m,errorProps:g,labelProps:v,descriptionProps:_,wrapperProps:y,id:x,size:w,style:b,inputContainer:j,inputWrapperOrder:C,withAsterisk:P,variant:E}=n,k=UW(n,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),$=Ar(x),{systemStyles:I,rest:R}=ao(k),N=Iu({label:o,description:i,error:a,required:l,classNames:c,className:d,__staticSelector:h,sx:m,errorProps:g,labelProps:v,descriptionProps:_,unstyled:p,styles:u,id:$,size:w,style:b,inputContainer:j,inputWrapperOrder:C,withAsterisk:P,variant:E},y);return BW(Iu({},R),{classNames:c,styles:u,unstyled:p,wrapperProps:Iu(Iu({},N),I),inputProps:{required:l,classNames:c,styles:u,unstyled:p,id:$,size:w,__staticSelector:h,error:a,variant:E}})}var WW=W((e,t,{size:r})=>({label:{display:"inline-block",fontSize:A({size:r,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const HW=WW;var qW=Object.defineProperty,Ef=Object.getOwnPropertySymbols,_T=Object.prototype.hasOwnProperty,ST=Object.prototype.propertyIsEnumerable,oS=(e,t,r)=>t in e?qW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GW=(e,t)=>{for(var r in t||(t={}))_T.call(t,r)&&oS(e,r,t[r]);if(Ef)for(var r of Ef(t))ST.call(t,r)&&oS(e,r,t[r]);return e},QW=(e,t)=>{var r={};for(var n in e)_T.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ef)for(var n of Ef(e))t.indexOf(n)<0&&ST.call(e,n)&&(r[n]=e[n]);return r};const KW={labelElement:"label",size:"sm"},ux=f.forwardRef((e,t)=>{const r=H("InputLabel",KW,e),{labelElement:n,children:o,required:i,size:a,classNames:l,styles:c,unstyled:u,className:d,htmlFor:p,__staticSelector:h,variant:m,onMouseDown:g}=r,v=QW(r,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:_,cx:y}=HW(null,{name:["InputWrapper",h],classNames:l,styles:c,unstyled:u,variant:m,size:a});return S.createElement(ae,GW({component:n,ref:t,className:y(_.label,d),htmlFor:n==="label"?p:void 0,onMouseDown:x=>{g==null||g(x),!x.defaultPrevented&&x.detail>1&&x.preventDefault()}},v),o,i&&S.createElement("span",{className:_.required,"aria-hidden":!0}," *"))});ux.displayName="@mantine/core/InputLabel";var YW=W((e,t,{size:r})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${O(2)})`,lineHeight:1.2,display:"block"}}));const XW=YW;var JW=Object.defineProperty,$f=Object.getOwnPropertySymbols,PT=Object.prototype.hasOwnProperty,jT=Object.prototype.propertyIsEnumerable,iS=(e,t,r)=>t in e?JW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZW=(e,t)=>{for(var r in t||(t={}))PT.call(t,r)&&iS(e,r,t[r]);if($f)for(var r of $f(t))jT.call(t,r)&&iS(e,r,t[r]);return e},eH=(e,t)=>{var r={};for(var n in e)PT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$f)for(var n of $f(e))t.indexOf(n)<0&&jT.call(e,n)&&(r[n]=e[n]);return r};const tH={size:"sm"},dx=f.forwardRef((e,t)=>{const r=H("InputError",tH,e),{children:n,className:o,classNames:i,styles:a,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=eH(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=XW(null,{name:["InputWrapper",u],classNames:i,styles:a,unstyled:l,variant:d,size:c});return S.createElement(oe,ZW({className:m(h.error,o),ref:t},p),n)});dx.displayName="@mantine/core/InputError";var rH=W((e,t,{size:r})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${O(2)})`,lineHeight:1.2,display:"block"}}));const nH=rH;var oH=Object.defineProperty,kf=Object.getOwnPropertySymbols,OT=Object.prototype.hasOwnProperty,CT=Object.prototype.propertyIsEnumerable,aS=(e,t,r)=>t in e?oH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iH=(e,t)=>{for(var r in t||(t={}))OT.call(t,r)&&aS(e,r,t[r]);if(kf)for(var r of kf(t))CT.call(t,r)&&aS(e,r,t[r]);return e},aH=(e,t)=>{var r={};for(var n in e)OT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kf)for(var n of kf(e))t.indexOf(n)<0&&CT.call(e,n)&&(r[n]=e[n]);return r};const sH={size:"sm"},fx=f.forwardRef((e,t)=>{const r=H("InputDescription",sH,e),{children:n,className:o,classNames:i,styles:a,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=aH(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=nH(null,{name:["InputWrapper",u],classNames:i,styles:a,unstyled:l,variant:d,size:c});return S.createElement(oe,iH({color:"dimmed",className:m(h.description,o),ref:t,unstyled:l},p),n)});fx.displayName="@mantine/core/InputDescription";const ET=f.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),lH=ET.Provider,cH=()=>f.useContext(ET);function uH(e,{hasDescription:t,hasError:r}){const n=e.findIndex(c=>c==="input"),o=e[n-1],i=e[n+1];return{offsetBottom:t&&i==="description"||r&&i==="error",offsetTop:t&&o==="description"||r&&o==="error"}}var dH=Object.defineProperty,fH=Object.defineProperties,pH=Object.getOwnPropertyDescriptors,sS=Object.getOwnPropertySymbols,hH=Object.prototype.hasOwnProperty,mH=Object.prototype.propertyIsEnumerable,lS=(e,t,r)=>t in e?dH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gH=(e,t)=>{for(var r in t||(t={}))hH.call(t,r)&&lS(e,r,t[r]);if(sS)for(var r of sS(t))mH.call(t,r)&&lS(e,r,t[r]);return e},vH=(e,t)=>fH(e,pH(t)),yH=W(e=>({root:vH(gH({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const xH=yH;var wH=Object.defineProperty,bH=Object.defineProperties,_H=Object.getOwnPropertyDescriptors,Rf=Object.getOwnPropertySymbols,$T=Object.prototype.hasOwnProperty,kT=Object.prototype.propertyIsEnumerable,cS=(e,t,r)=>t in e?wH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xo=(e,t)=>{for(var r in t||(t={}))$T.call(t,r)&&cS(e,r,t[r]);if(Rf)for(var r of Rf(t))kT.call(t,r)&&cS(e,r,t[r]);return e},uS=(e,t)=>bH(e,_H(t)),SH=(e,t)=>{var r={};for(var n in e)$T.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Rf)for(var n of Rf(e))t.indexOf(n)<0&&kT.call(e,n)&&(r[n]=e[n]);return r};const PH={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},RT=f.forwardRef((e,t)=>{const r=H("InputWrapper",PH,e),{className:n,label:o,children:i,required:a,id:l,error:c,description:u,labelElement:d,labelProps:p,descriptionProps:h,errorProps:m,classNames:g,styles:v,size:_,inputContainer:y,__staticSelector:x,unstyled:w,inputWrapperOrder:b,withAsterisk:j,variant:C}=r,P=SH(r,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:E,cx:k}=xH(null,{classNames:g,styles:v,name:["InputWrapper",x],unstyled:w,variant:C,size:_}),$={classNames:g,styles:v,unstyled:w,size:_,variant:C,__staticSelector:x},I=typeof j=="boolean"?j:a,R=l?`${l}-error`:m==null?void 0:m.id,N=l?`${l}-description`:h==null?void 0:h.id,L=`${!!c&&typeof c!="boolean"?R:""} ${u?N:""}`,Q=L.trim().length>0?L.trim():void 0,G=o&&S.createElement(ux,Xo(Xo({key:"label",labelElement:d,id:l?`${l}-label`:void 0,htmlFor:l,required:I},$),p),o),T=u&&S.createElement(fx,uS(Xo(Xo({key:"description"},h),$),{size:(h==null?void 0:h.size)||$.size,id:(h==null?void 0:h.id)||N}),u),F=S.createElement(f.Fragment,{key:"input"},y(i)),V=typeof c!="boolean"&&c&&S.createElement(dx,uS(Xo(Xo({},m),$),{size:(m==null?void 0:m.size)||$.size,key:"error",id:(m==null?void 0:m.id)||R}),c),X=b.map(J=>{switch(J){case"label":return G;case"input":return F;case"description":return T;case"error":return V;default:return null}});return S.createElement(lH,{value:Xo({describedBy:Q},uH(b,{hasDescription:!!T,hasError:!!V}))},S.createElement(ae,Xo({className:k(E.root,n),ref:t},P),X))});RT.displayName="@mantine/core/InputWrapper";var jH=Object.defineProperty,Tf=Object.getOwnPropertySymbols,TT=Object.prototype.hasOwnProperty,IT=Object.prototype.propertyIsEnumerable,dS=(e,t,r)=>t in e?jH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OH=(e,t)=>{for(var r in t||(t={}))TT.call(t,r)&&dS(e,r,t[r]);if(Tf)for(var r of Tf(t))IT.call(t,r)&&dS(e,r,t[r]);return e},CH=(e,t)=>{var r={};for(var n in e)TT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Tf)for(var n of Tf(e))t.indexOf(n)<0&&IT.call(e,n)&&(r[n]=e[n]);return r};const EH={},DT=f.forwardRef((e,t)=>{const r=H("InputPlaceholder",EH,e),{sx:n}=r,o=CH(r,["sx"]);return S.createElement(ae,OH({component:"span",sx:[i=>i.fn.placeholderStyles(),..._c(n)],ref:t},o))});DT.displayName="@mantine/core/InputPlaceholder";var $H=Object.defineProperty,kH=Object.defineProperties,RH=Object.getOwnPropertyDescriptors,fS=Object.getOwnPropertySymbols,TH=Object.prototype.hasOwnProperty,IH=Object.prototype.propertyIsEnumerable,pS=(e,t,r)=>t in e?$H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Du=(e,t)=>{for(var r in t||(t={}))TH.call(t,r)&&pS(e,r,t[r]);if(fS)for(var r of fS(t))IH.call(t,r)&&pS(e,r,t[r]);return e},$g=(e,t)=>kH(e,RH(t));const Et={xs:O(30),sm:O(36),md:O(42),lg:O(50),xl:O(60)},DH=["default","filled","unstyled"];function NH({theme:e,variant:t}){return DH.includes(t)?t==="default"?{border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${O(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:O(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var AH=W((e,{multiline:t,radius:r,invalid:n,rightSectionWidth:o,withRightSection:i,iconWidth:a,offsetBottom:l,offsetTop:c,pointer:u},{variant:d,size:p})=>{const h=e.fn.variant({variant:"filled",color:"red"}).background,m=d==="default"||d==="filled"?{minHeight:A({size:p,sizes:Et}),paddingLeft:`calc(${A({size:p,sizes:Et})} / 3)`,paddingRight:i?o||A({size:p,sizes:Et}):`calc(${A({size:p,sizes:Et})} / 3)`,borderRadius:e.fn.radius(r)}:d==="unstyled"&&i?{paddingRight:o||A({size:p,sizes:Et})}:null;return{wrapper:{position:"relative",marginTop:c?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:$g(Du(Du($g(Du({},e.fn.fontStyles()),{height:t?d==="unstyled"?void 0:"auto":A({size:p,sizes:Et}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${A({size:p,sizes:Et})} - ${O(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:A({size:p,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:u?"pointer":void 0}),NH({theme:e,variant:d})),m),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:h,borderColor:h,"&::placeholder":{opacity:1,color:h}},"&[data-with-icon]":{paddingLeft:typeof a=="number"?O(a):A({size:p,sizes:Et})},"&::placeholder":$g(Du({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:a?O(a):A({size:p,sizes:Et}),color:n?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||A({size:p,sizes:Et})}}});const MH=AH;var LH=Object.defineProperty,zH=Object.defineProperties,FH=Object.getOwnPropertyDescriptors,If=Object.getOwnPropertySymbols,NT=Object.prototype.hasOwnProperty,AT=Object.prototype.propertyIsEnumerable,hS=(e,t,r)=>t in e?LH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nu=(e,t)=>{for(var r in t||(t={}))NT.call(t,r)&&hS(e,r,t[r]);if(If)for(var r of If(t))AT.call(t,r)&&hS(e,r,t[r]);return e},mS=(e,t)=>zH(e,FH(t)),VH=(e,t)=>{var r={};for(var n in e)NT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&If)for(var n of If(e))t.indexOf(n)<0&&AT.call(e,n)&&(r[n]=e[n]);return r};const BH={size:"sm",variant:"default"},xa=f.forwardRef((e,t)=>{const r=H("Input",BH,e),{className:n,error:o,required:i,disabled:a,variant:l,icon:c,style:u,rightSectionWidth:d,iconWidth:p,rightSection:h,rightSectionProps:m,radius:g,size:v,wrapperProps:_,classNames:y,styles:x,__staticSelector:w,multiline:b,sx:j,unstyled:C,pointer:P}=r,E=VH(r,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:k,offsetTop:$,describedBy:I}=cH(),{classes:R,cx:N}=MH({radius:g,multiline:b,invalid:!!o,rightSectionWidth:d?O(d):void 0,iconWidth:p,withRightSection:!!h,offsetBottom:k,offsetTop:$,pointer:P},{classNames:y,styles:x,name:["Input",w],unstyled:C,variant:l,size:v}),{systemStyles:M,rest:L}=ao(E);return S.createElement(ae,Nu(Nu({className:N(R.wrapper,n),sx:j,style:u},M),_),c&&S.createElement("div",{className:R.icon},c),S.createElement(ae,mS(Nu({component:"input"},L),{ref:t,required:i,"aria-invalid":!!o,"aria-describedby":I,disabled:a,"data-disabled":a||void 0,"data-with-icon":!!c||void 0,"data-invalid":!!o||void 0,className:R.input})),h&&S.createElement("div",mS(Nu({},m),{className:R.rightSection}),h))});xa.displayName="@mantine/core/Input";xa.Wrapper=RT;xa.Label=ux;xa.Description=fx;xa.Error=dx;xa.Placeholder=DT;const Ut=xa;var UH=Object.defineProperty,Df=Object.getOwnPropertySymbols,MT=Object.prototype.hasOwnProperty,LT=Object.prototype.propertyIsEnumerable,gS=(e,t,r)=>t in e?UH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,WH=(e,t)=>{for(var r in t||(t={}))MT.call(t,r)&&gS(e,r,t[r]);if(Df)for(var r of Df(t))LT.call(t,r)&&gS(e,r,t[r]);return e},HH=(e,t)=>{var r={};for(var n in e)MT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Df)for(var n of Df(e))t.indexOf(n)<0&&LT.call(e,n)&&(r[n]=e[n]);return r};function qH(e){const t=e,{style:r}=t,n=HH(t,["style"]);return S.createElement("svg",WH({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r},n),S.createElement("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var GH=Object.defineProperty,QH=Object.defineProperties,KH=Object.getOwnPropertyDescriptors,vS=Object.getOwnPropertySymbols,YH=Object.prototype.hasOwnProperty,XH=Object.prototype.propertyIsEnumerable,yS=(e,t,r)=>t in e?GH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,JH=(e,t)=>{for(var r in t||(t={}))YH.call(t,r)&&yS(e,r,t[r]);if(vS)for(var r of vS(t))XH.call(t,r)&&yS(e,r,t[r]);return e},ZH=(e,t)=>QH(e,KH(t));const zT=f.createContext(null);function eq({spacing:e,children:t}){return S.createElement(zT.Provider,{value:{spacing:e}},t)}function tq(){const e=f.useContext(zT);return e?ZH(JH({},e),{withinGroup:!0}):{spacing:null,withinGroup:!1}}var rq=W((e,{spacing:t})=>({root:{display:"flex",paddingLeft:A({size:t,sizes:e.spacing})}}));const nq=rq;var oq=Object.defineProperty,Nf=Object.getOwnPropertySymbols,FT=Object.prototype.hasOwnProperty,VT=Object.prototype.propertyIsEnumerable,xS=(e,t,r)=>t in e?oq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iq=(e,t)=>{for(var r in t||(t={}))FT.call(t,r)&&xS(e,r,t[r]);if(Nf)for(var r of Nf(t))VT.call(t,r)&&xS(e,r,t[r]);return e},aq=(e,t)=>{var r={};for(var n in e)FT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Nf)for(var n of Nf(e))t.indexOf(n)<0&&VT.call(e,n)&&(r[n]=e[n]);return r};const sq={},BT=f.forwardRef((e,t)=>{const r=H("AvatarGroup",sq,e),{children:n,spacing:o="sm",unstyled:i,className:a,variant:l}=r,c=aq(r,["children","spacing","unstyled","className","variant"]),{classes:u,cx:d}=nq({spacing:o},{name:"AvatarGroup",unstyled:i,variant:l});return S.createElement(eq,{spacing:o},S.createElement(ae,iq({ref:t,className:d(u.root,a)},c),n))});BT.displayName="@mantine/core/AvatarGroup";var lq=Object.defineProperty,cq=Object.defineProperties,uq=Object.getOwnPropertyDescriptors,wS=Object.getOwnPropertySymbols,dq=Object.prototype.hasOwnProperty,fq=Object.prototype.propertyIsEnumerable,bS=(e,t,r)=>t in e?lq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sl=(e,t)=>{for(var r in t||(t={}))dq.call(t,r)&&bS(e,r,t[r]);if(wS)for(var r of wS(t))fq.call(t,r)&&bS(e,r,t[r]);return e},_S=(e,t)=>cq(e,uq(t));const pq=["filled","light","gradient","outline"],Au={xs:O(16),sm:O(26),md:O(38),lg:O(56),xl:O(84)};function hq({withinGroup:e,spacing:t,theme:r}){return e?{marginLeft:`calc(${A({size:t,sizes:r.spacing})} * -1)`,backgroundColor:`${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`,border:`${O(2)} solid ${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`}:null}function mq({theme:e,variant:t,color:r,gradient:n}){const o=e.fn.variant({variant:t,color:r,gradient:n});return pq.includes(t)?{placeholder:{color:o.color,backgroundColor:o.background,backgroundImage:t==="gradient"?o.background:void 0,border:`${O(t==="gradient"?0:1)} solid ${o.border}`},placeholderIcon:{color:o.color}}:{}}var gq=W((e,{radius:t,withinGroup:r,spacing:n,color:o,gradient:i},{variant:a,size:l})=>{const c=mq({theme:e,color:o,gradient:i,variant:a});return{root:sl(_S(sl({},e.fn.focusStyles()),{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",display:"block",userSelect:"none",overflow:"hidden",borderRadius:e.fn.radius(t),textDecoration:"none",border:0,backgroundColor:"transparent",padding:0,width:A({size:l,sizes:Au}),minWidth:A({size:l,sizes:Au}),height:A({size:l,sizes:Au})}),hq({withinGroup:r,spacing:n,theme:e})),image:{objectFit:"cover",width:"100%",height:"100%",display:"block"},placeholder:sl(_S(sl({},e.fn.fontStyles()),{fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",userSelect:"none",borderRadius:e.fn.radius(t),fontSize:`calc(${A({size:l,sizes:Au})} / 2.5)`}),c.placeholder),placeholderIcon:sl({width:"70%",height:"70%"},c.placeholderIcon)}});const vq=gq;var yq=Object.defineProperty,xq=Object.defineProperties,wq=Object.getOwnPropertyDescriptors,Af=Object.getOwnPropertySymbols,UT=Object.prototype.hasOwnProperty,WT=Object.prototype.propertyIsEnumerable,SS=(e,t,r)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PS=(e,t)=>{for(var r in t||(t={}))UT.call(t,r)&&SS(e,r,t[r]);if(Af)for(var r of Af(t))WT.call(t,r)&&SS(e,r,t[r]);return e},bq=(e,t)=>xq(e,wq(t)),_q=(e,t)=>{var r={};for(var n in e)UT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Af)for(var n of Af(e))t.indexOf(n)<0&&WT.call(e,n)&&(r[n]=e[n]);return r};const Sq={size:"md",color:"gray",variant:"light"},px=f.forwardRef((e,t)=>{const r=H("Avatar",Sq,e),{className:n,size:o,src:i,alt:a,radius:l,children:c,color:u,variant:d,gradient:p,classNames:h,styles:m,imageProps:g,unstyled:v}=r,_=_q(r,["className","size","src","alt","radius","children","color","variant","gradient","classNames","styles","imageProps","unstyled"]),y=tq(),[x,w]=f.useState(!i),{classes:b,cx:j}=vq({color:u,radius:l,withinGroup:y.withinGroup,spacing:y.spacing,gradient:p},{classNames:h,styles:m,unstyled:v,name:"Avatar",variant:d,size:o});return f.useEffect(()=>{w(!i)},[i]),S.createElement(ae,PS({component:"div",className:j(b.root,n),ref:t},_),x?S.createElement("div",{className:b.placeholder,title:a},c||S.createElement(qH,{className:b.placeholderIcon})):S.createElement("img",bq(PS({},g),{className:b.image,src:i,alt:a,onError:()=>w(!0)})))});px.displayName="@mantine/core/Avatar";px.Group=BT;const Mf=px;var Pq=Object.defineProperty,jq=Object.defineProperties,Oq=Object.getOwnPropertyDescriptors,jS=Object.getOwnPropertySymbols,Cq=Object.prototype.hasOwnProperty,Eq=Object.prototype.propertyIsEnumerable,OS=(e,t,r)=>t in e?Pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kg=(e,t)=>{for(var r in t||(t={}))Cq.call(t,r)&&OS(e,r,t[r]);if(jS)for(var r of jS(t))Eq.call(t,r)&&OS(e,r,t[r]);return e},$q=(e,t)=>jq(e,Oq(t));const kq=["light","filled","outline","dot","gradient"],Rg={xs:{fontSize:O(9),height:O(16)},sm:{fontSize:O(10),height:O(18)},md:{fontSize:O(11),height:O(20)},lg:{fontSize:O(13),height:O(26)},xl:{fontSize:O(16),height:O(32)}},Rq={xs:O(4),sm:O(4),md:O(6),lg:O(8),xl:O(10)};function Tq({theme:e,variant:t,color:r,size:n,gradient:o}){if(!kq.includes(t))return null;if(t==="dot"){const a=A({size:n,sizes:Rq});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${A({size:n,sizes:e.spacing})} / 1.5 - ${a} / 2)`,"&::before":{content:'""',display:"block",width:a,height:a,borderRadius:a,backgroundColor:e.fn.themeColor(r,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:a}}}const i=e.fn.variant({color:r,variant:t,gradient:o});return{background:i.background,color:i.color,border:`${O(t==="gradient"?0:1)} solid ${i.border}`}}var Iq=W((e,{color:t,radius:r,gradient:n,fullWidth:o},{variant:i,size:a})=>{const{fontSize:l,height:c}=a in Rg?Rg[a]:Rg.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:kg($q(kg(kg({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:l,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${O(2)})`,textDecoration:"none",padding:`0 calc(${A({size:a,sizes:e.spacing})} / 1.5)`,boxSizing:"border-box",display:o?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:o?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(r),fontWeight:700,letterSpacing:O(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),Tq({theme:e,variant:i,color:t,size:a,gradient:n}))}});const Dq=Iq;var Nq=Object.defineProperty,Lf=Object.getOwnPropertySymbols,HT=Object.prototype.hasOwnProperty,qT=Object.prototype.propertyIsEnumerable,CS=(e,t,r)=>t in e?Nq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Aq=(e,t)=>{for(var r in t||(t={}))HT.call(t,r)&&CS(e,r,t[r]);if(Lf)for(var r of Lf(t))qT.call(t,r)&&CS(e,r,t[r]);return e},Mq=(e,t)=>{var r={};for(var n in e)HT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Lf)for(var n of Lf(e))t.indexOf(n)<0&&qT.call(e,n)&&(r[n]=e[n]);return r};const Lq={variant:"light",size:"md",radius:"xl"},GT=f.forwardRef((e,t)=>{const r=H("Badge",Lq,e),{className:n,color:o,variant:i,fullWidth:a,children:l,size:c,leftSection:u,rightSection:d,radius:p,gradient:h,classNames:m,styles:g,unstyled:v}=r,_=Mq(r,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:y,cx:x}=Dq({fullWidth:a,color:o,radius:p,gradient:h},{classNames:m,styles:g,name:"Badge",unstyled:v,variant:i,size:c});return S.createElement(ae,Aq({className:x(y.root,n),ref:t},_),u&&S.createElement("span",{className:y.leftSection},u),S.createElement("span",{className:y.inner},l),d&&S.createElement("span",{className:y.rightSection},d))});GT.displayName="@mantine/core/Badge";const QT=GT;var zq=Object.defineProperty,zf=Object.getOwnPropertySymbols,KT=Object.prototype.hasOwnProperty,YT=Object.prototype.propertyIsEnumerable,ES=(e,t,r)=>t in e?zq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$S=(e,t)=>{for(var r in t||(t={}))KT.call(t,r)&&ES(e,r,t[r]);if(zf)for(var r of zf(t))YT.call(t,r)&&ES(e,r,t[r]);return e},Fq=(e,t)=>{var r={};for(var n in e)KT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zf)for(var n of zf(e))t.indexOf(n)<0&&YT.call(e,n)&&(r[n]=e[n]);return r};function Vq(e){const t=e,{style:r}=t,n=Fq(t,["style"]);return S.createElement("svg",$S({viewBox:"0 0 409.294 409.294",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:$S({width:O(20),height:O(20)},r)},n),S.createElement("path",{d:"M0 204.647v175.412h175.412V204.647H58.471c0-64.48 52.461-116.941 116.941-116.941V29.235C78.684 29.235 0 107.919 0 204.647zM409.294 87.706V29.235c-96.728 0-175.412 78.684-175.412 175.412v175.412h175.412V204.647H292.353c0-64.48 52.461-116.941 116.941-116.941z"}))}var Bq=Object.defineProperty,Uq=Object.defineProperties,Wq=Object.getOwnPropertyDescriptors,kS=Object.getOwnPropertySymbols,Hq=Object.prototype.hasOwnProperty,qq=Object.prototype.propertyIsEnumerable,RS=(e,t,r)=>t in e?Bq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gq=(e,t)=>{for(var r in t||(t={}))Hq.call(t,r)&&RS(e,r,t[r]);if(kS)for(var r of kS(t))qq.call(t,r)&&RS(e,r,t[r]);return e},Qq=(e,t)=>Uq(e,Wq(t)),Kq=W((e,{color:t})=>({root:Qq(Gq({},e.fn.fontStyles()),{fontSize:e.fontSizes.lg,lineHeight:e.lineHeight,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,margin:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm,padding:`${e.spacing.md} ${e.spacing.lg}`}),inner:{display:"flex"},body:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},icon:{color:e.fn.variant({variant:"filled",color:t}).background,marginRight:e.spacing.lg,marginTop:O(2),width:O(22)},cite:{display:"block",fontSize:e.fontSizes.sm,marginTop:e.spacing.xs,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],overflow:"hidden",textOverflow:"ellipsis"}}));const Yq=Kq;var Xq=Object.defineProperty,Ff=Object.getOwnPropertySymbols,XT=Object.prototype.hasOwnProperty,JT=Object.prototype.propertyIsEnumerable,TS=(e,t,r)=>t in e?Xq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Jq=(e,t)=>{for(var r in t||(t={}))XT.call(t,r)&&TS(e,r,t[r]);if(Ff)for(var r of Ff(t))JT.call(t,r)&&TS(e,r,t[r]);return e},Zq=(e,t)=>{var r={};for(var n in e)XT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ff)for(var n of Ff(e))t.indexOf(n)<0&&JT.call(e,n)&&(r[n]=e[n]);return r};const eG={color:"gray",icon:S.createElement(Vq,null)},ZT=f.forwardRef((e,t)=>{const r=H("Blockquote",eG,e),{className:n,color:o,icon:i,cite:a,children:l,classNames:c,styles:u,unstyled:d,variant:p}=r,h=Zq(r,["className","color","icon","cite","children","classNames","styles","unstyled","variant"]),{classes:m,cx:g}=Yq({color:o},{classNames:c,styles:u,unstyled:d,name:"Blockquote",variant:p});return S.createElement(ae,Jq({component:"blockquote",className:g(m.root,n),ref:t},h),S.createElement("div",{className:m.inner},i&&S.createElement("div",{className:m.icon},i),S.createElement("div",{className:m.body},l,a&&S.createElement("cite",{className:m.cite},a))))});ZT.displayName="@mantine/core/Blockquote";var tG=W((e,{orientation:t,buttonBorderWidth:r})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type:not(:last-of-type)":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${O(r)} / 2)`},"&:last-of-type:not(:first-of-type)":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${O(r)} / 2)`},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${O(r)} / 2)`,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${O(r)} / 2)`},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:`calc(${r} * -1)`,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const rG=tG;var nG=Object.defineProperty,Vf=Object.getOwnPropertySymbols,eI=Object.prototype.hasOwnProperty,tI=Object.prototype.propertyIsEnumerable,IS=(e,t,r)=>t in e?nG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oG=(e,t)=>{for(var r in t||(t={}))eI.call(t,r)&&IS(e,r,t[r]);if(Vf)for(var r of Vf(t))tI.call(t,r)&&IS(e,r,t[r]);return e},iG=(e,t)=>{var r={};for(var n in e)eI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Vf)for(var n of Vf(e))t.indexOf(n)<0&&tI.call(e,n)&&(r[n]=e[n]);return r};const aG={orientation:"horizontal",buttonBorderWidth:1},rI=f.forwardRef((e,t)=>{const r=H("ButtonGroup",aG,e),{className:n,orientation:o,buttonBorderWidth:i,unstyled:a}=r,l=iG(r,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:u}=rG({orientation:o,buttonBorderWidth:i},{name:"ButtonGroup",unstyled:a});return S.createElement(ae,oG({className:u(c.root,n),ref:t},l))});rI.displayName="@mantine/core/ButtonGroup";var sG=Object.defineProperty,lG=Object.defineProperties,cG=Object.getOwnPropertyDescriptors,DS=Object.getOwnPropertySymbols,uG=Object.prototype.hasOwnProperty,dG=Object.prototype.propertyIsEnumerable,NS=(e,t,r)=>t in e?sG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yo=(e,t)=>{for(var r in t||(t={}))uG.call(t,r)&&NS(e,r,t[r]);if(DS)for(var r of DS(t))dG.call(t,r)&&NS(e,r,t[r]);return e},xd=(e,t)=>lG(e,cG(t));const fG=["filled","outline","light","white","default","subtle","gradient"],py={xs:{height:Et.xs,paddingLeft:O(14),paddingRight:O(14)},sm:{height:Et.sm,paddingLeft:O(18),paddingRight:O(18)},md:{height:Et.md,paddingLeft:O(22),paddingRight:O(22)},lg:{height:Et.lg,paddingLeft:O(26),paddingRight:O(26)},xl:{height:Et.xl,paddingLeft:O(32),paddingRight:O(32)},"compact-xs":{height:O(22),paddingLeft:O(7),paddingRight:O(7)},"compact-sm":{height:O(26),paddingLeft:O(8),paddingRight:O(8)},"compact-md":{height:O(30),paddingLeft:O(10),paddingRight:O(10)},"compact-lg":{height:O(34),paddingLeft:O(12),paddingRight:O(12)},"compact-xl":{height:O(40),paddingLeft:O(14),paddingRight:O(14)}};function pG({compact:e,size:t,withLeftIcon:r,withRightIcon:n}){if(e)return py[`compact-${t}`];const o=py[t];return o?xd(yo({},o),{paddingLeft:r?`calc(${o.paddingLeft} / 1.5)`:o.paddingLeft,paddingRight:n?`calc(${o.paddingRight} / 1.5)`:o.paddingRight}):{}}const hG=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function mG({variant:e,theme:t,color:r,gradient:n}){if(!fG.includes(e))return null;const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?yo({border:0,backgroundImage:o.background,color:o.color},t.fn.hover({backgroundSize:"200%"})):yo({border:`${O(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var gG=W((e,{radius:t,fullWidth:r,compact:n,withLeftIcon:o,withRightIcon:i,color:a,gradient:l},{variant:c,size:u})=>({root:xd(yo(xd(yo(yo(yo(yo({},pG({compact:n,size:u,withLeftIcon:o,withRightIcon:i})),e.fn.fontStyles()),e.fn.focusStyles()),hG(r)),{borderRadius:e.fn.radius(t),fontWeight:600,position:"relative",lineHeight:1,fontSize:A({size:u,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),mG({variant:c,theme:e,color:a,gradient:l})),{"&:active":e.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":xd(yo({content:'""'},e.fn.cover(O(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:e.spacing.xs},rightIcon:{marginLeft:e.spacing.xs},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}}));const vG=gG;var yG=Object.defineProperty,Bf=Object.getOwnPropertySymbols,nI=Object.prototype.hasOwnProperty,oI=Object.prototype.propertyIsEnumerable,AS=(e,t,r)=>t in e?yG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,MS=(e,t)=>{for(var r in t||(t={}))nI.call(t,r)&&AS(e,r,t[r]);if(Bf)for(var r of Bf(t))oI.call(t,r)&&AS(e,r,t[r]);return e},xG=(e,t)=>{var r={};for(var n in e)nI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bf)for(var n of Bf(e))t.indexOf(n)<0&&oI.call(e,n)&&(r[n]=e[n]);return r};const wG={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},hx=f.forwardRef((e,t)=>{const r=H("Button",wG,e),{className:n,size:o,color:i,type:a,disabled:l,children:c,leftIcon:u,rightIcon:d,fullWidth:p,variant:h,radius:m,uppercase:g,compact:v,loading:_,loaderPosition:y,loaderProps:x,gradient:w,classNames:b,styles:j,unstyled:C}=r,P=xG(r,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:E,cx:k,theme:$}=vG({radius:m,color:i,fullWidth:p,compact:v,gradient:w,withLeftIcon:!!u,withRightIcon:!!d},{name:"Button",unstyled:C,classNames:b,styles:j,variant:h,size:o}),I=$.fn.variant({color:i,variant:h}),R=S.createElement(mn,MS({color:I.color,size:`calc(${A({size:o,sizes:py}).height} / 2)`},x));return S.createElement(Po,MS({className:k(E.root,n),type:a,disabled:l,"data-button":!0,"data-disabled":l||void 0,"data-loading":_||void 0,ref:t,unstyled:C},P),S.createElement("div",{className:E.inner},(u||_&&y==="left")&&S.createElement("span",{className:k(E.icon,E.leftIcon)},_&&y==="left"?R:u),_&&y==="center"&&S.createElement("span",{className:E.centerLoader},R),S.createElement("span",{className:E.label,style:{textTransform:g?"uppercase":void 0}},c),(d||_&&y==="right")&&S.createElement("span",{className:k(E.icon,E.rightIcon)},_&&y==="right"?R:d)))});hx.displayName="@mantine/core/Button";hx.Group=rI;const re=hx;var bG=W((e,{radius:t,shadow:r})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,boxSizing:"border-box",borderRadius:e.fn.radius(t),boxShadow:e.shadows[r]||r||"none","&[data-with-border]":{border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}}}));const _G=bG;var SG=Object.defineProperty,Uf=Object.getOwnPropertySymbols,iI=Object.prototype.hasOwnProperty,aI=Object.prototype.propertyIsEnumerable,LS=(e,t,r)=>t in e?SG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PG=(e,t)=>{for(var r in t||(t={}))iI.call(t,r)&&LS(e,r,t[r]);if(Uf)for(var r of Uf(t))aI.call(t,r)&&LS(e,r,t[r]);return e},jG=(e,t)=>{var r={};for(var n in e)iI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Uf)for(var n of Uf(e))t.indexOf(n)<0&&aI.call(e,n)&&(r[n]=e[n]);return r};const OG={},sI=f.forwardRef((e,t)=>{const r=H("Paper",OG,e),{className:n,children:o,radius:i,withBorder:a,shadow:l,unstyled:c,variant:u}=r,d=jG(r,["className","children","radius","withBorder","shadow","unstyled","variant"]),{classes:p,cx:h}=_G({radius:i,shadow:l},{name:"Paper",unstyled:c,variant:u});return S.createElement(ae,PG({className:h(p.root,n),"data-with-border":a||void 0,ref:t},d),o)});sI.displayName="@mantine/core/Paper";const dn=sI;var CG=W((e,{inline:t})=>({root:{display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}}));const EG=CG;var $G=Object.defineProperty,Wf=Object.getOwnPropertySymbols,lI=Object.prototype.hasOwnProperty,cI=Object.prototype.propertyIsEnumerable,zS=(e,t,r)=>t in e?$G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kG=(e,t)=>{for(var r in t||(t={}))lI.call(t,r)&&zS(e,r,t[r]);if(Wf)for(var r of Wf(t))cI.call(t,r)&&zS(e,r,t[r]);return e},RG=(e,t)=>{var r={};for(var n in e)lI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wf)for(var n of Wf(e))t.indexOf(n)<0&&cI.call(e,n)&&(r[n]=e[n]);return r};const uI=f.forwardRef((e,t)=>{const r=H("Center",{},e),{inline:n,className:o,unstyled:i,variant:a}=r,l=RG(r,["inline","className","unstyled","variant"]),{classes:c,cx:u}=EG({inline:n},{name:"Center",unstyled:i,variant:a});return S.createElement(ae,kG({ref:t,className:u(c.root,o)},l))});uI.displayName="@mantine/core/Center";const ar=uI,dI=f.createContext(null),TG=dI.Provider,IG=()=>f.useContext(dI);var DG=Object.defineProperty,Hf=Object.getOwnPropertySymbols,fI=Object.prototype.hasOwnProperty,pI=Object.prototype.propertyIsEnumerable,FS=(e,t,r)=>t in e?DG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VS=(e,t)=>{for(var r in t||(t={}))fI.call(t,r)&&FS(e,r,t[r]);if(Hf)for(var r of Hf(t))pI.call(t,r)&&FS(e,r,t[r]);return e},NG=(e,t)=>{var r={};for(var n in e)fI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Hf)for(var n of Hf(e))t.indexOf(n)<0&&pI.call(e,n)&&(r[n]=e[n]);return r};const AG={size:"sm"},hI=f.forwardRef((e,t)=>{const r=H("CheckboxGroup",AG,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c}=r,u=NG(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=Ir({value:o,defaultValue:i,finalValue:[],onChange:a}),h=m=>{const g=m.currentTarget.value;p(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return S.createElement(TG,{value:{value:d,onChange:h,size:l}},S.createElement(Ut.Wrapper,VS(VS({labelElement:"div",size:l,__staticSelector:"CheckboxGroup",ref:t},c),u),n))});hI.displayName="@mantine/core/CheckboxGroup";var MG=Object.defineProperty,qf=Object.getOwnPropertySymbols,mI=Object.prototype.hasOwnProperty,gI=Object.prototype.propertyIsEnumerable,BS=(e,t,r)=>t in e?MG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gf=(e,t)=>{for(var r in t||(t={}))mI.call(t,r)&&BS(e,r,t[r]);if(qf)for(var r of qf(t))gI.call(t,r)&&BS(e,r,t[r]);return e},vI=(e,t)=>{var r={};for(var n in e)mI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&qf)for(var n of qf(e))t.indexOf(n)<0&&gI.call(e,n)&&(r[n]=e[n]);return r};function yI(e){const t=e,{width:r,height:n,style:o}=t,i=vI(t,["width","height","style"]);return S.createElement("svg",Gf({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Gf({width:r,height:n},o)},i),S.createElement("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function xI(e){var t=e,{indeterminate:r}=t,n=vI(t,["indeterminate"]);return r?S.createElement("svg",Gf({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6"},n),S.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):S.createElement(yI,Gf({},n))}var LG=Object.defineProperty,zG=Object.defineProperties,FG=Object.getOwnPropertyDescriptors,US=Object.getOwnPropertySymbols,VG=Object.prototype.hasOwnProperty,BG=Object.prototype.propertyIsEnumerable,WS=(e,t,r)=>t in e?LG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,HS=(e,t)=>{for(var r in t||(t={}))VG.call(t,r)&&WS(e,r,t[r]);if(US)for(var r of US(t))BG.call(t,r)&&WS(e,r,t[r]);return e},qS=(e,t)=>zG(e,FG(t));const UG={xs:O(16),sm:O(20),md:O(24),lg:O(30),xl:O(36)};var WG=W((e,{radius:t,color:r,transitionDuration:n,labelPosition:o,error:i,indeterminate:a},{size:l})=>{const c=A({size:l,sizes:UG}),u=e.fn.variant({variant:"filled",color:r});return{icon:qS(HS({},e.fn.cover()),{ref:Vt("icon"),color:a?"inherit":e.white,transform:a?"none":`translateY(${O(5)}) scale(0.5)`,opacity:a?1:0,transitionProperty:"opacity, transform",transitionTimingFunction:"ease",transitionDuration:`${n}ms`,pointerEvents:"none",width:"60%",position:"absolute",zIndex:1,margin:"auto","@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}}),inner:{position:"relative",width:c,height:c,order:o==="left"?2:1},input:qS(HS({},e.fn.focusStyles()),{appearance:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${O(1)} solid ${i?e.fn.variant({variant:"filled",color:"red"}).background:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,width:c,height:c,borderRadius:e.fn.radius(t),padding:0,display:"block",margin:0,transition:`border-color ${n}ms ease, background-color ${n}ms ease`,cursor:e.cursorType,"&:checked":{backgroundColor:u.background,borderColor:u.background,[`& + .${Vt("icon")}`]:{opacity:1,color:e.white,transform:"translateY(0) scale(1)"}},"&:disabled":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[3],cursor:"not-allowed",pointerEvents:"none",[`& + .${Vt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5]}}})}});const HG=WG;var qG=Object.defineProperty,GG=Object.defineProperties,QG=Object.getOwnPropertyDescriptors,GS=Object.getOwnPropertySymbols,KG=Object.prototype.hasOwnProperty,YG=Object.prototype.propertyIsEnumerable,QS=(e,t,r)=>t in e?qG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,XG=(e,t)=>{for(var r in t||(t={}))KG.call(t,r)&&QS(e,r,t[r]);if(GS)for(var r of GS(t))YG.call(t,r)&&QS(e,r,t[r]);return e},JG=(e,t)=>GG(e,QG(t));const Tg={xs:O(16),sm:O(20),md:O(24),lg:O(30),xl:O(36)};var ZG=W((e,{labelPosition:t},{size:r})=>({root:{},body:{display:"flex","&:has(input:disabled) label":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}},labelWrapper:JG(XG({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:r in Tg?A({size:r,sizes:e.fontSizes}):void 0,lineHeight:r in Tg?A({size:r,sizes:Tg}):void 0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,cursor:e.cursorType,order:t==="left"?1:2}),description:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},error:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},label:{cursor:e.cursorType,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm,"&:disabled, &[data-disabled]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}));const eQ=ZG;var tQ=Object.defineProperty,Qf=Object.getOwnPropertySymbols,wI=Object.prototype.hasOwnProperty,bI=Object.prototype.propertyIsEnumerable,KS=(e,t,r)=>t in e?tQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rQ=(e,t)=>{for(var r in t||(t={}))wI.call(t,r)&&KS(e,r,t[r]);if(Qf)for(var r of Qf(t))bI.call(t,r)&&KS(e,r,t[r]);return e},nQ=(e,t)=>{var r={};for(var n in e)wI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qf)for(var n of Qf(e))t.indexOf(n)<0&&bI.call(e,n)&&(r[n]=e[n]);return r};const dm=f.forwardRef((e,t)=>{var r=e,{__staticSelector:n,className:o,classNames:i,styles:a,unstyled:l,children:c,label:u,description:d,id:p,disabled:h,error:m,size:g,labelPosition:v,variant:_}=r,y=nQ(r,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","variant"]);const{classes:x,cx:w}=eQ({labelPosition:v},{name:n,styles:a,classNames:i,unstyled:l,variant:_,size:g});return S.createElement(ae,rQ({className:w(x.root,o),ref:t},y),S.createElement("div",{className:w(x.body)},c,S.createElement("div",{className:x.labelWrapper},u!=null&&S.createElement("label",{className:x.label,"data-disabled":h||void 0,htmlFor:p},u),d&&S.createElement(Ut.Description,{className:x.description},d),m&&m!=="boolean"&&S.createElement(Ut.Error,{className:x.error},m))))});dm.displayName="@mantine/core/InlineInput";var oQ=Object.defineProperty,Kf=Object.getOwnPropertySymbols,_I=Object.prototype.hasOwnProperty,SI=Object.prototype.propertyIsEnumerable,YS=(e,t,r)=>t in e?oQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mu=(e,t)=>{for(var r in t||(t={}))_I.call(t,r)&&YS(e,r,t[r]);if(Kf)for(var r of Kf(t))SI.call(t,r)&&YS(e,r,t[r]);return e},iQ=(e,t)=>{var r={};for(var n in e)_I.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Kf)for(var n of Kf(e))t.indexOf(n)<0&&SI.call(e,n)&&(r[n]=e[n]);return r};const aQ={size:"sm",transitionDuration:100,icon:xI,labelPosition:"right"},Tn=f.forwardRef((e,t)=>{const r=H("Checkbox",aQ,e),{className:n,style:o,sx:i,checked:a,disabled:l,color:c,label:u,indeterminate:d,id:p,size:h,radius:m,wrapperProps:g,children:v,classNames:_,styles:y,transitionDuration:x,icon:w,unstyled:b,labelPosition:j,description:C,error:P,variant:E}=r,k=iQ(r,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),$=IG(),I=Ar(p),{systemStyles:R,rest:N}=ao(k),{classes:M}=HG({radius:m,color:c,transitionDuration:x,labelPosition:j,error:!!P,indeterminate:d},{name:"Checkbox",classNames:_,styles:y,unstyled:b,variant:E,size:($==null?void 0:$.size)||h}),L=$?{checked:$.value.includes(N.value),onChange:$.onChange}:{};return S.createElement(dm,Mu(Mu({className:n,sx:i,style:o,id:I,size:($==null?void 0:$.size)||h,labelPosition:j,label:u,description:C,error:P,disabled:l,__staticSelector:"Checkbox",classNames:_,styles:y,unstyled:b,"data-checked":L.checked||void 0,variant:E},R),g),S.createElement("div",{className:M.inner},S.createElement("input",Mu(Mu({id:I,ref:t,type:"checkbox",className:M.input,checked:a,disabled:l},N),L)),S.createElement(w,{indeterminate:d,className:M.icon})))});Tn.displayName="@mantine/core/Checkbox";Tn.Group=hI;const PI=f.createContext(null),sQ=PI.Provider,lQ=()=>f.useContext(PI),cQ={};function jI(e){const{value:t,defaultValue:r,onChange:n,multiple:o,children:i}=H("ChipGroup",cQ,e),[a,l]=Ir({value:t,defaultValue:r,finalValue:o?[]:null,onChange:n}),c=d=>Array.isArray(a)?a.includes(d):d===a,u=d=>{const p=d.currentTarget.value;Array.isArray(a)?l(a.includes(p)?a.filter(h=>h!==p):[...a,p]):l(p)};return S.createElement(sQ,{value:{isChipSelected:c,onChange:u,multiple:o}},i)}jI.displayName="@mantine/core/ChipGroup";var uQ=Object.defineProperty,dQ=Object.defineProperties,fQ=Object.getOwnPropertyDescriptors,XS=Object.getOwnPropertySymbols,pQ=Object.prototype.hasOwnProperty,hQ=Object.prototype.propertyIsEnumerable,JS=(e,t,r)=>t in e?uQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,On=(e,t)=>{for(var r in t||(t={}))pQ.call(t,r)&&JS(e,r,t[r]);if(XS)for(var r of XS(t))hQ.call(t,r)&&JS(e,r,t[r]);return e},Cl=(e,t)=>dQ(e,fQ(t));const ZS={xs:O(24),sm:O(28),md:O(32),lg:O(36),xl:O(40)},ll={xs:O(10),sm:O(12),md:O(14),lg:O(16),xl:O(18)},eP={xs:O(16),sm:O(20),md:O(24),lg:O(28),xl:O(32)},Lu={xs:O(7.5),sm:O(10),md:O(11.5),lg:O(13),xl:O(15)};function mQ(e,{color:t},r){const n=e.fn.variant({variant:"filled",color:t}),o=e.fn.variant({variant:"light",color:t});return r==="light"?{label:On({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1]},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),checked:Cl(On({color:o.color,backgroundColor:o.background},e.fn.hover({backgroundColor:o.hover})),{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:t}).background}})}:r==="filled"?{label:On({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1]},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),checked:On({color:n.color,backgroundColor:n.background},e.fn.hover({backgroundColor:n.hover}))}:r==="outline"?{label:On({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),checked:{border:`${O(1)} solid ${n.background}`}}:{label:null,checked:null}}var gQ=W((e,{radius:t,color:r},{size:n,variant:o})=>{const i=mQ(e,{color:r},o);return{root:{},label:Cl(On(Cl(On({ref:Vt("label")},e.fn.fontStyles()),{boxSizing:"border-box",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"inline-flex",alignItems:"center",userSelect:"none",border:`${O(1)} solid transparent`,borderRadius:e.fn.radius(t),height:A({size:n,sizes:ZS}),fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:`calc(${A({size:n,sizes:ZS})} - ${O(2)})`,paddingLeft:A({size:n,sizes:eP}),paddingRight:A({size:n,sizes:eP}),cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 100ms ease",WebkitTapHighlightColor:"transparent"}),i.label),{"&[data-disabled]":Cl(On({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed",pointerEvents:"none"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})),{[`& .${Vt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}),"&[data-checked]":{paddingLeft:A({size:n,sizes:Lu}),paddingRight:A({size:n,sizes:Lu}),"&:not([data-disabled])":i.checked}}),iconWrapper:{ref:Vt("iconWrapper"),color:o==="filled"?e.white:e.fn.variant({variant:"filled",color:r}).background,width:`calc(${A({size:n,sizes:ll})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,maxWidth:`calc(${A({size:n,sizes:ll})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,height:A({size:n,sizes:ll}),display:"inline-block",verticalAlign:"middle",overflow:"hidden"},checkIcon:{width:A({size:n,sizes:ll}),height:`calc(${A({size:n,sizes:ll})} / 1.1)`,display:"block"},input:{width:0,height:0,padding:0,opacity:0,margin:0,"&:disabled + label":Cl(On({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed",pointerEvents:"none"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})),{[`& .${Vt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&[data-checked]":{paddingLeft:A({size:n,sizes:Lu}),paddingRight:A({size:n,sizes:Lu}),"&:not([data-disabled])":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}),"&:focus":{outline:"none",[`& + .${Vt("label")}`]:On({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),"&:focus:not(:focus-visible)":{[`& + .${Vt("label")}`]:On({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)}}}}});const vQ=gQ;var yQ=Object.defineProperty,Yf=Object.getOwnPropertySymbols,OI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,tP=(e,t,r)=>t in e?yQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zu=(e,t)=>{for(var r in t||(t={}))OI.call(t,r)&&tP(e,r,t[r]);if(Yf)for(var r of Yf(t))CI.call(t,r)&&tP(e,r,t[r]);return e},xQ=(e,t)=>{var r={};for(var n in e)OI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yf)for(var n of Yf(e))t.indexOf(n)<0&&CI.call(e,n)&&(r[n]=e[n]);return r};const wQ={type:"checkbox",size:"sm",radius:"xl",variant:"outline"},Xf=f.forwardRef((e,t)=>{const r=H("Chip",wQ,e),{radius:n,type:o,size:i,variant:a,disabled:l,id:c,color:u,children:d,className:p,classNames:h,style:m,styles:g,checked:v,defaultChecked:_,onChange:y,sx:x,wrapperProps:w,value:b,unstyled:j}=r,C=xQ(r,["radius","type","size","variant","disabled","id","color","children","className","classNames","style","styles","checked","defaultChecked","onChange","sx","wrapperProps","value","unstyled"]),P=lQ(),E=Ar(c),{systemStyles:k,rest:$}=ao(C),{classes:I,cx:R}=vQ({radius:n,color:u},{classNames:h,styles:g,unstyled:j,name:"Chip",variant:a,size:i}),[N,M]=Ir({value:v,defaultValue:_,finalValue:!1,onChange:y}),L=P?{checked:P.isChipSelected(b),onChange:P.onChange,type:P.multiple?"checkbox":"radio"}:{},Q=L.checked||N;return S.createElement(ae,zu(zu({className:R(I.root,p),style:m,sx:x},k),w),S.createElement("input",zu(zu({type:o,className:I.input,checked:Q,onChange:G=>M(G.currentTarget.checked),id:E,disabled:l,ref:t,value:b},L),$)),S.createElement("label",{htmlFor:E,"data-checked":Q||void 0,"data-disabled":l||void 0,className:I.label},Q&&S.createElement("span",{className:I.iconWrapper},S.createElement(yI,{className:I.checkIcon})),d))});Xf.displayName="@mantine/core/Chip";Xf.Group=jI;var bQ=W((e,{fluid:t,sizes:r},{size:n})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":A({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const _Q=bQ;var SQ=Object.defineProperty,Jf=Object.getOwnPropertySymbols,EI=Object.prototype.hasOwnProperty,$I=Object.prototype.propertyIsEnumerable,rP=(e,t,r)=>t in e?SQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PQ=(e,t)=>{for(var r in t||(t={}))EI.call(t,r)&&rP(e,r,t[r]);if(Jf)for(var r of Jf(t))$I.call(t,r)&&rP(e,r,t[r]);return e},jQ=(e,t)=>{var r={};for(var n in e)EI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Jf)for(var n of Jf(e))t.indexOf(n)<0&&$I.call(e,n)&&(r[n]=e[n]);return r};const OQ={sizes:{xs:O(540),sm:O(720),md:O(960),lg:O(1140),xl:O(1320)}},kI=f.forwardRef((e,t)=>{const r=H("Container",OQ,e),{className:n,fluid:o,size:i,unstyled:a,sizes:l,variant:c}=r,u=jQ(r,["className","fluid","size","unstyled","sizes","variant"]),{classes:d,cx:p}=_Q({fluid:o,sizes:l},{unstyled:a,name:"Container",variant:c,size:i});return S.createElement(ae,PQ({className:p(d.root,n),ref:t},u))});kI.displayName="@mantine/core/Container";var CQ=Object.defineProperty,Zf=Object.getOwnPropertySymbols,RI=Object.prototype.hasOwnProperty,TI=Object.prototype.propertyIsEnumerable,nP=(e,t,r)=>t in e?CQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,EQ=(e,t)=>{for(var r in t||(t={}))RI.call(t,r)&&nP(e,r,t[r]);if(Zf)for(var r of Zf(t))TI.call(t,r)&&nP(e,r,t[r]);return e},$Q=(e,t)=>{var r={};for(var n in e)RI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zf)for(var n of Zf(e))t.indexOf(n)<0&&TI.call(e,n)&&(r[n]=e[n]);return r};const kQ={timeout:1e3};function II(e){const t=H("CopyButton",kQ,e),{children:r,timeout:n,value:o}=t,i=$Q(t,["children","timeout","value"]),a=mL({timeout:n}),l=()=>a.copy(o);return S.createElement(S.Fragment,null,r(EQ({copy:l,copied:a.copied},i)))}II.displayName="@mantine/core/CopyButton";const[RQ,Fs]=No("ModalBase component was not found in tree");var TQ=W(()=>({close:{marginLeft:"auto",marginRight:0}}));const IQ=TQ;var DQ=Object.defineProperty,ep=Object.getOwnPropertySymbols,DI=Object.prototype.hasOwnProperty,NI=Object.prototype.propertyIsEnumerable,oP=(e,t,r)=>t in e?DQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,NQ=(e,t)=>{for(var r in t||(t={}))DI.call(t,r)&&oP(e,r,t[r]);if(ep)for(var r of ep(t))NI.call(t,r)&&oP(e,r,t[r]);return e},AQ=(e,t)=>{var r={};for(var n in e)DI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ep)for(var n of ep(e))t.indexOf(n)<0&&NI.call(e,n)&&(r[n]=e[n]);return r};const MQ={size:"sm"},LQ=f.forwardRef((e,t)=>{const r=Fs(),n=H(`${r.__staticSelector}CloseButton`,MQ,e),{className:o}=n,i=AQ(n,["className"]),{classes:a,cx:l}=IQ(null,r.stylesApi);return S.createElement(kc,NQ({className:l(a.close,o),ref:t,onClick:r.onClose},i))});var zQ=W(()=>({overlay:{}}));const FQ=zQ;var VQ=Object.defineProperty,BQ=Object.defineProperties,UQ=Object.getOwnPropertyDescriptors,iP=Object.getOwnPropertySymbols,WQ=Object.prototype.hasOwnProperty,HQ=Object.prototype.propertyIsEnumerable,aP=(e,t,r)=>t in e?VQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qQ=(e,t)=>{for(var r in t||(t={}))WQ.call(t,r)&&aP(e,r,t[r]);if(iP)for(var r of iP(t))HQ.call(t,r)&&aP(e,r,t[r]);return e},GQ=(e,t)=>BQ(e,UQ(t)),QQ=W((e,{color:t,opacity:r,blur:n,radius:o,gradient:i,fixed:a,zIndex:l})=>({root:GQ(qQ({},e.fn.cover(0)),{position:a?"fixed":"absolute",backgroundColor:i?void 0:e.fn.rgba(t,r),backgroundImage:i,backdropFilter:n?`blur(${O(n)})`:void 0,borderRadius:e.fn.radius(o),zIndex:l,"&[data-center]":{display:"flex",alignItems:"center",justifyContent:"center"}})}));const KQ=QQ;var YQ=Object.defineProperty,tp=Object.getOwnPropertySymbols,AI=Object.prototype.hasOwnProperty,MI=Object.prototype.propertyIsEnumerable,sP=(e,t,r)=>t in e?YQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,XQ=(e,t)=>{for(var r in t||(t={}))AI.call(t,r)&&sP(e,r,t[r]);if(tp)for(var r of tp(t))MI.call(t,r)&&sP(e,r,t[r]);return e},JQ=(e,t)=>{var r={};for(var n in e)AI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tp)for(var n of tp(e))t.indexOf(n)<0&&MI.call(e,n)&&(r[n]=e[n]);return r};const ZQ={opacity:.6,color:"#000",zIndex:Dn("modal"),radius:0},LI=f.forwardRef((e,t)=>{const r=H("Overlay",ZQ,e),{variant:n,opacity:o,color:i,blur:a,gradient:l,zIndex:c,radius:u,children:d,className:p,classNames:h,styles:m,unstyled:g,center:v,fixed:_}=r,y=JQ(r,["variant","opacity","color","blur","gradient","zIndex","radius","children","className","classNames","styles","unstyled","center","fixed"]),{classes:x,cx:w}=KQ({color:i,opacity:o,blur:a,radius:u,gradient:l,fixed:_,zIndex:c},{name:"Overlay",classNames:h,styles:m,unstyled:g,variant:n});return S.createElement(ae,XQ({ref:t,className:w(x.root,p),"data-center":v||void 0},y),d)});LI.displayName="@mantine/core/Overlay";const zI=LI;var eK=Object.defineProperty,tK=Object.defineProperties,rK=Object.getOwnPropertyDescriptors,rp=Object.getOwnPropertySymbols,FI=Object.prototype.hasOwnProperty,VI=Object.prototype.propertyIsEnumerable,lP=(e,t,r)=>t in e?eK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cl=(e,t)=>{for(var r in t||(t={}))FI.call(t,r)&&lP(e,r,t[r]);if(rp)for(var r of rp(t))VI.call(t,r)&&lP(e,r,t[r]);return e},nK=(e,t)=>tK(e,rK(t)),oK=(e,t)=>{var r={};for(var n in e)FI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rp)for(var n of rp(e))t.indexOf(n)<0&&VI.call(e,n)&&(r[n]=e[n]);return r};const iK={},aK=f.forwardRef((e,t)=>{const r=Fs(),n=H(`${r.__staticSelector}Overlay`,iK,e),{onClick:o,transitionProps:i,style:a,className:l}=n,c=oK(n,["onClick","transitionProps","style","className"]),{classes:u,cx:d}=FQ(null,r.stylesApi),p=h=>{o==null||o(h),r.closeOnClickOutside&&r.onClose()};return S.createElement(ya,nK(cl(cl({mounted:r.opened},r.transitionProps),i),{transition:"fade"}),h=>S.createElement(zI,cl({ref:t,onClick:p,fixed:!0,style:cl(cl({},a),h),className:d(u.overlay,l),zIndex:r.zIndex},c)))});var sK=W((e,{zIndex:t})=>({inner:{position:"fixed",width:"100%",top:0,bottom:0,maxHeight:"100%",zIndex:t,pointerEvents:"none"},content:{pointerEvents:"all"}}));const lK=sK;var cK=Object.defineProperty,np=Object.getOwnPropertySymbols,BI=Object.prototype.hasOwnProperty,UI=Object.prototype.propertyIsEnumerable,cP=(e,t,r)=>t in e?cK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ul=(e,t)=>{for(var r in t||(t={}))BI.call(t,r)&&cP(e,r,t[r]);if(np)for(var r of np(t))UI.call(t,r)&&cP(e,r,t[r]);return e},uK=(e,t)=>{var r={};for(var n in e)BI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&np)for(var n of np(e))t.indexOf(n)<0&&UI.call(e,n)&&(r[n]=e[n]);return r};const dK={},fK=f.forwardRef((e,t)=>{const r=Fs(),n=H(`${r.__staticSelector}Content`,dK,e),{className:o,transitionProps:i,style:a,onKeyDown:l}=n,c=uK(n,["className","transitionProps","style","onKeyDown"]),{classes:u,cx:d}=lK({zIndex:r.zIndex},r.stylesApi),p=h=>{var m;((m=h.target)==null?void 0:m.getAttribute("data-mantine-stop-propagation"))!=="true"&&h.key==="Escape"&&r.closeOnEscape&&r.onClose(),l==null||l(h)};return S.createElement(ya,ul(ul({mounted:r.opened,transition:"pop"},r.transitionProps),i),h=>S.createElement("div",{className:d(u.inner)},S.createElement(lx,{active:r.opened&&r.trapFocus},S.createElement(dn,ul({component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":r.bodyMounted?r.getBodyId():void 0,"aria-labelledby":r.titleMounted?r.getTitleId():void 0,onKeyDown:p,ref:t,className:d(u.content,o),style:ul(ul({},a),h),shadow:r.shadow},c),c.children))))});var pK=W((e,{padding:t})=>{const r=A({size:t,sizes:e.spacing});return{header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:r,paddingRight:`calc(${r} - ${O(5)})`,position:"sticky",top:0,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,zIndex:1e3}}});const hK=pK;var mK=Object.defineProperty,op=Object.getOwnPropertySymbols,WI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,uP=(e,t,r)=>t in e?mK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gK=(e,t)=>{for(var r in t||(t={}))WI.call(t,r)&&uP(e,r,t[r]);if(op)for(var r of op(t))HI.call(t,r)&&uP(e,r,t[r]);return e},vK=(e,t)=>{var r={};for(var n in e)WI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&op)for(var n of op(e))t.indexOf(n)<0&&HI.call(e,n)&&(r[n]=e[n]);return r};const yK={},xK=f.forwardRef((e,t)=>{const r=Fs(),n=H(`${r.__staticSelector}Header`,yK,e),{className:o}=n,i=vK(n,["className"]),{classes:a,cx:l}=hK({padding:r.padding},r.stylesApi);return S.createElement(ae,gK({ref:t,className:l(a.header,o)},i))});var wK=W(e=>({title:{lineHeight:1,padding:0,margin:0,fontWeight:400,fontSize:e.fontSizes.md}}));const bK=wK;var _K=Object.defineProperty,ip=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty,GI=Object.prototype.propertyIsEnumerable,dP=(e,t,r)=>t in e?_K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SK=(e,t)=>{for(var r in t||(t={}))qI.call(t,r)&&dP(e,r,t[r]);if(ip)for(var r of ip(t))GI.call(t,r)&&dP(e,r,t[r]);return e},PK=(e,t)=>{var r={};for(var n in e)qI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ip)for(var n of ip(e))t.indexOf(n)<0&&GI.call(e,n)&&(r[n]=e[n]);return r};const jK={},OK=f.forwardRef((e,t)=>{const r=Fs(),n=H(`${r.__staticSelector}Title`,jK,e),{className:o}=n,i=PK(n,["className"]),{classes:a,cx:l}=bK(null,r.stylesApi);return f.useEffect(()=>(r.setTitleMounted(!0),()=>r.setTitleMounted(!1)),[]),S.createElement(ae,SK({component:"h2",id:r.getTitleId(),className:l(a.title,o),ref:t},i))});var CK=W((e,{padding:t})=>({body:{padding:A({size:t,sizes:e.spacing}),"&:not(:only-child)":{paddingTop:0}}}));const EK=CK;var $K=Object.defineProperty,ap=Object.getOwnPropertySymbols,QI=Object.prototype.hasOwnProperty,KI=Object.prototype.propertyIsEnumerable,fP=(e,t,r)=>t in e?$K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kK=(e,t)=>{for(var r in t||(t={}))QI.call(t,r)&&fP(e,r,t[r]);if(ap)for(var r of ap(t))KI.call(t,r)&&fP(e,r,t[r]);return e},RK=(e,t)=>{var r={};for(var n in e)QI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ap)for(var n of ap(e))t.indexOf(n)<0&&KI.call(e,n)&&(r[n]=e[n]);return r};const TK={},IK=f.forwardRef((e,t)=>{const r=Fs(),n=H(`${r.__staticSelector}Body`,TK,e),{className:o}=n,i=RK(n,["className"]),{classes:a,cx:l}=EK({padding:r.padding},r.stylesApi);return f.useEffect(()=>(r.setBodyMounted(!0),()=>r.setBodyMounted(!1)),[]),S.createElement(ae,kK({id:r.getBodyId(),className:l(a.body,o),ref:t},i))});function DK({children:e}){return S.createElement(S.Fragment,null,e)}function NK({opened:e,transitionDuration:t}){const[r,n]=f.useState(e),o=f.useRef(),a=Uh()?0:t;return f.useEffect(()=>(e?(n(!0),window.clearTimeout(o.current)):a===0?n(!1):o.current=window.setTimeout(()=>n(!1),a),()=>window.clearTimeout(o.current)),[e,a]),r}var AK=W(()=>({root:{}}));const MK=AK;var LK=Object.defineProperty,zK=Object.defineProperties,FK=Object.getOwnPropertyDescriptors,sp=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,XI=Object.prototype.propertyIsEnumerable,pP=(e,t,r)=>t in e?LK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ig=(e,t)=>{for(var r in t||(t={}))YI.call(t,r)&&pP(e,r,t[r]);if(sp)for(var r of sp(t))XI.call(t,r)&&pP(e,r,t[r]);return e},hP=(e,t)=>zK(e,FK(t)),VK=(e,t)=>{var r={};for(var n in e)YI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sp)for(var n of sp(e))t.indexOf(n)<0&&XI.call(e,n)&&(r[n]=e[n]);return r};const mx={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Dn("modal"),padding:"md",size:"md",shadow:"xl"};function kt(e){const t=H("ModalBase",mx,e),{opened:r,onClose:n,children:o,closeOnClickOutside:i,__staticSelector:a,transitionProps:l,withinPortal:c,portalProps:u,keepMounted:d,target:p,zIndex:h,lockScroll:m,trapFocus:g,closeOnEscape:v,returnFocus:_,padding:y,shadow:x,id:w,size:b,variant:j,classNames:C,unstyled:P,styles:E,className:k}=t,$=VK(t,["opened","onClose","children","closeOnClickOutside","__staticSelector","transitionProps","withinPortal","portalProps","keepMounted","target","zIndex","lockScroll","trapFocus","closeOnEscape","returnFocus","padding","shadow","id","size","variant","classNames","unstyled","styles","className"]),{classes:I,cx:R}=MK(null,{name:a,classNames:C,styles:E,unstyled:P,variant:j,size:b}),N=Ar(w),[M,L]=f.useState(!1),[Q,G]=f.useState(!1),T=typeof(l==null?void 0:l.duration)=="number"?l==null?void 0:l.duration:200,F=NK({opened:r,transitionDuration:T});return fv("keydown",V=>{!g&&V.key==="Escape"&&v&&n()}),d$({opened:r,shouldReturnFocus:g&&_}),S.createElement(Ls,hP(Ig({},u),{withinPortal:c,target:p}),S.createElement(RQ,{value:{__staticSelector:a,opened:r,onClose:n,closeOnClickOutside:i,transitionProps:hP(Ig({},l),{duration:T,keepMounted:d}),zIndex:h,padding:y,id:N,getTitleId:()=>`${N}-title`,getBodyId:()=>`${N}-body`,titleMounted:M,bodyMounted:Q,setTitleMounted:L,setBodyMounted:G,trapFocus:g,closeOnEscape:v,shadow:x,stylesApi:{name:a,size:b,variant:j,classNames:C,styles:E,unstyled:P}}},S.createElement(F9,{enabled:F&&m},S.createElement(ae,Ig({className:R(I.root,k)},$),o))))}kt.CloseButton=LQ;kt.Overlay=aK;kt.Content=fK;kt.Header=xK;kt.Title=OK;kt.Body=IK;kt.NativeScrollArea=DK;const BK={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 UK=Object.defineProperty,WK=Object.defineProperties,HK=Object.getOwnPropertyDescriptors,lp=Object.getOwnPropertySymbols,JI=Object.prototype.hasOwnProperty,ZI=Object.prototype.propertyIsEnumerable,mP=(e,t,r)=>t in e?UK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qK=(e,t)=>{for(var r in t||(t={}))JI.call(t,r)&&mP(e,r,t[r]);if(lp)for(var r of lp(t))ZI.call(t,r)&&mP(e,r,t[r]);return e},GK=(e,t)=>WK(e,HK(t)),QK=(e,t)=>{var r={};for(var n in e)JI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&lp)for(var n of lp(e))t.indexOf(n)<0&&ZI.call(e,n)&&(r[n]=e[n]);return r};const KK={},cp=f.forwardRef((e,t)=>{const r=H("Flex",KK,e),{gap:n,rowGap:o,columnGap:i,align:a,justify:l,wrap:c,direction:u,sx:d}=r,p=QK(r,["gap","rowGap","columnGap","align","justify","wrap","direction","sx"]);return S.createElement(ae,GK(qK({},p),{sx:[{display:"flex"},h=>pv({gap:n,rowGap:o,columnGap:i,align:a,justify:l,wrap:c,direction:u},h,BK),..._c(d)],ref:t}))});cp.displayName="@mantine/core/Flex";const[YK,XK]=No("Grid component was not found in tree");var JK=Object.defineProperty,gP=Object.getOwnPropertySymbols,ZK=Object.prototype.hasOwnProperty,eY=Object.prototype.propertyIsEnumerable,vP=(e,t,r)=>t in e?JK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tY=(e,t)=>{for(var r in t||(t={}))ZK.call(t,r)&&vP(e,r,t[r]);if(gP)for(var r of gP(t))eY.call(t,r)&&vP(e,r,t[r]);return e};const gx=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,eD=(e,t,r)=>r||e==="auto"||e==="content"?"unset":gx(e,t),tD=(e,t)=>{if(e)return e==="auto"||t?1:0},rD=(e,t)=>e===0?0:e?`${100/(t/e)}%`:void 0,nD=(e,t)=>typeof e<"u"?`calc(${A({size:e,sizes:t.spacing})} / 2)`:void 0;function rY({sizes:e,offsets:t,orders:r,theme:n,columns:o,gutters:i,grow:a}){return UE.reduce((l,c)=>(l[`@media (min-width: ${sr(n.breakpoints[c])})`]={order:r[c],flexBasis:gx(e[c],o),padding:nD(i[c],n),flexShrink:0,width:e[c]==="content"?"auto":void 0,maxWidth:eD(e[c],o,a),marginLeft:rD(t[c],o),flexGrow:tD(e[c],a)},l),{})}var nY=W((e,{gutter:t,gutterXs:r,gutterSm:n,gutterMd:o,gutterLg:i,gutterXl:a,grow:l,offset:c,offsetXs:u,offsetSm:d,offsetMd:p,offsetLg:h,offsetXl:m,columns:g,span:v,xs:_,sm:y,md:x,lg:w,xl:b,order:j,orderXs:C,orderSm:P,orderMd:E,orderLg:k,orderXl:$})=>({col:tY({boxSizing:"border-box",flexGrow:tD(v,l),order:j,padding:nD(t,e),marginLeft:rD(c,g),flexBasis:gx(v,g),flexShrink:0,width:v==="content"?"auto":void 0,maxWidth:eD(v,g,l)},rY({sizes:{xs:_,sm:y,md:x,lg:w,xl:b},offsets:{xs:u,sm:d,md:p,lg:h,xl:m},orders:{xs:C,sm:P,md:E,lg:k,xl:$},gutters:{xs:r,sm:n,md:o,lg:i,xl:a},theme:e,columns:g,grow:l}))}));const oY=nY;var iY=Object.defineProperty,up=Object.getOwnPropertySymbols,oD=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable,yP=(e,t,r)=>t in e?iY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aY=(e,t)=>{for(var r in t||(t={}))oD.call(t,r)&&yP(e,r,t[r]);if(up)for(var r of up(t))iD.call(t,r)&&yP(e,r,t[r]);return e},sY=(e,t)=>{var r={};for(var n in e)oD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&up)for(var n of up(e))t.indexOf(n)<0&&iD.call(e,n)&&(r[n]=e[n]);return r};const lY={};function cY(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const aD=f.forwardRef((e,t)=>{const r=H("GridCol",lY,e),{children:n,span:o,offset:i,offsetXs:a,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:g,xl:v,order:_,orderXs:y,orderSm:x,orderMd:w,orderLg:b,orderXl:j,className:C,unstyled:P,variant:E}=r,k=sY(r,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","unstyled","variant"]),$=XK(),I=o||$.columns,{classes:R,cx:N}=oY({gutter:$.gutter,gutterXs:$.gutterXs,gutterSm:$.gutterSm,gutterMd:$.gutterMd,gutterLg:$.gutterLg,gutterXl:$.gutterXl,offset:i,offsetXs:a,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:g,xl:v,order:_,orderXs:y,orderSm:x,orderMd:w,orderLg:b,orderXl:j,grow:$.grow,columns:$.columns,span:I},{unstyled:P,name:"Grid",variant:E});return!cY(I)||I>$.columns?null:S.createElement(ae,aY({className:N(R.col,C),ref:t},k),n)});aD.displayName="@mantine/core/Col";var uY=Object.defineProperty,xP=Object.getOwnPropertySymbols,dY=Object.prototype.hasOwnProperty,fY=Object.prototype.propertyIsEnumerable,wP=(e,t,r)=>t in e?uY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pY=(e,t)=>{for(var r in t||(t={}))dY.call(t,r)&&wP(e,r,t[r]);if(xP)for(var r of xP(t))fY.call(t,r)&&wP(e,r,t[r]);return e};function hY(e,t){return UE.reduce((r,n)=>(typeof e[n]<"u"&&(r[`@media (min-width: ${t.breakpoints[n]})`]={margin:`calc(-${A({size:e[n],sizes:t.spacing})} / 2)`}),r),{})}var mY=W((e,{justify:t,align:r,gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c})=>({root:pY({margin:`calc(-${A({size:n,sizes:e.spacing})} / 2)`,display:"flex",flexWrap:"wrap",justifyContent:t,alignItems:r},hY({xs:o,sm:i,md:a,lg:l,xl:c},e))}));const gY=mY;var vY=Object.defineProperty,dp=Object.getOwnPropertySymbols,sD=Object.prototype.hasOwnProperty,lD=Object.prototype.propertyIsEnumerable,bP=(e,t,r)=>t in e?vY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yY=(e,t)=>{for(var r in t||(t={}))sD.call(t,r)&&bP(e,r,t[r]);if(dp)for(var r of dp(t))lD.call(t,r)&&bP(e,r,t[r]);return e},xY=(e,t)=>{var r={};for(var n in e)sD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&dp)for(var n of dp(e))t.indexOf(n)<0&&lD.call(e,n)&&(r[n]=e[n]);return r};const wY={gutter:"md",justify:"flex-start",align:"stretch",columns:12},ln=f.forwardRef((e,t)=>{const r=H("Grid",wY,e),{gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c,children:u,grow:d,justify:p,align:h,columns:m,className:g,unstyled:v,variant:_}=r,y=xY(r,["gutter","gutterXs","gutterSm","gutterMd","gutterLg","gutterXl","children","grow","justify","align","columns","className","unstyled","variant"]),{classes:x,cx:w}=gY({gutter:n,justify:p,align:h,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c},{unstyled:v,name:"Grid",variant:_});return S.createElement(YK,{value:{gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c,grow:d,columns:m}},S.createElement(ae,yY({className:w(x.root,g),ref:t},y),u))});ln.Col=aD;ln.displayName="@mantine/core/Grid";function bY(e){return f.Children.toArray(e).filter(Boolean)}const cD={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var _Y=W((e,{spacing:t,position:r,noWrap:n,grow:o,align:i,count:a})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:i||"center",flexWrap:n?"nowrap":"wrap",justifyContent:cD[r],gap:A({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/a}% - (${O(A({size:t,sizes:e.spacing}))} - ${A({size:t,sizes:e.spacing})} / ${a}))`:void 0,flexGrow:o?1:0}}}));const SY=_Y;var PY=Object.defineProperty,fp=Object.getOwnPropertySymbols,uD=Object.prototype.hasOwnProperty,dD=Object.prototype.propertyIsEnumerable,_P=(e,t,r)=>t in e?PY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jY=(e,t)=>{for(var r in t||(t={}))uD.call(t,r)&&_P(e,r,t[r]);if(fp)for(var r of fp(t))dD.call(t,r)&&_P(e,r,t[r]);return e},OY=(e,t)=>{var r={};for(var n in e)uD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&fp)for(var n of fp(e))t.indexOf(n)<0&&dD.call(e,n)&&(r[n]=e[n]);return r};const CY={position:"left",spacing:"md"},K=f.forwardRef((e,t)=>{const r=H("Group",CY,e),{className:n,position:o,align:i,children:a,noWrap:l,grow:c,spacing:u,unstyled:d,variant:p}=r,h=OY(r,["className","position","align","children","noWrap","grow","spacing","unstyled","variant"]),m=bY(a),{classes:g,cx:v}=SY({align:i,grow:c,noWrap:l,spacing:u,position:o,count:m.length},{unstyled:d,name:"Group",variant:p});return S.createElement(ae,jY({className:v(g.root,n),ref:t},h),m)});K.displayName="@mantine/core/Group";function EY({open:e,close:t,openDelay:r,closeDelay:n}){const o=f.useRef(-1),i=f.useRef(-1),a=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{a(),r===0?e():o.current=window.setTimeout(e,r)},c=()=>{a(),n===0?t():i.current=window.setTimeout(t,n)};return f.useEffect(()=>a,[]),{openDropdown:l,closeDropdown:c}}function SP(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var $Y=W((e,t,{size:r})=>({input:{fontFamily:e.fontFamilyMonospace,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${O(2)})`}}));const kY=$Y;function vx(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var RY=f.useLayoutEffect,TY=function(t){var r=f.useRef(t);return RY(function(){r.current=t}),r},PP=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},IY=function(t,r){var n=f.useRef();return f.useCallback(function(o){t.current=o,n.current&&PP(n.current,null),n.current=r,r&&PP(r,o)},[r])},jP={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},OP=function(t){Object.keys(jP).forEach(function(r){t.style.setProperty(r,jP[r],"important")})},Ur=null,DY=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function NY(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),Ur||(Ur=document.createElement("textarea"),Ur.setAttribute("tabindex","-1"),Ur.setAttribute("aria-hidden","true"),OP(Ur)),Ur.parentNode===null&&document.body.appendChild(Ur);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,l=a.boxSizing;Object.keys(a).forEach(function(h){var m=h;Ur.style[m]=a[m]}),OP(Ur),Ur.value=t;var c=DY(Ur,e);Ur.value="x";var u=Ur.scrollHeight-o,d=u*r;l==="border-box"&&(d=d+o+i),c=Math.max(d,c);var p=u*n;return l==="border-box"&&(p=p+o+i),c=Math.min(p,c),[c,u]}var CP=function(){},AY=function(t,r){return t.reduce(function(n,o){return n[o]=r[o],n},{})},MY=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],LY=!!document.documentElement.currentStyle,zY=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=AY(MY,r),o=n.boxSizing;if(o==="")return null;LY&&o==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var i=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:i,borderSize:a}},FY=function(t){var r=TY(t);f.useLayoutEffect(function(){var n=function(i){r.current(i)};return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}},[])},VY=function(t,r){var n=t.cacheMeasurements,o=t.maxRows,i=t.minRows,a=t.onChange,l=a===void 0?CP:a,c=t.onHeightChange,u=c===void 0?CP:c,d=vx(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),p=d.value!==void 0,h=f.useRef(null),m=IY(h,r),g=f.useRef(0),v=f.useRef(),_=function(){var w=h.current,b=n&&v.current?v.current:zY(w);if(b){v.current=b;var j=NY(b,w.value||w.placeholder||"x",i,o),C=j[0],P=j[1];g.current!==C&&(g.current=C,w.style.setProperty("height",C+"px","important"),u(C,{rowHeight:P}))}},y=function(w){p||_(),l(w)};return f.useLayoutEffect(_),FY(_),f.createElement("textarea",st({},d,{onChange:y,ref:m}))},BY=f.forwardRef(VY);const UY=BY;var WY=W(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const HY=WY;var qY=Object.defineProperty,GY=Object.defineProperties,QY=Object.getOwnPropertyDescriptors,pp=Object.getOwnPropertySymbols,fD=Object.prototype.hasOwnProperty,pD=Object.prototype.propertyIsEnumerable,EP=(e,t,r)=>t in e?qY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ia=(e,t)=>{for(var r in t||(t={}))fD.call(t,r)&&EP(e,r,t[r]);if(pp)for(var r of pp(t))pD.call(t,r)&&EP(e,r,t[r]);return e},Dg=(e,t)=>GY(e,QY(t)),KY=(e,t)=>{var r={};for(var n in e)fD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pp)for(var n of pp(e))t.indexOf(n)<0&&pD.call(e,n)&&(r[n]=e[n]);return r};const YY={autosize:!1,size:"sm",__staticSelector:"Textarea"},Nc=f.forwardRef((e,t)=>{const r=H("Textarea",YY,e),{autosize:n,maxRows:o,minRows:i,label:a,error:l,description:c,id:u,className:d,required:p,style:h,wrapperProps:m,classNames:g,styles:v,size:_,__staticSelector:y,sx:x,errorProps:w,descriptionProps:b,labelProps:j,inputWrapperOrder:C,inputContainer:P,unstyled:E,withAsterisk:k,variant:$}=r,I=KY(r,["autosize","maxRows","minRows","label","error","description","id","className","required","style","wrapperProps","classNames","styles","size","__staticSelector","sx","errorProps","descriptionProps","labelProps","inputWrapperOrder","inputContainer","unstyled","withAsterisk","variant"]),R=Ar(u),{classes:N,cx:M}=HY(),{systemStyles:L,rest:Q}=ao(I),G=Ia({required:p,ref:t,error:l,id:R,classNames:Dg(Ia({},g),{input:M(N.input,g==null?void 0:g.input)}),styles:v,__staticSelector:y,size:_,multiline:!0,unstyled:E,variant:$},Q);return S.createElement(Ut.Wrapper,Ia(Ia({label:a,error:l,id:R,description:c,required:p,style:h,className:d,classNames:g,styles:v,size:_,__staticSelector:y,sx:x,errorProps:w,labelProps:j,descriptionProps:b,inputContainer:P,inputWrapperOrder:C,unstyled:E,withAsterisk:k,variant:$},L),m),n?S.createElement(Ut,Dg(Ia({},G),{component:UY,maxRows:o,minRows:i})):S.createElement(Ut,Dg(Ia({},G),{component:"textarea",rows:i})))});Nc.displayName="@mantine/core/Textarea";var XY=Object.defineProperty,JY=Object.defineProperties,ZY=Object.getOwnPropertyDescriptors,hp=Object.getOwnPropertySymbols,hD=Object.prototype.hasOwnProperty,mD=Object.prototype.propertyIsEnumerable,$P=(e,t,r)=>t in e?XY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kP=(e,t)=>{for(var r in t||(t={}))hD.call(t,r)&&$P(e,r,t[r]);if(hp)for(var r of hp(t))mD.call(t,r)&&$P(e,r,t[r]);return e},eX=(e,t)=>JY(e,ZY(t)),tX=(e,t)=>{var r={};for(var n in e)hD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&hp)for(var n of hp(e))t.indexOf(n)<0&&mD.call(e,n)&&(r[n]=e[n]);return r};const rX={formatOnBlur:!1,size:"sm",serialize:JSON.stringify,deserialize:JSON.parse},Vs=f.forwardRef((e,t)=>{const r=H("JsonInput",rX,e),{value:n,defaultValue:o,onChange:i,onFocus:a,onBlur:l,error:c,formatOnBlur:u,size:d,validationError:p,classNames:h,unstyled:m,readOnly:g,variant:v,serialize:_,deserialize:y}=r,x=tX(r,["value","defaultValue","onChange","onFocus","onBlur","error","formatOnBlur","size","validationError","classNames","unstyled","readOnly","variant","serialize","deserialize"]),{classes:w,cx:b}=kY(null,{name:"JsonInput",unstyled:m,size:d,variant:v}),[j,C]=Ir({value:n,defaultValue:o,finalValue:"",onChange:i}),[P,E]=f.useState(SP(j,y)),k=I=>{typeof a=="function"&&a(I),E(!0)},$=I=>{typeof l=="function"&&l(I);const R=SP(I.currentTarget.value,y);u&&!g&&R&&I.currentTarget.value.trim()!==""&&C(_(y(I.currentTarget.value),null,2)),E(R)};return S.createElement(Nc,kP({value:j,onChange:I=>C(I.currentTarget.value),onFocus:k,onBlur:$,error:P?c:p||!0,__staticSelector:"JsonInput",classNames:eX(kP({},h),{input:b(w.input,h==null?void 0:h.input)}),autoComplete:"off",ref:t,unstyled:m,readOnly:g,size:d,variant:v},x))});Vs.displayName="@mantine/core/JsonInput";const[nX,oX]=No("List component was not found in tree");var iX=W((e,{spacing:t,center:r})=>({itemWrapper:{ref:Vt("itemWrapper"),display:"inline-flex",flexDirection:"column",whiteSpace:"normal"},item:{whiteSpace:"nowrap",lineHeight:r?1:e.lineHeight,"&:not(:first-of-type)":{marginTop:A({size:t,sizes:e.spacing})},"&[data-with-icon]":{listStyle:"none",[`& .${Vt("itemWrapper")}`]:{display:"inline-flex",alignItems:r?"center":"flex-start",flexDirection:"row"}}},itemIcon:{display:"inline-block",verticalAlign:"middle",marginRight:e.spacing.sm}}));const aX=iX;var sX=Object.defineProperty,mp=Object.getOwnPropertySymbols,gD=Object.prototype.hasOwnProperty,vD=Object.prototype.propertyIsEnumerable,RP=(e,t,r)=>t in e?sX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lX=(e,t)=>{for(var r in t||(t={}))gD.call(t,r)&&RP(e,r,t[r]);if(mp)for(var r of mp(t))vD.call(t,r)&&RP(e,r,t[r]);return e},cX=(e,t)=>{var r={};for(var n in e)gD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&mp)for(var n of mp(e))t.indexOf(n)<0&&vD.call(e,n)&&(r[n]=e[n]);return r};const uX={},yD=f.forwardRef((e,t)=>{const r=H("ListItem",uX,e),{className:n,children:o,icon:i}=r,a=cX(r,["className","children","icon"]),{icon:l,spacing:c,center:u,listStyleType:d,size:p,withPadding:h,classNames:m,styles:g,unstyled:v,variant:_}=oX(),y=i||l,{classes:x,cx:w}=aX({withPadding:h,listStyleType:d,center:u,spacing:c},{classNames:m,styles:g,unstyled:v,name:"List",variant:_,size:p});return S.createElement(ae,lX({component:"li",className:w(x.item,n),"data-with-icon":!!y||void 0,ref:t},a),S.createElement("div",{className:x.itemWrapper},y&&S.createElement("span",{className:x.itemIcon},y),S.createElement("span",null,o)))});yD.displayName="@mantine/core/ListItem";var dX=Object.defineProperty,fX=Object.defineProperties,pX=Object.getOwnPropertyDescriptors,TP=Object.getOwnPropertySymbols,hX=Object.prototype.hasOwnProperty,mX=Object.prototype.propertyIsEnumerable,IP=(e,t,r)=>t in e?dX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gX=(e,t)=>{for(var r in t||(t={}))hX.call(t,r)&&IP(e,r,t[r]);if(TP)for(var r of TP(t))mX.call(t,r)&&IP(e,r,t[r]);return e},vX=(e,t)=>fX(e,pX(t)),yX=W((e,{withPadding:t,listStyleType:r},{size:n})=>({root:vX(gX({},e.fn.fontStyles()),{listStyleType:r,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:t?e.spacing.xl:0,listStylePosition:"inside"})}));const xX=yX;var wX=Object.defineProperty,gp=Object.getOwnPropertySymbols,xD=Object.prototype.hasOwnProperty,wD=Object.prototype.propertyIsEnumerable,DP=(e,t,r)=>t in e?wX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bX=(e,t)=>{for(var r in t||(t={}))xD.call(t,r)&&DP(e,r,t[r]);if(gp)for(var r of gp(t))wD.call(t,r)&&DP(e,r,t[r]);return e},_X=(e,t)=>{var r={};for(var n in e)xD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&gp)for(var n of gp(e))t.indexOf(n)<0&&wD.call(e,n)&&(r[n]=e[n]);return r};const SX={type:"unordered",size:"md",spacing:0},Er=f.forwardRef((e,t)=>{const r=H("List",SX,e),{children:n,type:o,size:i,listStyleType:a,withPadding:l,center:c,spacing:u,icon:d,className:p,styles:h,classNames:m,unstyled:g,variant:v}=r,_=_X(r,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled","variant"]),{classes:y,cx:x}=xX({withPadding:l,listStyleType:a,center:c,spacing:u},{classNames:m,styles:h,name:"List",unstyled:g,size:i,variant:v});return S.createElement(nX,{value:{spacing:u,center:c,icon:d,listStyleType:a,size:i,withPadding:l,classNames:m,styles:h,unstyled:g,variant:v}},S.createElement(ae,bX({component:o==="unordered"?"ul":"ol",className:x(y.root,p),ref:t},_),n))});Er.Item=yD;Er.displayName="@mantine/core/List";var PX=Object.defineProperty,jX=Object.defineProperties,OX=Object.getOwnPropertyDescriptors,NP=Object.getOwnPropertySymbols,CX=Object.prototype.hasOwnProperty,EX=Object.prototype.propertyIsEnumerable,AP=(e,t,r)=>t in e?PX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$X=(e,t)=>{for(var r in t||(t={}))CX.call(t,r)&&AP(e,r,t[r]);if(NP)for(var r of NP(t))EX.call(t,r)&&AP(e,r,t[r]);return e},kX=(e,t)=>jX(e,OX(t)),RX=W(e=>({root:kX($X({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})}));const TX=RX;var IX=Object.defineProperty,DX=Object.defineProperties,NX=Object.getOwnPropertyDescriptors,vp=Object.getOwnPropertySymbols,bD=Object.prototype.hasOwnProperty,_D=Object.prototype.propertyIsEnumerable,MP=(e,t,r)=>t in e?IX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fu=(e,t)=>{for(var r in t||(t={}))bD.call(t,r)&&MP(e,r,t[r]);if(vp)for(var r of vp(t))_D.call(t,r)&&MP(e,r,t[r]);return e},AX=(e,t)=>DX(e,NX(t)),MX=(e,t)=>{var r={};for(var n in e)bD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&vp)for(var n of vp(e))t.indexOf(n)<0&&_D.call(e,n)&&(r[n]=e[n]);return r};const LX={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:Dn("overlay")},SD=f.forwardRef((e,t)=>{const r=H("LoadingOverlay",LX,e),{className:n,visible:o,loaderProps:i,overlayOpacity:a,overlayColor:l,transitionDuration:c,exitTransitionDuration:u,zIndex:d,style:p,loader:h,radius:m,overlayBlur:g,unstyled:v,variant:_,keepMounted:y}=r,x=MX(r,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:w,cx:b,theme:j}=TX(null,{name:"LoadingOverlay",unstyled:v,variant:_}),C=`calc(${d} + 1)`;return S.createElement(ya,{keepMounted:y,duration:c,exitDuration:u,mounted:o,transition:"fade"},P=>S.createElement(ae,Fu({className:b(w.root,n),style:AX(Fu(Fu({},P),p),{zIndex:d}),ref:t},x),h?S.createElement("div",{style:{zIndex:C}},h):S.createElement(mn,Fu({style:{zIndex:C}},i)),S.createElement(zI,{opacity:a,zIndex:d,radius:m,blur:g,unstyled:v,color:l||(j.colorScheme==="dark"?j.colors.dark[5]:j.white)})))});SD.displayName="@mantine/core/LoadingOverlay";const PD={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[zX,Ac]=No(PD.context);var FX=W(e=>({divider:{marginTop:O(4),marginBottom:O(4),borderTop:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const VX=FX;var BX=Object.defineProperty,yp=Object.getOwnPropertySymbols,jD=Object.prototype.hasOwnProperty,OD=Object.prototype.propertyIsEnumerable,LP=(e,t,r)=>t in e?BX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,UX=(e,t)=>{for(var r in t||(t={}))jD.call(t,r)&&LP(e,r,t[r]);if(yp)for(var r of yp(t))OD.call(t,r)&&LP(e,r,t[r]);return e},WX=(e,t)=>{var r={};for(var n in e)jD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&yp)for(var n of yp(e))t.indexOf(n)<0&&OD.call(e,n)&&(r[n]=e[n]);return r};const HX={},CD=f.forwardRef((e,t)=>{const r=H("MenuDivider",HX,e),{children:n,className:o}=r,i=WX(r,["children","className"]),{classNames:a,styles:l,unstyled:c,variant:u}=Ac(),{classes:d,cx:p}=VX(null,{name:"Menu",classNames:a,styles:l,unstyled:c,variant:u});return S.createElement(ae,UX({className:p(d.divider,o),ref:t},i))});CD.displayName="@mantine/core/MenuDivider";var qX=Object.defineProperty,xp=Object.getOwnPropertySymbols,ED=Object.prototype.hasOwnProperty,$D=Object.prototype.propertyIsEnumerable,zP=(e,t,r)=>t in e?qX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GX=(e,t)=>{for(var r in t||(t={}))ED.call(t,r)&&zP(e,r,t[r]);if(xp)for(var r of xp(t))$D.call(t,r)&&zP(e,r,t[r]);return e},QX=(e,t)=>{var r={};for(var n in e)ED.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&xp)for(var n of xp(e))t.indexOf(n)<0&&$D.call(e,n)&&(r[n]=e[n]);return r};const KX={};function kD(e){const t=H("MenuDropdown",KX,e),{children:r,onMouseEnter:n,onMouseLeave:o}=t,i=QX(t,["children","onMouseEnter","onMouseLeave"]),a=f.useRef(),l=Ac(),c=p=>{var h;(p.key==="ArrowUp"||p.key==="ArrowDown")&&(p.preventDefault(),(h=a.current.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||h.focus())},u=Hr(n,()=>l.trigger==="hover"&&l.openDropdown()),d=Hr(o,()=>l.trigger==="hover"&&l.closeDropdown());return S.createElement(zo.Dropdown,GX({onMouseEnter:u,onMouseLeave:d,role:"menu","aria-orientation":"vertical"},i),S.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:c,ref:a,style:{outline:0}},r))}kD.displayName="@mantine/core/MenuDropdown";var YX=Object.defineProperty,XX=Object.defineProperties,JX=Object.getOwnPropertyDescriptors,FP=Object.getOwnPropertySymbols,ZX=Object.prototype.hasOwnProperty,eJ=Object.prototype.propertyIsEnumerable,VP=(e,t,r)=>t in e?YX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tJ=(e,t)=>{for(var r in t||(t={}))ZX.call(t,r)&&VP(e,r,t[r]);if(FP)for(var r of FP(t))eJ.call(t,r)&&VP(e,r,t[r]);return e},rJ=(e,t)=>XX(e,JX(t)),nJ=W((e,{color:t,radius:r})=>({item:rJ(tJ({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs} ${e.spacing.sm}`,cursor:"pointer",borderRadius:e.fn.radius(r),color:t?e.fn.variant({variant:"filled",primaryFallback:!1,color:t}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:t?e.fn.variant({variant:"light",color:t}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[1]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}}));const oJ=nJ;var iJ=Object.defineProperty,aJ=Object.defineProperties,sJ=Object.getOwnPropertyDescriptors,wp=Object.getOwnPropertySymbols,RD=Object.prototype.hasOwnProperty,TD=Object.prototype.propertyIsEnumerable,BP=(e,t,r)=>t in e?iJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lJ=(e,t)=>{for(var r in t||(t={}))RD.call(t,r)&&BP(e,r,t[r]);if(wp)for(var r of wp(t))TD.call(t,r)&&BP(e,r,t[r]);return e},cJ=(e,t)=>aJ(e,sJ(t)),uJ=(e,t)=>{var r={};for(var n in e)RD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&wp)for(var n of wp(e))t.indexOf(n)<0&&TD.call(e,n)&&(r[n]=e[n]);return r};const dJ={},ID=f.forwardRef((e,t)=>{const r=H("MenuItem",dJ,e),{children:n,className:o,color:i,closeMenuOnClick:a,icon:l,rightSection:c}=r,u=uJ(r,["children","className","color","closeMenuOnClick","icon","rightSection"]),d=Ac(),{classes:p,cx:h,theme:m}=oJ({radius:d.radius,color:i},{name:"Menu",classNames:d.classNames,styles:d.styles,unstyled:d.unstyled,variant:d.variant}),g=f.useRef(),v=d.getItemIndex(g.current),_=u,y=Hr(_.onMouseLeave,()=>d.setHovered(-1)),x=Hr(_.onMouseEnter,()=>d.setHovered(d.getItemIndex(g.current))),w=Hr(_.onClick,()=>{typeof a=="boolean"?a&&d.closeDropdownImmediately():d.closeOnItemClick&&d.closeDropdownImmediately()}),b=Hr(_.onFocus,()=>d.setHovered(d.getItemIndex(g.current)));return S.createElement(ae,cJ(lJ({component:"button",type:"button"},u),{tabIndex:-1,onFocus:b,className:h(p.item,o),ref:Ds(g,t),role:"menuitem","data-menu-item":!0,"data-hovered":d.hovered===v?!0:void 0,onMouseEnter:x,onMouseLeave:y,onClick:w,onKeyDown:AE({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:d.loop,dir:m.dir,orientation:"vertical",onKeyDown:_.onKeydown})}),l&&S.createElement("div",{className:p.itemIcon},l),n&&S.createElement("div",{className:p.itemLabel},n),c&&S.createElement("div",{className:p.itemRightSection},c))});ID.displayName="@mantine/core/MenuItem";const fJ=ID;var pJ=W(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs} / 2) ${e.spacing.sm}`,cursor:"default"}}));const hJ=pJ;var mJ=Object.defineProperty,bp=Object.getOwnPropertySymbols,DD=Object.prototype.hasOwnProperty,ND=Object.prototype.propertyIsEnumerable,UP=(e,t,r)=>t in e?mJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gJ=(e,t)=>{for(var r in t||(t={}))DD.call(t,r)&&UP(e,r,t[r]);if(bp)for(var r of bp(t))ND.call(t,r)&&UP(e,r,t[r]);return e},vJ=(e,t)=>{var r={};for(var n in e)DD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&bp)for(var n of bp(e))t.indexOf(n)<0&&ND.call(e,n)&&(r[n]=e[n]);return r};const yJ={},AD=f.forwardRef((e,t)=>{const r=H("MenuLabel",yJ,e),{children:n,className:o}=r,i=vJ(r,["children","className"]),{classNames:a,styles:l,unstyled:c,variant:u}=Ac(),{classes:d,cx:p}=hJ(null,{name:"Menu",classNames:a,styles:l,unstyled:c,variant:u});return S.createElement(oe,gJ({className:p(d.label,o),ref:t},i),n)});AD.displayName="@mantine/core/MenuLabel";var xJ=Object.defineProperty,_p=Object.getOwnPropertySymbols,MD=Object.prototype.hasOwnProperty,LD=Object.prototype.propertyIsEnumerable,WP=(e,t,r)=>t in e?xJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wJ=(e,t)=>{for(var r in t||(t={}))MD.call(t,r)&&WP(e,r,t[r]);if(_p)for(var r of _p(t))LD.call(t,r)&&WP(e,r,t[r]);return e},bJ=(e,t)=>{var r={};for(var n in e)MD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&_p)for(var n of _p(e))t.indexOf(n)<0&&LD.call(e,n)&&(r[n]=e[n]);return r};const _J={refProp:"ref"},zD=f.forwardRef((e,t)=>{const r=H("MenuTarget",_J,e),{children:n,refProp:o}=r,i=bJ(r,["children","refProp"]);if(!Ts(n))throw new Error(PD.children);const a=Ac(),l=Hr(n.props.onClick,()=>a.trigger==="click"&&a.toggleDropdown()),c=Hr(n.props.onMouseEnter,()=>a.trigger==="hover"&&a.openDropdown()),u=Hr(n.props.onMouseLeave,()=>a.trigger==="hover"&&a.closeDropdown());return S.createElement(zo.Target,wJ({refProp:o,popupType:"menu",ref:t},i),f.cloneElement(n,{onClick:l,onMouseEnter:c,onMouseLeave:u,"data-expanded":a.opened?!0:void 0}))});zD.displayName="@mantine/core/MenuTarget";var SJ=W({dropdown:{padding:O(4)}});const PJ=SJ;var jJ=Object.defineProperty,OJ=Object.defineProperties,CJ=Object.getOwnPropertyDescriptors,Sp=Object.getOwnPropertySymbols,FD=Object.prototype.hasOwnProperty,VD=Object.prototype.propertyIsEnumerable,HP=(e,t,r)=>t in e?jJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qP=(e,t)=>{for(var r in t||(t={}))FD.call(t,r)&&HP(e,r,t[r]);if(Sp)for(var r of Sp(t))VD.call(t,r)&&HP(e,r,t[r]);return e},GP=(e,t)=>OJ(e,CJ(t)),EJ=(e,t)=>{var r={};for(var n in e)FD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Sp)for(var n of Sp(e))t.indexOf(n)<0&&VD.call(e,n)&&(r[n]=e[n]);return r};const $J={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function Z(e){const t=H("Menu",$J,e),{children:r,onOpen:n,onClose:o,opened:i,defaultOpened:a,onChange:l,closeOnItemClick:c,loop:u,closeOnEscape:d,trigger:p,openDelay:h,closeDelay:m,classNames:g,styles:v,unstyled:_,radius:y,variant:x}=t,w=EJ(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:b,cx:j}=PJ(),[C,{setHovered:P,resetHovered:E}]=G9(),[k,$]=Ir({value:i,defaultValue:a,finalValue:!1,onChange:l}),I=()=>{$(!1),k&&(o==null||o())},R=()=>{$(!0),!k&&(n==null||n())},N=()=>k?I():R(),{openDropdown:M,closeDropdown:L}=EY({open:R,close:I,closeDelay:m,openDelay:h}),Q=G=>W9("[data-menu-item]","[data-menu-dropdown]",G);return cn(()=>{E()},[k]),S.createElement(zX,{value:{opened:k,toggleDropdown:N,getItemIndex:Q,hovered:C,setHovered:P,closeOnItemClick:c,closeDropdown:p==="click"?I:L,openDropdown:p==="click"?R:M,closeDropdownImmediately:I,loop:u,trigger:p,radius:y,classNames:g,styles:v,unstyled:_,variant:x}},S.createElement(zo,GP(qP({},w),{radius:y,opened:k,onChange:N,defaultOpened:a,trapFocus:p==="click",closeOnEscape:d&&p==="click",__staticSelector:"Menu",classNames:GP(qP({},g),{dropdown:j(b.dropdown,g==null?void 0:g.dropdown)}),styles:v,unstyled:_,variant:x}),r))}Z.displayName="@mantine/core/Menu";Z.Item=fJ;Z.Label=AD;Z.Dropdown=kD;Z.Target=zD;Z.Divider=CD;const[kJ,RJ]=No("Modal component was not found in tree"),TJ={xs:O(320),sm:O(380),md:O(440),lg:O(620),xl:O(780)};var IJ=W((e,{yOffset:t,xOffset:r,centered:n,fullScreen:o},{size:i})=>({content:{flex:o?"0 0 100%":`0 0 ${A({size:i,sizes:TJ})}`,maxWidth:"100%",maxHeight:o?void 0:`calc(100dvh - (${O(t)} * 2))`,height:o?"100vh":void 0,borderRadius:o?0:void 0,overflowY:"auto"},inner:{paddingTop:o?0:t,paddingBottom:o?0:t,paddingLeft:o?0:r,paddingRight:o?0:r,display:"flex",justifyContent:"center",alignItems:n?"center":"flex-start"}}));const DJ=IJ;var NJ=Object.defineProperty,AJ=Object.defineProperties,MJ=Object.getOwnPropertyDescriptors,Pp=Object.getOwnPropertySymbols,BD=Object.prototype.hasOwnProperty,UD=Object.prototype.propertyIsEnumerable,QP=(e,t,r)=>t in e?NJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hy=(e,t)=>{for(var r in t||(t={}))BD.call(t,r)&&QP(e,r,t[r]);if(Pp)for(var r of Pp(t))UD.call(t,r)&&QP(e,r,t[r]);return e},WD=(e,t)=>AJ(e,MJ(t)),LJ=(e,t)=>{var r={};for(var n in e)BD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pp)for(var n of Pp(e))t.indexOf(n)<0&&UD.call(e,n)&&(r[n]=e[n]);return r};const zJ=WD(hy({},mx),{yOffset:"5dvh",xOffset:"5vw"});function HD(e){const t=H("ModalRoot",zJ,e),{classNames:r,variant:n,size:o,yOffset:i,xOffset:a,scrollAreaComponent:l,radius:c,centered:u,fullScreen:d}=t,p=LJ(t,["classNames","variant","size","yOffset","xOffset","scrollAreaComponent","radius","centered","fullScreen"]),{classes:h,cx:m}=DJ({yOffset:i,xOffset:a,centered:u,fullScreen:d},{name:"Modal",variant:n,size:o});return S.createElement(kJ,{value:{yOffset:i,scrollAreaComponent:l,radius:c}},S.createElement(kt,hy({__staticSelector:"Modal",size:o,variant:n,classNames:WD(hy({},r),{content:m(h.content,r==null?void 0:r.content),inner:m(h.inner,r==null?void 0:r.inner)})},p)))}var FJ=Object.defineProperty,jp=Object.getOwnPropertySymbols,qD=Object.prototype.hasOwnProperty,GD=Object.prototype.propertyIsEnumerable,KP=(e,t,r)=>t in e?FJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VJ=(e,t)=>{for(var r in t||(t={}))qD.call(t,r)&&KP(e,r,t[r]);if(jp)for(var r of jp(t))GD.call(t,r)&&KP(e,r,t[r]);return e},BJ=(e,t)=>{var r={};for(var n in e)qD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&jp)for(var n of jp(e))t.indexOf(n)<0&&GD.call(e,n)&&(r[n]=e[n]);return r};const UJ={shadow:"xl"},QD=f.forwardRef((e,t)=>{const r=H("ModalContent",UJ,e),{children:n,scrollAreaComponent:o}=r,i=BJ(r,["children","scrollAreaComponent"]),a=RJ(),l=o||a.scrollAreaComponent||kt.NativeScrollArea;return S.createElement(kt.Content,VJ({ref:t,radius:a.radius},i),S.createElement(l,{style:{maxHeight:`calc(100dvh - (${O(a.yOffset)} * 2))`}},n))});var WJ=Object.defineProperty,HJ=Object.defineProperties,qJ=Object.getOwnPropertyDescriptors,Op=Object.getOwnPropertySymbols,KD=Object.prototype.hasOwnProperty,YD=Object.prototype.propertyIsEnumerable,YP=(e,t,r)=>t in e?WJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wd=(e,t)=>{for(var r in t||(t={}))KD.call(t,r)&&YP(e,r,t[r]);if(Op)for(var r of Op(t))YD.call(t,r)&&YP(e,r,t[r]);return e},GJ=(e,t)=>HJ(e,qJ(t)),QJ=(e,t)=>{var r={};for(var n in e)KD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Op)for(var n of Op(e))t.indexOf(n)<0&&YD.call(e,n)&&(r[n]=e[n]);return r};const KJ=GJ(wd({},mx),{transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0});function Mr(e){const t=H("Modal",KJ,e),{title:r,withOverlay:n,overlayProps:o,withCloseButton:i,closeButtonProps:a,children:l}=t,c=QJ(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!r||i;return S.createElement(HD,wd({},c),n&&S.createElement(kt.Overlay,wd({},o)),S.createElement(QD,null,u&&S.createElement(kt.Header,null,r&&S.createElement(kt.Title,null,r),i&&S.createElement(kt.CloseButton,wd({},a))),S.createElement(kt.Body,null,l)))}Mr.Root=HD;Mr.CloseButton=kt.CloseButton;Mr.Overlay=kt.Overlay;Mr.Content=QD;Mr.Header=kt.Header;Mr.Title=kt.Title;Mr.Body=kt.Body;Mr.NativeScrollArea=kt.NativeScrollArea;const XD={xs:O(16),sm:O(22),md:O(26),lg:O(30),xl:O(36)},YJ={xs:O(10),sm:O(12),md:O(14),lg:O(16),xl:O(18)};var XJ=W((e,{disabled:t,radius:r,readOnly:n},{size:o,variant:i})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:i==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:A({size:o,sizes:XD}),paddingLeft:`calc(${A({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||n?A({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:A({size:o,sizes:YJ}),borderRadius:A({size:r,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${O(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${A({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}})),JJ=Object.defineProperty,Cp=Object.getOwnPropertySymbols,JD=Object.prototype.hasOwnProperty,ZD=Object.prototype.propertyIsEnumerable,XP=(e,t,r)=>t in e?JJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZJ=(e,t)=>{for(var r in t||(t={}))JD.call(t,r)&&XP(e,r,t[r]);if(Cp)for(var r of Cp(t))ZD.call(t,r)&&XP(e,r,t[r]);return e},eZ=(e,t)=>{var r={};for(var n in e)JD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cp)for(var n of Cp(e))t.indexOf(n)<0&&ZD.call(e,n)&&(r[n]=e[n]);return r};const tZ={xs:16,sm:22,md:24,lg:26,xl:30};function eN(e){var t=e,{label:r,classNames:n,styles:o,className:i,onRemove:a,disabled:l,readOnly:c,size:u,radius:d="sm",variant:p,unstyled:h}=t,m=eZ(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:g,cx:v}=XJ({disabled:l,readOnly:c,radius:d},{name:"MultiSelect",classNames:n,styles:o,unstyled:h,size:u,variant:p});return S.createElement("div",ZJ({className:v(g.defaultValue,i)},m),S.createElement("span",{className:g.defaultValueLabel},r),!l&&!c&&S.createElement(kc,{"aria-hidden":!0,onMouseDown:a,size:tZ[u],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:g.defaultValueRemove,tabIndex:-1,unstyled:h}))}eN.displayName="@mantine/core/MultiSelect/DefaultValue";function rZ({data:e,searchable:t,limit:r,searchValue:n,filter:o,value:i,disableSelectedItemFiltering:a}){if(!t&&i.length===0)return e;if(!t){const c=[];for(let u=0;u<e.length;u+=1)(a||!i.some(d=>d===e[u].value&&!e[u].disabled))&&c.push(e[u]);return c}const l=[];for(let c=0;c<e.length&&(o(n,!a&&i.some(u=>u===e[c].value&&!e[c].disabled),e[c])&&l.push(e[c]),!(l.length>=r));c+=1);return l}var nZ=Object.defineProperty,Ep=Object.getOwnPropertySymbols,tN=Object.prototype.hasOwnProperty,rN=Object.prototype.propertyIsEnumerable,JP=(e,t,r)=>t in e?nZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZP=(e,t)=>{for(var r in t||(t={}))tN.call(t,r)&&JP(e,r,t[r]);if(Ep)for(var r of Ep(t))rN.call(t,r)&&JP(e,r,t[r]);return e},oZ=(e,t)=>{var r={};for(var n in e)tN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ep)for(var n of Ep(e))t.indexOf(n)<0&&rN.call(e,n)&&(r[n]=e[n]);return r};const iZ={xs:O(14),sm:O(18),md:O(20),lg:O(24),xl:O(28)};function aZ(e){var t=e,{size:r,error:n,style:o}=t,i=oZ(t,["size","error","style"]);const a=Ht(),l=A({size:r,sizes:iZ});return S.createElement("svg",ZP({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:ZP({color:n?a.colors.red[6]:a.colors.gray[6],width:l,height:l},o),"data-chevron":!0},i),S.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var sZ=Object.defineProperty,lZ=Object.defineProperties,cZ=Object.getOwnPropertyDescriptors,ej=Object.getOwnPropertySymbols,uZ=Object.prototype.hasOwnProperty,dZ=Object.prototype.propertyIsEnumerable,tj=(e,t,r)=>t in e?sZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fZ=(e,t)=>{for(var r in t||(t={}))uZ.call(t,r)&&tj(e,r,t[r]);if(ej)for(var r of ej(t))dZ.call(t,r)&&tj(e,r,t[r]);return e},pZ=(e,t)=>lZ(e,cZ(t));function nN({shouldClear:e,clearButtonProps:t,onClear:r,size:n,error:o}){return e?S.createElement(kc,pZ(fZ({},t),{variant:"transparent",onClick:r,size:n,onMouseDown:i=>i.preventDefault()})):S.createElement(aZ,{error:o,size:n})}nN.displayName="@mantine/core/SelectRightSection";var hZ=Object.defineProperty,mZ=Object.defineProperties,gZ=Object.getOwnPropertyDescriptors,$p=Object.getOwnPropertySymbols,oN=Object.prototype.hasOwnProperty,iN=Object.prototype.propertyIsEnumerable,rj=(e,t,r)=>t in e?hZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ng=(e,t)=>{for(var r in t||(t={}))oN.call(t,r)&&rj(e,r,t[r]);if($p)for(var r of $p(t))iN.call(t,r)&&rj(e,r,t[r]);return e},nj=(e,t)=>mZ(e,gZ(t)),vZ=(e,t)=>{var r={};for(var n in e)oN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$p)for(var n of $p(e))t.indexOf(n)<0&&iN.call(e,n)&&(r[n]=e[n]);return r};function aN(e){var t=e,{styles:r,rightSection:n,rightSectionWidth:o,theme:i}=t,a=vZ(t,["styles","rightSection","rightSectionWidth","theme"]);if(n)return{rightSection:n,rightSectionWidth:o,styles:r};const l=typeof r=="function"?r(i):r;return{rightSection:!a.readOnly&&!(a.disabled&&a.shouldClear)&&S.createElement(nN,Ng({},a)),styles:nj(Ng({},l),{rightSection:nj(Ng({},l==null?void 0:l.rightSection),{pointerEvents:a.shouldClear?void 0:"none"})})}}var yZ=Object.defineProperty,xZ=Object.defineProperties,wZ=Object.getOwnPropertyDescriptors,oj=Object.getOwnPropertySymbols,bZ=Object.prototype.hasOwnProperty,_Z=Object.prototype.propertyIsEnumerable,ij=(e,t,r)=>t in e?yZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SZ=(e,t)=>{for(var r in t||(t={}))bZ.call(t,r)&&ij(e,r,t[r]);if(oj)for(var r of oj(t))_Z.call(t,r)&&ij(e,r,t[r]);return e},PZ=(e,t)=>xZ(e,wZ(t)),jZ=W((e,{invalid:t},{size:r})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${A({size:r,sizes:Et})} - ${O(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:A({size:r,sizes:Et})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${O(2)}) calc(${e.spacing.xs} / 2)`},searchInput:PZ(SZ({},e.fn.fontStyles()),{flex:1,minWidth:O(60),backgroundColor:"transparent",border:0,outline:0,fontSize:A({size:r,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:A({size:r,sizes:XD}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const OZ=jZ;var CZ=Object.defineProperty,EZ=Object.defineProperties,$Z=Object.getOwnPropertyDescriptors,kp=Object.getOwnPropertySymbols,sN=Object.prototype.hasOwnProperty,lN=Object.prototype.propertyIsEnumerable,aj=(e,t,r)=>t in e?CZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Da=(e,t)=>{for(var r in t||(t={}))sN.call(t,r)&&aj(e,r,t[r]);if(kp)for(var r of kp(t))lN.call(t,r)&&aj(e,r,t[r]);return e},sj=(e,t)=>EZ(e,$Z(t)),kZ=(e,t)=>{var r={};for(var n in e)sN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kp)for(var n of kp(e))t.indexOf(n)<0&&lN.call(e,n)&&(r[n]=e[n]);return r};function RZ(e,t,r){return t?!1:r.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function TZ(e,t){return!!e&&!t.some(r=>r.value.toLowerCase()===e.toLowerCase())}function lj(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const r=t.map(n=>typeof n=="object"?n.value:n);return e.filter(n=>r.includes(n))}const IZ={size:"sm",valueComponent:eN,itemComponent:bR,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:RZ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:TZ,switchDirectionOnFlip:!1,zIndex:Dn("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},fm=f.forwardRef((e,t)=>{const r=H("MultiSelect",IZ,e),{className:n,style:o,required:i,label:a,description:l,size:c,error:u,classNames:d,styles:p,wrapperProps:h,value:m,defaultValue:g,data:v,onChange:_,valueComponent:y,itemComponent:x,id:w,transitionProps:b,maxDropdownHeight:j,shadow:C,nothingFound:P,onFocus:E,onBlur:k,searchable:$,placeholder:I,filter:R,limit:N,clearSearchOnChange:M,clearable:L,clearSearchOnBlur:Q,variant:G,onSearchChange:T,searchValue:F,disabled:V,initiallyOpened:X,radius:J,icon:_e,rightSection:Se,rightSectionWidth:Xe,creatable:Le,getCreateLabel:gt,shouldCreate:Nt,onCreate:ke,sx:qt,dropdownComponent:zr,onDropdownClose:cr,onDropdownOpen:Gt,maxSelectedValues:At,withinPortal:co,portalProps:Uo,switchDirectionOnFlip:tt,zIndex:uo,selectOnBlur:Sr,name:ur,dropdownPosition:Di,errorProps:en,labelProps:fo,descriptionProps:ee,form:me,positionDependencies:ft,onKeyDown:Ue,unstyled:bt,inputContainer:An,inputWrapperOrder:yn,readOnly:Fr,withAsterisk:Wo,clearButtonProps:Mn,hoverOnSearchChange:Ln,disableSelectedItemFiltering:po}=r,Ni=kZ(r,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:dr,cx:Ho,theme:ja}=OZ({invalid:!!u},{name:"MultiSelect",classNames:d,styles:p,unstyled:bt,size:c,variant:G}),{systemStyles:Wm,rest:D}=ao(Ni),z=f.useRef(),U=f.useRef({}),Y=Ar(w),[te,ge]=f.useState(X),[xe,he]=f.useState(-1),[pe,Re]=f.useState("column"),[Qe,Oe]=Ir({value:F,defaultValue:"",finalValue:void 0,onChange:T}),[Ke,rt]=f.useState(!1),{scrollIntoView:Tt,targetRef:Vr,scrollableRef:Ai}=ML({duration:0,offset:5,cancelable:!1,isList:!0}),Oa=Le&&typeof gt=="function";let zn=null;const Br=v.map(ye=>typeof ye=="string"?{label:ye,value:ye}:ye),qo=Q9({data:Br}),[nt,Fn]=Ir({value:lj(m,v),defaultValue:lj(g,v),finalValue:[],onChange:_}),fr=f.useRef(!!At&&At<nt.length),ho=ye=>{if(!Fr){const ot=nt.filter(tn=>tn!==ye);Fn(ot),At&&ot.length<At&&(fr.current=!1)}},Ye=ye=>{Oe(ye.currentTarget.value),!V&&!fr.current&&$&&ge(!0)},Pr=ye=>{typeof E=="function"&&E(ye),!V&&!fr.current&&$&&ge(!0)},Ee=rZ({data:qo,searchable:$,searchValue:Qe,limit:N,filter:R,value:nt,disableSelectedItemFiltering:po});Oa&&Nt(Qe,qo)&&(zn=gt(Qe),Ee.push({label:Qe,value:Qe,creatable:!0}));const pr=Math.min(xe,Ee.length-1),qs=(ye,ot,tn)=>{let Go=ye;for(;tn(Go);)if(Go=ot(Go),!Ee[Go].disabled)return Go;return ye};cn(()=>{he(Ln&&Qe?0:-1)},[Qe,Ln]),cn(()=>{!V&&nt.length>v.length&&ge(!1),At&&nt.length<At&&(fr.current=!1),At&&nt.length>=At&&(fr.current=!0,ge(!1))},[nt]);const Ca=ye=>{if(!Fr)if(M&&Oe(""),nt.includes(ye.value))ho(ye.value);else{if(ye.creatable&&typeof ke=="function"){const ot=ke(ye.value);typeof ot<"u"&&ot!==null&&Fn(typeof ot=="string"?[...nt,ot]:[...nt,ot.value])}else Fn([...nt,ye.value]);nt.length===At-1&&(fr.current=!0,ge(!1)),Ee.length===1&&ge(!1)}},DA=ye=>{typeof k=="function"&&k(ye),Sr&&Ee[pr]&&te&&Ca(Ee[pr]),Q&&Oe(""),ge(!1)},NA=ye=>{if(Ke||(Ue==null||Ue(ye),Fr)||ye.key!=="Backspace"&&At&&fr.current)return;const ot=pe==="column",tn=()=>{he(Mi=>{var mo;const Gs=qs(Mi,Li=>Li+1,Li=>Li<Ee.length-1);return te&&(Vr.current=U.current[(mo=Ee[Gs])==null?void 0:mo.value],Tt({alignment:ot?"end":"start"})),Gs})},Go=()=>{he(Mi=>{var mo;const Gs=qs(Mi,Li=>Li-1,Li=>Li>0);return te&&(Vr.current=U.current[(mo=Ee[Gs])==null?void 0:mo.value],Tt({alignment:ot?"start":"end"})),Gs})};switch(ye.key){case"ArrowUp":{ye.preventDefault(),ge(!0),ot?Go():tn();break}case"ArrowDown":{ye.preventDefault(),ge(!0),ot?tn():Go();break}case"Enter":{ye.preventDefault(),Ee[pr]&&te?Ca(Ee[pr]):ge(!0);break}case" ":{$||(ye.preventDefault(),Ee[pr]&&te?Ca(Ee[pr]):ge(!0));break}case"Backspace":{nt.length>0&&Qe.length===0&&(Fn(nt.slice(0,-1)),ge(!0),At&&(fr.current=!1));break}case"Home":{if(!$){ye.preventDefault(),te||ge(!0);const Mi=Ee.findIndex(mo=>!mo.disabled);he(Mi),Tt({alignment:ot?"end":"start"})}break}case"End":{if(!$){ye.preventDefault(),te||ge(!0);const Mi=Ee.map(mo=>!!mo.disabled).lastIndexOf(!1);he(Mi),Tt({alignment:ot?"end":"start"})}break}case"Escape":ge(!1)}},AA=nt.map(ye=>{let ot=qo.find(tn=>tn.value===ye&&!tn.disabled);return!ot&&Oa&&(ot={value:ye,label:ye}),ot}).filter(ye=>!!ye).map((ye,ot)=>S.createElement(y,sj(Da({},ye),{variant:G,disabled:V,className:dr.value,readOnly:Fr,onRemove:tn=>{tn.preventDefault(),tn.stopPropagation(),ho(ye.value)},key:ye.value,size:c,styles:p,classNames:d,radius:J,index:ot}))),MA=ye=>nt.includes(ye),LA=()=>{var ye;Oe(""),Fn([]),(ye=z.current)==null||ye.focus(),At&&(fr.current=!1)},eu=!Fr&&(Ee.length>0?te:te&&!!P);return cn(()=>{const ye=eu?Gt:cr;typeof ye=="function"&&ye()},[eu]),S.createElement(Ut.Wrapper,Da(Da({required:i,id:Y,label:a,error:u,description:l,size:c,className:n,style:o,classNames:d,styles:p,__staticSelector:"MultiSelect",sx:qt,errorProps:en,descriptionProps:ee,labelProps:fo,inputContainer:An,inputWrapperOrder:yn,unstyled:bt,withAsterisk:Wo,variant:G},Wm),h),S.createElement(Vl,{opened:eu,transitionProps:b,shadow:"sm",withinPortal:co,portalProps:Uo,__staticSelector:"MultiSelect",onDirectionChange:Re,switchDirectionOnFlip:tt,zIndex:uo,dropdownPosition:Di,positionDependencies:[...ft,Qe],classNames:d,styles:p,unstyled:bt,variant:G},S.createElement(Vl.Target,null,S.createElement("div",{className:dr.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":te&&eu?`${Y}-items`:null,"aria-controls":Y,"aria-expanded":te,onMouseLeave:()=>he(-1),tabIndex:-1},S.createElement("input",{type:"hidden",name:ur,value:nt.join(","),form:me,disabled:V}),S.createElement(Ut,Da({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:c,variant:G,disabled:V,error:u,required:i,radius:J,icon:_e,unstyled:bt,onMouseDown:ye=>{var ot;ye.preventDefault(),!V&&!fr.current&&ge(!te),(ot=z.current)==null||ot.focus()},classNames:sj(Da({},d),{input:Ho({[dr.input]:!$},d==null?void 0:d.input)})},aN({theme:ja,rightSection:Se,rightSectionWidth:Xe,styles:p,size:c,shouldClear:L&&nt.length>0,onClear:LA,error:u,disabled:V,clearButtonProps:Mn,readOnly:Fr})),S.createElement("div",{className:dr.values,"data-clearable":L||void 0},AA,S.createElement("input",Da({ref:Ds(t,z),type:"search",id:Y,className:Ho(dr.searchInput,{[dr.searchInputPointer]:!$,[dr.searchInputInputHidden]:!te&&nt.length>0||!$&&nt.length>0,[dr.searchInputEmpty]:nt.length===0}),onKeyDown:NA,value:Qe,onChange:Ye,onFocus:Pr,onBlur:DA,readOnly:!$||fr.current||Fr,placeholder:nt.length===0?I:void 0,disabled:V,"data-mantine-stop-propagation":te,autoComplete:"off",onCompositionStart:()=>rt(!0),onCompositionEnd:()=>rt(!1)},D)))))),S.createElement(Vl.Dropdown,{component:zr||K0,maxHeight:j,direction:pe,id:Y,innerRef:Ai,__staticSelector:"MultiSelect",classNames:d,styles:p},S.createElement(yR,{data:Ee,hovered:pr,classNames:d,styles:p,uuid:Y,__staticSelector:"MultiSelect",onItemHover:he,onItemSelect:Ca,itemsRefs:U,itemComponent:x,size:c,nothingFound:P,isItemSelected:MA,creatable:Le&&!!zn,createLabel:zn,unstyled:bt,variant:G}))))});fm.displayName="@mantine/core/MultiSelect";var DZ=Object.defineProperty,NZ=Object.defineProperties,AZ=Object.getOwnPropertyDescriptors,Rp=Object.getOwnPropertySymbols,cN=Object.prototype.hasOwnProperty,uN=Object.prototype.propertyIsEnumerable,cj=(e,t,r)=>t in e?DZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vu=(e,t)=>{for(var r in t||(t={}))cN.call(t,r)&&cj(e,r,t[r]);if(Rp)for(var r of Rp(t))uN.call(t,r)&&cj(e,r,t[r]);return e},uj=(e,t)=>NZ(e,AZ(t)),MZ=(e,t)=>{var r={};for(var n in e)cN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Rp)for(var n of Rp(e))t.indexOf(n)<0&&uN.call(e,n)&&(r[n]=e[n]);return r};const LZ={size:"sm"},mt=f.forwardRef((e,t)=>{const r=bT("NativeSelect",LZ,e),{inputProps:n,wrapperProps:o,data:i,onChange:a,value:l,classNames:c,styles:u,rightSection:d,rightSectionWidth:p}=r,h=MZ(r,["inputProps","wrapperProps","data","onChange","value","classNames","styles","rightSection","rightSectionWidth"]),m=Ht(),v=i.map(_=>typeof _=="string"?{label:_,value:_}:_).map(_=>S.createElement("option",{key:_.value,value:_.value,disabled:_.disabled},_.label));return S.createElement(Ut.Wrapper,uj(Vu({},o),{__staticSelector:"NativeSelect"}),S.createElement(Ut,Vu(uj(Vu(Vu({},n),h),{onChange:a,component:"select",ref:t,value:l===null?"":l,__staticSelector:"NativeSelect",pointer:m.cursorType==="pointer"}),aN({theme:m,rightSection:d,rightSectionWidth:p,styles:u,shouldClear:!1,size:n.size,error:o.error,readOnly:!1})),v))});mt.displayName="@mantine/core/NativeSelect";var zZ=W((e,{color:t,radius:r,withTitle:n})=>{const o=e.fn.radius(r),i=e.fn.variant({variant:"filled",color:t});return{closeButton:e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0]}),icon:{boxSizing:"border-box",marginRight:e.spacing.md,width:O(28),height:O(28),borderRadius:O(28),display:"flex",flex:"none",alignItems:"center",justifyContent:"center",backgroundColor:i.background,color:e.white},root:{overflow:"hidden",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",paddingLeft:O(22),paddingRight:e.spacing.xs,paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs,borderRadius:o,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,boxShadow:e.shadows.lg,"&::before":{content:'""',display:"block",position:"absolute",width:O(6),top:o,bottom:o,left:O(4),borderRadius:o,backgroundColor:i.background},"&[data-with-icon]":{paddingLeft:e.spacing.xs,"&::before":{display:"none"}},"&[data-with-border]":{border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}},body:{flex:1,overflow:"hidden",marginRight:e.spacing.xs},loader:{marginRight:e.spacing.md},title:{lineHeight:1.4,marginBottom:O(2),overflow:"hidden",textOverflow:"ellipsis",color:e.colorScheme==="dark"?e.white:e.colors.gray[9]},description:{color:n?e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis"}}});const FZ=zZ;var VZ=Object.defineProperty,BZ=Object.defineProperties,UZ=Object.getOwnPropertyDescriptors,Tp=Object.getOwnPropertySymbols,dN=Object.prototype.hasOwnProperty,fN=Object.prototype.propertyIsEnumerable,dj=(e,t,r)=>t in e?VZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fj=(e,t)=>{for(var r in t||(t={}))dN.call(t,r)&&dj(e,r,t[r]);if(Tp)for(var r of Tp(t))fN.call(t,r)&&dj(e,r,t[r]);return e},WZ=(e,t)=>BZ(e,UZ(t)),HZ=(e,t)=>{var r={};for(var n in e)dN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Tp)for(var n of Tp(e))t.indexOf(n)<0&&fN.call(e,n)&&(r[n]=e[n]);return r};const qZ={withCloseButton:!0},pN=f.forwardRef((e,t)=>{const r=H("Notification",qZ,e),{className:n,color:o,radius:i,loading:a,withCloseButton:l,withBorder:c,title:u,icon:d,children:p,onClose:h,closeButtonProps:m,classNames:g,styles:v,unstyled:_,variant:y}=r,x=HZ(r,["className","color","radius","loading","withCloseButton","withBorder","title","icon","children","onClose","closeButtonProps","classNames","styles","unstyled","variant"]),{classes:w,cx:b}=FZ({color:o,radius:i,withTitle:!!u},{name:"Notification",classNames:g,styles:v,unstyled:_,variant:y});return S.createElement(ae,fj({className:b(w.root,n),"data-with-icon":!!d||a||void 0,"data-with-border":c||void 0,role:"alert",ref:t},x),d&&!a&&S.createElement("div",{className:w.icon},d),a&&S.createElement(mn,{size:28,color:o,className:w.loader}),S.createElement("div",{className:w.body},u&&S.createElement(oe,{className:w.title,size:"sm",weight:500},u),S.createElement(oe,{color:"dimmed",className:w.description,size:"sm"},p)),l&&S.createElement(kc,WZ(fj({iconSize:16,color:"gray"},m),{onClick:h,className:w.closeButton})))});pN.displayName="@mantine/core/Notification";var GZ=Object.defineProperty,QZ=Object.defineProperties,KZ=Object.getOwnPropertyDescriptors,Ip=Object.getOwnPropertySymbols,hN=Object.prototype.hasOwnProperty,mN=Object.prototype.propertyIsEnumerable,pj=(e,t,r)=>t in e?GZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ag=(e,t)=>{for(var r in t||(t={}))hN.call(t,r)&&pj(e,r,t[r]);if(Ip)for(var r of Ip(t))mN.call(t,r)&&pj(e,r,t[r]);return e},YZ=(e,t)=>QZ(e,KZ(t)),XZ=(e,t)=>{var r={};for(var n in e)hN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ip)for(var n of Ip(e))t.indexOf(n)<0&&mN.call(e,n)&&(r[n]=e[n]);return r};const JZ={type:"text",size:"sm",__staticSelector:"TextInput"},le=f.forwardRef((e,t)=>{const r=bT("TextInput",JZ,e),{inputProps:n,wrapperProps:o}=r,i=XZ(r,["inputProps","wrapperProps"]);return S.createElement(Ut.Wrapper,Ag({},o),S.createElement(Ut,YZ(Ag(Ag({},n),i),{ref:t})))});le.displayName="@mantine/core/TextInput";const[ZZ,pm]=No("Pagination.Root component was not found in tree"),eee={siblings:1,boundaries:1};function gN(e){const{total:t,value:r,defaultValue:n,onChange:o,disabled:i,children:a,siblings:l,boundaries:c,color:u,radius:d,onNextPage:p,onPreviousPage:h,onFirstPage:m,onLastPage:g,getItemProps:v,classNames:_,styles:y,unstyled:x,variant:w,size:b}=H("PaginationRoot",eee,e),{range:j,setPage:C,next:P,previous:E,active:k,first:$,last:I}=RL({page:r,initialPage:n,onChange:o,total:t,siblings:l,boundaries:c}),R=Hr(p,P),N=Hr(h,E),M=Hr(m,$),L=Hr(g,I);return S.createElement(ZZ,{value:{total:t,range:j,active:k,disabled:i,color:u,radius:d,getItemProps:v,onChange:C,onNext:R,onPrevious:N,onFirst:M,onLast:L,stylesApi:{name:"Pagination",classNames:_,styles:y,unstyled:x,variant:w,size:b}}},a)}const fc={xs:O(22),sm:O(26),md:O(32),lg:O(38),xl:O(44)};var tee=W((e,{color:t,radius:r,withPadding:n},{size:o})=>{const i=e.fn.variant({color:t,variant:"filled"});return{control:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center",border:`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,height:A({size:o,sizes:fc}),minWidth:A({size:o,sizes:fc}),padding:n?`0 calc(${A({size:o,sizes:e.spacing})} / 2)`:void 0,fontSize:A({size:o,sizes:e.fontSizes}),borderRadius:e.fn.radius(r),lineHeight:1,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,"&:not([data-disabled])":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]}),"&:active:not([data-disabled])":e.activeStyles,"&[data-disabled]":{opacity:.4,cursor:"not-allowed",pointerEvents:"none"},"&[data-active]":{borderColor:"transparent",color:i.color,backgroundColor:i.background,"&:not([data-disabled])":e.fn.hover({backgroundColor:i.hover})}}}});const ree=tee;var nee=Object.defineProperty,oee=Object.defineProperties,iee=Object.getOwnPropertyDescriptors,Dp=Object.getOwnPropertySymbols,vN=Object.prototype.hasOwnProperty,yN=Object.prototype.propertyIsEnumerable,hj=(e,t,r)=>t in e?nee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aee=(e,t)=>{for(var r in t||(t={}))vN.call(t,r)&&hj(e,r,t[r]);if(Dp)for(var r of Dp(t))yN.call(t,r)&&hj(e,r,t[r]);return e},see=(e,t)=>oee(e,iee(t)),lee=(e,t)=>{var r={};for(var n in e)vN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Dp)for(var n of Dp(e))t.indexOf(n)<0&&yN.call(e,n)&&(r[n]=e[n]);return r};const cee={withPadding:!0},hm=f.forwardRef((e,t)=>{const r=H("PaginationControl",cee,e),{active:n,className:o,disabled:i,withPadding:a}=r,l=lee(r,["active","className","disabled","withPadding"]),c=pm(),{classes:u,cx:d}=ree({color:c.color,radius:c.radius,withPadding:a},c.stylesApi);return S.createElement(Po,see(aee({},l),{disabled:i,"data-active":n||void 0,"data-disabled":i||void 0,ref:t,className:d(u.control,o)}))});hm.displayName="@mantine/core/PaginationControl";var uee=Object.defineProperty,dee=Object.defineProperties,fee=Object.getOwnPropertyDescriptors,Np=Object.getOwnPropertySymbols,xN=Object.prototype.hasOwnProperty,wN=Object.prototype.propertyIsEnumerable,mj=(e,t,r)=>t in e?uee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sa=(e,t)=>{for(var r in t||(t={}))xN.call(t,r)&&mj(e,r,t[r]);if(Np)for(var r of Np(t))wN.call(t,r)&&mj(e,r,t[r]);return e},Mc=(e,t)=>dee(e,fee(t)),pee=(e,t)=>{var r={};for(var n in e)xN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Np)for(var n of Np(e))t.indexOf(n)<0&&wN.call(e,n)&&(r[n]=e[n]);return r};function bN(e){return`calc(${A({size:e,sizes:fc})} / 2)`}function Lc(e){var t=e,{size:r,style:n,children:o,path:i}=t,a=pee(t,["size","style","children","path"]);return S.createElement("svg",sa({viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:sa({width:r,height:r},n)},a),S.createElement("path",{d:i,fill:"currentColor"}))}const hee=e=>S.createElement(Lc,Mc(sa({},e),{path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"})),mee=e=>S.createElement(Lc,Mc(sa({},e),{path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"})),gee=e=>S.createElement(Lc,Mc(sa({},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"})),vee=e=>S.createElement(Lc,Mc(sa({},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"})),yee=e=>S.createElement(Lc,Mc(sa({},e),{path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}));var xee=W((e,t,{size:r})=>({dots:{height:A({size:r,sizes:fc}),minWidth:A({size:r,sizes:fc}),display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"}}));const wee=xee;var bee=Object.defineProperty,Ap=Object.getOwnPropertySymbols,_N=Object.prototype.hasOwnProperty,SN=Object.prototype.propertyIsEnumerable,gj=(e,t,r)=>t in e?bee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_ee=(e,t)=>{for(var r in t||(t={}))_N.call(t,r)&&gj(e,r,t[r]);if(Ap)for(var r of Ap(t))SN.call(t,r)&&gj(e,r,t[r]);return e},See=(e,t)=>{var r={};for(var n in e)_N.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ap)for(var n of Ap(e))t.indexOf(n)<0&&SN.call(e,n)&&(r[n]=e[n]);return r};const Pee={icon:yee},yx=f.forwardRef((e,t)=>{const r=H("PaginationDots",Pee,e),{className:n,icon:o}=r,i=See(r,["className","icon"]),a=pm(),{classes:l,cx:c}=wee(null,a.stylesApi);return S.createElement(ae,_ee({ref:t,className:c(l.dots,n)},i),S.createElement(o,{size:bN(a.stylesApi.size)}))});yx.displayName="@mantine/core/PaginationDots";var jee=Object.defineProperty,vj=Object.getOwnPropertySymbols,Oee=Object.prototype.hasOwnProperty,Cee=Object.prototype.propertyIsEnumerable,yj=(e,t,r)=>t in e?jee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Eee=(e,t)=>{for(var r in t||(t={}))Oee.call(t,r)&&yj(e,r,t[r]);if(vj)for(var r of vj(t))Cee.call(t,r)&&yj(e,r,t[r]);return e};function xx({dotsIcon:e}){const t=pm(),r=t.range.map((n,o)=>{var i;return n==="dots"?S.createElement(yx,{icon:e,key:o}):S.createElement(hm,Eee({key:o,active:n===t.active,"aria-current":n===t.active?"page":void 0,onClick:()=>t.onChange(n),disabled:t.disabled},(i=t.getItemProps)==null?void 0:i.call(t,n)),n)});return S.createElement(S.Fragment,null,r)}xx.displayName="@mantine/core/PaginationItems";var $ee=W(e=>({icon:{transform:e.dir==="rtl"?"rotate(180deg)":"unset"}}));const kee=$ee;var Ree=Object.defineProperty,Mp=Object.getOwnPropertySymbols,PN=Object.prototype.hasOwnProperty,jN=Object.prototype.propertyIsEnumerable,xj=(e,t,r)=>t in e?Ree(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tee=(e,t)=>{for(var r in t||(t={}))PN.call(t,r)&&xj(e,r,t[r]);if(Mp)for(var r of Mp(t))jN.call(t,r)&&xj(e,r,t[r]);return e},Iee=(e,t)=>{var r={};for(var n in e)PN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Mp)for(var n of Mp(e))t.indexOf(n)<0&&jN.call(e,n)&&(r[n]=e[n]);return r};function mm({icon:e,name:t,action:r,type:n}){const o={icon:e},i=f.forwardRef((a,l)=>{const c=H(t,o,a),{icon:u}=c,d=Iee(c,["icon"]),{classes:p}=kee(),h=pm(),m=n==="next"?h.active===h.total:h.active===1;return S.createElement(hm,Tee({disabled:h.disabled||m,ref:l,onClick:h[r],withPadding:!1},d),S.createElement(u,{className:p.icon,size:bN(h.stylesApi.size)}))});return i.displayName=`@mantine/core/${t}`,i}const ON=mm({icon:hee,name:"PaginationNext",action:"onNext",type:"next"}),CN=mm({icon:mee,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),EN=mm({icon:gee,name:"PaginationFirst",action:"onFirst",type:"previous"}),$N=mm({icon:vee,name:"PaginationLast",action:"onLast",type:"next"});var Dee=Object.defineProperty,Lp=Object.getOwnPropertySymbols,kN=Object.prototype.hasOwnProperty,RN=Object.prototype.propertyIsEnumerable,wj=(e,t,r)=>t in e?Dee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dl=(e,t)=>{for(var r in t||(t={}))kN.call(t,r)&&wj(e,r,t[r]);if(Lp)for(var r of Lp(t))RN.call(t,r)&&wj(e,r,t[r]);return e},Nee=(e,t)=>{var r={};for(var n in e)kN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Lp)for(var n of Lp(e))t.indexOf(n)<0&&RN.call(e,n)&&(r[n]=e[n]);return r};const Aee={withControls:!0,siblings:1,boundaries:1};function so(e){const t=H("Pagination",Aee,e),{withEdges:r,withControls:n,classNames:o,styles:i,unstyled:a,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:g,boundaries:v,color:_,radius:y,onNextPage:x,onPreviousPage:w,onFirstPage:b,onLastPage:j,getItemProps:C,getControlProps:P,spacing:E,nextIcon:k,previousIcon:$,lastIcon:I,firstIcon:R,dotsIcon:N}=t,M=Nee(t,["withEdges","withControls","classNames","styles","unstyled","variant","size","total","value","defaultValue","onChange","disabled","siblings","boundaries","color","radius","onNextPage","onPreviousPage","onFirstPage","onLastPage","getItemProps","getControlProps","spacing","nextIcon","previousIcon","lastIcon","firstIcon","dotsIcon"]),L=Ht();return u<=0?null:S.createElement(gN,{classNames:o,styles:i,unstyled:a,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:g,boundaries:v,color:_,radius:y,onNextPage:x,onPreviousPage:w,onFirstPage:b,onLastPage:j,getItemProps:C},S.createElement(K,dl({spacing:E??`calc(${A({size:c,sizes:L.spacing})} / 2)`},M),r&&S.createElement(EN,dl({icon:R},P==null?void 0:P("first"))),n&&S.createElement(CN,dl({icon:$},P==null?void 0:P("previous"))),S.createElement(xx,{dotsIcon:N}),n&&S.createElement(ON,dl({icon:k},P==null?void 0:P("next"))),r&&S.createElement($N,dl({icon:I},P==null?void 0:P("last")))))}so.displayName="@mantine/core/Pagination";so.Root=gN;so.Items=xx;so.Control=hm;so.Dots=yx;so.Next=ON;so.Previous=CN;so.Last=$N;so.First=EN;const Mee=({reveal:e,size:t})=>S.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:t,height:t}},S.createElement("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}));var Lee=Object.defineProperty,zee=Object.defineProperties,Fee=Object.getOwnPropertyDescriptors,bj=Object.getOwnPropertySymbols,Vee=Object.prototype.hasOwnProperty,Bee=Object.prototype.propertyIsEnumerable,_j=(e,t,r)=>t in e?Lee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mg=(e,t)=>{for(var r in t||(t={}))Vee.call(t,r)&&_j(e,r,t[r]);if(bj)for(var r of bj(t))Bee.call(t,r)&&_j(e,r,t[r]);return e},Sj=(e,t)=>zee(e,Fee(t)),Uee=W((e,{rightSectionWidth:t},{size:r})=>({visibilityToggle:{},input:{position:"relative",overflow:"hidden"},innerInput:Sj(Mg(Mg({},e.fn.fontStyles()),e.fn.cover(0)),{backgroundColor:"transparent",border:`${O(1)} solid transparent`,borderLeftWidth:0,borderRightWidth:0,boxSizing:"border-box",display:"block",width:`calc(100% - ${O(t)})`,paddingLeft:`calc(${A({size:r,sizes:Et})} / 3)`,fontSize:A({size:r,sizes:e.fontSizes}),height:`calc(${A({size:r,sizes:Et})} - ${O(2)})`,lineHeight:`calc(${A({size:r,sizes:Et})} - ${O(4)})`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"&::-ms-reveal, &::-ms-clear":{display:"none"},"&:focus":{outline:0},"&:disabled":{cursor:"not-allowed",pointerEvents:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"&::placeholder":Sj(Mg({},e.fn.placeholderStyles()),{opacity:1}),"&[data-invalid]":{color:e.fn.variant({variant:"filled",color:"red"}).background,"&::placeholder":{opacity:1,color:e.fn.variant({variant:"filled",color:"red"}).background}},"&[data-with-icon]":{paddingLeft:A({size:r,sizes:Et})}})}));const Wee=Uee;var Hee=Object.defineProperty,qee=Object.defineProperties,Gee=Object.getOwnPropertyDescriptors,zp=Object.getOwnPropertySymbols,TN=Object.prototype.hasOwnProperty,IN=Object.prototype.propertyIsEnumerable,Pj=(e,t,r)=>t in e?Hee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bu=(e,t)=>{for(var r in t||(t={}))TN.call(t,r)&&Pj(e,r,t[r]);if(zp)for(var r of zp(t))IN.call(t,r)&&Pj(e,r,t[r]);return e},Qee=(e,t)=>qee(e,Gee(t)),Kee=(e,t)=>{var r={};for(var n in e)TN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zp)for(var n of zp(e))t.indexOf(n)<0&&IN.call(e,n)&&(r[n]=e[n]);return r};const Yee={xs:O(22),sm:O(26),md:O(28),lg:O(32),xl:O(40)},Xee={xs:O(12),sm:O(15),md:O(17),lg:O(19),xl:O(21)},Jee={xs:O(28),sm:O(32),md:O(34),lg:O(44),xl:O(54)},Zee={size:"sm",toggleTabIndex:-1,visibilityToggleIcon:Mee,__staticSelector:"PasswordInput"},to=f.forwardRef((e,t)=>{const r=H("PasswordInput",Zee,e),{radius:n,disabled:o,size:i,toggleTabIndex:a,className:l,id:c,label:u,error:d,required:p,style:h,icon:m,description:g,wrapperProps:v,classNames:_,styles:y,variant:x,visibilityToggleIcon:w,__staticSelector:b,sx:j,labelProps:C,descriptionProps:P,errorProps:E,unstyled:k,visibilityToggleLabel:$,withAsterisk:I,inputContainer:R,iconWidth:N,inputWrapperOrder:M,visible:L,defaultVisible:Q,onVisibilityChange:G}=r,T=Kee(r,["radius","disabled","size","toggleTabIndex","className","id","label","error","required","style","icon","description","wrapperProps","classNames","styles","variant","visibilityToggleIcon","__staticSelector","sx","labelProps","descriptionProps","errorProps","unstyled","visibilityToggleLabel","withAsterisk","inputContainer","iconWidth","inputWrapperOrder","visible","defaultVisible","onVisibilityChange"]),F=A({size:i,sizes:Jee}),{classes:V}=Wee({rightSectionWidth:F},{name:"PasswordInput",classNames:_,styles:y,unstyled:k,size:i,variant:x}),X=Ar(c),{systemStyles:J,rest:_e}=ao(T),[Se,Xe]=Ir({value:L,defaultValue:Q,finalValue:!1,onChange:G}),Le=()=>Xe(!Se),gt=S.createElement(yr,{className:V.visibilityToggle,tabIndex:a,radius:n,size:A({size:i,sizes:Yee}),"aria-hidden":!$,"aria-label":$,unstyled:k,onMouseDown:Nt=>{Nt.preventDefault(),Le()},onKeyDown:Nt=>{Nt.key===" "&&(Nt.preventDefault(),Le())}},S.createElement(w,{reveal:Se,size:A({size:i,sizes:Xee})}));return S.createElement(Ut.Wrapper,Bu(Bu({required:p,id:X,label:u,error:d,description:g,size:i,className:l,style:h,classNames:_,styles:y,__staticSelector:b,sx:j,errorProps:E,descriptionProps:P,labelProps:C,unstyled:k,withAsterisk:I,inputWrapperOrder:M,inputContainer:R,variant:x},J),v),S.createElement(Ut,{component:"div",error:d,icon:m,size:i,classNames:Qee(Bu({},_),{input:V.input}),styles:y,radius:n,disabled:o,__staticSelector:b,rightSectionWidth:F,rightSection:!o&&gt,variant:x,unstyled:k,iconWidth:N},S.createElement("input",Bu({type:Se?"text":"password",required:p,"data-invalid":!!d||void 0,"data-with-icon":!!m||void 0,className:V.innerInput,disabled:o,id:X,ref:t,autoComplete:"off"},_e))))});to.displayName="@mantine/core/PasswordInput";const DN=f.createContext(!1),ete=DN.Provider,tte=()=>f.useContext(DN);function NN({children:e,openDelay:t=0,closeDelay:r=0}){return S.createElement(ete,{value:!0},S.createElement(LU,{delay:{open:t,close:r}},e))}NN.displayName="@mantine/core/TooltipGroup";var rte=Object.defineProperty,nte=Object.defineProperties,ote=Object.getOwnPropertyDescriptors,jj=Object.getOwnPropertySymbols,ite=Object.prototype.hasOwnProperty,ate=Object.prototype.propertyIsEnumerable,Oj=(e,t,r)=>t in e?rte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cj=(e,t)=>{for(var r in t||(t={}))ite.call(t,r)&&Oj(e,r,t[r]);if(jj)for(var r of jj(t))ate.call(t,r)&&Oj(e,r,t[r]);return e},ste=(e,t)=>nte(e,ote(t));function lte(e,t){if(!t)return{backgroundColor:e.colorScheme==="dark"?e.colors.gray[2]:e.colors.gray[9],color:e.colorScheme==="dark"?e.black:e.white};const r=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:r.background,color:r.color}}var cte=W((e,{color:t,radius:r,width:n,multiline:o})=>({tooltip:ste(Cj(Cj({},e.fn.fontStyles()),lte(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(r),padding:`calc(${e.spacing.xs} / 2) ${e.spacing.xs}`,position:"absolute",whiteSpace:o?"unset":"nowrap",pointerEvents:"none",width:n}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));const AN=cte,MN={children:"Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"};function ute({offset:e,position:t}){const[r,n]=f.useState(!1),o=f.useRef(),{x:i,y:a,reference:l,floating:c,refs:u,update:d,placement:p}=sx({placement:t,middleware:[tx({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=p.includes("right")?e:t.includes("left")?e*-1:0,m=p.includes("bottom")?e:t.includes("top")?e*-1:0,g=f.useCallback(({clientX:v,clientY:_})=>{l({getBoundingClientRect(){return{width:0,height:0,x:v,y:_,left:v+h,top:_+m,right:v,bottom:_}}})},[l]);return f.useEffect(()=>{if(u.floating.current){const v=o.current;v.addEventListener("mousemove",g);const _=_o(u.floating.current);return _.forEach(y=>{y.addEventListener("scroll",d)}),()=>{v.removeEventListener("mousemove",g),_.forEach(y=>{y.removeEventListener("scroll",d)})}}},[l,u.floating.current,d,g,r]),{handleMouseMove:g,x:i,y:a,opened:r,setOpened:n,boundaryRef:o,floating:c}}var dte=Object.defineProperty,fte=Object.defineProperties,pte=Object.getOwnPropertyDescriptors,Fp=Object.getOwnPropertySymbols,LN=Object.prototype.hasOwnProperty,zN=Object.prototype.propertyIsEnumerable,Ej=(e,t,r)=>t in e?dte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Uu=(e,t)=>{for(var r in t||(t={}))LN.call(t,r)&&Ej(e,r,t[r]);if(Fp)for(var r of Fp(t))zN.call(t,r)&&Ej(e,r,t[r]);return e},Wu=(e,t)=>fte(e,pte(t)),hte=(e,t)=>{var r={};for(var n in e)LN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Fp)for(var n of Fp(e))t.indexOf(n)<0&&zN.call(e,n)&&(r[n]=e[n]);return r};const mte={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Dn("popover")};function FN(e){var t;const r=H("TooltipFloating",mte,e),{children:n,refProp:o,withinPortal:i,portalProps:a,style:l,className:c,classNames:u,styles:d,unstyled:p,radius:h,color:m,label:g,offset:v,position:_,multiline:y,width:x,zIndex:w,disabled:b,variant:j}=r,C=hte(r,["children","refProp","withinPortal","portalProps","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled","variant"]),{handleMouseMove:P,x:E,y:k,opened:$,boundaryRef:I,floating:R,setOpened:N}=ute({offset:v,position:_}),{classes:M,cx:L}=AN({radius:h,color:m,multiline:y,width:x},{name:"TooltipFloating",classNames:u,styles:d,unstyled:p,variant:j});if(!Ts(n))throw new Error(MN.children);const Q=Ds(I,n.ref),G=F=>{var V,X;(X=(V=n.props).onMouseEnter)==null||X.call(V,F),P(F),N(!0)},T=F=>{var V,X;(X=(V=n.props).onMouseLeave)==null||X.call(V,F),N(!1)};return S.createElement(S.Fragment,null,S.createElement(Ls,Wu(Uu({},a),{withinPortal:i}),S.createElement(ae,Wu(Uu({},C),{ref:R,className:L(M.tooltip,c),style:Wu(Uu({},l),{zIndex:w,display:!b&&$?"block":"none",top:k??"",left:(t=Math.round(E))!=null?t:""})}),g)),f.cloneElement(n,Wu(Uu({},n.props),{[o]:Q,onMouseEnter:G,onMouseLeave:T})))}FN.displayName="@mantine/core/TooltipFloating";function gte(e){const[t,r]=f.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=tte(),a=Ar(),{delay:l,currentId:c,setCurrentId:u}=nT(),d=f.useCallback(E=>{r(E),E&&u(a)},[u,a]),{x:p,y:h,reference:m,floating:g,context:v,refs:_,update:y,placement:x,middlewareData:{arrow:{x:w,y:b}={}}}=sx({placement:e.position,open:o,onOpenChange:d,middleware:[WR(e.offset),tx({padding:8}),VR(),JR({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[UR()]:[]]}),{getReferenceProps:j,getFloatingProps:C}=YU([MU(v,{enabled:e.events.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),QU(v,{enabled:e.events.focus,keyboardOnly:!0}),KU(v,{role:"tooltip"}),GU(v,{enabled:typeof e.opened===void 0}),zU(v,{id:a})]);return iT({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:_,update:y}}),cn(()=>{var E;(E=e.onPositionChange)==null||E.call(e,x)},[x]),{x:p,y:h,arrowX:w,arrowY:b,reference:m,floating:g,getFloatingProps:C,getReferenceProps:j,isGroupPhase:o&&c&&c!==a,opened:o,placement:x}}var vte=Object.defineProperty,yte=Object.defineProperties,xte=Object.getOwnPropertyDescriptors,Vp=Object.getOwnPropertySymbols,VN=Object.prototype.hasOwnProperty,BN=Object.prototype.propertyIsEnumerable,$j=(e,t,r)=>t in e?vte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zi=(e,t)=>{for(var r in t||(t={}))VN.call(t,r)&&$j(e,r,t[r]);if(Vp)for(var r of Vp(t))BN.call(t,r)&&$j(e,r,t[r]);return e},Lg=(e,t)=>yte(e,xte(t)),wte=(e,t)=>{var r={};for(var n in e)VN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Vp)for(var n of Vp(e))t.indexOf(n)<0&&BN.call(e,n)&&(r[n]=e[n]);return r};const bte={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:Dn("popover"),positionDependencies:[]},gm=f.forwardRef((e,t)=>{var r;const n=f.useRef(null),o=H("Tooltip",bte,e),{children:i,position:a,refProp:l,label:c,openDelay:u,closeDelay:d,onPositionChange:p,opened:h,withinPortal:m,portalProps:g,radius:v,color:_,classNames:y,styles:x,unstyled:w,style:b,className:j,withArrow:C,arrowSize:P,arrowOffset:E,arrowRadius:k,arrowPosition:$,offset:I,transitionProps:R,multiline:N,width:M,events:L,zIndex:Q,disabled:G,positionDependencies:T,onClick:F,onMouseEnter:V,onMouseLeave:X,inline:J,variant:_e,keepMounted:Se}=o,Xe=wte(o,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","portalProps","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","offset","transitionProps","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline","variant","keepMounted"]),{classes:Le,cx:gt,theme:Nt}=AN({radius:v,color:_,width:M,multiline:N},{name:"Tooltip",classNames:y,styles:x,unstyled:w,variant:_e}),ke=gte({position:gT(Nt.dir,a),closeDelay:d,openDelay:u,onPositionChange:p,opened:h,events:L,arrowRef:n,arrowOffset:E,offset:I+(C?P/2:0),positionDependencies:[...T,i],inline:J});if(!Ts(i))throw new Error(MN.children);const qt=Ds(ke.reference,i.ref,t);return S.createElement(S.Fragment,null,S.createElement(Ls,Lg(zi({},g),{withinPortal:m}),S.createElement(ya,Lg(zi({keepMounted:Se,mounted:!G&&ke.opened},R),{transition:R.transition||"fade",duration:ke.isGroupPhase?10:(r=R.duration)!=null?r:100}),zr=>{var cr,Gt;return S.createElement(ae,zi(zi({},Xe),ke.getFloatingProps({ref:ke.floating,className:Le.tooltip,style:Lg(zi(zi({},b),zr),{zIndex:Q,top:(cr=ke.y)!=null?cr:0,left:(Gt=ke.x)!=null?Gt:0})})),c,S.createElement(cx,{ref:n,arrowX:ke.arrowX,arrowY:ke.arrowY,visible:C,position:ke.placement,arrowSize:P,arrowOffset:E,arrowRadius:k,arrowPosition:$,className:Le.arrow}))})),f.cloneElement(i,ke.getReferenceProps(zi({onClick:F,onMouseEnter:V,onMouseLeave:X,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[l]:qt,className:gt(j,i.props.className)},i.props))))});gm.Group=NN;gm.Floating=FN;gm.displayName="@mantine/core/Tooltip";const UN=gm;var _te=Object.defineProperty,Bp=Object.getOwnPropertySymbols,WN=Object.prototype.hasOwnProperty,HN=Object.prototype.propertyIsEnumerable,kj=(e,t,r)=>t in e?_te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rj=(e,t)=>{for(var r in t||(t={}))WN.call(t,r)&&kj(e,r,t[r]);if(Bp)for(var r of Bp(t))HN.call(t,r)&&kj(e,r,t[r]);return e},Ste=(e,t)=>{var r={};for(var n in e)WN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bp)for(var n of Bp(e))t.indexOf(n)<0&&HN.call(e,n)&&(r[n]=e[n]);return r};function Pte(e){const t=e,{width:r,height:n,style:o}=t,i=Ste(t,["width","height","style"]);return S.createElement("svg",Rj({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:Rj({width:r,height:n},o)},i),S.createElement("path",{fill:"currentColor",d:"M0 2.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0z"}))}const qN=f.createContext(null),jte=qN.Provider,Ote=()=>f.useContext(qN);var Cte=Object.defineProperty,Up=Object.getOwnPropertySymbols,GN=Object.prototype.hasOwnProperty,QN=Object.prototype.propertyIsEnumerable,Tj=(e,t,r)=>t in e?Cte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ij=(e,t)=>{for(var r in t||(t={}))GN.call(t,r)&&Tj(e,r,t[r]);if(Up)for(var r of Up(t))QN.call(t,r)&&Tj(e,r,t[r]);return e},Ete=(e,t)=>{var r={};for(var n in e)GN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Up)for(var n of Up(e))t.indexOf(n)<0&&QN.call(e,n)&&(r[n]=e[n]);return r};const $te={size:"sm"},KN=f.forwardRef((e,t)=>{const r=H("RadioGroup",$te,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c,unstyled:u,name:d}=r,p=Ete(r,["children","value","defaultValue","onChange","size","wrapperProps","unstyled","name"]),h=Ar(d),[m,g]=Ir({value:o,defaultValue:i,finalValue:"",onChange:a}),v=_=>g(_.currentTarget.value);return S.createElement(jte,{value:{value:m,onChange:v,size:l,name:h}},S.createElement(Ut.Wrapper,Ij(Ij({labelElement:"div",size:l,__staticSelector:"RadioGroup",ref:t,unstyled:u},c),p),n))});KN.displayName="@mantine/core/RadioGroup";var kte=Object.defineProperty,Rte=Object.defineProperties,Tte=Object.getOwnPropertyDescriptors,Dj=Object.getOwnPropertySymbols,Ite=Object.prototype.hasOwnProperty,Dte=Object.prototype.propertyIsEnumerable,Nj=(e,t,r)=>t in e?kte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nte=(e,t)=>{for(var r in t||(t={}))Ite.call(t,r)&&Nj(e,r,t[r]);if(Dj)for(var r of Dj(t))Dte.call(t,r)&&Nj(e,r,t[r]);return e},Ate=(e,t)=>Rte(e,Tte(t));const zg={xs:O(16),sm:O(20),md:O(24),lg:O(30),xl:O(36)},Hu={xs:O(6),sm:O(8),md:O(10),lg:O(14),xl:O(16)};var Mte=W((e,{color:t,transitionDuration:r,labelPosition:n,error:o},{size:i})=>{const a=e.fn.variant({variant:"filled",color:t}),l=e.fn.variant({variant:"filled",color:"red"}).background;return{inner:{order:n==="left"?2:1,position:"relative",alignSelf:"flex-start"},icon:{ref:Vt("icon"),color:e.white,opacity:0,transform:`scale(0.75) translateY(${O(2)})`,transition:`opacity ${r}ms ${e.transitionTimingFunction}`,pointerEvents:"none",width:A({sizes:Hu,size:i}),height:A({sizes:Hu,size:i}),position:"absolute",top:`calc(50% - ${A({sizes:Hu,size:i})} / 2)`,left:`calc(50% - ${A({sizes:Hu,size:i})} / 2)`},radio:Ate(Nte({},e.fn.focusStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${O(1)} solid ${o?l:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,position:"relative",appearance:"none",width:A({sizes:zg,size:i}),height:A({sizes:zg,size:i}),borderRadius:A({sizes:zg,size:i}),margin:0,display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:`${r}ms`,cursor:e.cursorType,"&:checked":{background:a.background,borderColor:a.background,[`& + .${Vt("icon")}`]:{opacity:1,transform:"scale(1)"}},"&:disabled":{borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[4],backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],[`& + .${Vt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[4]}}})}});const Lte=Mte;var zte=Object.defineProperty,Wp=Object.getOwnPropertySymbols,YN=Object.prototype.hasOwnProperty,XN=Object.prototype.propertyIsEnumerable,Aj=(e,t,r)=>t in e?zte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qu=(e,t)=>{for(var r in t||(t={}))YN.call(t,r)&&Aj(e,r,t[r]);if(Wp)for(var r of Wp(t))XN.call(t,r)&&Aj(e,r,t[r]);return e},Fte=(e,t)=>{var r={};for(var n in e)YN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wp)for(var n of Wp(e))t.indexOf(n)<0&&XN.call(e,n)&&(r[n]=e[n]);return r};const Vte={icon:Pte,transitionDuration:100,size:"sm",labelPosition:"right"},Hp=f.forwardRef((e,t)=>{var r,n;const o=H("Radio",Vte,e),{className:i,style:a,id:l,label:c,size:u,title:d,disabled:p,color:h,classNames:m,styles:g,sx:v,icon:_,transitionDuration:y,wrapperProps:x,unstyled:w,labelPosition:b,description:j,error:C,variant:P}=o,E=Fte(o,["className","style","id","label","size","title","disabled","color","classNames","styles","sx","icon","transitionDuration","wrapperProps","unstyled","labelPosition","description","error","variant"]),k=Ote(),$=(r=k==null?void 0:k.size)!=null?r:u,I=e.size?u:$,{classes:R}=Lte({color:h,transitionDuration:y,labelPosition:b,error:!!C},{name:"Radio",classNames:m,styles:g,unstyled:w,variant:P,size:I}),{systemStyles:N,rest:M}=ao(E),L=Ar(l),Q=k?{checked:k.value===M.value,name:(n=M.name)!=null?n:k.name,onChange:k.onChange}:{};return S.createElement(dm,qu(qu({className:i,sx:v,style:a,id:L,size:I,labelPosition:b,label:c,description:j,error:C,disabled:p,__staticSelector:"Radio",classNames:m,styles:g,unstyled:w,"data-checked":Q.checked||void 0,variant:P},N),x),S.createElement("div",{className:R.inner},S.createElement("input",qu(qu({ref:t,className:R.radio,type:"radio",id:L,disabled:p},M),Q)),S.createElement(_,{className:R.icon,"aria-hidden":!0})))});Hp.displayName="@mantine/core/Radio";Hp.Group=KN;function Bte({size:e,thickness:t,sum:r,value:n,root:o,offset:i}){const a=(e*.9-t*2)/2,l=Math.PI*a*2/100,c=o?`${(100-r)*l}, ${r*l}`:`${n*l}, ${(100-n)*l}`;return{strokeWidth:t,cx:e/2,cy:e/2,r:a,transform:o?`scale(1, -1) translate(0, -${e})`:null,strokeDasharray:c,strokeDashoffset:o?0:i}}var Ute=Object.defineProperty,Wte=Object.defineProperties,Hte=Object.getOwnPropertyDescriptors,qp=Object.getOwnPropertySymbols,JN=Object.prototype.hasOwnProperty,ZN=Object.prototype.propertyIsEnumerable,Mj=(e,t,r)=>t in e?Ute(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lj=(e,t)=>{for(var r in t||(t={}))JN.call(t,r)&&Mj(e,r,t[r]);if(qp)for(var r of qp(t))ZN.call(t,r)&&Mj(e,r,t[r]);return e},qte=(e,t)=>Wte(e,Hte(t)),Gte=(e,t)=>{var r={};for(var n in e)JN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&qp)for(var n of qp(e))t.indexOf(n)<0&&ZN.call(e,n)&&(r[n]=e[n]);return r};function e5(e){var t=e,{size:r,value:n,offset:o,sum:i,thickness:a,root:l,color:c,lineRoundCaps:u,tooltip:d}=t,p=Gte(t,["size","value","offset","sum","thickness","root","color","lineRoundCaps","tooltip"]);const h=Ht(),m=h.fn.themeColor(c||(h.colorScheme==="dark"?"dark":"gray"),c?h.fn.primaryShade():h.colorScheme==="dark"?4:1,!1);return S.createElement(UN.Floating,{disabled:!d,label:d},S.createElement("circle",Lj(qte(Lj({},p),{fill:"none",strokeLinecap:u?"round":"butt",stroke:m}),Bte({sum:i,size:r,thickness:a,value:n,offset:o,root:l}))))}e5.displayName="@mantine/core/Curve";var Qte=Object.defineProperty,Kte=Object.defineProperties,Yte=Object.getOwnPropertyDescriptors,zj=Object.getOwnPropertySymbols,Xte=Object.prototype.hasOwnProperty,Jte=Object.prototype.propertyIsEnumerable,Fj=(e,t,r)=>t in e?Qte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fl=(e,t)=>{for(var r in t||(t={}))Xte.call(t,r)&&Fj(e,r,t[r]);if(zj)for(var r of zj(t))Jte.call(t,r)&&Fj(e,r,t[r]);return e},pl=(e,t)=>Kte(e,Yte(t));function Zte({size:e,thickness:t,sections:r,renderRoundedLineCaps:n,rootColor:o}){const i=r.reduce((d,p)=>d+p.value,0),a=Math.PI*((e*.9-t*2)/2)*2;let l=a;const c=[],u=[];for(let d=0;d<r.length;d+=1)c.push({sum:i,offset:l,data:r[d],root:!1}),l-=r[d].value/100*a;if(c.push({sum:i,offset:l,data:{color:o},root:!0}),u.push(pl(fl({},c[c.length-1]),{lineRoundCaps:!1})),c.length>2){u.push(pl(fl({},c[0]),{lineRoundCaps:n})),u.push(pl(fl({},c[c.length-2]),{lineRoundCaps:n}));for(let d=1;d<=c.length-3;d+=1)u.push(pl(fl({},c[d]),{lineRoundCaps:!1}))}else u.push(pl(fl({},c[0]),{lineRoundCaps:n}));return u}var ere=W({root:{position:"relative"},label:{position:"absolute",top:"50%",transform:"translateY(-50%)"}});const tre=ere;var rre=Object.defineProperty,nre=Object.defineProperties,ore=Object.getOwnPropertyDescriptors,Gp=Object.getOwnPropertySymbols,t5=Object.prototype.hasOwnProperty,r5=Object.prototype.propertyIsEnumerable,Vj=(e,t,r)=>t in e?rre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fg=(e,t)=>{for(var r in t||(t={}))t5.call(t,r)&&Vj(e,r,t[r]);if(Gp)for(var r of Gp(t))r5.call(t,r)&&Vj(e,r,t[r]);return e},ire=(e,t)=>nre(e,ore(t)),are=(e,t)=>{var r={};for(var n in e)t5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gp)for(var n of Gp(e))t.indexOf(n)<0&&r5.call(e,n)&&(r[n]=e[n]);return r};const sre={size:120,thickness:12},wx=f.forwardRef((e,t)=>{const r=H("RingProgress",sre,e),{className:n,style:o,label:i,sections:a,size:l,thickness:c,classNames:u,styles:d,roundCaps:p,rootColor:h,unstyled:m,variant:g}=r,v=are(r,["className","style","label","sections","size","thickness","classNames","styles","roundCaps","rootColor","unstyled","variant"]),{classes:_,cx:y}=tre(null,{name:"RingProgress",classNames:u,styles:d,unstyled:m,variant:g}),x=Zte({size:l,thickness:c,sections:a,renderRoundedLineCaps:p,rootColor:h}).map(({data:w,sum:b,root:j,lineRoundCaps:C,offset:P},E)=>S.createElement(e5,ire(Fg({},w),{key:E,size:l,thickness:c,sum:b,offset:P,color:w==null?void 0:w.color,root:j,lineRoundCaps:C})));return S.createElement(ae,Fg({style:Fg({width:l,height:l},o),className:y(_.root,n),ref:t},v),S.createElement("svg",{style:{width:l,height:l,transform:"rotate(-90deg)"}},x),i&&S.createElement("div",{className:_.label,style:{right:c*2,left:c*2}},i))});wx.displayName="@mantine/core/RingProgress";function lre(e,t){if(t.length===0)return t;const r="maxWidth"in t[0]?"maxWidth":"minWidth",n=[...t].sort((o,i)=>wr(A({size:i[r],sizes:e.breakpoints}))-wr(A({size:o[r],sizes:e.breakpoints})));return r==="minWidth"?n.reverse():n}var cre=Object.defineProperty,Bj=Object.getOwnPropertySymbols,ure=Object.prototype.hasOwnProperty,dre=Object.prototype.propertyIsEnumerable,Uj=(e,t,r)=>t in e?cre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fre=(e,t)=>{for(var r in t||(t={}))ure.call(t,r)&&Uj(e,r,t[r]);if(Bj)for(var r of Bj(t))dre.call(t,r)&&Uj(e,r,t[r]);return e},pre=W((e,{spacing:t,breakpoints:r,cols:n,verticalSpacing:o})=>{const i=o!=null,a=lre(e,r).reduce((l,c)=>{var u,d;const p="maxWidth"in c?"max-width":"min-width",h=A({size:p==="max-width"?c.maxWidth:c.minWidth,sizes:e.breakpoints,units:"em"}),m=wr(h)-(p==="max-width"?1:0);return l[`@media (${p}: ${sr(m)})`]={gridTemplateColumns:`repeat(${c.cols}, minmax(0, 1fr))`,gap:`${A({size:(u=c.verticalSpacing)!=null?u:i?o:t,sizes:e.spacing})} ${A({size:(d=c.spacing)!=null?d:t,sizes:e.spacing})}`},l},{});return{root:fre({boxSizing:"border-box",display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:`${A({size:i?o:t,sizes:e.spacing})} ${A({size:t,sizes:e.spacing})}`},a)}});const hre=pre;var mre=Object.defineProperty,Qp=Object.getOwnPropertySymbols,n5=Object.prototype.hasOwnProperty,o5=Object.prototype.propertyIsEnumerable,Wj=(e,t,r)=>t in e?mre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gre=(e,t)=>{for(var r in t||(t={}))n5.call(t,r)&&Wj(e,r,t[r]);if(Qp)for(var r of Qp(t))o5.call(t,r)&&Wj(e,r,t[r]);return e},vre=(e,t)=>{var r={};for(var n in e)n5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qp)for(var n of Qp(e))t.indexOf(n)<0&&o5.call(e,n)&&(r[n]=e[n]);return r};const yre={breakpoints:[],cols:1,spacing:"md"},i5=f.forwardRef((e,t)=>{const r=H("SimpleGrid",yre,e),{className:n,breakpoints:o,cols:i,spacing:a,verticalSpacing:l,children:c,unstyled:u,variant:d}=r,p=vre(r,["className","breakpoints","cols","spacing","verticalSpacing","children","unstyled","variant"]),{classes:h,cx:m}=hre({breakpoints:o,cols:i,spacing:a,verticalSpacing:l},{name:"SimpleGrid",unstyled:u,variant:d});return S.createElement(ae,gre({className:m(h.root,n),ref:t},p),c)});i5.displayName="@mantine/core/SimpleGrid";var xre=Object.defineProperty,Kp=Object.getOwnPropertySymbols,a5=Object.prototype.hasOwnProperty,s5=Object.prototype.propertyIsEnumerable,Hj=(e,t,r)=>t in e?xre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wre=(e,t)=>{for(var r in t||(t={}))a5.call(t,r)&&Hj(e,r,t[r]);if(Kp)for(var r of Kp(t))s5.call(t,r)&&Hj(e,r,t[r]);return e},bre=(e,t)=>{var r={};for(var n in e)a5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Kp)for(var n of Kp(e))t.indexOf(n)<0&&s5.call(e,n)&&(r[n]=e[n]);return r};const _re={w:0,h:0},vm=f.forwardRef((e,t)=>{const r=H("Space",_re,e),{w:n,h:o}=r,i=bre(r,["w","h"]);return S.createElement(ae,wre({ref:t,w:n,miw:n,h:o,mih:o},i))});vm.displayName="@mantine/core/Space";var Sre=W((e,{spacing:t,align:r,justify:n})=>({root:{display:"flex",flexDirection:"column",alignItems:r,justifyContent:n,gap:A({size:t,sizes:e.spacing})}}));const Pre=Sre;var jre=Object.defineProperty,Yp=Object.getOwnPropertySymbols,l5=Object.prototype.hasOwnProperty,c5=Object.prototype.propertyIsEnumerable,qj=(e,t,r)=>t in e?jre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ore=(e,t)=>{for(var r in t||(t={}))l5.call(t,r)&&qj(e,r,t[r]);if(Yp)for(var r of Yp(t))c5.call(t,r)&&qj(e,r,t[r]);return e},Cre=(e,t)=>{var r={};for(var n in e)l5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yp)for(var n of Yp(e))t.indexOf(n)<0&&c5.call(e,n)&&(r[n]=e[n]);return r};const Ere={spacing:"md",align:"stretch",justify:"flex-start"},be=f.forwardRef((e,t)=>{const r=H("Stack",Ere,e),{spacing:n,className:o,align:i,justify:a,unstyled:l,variant:c}=r,u=Cre(r,["spacing","className","align","justify","unstyled","variant"]),{classes:d,cx:p}=Pre({spacing:n,align:i,justify:a},{name:"Stack",unstyled:l,variant:c});return S.createElement(ae,Ore({className:p(d.root,o),ref:t},u))});be.displayName="@mantine/core/Stack";var $re=Object.defineProperty,kre=Object.defineProperties,Rre=Object.getOwnPropertyDescriptors,Gj=Object.getOwnPropertySymbols,Tre=Object.prototype.hasOwnProperty,Ire=Object.prototype.propertyIsEnumerable,Qj=(e,t,r)=>t in e?$re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vg=(e,t)=>{for(var r in t||(t={}))Tre.call(t,r)&&Qj(e,r,t[r]);if(Gj)for(var r of Gj(t))Ire.call(t,r)&&Qj(e,r,t[r]);return e},Dre=(e,t)=>kre(e,Rre(t));const u5={xs:O(34),sm:O(36),md:O(42),lg:O(48),xl:O(52)};var Nre=W((e,{color:t,iconSize:r,radius:n,allowStepClick:o,iconPosition:i,orientation:a},{size:l})=>{const c=r?O(r):A({size:l,sizes:u5}),u=l==="xl"||l==="lg"?e.spacing.md:e.spacing.sm,d=e.fn.radius(n),p=e.fn.variant({variant:"filled",color:t||e.primaryColor,primaryFallback:!1}),h=`calc(${e.spacing.xs} / 2)`,m={step:{justifyContent:"flex-start",minHeight:`calc(${c} + ${e.spacing.xl} + ${h})`,marginTop:h,overflow:"hidden","&:first-of-type":{marginTop:0},[`&:last-of-type .${Vt("verticalSeparator")}`]:{display:"none"}}};return{stepLoader:{},step:Vg({display:"flex",flexDirection:i==="left"?"row":"row-reverse",cursor:o?"pointer":"default"},a==="vertical"?m.step:{alignItems:"center"}),stepWrapper:{position:"relative"},verticalSeparator:{top:`calc(${c} + ${h})`,left:`calc(${c} / 2)`,height:"100vh",position:"absolute",borderLeft:`${O(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,ref:Vt("verticalSeparator")},verticalSeparatorActive:{borderColor:e.fn.variant({variant:"filled",color:t}).background},stepIcon:{boxSizing:"border-box",height:c,width:c,minWidth:c,borderRadius:d,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],border:`${O(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,transition:"background-color 150ms ease, border-color 150ms ease",position:"relative",fontWeight:700,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],fontSize:A({size:l,sizes:e.fontSizes}),"&[data-progress]":{borderColor:p.background},"&[data-completed]":{backgroundColor:p.background,borderColor:p.background,color:e.white}},stepCompletedIcon:Dre(Vg({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.white}),stepBody:Vg({display:"flex",flexDirection:"column",marginLeft:i==="left"?u:void 0,marginRight:i==="right"?u:void 0},a==="vertical"?{marginTop:`calc(${r} / 4)`}:null),stepLabel:{textAlign:i,fontWeight:500,fontSize:A({size:l,sizes:e.fontSizes}),lineHeight:1},stepDescription:{textAlign:i,marginTop:`calc(${A({size:l,sizes:e.spacing})} / 3)`,marginBottom:`calc(${A({size:l,sizes:e.spacing})} / 3)`,fontSize:`calc(${A({size:l,sizes:e.fontSizes})} - ${O(2)})`,lineHeight:1}}});const Are=Nre;var Mre=Object.defineProperty,Xp=Object.getOwnPropertySymbols,d5=Object.prototype.hasOwnProperty,f5=Object.prototype.propertyIsEnumerable,Kj=(e,t,r)=>t in e?Mre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bg=(e,t)=>{for(var r in t||(t={}))d5.call(t,r)&&Kj(e,r,t[r]);if(Xp)for(var r of Xp(t))f5.call(t,r)&&Kj(e,r,t[r]);return e},Lre=(e,t)=>{var r={};for(var n in e)d5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xp)for(var n of Xp(e))t.indexOf(n)<0&&f5.call(e,n)&&(r[n]=e[n]);return r};const zre={xs:16,sm:18,md:20,lg:22,xl:24},Fre={withIcon:!0,size:"md",radius:"xl",allowStepClick:!0,iconPosition:"left",__staticSelector:"Step"},Gu=(e,t)=>typeof e=="function"?S.createElement(e,{step:t}):e,p5=f.forwardRef((e,t)=>{const r=H("StepperStep",Fre,e),{className:n,step:o,state:i,color:a,icon:l,completedIcon:c,progressIcon:u,label:d,description:p,withIcon:h,iconSize:m,size:g,radius:v,loading:_,allowStepClick:y,allowStepSelect:x,iconPosition:w,__staticSelector:b,classNames:j,styles:C,unstyled:P,orientation:E,variant:k}=r,$=Lre(r,["className","step","state","color","icon","completedIcon","progressIcon","label","description","withIcon","iconSize","size","radius","loading","allowStepClick","allowStepSelect","iconPosition","__staticSelector","classNames","styles","unstyled","orientation","variant"]),{classes:I,cx:R}=Are({color:a,iconSize:m,radius:v,allowStepClick:y,iconPosition:w,orientation:E},{name:b,classNames:j,styles:C,unstyled:P,variant:k,size:g}),N=A({size:g,sizes:zre}),M=i==="stepCompleted"?null:i==="stepProgress"?u:l,L={"data-progress":i==="stepProgress"||void 0,"data-completed":i==="stepCompleted"||void 0};return S.createElement(Po,Bg(Bg({className:R(I.step,n),tabIndex:y?0:-1,ref:t},L),$),h&&S.createElement("div",{className:I.stepWrapper},S.createElement("div",Bg({className:I.stepIcon},L),S.createElement(ya,{mounted:i==="stepCompleted",transition:"pop",duration:200},Q=>S.createElement("div",{className:I.stepCompletedIcon,style:Q},_?S.createElement(mn,{color:"#fff",size:N,className:I.stepLoader}):Gu(c,o)||S.createElement(xI,{indeterminate:!1,width:N,height:N}))),i!=="stepCompleted"?_?S.createElement(mn,{size:N,color:a}):Gu(M||l,o):null),E==="vertical"&&S.createElement("div",{className:R(I.verticalSeparator,{[I.verticalSeparatorActive]:i==="stepCompleted"})})),(d||p)&&S.createElement("div",{className:I.stepBody},d&&S.createElement(oe,{className:I.stepLabel},Gu(d,o)),p&&S.createElement(oe,{className:I.stepDescription,color:"dimmed"},Gu(p,o))))});p5.displayName="@mantine/core/Step";function Jp(e){return null}Jp.displayName="@mantine/core/StepCompleted";var Vre=Object.defineProperty,Bre=Object.defineProperties,Ure=Object.getOwnPropertyDescriptors,Yj=Object.getOwnPropertySymbols,Wre=Object.prototype.hasOwnProperty,Hre=Object.prototype.propertyIsEnumerable,Xj=(e,t,r)=>t in e?Vre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hl=(e,t)=>{for(var r in t||(t={}))Wre.call(t,r)&&Xj(e,r,t[r]);if(Yj)for(var r of Yj(t))Hre.call(t,r)&&Xj(e,r,t[r]);return e},qre=(e,t)=>Bre(e,Ure(t)),Gre=W((e,{contentPadding:t,color:r,orientation:n,iconPosition:o,iconSize:i,breakpoint:a},{size:l})=>{const c=typeof a<"u",u=wr(A({size:a,sizes:e.breakpoints})),d=typeof i<"u"?`calc(${O(i)} / 2 - ${O(1)})`:`calc(${A({size:l,sizes:u5})} / 2 - ${O(1)})`,p={steps:{flexDirection:"column",alignItems:o==="left"?"flex-start":"flex-end"},separator:{width:O(2),minHeight:e.spacing.xl,marginLeft:o==="left"?d:0,marginRight:o==="right"?d:0,marginTop:`calc(${e.spacing.xs} / 2)`,marginBottom:`calc(${e.spacing.xs} - ${O(2)})`}},h={steps:{[`@media (max-width: ${sr(u-1)})`]:p.steps},separator:{[`@media (max-width: ${sr(u-1)})`]:p.separator}};return{root:{},steps:hl(hl({display:"flex",boxSizing:"border-box",alignItems:"center"},n==="vertical"?p.steps:null),c?h.steps:null),separator:hl(hl({boxSizing:"border-box",transition:"background-color 150ms ease",flex:1,height:O(2),backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],marginLeft:e.spacing.md,marginRight:e.spacing.md},n==="vertical"?p.separator:null),c?h.separator:null),separatorActive:{backgroundColor:e.fn.variant({variant:"filled",color:r||e.primaryColor,primaryFallback:!1}).background},content:qre(hl({},e.fn.fontStyles()),{paddingTop:A({size:t,sizes:e.spacing})})}});const Qre=Gre;var Kre=Object.defineProperty,Zp=Object.getOwnPropertySymbols,h5=Object.prototype.hasOwnProperty,m5=Object.prototype.propertyIsEnumerable,Jj=(e,t,r)=>t in e?Kre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yre=(e,t)=>{for(var r in t||(t={}))h5.call(t,r)&&Jj(e,r,t[r]);if(Zp)for(var r of Zp(t))m5.call(t,r)&&Jj(e,r,t[r]);return e},Xre=(e,t)=>{var r={};for(var n in e)h5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zp)for(var n of Zp(e))t.indexOf(n)<0&&m5.call(e,n)&&(r[n]=e[n]);return r};const Jre={contentPadding:"md",size:"md",radius:"xl",orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0},pc=f.forwardRef((e,t)=>{var r,n,o;const i=H("Stepper",Jre,e),{className:a,children:l,onStepClick:c,active:u,icon:d,completedIcon:p,progressIcon:h,color:m,iconSize:g,contentPadding:v,size:_,radius:y,orientation:x,breakpoint:w,iconPosition:b,allowNextStepsSelect:j,classNames:C,styles:P,unstyled:E,variant:k}=i,$=Xre(i,["className","children","onStepClick","active","icon","completedIcon","progressIcon","color","iconSize","contentPadding","size","radius","orientation","breakpoint","iconPosition","allowNextStepsSelect","classNames","styles","unstyled","variant"]),{classes:I,cx:R}=Qre({contentPadding:v,color:m,orientation:x,iconPosition:b,iconSize:g,breakpoint:w},{name:"Stepper",classNames:C,styles:P,unstyled:E,variant:k,size:_}),N=f.Children.toArray(l),M=N.filter(V=>V.type!==Jp),L=N.find(V=>V.type===Jp),Q=M.reduce((V,X,J)=>{const _e=u===J?"stepProgress":u>J?"stepCompleted":"stepInactive",Xe=typeof c!="function"?!1:typeof X.props.allowStepSelect=="boolean"?X.props.allowStepSelect:_e==="stepCompleted"||j;return V.push(f.cloneElement(X,{__staticSelector:"Stepper",icon:X.props.icon||d||J+1,key:J,step:J,variant:k,state:_e,onClick:()=>Xe&&c(J),allowStepClick:Xe,completedIcon:X.props.completedIcon||p,progressIcon:X.props.progressIcon||h,color:X.props.color||m,iconSize:g,size:_,radius:y,classNames:C,styles:P,iconPosition:X.props.iconPosition||b,orientation:x,unstyled:E})),x==="horizontal"&&J!==M.length-1&&V.push(S.createElement("div",{className:R(I.separator,{[I.separatorActive]:J<u}),key:`separator-${J}`})),V},[]),G=(n=(r=M[u])==null?void 0:r.props)==null?void 0:n.children,T=(o=L==null?void 0:L.props)==null?void 0:o.children,F=u>M.length-1?T:G;return S.createElement(ae,Yre({className:R(I.root,a),ref:t},$),S.createElement("div",{className:I.steps},Q),F&&S.createElement("div",{className:I.content},F))});pc.Step=p5;pc.Completed=Jp;pc.displayName="@mantine/core/Stepper";const g5=f.createContext(null),Zre=g5.Provider,ene=()=>f.useContext(g5);var tne=Object.defineProperty,eh=Object.getOwnPropertySymbols,v5=Object.prototype.hasOwnProperty,y5=Object.prototype.propertyIsEnumerable,Zj=(e,t,r)=>t in e?tne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eO=(e,t)=>{for(var r in t||(t={}))v5.call(t,r)&&Zj(e,r,t[r]);if(eh)for(var r of eh(t))y5.call(t,r)&&Zj(e,r,t[r]);return e},rne=(e,t)=>{var r={};for(var n in e)v5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&eh)for(var n of eh(e))t.indexOf(n)<0&&y5.call(e,n)&&(r[n]=e[n]);return r};const nne={size:"sm"},x5=f.forwardRef((e,t)=>{const r=H("SwitchGroup",nne,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c}=r,u=rne(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=Ir({value:o,defaultValue:i,finalValue:[],onChange:a}),h=m=>{const g=m.currentTarget.value;p(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return S.createElement(Zre,{value:{value:d,onChange:h,size:l}},S.createElement(Ut.Wrapper,eO(eO({labelElement:"div",size:l,__staticSelector:"SwitchGroup",ref:t},c),u),n))});x5.displayName="@mantine/core/SwitchGroup";var one=Object.defineProperty,ine=Object.defineProperties,ane=Object.getOwnPropertyDescriptors,tO=Object.getOwnPropertySymbols,sne=Object.prototype.hasOwnProperty,lne=Object.prototype.propertyIsEnumerable,rO=(e,t,r)=>t in e?one(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cne=(e,t)=>{for(var r in t||(t={}))sne.call(t,r)&&rO(e,r,t[r]);if(tO)for(var r of tO(t))lne.call(t,r)&&rO(e,r,t[r]);return e},une=(e,t)=>ine(e,ane(t));const dne={xs:O(16),sm:O(20),md:O(24),lg:O(30),xl:O(36)},fne={xs:O(32),sm:O(38),md:O(46),lg:O(56),xl:O(72)},pne={xs:O(12),sm:O(14),md:O(18),lg:O(22),xl:O(28)},hne={xs:O(5),sm:O(6),md:O(7),lg:O(9),xl:O(11)},mne={xs:O(4),sm:O(5),md:O(6),lg:O(8),xl:O(10)};var gne=W((e,{radius:t,color:r,labelPosition:n,error:o},{size:i})=>{const a=A({size:i,sizes:pne}),l=A({size:t,sizes:e.radius}),c=e.fn.variant({variant:"filled",color:r}),u=A({size:i,sizes:fne}),d=O(i==="xs"?1:2),p=e.fn.variant({variant:"filled",color:"red"}).background;return{root:{position:"relative"},input:{height:0,width:0,overflow:"hidden",whiteSpace:"nowrap",padding:0,WebkitClipPath:"inset(50%)",clipPath:"inset(50%)",position:"absolute"},track:une(cne({},e.fn.focusStyles("input:focus + &")),{cursor:e.cursorType,overflow:"hidden",WebkitTapHighlightColor:"transparent",position:"relative",borderRadius:l,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[2],border:`${O(1)} solid ${o?p:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,height:A({size:i,sizes:dne}),minWidth:u,margin:0,transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:"150ms",boxSizing:"border-box",appearance:"none",display:"flex",alignItems:"center",fontSize:A({size:i,sizes:hne}),fontWeight:600,order:n==="left"?2:1,userSelect:"none",zIndex:0,lineHeight:0,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[6],transition:`color 150ms ${e.transitionTimingFunction}`,"input:checked + &":{backgroundColor:c.background,borderColor:c.background,color:e.white,transition:`color 150ms ${e.transitionTimingFunction}`},"input:disabled + &":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],cursor:"not-allowed",pointerEvents:"none"}}),thumb:{position:"absolute",zIndex:1,borderRadius:l,boxSizing:"border-box",display:"flex",backgroundColor:e.white,height:a,width:a,border:`${O(1)} solid ${e.colorScheme==="dark"?e.white:e.colors.gray[3]}`,left:d,transition:`left 150ms ${e.transitionTimingFunction}`,"& > *":{margin:"auto"},"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":""},"input:checked + * > &":{left:`calc(100% - ${a} - ${d})`,borderColor:e.white},"input:disabled + * > &":{borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],backgroundColor:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[0]}},trackLabel:{height:"100%",display:"grid",placeContent:"center",minWidth:`calc(${u} - ${a})`,paddingInline:A({size:i,sizes:mne}),marginLeft:`calc(${a} + ${d})`,transition:`margin 150ms ${e.transitionTimingFunction}`,"input:checked + * > &":{marginLeft:0,marginRight:`calc(${a} + ${d})`}}}});const vne=gne;var yne=Object.defineProperty,xne=Object.defineProperties,wne=Object.getOwnPropertyDescriptors,th=Object.getOwnPropertySymbols,w5=Object.prototype.hasOwnProperty,b5=Object.prototype.propertyIsEnumerable,nO=(e,t,r)=>t in e?yne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ug=(e,t)=>{for(var r in t||(t={}))w5.call(t,r)&&nO(e,r,t[r]);if(th)for(var r of th(t))b5.call(t,r)&&nO(e,r,t[r]);return e},bne=(e,t)=>xne(e,wne(t)),_ne=(e,t)=>{var r={};for(var n in e)w5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&th)for(var n of th(e))t.indexOf(n)<0&&b5.call(e,n)&&(r[n]=e[n]);return r};const Sne={offLabel:"",onLabel:"",size:"sm",radius:"xl",error:!1},ym=f.forwardRef((e,t)=>{var r;const n=H("Switch",Sne,e),{className:o,color:i,label:a,offLabel:l,onLabel:c,id:u,style:d,size:p,radius:h,wrapperProps:m,children:g,unstyled:v,styles:_,classNames:y,thumbIcon:x,sx:w,checked:b,defaultChecked:j,onChange:C,labelPosition:P,description:E,error:k,disabled:$,variant:I}=n,R=_ne(n,["className","color","label","offLabel","onLabel","id","style","size","radius","wrapperProps","children","unstyled","styles","classNames","thumbIcon","sx","checked","defaultChecked","onChange","labelPosition","description","error","disabled","variant"]),N=ene(),M=(N==null?void 0:N.size)||p,{classes:L,cx:Q}=vne({color:i,radius:h,labelPosition:P,error:!!k},{name:"Switch",classNames:y,styles:_,unstyled:v,size:M,variant:I}),{systemStyles:G,rest:T}=ao(R),F=Ar(u),V=N?{checked:N.value.includes(T.value),onChange:N.onChange}:{},[X,J]=Ir({value:(r=V.checked)!=null?r:b,defaultValue:j,finalValue:!1});return S.createElement(dm,Ug(Ug({className:Q(o,L.root),sx:w,style:d,id:F,size:(N==null?void 0:N.size)||p,labelPosition:P,label:a,description:E,error:k,disabled:$,__staticSelector:"Switch",classNames:y,styles:_,unstyled:v,"data-checked":V.checked||void 0,variant:I},G),m),S.createElement("input",bne(Ug({},T),{disabled:$,checked:X,onChange:_e=>{N?V.onChange(_e):C==null||C(_e),J(_e.currentTarget.checked)},id:F,ref:t,type:"checkbox",className:L.input})),S.createElement("label",{htmlFor:F,className:L.track},S.createElement("div",{className:L.thumb},x),S.createElement("div",{className:L.trackLabel},X?c:l)))});ym.displayName="@mantine/core/Switch";ym.Group=x5;var Pne=Object.defineProperty,jne=Object.defineProperties,One=Object.getOwnPropertyDescriptors,oO=Object.getOwnPropertySymbols,Cne=Object.prototype.hasOwnProperty,Ene=Object.prototype.propertyIsEnumerable,iO=(e,t,r)=>t in e?Pne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$ne=(e,t)=>{for(var r in t||(t={}))Cne.call(t,r)&&iO(e,r,t[r]);if(oO)for(var r of oO(t))Ene.call(t,r)&&iO(e,r,t[r]);return e},kne=(e,t)=>jne(e,One(t)),Rne=W((e,{captionSide:t,horizontalSpacing:r,verticalSpacing:n,fontSize:o,withBorder:i,withColumnBorders:a})=>{const l=`${O(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`;return{root:kne($ne({},e.fn.fontStyles()),{width:"100%",borderCollapse:"collapse",captionSide:t,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,border:i?l:void 0,"& > caption":{marginTop:t==="top"?0:e.spacing.xs,marginBottom:t==="bottom"?0:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& > thead > tr > th, & > tfoot > tr > th, & > tbody > tr > th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:A({size:o,sizes:e.fontSizes}),padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`},"& > thead > tr > th":{borderBottom:l},"& > tfoot > tr > th, & > tbody > tr > th":{borderTop:l},"& > tbody > tr > td":{padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`,borderTop:l,fontSize:A({size:o,sizes:e.fontSizes})},"& > tbody > tr:first-of-type > td, & > tbody > tr:first-of-type > th":{borderTop:"none"},"& > thead > tr > th, & > tbody > tr > td":{borderRight:a?l:"none","&:last-of-type":{borderRight:"none",borderLeft:a?l:"none"}},"& > tbody > tr > th":{borderRight:a?l:"none"},"&[data-striped] > tbody > tr:nth-of-type(odd)":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]},"&[data-hover] > tbody > tr":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})})}});const Tne=Rne;var Ine=Object.defineProperty,Dne=Object.defineProperties,Nne=Object.getOwnPropertyDescriptors,rh=Object.getOwnPropertySymbols,_5=Object.prototype.hasOwnProperty,S5=Object.prototype.propertyIsEnumerable,aO=(e,t,r)=>t in e?Ine(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ane=(e,t)=>{for(var r in t||(t={}))_5.call(t,r)&&aO(e,r,t[r]);if(rh)for(var r of rh(t))S5.call(t,r)&&aO(e,r,t[r]);return e},Mne=(e,t)=>Dne(e,Nne(t)),Lne=(e,t)=>{var r={};for(var n in e)_5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rh)for(var n of rh(e))t.indexOf(n)<0&&S5.call(e,n)&&(r[n]=e[n]);return r};const zne={striped:!1,highlightOnHover:!1,captionSide:"top",horizontalSpacing:"xs",fontSize:"sm",verticalSpacing:7,withBorder:!1,withColumnBorders:!1},wa=f.forwardRef((e,t)=>{const r=H("Table",zne,e),{className:n,children:o,striped:i,highlightOnHover:a,captionSide:l,horizontalSpacing:c,verticalSpacing:u,fontSize:d,unstyled:p,withBorder:h,withColumnBorders:m,variant:g}=r,v=Lne(r,["className","children","striped","highlightOnHover","captionSide","horizontalSpacing","verticalSpacing","fontSize","unstyled","withBorder","withColumnBorders","variant"]),{classes:_,cx:y}=Tne({captionSide:l,verticalSpacing:u,horizontalSpacing:c,fontSize:d,withBorder:h,withColumnBorders:m},{unstyled:p,name:"Table",variant:g});return S.createElement(ae,Mne(Ane({},v),{component:"table",ref:t,className:y(_.root,n),"data-striped":i||void 0,"data-hover":a||void 0}),o)});wa.displayName="@mantine/core/Table";const my={context:"Tabs component was not found in the tree",value:"Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value"},[Fne,bx]=No(my.context);var Vne=Object.defineProperty,sO=Object.getOwnPropertySymbols,Bne=Object.prototype.hasOwnProperty,Une=Object.prototype.propertyIsEnumerable,lO=(e,t,r)=>t in e?Vne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wne=(e,t)=>{for(var r in t||(t={}))Bne.call(t,r)&&lO(e,r,t[r]);if(sO)for(var r of sO(t))Une.call(t,r)&&lO(e,r,t[r]);return e};function Hne({orientation:e,inverted:t,placement:r},n,o){const i=e==="vertical";return o==="default"?{[i?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${O(2)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="outline"?{[i?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${O(1)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="pills"?{gap:`calc(${n.spacing.sm} / 2)`}:{}}var qne=W((e,t,{variant:r})=>{const n=t.orientation==="vertical";return{tabsList:Wne({display:"flex",flexWrap:"wrap",flexDirection:n?"column":"row",justifyContent:cD[t.position],'& [role="tab"]':{flex:t.grow?1:void 0}},Hne(t,e,r))}});const Gne=qne;var Qne=Object.defineProperty,Kne=Object.defineProperties,Yne=Object.getOwnPropertyDescriptors,nh=Object.getOwnPropertySymbols,P5=Object.prototype.hasOwnProperty,j5=Object.prototype.propertyIsEnumerable,cO=(e,t,r)=>t in e?Qne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xne=(e,t)=>{for(var r in t||(t={}))P5.call(t,r)&&cO(e,r,t[r]);if(nh)for(var r of nh(t))j5.call(t,r)&&cO(e,r,t[r]);return e},Jne=(e,t)=>Kne(e,Yne(t)),Zne=(e,t)=>{var r={};for(var n in e)P5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nh)for(var n of nh(e))t.indexOf(n)<0&&j5.call(e,n)&&(r[n]=e[n]);return r};const eoe={grow:!1,position:"left"},O5=f.forwardRef((e,t)=>{const r=H("TabsList",eoe,e),{children:n,className:o,grow:i,position:a}=r,l=Zne(r,["children","className","grow","position"]),{orientation:c,variant:u,color:d,radius:p,inverted:h,placement:m,classNames:g,styles:v,unstyled:_}=bx(),{classes:y,cx:x}=Gne({orientation:c,grow:i,color:d,position:a,radius:p,inverted:h,placement:m},{name:"Tabs",unstyled:_,classNames:g,styles:v,variant:u});return S.createElement(ae,Jne(Xne({},l),{className:x(y.tabsList,o),ref:t,role:"tablist","aria-orientation":c}),n)});O5.displayName="@mantine/core/TabsList";var toe=W((e,{orientation:t})=>({panel:{flex:t==="vertical"?1:void 0}}));const roe=toe;var noe=Object.defineProperty,ooe=Object.defineProperties,ioe=Object.getOwnPropertyDescriptors,oh=Object.getOwnPropertySymbols,C5=Object.prototype.hasOwnProperty,E5=Object.prototype.propertyIsEnumerable,uO=(e,t,r)=>t in e?noe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aoe=(e,t)=>{for(var r in t||(t={}))C5.call(t,r)&&uO(e,r,t[r]);if(oh)for(var r of oh(t))E5.call(t,r)&&uO(e,r,t[r]);return e},soe=(e,t)=>ooe(e,ioe(t)),loe=(e,t)=>{var r={};for(var n in e)C5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&oh)for(var n of oh(e))t.indexOf(n)<0&&E5.call(e,n)&&(r[n]=e[n]);return r};const coe={},$5=f.forwardRef((e,t)=>{const r=H("TabsPanel",coe,e),{value:n,children:o,sx:i,className:a}=r,l=loe(r,["value","children","sx","className"]),c=bx(),{classes:u,cx:d}=roe({orientation:c.orientation,color:c.color,radius:c.radius,inverted:c.inverted,placement:c.placement},{name:"Tabs",unstyled:c.unstyled,classNames:c.classNames,styles:c.styles,variant:c.variant}),p=c.getPanelId(n),h=c.value===n,m=c.keepMounted||h?o:null;return f.useEffect(()=>(c.setMountedPanelIds(g=>[...g,p]),c.setMountedPanelIds(g=>g.filter(v=>v!==p))),[p]),S.createElement(ae,soe(aoe({},l),{ref:t,sx:[{display:h?void 0:"none"},..._c(i)],className:d(u.panel,a),role:"tabpanel",id:p,"aria-labelledby":c.getTabId(n)}),m)});$5.displayName="@mantine/core/TabsPanel";var uoe=Object.defineProperty,doe=Object.defineProperties,foe=Object.getOwnPropertyDescriptors,dO=Object.getOwnPropertySymbols,poe=Object.prototype.hasOwnProperty,hoe=Object.prototype.propertyIsEnumerable,fO=(e,t,r)=>t in e?uoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Za=(e,t)=>{for(var r in t||(t={}))poe.call(t,r)&&fO(e,r,t[r]);if(dO)for(var r of dO(t))hoe.call(t,r)&&fO(e,r,t[r]);return e},pO=(e,t)=>doe(e,foe(t));function moe(e,{orientation:t,color:r,radius:n,inverted:o,placement:i},a){const l=t==="vertical",c=e.fn.variant({color:r,variant:"filled"}),u=O(e.fn.radius(n)),d=t==="vertical"?i==="left"?`${u} 0 0 ${u}`:` 0 ${u} ${u} 0`:o?`0 0 ${u} ${u}`:`${u} ${u} 0 0`;return a==="default"?pO(Za({[l?i==="left"?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:`${O(2)} solid transparent`,[l?i==="left"?"marginRight":"marginLeft":o?"marginTop":"marginBottom"]:O(-2),borderRadius:d},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]})),{"&[data-active]":Za({borderColor:c.background,color:e.colorScheme==="dark"?e.white:e.black},e.fn.hover({borderColor:c.background}))}):a==="outline"?{borderRadius:d,border:`${O(1)} solid transparent`,[l?i==="left"?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:"none","&[data-active]":{borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3],"&::before":{content:'""',backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,position:"absolute",bottom:l?0:o?"unset":O(-1),top:l?0:o?O(-1):"unset",[l?"width":"height"]:O(1),right:l?i==="left"?O(-1):"unset":0,left:l?i==="left"?"unset":O(-1):0}}}:a==="pills"?pO(Za({borderRadius:e.fn.radius(n)},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]})),{"&[data-active]":Za({backgroundColor:c.background,color:e.white},e.fn.hover({backgroundColor:c.background}))}):{}}var goe=W((e,t,{variant:r})=>({tabLabel:{},tab:Za({position:"relative",padding:`${e.spacing.xs} ${e.spacing.md}`,paddingLeft:t.withIcon?e.spacing.xs:void 0,paddingRight:t.withRightSection?e.spacing.xs:void 0,fontSize:e.fontSizes.sm,whiteSpace:"nowrap",zIndex:0,display:"flex",alignItems:"center",justifyContent:t.orientation==="horizontal"?"center":void 0,lineHeight:1,"&:disabled":Za({opacity:.5,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),"&:focus":{zIndex:1}},moe(e,t,r)),tabRightSection:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginLeft:O(7)}},tabIcon:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginRight:O(7)}}}));const voe=goe;var yoe=Object.defineProperty,xoe=Object.defineProperties,woe=Object.getOwnPropertyDescriptors,ih=Object.getOwnPropertySymbols,k5=Object.prototype.hasOwnProperty,R5=Object.prototype.propertyIsEnumerable,hO=(e,t,r)=>t in e?yoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,boe=(e,t)=>{for(var r in t||(t={}))k5.call(t,r)&&hO(e,r,t[r]);if(ih)for(var r of ih(t))R5.call(t,r)&&hO(e,r,t[r]);return e},_oe=(e,t)=>xoe(e,woe(t)),Soe=(e,t)=>{var r={};for(var n in e)k5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ih)for(var n of ih(e))t.indexOf(n)<0&&R5.call(e,n)&&(r[n]=e[n]);return r};const Poe={},T5=f.forwardRef((e,t)=>{const r=H("TabsTab",Poe,e),{value:n,children:o,onKeyDown:i,onClick:a,className:l,icon:c,rightSection:u,color:d}=r,p=Soe(r,["value","children","onKeyDown","onClick","className","icon","rightSection","color"]),h=bx(),m=!!c,g=!!u,{theme:v,classes:_,cx:y}=voe({withIcon:m||g&&!o,withRightSection:g||m&&!o,orientation:h.orientation,color:d||h.color,radius:h.radius,inverted:h.inverted,placement:h.placement},{name:"Tabs",unstyled:h.unstyled,classNames:h.classNames,styles:h.styles,variant:h.variant}),x=n===h.value,w=h.getPanelId(n),b=h.mountedPanelIds.includes(n)?w:void 0,j=C=>{h.onTabChange(h.allowTabDeactivation&&n===h.value?null:n),a==null||a(C)};return S.createElement(Po,_oe(boe({},p),{unstyled:h.unstyled,className:y(_.tab,l),"data-active":x||void 0,ref:t,type:"button",role:"tab",id:h.getTabId(n),"aria-selected":x,tabIndex:x||h.value===null?0:-1,"aria-controls":b,onClick:j,onKeyDown:AE({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:h.activateTabWithKeyboard,loop:h.loop,dir:v.dir,orientation:h.orientation,onKeyDown:i})}),c&&S.createElement("span",{className:_.tabIcon},c),o&&S.createElement("span",{className:_.tabLabel},o),u&&S.createElement("span",{className:_.tabRightSection},u))});T5.displayName="@mantine/core/Tab";function I5({defaultValue:e,value:t,onTabChange:r,orientation:n,children:o,loop:i,id:a,activateTabWithKeyboard:l,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,placement:m,keepMounted:g=!0,classNames:v,styles:_,unstyled:y}){const x=Ar(a),[w,b]=f.useState([]),[j,C]=Ir({value:t,defaultValue:e,finalValue:null,onChange:r});return S.createElement(Fne,{value:{placement:m,value:j,orientation:n,id:x,loop:i,activateTabWithKeyboard:l,getTabId:N1(`${x}-tab`,my.value),getPanelId:N1(`${x}-panel`,my.value),onTabChange:C,setMountedPanelIds:b,mountedPanelIds:w,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,keepMounted:g,classNames:v,styles:_,unstyled:y}},o)}I5.displayName="@mantine/core/TabsProvider";var joe=W((e,{orientation:t,placement:r})=>({root:{display:t==="vertical"?"flex":void 0,flexDirection:r==="right"?"row-reverse":"row"}}));const Ooe=joe;var Coe=Object.defineProperty,Eoe=Object.defineProperties,$oe=Object.getOwnPropertyDescriptors,ah=Object.getOwnPropertySymbols,D5=Object.prototype.hasOwnProperty,N5=Object.prototype.propertyIsEnumerable,mO=(e,t,r)=>t in e?Coe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,koe=(e,t)=>{for(var r in t||(t={}))D5.call(t,r)&&mO(e,r,t[r]);if(ah)for(var r of ah(t))N5.call(t,r)&&mO(e,r,t[r]);return e},Roe=(e,t)=>Eoe(e,$oe(t)),Toe=(e,t)=>{var r={};for(var n in e)D5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ah)for(var n of ah(e))t.indexOf(n)<0&&N5.call(e,n)&&(r[n]=e[n]);return r};const Ioe={orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},ze=f.forwardRef((e,t)=>{const r=H("Tabs",Ioe,e),{defaultValue:n,value:o,orientation:i,loop:a,activateTabWithKeyboard:l,allowTabDeactivation:c,children:u,id:d,onTabChange:p,variant:h,color:m,className:g,unstyled:v,classNames:_,styles:y,radius:x,inverted:w,keepMounted:b,placement:j}=r,C=Toe(r,["defaultValue","value","orientation","loop","activateTabWithKeyboard","allowTabDeactivation","children","id","onTabChange","variant","color","className","unstyled","classNames","styles","radius","inverted","keepMounted","placement"]),{classes:P,cx:E}=Ooe({orientation:i,color:m,radius:x,inverted:w,placement:j},{unstyled:v,name:"Tabs",classNames:_,styles:y,variant:h});return S.createElement(I5,{activateTabWithKeyboard:l,defaultValue:n,orientation:i,onTabChange:p,value:o,id:d,loop:a,allowTabDeactivation:c,color:m,variant:h,radius:x,inverted:w,keepMounted:b,placement:j,classNames:_,styles:y,unstyled:v},S.createElement(ae,Roe(koe({},C),{className:E(P.root,g),id:d,ref:t}),u))});ze.List=O5;ze.Tab=T5;ze.Panel=$5;ze.displayName="@mantine/core/Tabs";var Doe=Object.defineProperty,Noe=Object.defineProperties,Aoe=Object.getOwnPropertyDescriptors,gO=Object.getOwnPropertySymbols,Moe=Object.prototype.hasOwnProperty,Loe=Object.prototype.propertyIsEnumerable,vO=(e,t,r)=>t in e?Doe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yO=(e,t)=>{for(var r in t||(t={}))Moe.call(t,r)&&vO(e,r,t[r]);if(gO)for(var r of gO(t))Loe.call(t,r)&&vO(e,r,t[r]);return e},zoe=(e,t)=>Noe(e,Aoe(t));const Foe={xs:O(16),sm:O(20),md:O(26),lg:O(32),xl:O(40)},Voe=["filled","light","gradient","outline","default"];function Boe({theme:e,variant:t,color:r,gradient:n}){if(!Voe.includes(t))return null;const o=e.fn.variant({variant:t,color:r||e.primaryColor,gradient:n,primaryFallback:!1});return{backgroundColor:o.background,color:o.color,backgroundImage:t==="gradient"?o.background:void 0,border:`${O(t==="gradient"?0:1)} solid ${o.border}`}}var Uoe=W((e,{color:t,radius:r,gradient:n},{variant:o,size:i})=>{const a=A({size:i,sizes:Foe});return{root:yO(zoe(yO({},e.fn.fontStyles()),{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:a,height:a,minWidth:a,minHeight:a,borderRadius:e.fn.radius(r)}),Boe({theme:e,variant:o,gradient:n,color:t}))}});const Woe=Uoe;var Hoe=Object.defineProperty,sh=Object.getOwnPropertySymbols,A5=Object.prototype.hasOwnProperty,M5=Object.prototype.propertyIsEnumerable,xO=(e,t,r)=>t in e?Hoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qoe=(e,t)=>{for(var r in t||(t={}))A5.call(t,r)&&xO(e,r,t[r]);if(sh)for(var r of sh(t))M5.call(t,r)&&xO(e,r,t[r]);return e},Goe=(e,t)=>{var r={};for(var n in e)A5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sh)for(var n of sh(e))t.indexOf(n)<0&&M5.call(e,n)&&(r[n]=e[n]);return r};const Qoe={size:"md",variant:"filled"},L5=f.forwardRef((e,t)=>{const r=H("ThemeIcon",Qoe,e),{className:n,size:o,radius:i,variant:a,color:l,children:c,gradient:u,unstyled:d}=r,p=Goe(r,["className","size","radius","variant","color","children","gradient","unstyled"]),{classes:h,cx:m}=Woe({variant:a,radius:i,color:l,gradient:u},{name:"ThemeIcon",unstyled:d,variant:a,size:o});return S.createElement(ae,qoe({className:m(h.root,n),ref:t},p),c)});L5.displayName="@mantine/core/ThemeIcon";var Koe=Object.defineProperty,Yoe=Object.defineProperties,Xoe=Object.getOwnPropertyDescriptors,wO=Object.getOwnPropertySymbols,Joe=Object.prototype.hasOwnProperty,Zoe=Object.prototype.propertyIsEnumerable,bO=(e,t,r)=>t in e?Koe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eie=(e,t)=>{for(var r in t||(t={}))Joe.call(t,r)&&bO(e,r,t[r]);if(wO)for(var r of wO(t))Zoe.call(t,r)&&bO(e,r,t[r]);return e},tie=(e,t)=>Yoe(e,Xoe(t));function rie(e,t,r){return typeof e<"u"?e in r.headings.sizes?r.headings.sizes[e].fontSize:O(e):r.headings.sizes[t].fontSize}function nie(e,t,r){return typeof e<"u"&&e in r.headings.sizes?r.headings.sizes[e].lineHeight:r.headings.sizes[t].lineHeight}var oie=W((e,{element:t,weight:r,inline:n},{size:o})=>({root:tie(eie({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:r||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:rie(o,t,e),lineHeight:n?1:nie(o,t,e),margin:0})}));const iie=oie;var aie=Object.defineProperty,lh=Object.getOwnPropertySymbols,z5=Object.prototype.hasOwnProperty,F5=Object.prototype.propertyIsEnumerable,_O=(e,t,r)=>t in e?aie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sie=(e,t)=>{for(var r in t||(t={}))z5.call(t,r)&&_O(e,r,t[r]);if(lh)for(var r of lh(t))F5.call(t,r)&&_O(e,r,t[r]);return e},lie=(e,t)=>{var r={};for(var n in e)z5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&lh)for(var n of lh(e))t.indexOf(n)<0&&F5.call(e,n)&&(r[n]=e[n]);return r};const cie={order:1},ue=f.forwardRef((e,t)=>{const r=H("Title",cie,e),{className:n,order:o,children:i,unstyled:a,size:l,weight:c,inline:u,variant:d}=r,p=lie(r,["className","order","children","unstyled","size","weight","inline","variant"]),{classes:h,cx:m}=iie({element:`h${o}`,weight:c,inline:u},{name:"Title",unstyled:a,variant:d,size:l});return[1,2,3,4,5,6].includes(o)?S.createElement(oe,sie({variant:d,component:`h${o}`,ref:t,className:m(h.root,n)},p),i):null});ue.displayName="@mantine/core/Title";function gy(e,t){return gy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},gy(e,t)}function V5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,gy(e,t)}var B5={exports:{}},uie="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",die=uie,fie=die;function U5(){}function W5(){}W5.resetWarningCache=U5;var pie=function(){function e(n,o,i,a,l,c){if(c!==fie){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:W5,resetWarningCache:U5};return r.PropTypes=r,r};B5.exports=pie();var hie=B5.exports;const De=By(hie),SO={disabled:!1},ch=S.createContext(null);var El="unmounted",Ui="exited",Wi="entering",Fa="entered",vy="exiting",Fo=function(e){V5(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=o,l=a&&!a.isMounting?n.enter:n.appear,c;return i.appearStatus=null,n.in?l?(c=Ui,i.appearStatus=Wi):c=Fa:n.unmountOnExit||n.mountOnEnter?c=El:c=Ui,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===El?{status:Ui}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==Wi&&a!==Fa&&(i=Wi):(a===Wi||a===Fa)&&(i=vy)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},r.updateStatus=function(o,i){o===void 0&&(o=!1),i!==null?(this.cancelNextCallback(),i===Wi?this.performEnter(o):this.performExit()):this.props.unmountOnExit&&this.state.status===Ui&&this.setState({status:El})},r.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[md.findDOMNode(this),l],u=c[0],d=c[1],p=this.getTimeouts(),h=l?p.appear:p.enter;if(!o&&!a||SO.disabled){this.safeSetState({status:Fa},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Wi},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Fa},function(){i.props.onEntered(u,d)})})})},r.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:md.findDOMNode(this);if(!i||SO.disabled){this.safeSetState({status:Ui},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:vy},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:Ui},function(){o.props.onExited(l)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:md.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===El)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=vx(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S.createElement(ch.Provider,{value:null},typeof a=="function"?a(o,l):S.cloneElement(S.Children.only(a),l))},t}(S.Component);Fo.contextType=ch;Fo.propTypes={};function Na(){}Fo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Na,onEntering:Na,onEntered:Na,onExit:Na,onExiting:Na,onExited:Na};Fo.UNMOUNTED=El;Fo.EXITED=Ui;Fo.ENTERING=Wi;Fo.ENTERED=Fa;Fo.EXITING=vy;const mie=Fo;function gie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _x(e,t){var r=function(i){return t&&f.isValidElement(i)?t(i):i},n=Object.create(null);return e&&f.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function vie(e,t){e=e||{},t=t||{};function r(d){return d in t?t[d]:e[d]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var a,l={};for(var c in t){if(n[c])for(a=0;a<n[c].length;a++){var u=n[c][a];l[n[c][a]]=r(u)}l[c]=r(c)}for(a=0;a<o.length;a++)l[o[a]]=r(o[a]);return l}function Yi(e,t,r){return r[t]!=null?r[t]:e.props[t]}function yie(e,t){return _x(e.children,function(r){return f.cloneElement(r,{onExited:t.bind(null,r),in:!0,appear:Yi(r,"appear",e),enter:Yi(r,"enter",e),exit:Yi(r,"exit",e)})})}function xie(e,t,r){var n=_x(e.children),o=vie(t,n);return Object.keys(o).forEach(function(i){var a=o[i];if(f.isValidElement(a)){var l=i in t,c=i in n,u=t[i],d=f.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=f.cloneElement(a,{onExited:r.bind(null,a),in:!0,exit:Yi(a,"exit",e),enter:Yi(a,"enter",e)}):!c&&l&&!d?o[i]=f.cloneElement(a,{in:!1}):c&&l&&f.isValidElement(u)&&(o[i]=f.cloneElement(a,{onExited:r.bind(null,a),in:u.props.in,exit:Yi(a,"exit",e),enter:Yi(a,"enter",e)}))}}),o}var wie=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},bie={component:"div",childFactory:function(t){return t}},Sx=function(e){V5(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=i.handleExited.bind(gie(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}var r=t.prototype;return r.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},r.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var a=i.children,l=i.handleExited,c=i.firstRender;return{children:c?yie(o,l):xie(o,a,l),firstRender:!1}},r.handleExited=function(o,i){var a=_x(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=st({},l.children);return delete c[o.key],{children:c}}))},r.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=vx(o,["component","childFactory"]),c=this.state.contextValue,u=wie(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?S.createElement(ch.Provider,{value:c},u):S.createElement(ch.Provider,{value:c},S.createElement(i,l,u))},t}(S.Component);Sx.propTypes={};Sx.defaultProps=bie;const _ie=Sx,[Sie,zc]=X9("mantine-notifications"),de=zc("show"),Pie=zc("hide"),jie=zc("clean"),Oie=zc("cleanQueue"),$l=zc("update"),So={show:de,hide:Pie,clean:jie,cleanQueue:Oie,update:$l};function Cie([e,t],r){const n={};return e==="top"&&(n.top=r),e==="bottom"&&(n.bottom=r),t==="left"&&(n.left=r),t==="right"&&(n.right=r),t==="center"&&(n.left="50%",n.transform="translateX(-50%)"),n}var Eie=Object.defineProperty,PO=Object.getOwnPropertySymbols,$ie=Object.prototype.hasOwnProperty,kie=Object.prototype.propertyIsEnumerable,jO=(e,t,r)=>t in e?Eie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OO=(e,t)=>{for(var r in t||(t={}))$ie.call(t,r)&&jO(e,r,t[r]);if(PO)for(var r of PO(t))kie.call(t,r)&&jO(e,r,t[r]);return e};const CO={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Rie={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Tie({state:e,maxHeight:t,positioning:r,transitionDuration:n}){const[o,i]=r,a=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:CO[a],transitionDuration:`${n}ms, ${n}ms, ${n}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},c={opacity:1,transform:Rie[a]},u={opacity:0,maxHeight:0,transform:CO[a]},d={entering:c,entered:c,exiting:u,exited:u};return OO(OO({},l),d[e])}function Iie(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}var Die=Object.defineProperty,Nie=Object.defineProperties,Aie=Object.getOwnPropertyDescriptors,uh=Object.getOwnPropertySymbols,H5=Object.prototype.hasOwnProperty,q5=Object.prototype.propertyIsEnumerable,EO=(e,t,r)=>t in e?Die(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$O=(e,t)=>{for(var r in t||(t={}))H5.call(t,r)&&EO(e,r,t[r]);if(uh)for(var r of uh(t))q5.call(t,r)&&EO(e,r,t[r]);return e},Mie=(e,t)=>Nie(e,Aie(t)),kO=(e,t)=>{var r={};for(var n in e)H5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&uh)for(var n of uh(e))t.indexOf(n)<0&&q5.call(e,n)&&(r[n]=e[n]);return r};function G5(e){var t=e,{notification:r,autoClose:n,onHide:o,innerRef:i}=t,a=kO(t,["notification","autoClose","onHide","innerRef"]);const l=r,{autoClose:c,message:u}=l,d=kO(l,["autoClose","message"]),p=Iie(n,c),h=f.useRef(),m=()=>{o(r.id),window.clearTimeout(h.current)},g=()=>{clearTimeout(h.current)},v=()=>{typeof p=="number"&&(h.current=window.setTimeout(m,p))};return f.useEffect(()=>{typeof r.onOpen=="function"&&r.onOpen(r)},[]),f.useEffect(()=>(v(),g),[n,r.autoClose]),S.createElement(pN,Mie($O($O({},d),a),{onClose:m,onMouseEnter:g,onMouseLeave:v,ref:i}),u)}G5.displayName="@mantine/notifications/NotificationContainer";var Lie=W((e,{zIndex:t})=>({notifications:{width:`calc(100% - ${e.spacing.md} * 2)`,boxSizing:"border-box",position:"fixed",zIndex:t},notification:{"&:not(:first-of-type)":{marginTop:e.spacing.sm}}}));const zie=Lie;var Fie=Object.defineProperty,Vie=Object.defineProperties,Bie=Object.getOwnPropertyDescriptors,RO=Object.getOwnPropertySymbols,Uie=Object.prototype.hasOwnProperty,Wie=Object.prototype.propertyIsEnumerable,TO=(e,t,r)=>t in e?Fie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hie=(e,t)=>{for(var r in t||(t={}))Uie.call(t,r)&&TO(e,r,t[r]);if(RO)for(var r of RO(t))Wie.call(t,r)&&TO(e,r,t[r]);return e},qie=(e,t)=>Vie(e,Bie(t));function Gie({limit:e}){const{state:t,queue:r,update:n,cleanQueue:o}=TL({initialValues:[],limit:e});return{notifications:t,queue:r,showNotification:u=>{const d=u.id||Bh();return n(p=>u.id&&p.some(h=>h.id===u.id)?p:[...p,qie(Hie({},u),{id:d})]),d},updateNotification:u=>n(d=>{const p=d.findIndex(m=>m.id===u.id);if(p===-1)return d;const h=[...d];return h[p]=u,h}),hideNotification:u=>n(d=>d.filter(p=>p.id===u?(typeof p.onClose=="function"&&p.onClose(p),!1):!0)),cleanQueue:o,clean:()=>n(()=>[])}}var Qie=Object.defineProperty,dh=Object.getOwnPropertySymbols,Q5=Object.prototype.hasOwnProperty,K5=Object.prototype.propertyIsEnumerable,IO=(e,t,r)=>t in e?Qie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wg=(e,t)=>{for(var r in t||(t={}))Q5.call(t,r)&&IO(e,r,t[r]);if(dh)for(var r of dh(t))K5.call(t,r)&&IO(e,r,t[r]);return e},Kie=(e,t)=>{var r={};for(var n in e)Q5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&dh)for(var n of dh(e))t.indexOf(n)<0&&K5.call(e,n)&&(r[n]=e[n]);return r};const Yie=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"],ba=e=>{var t=e,{className:r,position:n="bottom-right",autoClose:o=4e3,transitionDuration:i=250,containerWidth:a=O(440),notificationMaxHeight:l=O(200),limit:c=5,zIndex:u=Dn("overlay"),style:d,children:p,target:h}=t,m=Kie(t,["className","position","autoClose","transitionDuration","containerWidth","notificationMaxHeight","limit","zIndex","style","children","target"]);const g=CL(),v=f.useRef({}),_=f.useRef(0),{notifications:y,showNotification:x,updateNotification:w,hideNotification:b,clean:j,cleanQueue:C}=Gie({limit:c}),{classes:P,cx:E,theme:k}=zie({zIndex:u}),$=Uh(),R=(k.respectReducedMotion?$:!1)?1:i,N=(Yie.includes(n)?n:"bottom-right").split("-");cn(()=>{y.length>_.current&&setTimeout(()=>g(),0),_.current=y.length},[y]),Sie({show:x,hide:b,update:w,clean:j,cleanQueue:C});const M=y.map(L=>S.createElement(mie,{key:L.id,timeout:R,onEnter:()=>v.current[L.id].offsetHeight,nodeRef:{current:v.current[L.id]}},Q=>S.createElement(G5,{innerRef:G=>{v.current[L.id]=G},notification:L,onHide:b,className:P.notification,autoClose:o,sx:[Wg({},Tie({state:Q,positioning:N,transitionDuration:R,maxHeight:l})),...Array.isArray(L.sx)?L.sx:[L.sx]]})));return S.createElement(G0,{target:h},S.createElement(ae,Wg({className:E(P.notifications,r),style:d,sx:Wg({maxWidth:a},Cie(N,k.spacing.md))},m),S.createElement(_ie,null,M)))};ba.displayName="@mantine/notifications/Notifications";ba.show=So.show;ba.hide=So.hide;ba.update=So.update;ba.clean=So.clean;ba.cleanQueue=So.cleanQueue;class Xie{constructor(t,r){this.operator=t,this.child=r}toString(){return`${this.operator}(${this.child.toString()})`}}class Fc{constructor(t,r,n){this.operator=t,this.left=r,this.right=n}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class Jie{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,r){return this.infixParselets[t]=r,this}registerPrefix(t,r){return this.prefixParselets[t]=r,this}prefix(t,r,n){return this.registerPrefix(t,{parse(o,i){const a=o.consumeAndParse(r);return n(i,a)}})}infixLeft(t,r,n){return this.registerInfix(t,{parse(o,i,a){const l=o.consumeAndParse(r);return n(i,a,l)},precedence:r})}construct(t){return new Zie(t,this.prefixParselets,this.infixParselets)}}class Zie{constructor(t,r,n){this.tokens=t,this.prefixParselets=r,this.infixParselets=n}hasMore(){return this.tokens.length>0}match(t){const r=this.peek();return(r==null?void 0:r.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const r=this.consume(),n=this.prefixParselets[r.id];if(!n)throw Error(`Parse error at "${r.value}" (line ${r.line}, column ${r.column}). No matching prefix parselet.`);let o=n.parse(this,r);for(;t>this.getPrecedence();){const i=this.consume();o=this.getInfixParselet(i).parse(this,o,i)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const r=this.getInfixParselet(t);return r?r.precedence:1/0}consume(t,r){var n,o;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((n=this.peek())==null?void 0:n.id)!==t){const i=this.peek();throw Error(`Expected ${t} but got "${i.id}" (${i.value}) at line ${i.line} column ${i.column}.`)}if(r&&((o=this.peek())==null?void 0:o.value)!==r){const i=this.peek();throw Error(`Expected "${r}" but got "${i.value}" at line ${i.line} column ${i.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}function ht(e){const t=at(e),r=Ro(e);return r===t?{reference:t}:{reference:t,display:r}}function at(e){return Pa(e)?e.reference:`${e.resourceType}/${e.id}`}function Px(e){if(e)return Pa(e)?e.reference.split("/")[1]:e.id}function eae(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Ro(e){var t;if(eae(e)){const r=tae(e);if(r)return r}if(e.resourceType==="Device"){const r=rae(e);if(r)return r}return e.resourceType==="Observation"&&"code"in e&&(t=e.code)!=null&&t.text?e.code.text:e.resourceType==="User"&&e.email?e.email:"name"in e&&e.name&&typeof e.name=="string"?e.name:at(e)}function tae(e){const t=e.name;if(t&&t.length>0)return Uc(t[0])}function rae(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function nae(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const r of t){const n=DO(r);if(n)return n}else return DO(t)}function DO(e){if(e.url&&e.contentType&&e.contentType.startsWith("image/"))return e.url}function Y5(e,t){const r=new Date(e);r.setUTCHours(0,0,0,0);const n=t?new Date(t):new Date;n.setUTCHours(0,0,0,0);const o=r.getUTCFullYear(),i=r.getUTCMonth(),a=r.getUTCDate(),l=n.getUTCFullYear(),c=n.getUTCMonth(),u=n.getUTCDate();let d=l-o;(c<i||c===i&&u<a)&&d--;let p=l*12+c-(o*12+i);u<a&&p--;const h=Math.floor((n.getTime()-r.getTime())/(1e3*60*60*24));return{years:d,months:p,days:h}}function oae(e,t){const{years:r,months:n,days:o}=Y5(e,t);return r>=2?r.toString().padStart(3,"0")+"Y":n>=1?n.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function Vc(e,...t){var n;let r=e;for(let o=0;o<t.length&&r;o++)r=(n=r==null?void 0:r.extension)==null?void 0:n.find(i=>i.url===t[o]);return r}function Dr(e,t){return JSON.stringify(e,iae,t?2:void 0)}function iae(e,t){return!aae(e)&&Xt(t)?void 0:t}function aae(e){return!!/\d+$/.exec(e)}function Xt(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!xm(e):!1}function xm(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 Bc(e,t,r){return e===t||Xt(e)&&Xt(t)?!0:Xt(e)||Xt(t)?!1:Array.isArray(e)&&Array.isArray(t)?sae(e,t):Array.isArray(e)||Array.isArray(t)?!1:li(e)&&li(t)?lae(e,t,r):(li(e)||li(t),!1)}function sae(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Bc(e[r],t[r]))return!1;return!0}function lae(e,t,r){const n=new Set;Object.keys(e).forEach(o=>n.add(o)),Object.keys(t).forEach(o=>n.add(o)),r==="meta"&&(n.delete("versionId"),n.delete("lastUpdated"),n.delete("author"));for(const o of n){const i=e[o],a=t[o];if(!Bc(i,a,o))return!1}return!0}function jx(e,t){return Xt(e)?!0:Xt(t)?!1:Array.isArray(e)&&Array.isArray(t)?cae(e,t):Array.isArray(e)||Array.isArray(t)?!1:li(e)&&li(t)?uae(e,t):li(e)||li(t)?!1:e===t}function cae(e,t){return t.every(r=>e.some(n=>jx(n,r)))}function uae(e,t){return Object.entries(t).every(([r,n])=>r in e&&jx(e[r],n))}function ki(e){return JSON.parse(JSON.stringify(e))}function X5(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function li(e){return e!==null&&typeof e=="object"}const J5=[];for(let e=0;e<256;e++)J5.push(e.toString(16).padStart(2,"0"));function dae(e){const t=new Uint8Array(e),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=J5[t[n]];return r.join("")}function fae(e){const t=new Uint8Array(e),r=[];for(let n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return window.btoa(r.join(""))}function er(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function pae(e,t){var r,n;return(n=(r=e.coding)==null?void 0:r.find(o=>o.system===t))==null?void 0:n.code}function hae(e){if(e)return Array.isArray(e)?e:[e]}const NO=e=>new Promise(t=>{setTimeout(t,e)});function mae(e,t,r){const n=[];for(let o=0;o<r-1;o++){let i=e.indexOf(t);i<0&&(i=e.length),n.push(e.slice(0,i)),e=e.slice(i+t.length)}return e&&n.push(e),n}function gae(e,t){const r=[];if(e.line&&r.push(...e.line),e.city||e.state||e.postalCode){const n=[];e.city&&n.push(e.city),e.state&&n.push(e.state),e.postalCode&&n.push(e.postalCode),r.push(n.join(", "))}return e.use&&(t!=null&&t.all||t!=null&&t.use)&&r.push("["+e.use+"]"),r.join((t==null?void 0:t.lineSeparator)??", ").trim()}function Uc(e,t){const r=[];if(e.prefix&&(t==null?void 0:t.prefix)!==!1&&r.push(...e.prefix),e.given&&r.push(...e.given),e.family&&r.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&r.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&r.push("["+e.use+"]"),r.length===0){const n=mc(e.text);if(n)return n}return r.join(" ").trim()}function wm(e){return e instanceof Date&&!isNaN(e.getTime())}function vae(e,t,r){if(!e)return"";const n=new Date("2000-01-01T"+e+"Z");return wm(n)?n.toLocaleTimeString(t,r):""}function Nr(e,t,r){if(!e)return"";const n=new Date(e);return wm(n)?n.toLocaleString(t,r):""}function yae(e,t,r){return!e||!e.start&&!e.end?"":Nr(e.start,t,r)+" - "+Nr(e.end,t,r)}const xae={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},wae={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},bae={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function Z5(e){if(!e)return"";const t=[];return _ae(t,e.repeat),e.event&&t.push(e.event.map(r=>Nr(r)).join(", ")),er(t.join(" ").trim())}function _ae(e,t){if(!(t!=null&&t.periodUnit))return;const r=t.frequency??1,n=t.period??1,o=t.periodUnit;r===1&&n===1?e.push(xae[o]):(r===1?e.push("once"):e.push(r+" times"),n===1?e.push("per "+wae[o]):e.push("per "+n+" "+bae[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(er).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>vae(i)).join(", "))}function hc(e,t,r=!1){if(r&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const n=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},o=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(n==null?void 0:n.value)===void 0&&(o==null?void 0:o.value)===void 0?"":(n==null?void 0:n.value)!==void 0&&(o==null?void 0:o.value)===void 0?r&&t!==void 0?(n.value=jae(n.value,t),`> ${ti(n,t)}`):`>= ${ti(n,t)}`:(n==null?void 0:n.value)===void 0&&(o==null?void 0:o.value)!==void 0?r&&t!==void 0?(o.value=Pae(o.value,t),`< ${ti(o,t)}`):`<= ${ti(o,t)}`:((n==null?void 0:n.unit)===(o==null?void 0:o.unit)&&(n==null||delete n.unit),`${ti(n,t)} - ${ti(o,t)}`)}function ti(e,t){if(!e)return"";const r=[];return e.comparator&&(r.push(e.comparator),r.push(" ")),e.value!==void 0&&(t!==void 0?r.push(e.value.toFixed(t)):r.push(e.value)),e.unit&&(e.unit!=="%"&&r[r.length-1]!==" "&&r.push(" "),r.push(e.unit)),r.join("").trim()}function Sae(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function js(e){if(!e)return"";const t=mc(e.text);return t||(e.coding?e.coding.map(r=>_a(r)).join(", "):"")}function _a(e){return mc(e==null?void 0:e.display)??mc(e==null?void 0:e.code)??""}function e4(e){if(!e)return"";if("component"in e)return e.component.map(r=>e4(r)).join(" / ");if(e.valueQuantity)return ti(e.valueQuantity);if(e.valueCodeableConcept)return js(e.valueCodeableConcept);const t=mc(e.valueString);return t||""}function mc(e){return typeof e=="string"?e:void 0}function Pae(e,t,r=1){return(t4(e,t)+r)*Math.pow(10,-t)}function jae(e,t,r=1){return(t4(e,t)-r)*Math.pow(10,-t)}function t4(e,t){return t===void 0?e:Math.round(e*Math.pow(10,t))}function Oae(e,t){const r=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:r??1,isArray:!!r&&r>1,constraints:[]}}function Cae(e){const t=Object.create(null);for(const[r,n]of Object.entries(e))t[r]={name:r,elements:Object.fromEntries(Object.entries(n.elements).map(([o,i])=>[o,Oae(o,i)])),constraints:[],innerTypes:[]};return t}const Eae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},$ae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},kae={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"}]}}},Rae={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"}]}}},Tae={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"}]}}},Iae={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"}]}}},Dae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},Nae={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"}]}}},Aae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},Mae={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"}]}}},Lae={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"}]}}},zae={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"}]}}},Fae={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"}]}}},Vae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Bae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},sequence:{type:[{code:"integer"}]},text:{type:[{code:"string"}]},additionalInstruction:{max:9007199254740991,type:[{code:"CodeableConcept"}]},patientInstruction:{type:[{code:"string"}]},timing:{type:[{code:"Timing"}]},"asNeeded[x]":{type:[{code:"boolean"},{code:"CodeableConcept"}]},site:{type:[{code:"CodeableConcept"}]},route:{type:[{code:"CodeableConcept"}]},method:{type:[{code:"CodeableConcept"}]},doseAndRate:{max:9007199254740991,type:[{code:"DosageDoseAndRate"}]},maxDosePerPeriod:{type:[{code:"Ratio"}]},maxDosePerAdministration:{type:[{code:"Quantity"}]},maxDosePerLifetime:{type:[{code:"Quantity"}]}}},Uae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Wae={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"}]}}},Hae={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"}]}}},qae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"string"}]},"value[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},Gae={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"}]}}},Qae={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"]}]}}},Kae={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"}]}}},Yae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},Xae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},Jae={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},Zae={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"]}]}}},ese={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},tse={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"}]}}},rse={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"}]}}},nse={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"}]}}},ose={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"}]}}},ise={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity"}]},high:{type:[{code:"Quantity"}]}}},ase={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},sse={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"}]}}},lse={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"]}]}}},cse={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity"}]},period:{min:1,type:[{code:"decimal"}]},factor:{type:[{code:"decimal"}]},lowerLimit:{type:[{code:"decimal"}]},upperLimit:{type:[{code:"decimal"}]},dimensions:{min:1,type:[{code:"positiveInt"}]},data:{type:[{code:"string"}]}}},use={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"}]}}},dse={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"}]}}},fse={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"}]}}},pse={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"}]}}},hse={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"]}]}}},mse={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"}]}}},gse={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"}]}}},vse={elements:{id:{type:[{code:"string"}]},meta:{type:[{code:"Meta"}]},implicitRules:{type:[{code:"uri"}]},language:{type:[{code:"code"}]},text:{type:[{code:"Narrative"}]},contained:{max:9007199254740991,type:[{code:"Resource"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},url:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},name:{type:[{code:"string"}]},title:{type:[{code:"string"}]},status:{min:1,type:[{code:"code"}]},experimental:{type:[{code:"boolean"}]},date:{type:[{code:"dateTime"}]},publisher:{type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]},description:{type:[{code:"markdown"}]},useContext:{max:9007199254740991,type:[{code:"UsageContext"}]},jurisdiction:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},yse={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"}]}}},xse={Element:Eae,BackboneElement:$ae,Address:kae,Age:Rae,Annotation:Tae,Attachment:Iae,CodeableConcept:Dae,Coding:Nae,ContactDetail:Aae,ContactPoint:Mae,Contributor:Lae,Count:zae,DataRequirement:Fae,Distance:Vae,Dosage:Bae,Duration:Uae,ElementDefinition:Wae,Expression:Hae,Extension:qae,HumanName:Gae,Identifier:Qae,MarketingStatus:Kae,Meta:Yae,Money:Xae,Narrative:Jae,ParameterDefinition:Zae,Period:ese,Population:tse,ProdCharacteristic:rse,ProductShelfLife:nse,Quantity:ose,Range:ise,Ratio:ase,Reference:sse,RelatedArtifact:lse,SampledData:cse,Signature:use,SubstanceAmount:dse,Timing:fse,TriggerDefinition:pse,UsageContext:hse,MoneyQuantity:mse,SimpleQuantity:gse,MetadataResource:vse,IdentityProvider:yse};function ve(e){return[{type:B.boolean,value:e}]}function io(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:B.integer,value:e}:typeof e=="number"?{type:B.decimal,value:e}:typeof e=="boolean"?{type:B.boolean,value:e}:typeof e=="string"?{type:B.string,value:e}:fn(e)?{type:B.Quantity,value:e}:Vo(e)?{type:e.resourceType,value:e}:{type:B.BackboneElement,value:e}}function ci(e){return e.length===0?!1:!!e[0].value}function To(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 xr(e,t){if(!e.value)return;const r=Sa(e.type,t);return r?Ox(e.value,t,r):wse(e,t)}function Ox(e,t,r){const n=r.type;if(!n||n.length===0)return;let o,i="undefined",a;if(r.path.endsWith("[x]")){const l=r.path.split(".").pop().replace("[x]","");for(const c of n){const u=l+er(c.code);if(o=e[u],a=e["_"+u],o!==void 0||a!==void 0){i=c.code;break}}}else console.assert(n.length===1,"Expected single type",r.path),o=e[t],i=n[0].code,a=e["_"+t];if(a)if(Array.isArray(o))for(let l=0;l<Math.max(o.length,a.length);l++)o[l]=zO(o[l],a[l]);else o=zO(o,a);if(!Xt(o))return(i==="Element"||i==="BackboneElement")&&(i=r.type[0].code),Array.isArray(o)?o.map(l=>AO(l,i)):AO(o,i)}function AO(e,t){return t==="Resource"&&Vo(e)&&(t=e.resourceType),{type:t,value:e}}function wse(e,t){const r=e.value;if(!r||typeof r!="object")return;let n;if(t in r)n=r[t];else for(const o in B){const i=t+er(o);if(i in r){n=r[i];break}}if(!Xt(n))return Array.isArray(n)?n.map(io):io(n)}function r4(e){const t=[];for(const r of e){let n=!1;for(const o of t)if(ci(i4(r,o))){n=!0;break}n||t.push(r)}return t}function n4(e){return ve(!ci(e))}function o4(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?ve(!1):ve(e.every((r,n)=>ci(i4(r,t[n]))))}function i4(e,t){var o,i;const r=(o=e.value)==null?void 0:o.valueOf(),n=(i=t.value)==null?void 0:i.valueOf();return typeof r=="number"&&typeof n=="number"?ve(Math.abs(r-n)<1e-8):fn(r)&&fn(n)?ve(l4(r,n)):ve(typeof r=="object"&&typeof n=="object"?Cx(e,t):r===n)}function a4(e,t){return e.length===0&&t.length===0?ve(!0):e.length!==t.length?ve(!1):(e.sort(MO),t.sort(MO),ve(e.every((r,n)=>ci(bse(r,t[n])))))}function bse(e,t){const{type:r,value:n}=e,{type:o,value:i}=t,a=n==null?void 0:n.valueOf(),l=i==null?void 0:i.valueOf();return typeof a=="number"&&typeof l=="number"?ve(Math.abs(a-l)<.01):fn(a)&&fn(l)?ve(l4(a,l)):ve(r==="Coding"&&o==="Coding"?typeof a!="object"||typeof l!="object"?!1:a.code===l.code&&a.system===l.system:typeof a=="object"&&typeof l=="object"?Cx({...a,id:void 0},{...l,id:void 0}):typeof a=="string"&&typeof l=="string"?a.toLowerCase()===l.toLowerCase():a===l)}function MO(e,t){var o,i;const r=(o=e.value)==null?void 0:o.valueOf(),n=(i=t.value)==null?void 0:i.valueOf();return typeof r=="number"&&typeof n=="number"?r-n:typeof r=="string"&&typeof n=="string"?r.localeCompare(n):0}function s4(e,t){const{value:r}=e;if(r==null)return!1;switch(t){case"Boolean":return typeof r=="boolean";case"Decimal":case"Integer":return typeof r=="number";case"Date":return typeof r=="string"&&!!/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r);case"DateTime":return typeof r=="string"&&!!/^\d{4}(-\d{2}(-\d{2})?)?T/.exec(r);case"Time":return typeof r=="string"&&!!/^T\d/.exec(r);case"Period":return _se(r);case"Quantity":return fn(r);default:return typeof r=="object"&&(r==null?void 0:r.resourceType)===t}}function _se(e){return!!(e&&typeof e=="object"&&"start"in e)}function fn(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function l4(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 Cx(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const o of r){const i=e[o],a=t[o];if(LO(i)&&LO(a)){if(!Cx(i,a))return!1}else if(i!==a)return!1}return!0}function LO(e){return e!==null&&typeof e=="object"}function zO(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return Sse(e??{},t)}return e}function Sse(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}const c4="ok",Pse="created",jse="gone",Ose="not-modified",Cse="not-found",Ese="forbidden",$se="accepted",kse={resourceType:"OperationOutcome",id:c4,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Rse={resourceType:"OperationOutcome",id:Cse,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},u4={resourceType:"OperationOutcome",id:Ese,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function yi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},expression:t?[t]:void 0}]}}function Rt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function bm(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function d4(e){return e.id===c4||e.id===Pse||e.id===Ose||e.id===$se}function Tse(e){return e.id===jse}class Ae extends Error{constructor(t,r){super(f4(t)),this.outcome=t,this.cause=r}}function lt(e){return e instanceof Ae?e.outcome:bm(e)?e:yi(je(e))}function je(e){return e?typeof e=="string"?e:e instanceof Error?e.message:bm(e)?f4(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function f4(e){var r;const t=((r=e.issue)==null?void 0:r.map(p4))??[];return t.length>0?t.join("; "):"Unknown error"}function p4(e){var r,n;let t;return(r=e.details)!=null&&r.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(n=e.expression)!=null&&n.length&&(t+=` (${e.expression.join(", ")})`),t}function Ise(e){return new Lse(e).parse()}const h4=Cae(xse),Ex=Object.create(null),FO=Object.create(null);function $x(e){let t;return e?(t=FO[e],t||(t=FO[e]=Object.create(null))):t=h4,t}function VO(e,t){var n;const r=Array.isArray(e)?e:((n=e.entry)==null?void 0:n.map(o=>o.resource))??[];for(const o of r)Dse(o,t)}function Dse(e,t){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const r=Ise(e),n=$x(t);n[e.name]=r,t&&e.url===t&&(Ex[t]=r);for(const o of r.innerTypes)o.parentType=r,n[o.name]=o}function Nse(e){return!!h4[e]}function kx(e,t){return $x(t)[e]}function Ase(e,t){const r=$x(t)[e];if(!r)throw new Ae(yi("Unknown data type: "+e));return r}function Mse(e){return!!Ex[e]}function _m(e){return Ex[e]}class Lse{constructor(t){var r;if(!((r=t.snapshot)!=null&&r.element)||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,title:t.title,type:t.type,url:t.url,kind:t.kind,description:Vse(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var r,n,o,i,a;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((r=t.id)!=null&&r.includes(":")){if((n=this.slicingContext)!=null&&n.current){const l=Hg(t,this.slicingContext.path);this.slicingContext.current.elements[l]=this.parseElementDefinition(t)}}else{const l=this.parseElementDefinition(t);this.checkFieldEnter(t,l);let c=this.backboneContext;for(;c;){if((o=t.path)!=null&&o.startsWith(c.path+".")){c.type.elements[Hg(t,c.path)]=l;break}c=c.parent}if(!c){const u=Hg(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((a=this.resourceSchema.mandatoryProperties)==null||a.add(u.replace("[x]",""))),this.resourceSchema.elements[u]=l}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,r){this.isInnerType(t)&&this.enterInnerType(t),t.slicing&&!this.slicingContext&&this.enterSlice(t,r)}enterInnerType(t){var r,n,o;for(;this.backboneContext&&!Aa((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;this.backboneContext={type:{name:WO(t),title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:Aa((n=this.backboneContext)==null?void 0:n.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,r){var n,o,i,a;Fse(t)&&!((n=this.peek())!=null&&n.sliceName)||(r.slicing={discriminator:(((o=t.slicing)==null?void 0:o.discriminator)??[]).map(l=>{if(l.type!=="value"&&l.type!=="pattern"&&l.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${l.type}`);return{path:l.path,type:l.type}}),slices:[],ordered:((i=t.slicing)==null?void 0:i.ordered)??!1,rule:(a=t.slicing)==null?void 0:a.rules},this.slicingContext={field:r.slicing,path:t.path??""})}checkFieldExit(t=void 0){var r;if(this.backboneContext&&!Aa(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&&!Aa(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),delete this.backboneContext;this.slicingContext&&!Aa(this.slicingContext.path,t==null?void 0:t.path)&&((r=this.slicingContext)!=null&&r.current&&this.slicingContext.field.slices.push(this.slicingContext.current),delete this.slicingContext)}next(){const t=this.peek();if(t)return this.index++,t}peek(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const r=this.elementIndex[t.contentReference.slice(t.contentReference.indexOf("#")+1)];return r?{...r,id:t.id,path:t.path,min:t.min??r.min,max:t.max??r.max,contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var n;const r=this.peek();return!!(Aa(t==null?void 0:t.path,r==null?void 0:r.path)&&((n=t.type)!=null&&n.some(o=>["BackboneElement","Element"].includes(o.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error("Invalid slice start before discriminator: "+t.sliceName);this.slicingContext.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext.current={name:t.sliceName??"",path:t.path??"",definition:t.definition,type:this.parseElementDefinitionType(t),elements:{},min:t.min??0,max:t.max==="*"?Number.POSITIVE_INFINITY:Number.parseInt(t.max,10)}}parseElementDefinitionType(t){return(t.type??[]).map(r=>{var o;let n;return(r.code==="BackboneElement"||r.code==="Element")&&(n=WO(t)),n||(n=(o=Vc(r,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:o.valueUrl),n||(n=r.code??""),{code:n,targetProfile:r.targetProfile,profile:r.profile}})}parseElementDefinition(t){var i,a;const r=BO(t.max),n=(i=t.base)!=null&&i.max?BO(t.base.max):r,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((a=t.base)==null?void 0:a.path)||"",min:t.min??0,max:r,isArray:n>1,constraints:(t.constraint??[]).map(l=>({key:l.key??"",severity:l.severity??"error",expression:l.expression??"",description:l.human??""})),type:this.parseElementDefinitionType(t),fixed:UO(xr(o,"fixed[x]")),pattern:UO(xr(o,"pattern[x]")),binding:t.binding}}}function BO(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Hg(e,t=""){return zse(e.path,t)}function zse(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Aa(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function UO(e){return Array.isArray(e)&&e.length>0?e[0]:Xt(e)?void 0:e}function Fse(e){var r,n;const t=(r=e.slicing)==null?void 0:r.discriminator;return!!((n=e.type)!=null&&n.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function Vse(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}const B={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function Bse(e){for(const t of e.base??[]){let r=Pi.types[t];r||(r={searchParamsDetails:{}},Pi.types[t]=r),r.searchParams||(r.searchParams={_id:{base:[t],code:"_id",type:"token",expression:t+".id"},_lastUpdated:{base:[t],code:"_lastUpdated",type:"date",expression:t+".meta.lastUpdated"},_compartment:{base:[t],code:"_compartment",type:"reference",expression:t+".meta.compartment"},_profile:{base:[t],code:"_profile",type:"uri",expression:t+".meta.profile"},_security:{base:[t],code:"_security",type:"token",expression:t+".meta.security"},_source:{base:[t],code:"_source",type:"uri",expression:t+".meta.source"},_tag:{base:[t],code:"_tag",type:"token",expression:t+".meta.tag"}}),r.searchParams[e.code]=e}}function WO(e){var r,n,o,i;const t=(n=(r=e.type)==null?void 0:r[0])==null?void 0:n.code;return t==="BackboneElement"||t==="Element"?Use((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function Use(e){return e.length===1?e[0]:e.map(er).join("")}function Rx(e){var t;return(t=Pi.types[e])==null?void 0:t.searchParams}function Wse(e,t){var r,n;return(n=(r=Pi.types[e])==null?void 0:r.searchParams)==null?void 0:n[t]}function fh(e){const t=e.replaceAll("[x]","").split(".").pop();return m4(t)}function m4(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(qse).join(" ").replace("_"," ").replace(/\s+/g," ")}const Hse=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function qse(e){const t=e.toUpperCase();return e===t?e:Hse.has(t)?t:t.charAt(0)+e.slice(1)}function Sa(e,t){const r=kx(e);if(r)return g4(r.elements,t)}function g4(e,t){const r=e[t]??e[t+"[x]"];if(r)return r;for(let n=0;n<t.length;n++){const o=t[n];if(o>="A"&&o<="Z"){const i=t.slice(0,n)+"[x]",a=e[i];if(a)return a}}}function Vo(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function Pa(e){return!!(e&&typeof e=="object"&&"reference"in e)}const Pi={types:{}};function bd(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 ml=()=>[],jr={empty:(e,t)=>ve(t.length===0),exists:(e,t,r)=>ve(r?t.filter(n=>ci(r.eval(e,[n]))).length>0:t.length>0),all:(e,t,r)=>ve(t.every(n=>ci(r.eval(e,[n])))),allTrue:(e,t)=>{for(const r of t)if(!r.value)return ve(!1);return ve(!0)},anyTrue:(e,t)=>{for(const r of t)if(r.value)return ve(!0);return ve(!1)},allFalse:(e,t)=>{for(const r of t)if(r.value)return ve(!1);return ve(!0)},anyFalse:(e,t)=>{for(const r of t)if(!r.value)return ve(!0);return ve(!1)},subsetOf:ml,supersetOf:ml,count:(e,t)=>[{type:B.integer,value:t.length}],distinct:(e,t)=>{const r=[];for(const n of t)r.some(o=>o.value===n.value)||r.push(n);return r},isDistinct:(e,t)=>ve(t.length===jr.distinct(e,t).length),where:(e,t,r)=>t.filter(n=>ci(r.eval(e,[n]))),select:(e,t,r)=>t.map(n=>r.eval(e,[n])).flat(),repeat:ml,ofType:(e,t,r)=>t.filter(n=>n.type===r.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,r)=>{var o;const n=(o=r.eval(e,t)[0])==null?void 0:o.value;if(typeof n!="number")throw new Error("Expected a number for skip(num)");return n>=t.length?[]:n<=0?t:t.slice(n,t.length)},take:(e,t,r)=>{var o;const n=(o=r.eval(e,t)[0])==null?void 0:o.value;if(typeof n!="number")throw new Error("Expected a number for take(num)");return n>=t.length?t:n<=0?[]:t.slice(0,n)},intersect:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t),o=[];for(const i of t)!o.some(a=>a.value===i.value)&&n.some(a=>a.value===i.value)&&o.push(i);return o},exclude:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t),o=[];for(const i of t)n.some(a=>a.value===i.value)||o.push(i);return o},union:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t);return r4([...t,...n])},combine:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t);return[...t,...n]},htmlChecks:(e,t,r)=>[io(!0)],iif:(e,t,r,n,o)=>{const i=r.eval(e,t);if(i.length>1||i.length===1&&typeof i[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ci(i)?n.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:r}]=qn(t,1);if(typeof r=="boolean")return[{type:B.boolean,value:r}];if(typeof r=="number"&&(r===0||r===1))return ve(!!r);if(typeof r=="string"){const n=r.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(n))return ve(!0);if(["false","f","no","n","0","0.0"].includes(n))return ve(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:ve(jr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:r}]=qn(t,1);return typeof r=="number"?[{type:B.integer,value:r}]:typeof r=="string"&&/^[+-]?\d+$/.exec(r)?[{type:B.integer,value:parseInt(r,10)}]:typeof r=="boolean"?[{type:B.integer,value:r?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:ve(jr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:r}]=qn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:B.date,value:bd(r)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:ve(jr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:r}]=qn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:B.dateTime,value:bd(r)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:ve(jr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:r}]=qn(t,1);return typeof r=="number"?[{type:B.decimal,value:r}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(r)?[{type:B.decimal,value:parseFloat(r)}]:typeof r=="boolean"?[{type:B.decimal,value:r?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:ve(jr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:r}]=qn(t,1);return fn(r)?[{type:B.Quantity,value:r}]:typeof r=="number"?[{type:B.Quantity,value:{value:r,unit:"1"}}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(r)?[{type:B.Quantity,value:{value:parseFloat(r),unit:"1"}}]:typeof r=="boolean"?[{type:B.Quantity,value:{value:r?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:ve(jr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:r}]=qn(t,1);return r==null?[]:fn(r)?[{type:B.string,value:`${r.value} '${r.unit}'`}]:[{type:B.string,value:r.toString()}]},convertsToString:(e,t)=>t.length===0?[]:ve(jr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:r}]=qn(t,1);if(typeof r=="string"){const n=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(r);if(n)return[{type:B.time,value:bd("T"+n[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:ve(jr.toTime(e,t).length===1),indexOf:(e,t,r)=>rn((n,o)=>n.indexOf(o),e,t,r),substring:(e,t,r,n)=>rn((o,i,a)=>{const l=i,c=a?l+a:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,r,n),startsWith:(e,t,r)=>rn((n,o)=>n.startsWith(o),e,t,r),endsWith:(e,t,r)=>rn((n,o)=>n.endsWith(o),e,t,r),contains:(e,t,r)=>rn((n,o)=>n.includes(o),e,t,r),upper:(e,t)=>rn(r=>r.toUpperCase(),e,t),lower:(e,t)=>rn(r=>r.toLowerCase(),e,t),replace:(e,t,r,n)=>rn((o,i,a)=>o.replaceAll(i,a),e,t,r,n),matches:(e,t,r)=>rn((n,o)=>!!new RegExp(o).exec(n),e,t,r),replaceMatches:(e,t,r,n)=>rn((o,i,a)=>o.replaceAll(i,a),e,t,r,n),length:(e,t)=>rn(r=>r.length,e,t),toChars:(e,t)=>rn(r=>r?r.split(""):void 0,e,t),abs:(e,t)=>Un(Math.abs,e,t),ceiling:(e,t)=>Un(Math.ceil,e,t),exp:(e,t)=>Un(Math.exp,e,t),floor:(e,t)=>Un(Math.floor,e,t),ln:(e,t)=>Un(Math.log,e,t),log:(e,t,r)=>Un((n,o)=>Math.log(n)/Math.log(o),e,t,r),power:(e,t,r)=>Un(Math.pow,e,t,r),round:(e,t)=>Un(Math.round,e,t),sqrt:(e,t)=>Un(Math.sqrt,e,t),truncate:(e,t)=>Un(r=>r|0,e,t),children:ml,descendants:ml,trace:(e,t,r)=>(console.log("trace",t,r),t),now:()=>[{type:B.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:B.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:B.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,r,n,o)=>{var u;const i=jr.toDateTime(e,r.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const a=jr.toDateTime(e,n.eval(e,t));if(a.length===0)throw new Error("Invalid end date");const l=(u=o.eval(e,t)[0])==null?void 0:u.value;if(l!=="years"&&l!=="months"&&l!=="days")throw new Error("Invalid units");const c=Y5(i[0].value,a[0].value);return[{type:B.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,r)=>{let n="";return r instanceof Tx?n=r.name:r instanceof Dx&&(n=r.left.name+"."+r.right.name),n?t.map(o=>({type:B.boolean,value:s4(o,n)})):[]},not:(e,t)=>jr.toBoolean(e,t).map(r=>({type:B.boolean,value:!r.value})),resolve:(e,t)=>t.map(r=>{const n=r.value;let o;if(typeof n=="string")o=n;else if(typeof n=="object"){const i=n;if(i.resource)return io(i.resource);i.reference?o=i.reference:i.type&&i.identifier&&(o=`${i.type}?identifier=${i.identifier.system}|${i.identifier.value}`)}if(o!=null&&o.includes("?")){const[i]=o.split("?");return{type:i,value:{resourceType:i}}}if(o!=null&&o.includes("/")){const[i,a]=o.split("/");return{type:i,value:{resourceType:i,id:a}}}return{type:B.BackboneElement,value:void 0}}).filter(r=>!!r.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:r})=>typeof r=="boolean"?{type:B.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof r=="number"?{type:B.BackboneElement,value:{namespace:"System",name:"Integer"}}:Vo(r)?{type:B.BackboneElement,value:{namespace:"FHIR",name:r.resourceType}}:{type:B.BackboneElement,value:null}),conformsTo:(e,t,r)=>{const n=r.eval(e,t)[0].value;if(!n.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=n.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(i=>{var a;return{type:B.boolean,value:((a=i.value)==null?void 0:a.resourceType)===o}})}};function rn(e,t,r,...n){if(r.length===0)return[];const[{value:o}]=qn(r,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...n.map(a=>{var l;return(l=a==null?void 0:a.eval(t,r)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(io):[io(i)]}function Un(e,t,r,...n){if(r.length===0)return[];const[{value:o}]=qn(r,1),i=fn(o),a=i?o.value:o;if(typeof a!="number")throw new Error("Math function cannot be called with non-number");const l=e(a,...n.map(d=>{var p;return(p=d.eval(t,r)[0])==null?void 0:p.value})),c=i?B.Quantity:r[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function qn(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const r of e)if(r==null)throw new Error("Expected non-null argument");return e}class Gse{constructor(t,r){this.original=t,this.child=r}eval(t,r){try{return r.length>0?r.map(n=>this.child.eval(t,[n])).flat():this.child.eval(t,[])}catch(n){throw new Error(`FhirPathError on "${this.original}": ${n}`)}}toString(){return this.child.toString()}}class Ma{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Tx{constructor(t){this.name=t}eval(t,r){if(this.name==="$this")return r;const n=t.variables[this.name];if(n)return[n];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return r.flatMap(o=>this.evalValue(o)).filter(o=>(o==null?void 0:o.value)!==void 0)}evalValue(t){const r=t.value;if(!(!r||typeof r!="object"))return Vo(r)&&r.resourceType===this.name?t:xr(t,this.name)}toString(){return this.name}}class Qse{eval(){return[]}toString(){return"{}"}}class Kse extends Xie{constructor(t,r,n){super(t,r),this.impl=n}eval(t,r){return this.impl(this.child.eval(t,r))}toString(){return this.operator+this.child.toString()}}class Ix extends Fc{constructor(t,r){super("as",t,r)}eval(t,r){return jr.ofType(t,this.left.eval(t,r),this.right)}}class Lr extends Fc{}class wn extends Lr{constructor(t,r,n,o){super(t,r,n),this.impl=o}eval(t,r){const n=this.left.eval(t,r);if(n.length!==1)return[];const o=this.right.eval(t,r);if(o.length!==1)return[];const i=n[0].value,a=o[0].value,l=fn(i)?i.value:i,c=fn(a)?a.value:a,u=this.impl(l,c);return typeof u=="boolean"?ve(u):fn(i)?[{type:B.Quantity,value:{...i,value:u}}]:[io(u)]}}class Yse extends Fc{constructor(t,r){super("&",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r),i=[...n,...o];return i.length>0&&i.every(a=>typeof a.value=="string")?[{type:B.string,value:i.map(a=>a.value).join("")}]:i}}class Xse extends Lr{constructor(t,r){super("contains",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return ve(n.some(i=>i.value===o[0].value))}}class Jse extends Lr{constructor(t,r){super("in",t,r)}eval(t,r){const n=To(this.left.eval(t,r)),o=this.right.eval(t,r);return n?ve(o.some(i=>i.value===n.value)):[]}}class Dx extends Fc{constructor(t,r){super(".",t,r)}eval(t,r){return this.right.eval(t,this.left.eval(t,r))}toString(){return`${this.left.toString()}.${this.right.toString()}`}}class v4 extends Fc{constructor(t,r){super("|",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return r4([...n,...o])}}class Zse extends Lr{constructor(t,r){super("=",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return o4(n,o)}}class ele extends Lr{constructor(t,r){super("!=",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return n4(o4(n,o))}}class tle extends Lr{constructor(t,r){super("~",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return a4(n,o)}}class rle extends Lr{constructor(t,r){super("!~",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return n4(a4(n,o))}}class Nx extends Lr{constructor(t,r){super("is",t,r)}eval(t,r){const n=this.left.eval(t,r);if(n.length!==1)return[];const o=this.right.name;return ve(s4(n[0],o))}}class nle extends Lr{constructor(t,r){super("and",t,r)}eval(t,r){const n=To(this.left.eval(t,r),"boolean"),o=To(this.right.eval(t,r),"boolean");return(n==null?void 0:n.value)===!0&&(o==null?void 0:o.value)===!0?ve(!0):(n==null?void 0:n.value)===!1||(o==null?void 0:o.value)===!1?ve(!1):[]}}class ole extends Lr{constructor(t,r){super("or",t,r)}eval(t,r){const n=To(this.left.eval(t,r),"boolean"),o=To(this.right.eval(t,r),"boolean");return(n==null?void 0:n.value)===!1&&(o==null?void 0:o.value)===!1?ve(!1):n!=null&&n.value||o!=null&&o.value?ve(!0):[]}}class ile extends Lr{constructor(t,r){super("xor",t,r)}eval(t,r){const n=To(this.left.eval(t,r),"boolean"),o=To(this.right.eval(t,r),"boolean");return!n||!o?[]:ve(n.value!==o.value)}}class ale extends Lr{constructor(t,r){super("implies",t,r)}eval(t,r){const n=To(this.left.eval(t,r),"boolean"),o=To(this.right.eval(t,r),"boolean");return(o==null?void 0:o.value)===!0||(n==null?void 0:n.value)===!1?ve(!0):!n||!o?[]:ve(!1)}}class Ax{constructor(t,r){this.name=t,this.args=r}eval(t,r){const n=jr[this.name];if(!n)throw new Error("Unrecognized function: "+this.name);return n(t,r,...this.args)}toString(){return`${this.name}(${this.args.map(t=>t.toString()).join(", ")})`}}class Mx{constructor(t,r){this.left=t,this.expr=r}eval(t,r){const n=this.expr.eval(t,r);if(n.length!==1)return[];const o=n[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const i=this.left.eval(t,r);return o in i?[i[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const sle=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class lle{constructor(t,r,n,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=r,this.operators=n,this.dateTimeLiterals=!!(o!=null&&o.dateTimeLiterals),this.symbolRegex=(o==null?void 0:o.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const r=this.peek();return t==="/"&&r==="*"?this.consumeMultiLineComment():t==="/"&&r==="/"?this.consumeSingleLineComment():t==="'"||t==='"'?this.consumeString(t):t==="`"?this.consumeBacktickSymbol():t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(r)?this.consumeSymbol():this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
88
+ `))}consumeString(t){this.advance();const r=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t));return this.advance(),r}consumeBacktickSymbol(){this.advance();const t=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),t}consumeDateTime(){this.advance();const t=this.pos.index;return this.consumeWhile(()=>/[\d-]/.exec(this.curr())),this.curr()==="T"&&(this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?this.advance():(this.curr()==="+"||this.curr()==="-")&&(this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.buildToken("DateTime",this.str.substring(t,this.pos.index))}consumeNumber(){const t=this.pos.index;let r="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&cle(this.peekToken())&&(r="Quantity",this.consumeToken()),this.buildToken(r,this.str.substring(t,this.pos.index)))}consumeSymbol(){var r;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((r=this.prevToken())==null?void 0:r.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),r=this.peek(),n=t+r;return this.operators.includes(n)?(this.advance(),this.advance(),this.buildToken(n,n)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const r=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(r,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
89
+ `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,r){const n=this.markStack.pop();if(!n)throw new Error("No mark for token");return{id:t,value:r,...n}}}function cle(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&sle.includes(e.value)))}const ule=["true","false"],dle=["!=","!~","<=",">=","{}","->"];function fle(e){return new lle(e,ule,dle).tokenize()}const We={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,IntegerDivide:4,Modulo:4,Add:5,Subtract:5,Ampersand:5,Is:6,As:6,Union:7,GreaterThan:8,GreaterThanOrEquals:8,LessThan:8,LessThanOrEquals:8,Equals:9,Equivalent:9,NotEquals:9,NotEquivalent:9,In:10,Contains:10,And:11,Xor:12,Or:12,Implies:13,Arrow:100,Semicolon:200},ple={parse(e){var r;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((r=e.peek())==null?void 0:r.value)+"`");return t}},hle={parse(e,t){const r=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new Mx(t,r)},precedence:We.Indexer},mle={parse(e,t){if(!(t instanceof Tx))throw new Error("Unexpected parentheses");const r=[];for(;!e.match(")");)r.push(e.consumeAndParse()),e.match(",");return new Ax(t.name,r)},precedence:We.FunctionCall};function gle(e){const t=e.split(" "),r=parseFloat(t[0]);let n=t[1];return n!=null&&n.startsWith("'")&&n.endsWith("'")?n=n.substring(1,n.length-1):n="{"+n+"}",{value:r,unit:n}}function vle(){return new Jie().registerPrefix("String",{parse:(e,t)=>new Ma({type:B.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Ma({type:B.dateTime,value:bd(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Ma({type:B.Quantity,value:gle(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Ma({type:t.value.includes(".")?B.decimal:B.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Ma({type:B.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Ma({type:B.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Tx(t.value)}).registerPrefix("{}",{parse:()=>new Qse}).registerPrefix("(",ple).registerInfix("[",hle).registerInfix("(",mle).prefix("+",We.UnaryAdd,(e,t)=>new Kse("+",t,r=>r)).prefix("-",We.UnarySubtract,(e,t)=>new wn("-",t,t,(r,n)=>-n)).infixLeft(".",We.Dot,(e,t,r)=>new Dx(e,r)).infixLeft("/",We.Divide,(e,t,r)=>new wn("/",e,r,(n,o)=>n/o)).infixLeft("*",We.Multiply,(e,t,r)=>new wn("*",e,r,(n,o)=>n*o)).infixLeft("+",We.Add,(e,t,r)=>new wn("+",e,r,(n,o)=>n+o)).infixLeft("-",We.Subtract,(e,t,r)=>new wn("-",e,r,(n,o)=>n-o)).infixLeft("|",We.Union,(e,t,r)=>new v4(e,r)).infixLeft("=",We.Equals,(e,t,r)=>new Zse(e,r)).infixLeft("!=",We.NotEquals,(e,t,r)=>new ele(e,r)).infixLeft("~",We.Equivalent,(e,t,r)=>new tle(e,r)).infixLeft("!~",We.NotEquivalent,(e,t,r)=>new rle(e,r)).infixLeft("<",We.LessThan,(e,t,r)=>new wn("<",e,r,(n,o)=>n<o)).infixLeft("<=",We.LessThanOrEquals,(e,t,r)=>new wn("<=",e,r,(n,o)=>n<=o)).infixLeft(">",We.GreaterThan,(e,t,r)=>new wn(">",e,r,(n,o)=>n>o)).infixLeft(">=",We.GreaterThanOrEquals,(e,t,r)=>new wn(">=",e,r,(n,o)=>n>=o)).infixLeft("&",We.Ampersand,(e,t,r)=>new Yse(e,r)).infixLeft("and",We.And,(e,t,r)=>new nle(e,r)).infixLeft("as",We.As,(e,t,r)=>new Ix(e,r)).infixLeft("contains",We.Contains,(e,t,r)=>new Xse(e,r)).infixLeft("div",We.Divide,(e,t,r)=>new wn("div",e,r,(n,o)=>n/o|0)).infixLeft("in",We.In,(e,t,r)=>new Jse(e,r)).infixLeft("is",We.Is,(e,t,r)=>new Nx(e,r)).infixLeft("mod",We.Modulo,(e,t,r)=>new wn("mod",e,r,(n,o)=>n%o)).infixLeft("or",We.Or,(e,t,r)=>new ole(e,r)).infixLeft("xor",We.Xor,(e,t,r)=>new ile(e,r)).infixLeft("implies",We.Implies,(e,t,r)=>new ale(e,r))}const yle=vle();function y4(e){return new Gse(e,yle.construct(fle(e)).consumeAndParse())}function xle(e,t){const r=Array.isArray(t)?t:[t];for(let n=0;n<r.length;n++){const o=r[n];typeof o=="object"&&"type"in o&&"value"in o||(r[n]=io(r[n]))}return gc(e,r).map(n=>n.value)}function gc(e,t,r){const n=r??{};return y4(e).eval({variables:n},t).map(i=>{var a;return{type:i.type,value:(a=i.value)==null?void 0:a.valueOf()}})}var ri=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.QUANTITY="QUANTITY",e.TEXT="TEXT",e.REFERENCE="REFERENCE",e.CANONICAL="CANONICAL",e.DATE="DATE",e.DATETIME="DATETIME",e.PERIOD="PERIOD",e.UUID="UUID",e))(ri||{});function Sm(e,t){var n,o;let r=(o=(n=Pi.types[e])==null?void 0:n.searchParamsDetails)==null?void 0:o[t.code];return r||(r=ble(e,t)),r}function wle(e,t,r){const n=Pi.types[e];n.searchParamsDetails||(n.searchParamsDetails={}),n.searchParamsDetails[t]=r}function ble(e,t){const r=t.code,n=Ple(r),o=Ole(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=Bl(l);c.length===1&&c[0]instanceof Lr?i.propertyTypes.add("boolean"):x4(i,Bl(l),e,1)}const a={columnName:n,type:jle(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return wle(e,r,a),a}function x4(e,t,r,n){const o=t[n];if(o instanceof Ix){e.propertyTypes.add(o.right.toString());return}if(o instanceof Ax){_le(e,o);return}const i=o.toString(),a=Sa(r,i);if(!a)throw new Error(`Element definition not found for ${r} ${i}`);let l=!1,c=n+1;if(c<t.length&&t[c]instanceof Mx&&(l=!0,c++),a.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(a);for(const u of a.type)e.propertyTypes.add(u.code);return}for(const u of a.type){let d=u.code;Sle(d)&&(d=a.type[0].code),x4(e,t,d,c)}}function _le(e,t){if(t.name==="as"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="resolve"){e.propertyTypes.add("string");return}if(t.name==="where"&&t.args[0]instanceof Nx){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function Sle(e){return e==="Element"||e==="BackboneElement"}function Ple(e){return e.split("-").reduce((t,r,n)=>t+(n?er(r):r),"")}function jle(e,t){switch(e.type){case"date":return t.size===1&&t.has(B.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(B.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(B.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function Ole(e,t){const r=[],n=y4(t);return yy(e,n.child,r),r}function yy(e,t,r){t instanceof v4?(yy(e,t.left,r),yy(e,t.right,r)):t.toString().startsWith(e+".")&&r.push(t)}function Bl(e){if(e instanceof Ix||e instanceof Mx)return[Bl(e.left),e].flat();if(e instanceof Lr)return[e];if(e instanceof Dx)return[Bl(e.left),Bl(e.right)].flat();if(e instanceof Ax){if(e.name==="where"&&!(e.args[0]instanceof Nx))return[];if(e.name==="last")return[]}return[e]}const Wc=20;var ie=(e=>(e.EQUALS="eq",e.NOT_EQUALS="ne",e.GREATER_THAN="gt",e.LESS_THAN="lt",e.GREATER_THAN_OR_EQUALS="ge",e.LESS_THAN_OR_EQUALS="le",e.STARTS_AFTER="sa",e.ENDS_BEFORE="eb",e.APPROXIMATELY="ap",e.CONTAINS="contains",e.EXACT="exact",e.TEXT="text",e.NOT="not",e.ABOVE="above",e.BELOW="below",e.IN="in",e.NOT_IN="not-in",e.OF_TYPE="of-type",e.MISSING="missing",e.IDENTIFIER="identifier",e.ITERATE="iterate",e))(ie||{});const w4={contains:"contains",exact:"exact",above:"above",below:"below",text:"text",not:"not",in:"in","not-in":"not-in","of-type":"of-type",missing:"missing",identifier:"identifier",iterate:"iterate"},Lx={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function Cle(e){let t;for(const r of e.pathname.split("/"))r&&(t=r);return $le(t,e.searchParams.entries())}function Ele(e){return Cle(new URL(e,"https://example.com/"))}function $le(e,t){const r={resourceType:e};for(const[n,o]of t)kle(r,n,o);return r}function kle(e,t,r){var a,l;let n,o;const i=t.indexOf(":");if(i>=0?(n=t.substring(0,i),o=t.substring(i+1)):(n=t,o=""),n==="_has"||t.includes(".")){qg(e,{code:t,operator:"eq",value:r});return}switch(n){case"_sort":Rle(e,r);break;case"_count":e.count=parseInt(r,10);break;case"_offset":e.offset=parseInt(r,10);break;case"_total":e.total=r;break;case"_summary":r==="count"?(e.total="accurate",e.count=0):(r==="true"||r==="data"||r==="text")&&(e.summary=r);break;case"_include":{const c=HO(r);o==="iterate"&&(c.modifier="iterate"),e.include?e.include.push(c):e.include=[c];break}case"_revinclude":{const c=HO(r);o==="iterate"&&(c.modifier="iterate"),e.revInclude?e.revInclude.push(c):e.revInclude=[c];break}case"_fields":case"_elements":e.fields=r.split(",");break;default:{const c=(l=(a=Pi.types[e.resourceType])==null?void 0:a.searchParams)==null?void 0:l[n];c?qg(e,Tle(c,o,r)):qg(e,Nle(n,o,r))}}}function Rle(e,t){for(const r of t.split(",")){let n,o=!1;r.startsWith("-")?(n=r.substring(1),o=!0):n=r,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:n,descending:o})}}function Tle(e,t,r){if(t==="missing")return{code:e.code,operator:"missing",value:r};switch(e.type){case"number":case"date":case"quantity":return Ile(e,r);case"reference":case"string":case"token":case"uri":return Dle(e,t,r);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function Ile(e,t){const{operator:r,value:n}=Ale(t);return{code:e.code,operator:r,value:n}}function Dle(e,t,r){return{code:e.code,operator:Mle(t),value:r}}function Nle(e,t,r){var o;let n="eq";if(t)n=t;else if(r.length>=2){const i=r.substring(0,2);i in Lx&&(r.length===2||(o=r.at(2))!=null&&o.match(/\d/))&&(n=i,r=r.substring(i.length))}return{code:e,operator:n,value:r}}function Ale(e){const t=e.substring(0,2),r=Lx[t];return r?{operator:r,value:e.substring(2)}:{operator:"eq",value:e}}function Mle(e){return w4[e]??"eq"}function HO(e){const t=e.split(":");if(t.includes("*"))throw new Ae(yi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new Ae(yi(`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 Ae(yi(`Invalid include value '${e}'`))}function qg(e,t){e.filters?e.filters.push(t):e.filters=[t]}function es(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(r=>t.push(Lle(r))),e.sortRules&&e.sortRules.length>0&&t.push(zle(e.sortRules)),e.offset!==void 0&&t.push("_offset="+e.offset),e.count!==void 0&&t.push("_count="+e.count),e.total!==void 0&&t.push("_total="+e.total),e.include&&e.include.forEach(r=>t.push(qO("_include",r))),e.revInclude&&e.revInclude.forEach(r=>t.push(qO("_revinclude",r))),t.length===0?"":(t.sort((r,n)=>r.localeCompare(n)),"?"+t.join("&"))}function Lle(e){const t=e.operator in w4?":"+e.operator:"",r=e.operator!=="eq"&&e.operator in Lx?e.operator:"";return`${e.code}${t}=${r}${encodeURIComponent(e.value)}`}function zle(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function qO(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Fle(e){if(typeof window<"u")return window.atob(e);if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("binary");throw new Error("Unable to decode base64")}function Vle(e){if(typeof window<"u")return window.btoa(e);if(typeof Buffer<"u")return Buffer.from(e,"binary").toString("base64");throw new Error("Unable to encode base64")}function GO(){const e=new Uint32Array(28);return crypto.getRandomValues(e),dae(e.buffer)}async function Ble(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function b4(){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 _4(e){var o,i,a;const t={};e=ki(e);for(const l of e.entry||[]){(o=l.resource)==null||delete o.meta;const c=(i=l.resource)==null?void 0:i.id;c&&(t[c]=b4(),l.fullUrl="urn:uuid:"+t[c],(a=l.resource)==null||delete a.id)}const r=e.entry,n=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:r==null?void 0:r.map(l=>({fullUrl:l.fullUrl,request:{method:"POST",url:l.resource.resourceType},resource:l.resource}))},(l,c)=>Ule(l,c,t),2);return Wle(JSON.parse(n))}function Ule(e,t,r){if(e==="reference"&&typeof t=="string"){let n;if(t.includes("/")?n=t.split("/")[1]:t.startsWith("urn:uuid:")?n=t.slice(9):t.startsWith("#")&&(n=t.slice(1)),n){const o=r[n];if(o)return"urn:uuid:"+o}}return t}function Wle(e){const t=qle(e),{sorted:r,cycles:n}=Hle(t),o={};for(const a of e.entry||[])a.fullUrl&&(o[a.fullUrl]=a);const i=r.map(a=>o[a]);for(const a of n)for(const l of a){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function Hle(e){const t=[],r={},n=[];for(const i of Object.keys(e))r[i]=0;function o(i,a){if(r[i]===2)return!0;if(r[i]===1){const c=a.lastIndexOf(i);return c!==-1&&n.push(a.slice(c)),!0}r[i]=1,a.push(i);let l=!1;for(const c of e[i])o(c,a)||(l=!0);return r[i]=2,a.pop(),t.unshift(i),!l}for(const i in e)r[i]===0&&o(i,[]);return{sorted:t,cycles:n}}function S4(e,t){for(const r in e)if(e[r]&&typeof e[r]=="object"){const n=e[r];if(Pa(n)){const o=n.reference;o.startsWith("urn:uuid:")&&t(o)}else S4(n,t)}}function qle(e){const t={};for(const r of e.entry||[])r.fullUrl&&(t[r.fullUrl]=[]);for(const r of e.entry||[]){const n=r.fullUrl;r.resource&&S4(r.resource,o=>{t[o]&&t[o].push(n)})}return t}class P4{constructor(t=10){this.max=t,this.cache=new Map}clear(){this.cache.clear()}get(t){const r=this.cache.get(t);return r&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){this.cache.has(t)?this.cache.delete(t):this.cache.size>=this.max&&this.cache.delete(this.first()),this.cache.set(t,r)}delete(t){this.cache.delete(t)}keys(){return this.cache.keys()}first(){return this.cache.keys().next().value}}const Kt={CSS:"text/css",DICOM:"application/dicom",FAVICON:"image/vnd.microsoft.icon",FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",HTML:"text/html",JAVASCRIPT:"text/javascript",JSON:"application/json",JSON_PATCH:"application/json-patch+json",PNG:"image/png",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript"};class j4{constructor(){this.listeners={}}addEventListener(t,r){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(r)}removeEventListener(t,r){const n=this.listeners[t];if(n){for(let o=0;o<n.length;o++)if(n[o]===r){n.splice(o,1);return}}}dispatchEvent(t){const r=this.listeners[t.type];if(r)for(const n of r)n.call(this,t);return!t.defaultPrevented}}class Gle{constructor(){this.emitter=new j4}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,r){this.emitter.addEventListener(t,r)}removeEventListener(t,r){this.emitter.removeEventListener(t,r)}}const xy={"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"},Qle=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],zx=["DiagnosticReport-update"];function Kle(e){return zx.includes(e)}function Yle(e){if(zx.includes(e))throw new Ae(Rt(`'context.version' is required for '${e}'.`))}const Xle={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport"},select:{resourceType:"*",isArray:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport"},patient:{resourceType:"Patient",optional:!0},study:{resourceType:"ImagingStudy",optional:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function Jle(e){return Qle.includes(e)}function O4(e){return!!e.endpoint}function QO(e){if(!Fx(e))throw new Ae(Rt("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:r,topic:n,events:o}=e,i={"hub.channel.type":t,"hub.mode":r,"hub.topic":n,"hub.events":o.join(",")};return O4(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function Fx(e){if(typeof e!="object")return!1;const{channelType:t,mode:r,topic:n,events:o}=e;if(!(t&&r&&n&&o)||typeof n!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||r!=="subscribe"&&r!=="unsubscribe")return!1;for(const i of o)if(!xy[i])return!1;return!(O4(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function KO(e,t,r,n){if(typeof t!="object")throw new Ae(Rt(`context[${r}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new Ae(Rt(`context[${r}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new Ae(Rt(`context[${r}] is invalid. Resource must contain a resource type. No resource type found.`));const o=n.resourceType;if(o!=="*"){if(!Jle(t.resourceType))throw new Ae(Rt(`context[${r}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new Ae(Rt(`context[${r}] is invalid. context[${r}] for the '${e}' event should contain resource of type ${o}.`))}}function Zle(e,t,r,n,o){if(o.set(t.key,(o.get(t.key)??0)+1),!n.isArray)KO(e,t.resource,r,n);else{const{resources:i}=t;if(!i)throw new Ae(Rt(`context[${r}] is invalid. context[${r}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(const a of i)KO(e,a,r,n)}}function ece(e,t){const r=new Map,n=Xle[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!n[i])throw new Ae(Rt(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));Zle(e,t[o],o,n[i],r)}for(const[o,i]of Object.entries(n)){if(!(i.optional||r.has(o)))throw new Ae(Rt(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(r.get(o)||0)>1)throw new Ae(Rt(`${r.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function YO(e,t,r,n){if(!(e&&typeof e=="string"))throw new Ae(Rt("Must provide a topic."));if(!xy[t])throw new Ae(Rt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(xy).join(", ")}`));if(typeof r!="object")throw new Ae(Rt("context must be a context object or array of context objects."));if(zx.includes(t)&&!n)throw new Ae(Rt(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(r)?r:[r];return ece(t,o),{timestamp:new Date().toISOString(),id:b4(),event:{"hub.topic":e,"hub.event":t,context:o,...n?{"context.versionId":n}:{}}}}class tce extends Gle{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new Ae(Rt("Subscription request should contain an endpoint."));if(!Fx(t))throw new Ae(Rt("Subscription request failed validation."));const r=new WebSocket(t.endpoint);r.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),r.addEventListener("message",n=>{const o=JSON.parse(n.data);if(o["hub.topic"])return;const i=o;i.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:i}),r.send(JSON.stringify({id:o==null?void 0:o.id,timestamp:new Date().toISOString()})))}),r.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=r}disconnect(){this.websocket.close()}}function rce(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=Fle(t),n=Array.from(r).reduce((i,a)=>{const l=("00"+a.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(n);return JSON.parse(o)}function nce(e){return e.split(".").length===3}function C4(e){const[t,r,n]=e.split(".");return rce(r)}function oce(e){try{return typeof C4(e).login_id=="string"}catch{return!1}}var XO;class bn{constructor(t){this[XO]="ReadablePromise",this.status="pending",this.suspender=t.then(r=>(this.status="success",this.response=r,r),r=>{throw this.status="error",this.error=r,r})}isPending(){return this.status==="pending"}isOk(){return this.status==="success"}read(){switch(this.status){case"pending":throw this.suspender;case"error":throw this.error;default:return this.response}}then(t,r){return this.suspender.then(t,r)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}XO=Symbol.toStringTag;class ice{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new ace)}clear(){this.storage.clear()}getString(t){return this.storage.getItem(t)??void 0}setString(t,r){r?this.storage.setItem(t,r):this.storage.removeItem(t)}getObject(t){const r=this.getString(t);return r?JSON.parse(r):void 0}setObject(t,r){this.setString(t,r?Dr(r):void 0)}}class ace{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,r){r?this.data.set(t,r):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}const sce="2.2.6-f42e4a96",lce=Kt.FHIR_JSON+", */*; q=0.1",cce="https://api.medplum.com/",uce=1e3,dce=6e4,JO="Binary/",ZO={resourceType:"Device",id:"system",deviceName:[{name:"System"}]};class fce extends j4{constructor(t){if(super(),this.initComplete=!0,t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");if(this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??pce(),this.storage=(t==null?void 0:t.storage)??new ice,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=tC((t==null?void 0:t.baseUrl)??cce),this.fhirBaseUrl=tC(Qu(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4/")),this.authorizeUrl=Qu(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Qu(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Qu(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.cacheTime=(t==null?void 0:t.cacheTime)??dce,this.cacheTime>0?this.requestCache=new P4((t==null?void 0:t.resourceCacheSize)??uce):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken)this.setAccessToken(t.accessToken),this.initPromise=Promise.resolve();else if(this.storage.getInitPromise!==void 0){const r=this.storage.getInitPromise(),n=new Promise(o=>{r.then(()=>{this.attemptResumeActiveLogin().then(o).catch(console.error),this.initComplete=!0}).catch(console.error)});this.initPromise=n,this.initComplete=!1}else this.initPromise=this.attemptResumeActiveLogin().catch(console.error);this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}clear(){this.storage.clear(),sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){var r;t=t.toString(),(r=this.requestCache)==null||r.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const r=this.fhirBaseUrl+t;if(this.requestCache)for(const n of this.requestCache.keys())(n.endsWith(r)||n.includes(r+"?"))&&this.requestCache.delete(n)}get(t,r={}){t=t.toString();const n=this.getCacheEntry(t,r);if(n)return n.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue?o=new Promise((a,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:r,resolve:a,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,r);const i=new bn(o);return this.setCacheEntry(t,i),i}post(t,r,n,o={}){return t=t.toString(),this.setRequestBody(o,r),n&&this.setRequestContentType(o,n),this.invalidateUrl(t),this.request("POST",t,o)}put(t,r,n,o={}){return t=t.toString(),this.setRequestBody(o,r),n&&this.setRequestContentType(o,n),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,r,n={}){return t=t.toString(),this.setRequestBody(n,r),this.setRequestContentType(n,Kt.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,n)}delete(t,r){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,r)}async startNewUser(t,r){const{codeChallengeMethod:n,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:n,codeChallenge:o},void 0,r)}async startNewProject(t,r){return this.post("auth/newproject",t,void 0,r)}async startNewPatient(t,r){return this.post("auth/newpatient",t,void 0,r)}async startLogin(t,r){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,r)}async startGoogleLogin(t,r){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,r)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const n=new URLSearchParams(window.location.search).get("code");if(n)return this.processCode(n);await this.requestAuthorization(t)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,r,n,o,i=!0){let a=o;i&&(a=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,r,n,a,i))}async exchangeExternalAccessToken(t,r){if(r=r??this.clientId,!r)throw new Error("MedplumClient is missing clientId");const n=new URLSearchParams;return n.set("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),n.set("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),n.set("client_id",r),n.set("subject_token",t),this.fetchTokens(n)}getExternalAuthRedirectUri(t,r,n,o,i=!0){const a=new URL(t);if(a.searchParams.set("response_type","code"),a.searchParams.set("client_id",r),a.searchParams.set("redirect_uri",n),a.searchParams.set("scope",o.scope??"openid profile email"),a.searchParams.set("state",JSON.stringify(o)),i){const{codeChallenge:l,codeChallengeMethod:c}=o;if(!c)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!l)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");a.searchParams.set("code_challenge_method",c),a.searchParams.set("code_challenge",l)}return a.toString()}fhirUrl(...t){return new URL(t.join("/"),this.fhirBaseUrl)}fhirSearchUrl(t,r){const n=this.fhirUrl(t);return r&&(n.search=new URLSearchParams(r).toString()),n}search(t,r,n){const o=this.fhirSearchUrl(t,r),i=o.toString()+"-search",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new bn((async()=>{const c=await this.get(o,n);if(c.entry)for(const u of c.entry)this.cacheResource(u.resource);return c})());return this.setCacheEntry(i,l),l}searchOne(t,r,n){const o=this.fhirSearchUrl(t,r);o.searchParams.set("_count","1"),o.searchParams.sort();const i=o.toString()+"-searchOne",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new bn(this.search(t,o.searchParams,n).then(c=>{var u,d;return(d=(u=c.entry)==null?void 0:u[0])==null?void 0:d.resource}));return this.setCacheEntry(i,l),l}searchResources(t,r,n){const i=this.fhirSearchUrl(t,r).toString()+"-searchResources",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new bn(this.search(t,r,n).then(nC));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,r,n){var i,a;let o=this.fhirSearchUrl(t,r);for(;o;){const l=new URL(o).searchParams,c=await this.search(t,l,n),u=(i=c.link)==null?void 0:i.find(d=>d.relation==="next");if(!((a=c.entry)!=null&&a.length)&&!u)break;yield nC(c),o=u!=null&&u.url?new URL(u.url):void 0}}searchValueSet(t,r,n){const o=this.fhirUrl("ValueSet","$expand");return o.searchParams.set("url",t),o.searchParams.set("filter",r),this.get(o.toString(),n)}getCached(t,r){var o,i;const n=(i=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,r).toString()))==null?void 0:i.value;return n!=null&&n.isOk()?n.read():void 0}getCachedReference(t){const r=t.reference;if(!r)return;if(r==="system")return ZO;const[n,o]=r.split("/");if(!(!n||!o))return this.getCached(n,o)}readResource(t,r,n){return this.get(this.fhirUrl(t,r),n)}readReference(t,r){const n=t.reference;if(!n)return new bn(Promise.reject(new Error("Missing reference")));if(n==="system")return new bn(Promise.resolve(ZO));const[o,i]=n.split("/");return!o||!i?new bn(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,r)}requestSchema(t){if(Nse(t))return Promise.resolve();const r=t+"-requestSchema",n=this.getCacheEntry(r,void 0);if(n)return n.value;const o=new bn((async()=>{const i=`{
90
+ StructureDefinitionList(name: "${t}") {
91
+ resourceType,
92
+ name,
93
+ kind,
94
+ description,
95
+ type,
96
+ snapshot {
97
+ element {
98
+ id,
99
+ path,
100
+ definition,
101
+ min,
102
+ max,
103
+ base {
104
+ path,
105
+ min,
106
+ max
107
+ },
108
+ contentReference,
109
+ type {
110
+ code,
111
+ profile,
112
+ targetProfile
113
+ },
114
+ binding {
115
+ strength,
116
+ valueSet
117
+ }
118
+ }
119
+ }
120
+ }
121
+ SearchParameterList(base: "${t}", _count: 100) {
122
+ base,
123
+ code,
124
+ type,
125
+ expression,
126
+ target
127
+ }
128
+ }`.replace(/\s+/g," "),a=await this.graphql(i);VO(a.data.StructureDefinitionList);for(const l of a.data.SearchParameterList)Bse(l)})());return this.setCacheEntry(r,o),o}requestProfileSchema(t){if(Mse(t))return Promise.resolve();const r=t+"-requestSchema",n=this.getCacheEntry(r,void 0);if(n)return n.value;const o=new bn((async()=>{const i=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});i?VO([i],t):console.warn(`No StructureDefinition found for ${t}!`)})());return this.setCacheEntry(r,o),o}readHistory(t,r,n){return this.get(this.fhirUrl(t,r,"_history"),n)}readVersion(t,r,n,o){return this.get(this.fhirUrl(t,r,"_history",n),o)}readPatientEverything(t,r){return this.get(this.fhirUrl("Patient",t,"$everything"),r)}createResource(t,r){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,r)}async createResourceIfNoneExist(t,r,n){return await this.searchOne(t.resourceType,r,n)??this.createResource(t,n)}async createAttachment(t,r,n,o,i){const a=await this.createBinary(t,r,n,o,i);return{contentType:n,url:a.url,title:r}}createBinary(t,r,n,o,i){const a=this.fhirUrl("Binary");return r&&a.searchParams.set("_filename",r),o?this.uploadwithProgress(a,t,n,o,i):this.post(a,t,n,i)}uploadwithProgress(t,r,n,o,i){return new Promise((a,l)=>{var p;const c=new XMLHttpRequest,u=()=>c.abort();(p=i==null?void 0:i.signal)==null||p.addEventListener("abort",u);const d=h=>{var m;(m=i==null?void 0:i.signal)==null||m.removeEventListener("abort",u),h instanceof Error?l(h):a(h)};c.responseType="json",c.onabort=()=>d(new Error("Request aborted")),c.onerror=()=>d(new Error("Request error")),o&&(c.upload.onprogress=h=>o(h),c.upload.onload=h=>o(h)),c.onload=()=>{c.status>=200&&c.status<300?d(c.response):d(new Ae(lt(c.response||c.statusText)))},c.open("POST",t),c.withCredentials=!0,c.setRequestHeader("Authorization","Bearer "+this.accessToken),c.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),c.setRequestHeader("Content-Type",n),c.setRequestHeader("X-Medplum","extended"),c.send(r)})}async createPdf(t,r,n,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=await this.createPdfImpl(t,n,o);return this.createBinary(i,r,"application/pdf")}createComment(t,r,n){const o=this.getProfile();let i,a;return t.resourceType==="Encounter"&&(i=ht(t),a=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,a=t.subject),t.resourceType==="Patient"&&(a=ht(t)),this.createResource({resourceType:"Communication",basedOn:[ht(t)],encounter:i,subject:a,sender:o?ht(o):void 0,sent:new Date().toISOString(),payload:[{contentString:r}]},n)}async updateResource(t,r){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let n=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,r);return n||(n=t),this.cacheResource(n),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),n}patchResource(t,r,n,o){return this.invalidateSearches(t),this.patch(this.fhirUrl(t,r),n,o)}deleteResource(t,r,n){return this.deleteCacheEntry(this.fhirUrl(t,r).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,r),n)}validateResource(t,r){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,r)}executeBot(t,r,n,o){let i;if(typeof t=="string"){const a=t;i=this.fhirUrl("Bot",a,"$execute")}else{const a=t;i=this.fhirUrl("Bot","$execute")+`?identifier=${a.system}|${a.value}`}return this.post(i,r,n,o)}executeBatch(t,r){return this.post(this.fhirBaseUrl.slice(0,-1),t,void 0,r)}sendEmail(t,r){return this.post("email/v1/send",t,Kt.JSON,r)}graphql(t,r,n,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:r,variables:n},Kt.JSON,o)}readResourceGraph(t,r,n,o){return this.get(`${this.fhirUrl(t,r)}/$graph?graph=${n}`,o)}pushToAgent(t,r,n,o,i,a){return this.post(this.fhirUrl("Agent",Px(t),"$push"),{destination:at(r),body:n,contentType:o,waitForResponse:i},Kt.FHIR_JSON,a)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var r,n;(!((r=this.sessionDetails)!=null&&r.profile)||at(this.sessionDetails.profile)!==((n=t.profile)==null?void 0:n.reference))&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}setAccessToken(t,r){this.accessToken=t,this.refreshToken=r,this.sessionDetails=void 0,this.medplumServer=oce(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const r=this.getLogins().filter(n=>{var o,i;return((o=n.profile)==null?void 0:o.reference)!==((i=t.profile)==null?void 0:i.reference)});r.push(t),this.storage.setObject("logins",r)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,r)=>{this.get("auth/me").then(n=>{var i,a;this.profilePromise=void 0;const o=((a=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:a.id)!==n.profile.id;this.sessionDetails=n,o&&this.dispatchEvent({type:"change"}),t(n.profile)}).catch(r)}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!!this.profilePromise}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,r={}){this.refreshPromise&&await this.refreshPromise;const n=t.toString();return n.startsWith(JO)&&(t=this.fhirUrl(n)),this.addFetchOptionsDefaults(r),(await this.fetchWithRetry(t.toString(),r)).blob()}async uploadMedia(t,r,n,o,i){const a=await this.createBinary(t,n,r);return this.createResource({resourceType:"Media",status:"completed",content:{contentType:r,url:JO+a.id,title:n},...o},i)}async bulkExport(t="",r,n,o){const i=t&&`${t}/`,a=this.fhirUrl(`${i}$export`);return r&&a.searchParams.set("_type",r),n&&a.searchParams.set("_since",n),this.startAsyncRequest(a.toString(),o)}async startAsyncRequest(t,r={}){this.addFetchOptionsDefaults(r);const n=r.headers;n.Prefer="respond-async";const o=await this.fetchWithRetry(t,r);if(o.status===202){const i=await rC(o);if(i)return this.pollStatus(i)}return this.parseResponse(o,"POST",t)}getCacheEntry(t,r){if(!this.requestCache||(r==null?void 0:r.cache)==="no-cache"||(r==null?void 0:r.cache)==="reload")return;const n=this.requestCache.get(t);if(!(!n||n.requestTime+this.cacheTime<Date.now()))return n}setCacheEntry(t,r){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:r})}cacheResource(t){var r,n;t!=null&&t.id&&!((n=(r=t.meta)==null?void 0:r.tag)!=null&&n.some(o=>o.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new bn(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,r,n={}){this.refreshPromise&&await this.refreshPromise,n.method=t,this.addFetchOptionsDefaults(n);const o=await this.fetchWithRetry(r,n);return this.parseResponse(o,t,r,n)}async parseResponse(t,r,n,o={}){if(t.status===401)return this.handleUnauthenticated(r,n,o);if(t.status===204||t.status===304)return;const i=t.headers.get("content-type"),a=i==null?void 0:i.includes("json");if(t.status===404&&!a)throw new Ae(Rse);const l=t.headers.get("content-location"),c=o.redirect??this.options.redirect;if(t.status===201&&l&&c==="follow")return this.request("GET",l,{...o,body:void 0});let u;if(a)try{u=await t.json()}catch(d){throw console.error("Error parsing response",t.status,d),d}else u=await t.text();if(t.status>=400)throw new Ae(lt(u));return u}async fetchWithRetry(t,r){t.startsWith("http")||(t=new URL(t,this.baseUrl).href);const n=3,o=200;let i;for(let a=0;a<n;a++){try{if(this.options.verbose&&this.logRequest(t,r),i=await this.fetch(t,r),this.options.verbose&&this.logResponse(i),i.status<500)return i}catch(l){this.retryCatch(a,n,l)}await NO(o)}return i}logRequest(t,r){if(console.log(`> ${r.method} ${t}`),r.headers){const n=r.headers,o=Object.entries(n).sort((i,a)=>i[0].localeCompare(a[0]));for(const[i,a]of o)console.log(`> ${i}: ${a}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((r,n)=>console.log(`< ${n}: ${r}`))}async pollStatus(t){let r=!0,n;const o=2e3;for(;r;){const i={};this.addFetchOptionsDefaults(i);const a=await this.fetchWithRetry(t,i);if(a.status!==202&&(r=!1,n=a,a.status===201)){const l=await rC(a);l&&(n=await this.fetchWithRetry(l,i))}await NO(o)}return this.parseResponse(n,"POST",t)}async executeAutoBatch(){var o,i;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const a=t[0];try{a.resolve(await this.request(a.method,this.fhirBaseUrl+a.url,a.options))}catch(l){a.reject(new Ae(lt(l)))}return}const r={resourceType:"Bundle",type:"batch",entry:t.map(a=>({request:{method:a.method,url:a.url},resource:a.options.body?JSON.parse(a.options.body):void 0}))},n=await this.post(this.fhirBaseUrl.slice(0,-1),r);for(let a=0;a<t.length;a++){const l=t[a],c=(o=n.entry)==null?void 0:o[a];(i=c==null?void 0:c.response)!=null&&i.outcome&&!d4(c.response.outcome)?l.reject(new Ae(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){let r=t.headers;r||(r={},t.headers=r),r.Accept||(r.Accept=lce),r["X-Medplum"]="extended",t.body&&!r["Content-Type"]&&(r["Content-Type"]=Kt.FHIR_JSON),this.accessToken?r.Authorization="Bearer "+this.accessToken:this.basicAuth&&(r.Authorization="Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,r){t.headers||(t.headers={});const n=t.headers;n["Content-Type"]=r}setRequestBody(t,r){typeof r=="string"||typeof Blob<"u"&&r instanceof Blob||typeof File<"u"&&r instanceof File||typeof Uint8Array<"u"&&r instanceof Uint8Array?t.body=r:r&&(t.body=JSON.stringify(r))}handleUnauthenticated(t,r,n){return this.refresh()?this.request(t,r,n):(this.clearActiveLogin(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new Error("Unauthenticated")))}async startPkce(){const t=GO();sessionStorage.setItem("pkceState",t);const r=GO();sessionStorage.setItem("codeVerifier",r);const n=await Ble(r),o=fae(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",o),{codeChallengeMethod:"S256",codeChallenge:o}}async requestAuthorization(t){const r=await this.ensureCodeChallenge(t??{}),n=new URL(this.authorizeUrl);n.searchParams.set("response_type","code"),n.searchParams.set("state",sessionStorage.getItem("pkceState")),n.searchParams.set("client_id",r.clientId??this.clientId),n.searchParams.set("redirect_uri",r.redirectUri??eC()),n.searchParams.set("code_challenge_method",r.codeChallengeMethod),n.searchParams.set("code_challenge",r.codeChallenge),n.searchParams.set("scope",r.scope??"openid profile"),window.location.assign(n.toString())}processCode(t,r){const n=new URLSearchParams;if(n.set("grant_type","authorization_code"),n.set("code",t),n.set("client_id",(r==null?void 0:r.clientId)??this.clientId),n.set("redirect_uri",(r==null?void 0:r.redirectUri)??eC()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&n.set("code_verifier",o)}return this.fetchTokens(n)}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){const t=new URLSearchParams;return t.set("grant_type","refresh_token"),t.set("client_id",this.clientId),t.set("refresh_token",this.refreshToken),this.refreshPromise=this.fetchTokens(t),this.refreshPromise}if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,r){this.clientId=t,this.clientSecret=r;const n=new URLSearchParams;return n.set("grant_type","client_credentials"),n.set("client_id",t),n.set("client_secret",r),this.fetchTokens(n)}async startJwtBearerLogin(t,r,n){this.clientId=t;const o=new URLSearchParams;return o.set("grant_type","urn:ietf:params:oauth:grant-type:jwt-bearer"),o.set("client_id",t),o.set("assertion",r),o.set("scope",n),this.fetchTokens(o)}async startJwtAssertionLogin(t){const r=new URLSearchParams;return r.append("grant_type","client_credentials"),r.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),r.append("client_assertion",t),this.fetchTokens(r)}setBasicAuth(t,r){this.clientId=t,this.clientSecret=r,this.basicAuth=Vle(t+":"+r)}async fhircastSubscribe(t,r){if(!(typeof t=="string"&&t!==""))throw new Ae(Rt("Invalid topic provided. Topic must be a valid string."));if(!(typeof r=="object"&&Array.isArray(r)&&r.length>0))throw new Ae(Rt("Invalid events provided. Events must be an array of event names containing at least one event."));const n={channelType:"websocket",mode:"subscribe",topic:t,events:r},i=(await this.post("/fhircast/STU3",QO(n),Kt.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return n.endpoint=i,n}async fhircastUnsubscribe(t){if(!Fx(t))throw new Ae(Rt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new Ae(Rt("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",QO(t),Kt.FORM_URL_ENCODED)}fhircastConnect(t){return new tce(t)}async fhircastPublish(t,r,n,o){return Kle(r)?this.post(`/fhircast/STU3/${t}`,YO(t,r,n,o),Kt.JSON):(Yle(r),this.post(`/fhircast/STU3/${t}`,YO(t,r,n),Kt.JSON))}async fhircastGetContext(t){return this.get(`/fhircast/STU3/${t}`)}async invite(t,r){return this.post("admin/projects/"+t+"/invite",r)}async fetchTokens(t){const r={method:"POST",headers:{"Content-Type":Kt.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},n=r.headers;this.basicAuth&&(n.Authorization=`Basic ${this.basicAuth}`);const o=await this.fetchWithRetry(this.tokenUrl,r);if(!o.ok){this.clearActiveLogin();try{const a=await o.json();throw new Ae(yi(a.error_description))}catch(a){throw new Ae(yi("Failed to fetch tokens"),a)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const r=t.access_token;if(nce(r)){const n=C4(r);if(Date.now()>=n.exp*1e3)throw this.clearActiveLogin(),new Error("Token expired");if(n.cid){if(n.cid!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}else if(this.clientId&&n.client_id!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}return this.setActiveLogin({accessToken:r,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}setupStorageListener(){try{window.addEventListener("storage",t=>{(t.key===null||t.key==="activeLogin")&&window.location.reload()})}catch{}}retryCatch(t,r,n){if(n.message==="Failed to fetch"&&t===1&&this.dispatchEvent({type:"offline"}),t>=r-1)throw n}}function pce(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function eC(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}function tC(e){return e.endsWith("/")?e:e+"/"}function Qu(e,t){return new URL(t,e).toString()}async function rC(e){var o,i;const t=e.headers.get("content-location");if(t)return t;const r=e.headers.get("location");if(r)return r;const n=await e.json();if(bm(n)&&((i=(o=n.issue)==null?void 0:o[0])!=null&&i.diagnostics))return n.issue[0].diagnostics}function nC(e){var r;const t=((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];return Object.assign(t,{bundle:e})}function hce(e,t){return t.pattern&&!jx(e,t.pattern)?!1:!(t.fixed&&!Bc(e,t.fixed))}function mce(e,t,r,n){if(Array.isArray(e))return!1;const o=(n??r.elements)[t.path],i=r.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(hce(e,o))return!0;break;case"type":return!e||!(i!=null&&i.length)?!1:i.some(a=>a.code===e.type)}return!1}var E4=f.createContext(void 0);function Pm(){return f.useContext(E4)}function ne(){return Pm().medplum}function jm(){return Pm().navigate}function Vx(){return Pm().profile}function gce(e){let t=e.medplum,r=e.navigate??vce,[n,o]=f.useState({profile:t.getProfile(),loading:!t.isInitialized});f.useEffect(()=>{t&&(t.isInitialized||(o(a=>({...a,loading:!0})),t.getInitPromise().then(()=>o(a=>({...a,loading:!1}))).catch(console.error)))},[t,t.isInitialized]),f.useEffect(()=>{function a(){o({...n,profile:t.getProfile()})}return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[t,n]);let i=f.useMemo(()=>({...n,medplum:t,navigate:r}),[n,t,r]);return s.jsx(E4.Provider,{value:i,children:e.children})}function vce(e){window.location.assign(e)}function et(e,t){let r=ne(),[n,o]=f.useState(oC(r,e)),i=f.useCallback(a=>{Bc(a,n)||o(a)},[n,o]);return f.useEffect(()=>{i(oC(r,e))},[r,e,i]),f.useEffect(()=>{let a=!0;return Pa(e)&&r.readReference(e).then(l=>{a&&i(l)}).catch(l=>{a&&(i(void 0),t&&t(lt(l)))}),()=>a=!1},[r,n,e,i,t]),n}function oC(e,t){if(t){if(Vo(t))return t;if(Pa(t))return e.getCachedReference(t)}}function yce(e,t){return $4("searchOne",e,t)}function Os(e,t){return $4("searchResources",e,t)}function $4(e,t,r){let n=ne(),[o,i]=f.useState(),[a,l]=f.useState(!1),[c,u]=f.useState(),[d,p]=f.useState();return f.useEffect(()=>{let h=n.fhirSearchUrl(t,r).toString();h!==o&&(i(h),n[e](t,r).then(m=>{l(!1),u(m),p(kse)}).catch(m=>{l(!1),u(void 0),p(lt(m))}))},[n,e,t,r,o,u]),[c,a,d]}function xce(e){const t=e.value;return t?s.jsx(s.Fragment,{children:gae(t)}):null}function iC(e,t){return e.line&&e.line.length>t?e.line[t]:""}function aC(e,t,r){const n=e.line||[];for(;n.length<=t;)n.push("");return n[t]=r,{...e,line:n}}function wce(e){const[t,r]=f.useState(e.defaultValue||{}),n=f.useRef();n.current=t;function o(h){r(h),e.onChange&&e.onChange(h)}function i(h){o({...n.current,use:h})}function a(h){o({...n.current,type:h})}function l(h){o(aC(n.current||{},0,h))}function c(h){o(aC(n.current||{},1,h))}function u(h){o({...n.current,city:h})}function d(h){o({...n.current,state:h})}function p(h){o({...n.current,postalCode:h})}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(mt,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>i(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(mt,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>a(h.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(le,{placeholder:"Line 1",defaultValue:iC(t,0),onChange:h=>l(h.currentTarget.value)}),s.jsx(le,{placeholder:"Line 2",defaultValue:iC(t,1),onChange:h=>c(h.currentTarget.value)}),s.jsx(le,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),s.jsx(le,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),s.jsx(le,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>p(h.currentTarget.value)})]})}function bce(e){const t=Vx(),[r,n]=f.useState(e.defaultValue||{}),o=f.useRef();o.current=r;function i(a){const l=a?{text:a,authorReference:t&&ht(t),time:new Date().toISOString()}:{};n(l),e.onChange&&e.onChange(l)}return s.jsx(le,{name:e.name,placeholder:"Annotation text",defaultValue:r.text,onChange:a=>i(a.currentTarget.value)})}var _ce={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"},Sce=Object.defineProperty,Pce=Object.defineProperties,jce=Object.getOwnPropertyDescriptors,ph=Object.getOwnPropertySymbols,k4=Object.prototype.hasOwnProperty,R4=Object.prototype.propertyIsEnumerable,sC=(e,t,r)=>t in e?Sce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lC=(e,t)=>{for(var r in t||(t={}))k4.call(t,r)&&sC(e,r,t[r]);if(ph)for(var r of ph(t))R4.call(t,r)&&sC(e,r,t[r]);return e},Oce=(e,t)=>Pce(e,jce(t)),Cce=(e,t)=>{var r={};for(var n in e)k4.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ph)for(var n of ph(e))t.indexOf(n)<0&&R4.call(e,n)&&(r[n]=e[n]);return r},fe=(e,t,r)=>{const n=f.forwardRef((o,i)=>{var a=o,{color:l="currentColor",size:c=24,stroke:u=2,children:d}=a,p=Cce(a,["color","size","stroke","children"]);return f.createElement("svg",lC(Oce(lC({ref:i},_ce),{width:c,height:c,stroke:l,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),p),[...r.map(([h,m])=>f.createElement(h,m)),...d||[]])});return n.propTypes={color:De.string,size:De.oneOfType([De.string,De.number]),stroke:De.oneOfType([De.string,De.number])},n.displayName=`${t}`,n},Ece=fe("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"}]]),Om=fe("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"}]]),$ce=fe("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"}]]),kce=fe("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"}]]),Rce=fe("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"}]]),Tce=fe("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"}]]),Ice=fe("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"}]]),Dce=fe("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"}]]),Nce=fe("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"}]]),Ace=fe("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"}]]),Mce=fe("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"}]]),Lce=fe("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"}]]),Fi=fe("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"}]]),Cm=fe("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),zce=fe("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"}]]),Fce=fe("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),Vce=fe("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",fill:"currentColor",key:"svg-0",strokeWidth:"0"}]]),hh=fe("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"}]]),mh=fe("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"}]]),Bx=fe("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"}]]),Bce=fe("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"}]]),Uce=fe("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"}]]),Wce=fe("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"}]]),Hce=fe("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"}]]),qce=fe("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"}]]),Gce=fe("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"}]]),Em=fe("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"}]]),$m=fe("equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]),cC=fe("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"}]]),Qce=fe("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"}]]),Kce=fe("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"}]]),Yce=fe("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"}]]),Xce=fe("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"}]]),Jce=fe("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"}]]),Zce=fe("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"}]]),eue=fe("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"}]]),tue=fe("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"}]]),T4=fe("math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]),I4=fe("math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]),rue=fe("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"}]]),nue=fe("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"}]]),oue=fe("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"}]]),iue=fe("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"}]]),aue=fe("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"}]]),sue=fe("player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]),lue=fe("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),cue=fe("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"}]]),uue=fe("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"}]]),due=fe("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"}]]),fue=fe("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"}]]),wy=fe("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"}]]),Ux=fe("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"}]]),Wx=fe("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"}]]),pue=fe("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"}]]),hue=fe("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"}]]),mue=fe("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"}]]),gue=fe("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"}]]),D4=fe("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"}]]),uC=fe("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"}]]),vue=fe("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"}]]),gh=fe("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);class N4 extends f.Component{constructor(t){super(t),this.state={}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error("Uncaught error:",t,r)}render(){return this.state.error?s.jsx(Rc,{icon:s.jsx(Om,{size:16}),title:"Something went wrong",color:"red",children:je(this.state.error)}):this.props.children}}function In(){return s.jsx(ar,{style:{width:"100%",height:"100vh"},children:s.jsx(mn,{})})}function Hx(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Uc(t,e.options)}):null}function Ze(e){e.preventDefault(),e.stopPropagation()}function A4(e){if(dC(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&dC(t[0]))return!0}return!1}function dC(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function $e(e){const t=jm(),{to:r,suffix:n,label:o,onClick:i,children:a,...l}=e;let c=yue(r);return n&&(c+="/"+n),s.jsx(Fe,{href:c,"aria-label":o,onClick:u=>{Ze(u),i?i(u):r&&t(c)},...l,children:a})}function yue(e){if(e){if(typeof e=="string")return xue(e);if(Vo(e))return wue(e);if(Pa(e))return bue(e)}return"#"}function xue(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function wue(e){return`/${e.resourceType}/${e.id}`}function bue(e){return`/${e.reference}`}function ji(e){const t=et(e.value),r=t?Ro(t):e.alt??"",n=(t&&nae(t))??e.src,o=e.radius??"xl",i={...e};return delete i.value,delete i.link,e.link?s.jsx($e,{to:t,children:s.jsx(Mf,{src:n,alt:r,radius:o,...i})}):s.jsx(Mf,{src:n,alt:r,radius:o,...i})}function qx(e){const{defaultValue:t,toKey:r,toOption:n,loadOptions:o,onChange:i,onCreate:a,creatable:l,...c}=e,u=_ue(t),d=f.useRef(null),[p,h]=f.useState(),[m,g]=f.useState(),[v,_]=f.useState(),[y,x]=f.useState(u.map(n)),[w,b]=f.useState([]),j=f.useRef(),C=f.useRef(),P=f.useRef();P.current=p;const E=f.useRef();E.current=m;const k=f.useRef();k.current=v;const $=f.useRef();$.current=w;const I=f.useCallback(()=>{var F;h(void 0);const G=((F=d.current)==null?void 0:F.value.trim())||"";if(G===C.current&&o===j.current)return;C.current=G,j.current=o;const T=new AbortController;g(T),o(G,T.signal).then(V=>{T.signal.aborted||(b(V.map(n)),g(void 0),k.current&&(V.length>0&&i(V.slice(0,1)),_(!1)))}).catch(V=>{T.signal.aborted||V.message.includes("aborted")||de({color:"red",message:je(V)})})},[o,i,n]),R=f.useCallback(()=>{E.current&&(E.current.abort(),g(void 0)),P.current!==void 0&&window.clearTimeout(P.current);const G=window.setTimeout(()=>I(),100);h(G)},[I]),N=f.useCallback(G=>{var V;const T=[],F=[];for(const X of G){let J=(V=$.current)==null?void 0:V.find(Se=>Se.value===X),_e=J==null?void 0:J.resource;!_e&&l!==!1&&a&&(_e=a(X),J=n(_e)),_e&&T.push(_e),J&&F.push(J)}i(T),x(F)},[l,i,a,n]),M=f.useCallback(G=>{G.key==="Enter"&&(!P.current&&!E.current?(Ze(G),$.current&&$.current.length>0&&(b($.current.slice(0,1)),N([$.current[0].value]))):_(!0))},[N]),L=f.useCallback(G=>{const T=n(a(G));return b([...$.current,T]),T},[a,b,n]),Q=f.useCallback((G,T)=>!T,[]);return f.useEffect(()=>()=>{E.current&&E.current.abort()},[]),s.jsx(fm,{...c,ref:d,defaultValue:u.map(r),searchable:!0,onKeyDown:M,onSearchChange:R,data:[...y,...w],onFocus:I,onChange:N,onCreate:L,rightSectionWidth:40,rightSection:m?s.jsx(mn,{size:16}):null,filter:Q,creatable:!0,withinPortal:!0})}function _ue(e){return e?Array.isArray(e)?e:[e]:[]}const Sue=W(()=>({searchInput:{input:{width:220,transition:"width 0.2s"},"input:focus":{width:400},"@media (max-width: 800px)":{input:{width:150},"input:focus":{width:150}}}}));function Pue(e){return e.id}function jue(e){return{value:e.id,label:Ro(e),resource:e}}function Oue(e){const{classes:t}=Sue(),r=jm(),n=ne(),o=f.useCallback(async(a,l)=>{const c=Eue(a),u={signal:l},d=await n.graphql(c,void 0,void 0,u);return $ue(d,a)},[n]),i=f.useCallback(a=>{a.length>0&&r(`/${at(a[0])}`)},[r]);return s.jsx(qx,{size:"sm",radius:"md",className:t.searchInput,icon:s.jsx(fue,{size:16}),placeholder:"Search",itemComponent:Cue,toKey:Pue,toOption:jue,onChange:i,loadOptions:o,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const Cue=f.forwardRef(({resource:e,...t},r)=>{var o;let n;return e.resourceType==="Patient"?n=e.birthDate:e.resourceType==="ServiceRequest"&&(n=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...t,children:s.jsxs(K,{noWrap:!0,children:[s.jsx(ji,{value:e}),s.jsxs("div",{children:[s.jsx(oe,{children:Ro(e)}),s.jsx(oe,{size:"xs",color:"dimmed",children:n})]})]})})});function Eue(e){const t=JSON.stringify(e);return X5(e)?`{
129
+ Patients1: PatientList(_id: ${t}, _count: 1) {
130
+ resourceType
131
+ id
132
+ identifier {
133
+ system
134
+ value
135
+ }
136
+ name {
137
+ given
138
+ family
139
+ }
140
+ birthDate
141
+ }
142
+ ServiceRequestList(_id: ${t}, _count: 1) {
143
+ resourceType
144
+ id
145
+ identifier {
146
+ system
147
+ value
148
+ }
149
+ subject {
150
+ display
151
+ }
152
+ }
153
+ }`.replace(/\s+/g," "):`{
154
+ Patients1: PatientList(name: ${t}, _count: 5) {
155
+ resourceType
156
+ id
157
+ identifier {
158
+ system
159
+ value
160
+ }
161
+ name {
162
+ given
163
+ family
164
+ }
165
+ birthDate
166
+ }
167
+ Patients2: PatientList(identifier: ${t}, _count: 5) {
168
+ resourceType
169
+ id
170
+ identifier {
171
+ system
172
+ value
173
+ }
174
+ name {
175
+ given
176
+ family
177
+ }
178
+ birthDate
179
+ }
180
+ ServiceRequestList(identifier: ${t}, _count: 5) {
181
+ resourceType
182
+ id
183
+ identifier {
184
+ system
185
+ value
186
+ }
187
+ subject {
188
+ display
189
+ }
190
+ }
191
+ }`.replace(/\s+/g," ")}function $ue(e,t){const r=[];return e.data.Patients1&&r.push(...e.data.Patients1),e.data.Patients2&&r.push(...e.data.Patients2),e.data.ServiceRequestList&&r.push(...e.data.ServiceRequestList),Rue(kue(r),t).slice(0,5)}function kue(e){const t=new Set,r=[];for(const n of e)t.has(n.id)||(t.add(n.id),r.push(n));return r}function Rue(e,t){return e.sort((r,n)=>fC(n,t)-fC(r,t))}function fC(e,t){let r=0;if(e.identifier)for(const n of e.identifier)r=Math.max(r,pC(n.value,t));if(e.resourceType==="Patient"&&e.name)for(const n of e.name)r=Math.max(r,pC(Uc(n),t));return r}function pC(e,t){if(!e)return 0;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?0:100-r}const Tue=W(e=>({logoButton:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},user:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},userName:{fontWeight:500,lineHeight:1,marginRight:3,[e.fn.smallerThan("xs")]:{display:"none"}},userActive:{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}}));function Iue(e){var d,p,h,m;const t=Pm(),{medplum:r,profile:n,navigate:o}=t,i=r.getLogins(),{classes:a,cx:l}=Tue(),[c,u]=f.useState(!1);return s.jsx(dR,{height:60,p:8,style:{zIndex:101},children:s.jsxs(K,{position:"apart",children:[s.jsxs(K,{spacing:"xs",children:[s.jsx(Po,{className:a.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(Oue,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(Z,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:c,onClose:()=>u(!1),children:[s.jsx(Z.Target,{children:s.jsx(Po,{className:l(a.user,{[a.userActive]:c}),onClick:()=>u(g=>!g),children:s.jsxs(K,{spacing:7,children:[s.jsx(ji,{value:n,radius:"xl",size:24}),s.jsx(oe,{size:"sm",className:a.userName,children:Uc((d=n==null?void 0:n.name)==null?void 0:d[0])}),s.jsx(Fce,{size:12,stroke:1.5})]})})}),s.jsxs(Z.Dropdown,{children:[s.jsxs(be,{align:"center",p:"xl",children:[s.jsx(ji,{size:"xl",radius:100,value:t.profile}),s.jsx(Hx,{value:(h=(p=t.profile)==null?void 0:p.name)==null?void 0:h[0]}),s.jsx(oe,{color:"dimmed",size:"xs",children:(m=r.getActiveLogin())==null?void 0:m.project.display})]}),i.length>1&&s.jsx(Z.Divider,{}),i.map(g=>g.profile.reference!==at(t.profile)&&s.jsx(Z.Item,{onClick:()=>{r.setActiveLogin(g).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(K,{children:[s.jsx(Mf,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(oe,{size:"sm",weight:500,children:g.profile.display}),s.jsx(oe,{color:"dimmed",size:"xs",children:g.project.display})]})]})},g.profile.reference)),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx(mue,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(Z.Item,{icon:s.jsx(wy,{size:14,stroke:1.5}),onClick:()=>o(`/${at(n)}`),children:"Account settings"}),s.jsx(Z.Item,{icon:s.jsx(tue,{size:14,stroke:1.5}),onClick:async()=>{await r.signOut(),o("/signin")},children:"Sign out"}),s.jsx(oe,{size:"xs",color:"dimmed",align:"center",children:e.version})]})]})]})})}function Due(e){const t={};for(const r of Array.from(e.elements))r instanceof HTMLInputElement?Nue(t,r):r instanceof HTMLTextAreaElement?t[r.name]=r.value:r instanceof HTMLSelectElement&&Aue(t,r);return t}function Nue(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function Aue(e,t){e[t.name]=t.value}function Ne(e){return s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const r=Due(t.target);e.onSubmit&&e.onSubmit(r)},children:e.children})}function Mue(e){const t=ne(),r=t.getUserConfiguration();function n(o){var d,p;const{menuname:i,bookmarkname:a}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=ki(r),u=(d=c.menu)==null?void 0:d.find(({title:h})=>h===i);(p=u==null?void 0:u.link)==null||p.push({name:a,target:l}),t.updateResource(c).then(h=>{r.menu=h.menu,t.dispatchEvent({type:"change"}),de({color:"green",message:"Success"}),e.onOk()}).catch(h=>{de({color:"red",message:je(h)})})}return s.jsx(Mr,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(Ne,{onSubmit:n,children:s.jsxs(be,{children:[s.jsx(Lue,{config:r}),s.jsx(le,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(K,{position:"right",children:s.jsx(re,{mt:"sm",type:"submit",children:"OK"})})]})})})}function Lue(e){function t(n){var o;return(o=n==null?void 0:n.menu)==null?void 0:o.map(i=>i.title)}const r=t(e.config);return s.jsx(mt,{name:"menuname",defaultValue:r[0],label:"Select Menu Option",placeholder:"Menu",data:r,withAsterisk:!0})}function Gx(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function zue(e){return typeof e.display=="string"?e.display:Gx(e)}function Fue(e){return{value:Gx(e),label:zue(e),resource:e}}function Vue(e){return{code:e,display:e}}function Qx(e){const t=ne(),{binding:r,creatable:n,clearable:o,...i}=e,a=f.useCallback(async(l,c)=>{var h;if(!r)return[];const d=(h=(await t.searchValueSet(r,l,{signal:c})).expansion)==null?void 0:h.contains,p=[];for(const m of d)m.code&&!p.some(g=>g.code===m.code)&&p.push(m);return p},[t,r]);return s.jsx(qx,{...i,creatable:n??!0,clearable:o??!0,toKey:Gx,toOption:Fue,loadOptions:a,onCreate:Vue,getCreateLabel:n===!1?void 0:l=>`+ Create ${l}`})}function M4(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=o[0],a=Uue(i);r(a),e.onChange&&e.onChange(a)}return s.jsx(Qx,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:Bue(t),onChange:n,creatable:e.creatable,maxSelectedValues:e.maxSelectedValues??1,clearSearchOnChange:e.clearSearchOnChange,clearable:e.clearable})}function Bue(e){return e?{code:e}:void 0}function Uue(e){return e==null?void 0:e.code}function Kx(e){const[t,r]=f.useState(e.defaultValue),n=e.onChange,o=f.useCallback(i=>{r(i),n&&n(i)},[n]);return s.jsx(M4,{"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1})}const L4=W(e=>({menuTitle:{margin:"20px 0 4px 6px",fontSize:"9px",fontWeight:"normal",textTransform:"uppercase",letterSpacing:"2px"},link:{...e.fn.focusStyles(),display:"flex",alignItems:"center",textDecoration:"none",fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],padding:"8px 12px",borderRadius:e.radius.sm,fontWeight:500,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],color:e.colorScheme==="dark"?e.white:e.black,textDecoration:"none","& svg":{color:e.colorScheme==="dark"?e.white:e.black}},"& svg":{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],marginRight:e.spacing.sm,strokeWidth:1.5,width:18,height:18}},linkActive:{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:e.primaryColor}).background,color:e.fn.variant({variant:"light",color:e.primaryColor}).color,"& svg":{color:e.fn.variant({variant:"light",color:e.primaryColor}).color}}}}));function Wue(e){var c;const{classes:t}=L4(),r=jm(),n=Gue(e.pathname,e.searchParams,e.menus),[o,i]=f.useState(!1);function a(u,d){u.stopPropagation(),u.preventDefault(),r(d),window.innerWidth<768&&e.closeNavbar()}function l(u){u&&r(`/${u}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Fl,{width:{sm:250},p:"xs",children:s.jsxs(ga,{children:[!e.resourceTypeSearchDisabled&&s.jsx(Fl.Section,{mb:"sm",children:s.jsx(Kx,{name:"resourceType",placeholder:"Resource Type",onChange:u=>l(u)},window.location.pathname)}),s.jsxs(Fl.Section,{grow:!0,children:[(c=e.menus)==null?void 0:c.map(u=>{var d;return s.jsxs(f.Fragment,{children:[s.jsx(oe,{className:t.menuTitle,children:u.title}),(d=u.links)==null?void 0:d.map(p=>s.jsxs(Hue,{to:p.href,active:p.href===(n==null?void 0:n.href),onClick:h=>a(h,p.href),children:[s.jsx(que,{to:p.href,icon:p.icon}),s.jsx("span",{children:p.label})]},p.href))]},`menu-${u.title}`)}),e.displayAddBookmark&&s.jsx(re,{variant:"subtle",size:"xs",mt:"xl",leftIcon:s.jsx(lue,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(Mue,{pathname:e.pathname,searchParams:e.searchParams,visible:o,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function Hue(e){const{classes:t,cx:r}=L4();return s.jsx($e,{onClick:e.onClick,to:e.to,className:r(t.link,{[t.linkActive]:e.active}),children:e.children})}function que(e){return e.icon?e.icon:s.jsx(vm,{w:30})}function Gue(e,t,r){if(!e||!t||!r)return;let n,o=0;for(const i of r)if(i.links)for(const a of i.links){const l=Que(e,t,a.href);l>o&&(o=l,n=a)}return n}function Que(e,t,r){const n=new URL(r,"https://example.com");if(e!==n.pathname)return 0;const o=["_count","_offset"];for(const[a,l]of n.searchParams.entries())if(!o.includes(a)&&t.get(a)!==l)return 0;let i=1;for(const[a,l]of t.entries())o.includes(a)||n.searchParams.get(a)===l&&i++;return i}function Kue(e){var u;const t=Ht(),[r,n]=f.useState(localStorage.navbarOpen==="true"),o=ne(),i=Vx();f.useEffect(()=>{function d(){de({color:"red",message:"No connection to server",autoClose:!1})}return o.addEventListener("offline",d),()=>o.removeEventListener("offline",d)},[o]);function a(d){localStorage.navbarOpen=d.toString(),n(d)}function l(){a(!1)}function c(){a(!r)}return o.isLoading()?s.jsx(In,{}):s.jsx(mR,{styles:{main:{background:t.colorScheme==="dark"?t.colors.dark[8]:t.colors.gray[0]}},padding:0,fixed:!0,header:i&&s.jsx(Iue,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:c}),navbar:i&&r?s.jsx(Wue,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:l,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,children:s.jsx(N4,{children:s.jsx(f.Suspense,{fallback:s.jsx(In,{}),children:e.children})},`${e.pathname}?${(u=e.searchParams)==null?void 0:u.toString()}`)})}function Hc(e){const{contentType:t,url:r,title:n}=e.value??{};return r?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:r,alt:n}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:r})}),t==="application/pdf"&&s.jsx("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{width:"100%",height:"400",src:r+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Fe,{href:r,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:Yue(n),children:n||"Download"})})]}):null}function Yue(e){return e!=null&&e.includes(".")?e:void 0}function Xue(e){var t;return s.jsx("div",{children:(t=e.values)==null?void 0:t.map((r,n)=>s.jsx("div",{children:s.jsx(Hc,{value:r,maxWidth:e.maxWidth})},"attatchment-"+n))})}function Yx(e){const t=ne(),r=f.useRef(null);function n(a){var l;Ze(a),(l=r.current)==null||l.click()}function o(a){Ze(a);const l=a.target.files;l&&Array.from(l).forEach(i)}function i(a){if(!a||!a.name)return;e.onUploadStart&&e.onUploadStart();const c=a.name,u=a.type||"application/octet-stream";t.createBinary(a,c,u,e.onUploadProgress).then(d=>{e.onUpload({contentType:d.contentType,url:d.url,title:c})}).catch(d=>{e.onUploadError&&e.onUploadError(lt(d))})}return s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:r,onChange:a=>o(a)}),e.children({onClick:n})]})}function Jue(e){const[t,r]=f.useState(e.defaultValue??[]),n=f.useRef();n.current=t;function o(i){r(i),e.onChange&&e.onChange(i)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((i,a)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Hc,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(yr,{title:"Remove",size:"sm",onClick:l=>{Ze(l);const c=t.slice();c.splice(a,1),o(c)},children:s.jsx(hh,{})})})]},`${a}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(Yx,{onUpload:i=>{o([...n.current,i])},children:i=>s.jsx(yr,{...i,title:"Add",size:"sm",color:"green",children:s.jsx(Bx,{size:16})})})})]})]})]})}function z4(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return t?s.jsxs(s.Fragment,{children:[s.jsx(Hc,{value:t,maxWidth:200}),s.jsx(re,{onClick:o=>{Ze(o),n(void 0)},children:"Remove"})]}):s.jsx(Yx,{onUpload:n,children:o=>s.jsx(re,{...o,children:"Upload..."})})}const F4=["meta","implicitRules","contained","extension","modifierExtension"],V4=["language","text"],Zue=W(e=>({root:{display:"grid",gridTemplateColumns:"30% 70%",margin:0,"& > dt, & > dd":{padding:`${e.spacing.sm} ${e.spacing.sm}`,borderTop:`0.1px solid ${e.colors.gray[3]}`,margin:0}},compact:{gridTemplateColumns:"20% 80%","& > dt, & > dd":{padding:`0 ${e.spacing.xs} ${e.spacing.xs} 0`,border:0}}}));function Xx(e){const{children:t,compact:r}=e,{classes:n,cx:o}=Zue();return s.jsx("dl",{className:o(n.root,{[n.compact]:r}),children:t})}function us(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function ro(e){return s.jsx(s.Fragment,{children:js(e.value)})}function ede(e){return s.jsx(s.Fragment,{children:_a(e.value)})}function B4(e){const t=e.value;if(!t)return null;const r=[];return t.value&&r.push(t.value),(t.use||t.system)&&(r.push(" ["),t.use&&r.push(t.use),t.use&&t.system&&r.push(" "),t.system&&r.push(t.system),r.push("]")),s.jsx(s.Fragment,{children:r.join("").trim()})}function tde(e){var r;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(r=t.telecom)==null?void 0:r.map(n=>s.jsx(B4,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function rde(e){var t,r;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(r=e.value)==null?void 0:r.value]})}function nde(e){return s.jsx(s.Fragment,{children:Sae(e.value)})}function vc(e){return s.jsx(s.Fragment,{children:ti(e.value)})}function Jx(e){return s.jsx(s.Fragment,{children:hc(e.value)})}function ode(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(vc,{value:t.numerator})," / ",s.jsx(vc,{value:t.denominator})]}):null}function vh(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Dr(e.value);return e.link!==!1&&e.value.reference?s.jsx($e,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function ide(e){const{property:t,values:r}=e,n=t.type[0].code;return e.values?s.jsx(s.Fragment,{children:r.map((o,i)=>s.jsx("div",{children:s.jsx(Io,{arrayElement:!0,property:t,propertyType:n,value:o,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${i}-${r.length}`))}):s.jsx(s.Fragment,{})}function Io(e){var i;const{property:t,propertyType:r,value:n}=e;if((i=t==null?void 0:t.path)==null?void 0:i.endsWith(".id"))return s.jsxs(ae,{component:"div",sx:{display:"flex",gap:3,alignItems:"center"},children:[n,!Xt(n)&&s.jsx(II,{value:n,timeout:2e3,children:({copied:a,copy:l})=>s.jsx(UN,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(yr,{color:a?"teal":"gray",onClick:l,children:a?s.jsx(Cm,{size:"1rem"}):s.jsx(Uce,{size:"1rem"})})})})]});if(t!=null&&t.max&&t.max>1&&!e.arrayElement)return r===B.Attachment?s.jsx(Xue,{values:n,maxWidth:e.maxWidth}):s.jsx(ide,{property:t,values:n,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(r){case B.boolean:return s.jsx(s.Fragment,{children:n===void 0?"":(!!n).toString()});case B.SystemString:case B.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:n});case B.code:case B.date:case B.decimal:case B.id:case B.integer:case B.positiveInt:case B.unsignedInt:case B.uri:case B.url:return s.jsx(s.Fragment,{children:n});case B.canonical:return s.jsx(vh,{value:{reference:n},link:e.link});case B.dateTime:case B.instant:return s.jsx(s.Fragment,{children:Nr(n)});case B.markdown:return s.jsx("pre",{children:n});case B.Address:return s.jsx(xce,{value:n});case B.Annotation:return s.jsx(s.Fragment,{children:n==null?void 0:n.text});case B.Attachment:return s.jsx(Hc,{value:n,maxWidth:e.maxWidth});case B.CodeableConcept:return s.jsx(ro,{value:n});case B.Coding:return s.jsx(ede,{value:n});case B.ContactDetail:return s.jsx(tde,{value:n});case B.ContactPoint:return s.jsx(B4,{value:n});case B.HumanName:return s.jsx(Hx,{value:n});case B.Identifier:return s.jsx(rde,{value:n});case B.Money:return s.jsx(nde,{value:n});case B.Period:return s.jsx(s.Fragment,{children:yae(n)});case B.Quantity:case B.Duration:return s.jsx(vc,{value:n});case B.Range:return s.jsx(Jx,{value:n});case B.Ratio:return s.jsx(ode,{value:n});case B.Reference:return s.jsx(vh,{value:n,link:e.link});case B.Timing:return s.jsx(s.Fragment,{children:Z5(n)});case B.Dosage:case B.UsageContext:return s.jsx(by,{value:{type:r,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);return s.jsx(by,{value:{type:t.type[0].code,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function km(e,t){const r=xr(e,t);return r?Array.isArray(r)?[r.map(n=>n.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function ade(e,t,r){const n=Ox(e,t,r);return n?Array.isArray(n)?[n.map(o=>o.value),n[0].type]:[n.value,n.type]:[void 0,"undefined"]}function by(e){const t=e.value,r=t.value;if(!r)return null;const n=t.type,o=kx(n);return o?typeof r=="object"&&"name"in r&&Object.keys(r).length===1&&typeof r.name=="string"?s.jsx("div",{children:r.name}):s.jsx(Xx,{compact:e.compact,children:Object.entries(o.elements).map(i=>{const[a,l]=i;if(F4.includes(a)||V4.includes(a)&&l.path.split(".").length===2)return null;const[c,u]=km(t,a);return e.ignoreMissingValues&&(!c||Array.isArray(c)&&c.length===0)?null:s.jsx(us,{term:fh(a),children:s.jsx(Io,{property:l,propertyType:u,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},a)})}):s.jsxs("div",{children:[n," not implemented"]})}function sde(e,t){const r=e.lastIndexOf(t);if(r===-1)return["",e];const n=e.substring(0,r),o=e.substring(r+t.length);return[n,o]}const Cs=S.createContext({profileUrl:void 0,debugMode:!1,getModifiedNestedElement:()=>{}});function lde(e,t,r){const n=Object.create(null);function o(a){return n[a]}const i=e==null?void 0:e.elements;if(i){const a=new Set;for(const[l,c]of Object.entries(i)){const[u,d]=sde(l,".");a.has(u)&&(n[e.type+"."+l]=c),a.add(l)}}return{debugMode:r??!1,profileUrl:t,getModifiedNestedElement:o}}function U4(e){const{debugMode:t}=f.useContext(Cs);let r;return t&&e.fhirPath?r=`${e.title} - ${e.fhirPath}`:r=e.title,s.jsxs(K,{noWrap:!0,"data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(Ut.Wrapper,{id:e.htmlFor,label:r,description:e.description,withAsterisk:e.withAsterisk,children:null})})]})}function Ie(e,t){var r,n,o;return(o=(n=(r=e==null?void 0:e.issue)==null?void 0:r.filter(i=>{var a;return W4((a=i.expression)==null?void 0:a[0],t)}))==null?void 0:n.map(i=>{var a;return(a=i.details)==null?void 0:a.text}))==null?void 0:o.join(`
192
+ `)}function Rm(e,t){var r;return(r=e==null?void 0:e.issue)==null?void 0:r.filter(n=>{var o;return W4((o=n.expression)==null?void 0:o[0],t)})}function W4(e,t){if(e===t)return!0;if(!e||!t)return!1;const r=e.indexOf(".");if(r>=0&&e.substring(r+1)===t)return!0;const n=t.indexOf(".");return n>=0&&t.substring(n+1)===e}function Je(e){const{debugMode:t}=f.useContext(Cs);let r;return t&&e.fhirPath?r=`${e.title} - ${e.fhirPath}`:r=e.title,s.jsx(Ut.Wrapper,{id:e.htmlFor,label:r,description:e.description,withAsterisk:e.withAsterisk,error:Ie(e.outcome,e.htmlFor),"data-testid":e.testId,children:e.children})}function _y(e,t,r,n,o){const i=n.type;if(i.length>1)for(const a of i){const l=t.replace("[x]",er(a.code));l in e&&delete e[l]}return e[r]=o,e}function cde(e){return!!e&&!Xt(e.url)&&!Xt(e.name)}function ude(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=fde(o);r(i),e.onChange&&e.onChange(i)}return s.jsx(Qx,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&dde(t),maxSelectedValues:1,onChange:n})}function dde(e){var t;return(t=e.coding)==null?void 0:t.map(r=>({system:r.system,code:r.code,display:r.display}))}function fde(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function H4(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=o[0],a=i&&hde(i);r(a),e.onChange&&e.onChange(a)}return s.jsx(Qx,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&pde(t),maxSelectedValues:1,onChange:n})}function pde(e){return{system:e.system,code:e.code,display:e.display}}function hde(e){return{system:e.system,code:e.code,display:e.display}}function q4(e){const{path:t,outcome:r}=e,{getModifiedNestedElement:n}=f.useContext(Cs),[o,i]=f.useState(e.defaultValue),a=f.useRef();a.current=o;const[l,c,u]=f.useMemo(()=>["system","use","value"].map(g=>n(t+"."+g)),[n,t]);function d(g){g&&Object.keys(g).length===0&&(g=void 0),i(g),e.onChange&&e.onChange(g)}function p(g){const v={...a.current,system:g};g||delete v.system,d(v)}function h(g){const v={...a.current,use:g};g||delete v.use,d(v)}function m(g){const v={...a.current,value:g};g||delete v.value,d(v)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,align:"flex-start",children:[s.jsx(mt,{"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((l==null?void 0:l.min)??0)>0,onChange:g=>p(g.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Ie(r,t+".system")}),s.jsx(mt,{"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((c==null?void 0:c.min)??0)>0,onChange:g=>h(g.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Ie(r,t+".use")}),s.jsx(le,{placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((u==null?void 0:u.min)??0)>0,onChange:g=>m(g.currentTarget.value),error:Ie(r,t+".value")})]})}function mde(e){var l;const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(c){r(c),e.onChange&&e.onChange(c)}function i(c){const u={...n.current,name:c};c||delete u.name,o(u)}function a(c){const u={...n.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:c=>i(c.currentTarget.value)}),s.jsx(q4,{name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:a,outcome:e.outcome})]})}function gde(e){if(!e)return"";const t=new Date(e);return wm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function G4(e){if(!e)return"";const t=new Date(e);return wm(t)?t.toISOString():""}var vde={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"2.2.6-f42e4a96",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function la(e){return s.jsx(le,{id:e.name,name:e.name,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:yde(),defaultValue:gde(e.defaultValue),autoFocus:e.autoFocus,error:Ie(e.outcome,e.name),onChange:t=>{if(e.onChange){const r=t.currentTarget.value;e.onChange(G4(r))}}})}function yde(){return vde.NODE_ENV==="test"?"text":"datetime-local"}function xde(e){const{propertyType:t}=e,r=ne(),[n,o]=f.useState(!1),[i,a]=f.useState(),l=f.useMemo(()=>{if(!(!t.profile||t.profile.length===0))return t.profile[0]},[t]);f.useEffect(()=>{l&&(o(!0),r.requestProfileSchema(l).then(()=>{const u=_m(l);o(!1),a(u)}).catch(u=>{o(!1),console.warn(u)}))},[r,l]);function c(u){e.onChange&&(console.log("Extension",u),e.onChange(u))}return l?n?s.jsxs("div",{children:["Loading ",l,"..."]}):i?s.jsx(t1,{profileUrl:l,typeName:i.name,defaultValue:e.defaultValue,onChange:c}):s.jsxs("div",{children:["StructureDefinition for ",l," not found"]}):s.jsx(wde,{...e})}function wde(e){return s.jsx(Vs,{id:e.name,name:e.name,"data-testid":"extension-json-input",defaultValue:Dr(e.defaultValue),deserialize:JSON.parse,onChange:t=>{e.onChange&&e.onChange(JSON.parse(t))}})}function bde(e){var p,h,m;const{outcome:t,path:r}=e,[n,o]=f.useState(e.defaultValue);function i(g){o(g),e.onChange&&e.onChange(g)}function a(g){i({...n,use:g||void 0})}function l(g){i({...n,prefix:g?g.split(" "):void 0})}function c(g){i({...n,given:g?g.split(" "):void 0})}function u(g){i({...n,family:g||void 0})}function d(g){i({...n,suffix:g?g.split(" "):void 0})}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(mt,{defaultValue:n==null?void 0:n.use,name:e.name+"-use","data-testid":"use",onChange:g=>a(g.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Ie(t,r+".use")}),s.jsx(le,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(p=n==null?void 0:n.prefix)==null?void 0:p.join(" "),onChange:g=>l(g.currentTarget.value),error:Ie(t,r+".prefix")}),s.jsx(le,{placeholder:"Given",name:e.name+"-given",defaultValue:(h=n==null?void 0:n.given)==null?void 0:h.join(" "),onChange:g=>c(g.currentTarget.value),error:Ie(t,r+".given")}),s.jsx(le,{name:e.name+"-family",placeholder:"Family",defaultValue:n==null?void 0:n.family,onChange:g=>u(g.currentTarget.value),error:Ie(t,r+".family")}),s.jsx(le,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(m=n==null?void 0:n.suffix)==null?void 0:m.join(" "),onChange:g=>d(g.currentTarget.value),error:Ie(t,r+".suffix")})]})}function _de(e){const{path:t,outcome:r}=e,[n,o]=f.useState(e.defaultValue),{getModifiedNestedElement:i}=f.useContext(Cs),[a,l]=f.useMemo(()=>["system","value"].map(u=>i(t+"."+u)),[i,t]);function c(u){o(u),e.onChange&&e.onChange(u)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,align:"flex-start",children:[s.jsx(le,{placeholder:"System",required:((a==null?void 0:a.min)??0)>0,defaultValue:n==null?void 0:n.system,onChange:u=>c({...n,system:u.currentTarget.value}),error:Ie(r,t+".system")}),s.jsx(le,{placeholder:"Value",required:((l==null?void 0:l.min)??0)>0,defaultValue:n==null?void 0:n.value,onChange:u=>c({...n,value:u.currentTarget.value}),error:Ie(r,t+".value")})]})}const Sde=["USD","EUR","CAD","GBP","AUD"];function Pde(e){var c;const{onChange:t}=e,[r,n]=f.useState(e.defaultValue),o=f.useCallback(u=>{n(u),t&&t(u)},[t]),i=f.useCallback(u=>{o({...r,currency:u.currentTarget.value})},[r,o]),a=f.useCallback(u=>{o({...r,value:u.currentTarget.valueAsNumber})},[r,o]),l=s.jsx(mt,{defaultValue:r==null?void 0:r.currency,data:Sde,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:i});return s.jsx(le,{type:"number",label:e.label,placeholder:e.placeholder??"Value",defaultValue:((c=r==null?void 0:r.value)==null?void 0:c.toString())??"USD",icon:s.jsx(Wce,{size:14}),rightSection:l,rightSectionWidth:92,onChange:a})}function jde(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(la,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>n({...t,start:o})}),s.jsx(la,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>n({...t,end:o})})]})}function ca(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(mt,{style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:o=>n({...t,comparator:o.currentTarget.value})}),s.jsx(le,{id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:o=>{e.disableWheel&&o.currentTarget.blur()},onChange:o=>{n({...t,value:Ode(o.currentTarget.value)})}}),s.jsx(le,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>n({...t,unit:o.currentTarget.value})})]})}function Ode(e){if(e)return parseFloat(e)}function Zx(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ca,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>n({...t,low:o})}),s.jsx(ca,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>n({...t,high:o})})]})}function Cde(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ca,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>n({...t,numerator:o})}),s.jsx(ca,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>n({...t,denominator:o})})]})}const Ede={Observation:"code",User:"email:contains"},$de=["AccessPolicy","Account","ActivityDefinition","Bot","CapabilityStatement","ClientApplication","CodeSystem","CompartmentDefinition","ConceptMap","EffectEvidenceSynthesis","Endpoint","EventDefinition","Evidence","EvidenceVariable","ExampleScenario","GraphDefinition","HealthcareService","ImplementationGuide","InsurancePlan","Library","Location","Measure","MedicinalProduct","MessageDefinition","NamingSystem","OperationDefinition","Organization","Patient","Person","PlanDefinition","Practitioner","Project","Questionnaire","RelatedPerson","ResearchDefinition","ResearchElementDefinition","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function kde(e){return{value:at(e),label:Ro(e),resource:e}}function Bs(e){const t=ne(),{resourceType:r,searchCriteria:n}=e,[o,i]=f.useState(),a=et(e.defaultValue,i),l=e.onChange,c=f.useCallback(async(d,p)=>{const h=Tde(r),m=new URLSearchParams({[h]:d??"",_count:"10",...n});return await t.searchResources(r,m,{signal:p})},[t,r,n]),u=f.useCallback(d=>{l&&l(d[0])},[l]);return e.defaultValue&&!o&&!a?null:s.jsx(qx,{name:e.name,required:e.required,itemComponent:Rde,defaultValue:a,placeholder:e.placeholder,maxSelectedValues:1,toKey:at,toOption:kde,loadOptions:c,onChange:u,clearable:!0})}const Rde=f.forwardRef(({label:e,resource:t,...r},n)=>s.jsx("div",{ref:n,...r,children:s.jsxs(K,{noWrap:!0,children:[s.jsx(ji,{value:t}),s.jsxs("div",{children:[s.jsx(oe,{children:e}),s.jsx(oe,{size:"xs",color:"dimmed",children:t.birthDate})]})]})}));function Tde(e){return Ede[e]??($de.includes(e)?"name":"_id")}function Tm(e){const{onChange:t}=e,r=ne(),[n,o]=f.useState(e.defaultValue),[i,a]=f.useState(()=>Ide(e.targetTypes)),[l,c]=f.useState(()=>Dde(e.defaultValue,i)),u=f.useRef(new P4),d=f.useMemo(()=>(l==null?void 0:l.type)==="profile"?{...e.searchCriteria,_profile:l.value}:e.searchCriteria,[e.searchCriteria,l]);f.useEffect(()=>{let m=!1;const g=i==null?void 0:i.map(v=>{if(!Ade(v))return Promise.resolve(v);m=!0;const _=v.value,y=u.current.get(_);if(y)return y;const x=Nde(r,v.value).then(b=>{const j={...v};return b?xm(b.type)?(j.resourceType=b.type,j.name=b.name,j.title=b.title):(console.error(`StructureDefinition.type missing for ${v.value}`),j.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${v.value}`),j.error="StructureDefinition not found"),j}).catch(b=>(console.error(b),{...v,error:b})),w=new bn(x);return u.current.set(_,w),w});!g||!m||Promise.all(g).then(v=>{if(a(v),!l)return;const _=v.findIndex(y=>y.value===l.value||y.resourceType===l.resourceType);if(_===-1){console.debug(`defaultValue had unexpected resourceType: ${l.resourceType}`);return}c(v[_])}).catch(console.error)},[r,l,i]);const p=f.useCallback(m=>{const g=m?ht(m):void 0;o(g),t&&t(g)},[t]),h=f.useMemo(()=>i?i.map(m=>({value:m.value,label:m.type==="profile"?m.title??m.name??m.resourceType??m.value:m.value})):[],[i]);return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[i&&i.length>1&&s.jsx(mt,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:l==null?void 0:l.resourceType,autoFocus:e.autoFocus,onChange:m=>{const g=m.currentTarget.value,v=i.find(_=>_.value===g);c(v)},data:h}),!i&&s.jsx(Kx,{autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:l==null?void 0:l.resourceType,onChange:m=>{c(m?{type:"resourceType",value:m,resourceType:m}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(Bs,{resourceType:l==null?void 0:l.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:n,searchCriteria:d,onChange:p})]})}function Ide(e){if(!e||e.length===0||e.length===1&&e[0]==="Resource")return;const t=[];for(const r of e)r.includes("/")?t.push({type:"profile",value:r}):t.push({type:"resourceType",value:r,resourceType:r});return t}function Dde(e,t){var n;const r=(n=e==null?void 0:e.reference)==null?void 0:n.split("/")[0];if(r){const o=t==null?void 0:t.find(i=>i.resourceType===r);return o||{type:"resourceType",value:r,resourceType:r}}if(t&&t.length>0)return t[0]}async function Nde(e,t){const r=_m(t);if(r)return{type:r.type,name:r.name,title:r.title};const n=`{
193
+ StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
194
+ type,
195
+ name,
196
+ title,
197
+ }
198
+ }`.replace(/\s+/g," ");return(await e.graphql(n)).data.StructureDefinitionList[0]}function Ade(e){return e.type==="profile"&&!(e!=null&&e.error)&&Xt(e.resourceType)}function Mde(e,t,r){var n,o;for(const i of[r.elements,(n=r.typeSchema)==null?void 0:n.elements]){let a;if(xm(i)){const l=g4(i,t.path);l&&(a=Ox(e.value,t.path,l))}if(a)return((o=hae(a))==null?void 0:o.some(l=>mce(l,t,r,i)))??!1}return!1}function Lde(e,t,r){var n;if(e)for(const o of t){const i={value:e,type:((n=o.typeSchema)==null?void 0:n.name)??o.type[0].code};if(r.every(a=>Mde(i,a,o)))return o.name}}function hC(e,t,r){if(!r||r.slices.length===0)return[e];const n=new Array(t.length+1);for(let o=0;o<n.length;o++)n[o]=[];for(const o of e){const i=Lde(o,t,r.discriminator);let a=i?t.findIndex(l=>l.name===i):-1;a===-1&&(a=t.length),n[a].push(o)}for(let o=0;o<t.length;o++)n[o].length===0&&n[o].push(void 0);return n}function zde(e){return e.type!==void 0&&e.type.length>0}const Q4=W(e=>({indented:{marginTop:"0.5rem",borderLeft:`3px solid ${e.colors.gray[4]}`,padding:"0.5rem 0 0.5rem 0.5rem"}}));function Fde(e){var y;const{property:t}=e,r=ne(),[n,o]=f.useState(!0),[i,a]=f.useState([]),[l]=f.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[c,u]=f.useState([[]]),{classes:d}=Q4(),p=(y=t.type[0])==null?void 0:y.code;f.useEffect(()=>{if(!t.slicing){const j=[];a(j);const C=hC(l,j,t.slicing);u(C),o(!1);return}const x=[],w=[],b=[];for(const j of t.slicing.slices){if(!zde(j))continue;const C=j.type[0];let P;Xt(j.elements)&&C.profile&&(P=C.profile[0]),x.push(j),w.push(P),P?b.push(r.requestProfileSchema(P)):b.push(Promise.resolve())}Promise.all(b).then(()=>{for(let C=0;C<x.length;C++){const P=x[C],E=w[C];if(E){const k=_m(E);P.typeSchema=k}}a(x);const j=hC(l,x,t.slicing);u(j),o(!1)}).catch(j=>{console.error(j),o(!1)})},[r,t.slicing,p,l]);function h(x,w){const b=[...c];if(b[w]=x,u(b),e.onChange){const j=b.flat().filter(C=>C!==void 0);e.onChange(j)}}if(n)return s.jsx("div",{children:"Loading..."});const m=i.length,g=c[m],v=!(e.hideNonSliceValues??(p==="Extension"&&i.length>0)),_=fh(t.path);return s.jsxs(be,{className:e.indent?d.indented:void 0,children:[i.map((x,w)=>s.jsx(Vde,{slice:x,property:t,defaultValue:c[w],onChange:b=>{h(b,w)},testId:`slice-${x.name}`},x.name)),v&&g.map((x,w)=>s.jsxs(K,{noWrap:!0,style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(Us,{arrayElement:!0,property:e.property,name:e.name+"."+w,defaultValue:x,onChange:b=>{const j=[...g];j[w]=b,h(j,m)},defaultPropertyType:void 0,outcome:e.outcome})}),s.jsx(Y4,{propertyDisplayName:_,testId:`nonsliced-remove-${w}`,onClick:b=>{Ze(b);const j=[...g];j.splice(w,1),h(j,m)}})]},`${w}-${g.length}`)),v&&c.flat().length<t.max&&s.jsx(K,{noWrap:!0,style:{justifyContent:"flex-start"},children:s.jsx(K4,{propertyDisplayName:_,onClick:x=>{Ze(x);const w=[...g];w.push(void 0),h(w,m)},testId:"nonsliced-add"})})]})}function Vde(e){const{slice:t,property:r}=e,[n,o]=f.useState(()=>e.defaultValue.map(d=>d??{})),{classes:i}=Q4();function a(d){o(d),e.onChange&&e.onChange(d)}const l=t.min>0,c=Xt(t.elements),u=m4(t.name);return s.jsx(Je,{title:u,description:t.definition,withAsterisk:l,fhirPath:`${r.path}:${t.name}`,testId:e.testId,children:s.jsxs(be,{className:c?i.indented:void 0,children:[n.map((d,p)=>s.jsxs(K,{noWrap:!0,children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(be,{children:Xt(t.elements)?s.jsx(e1,{elementDefinitionType:t.type[0],name:t.name,defaultValue:d,onChange:h=>{const m=[...n];m[p]=h,a(m)},outcome:void 0,min:t.min,max:t.max,binding:void 0,path:t.path}):s.jsx(X4,{type:t.type[0].code,elements:t.elements,defaultValue:d,outcome:e.outcome,onChange:h=>{const m=[...n];m[p]=h,a(m)},testId:e.testId&&`${e.testId}-elements-${p}`})})}),n.length>t.min&&s.jsx(Y4,{propertyDisplayName:u,testId:e.testId&&`${e.testId}-remove-${p}`,onClick:h=>{Ze(h);const m=[...n];m.splice(p,1),a(m)}})]},`${p}-${n.length}`)),n.length<t.max&&s.jsx(K,{noWrap:!0,style:{justifyContent:"flex-start"},children:s.jsx(K4,{propertyDisplayName:u,onClick:d=>{Ze(d);const p=[...n,void 0];a(p)},testId:e.testId&&`${e.testId}-add`})})]})})}function K4({propertyDisplayName:e,onClick:t,testId:r}){const n=e?`Add ${e}`:"Add";return e?s.jsx(re,{title:n,size:"sm",color:"green.6",variant:"subtle","data-testid":r,leftIcon:s.jsx(mh,{size:"1.25rem"}),onClick:t,children:n}):s.jsx(yr,{title:n,color:"green.6","data-testid":r,onClick:t,children:s.jsx(mh,{size:"1.25rem"})})}function Y4({propertyDisplayName:e,onClick:t,testId:r}){return s.jsx(yr,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":r,onClick:t,children:s.jsx(hh,{size:"1.25rem"})})}const Bde=["sun","mon","tue","wed","thu","fri","sat"];function Ude(e){const[t,r]=f.useState(e.defaultValue),[n,o]=f.useState(!1),i=f.useRef();return i.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx("span",{children:Z5(i.current)||"No repeat"}),s.jsx(re,{onClick:()=>o(!0),children:"Edit"})]}),s.jsx(Wde,{visible:n,defaultValue:i.current,onOk:a=>{e.onChange&&e.onChange(a),r(a),o(!1)},onCancel:()=>o(!1)})]})}const mC={repeat:{period:1,periodUnit:"d"}};function Wde(e){const[t,r]=f.useState(e.defaultValue||mC),n=f.useRef();n.current=t;function o(u){r({...n.current,event:[u]})}function i(u){r({...n.current,repeat:u})}function a(u){var d;i({...(d=n.current)==null?void 0:d.repeat,period:u})}function l(u){var d;i({...(d=n.current)==null?void 0:d.repeat,periodUnit:u})}function c(u){var d;i({...(d=n.current)==null?void 0:d.repeat,dayOfWeek:u})}return s.jsx(Mr,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(be,{children:[s.jsx(Je,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(la,{name:"timing-dialog-start",onChange:u=>o(u)})}),s.jsx(ym,{label:"Repeat",checked:!!t.repeat,onChange:u=>i(u.currentTarget.checked?mC.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(Je,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:u=>a(parseInt(u.currentTarget.value,10)||1)}),s.jsx(mt,{id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:u=>l(u.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&s.jsx(Je,{title:"Repeat on",children:s.jsx(Xf.Group,{multiple:!0,onChange:c,children:s.jsx(K,{position:"apart",mt:"md",spacing:"xs",children:Bde.map(u=>s.jsx(Xf,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),s.jsx(K,{position:"right",children:s.jsx(re,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Us(e){var l;const{property:t,name:r,defaultValue:n,onChange:o}=e,i=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,a=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(i===B.Attachment)return s.jsx(Jue,{name:r,defaultValue:n,onChange:o});const c=((l=a[0])==null?void 0:l.code)!==B.Extension;return s.jsx(Fde,{property:t,name:r,defaultValue:n,indent:c,onChange:o,outcome:e.outcome})}return a.length>1?s.jsx(Hde,{elementDefinitionTypes:a,...e}):s.jsx(e1,{name:r,defaultValue:n,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",er(a[0].code));e.onChange(c,u)}},outcome:e.outcome,elementDefinitionType:a[0],min:t.min,max:t.min,binding:t.binding,path:t.path})}function Hde(e){const t=e.elementDefinitionTypes;let r;e.defaultPropertyType&&(r=t.find(i=>i.code===e.defaultPropertyType)),r||(r=t[0]);const[n,o]=f.useState(r);return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(mt,{style:{width:"200px"},defaultValue:n.code,onChange:i=>{o(t.find(a=>a.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),s.jsx(e1,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:n,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",er(n.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path})]})}function e1(e){const{name:t,defaultValue:r,onChange:n,outcome:o,binding:i,path:a}=e,l=e.min!==void 0&&e.min>0,c=e.elementDefinitionType.code;if(!c)return s.jsx("div",{children:"Property type not specified "});const u={name:t,defaultValue:r,onChange:n,outcome:o,path:a};switch(c){case B.SystemString:case B.canonical:case B.string:case B.time:case B.uri:case B.url:return s.jsx(le,{id:t,name:t,"data-testid":t,defaultValue:r,required:l,onChange:d=>{n&&n(d.currentTarget.value)},error:Ie(o,t)});case B.date:return s.jsx(le,{type:"date",id:t,name:t,"data-testid":t,defaultValue:r,required:l,onChange:d=>{n&&n(d.currentTarget.value)},error:Ie(o,t)});case B.dateTime:case B.instant:return s.jsx(la,{name:t,defaultValue:r,onChange:n,outcome:o});case B.decimal:case B.integer:case B.positiveInt:case B.unsignedInt:return s.jsx(le,{type:"number",step:c===B.decimal?"any":"1",id:t,name:t,"data-testid":t,defaultValue:r,required:l,onChange:d=>{n&&n(d.currentTarget.valueAsNumber)}});case B.code:return s.jsx(M4,{...u,binding:i==null?void 0:i.valueSet});case B.boolean:return s.jsx(Tn,{id:t,name:t,"data-testid":t,defaultChecked:!!r,onChange:d=>{n&&n(d.currentTarget.checked)}});case B.base64Binary:case B.markdown:return s.jsx(Nc,{id:t,spellCheck:c!==B.base64Binary,name:t,"data-testid":t,defaultValue:r,required:l,onChange:d=>{n&&n(d.currentTarget.value)}});case B.Address:return s.jsx(wce,{...u});case B.Annotation:return s.jsx(bce,{...u});case B.Attachment:return s.jsx(z4,{...u});case B.CodeableConcept:return s.jsx(ude,{binding:i==null?void 0:i.valueSet,...u});case B.Coding:return s.jsx(H4,{binding:i==null?void 0:i.valueSet,...u});case B.ContactDetail:return s.jsx(mde,{...u});case B.ContactPoint:return s.jsx(q4,{...u});case B.Extension:return s.jsx(xde,{...u,propertyType:e.elementDefinitionType});case B.HumanName:return s.jsx(bde,{...u});case B.Identifier:return s.jsx(_de,{...u});case B.Money:return s.jsx(Pde,{...u});case B.Period:return s.jsx(jde,{...u});case B.Duration:case B.Quantity:return s.jsx(ca,{...u});case B.Range:return s.jsx(Zx,{...u});case B.Ratio:return s.jsx(Cde,{...u});case B.Reference:return s.jsx(Tm,{...u,targetTypes:qde(e.elementDefinitionType)});case B.Timing:return s.jsx(Ude,{...u});case B.Dosage:case B.UsageContext:default:return s.jsx(t1,{typeName:c,defaultValue:r,onChange:n,outcome:o})}}const gC="http://hl7.org/fhir/StructureDefinition/";function qde(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(r=>r.startsWith(gC)?r.slice(gC.length):r)}const Sy=new Set(["extension","modifierExtension"]),Gde=new Set(["id",...F4].filter(e=>!Sy.has(e)));function X4(e){const{elements:t}=e,[r,n]=f.useState(e.defaultValue??{}),o=f.useMemo(()=>{const a=Object.create(null);for(const[l,c]of Object.entries(t))c.fixed&&(a[l]=c);return a},[t]);function i(a){for(const[l,c]of Object.entries(o))_y(a,l,l,c,c.fixed.value);n(a),e.onChange&&e.onChange(a)}return s.jsx(be,{style:{flexGrow:1},"data-testid":e.testId,children:Object.entries(t).map(([a,l])=>{var h;if(!l.type||l.max===0||a==="url"&&l.fixed||Sy.has(a)&&!xm((h=l.slicing)==null?void 0:h.slices))return null;if(Gde.has(a))return null;if(V4.includes(a)&&l.path.split(".").length===2||a.includes("."))return null;const[c,u]=ade(r,a,l),d=l.min!==void 0&&l.min>0,p=s.jsx(Us,{property:l,name:a,defaultValue:c,defaultPropertyType:u,onChange:(m,g)=>{i(_y({...r},a,g??a,l,m))},arrayElement:void 0,outcome:e.outcome},a);return e.type==="Extension"||Sy.has(a)?p:l.type.length===1&&l.type[0].code==="boolean"?s.jsx(U4,{title:fh(a),description:l.description,htmlFor:a,fhirPath:l.path,withAsterisk:d,children:p},a):s.jsx(Je,{title:fh(a),description:l.description,withAsterisk:d,htmlFor:a,outcome:e.outcome,fhirPath:l.path,children:p},a)})})}function t1(e){const{typeName:t}=e,[r,n]=f.useState(e.defaultValue??{}),o=f.useContext(Cs),i=e.profileUrl??o.profileUrl,a=f.useMemo(()=>kx(t,i),[t,i]),l=f.useMemo(()=>lde(a,i),[a,i]);if(!a)return s.jsxs("div",{children:[t," not implemented"]});function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsx(Cs.Provider,{value:l,children:s.jsx(X4,{type:a.type,elements:a.elements,defaultValue:r,onChange:c,outcome:e.outcome})})}const Qde=W(()=>({root:{"@media (max-width: 800px)":{paddingLeft:4,paddingRight:4}}}));function qc(e){const{children:t,...r}=e,{classes:n}=Qde();return s.jsx(kI,{className:n.root,...r,children:t})}const Kde=W(e=>({noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));function J4({value:e}){const{classes:t}=Kde();return e?s.jsx(be,{justify:"flex-start",spacing:"xs",children:e.map(r=>{var n;return r.text&&s.jsx(ZT,{classNames:{cite:t.noteCite,body:t.noteBody,root:t.noteRoot},cite:((n=r.authorReference)==null?void 0:n.display)||r.authorString,icon:null,children:r.text},`note-${r.text}`)})}):null}function Gc(e){const{value:t,link:r,...n}=e,[o,i]=f.useState(),a=et(t,i);let l;if(o&&!d4(o))l=`[${je(o)}]`;else if(a)l=Ro(a);else return null;return r?s.jsx($e,{to:t,...n,children:l}):s.jsx(oe,{component:"span",...n,children:l})}function ds(e){return s.jsxs(K,{spacing:"xs",children:[s.jsx(ji,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Gc,{value:e.value,link:e.link})]})}const Yde={draft:"blue",active:"blue","on-hold":"yellow",revoked:"red",completed:"green","entered-in-error":"red",unknown:"gray",retired:"gray",registered:"blue",preliminary:"blue",final:"green",amended:"yellow",corrected:"yellow",cancelled:"red",requested:"blue",received:"blue",accepted:"blue",rejected:"red",ready:"blue","in-progress":"blue",failed:"red",proposed:"blue",pending:"blue",booked:"blue",arrived:"blue",fulfilled:"green",noshow:"red","checked-in":"blue",waitlist:"gray",routine:"gray",urgent:"red",asap:"red",stat:"red"};function Z4(e){return s.jsx(QT,{color:Yde[e.status],children:e.status})}const e3=W(e=>({table:{border:`0.1px solid ${e.colors.gray[5]}`,borderCollapse:"collapse","& td, & th":{border:`0.1px solid ${e.colors.gray[5]}`,padding:4}},criticalRow:{background:e.colorScheme==="dark"?e.colors.red[7]:e.colors.red[1],border:`0.1px solid ${e.colors.red[5]}`,color:e.colors.red[5],fontWeight:500,"& td":{border:`0.1px solid ${e.colors.red[5]}`}},noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));r1.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function r1(e){var a;const t=ne(),r=et(e.value),[n,o]=f.useState();if(f.useEffect(()=>{r!=null&&r.specimen&&Promise.allSettled(r.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,r]),!r)return null;const i=(n==null?void 0:n.flatMap(l=>l.note||[]))||[];if(r.presentedForm&&r.presentedForm.length>0){const l=r.presentedForm[0];(a=l.contentType)!=null&&a.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return s.jsxs(be,{children:[s.jsx(ue,{children:"Diagnostic Report"}),s.jsx(Xde,{value:r}),n&&!e.hideSpecimenInfo&&Jde(n),r.result&&s.jsx(Zde,{hideObservationNotes:e.hideObservationNotes,value:r.result}),i.length>0&&s.jsx(J4,{value:i})]})}function Xde({value:e}){var t,r;return s.jsxs(K,{mt:"md",spacing:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(oe,{size:"xs",transform:"uppercase",color:"dimmed",children:"Subject"}),s.jsx(oe,{children:s.jsx(ds,{value:e.subject,link:!0})})]}),(t=e.resultsInterpreter)==null?void 0:t.map(n=>s.jsxs("div",{children:[s.jsx(oe,{size:"xs",transform:"uppercase",color:"dimmed",children:"Interpreter"}),s.jsx(oe,{children:s.jsx(ds,{value:n,link:!0})})]},n.reference)),(r=e.performer)==null?void 0:r.map(n=>s.jsxs("div",{children:[s.jsx(oe,{size:"xs",transform:"uppercase",color:"dimmed",children:"Performer"}),s.jsx(oe,{children:s.jsx(ds,{value:n,link:!0})})]},n.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(oe,{size:"xs",transform:"uppercase",color:"dimmed",children:"Issued"}),s.jsx(oe,{children:Nr(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(oe,{size:"xs",transform:"uppercase",color:"dimmed",children:"Status"}),s.jsx(oe,{children:er(e.status)})]})]})}function Jde(e){return s.jsxs(be,{spacing:"xs",children:[s.jsx(ue,{order:2,size:"h6",children:"Specimens"}),s.jsx(Er,{type:"ordered",children:e==null?void 0:e.map(t=>{var r;return s.jsx(Er.Item,{ml:"sm",children:s.jsxs(K,{spacing:20,children:[s.jsxs(K,{spacing:5,children:[s.jsx(oe,{fw:500,children:"Collected:"})," ",Nr((r=t.collection)==null?void 0:r.collectedDateTime)]}),s.jsxs(K,{spacing:5,children:[s.jsx(oe,{fw:500,children:"Received:"})," ",Nr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function Zde(e){const{classes:t}=e3();return s.jsxs("table",{className:t.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(t3,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function t3(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(r=>s.jsx(efe,{value:r,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Pa(r)?r.reference:r.id}`))})}function efe(e){var a,l;const{classes:t,cx:r}=e3(),n=et(e.value);if(!n||(a=e.ancestorIds)!=null&&a.includes(n.id))return null;const o=!e.hideObservationNotes&&n.note,i=nfe(n);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:r({[t.criticalRow]:i}),children:[s.jsx("td",{rowSpan:o?2:1,children:s.jsx($e,{to:n,children:s.jsx(ro,{value:n.code})})}),s.jsx("td",{children:s.jsx(tfe,{value:n})}),s.jsx("td",{children:s.jsx(rfe,{value:n.referenceRange})}),s.jsx("td",{children:n.interpretation&&n.interpretation.length>0&&s.jsx(ro,{value:n.interpretation[0]})}),s.jsx("td",{children:n.category&&n.category.length>0&&s.jsx(s.Fragment,{children:n.category.map(c=>s.jsx("div",{children:s.jsx(ro,{value:c})},`category-${js(c)}`))})}),s.jsx("td",{children:(l=n.performer)==null?void 0:l.map(c=>s.jsx(vh,{value:c},c.reference))}),s.jsx("td",{children:n.status&&s.jsx(Z4,{status:n.status})})]}),n.hasMember&&s.jsx(t3,{value:n.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,n.id]:[n.id],hideObservationNotes:e.hideObservationNotes}),o&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(J4,{value:n.note})})})]})}function tfe(e){const t=e.value;return s.jsx(s.Fragment,{children:e4(t)})}function rfe(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(Jx,{value:t}):null}function nfe(e){var r,n,o,i;const t=(i=(o=(n=(r=e.interpretation)==null?void 0:r[0])==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}const ofe=W((e,{width:t,fill:r})=>({paper:{maxWidth:t,margin:`${e.spacing.xl} auto`,padding:r?0:e.spacing.md,"@media (max-width: 800px)":{padding:r?0:8},"& img":{width:"100%",maxWidth:"100%"},"& video":{width:"100%",maxWidth:"100%"}}})),ife={shadow:"xs",radius:"md",withBorder:!0};function n1(e){const{className:t,children:r,width:n,fill:o,unstyled:i,...a}=H("Panel",ife,e),{classes:l,cx:c}=ofe({width:n,fill:o},{name:"Panel",unstyled:i});return s.jsx(dn,{className:c(l.paper,t),...a,children:r})}var r3={},Qc={};Object.defineProperty(Qc,"__esModule",{value:!0});Qc.Pointer=void 0;function afe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function sfe(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var lfe=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var r=t.split("/").map(afe);if(r[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(r)},e.prototype.toString=function(){return this.tokens.map(sfe).join("/")},e.prototype.evaluate=function(t){for(var r=null,n="",o=t,i=1,a=this.tokens.length;i<a;i++)r=o,n=this.tokens[i],!(n=="__proto__"||n=="constructor"||n=="prototype")&&(o=(r||{})[n]);return{parent:r,key:n,value:o}},e.prototype.get=function(t){return this.evaluate(t).value},e.prototype.set=function(t,r){var n=this.evaluate(t);n.parent&&(n.parent[n.key]=r)},e.prototype.push=function(t){this.tokens.push(t)},e.prototype.add=function(t){var r=this.tokens.concat(String(t));return new e(r)},e}();Qc.Pointer=lfe;var _t={},o1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function r(o){return o!=null&&typeof o=="object"}function n(o){if(!r(o))return o;if(o.constructor==Array){for(var i=o.length,a=new Array(i),l=0;l<i;l++)a[l]=n(o[l]);return a}if(o.constructor==Date){var c=new Date(+o);return c}var u={};for(var d in o)e.hasOwnProperty.call(o,d)&&(u[d]=n(o[d]));return u}e.clone=n})(o1);var gr={};Object.defineProperty(gr,"__esModule",{value:!0});gr.diffAny=gr.diffObjects=gr.diffArrays=gr.intersection=gr.subtract=gr.isDestructive=void 0;var yc=o1;function cfe(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}gr.isDestructive=cfe;function Py(e,t){var r={};for(var n in e)yc.hasOwnProperty.call(e,n)&&e[n]!==void 0&&(r[n]=1);for(var o in t)yc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete r[o];return Object.keys(r)}gr.subtract=Py;function n3(e){for(var t=e.length,r={},n=0;n<t;n++){var o=e[n];for(var i in o)yc.hasOwnProperty.call(o,i)&&o[i]!==void 0&&(r[i]=(r[i]||0)+1)}for(var i in r)r[i]<t&&delete r[i];return Object.keys(r)}gr.intersection=n3;function ufe(e){return e.op==="add"}function dfe(e){return e.op==="remove"}function Gg(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function o3(e,t,r,n){n===void 0&&(n=Im);var o={"0,0":{operations:[],cost:0}};function i(d,p){var h="".concat(d,",").concat(p),m=o[h];if(m===void 0){if(d>0&&p>0&&!n(e[d-1],t[p-1],r.add(String(d-1))).length)m=i(d-1,p-1);else{var g=[];if(d>0){var v=i(d-1,p),_={op:"remove",index:d-1};g.push(Gg(v,_))}if(p>0){var y=i(d,p-1),x={op:"add",index:d-1,value:t[p-1]};g.push(Gg(y,x))}if(d>0&&p>0){var w=i(d-1,p-1),b={op:"replace",index:d-1,original:e[d-1],value:t[p-1]};g.push(Gg(w,b))}var j=g.sort(function(C,P){return C.cost-P.cost})[0];m=j}o[h]=m}return m}var a=isNaN(e.length)||e.length<=0?0:e.length,l=isNaN(t.length)||t.length<=0?0:t.length,c=i(a,l).operations,u=c.reduce(function(d,p){var h=d[0],m=d[1];if(ufe(p)){var g=p.index+1+m,v=g<a+m?String(g):"-",_={op:p.op,path:r.add(v).toString(),value:p.value};return[h.concat(_),m+1]}else if(dfe(p)){var _={op:p.op,path:r.add(String(p.index+m)).toString()};return[h.concat(_),m-1]}else{var y=r.add(String(p.index+m)),x=n(p.original,p.value,y);return[h.concat.apply(h,x),m]}},[[],0])[0];return u}gr.diffArrays=o3;function i3(e,t,r,n){n===void 0&&(n=Im);var o=[];return Py(e,t).forEach(function(i){o.push({op:"remove",path:r.add(i).toString()})}),Py(t,e).forEach(function(i){o.push({op:"add",path:r.add(i).toString(),value:t[i]})}),n3([e,t]).forEach(function(i){o.push.apply(o,n(e[i],t[i],r.add(i)))}),o}gr.diffObjects=i3;function Im(e,t,r,n){if(n===void 0&&(n=Im),e===t)return[];var o=(0,yc.objectType)(e),i=(0,yc.objectType)(t);return o=="array"&&i=="array"?o3(e,t,r,n):o=="object"&&i=="object"?i3(e,t,r,n):[{op:"replace",path:r.toString(),value:t}]}gr.diffAny=Im;var i1=O1&&O1.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(_t,"__esModule",{value:!0});_t.apply=_t.InvalidOperationError=_t.test=_t.copy=_t.move=_t.replace=_t.remove=_t.add=_t.TestError=_t.MissingError=void 0;var Do=Qc,a1=o1,ffe=gr,no=function(e){i1(t,e);function t(r){var n=e.call(this,"Value required at path: ".concat(r))||this;return n.path=r,n.name="MissingError",n}return t}(Error);_t.MissingError=no;var a3=function(e){i1(t,e);function t(r,n){var o=e.call(this,"Test failed: ".concat(r," != ").concat(n))||this;return o.actual=r,o.expected=n,o.name="TestError",o}return t}(Error);_t.TestError=a3;function s1(e,t,r){if(Array.isArray(e))if(t=="-")e.push(r);else{var n=parseInt(t,10);e.splice(n,0,r)}else e[t]=r}function s3(e,t){if(Array.isArray(e)){var r=parseInt(t,10);e.splice(r,1)}else delete e[t]}function l3(e,t){var r=Do.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new no(t.path):(s1(r.parent,r.key,(0,a1.clone)(t.value)),null)}_t.add=l3;function c3(e,t){var r=Do.Pointer.fromJSON(t.path).evaluate(e);return r.value===void 0?new no(t.path):(s3(r.parent,r.key),null)}_t.remove=c3;function u3(e,t){var r=Do.Pointer.fromJSON(t.path).evaluate(e);if(r.parent===null)return new no(t.path);if(Array.isArray(r.parent)){if(parseInt(r.key,10)>=r.parent.length)return new no(t.path)}else if(r.value===void 0)return new no(t.path);return r.parent[r.key]=(0,a1.clone)(t.value),null}_t.replace=u3;function d3(e,t){var r=Do.Pointer.fromJSON(t.from).evaluate(e);if(r.value===void 0)return new no(t.from);var n=Do.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new no(t.path):(s3(r.parent,r.key),s1(n.parent,n.key,r.value),null)}_t.move=d3;function f3(e,t){var r=Do.Pointer.fromJSON(t.from).evaluate(e);if(r.value===void 0)return new no(t.from);var n=Do.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new no(t.path):(s1(n.parent,n.key,(0,a1.clone)(r.value)),null)}_t.copy=f3;function p3(e,t){var r=Do.Pointer.fromJSON(t.path).evaluate(e);return(0,ffe.diffAny)(r.value,t.value,new Do.Pointer).length?new a3(r.value,t.value):null}_t.test=p3;var h3=function(e){i1(t,e);function t(r){var n=e.call(this,"Invalid operation: ".concat(r.op))||this;return n.operation=r,n.name="InvalidOperationError",n}return t}(Error);_t.InvalidOperationError=h3;function pfe(e,t){switch(t.op){case"add":return l3(e,t);case"remove":return c3(e,t);case"replace":return u3(e,t);case"move":return d3(e,t);case"copy":return f3(e,t);case"test":return p3(e,t)}return new h3(t)}_t.apply=pfe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=Qc;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var r=_t,n=gr;function o(u,d){return d.map(function(p){return(0,r.apply)(u,p)})}e.applyPatch=o;function i(u){function d(p,h,m){var g=u(p,h,m);return Array.isArray(g)?g:(0,n.diffAny)(p,h,m,d)}return d}function a(u,d,p){var h=new t.Pointer;return(p?i(p):n.diffAny)(u,d,h)}e.createPatch=a;function l(u,d){var p=t.Pointer.fromJSON(d).evaluate(u);if(p!==void 0)return{op:"test",path:d,value:p.value}}function c(u,d){var p=new Array;return d.filter(n.isDestructive).forEach(function(h){var m=l(u,h.path);if(m&&p.push(m),"from"in h){var g=l(u,h.from);g&&p.push(g)}}),p}e.createTests=c})(r3);const hfe=W(e=>({root:{borderCollapse:"collapse",width:"100%","& tr":{borderTop:`0.1px solid ${e.colors.gray[3]}`},"& th, & td":{padding:`${e.spacing.sm} ${e.spacing.sm}`,verticalAlign:"top"}},removed:{color:e.colors.red[7],fontFamily:"monospace",textDecoration:"line-through",whiteSpace:"pre-wrap"},added:{color:e.colors.green[7],fontFamily:"monospace",whiteSpace:"pre-wrap"}}));function mfe(e){const{classes:t}=hfe(),r=ne(),[n,o]=f.useState(!1);if(f.useEffect(()=>{r.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.original.resourceType]),!n)return null;const i=r3.createPatch(e.original,e.revised),a=[io(e.original)],l=[io(e.revised)];return s.jsxs("table",{className:t.root,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{}),s.jsx("th",{children:"Before"}),s.jsx("th",{children:"After"})]})}),s.jsx("tbody",{children:i.map(c=>{var _,y,x;if(c.path.startsWith("/meta"))return null;const u=c.path,d=gfe(u),p=Sm(e.original.resourceType,{resourceType:"SearchParameter",base:[e.original.resourceType],code:e.original.resourceType+"."+d,expression:e.original.resourceType+"."+d}),h=(_=p==null?void 0:p.elementDefinitions)==null?void 0:_[0],m=!!(h!=null&&h.isArray),g=c.op==="add"||(y=gc(d,a))==null?void 0:y[0],v=c.op==="remove"||(x=gc(d,l))==null?void 0:x[0];return s.jsxs("tr",{children:[s.jsxs("td",{children:[er(c.op)," ",d]}),s.jsx("td",{className:t.removed,children:g&&s.jsx(Io,{property:h,propertyType:g.type,value:vC(g.value,m),ignoreMissingValues:!0})}),s.jsx("td",{className:t.added,children:v&&s.jsx(Io,{property:h,propertyType:v.type,value:vC(v.value,m),ignoreMissingValues:!0})})]},`op-${c.op}-${c.path}`)})})]})}function gfe(e){const t=e.split("/").filter(Boolean);let r="";for(let n=0;n<t.length;n++){const o=t[n];o==="-"?r+=".last()":/^\d+$/.test(o)?r+=`[${o}]`:(n>0&&(r+="."),r+=o)}return r}function vC(e,t){return Array.isArray(e)&&!t?e[0]:!Array.isArray(e)&&t?[e]:e}function l1(e){const t=ne(),r=et(e.value),[n,o]=f.useState(!1);return f.useEffect(()=>{r&&t.requestSchema(r.resourceType).then(()=>o(!0)).catch(console.log)},[t,r]),!n||!r?null:s.jsx(by,{value:{type:r.resourceType,value:e.forceUseInput?e.value:r},ignoreMissingValues:e.ignoreMissingValues})}function vfe(e){return s.jsx(qc,{children:e.children})}function ua(e){var c,u;const{resource:t,profile:r,padding:n,popupMenuItems:o,...i}=e,a=r??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return s.jsxs(n1,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(K,{position:"apart",spacing:8,mx:"xs",my:"sm",children:[s.jsx(ji,{value:a,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(oe,{size:"sm",children:s.jsx(Gc,{color:"dark",weight:500,value:a,link:!0})}),s.jsxs(oe,{size:"xs",children:[s.jsx($e,{color:"dimmed",to:e.resource,children:Nr(l)}),s.jsx(oe,{component:"span",color:"dimmed",mx:8,children:"·"}),s.jsx($e,{color:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(Z,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(Z.Target,{children:s.jsx(yr,{radius:"xl","aria-label":`Actions for ${at(e.resource)}`,children:s.jsx(qce,{})})}),o]})]}),s.jsxs(N4,{children:[n&&s.jsx("div",{style:{padding:"0 16px 16px 16px"},children:e.children}),!n&&s.jsx(s.Fragment,{children:e.children})]})]})}function m3(e,t){e.sort((r,n)=>{const o=yC(r,t),i=yC(n,t);return o>i?1:o<i?-1:xC(r,t)-xC(n,t)})}function yC(e,t){if(!g3(e,t)){const r=e.priority;if(typeof r=="string")return{stat:4,asap:3,urgent:2}[r]??0}return 0}function xC(e,t){var n;if(!g3(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const r=(n=e.meta)==null?void 0:n.lastUpdated;return r?new Date(r).getTime():0}function g3(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const yfe=W(e=>({pinnedComment:{backgroundColor:e.colors.blue[0]}}));function Dm(e){const t=ne(),r=jm(),n=t.getProfile(),o=f.useRef(null),i=et(e.value),[a,l]=f.useState(),[c,u]=f.useState([]),d=e.loadTimelineResources,p=f.useRef(c);p.current=c;const h=f.useCallback(R=>{m3(R,i),R.reverse(),u(R)},[i]),m=f.useCallback(R=>{const N=[];for(const M of R){if(M.status!=="fulfilled")continue;const L=M.value;if(L.type==="history"&&l(L),L.entry)for(const Q of L.entry)N.push(Q.resource)}h(N)},[h]),g=f.useCallback(R=>h([...p.current,R]),[h]),v=f.useCallback(()=>{var M;let R,N;"resourceType"in e.value?(R=e.value.resourceType,N=e.value.id):[R,N]=(M=e.value.reference)==null?void 0:M.split("/"),d(t,R,N).then(m).catch(console.log)},[t,e.value,d,m]);f.useEffect(()=>v(),[v]);function _(R){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,R)).then(N=>g(N)).catch(console.log)}function y(R){!i||!e.createMedia||t.createResource(e.createMedia(i,n,R)).then(N=>g(N)).then(()=>$l({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(Cm,{size:16}),autoClose:2e3})).catch(N=>$l({id:"upload-notification",color:"red",title:"Upload error",message:je(N),icon:s.jsx(cC,{size:16}),autoClose:2e3}))}function x(R,N){return t.updateResource({...R,priority:N})}function w(R){x(R,"stat").then(v).catch(console.log)}function b(R){x(R,"routine").then(v).catch(console.log)}function j(R){r(`/${R.resourceType}/${R.id}`)}function C(R){r(`/${R.resourceType}/${R.id}/edit`)}function P(R){r(`/${R.resourceType}/${R.id}/delete`)}function E(R){var N;r(`/${R.resourceType}/${R.id}/_history/${(N=R.meta)==null?void 0:N.versionId}`)}function k(){de({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function $(R){$l({id:"upload-notification",loading:!0,title:"Uploading...",message:jfe(R),autoClose:!1,withCloseButton:!1})}function I(R){$l({id:"upload-notification",color:"red",title:"Upload error",message:je(R),icon:s.jsx(cC,{size:16}),autoClose:2e3})}return i?s.jsxs(vfe,{children:[e.createCommunication&&s.jsx(n1,{children:s.jsx(Ne,{testid:"timeline-form",onSubmit:R=>{_(R.text);const N=o.current;N&&(N.value="",N.focus())},children:s.jsxs(K,{spacing:"xs",noWrap:!0,style:{width:"100%"},children:[s.jsx(ji,{value:n}),s.jsx(le,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(yr,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(rue,{size:16})}),s.jsx(Yx,{onUpload:y,onUploadStart:k,onUploadProgress:$,onUploadError:I,children:R=>s.jsx(yr,{...R,radius:"xl",color:"blue",variant:"filled",children:s.jsx(Bx,{size:16})})})]})})}),c.map(R=>{var M;if(!R)return null;const N=`${R.resourceType}/${R.id}/${(M=R.meta)==null?void 0:M.versionId}`;if(R.resourceType===i.resourceType&&R.id===i.id)return s.jsx(xfe,{history:a,resource:R,onDetails:E},N);switch(R.resourceType){case"AuditEvent":return s.jsx(Sfe,{resource:R,onDetails:j},N);case"Communication":return s.jsx(bfe,{resource:R,onPin:R.priority!=="stat"?w:void 0,onUnpin:R.priority==="stat"?b:void 0,onDetails:j,onEdit:C,onDelete:P},N);case"DiagnosticReport":return s.jsx(Pfe,{resource:R,onDetails:j,onEdit:C,onDelete:P},N);case"Media":return s.jsx(_fe,{resource:R,onDetails:j,onEdit:C,onDelete:P},N);default:return s.jsx(ua,{resource:R,padding:!0,children:s.jsx(l1,{value:R,ignoreMissingValues:!0})},N)}})]}):s.jsx(ar,{style:{width:"100%",height:"100%"},children:s.jsx(mn,{})})}function Es(e){return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Label,{children:"Resource"}),e.onPin&&s.jsx(Z.Item,{icon:s.jsx(iue,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${at(e.resource)}`,children:"Pin"}),e.onUnpin&&s.jsx(Z.Item,{icon:s.jsx(aue,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${at(e.resource)}`,children:"Unpin"}),e.onDetails&&s.jsx(Z.Item,{icon:s.jsx(Jce,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${at(e.resource)}`,children:"Details"}),e.onEdit&&s.jsx(Z.Item,{icon:s.jsx(Gce,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${at(e.resource)}`,children:"Edit"}),e.onDelete&&s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Label,{children:"Danger zone"}),s.jsx(Z.Item,{color:"red",icon:s.jsx(D4,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${at(e.resource)}`,children:"Delete"})]})]})}function xfe(e){const t=wfe(e.history,e.resource);return t?s.jsx(ua,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(Es,{...e}),children:s.jsx(mfe,{original:t,revised:e.resource})}):s.jsxs(ua,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(Es,{...e}),children:[s.jsx("h3",{children:"Created"}),s.jsx(l1,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function wfe(e,t){const r=e.entry,n=r.findIndex(o=>{var i,a,l;return((a=(i=o.resource)==null?void 0:i.meta)==null?void 0:a.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(n>=r.length-1))return r[n+1].resource}function bfe(e){var o,i;const{classes:t}=yfe(),n=!e.resource.priority||e.resource.priority==="routine"?void 0:t.pinnedComment;return s.jsx(ua,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:s.jsx(Es,{...e}),children:s.jsx("p",{children:(i=(o=e.resource.payload)==null?void 0:o[0])==null?void 0:i.contentString})})}function _fe(e){var n;const t=(n=e.resource.content)==null?void 0:n.contentType,r=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(ua,{resource:e.resource,padding:!!r,popupMenuItems:s.jsx(Es,{...e}),children:s.jsx(Hc,{value:e.resource.content})})}function Sfe(e){return s.jsx(ua,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(Es,{...e}),children:s.jsx(ga,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function Pfe(e){return s.jsx(ua,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(Es,{...e}),children:s.jsx(r1,{value:e.resource})})}function jfe(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Qg(e.loaded)} / ${Qg(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Qg(e.loaded)}`}function Qg(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 Ofe(e){return s.jsx(Dm,{value:e.resource,loadTimelineResources:async(t,r,n)=>{const o=`${r}/${n}`,i=100;return Promise.allSettled([t.readHistory(r,n),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:i})])}})}function we(e){const{children:t,...r}=e;return s.jsx(qc,{children:s.jsx(n1,{...r,children:t})})}function Cfe(e){return s.jsx(Dm,{value:e.encounter,loadTimelineResources:async(t,r,n)=>Promise.allSettled([t.readHistory("Encounter",n),t.search("Communication","encounter=Encounter/"+n),t.search("Media","encounter=Encounter/"+n)]),createCommunication:(t,r,n)=>({resourceType:"Communication",status:"completed",encounter:ht(t),subject:t.subject,sender:ht(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",encounter:ht(t),subject:t.subject,operator:ht(r),issued:new Date().toISOString(),content:n})})}function Efe(e){let t;try{t=xle(e.path,e.resource)}catch(r){return console.warn("FhirPathDisplay:",r),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return s.jsx(Io,{value:t[0]||"",propertyType:e.propertyType})}function $fe(e){return s.jsxs(Mr,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(ae,{display:"flex",sx:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(wC,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(wC,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(oe,{sx:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function wC(e){return s.jsx(re,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const kfe={string:[ie.EQUALS,ie.NOT,ie.CONTAINS,ie.EXACT],fulltext:[ie.EQUALS,ie.NOT,ie.CONTAINS,ie.EXACT],token:[ie.EQUALS,ie.NOT],reference:[ie.EQUALS,ie.NOT],numeric:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS],quantity:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS],date:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS,ie.STARTS_AFTER,ie.ENDS_BEFORE,ie.APPROXIMATELY],datetime:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS,ie.STARTS_AFTER,ie.ENDS_BEFORE,ie.APPROXIMATELY]},Rfe={eq:"equals",ne:"not equals",gt:"greater than",lt:"less than",ge:"greater than or equals",le:"less than or equals",sa:"starts after",eb:"ends before",ap:"approximately",contains:"contains",exact:"exact",text:"text",not:"not",above:"above",below:"below",in:"in","not-in":"not in","of-type":"of type",missing:"missing",identifier:"identifier",iterate:"iterate"};function c1(e,t){return{...e,filters:t,offset:0,name:void 0}}function u1(e,t){return c1(e,(e.filters??[]).filter(r=>r.code!==t))}function Nm(e,t,r,n,o){o&&(e=u1(e,t));const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:r,value:n??""}),c1(e,i)}function Tfe(e,t){if(!e.filters)return e;const r=[...e.filters];return r.splice(t,1),{...e,filters:r,name:void 0}}function Ife(e,t){return d1(e,t,-1)}function Dfe(e,t){return d1(e,t,0)}function Nfe(e,t){return d1(e,t,1)}function d1(e,t,r){const n=new Date;n.setDate(n.getDate()+r),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),p1(e,t,n,o)}function Afe(e,t){return f1(e,t,-1)}function Mfe(e,t){return f1(e,t,0)}function Lfe(e,t){return f1(e,t,1)}function f1(e,t,r){const n=new Date;n.setMonth(n.getMonth()+r),n.setDate(1),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),p1(e,t,n,o)}function zfe(e,t){const r=new Date;return r.setMonth(0),r.setDate(1),r.setHours(0,0,0,0),p1(e,t,r,new Date)}function p1(e,t,r,n){return e=u1(e,t),e=bC(e,t,ie.GREATER_THAN_OR_EQUALS,r),e=bC(e,t,ie.LESS_THAN_OR_EQUALS,n),e}function bC(e,t,r,n){return Nm(e,t,r,n.toISOString())}function _C(e,t,r=!0){return Nm(e,t,ie.MISSING,r.toString())}function Ffe(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function Vfe(e,t){const r=e.count??Wc,n=(t-1)*r;return Ffe(e,n)}function Bfe(e,t,r){return t===Ufe(e)&&r!==void 0&&r===Wfe(e)?e:{...e,sortRules:[{code:t,descending:!!r}],name:void 0}}function Ufe(e){const t=e.sortRules;if(!t||t.length===0)return;const r=t[0].code;return r.startsWith("-")?r.substr(1):r}function Wfe(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function Hfe(e){return kfe[e.type]}function h1(e){return Rfe[e]??""}function Oi(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(er).join(" "))}function qfe(e,t){var n,o;const r=t.name;return r==="id"?e.id:r==="meta.versionId"?(n=e.meta)==null?void 0:n.versionId:r==="_lastUpdated"?Nr((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?Gfe(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?Qfe(e,t.searchParams[0]):null}function Gfe(e,t){var i,a,l;const r=((l=(a=(i=t.path)==null?void 0:i.split("."))==null?void 0:a.pop())==null?void 0:l.replaceAll("[x]",""))??"",[n,o]=km({type:e.resourceType,value:e},r);return n?s.jsx(Io,{property:t,propertyType:o,value:n,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function Qfe(e,t){const r=gc(t.expression,[{type:e.resourceType,value:e}]);return!r||r.length===0?null:s.jsx(s.Fragment,{children:r.map((n,o)=>s.jsx(Io,{propertyType:n.type,value:n.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${r.length}`))})}function Kfe(e){const t=f.useRef(!1),[r,n]=f.useState({search:JSON.parse(Dr(e.search))}),[o,i]=f.useState(!1);f.useEffect(()=>{n({search:e.search})},[e.search]);const a=f.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=Ase(c),d=Rx(c);return Yfe(u,d).sort((p,h)=>p.localeCompare(h)).map(p=>({value:p,label:Oi(p)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){n({search:{...r.search,fields:c}})}return s.jsx(Mr,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(be,{children:[s.jsx(fm,{withinPortal:!0,style:{width:550},placeholder:"Select fields to display",data:a,value:r.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",dropdownPosition:"bottom",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(K,{position:"right",children:s.jsx(re,{onClick:()=>e.onOk(r.search),children:"OK"})})]})})}function Yfe(e,t){const r=[],n=new Set,o=new Set;for(const i of Object.keys(e.elements))r.push(i),n.add(i.toLowerCase()),o.add(Oi(i));if(t)for(const i of Object.keys(t)){const a=Oi(i);!n.has(i)&&!o.has(a)&&(r.push(i),n.add(i),o.add(a))}return r}function v3(e){var o;const{resourceType:t,filter:r}=e,n=(o=Pi.types[t].searchParams)==null?void 0:o[r.code];if(n){if(n.type==="reference"&&(r.operator===ie.EQUALS||r.operator===ie.NOT_EQUALS))return s.jsx(Gc,{value:{reference:r.value}});const i=Sm(t,n);if(r.code==="_lastUpdated"||i.type===ri.DATETIME)return s.jsx(s.Fragment,{children:Nr(r.value)})}return s.jsx(s.Fragment,{children:r.value})}function y3(e){const t=Sm(e.resourceType,e.searchParam),r="filter-value";switch(t.type){case ri.REFERENCE:return s.jsx(Tm,{name:r,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:n=>{n?e.onChange(n.reference):e.onChange("")}});case ri.BOOLEAN:return s.jsx(Tn,{name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.checked.toString())});case ri.DATE:return s.jsx(le,{type:"date",name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.value)});case ri.DATETIME:return s.jsx(la,{name:r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case ri.NUMBER:return s.jsx(le,{type:"number",name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.value)});case ri.QUANTITY:return s.jsx(ca,{name:r,defaultValue:Xfe(e.defaultValue),autoFocus:e.autoFocus,onChange:n=>{n?e.onChange(`${n.value}`):e.onChange("")}});default:return s.jsx(le,{name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.value),placeholder:"Search value"})}}function Xfe(e){if(e){const[t,r,n]=e.split("|");if(t)return{value:parseFloat(t),system:r,unit:n}}}function Jfe(e){const[t,r]=f.useState(JSON.parse(Dr(e.search))),[n,o]=f.useState(-1),i=f.useRef(t);i.current=t,f.useEffect(()=>{r(JSON.parse(Dr(e.search)))},[e.search]);function a(d){r(Nm(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=Rx(l)??{},u=t.filters||[];return s.jsxs(Mr,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[s.jsx("div",{children:s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:120}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[u.map((d,p)=>p===n?s.jsx(SC,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[p]=h,r(c1(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(Zfe,{resourceType:l,searchParams:c,filter:d,onEdit:()=>o(p),onDelete:()=>r(Tfe(i.current,p))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(SC,{resourceType:l,searchParams:c,okText:"Add",onOk:a})]})]})}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(re,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function Zfe(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:Oi(t.code)}),s.jsx("td",{children:h1(t.operator)}),s.jsx("td",{children:s.jsx(v3,{resourceType:e.resourceType,filter:t})}),s.jsxs("td",{children:[s.jsx(re,{compact:!0,variant:"outline",onClick:e.onEdit,children:"Edit"}),s.jsx(re,{compact:!0,variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function SC(e){const[t,r]=f.useState(e.defaultValue??{}),n=f.useRef(t);n.current=t;function o(u){r({...n.current,code:u})}function i(u){r({...n.current,operator:u})}function a(u){r({...n.current,value:u})}const l=e.searchParams[t.code],c=l&&Hfe(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(mt,{"data-testid":"filter-field",defaultValue:n.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:Oi(u)}))]})}),s.jsx("td",{children:c&&s.jsx(mt,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:h1(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(y3,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:a})}),s.jsxs("td",{children:[t.code&&t.operator&&s.jsx(re,{compact:!0,variant:"outline",onClick:()=>{e.onOk(n.current),r({})},children:e.okText}),e.onCancel&&s.jsx(re,{compact:!0,variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function epe(e){const[t,r]=f.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function n(){e.onOk({...e.filter,value:t})}return s.jsx(Mr,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(Ne,{onSubmit:n,children:s.jsxs(ln,{children:[s.jsx(ln.Col,{span:10,children:s.jsx(y3,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:r})}),s.jsx(ln.Col,{span:2,children:s.jsx(re,{onClick:n,fullWidth:!0,children:"OK"})})]})})})}function tpe(e){if(!e.searchParams)return null;function t(i,a){o(Bfe(e.search,i.code,a))}function r(i){o(u1(e.search,i.code))}function n(i,a){e.onPrompt(i,{code:i.code,operator:a,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?s.jsx(rpe,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:n,onChange:o,onClear:r}):s.jsx(Z.Dropdown,{children:e.searchParams.map(i=>s.jsx(Z.Item,{children:Oi(i.code)},i.code))})}function rpe(e){switch(e.searchParam.type){case"date":return s.jsx(npe,{...e});case"number":case"quantity":return s.jsx(ope,{...e});case"reference":return s.jsx(ipe,{...e});case"string":case"token":case"uri":return s.jsx(ape,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function npe(e){const{searchParam:t}=e,r=t.code;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{icon:s.jsx(Ux,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(Z.Item,{icon:s.jsx(Wx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx($m,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{icon:s.jsx(Em,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx(I4,{size:14}),onClick:()=>e.onPrompt(t,ie.ENDS_BEFORE),children:"Before..."}),s.jsx(Z.Item,{icon:s.jsx(T4,{size:14}),onClick:()=>e.onPrompt(t,ie.STARTS_AFTER),children:"After..."}),s.jsx(Z.Item,{icon:s.jsx(Dce,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Between..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx(Fi,{size:14}),onClick:()=>e.onChange(Nfe(e.search,r)),children:"Tomorrow"}),s.jsx(Z.Item,{icon:s.jsx(Fi,{size:14}),onClick:()=>e.onChange(Dfe(e.search,r)),children:"Today"}),s.jsx(Z.Item,{icon:s.jsx(Fi,{size:14}),onClick:()=>e.onChange(Ife(e.search,r)),children:"Yesterday"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx(Fi,{size:14}),onClick:()=>e.onChange(Lfe(e.search,r)),children:"Next Month"}),s.jsx(Z.Item,{icon:s.jsx(Fi,{size:14}),onClick:()=>e.onChange(Mfe(e.search,r)),children:"This Month"}),s.jsx(Z.Item,{icon:s.jsx(Fi,{size:14}),onClick:()=>e.onChange(Afe(e.search,r)),children:"Last Month"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx(Fi,{size:14}),onClick:()=>e.onChange(zfe(e.search,r)),children:"Year to date"}),s.jsx(Am,{...e})]})}function ope(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{icon:s.jsx(Ux,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(Z.Item,{icon:s.jsx(Wx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx($m,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{icon:s.jsx(Em,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx(T4,{size:14}),onClick:()=>e.onPrompt(t,ie.GREATER_THAN),children:"Greater than..."}),s.jsx(Z.Item,{icon:s.jsx(wy,{size:14}),onClick:()=>e.onPrompt(t,ie.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(Z.Item,{icon:s.jsx(I4,{size:14}),onClick:()=>e.onPrompt(t,ie.LESS_THAN),children:"Less than..."}),s.jsx(Z.Item,{icon:s.jsx(wy,{size:14}),onClick:()=>e.onPrompt(t,ie.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Am,{...e})]})}function ipe(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{icon:s.jsx($m,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{icon:s.jsx(Em,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT),children:"Does not equal..."}),s.jsx(Am,{...e})]})}function ape(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{icon:s.jsx(Ux,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(Z.Item,{icon:s.jsx(Wx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx($m,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{icon:s.jsx(Em,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT),children:"Does not equal..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx(Mce,{size:14}),onClick:()=>e.onPrompt(t,ie.CONTAINS),children:"Contains..."}),s.jsx(Z.Item,{icon:s.jsx(Ace,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Does not contain..."}),s.jsx(Am,{...e})]})}function Am(e){const{searchParam:t}=e,r=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx(Tce,{size:14}),onClick:()=>e.onChange(_C(e.search,r)),children:"Missing"}),s.jsx(Z.Item,{icon:s.jsx(Rce,{size:14}),onClick:()=>e.onChange(_C(e.search,r,!1)),children:"Not missing"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{icon:s.jsx(gh,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function spe(e){const t=e.resourceType,r=[];for(const n of e.fields||["id","_lastUpdated"])r.push(lpe(t,n));return r}function lpe(e,t){var o;if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const r=Sa(e,t),n=Wse(e,t.toLowerCase());if(r&&n)return{name:t,elementDefinition:r,searchParams:[n]};if(r){const i=Rx(e);let a;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);a=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),a.length===0&&(a=void 0)}return{name:t,elementDefinition:r,searchParams:a}}if(n){const i=Sm(e,n);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[n]}}return{name:t}}class cpe extends Event{constructor(t){super("change"),this.definition=t}}class upe extends Event{constructor(t){super("load"),this.response=t}}class yh extends Event{constructor(t,r){super("click"),this.resource=t,this.browserEvent=r}}const dpe=W(e=>({root:{maxWidth:"100%",overflow:"auto",textAlign:"left",marginBottom:"20px"},table:{cursor:"pointer"},tr:{"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.colors.gray[0]}},th:{padding:"0 !important"},control:{width:"100%",padding:`${e.spacing.xs} ${e.spacing.md}`,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]}},icon:{width:21,height:21,borderRadius:21}}));function fpe(e){var L,Q,G;const{classes:t}=dpe(),r=ne(),[n,o]=f.useState(!1),[i,a]=f.useState(),{search:l,onLoad:c}=e,[u,d]=f.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),p=f.useRef(u);p.current=u;const h=l.total??"accurate",m=f.useCallback(T=>{a(void 0),r.search(l.resourceType,es({...l,total:h,fields:void 0}),T).then(F=>{d({...p.current,searchResponse:F}),c&&c(new upe(F))}).catch(F=>{d({...p.current,searchResponse:void 0}),a(F)})},[r,l,h,c]),g=f.useCallback(()=>{d({...p.current,searchResponse:void 0}),m({cache:"reload"})},[m]);f.useEffect(()=>{m()},[m]);function v(T,F){T.stopPropagation();const X=T.target.checked,J={...p.current.selected};X?J[F]=!0:delete J[F],d({...p.current,selected:J})}function _(T){T.stopPropagation();const V=T.target.checked,X={},J=p.current.searchResponse;V&&(J!=null&&J.entry)&&J.entry.forEach(_e=>{var Se;(Se=_e.resource)!=null&&Se.id&&(X[_e.resource.id]=!0)}),d({...p.current,selected:X})}function y(){var F,V;const T=p.current;if(!((F=T.searchResponse)!=null&&F.entry)||T.searchResponse.entry.length===0)return!1;for(const X of T.searchResponse.entry)if((V=X.resource)!=null&&V.id&&!T.selected[X.resource.id])return!1;return!0}function x(T){e.onChange&&e.onChange(new cpe(T))}function w(T,F){if(A4(T.target)||T.button===2)return;Ze(T);const V=T.button===1||T.ctrlKey||T.metaKey;!V&&e.onClick&&e.onClick(new yh(F,T)),V&&e.onAuxClick&&e.onAuxClick(new yh(F,T))}function b(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(f.useEffect(()=>{o(!1),r.requestSchema(e.search.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.search.resourceType]),!n)return s.jsx(ar,{style:{width:"100%",height:"100%"},children:s.jsx(mn,{})});const j=e.checkboxesEnabled,C=spe(l),P=l.resourceType,E=u.searchResponse,k=E==null?void 0:E.entry,$=k==null?void 0:k.map(T=>T.resource),I="subtle",R="gray",N=16,M=window.innerWidth<768;return s.jsxs("div",{className:t.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(K,{position:"apart",mb:"xl",children:[s.jsxs(K,{spacing:2,children:[s.jsx(re,{compact:!0,variant:I,color:R,leftIcon:s.jsx(Bce,{size:N}),onClick:()=>d({...p.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(re,{compact:!0,variant:I,color:R,leftIcon:s.jsx(Kce,{size:N}),onClick:()=>d({...p.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(re,{compact:!0,variant:I,color:R,leftIcon:s.jsx(Qce,{size:N}),onClick:e.onNew,children:"New..."}),!M&&b()&&s.jsx(re,{compact:!0,variant:I,color:R,leftIcon:s.jsx(gue,{size:N}),onClick:e.onExport?e.onExport:()=>d({...p.current,exportDialogVisible:!0}),children:"Export..."}),!M&&e.onDelete&&s.jsx(re,{compact:!0,variant:I,color:R,leftIcon:s.jsx(D4,{size:N}),onClick:()=>e.onDelete(Object.keys(u.selected)),children:"Delete..."}),!M&&e.onBulk&&s.jsx(re,{compact:!0,variant:I,color:R,leftIcon:s.jsx(Ice,{size:N}),onClick:()=>e.onBulk(Object.keys(u.selected)),children:"Bulk..."})]}),s.jsxs(K,{spacing:2,children:[E&&s.jsxs(oe,{size:"xs",color:"dimmed",children:[gpe(l,E.total),"-",vpe(l,E.total)," of"," ",`${h==="estimate"?"~":""}${(L=E.total)==null?void 0:L.toLocaleString()}`]}),s.jsx(yr,{title:"Refresh",onClick:g,children:s.jsx(uue,{size:"1.125rem"})})]})]}),s.jsxs(wa,{className:t.table,children:[s.jsxs("thead",{children:[s.jsxs("tr",{children:[j&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:y(),onChange:T=>_(T)})}),C.map(T=>s.jsx("th",{children:s.jsxs(Z,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(Z.Target,{children:s.jsx(Po,{className:t.control,children:s.jsxs(K,{position:"apart",noWrap:!0,children:[s.jsx(oe,{weight:500,size:"sm",children:Oi(T.name)}),s.jsx(ar,{className:t.icon,children:s.jsx(Ece,{size:14,stroke:1.5})})]})})}),s.jsx(tpe,{search:e.search,searchParams:T.searchParams,onPrompt:(F,V)=>{d({...p.current,filterDialogVisible:!0,filterDialogSearchParam:F,filterDialogFilter:V})},onChange:F=>{x(F)}})]})},T.name))]}),!e.hideFilters&&s.jsxs("tr",{children:[j&&s.jsx("th",{}),C.map(T=>s.jsx("th",{children:T.searchParams&&s.jsx(ppe,{resourceType:P,searchParams:T.searchParams,filters:e.search.filters})},T.name))]})]}),s.jsx("tbody",{children:$==null?void 0:$.map(T=>T&&s.jsxs("tr",{className:t.tr,"data-testid":"search-control-row",onClick:F=>w(F,T),onAuxClick:F=>w(F,T),children:[j&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${T.id}`,checked:!!u.selected[T.id],onChange:F=>v(F,T.id)})}),C.map(F=>s.jsx("td",{children:qfe(T,F)},F.name))]},T.id))})]}),($==null?void 0:$.length)===0&&s.jsx(qc,{children:s.jsx(ar,{style:{height:150},children:s.jsx(oe,{size:"xl",color:"dimmed",children:"No results"})})}),(E==null?void 0:E.total)!==void 0&&E.total>0&&s.jsx(ar,{m:"md",p:"md",children:s.jsx(so,{value:hpe(l),total:mpe(l,E.total),onChange:T=>x(Vfe(l,T)),getControlProps:T=>{switch(T){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),i&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),s.jsx(Kfe,{search:e.search,visible:p.current.fieldEditorVisible,onOk:T=>{x(T),d({...p.current,fieldEditorVisible:!1})},onCancel:()=>{d({...p.current,fieldEditorVisible:!1})}}),s.jsx(Jfe,{search:e.search,visible:p.current.filterEditorVisible,onOk:T=>{x(T),d({...p.current,filterEditorVisible:!1})},onCancel:()=>{d({...p.current,filterEditorVisible:!1})}}),s.jsx($fe,{visible:p.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{d({...p.current,exportDialogVisible:!1})}}),s.jsx(epe,{visible:p.current.filterDialogVisible,title:(Q=u.filterDialogSearchParam)!=null&&Q.code?Oi(u.filterDialogSearchParam.code):"",resourceType:P,searchParam:u.filterDialogSearchParam,filter:u.filterDialogFilter,defaultValue:"",onOk:T=>{x(Nm(e.search,T.code,T.operator,T.value)),d({...p.current,filterDialogVisible:!1})},onCancel:()=>{d({...p.current,filterDialogVisible:!1})}},(G=u.filterDialogSearchParam)==null?void 0:G.code)]})}const Kc=f.memo(fpe);function ppe(e){const t=(e.filters??[]).filter(r=>e.searchParams.find(n=>n.code===r.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(r=>s.jsxs("div",{children:[h1(r.operator)," ",s.jsx(v3,{resourceType:e.resourceType,filter:r})]},`filter-${r.code}-${r.operator}-${r.value}`))})}function hpe(e){return Math.floor((e.offset??0)/(e.count??Wc))+1}function mpe(e,t){const r=e.count??Wc;return Math.ceil(t/r)}function gpe(e,t){return Math.min(t,(e.offset??0)+1)}function vpe(e,t){return Math.min(t,((e.offset??0)+1)*(e.count??Wc))}function ype(e){const t=ne(),[r,n]=f.useState(!1),[o,i]=f.useState(),{query:a,fields:l}=e,[c,u]=f.useState(),[d,p]=f.useState({}),h=f.useRef();h.current=c;const m=f.useRef({});m.current=d,f.useEffect(()=>{i(void 0),t.graphql(a).then(u).catch(w=>i(lt(w)))},[t,a]);function g(w,b){w.stopPropagation();const C=w.target.checked,P={...m.current};C?P[b]=!0:delete P[b],p(P)}function v(w){var E;w.stopPropagation();const j=w.target.checked,C={},P=(E=h.current)==null?void 0:E.data.ResourceList;j&&P&&P.forEach(k=>{k.id&&(C[k.id]=!0)}),p(C)}function _(){var b;const w=(b=h.current)==null?void 0:b.data.ResourceList;if(!w||w.length===0)return!1;for(const j of w)if(j.id&&!m.current[j.id])return!1;return!0}function y(w,b){A4(w.target)||(Ze(w),w.button!==1&&e.onClick&&e.onClick(new yh(b,w)),w.button===1&&e.onAuxClick&&e.onAuxClick(new yh(b,w)))}if(f.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>n(!0)).catch(console.log)},[t,e.resourceType]),!r)return s.jsx(mn,{});const x=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:w=>Ze(w),"data-testid":"search-control",children:[s.jsxs(wa,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[x&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:_(),onChange:w=>v(w)})}),l.map(w=>s.jsx("th",{children:w.name},w.name))]})}),s.jsx("tbody",{children:c==null?void 0:c.data.ResourceList.map(w=>w&&s.jsxs("tr",{"data-testid":"search-control-row",onClick:b=>y(b,w),onAuxClick:b=>y(b,w),children:[x&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${w.id}`,checked:!!d[w.id],onChange:b=>g(b,w.id)})}),l.map(b=>s.jsx("td",{children:s.jsx(Efe,{propertyType:b.propertyType,path:b.fhirPath,resource:w})},b.name))]},w.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&s.jsx(re,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const xpe=f.memo(ype);function Nn(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 wpe(e){const{group:t}=e;return s.jsx(dn,{withBorder:!0,radius:"md",p:"xs",display:"flex",sx:{alignItems:"center",justifyContent:"center"},children:s.jsxs(K,{children:[t.measureScore&&s.jsx(Spe,{group:t}),!t.measureScore&&s.jsx(_pe,{group:t})]})})}function bpe(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(oe,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(oe,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function _pe(e){const{group:t}=e,r=t.population,n=r==null?void 0:r.find(c=>js(c.code)==="numerator"),o=r==null?void 0:r.find(c=>js(c.code)==="denominator"),i=n==null?void 0:n.count,a=o==null?void 0:o.count;if(a===0)return s.jsxs(ae,{children:[s.jsx(ue,{order:3,children:"Not Applicable"}),s.jsx(oe,{children:`Denominator: ${a}`})]});if(i===void 0||a===void 0)return s.jsxs(ae,{children:[s.jsx(ue,{order:3,children:"Insufficient Data"}),s.jsx(oe,{children:`Numerator: ${i}`}),s.jsx(oe,{children:`Denominator: ${a}`})]});const l=i/a*100;return s.jsx(wx,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:x3(l)}],label:s.jsx(cp,{justify:"center",children:s.jsxs(oe,{fw:700,fz:18,children:[i," / ",a]})})})}function Spe(e){var n,o,i;const{group:t}=e,r=((n=t.measureScore)==null?void 0:n.unit)??((o=t.measureScore)==null?void 0:o.code);return s.jsx(s.Fragment,{children:r==="%"?s.jsx(wx,{size:120,thickness:12,roundCaps:!0,sections:[{value:Ppe(t),color:x3(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(cp,{justify:"center",children:s.jsx(oe,{fw:700,fz:18,children:s.jsx(vc,{value:t.measureScore})})})}):s.jsx(cp,{h:120,align:"center",children:s.jsx(ue,{order:3,children:s.jsx(vc,{value:t.measureScore})})})})}function Ppe(e){var n,o;const t=(n=e.measureScore)==null?void 0:n.value,r=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&r==="%"?t*100:t:0}function x3(e){return e<=33?"red":e<=67?"yellow":"green"}function jpe(e){var n;const t=et(e.measureReport),[r]=yce("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(ae,{children:[r&&s.jsx(bpe,{measure:r}),s.jsx(i5,{cols:3,breakpoints:[{maxWidth:"48rem",cols:2,spacing:"md"},{maxWidth:"36rem",cols:1,spacing:"sm"}],spacing:"md",children:(n=t.group)==null?void 0:n.map((o,i)=>s.jsx(wpe,{group:o},o.id??i))})]}):null}function lo(e){var r;const t=((r=e.outcome)==null?void 0:r.issue)||e.issues;return!t||t.length===0?null:s.jsx(Rc,{icon:s.jsx(Om,{size:16}),color:"red",children:t.map(n=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:p4(n)},(o=n.details)==null?void 0:o.text)})})}function Ope(e){const t=f.useCallback((r,n,o)=>{const i=`${n}/${o}`,a=100;return Promise.allSettled([r.readHistory("Patient",o),r.search("Communication",{subject:i,_count:a}),r.search("Device",{patient:i,_count:a}),r.search("DeviceRequest",{patient:i,_count:a}),r.search("DiagnosticReport",{subject:i,_count:a}),r.search("Media",{subject:i,_count:a}),r.search("ServiceRequest",{subject:i,_count:a}),r.search("Task",{subject:i,_count:a})])},[]);return s.jsx(Dm,{value:e.patient,loadTimelineResources:t,createCommunication:(r,n,o)=>({resourceType:"Communication",status:"completed",subject:ht(r),sender:ht(n),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,n,o)=>({resourceType:"Media",status:"completed",subject:ht(r),operator:ht(n),issued:new Date().toISOString(),content:o})})}const w3=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}}}));function Cpe(e){const t=ne(),r=et(e.value),[n,o]=f.useState(!1),[i,a]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){c(void 0)}function h(){a(void 0)}const m=f.useRef();if(m.current=u,f.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(d(Ipe(r??{resourceType:"PlanDefinition"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!u)return null;function g(v,_){d({...m.current,[v]:_})}return s.jsx("div",{children:s.jsxs(Ne,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[s.jsx(le,{label:"Plan Title",defaultValue:u.title,onChange:v=>g("title",v.currentTarget.value)}),s.jsx(b3,{actions:u.action||[],selectedKey:i,setSelectedKey:a,hoverKey:l,setHoverKey:c,onChange:v=>g("action",v)}),s.jsx(re,{type:"submit",children:"Save"})]})})}function b3(e){const{classes:t}=w3(),r=f.useRef();r.current=e.actions;function n(a){e.onChange(r.current.map(l=>l.id===a.id?a:l))}function o(a){e.onChange([...r.current,a]),e.setSelectedKey(a.id)}function i(a){e.onChange(r.current.filter(l=>l!==a))}return s.jsxs("div",{className:t.section,children:[e.actions.map(a=>s.jsx("div",{children:s.jsx(Epe,{action:a,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(a)})},a.id)),s.jsx("div",{className:t.bottomActions,children:s.jsx(Fe,{href:"#",onClick:a=>{Ze(a),o({id:S3()})},children:"Add action"})})]})}function Epe(e){const{classes:t,cx:r}=w3(),{action:n}=e,o=Tpe(n),i=e.selectedKey===e.action.id,a=e.hoverKey===e.action.id;function l(d){d.stopPropagation(),e.setSelectedKey(e.action.id)}function c(d){Ze(d),e.setHoverKey(e.action.id)}const u=r(t.section,{[t.editing]:i,[t.hovering]:a&&!i});return s.jsxs("div",{"data-testid":n.id,className:u,onClick:l,onMouseOver:c,onFocus:c,children:[i?s.jsx(kpe,{action:n,actionType:o,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx($pe,{action:n,actionType:o}),s.jsx("div",{className:t.bottomActions,children:s.jsx(Fe,{href:"#",onClick:d=>{d.preventDefault(),e.onRemove()},children:"Remove"})})]})}const jy={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function $pe(e){const{action:t,actionType:r}=e,[n,o]=_3(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",r&&`(${r})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(vh,{value:{reference:t.definitionCanonical}})}),n&&s.jsx("div",{children:s.jsx(Io,{property:jy,propertyType:o,value:n})})]})}function kpe(e){const{action:t}=e,[r,n]=f.useState(e.actionType);function o(i,a){e.onChange({...t,[i]:a})}return s.jsxs(be,{spacing:"xl",children:[s.jsx(le,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),s.jsx(le,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),s.jsx(mt,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:r,onChange:i=>n(i.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&s.jsx(b3,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:i=>o("action",i)}),(()=>{switch(r){case"appointment":return s.jsx(Ku,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(Ku,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(Ku,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(Ku,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(Je,{title:"Timing",description:"When the action should take place.",children:s.jsx(Rpe,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function Ku(e){const{id:t,definitionCanonical:r}=e.action,n=r!=null&&r.startsWith(e.resourceType+"/")?{reference:r}:void 0;return s.jsx(Bs,{name:t,resourceType:e.resourceType,defaultValue:n,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:at(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function Rpe(e){const t=e.action,r="timing",[n,o]=_3(t);return s.jsx(Us,{property:jy,name:"timing[x]",defaultValue:n,defaultPropertyType:o,onChange:(i,a)=>{e.onChange(_y(t,r,a??r,jy,i))},outcome:void 0})}function Tpe(e){var t,r,n;if((t=e.definitionCanonical)!=null&&t.startsWith("Schedule"))return"appointment";if((r=e.definitionCanonical)!=null&&r.startsWith("Questionnaire/"))return"questionnaire";if((n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition/"))return"task"}function _3(e){return km({type:"PlanDefinitionAction",value:e},"timing")}let Kg=1;function S3(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Kg=Math.max(Kg,t+1))}return e}return"id-"+Kg++}function Ipe(e){return{...e,action:P3(e.action)}}function P3(e){if(e)return e.map(t=>({...t,id:S3(t.id),action:P3(t.action)}))}var ut=(e=>(e.group="group",e.display="display",e.question="question",e.boolean="boolean",e.decimal="decimal",e.integer="integer",e.date="date",e.dateTime="dateTime",e.time="time",e.string="string",e.text="text",e.url="url",e.choice="choice",e.openChoice="open-choice",e.attachment="attachment",e.reference="reference",e.quantity="quantity",e))(ut||{});function Dpe(e){return e.type==="choice"||e.type==="open-choice"}function Npe(e,t){if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const n of e.enableWhen){const o=j3(t,n.question);if(n.operator==="exists"&&!n.answerBoolean&&!(o!=null&&o.length)){if(r==="any")return!0;continue}const{anyMatch:i,allMatch:a}=Lpe(n,o,r);if(r==="any"&&i)return!0;if(r==="all"&&!a)return!1}return r!=="any"}function Ape(e,t,r){return e.map(n=>{var a;const o=(a=r.answerOption)==null?void 0:a.find(l=>_a(l.valueCoding)===n||l[t]===n),i=xr({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function j3(e,t){if(e)for(const r of e){if(r.linkId===t)return r.answer;if(r.item){const n=j3(r.item,t);if(n)return n}}}function Mpe(e,t,r){if(r==="exists")return!!e===t.value;if(e){const n=r==="="||r==="!="?r==null?void 0:r.replace("=","~"):r,[{value:o}]=gc(`%actualAnswer ${n} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function Lpe(e,t,r){const n=t||[],o=xr({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,a=!0;for(const l of n){const c=xr({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(Mpe(c,o,u)?i=!0:a=!1,r==="any"&&i)break}return{anyMatch:i,allMatch:a}}function O3(e){var r,n;const t=Vc(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(n=(r=t.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:n.map(o=>o.code)}}function Yg(e,t){var o;const r=ki(e);let n=Vc(r,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(n&&(r.extension=(o=r.extension)==null?void 0:o.filter(i=>i!==n)),r):(n||(r.extension||(r.extension=[]),n={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},r.extension.push(n)),t.length===1?(n.valueCode=t[0],delete n.valueCodeableConcept):(n.valueCodeableConcept={coding:t.map(i=>({code:i}))},delete n.valueCode),r)}function zpe(e,t,r){const n=Vc(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(n!=null&&n.valueString))return;let o=n.valueString;t!=null&&t.reference&&(o=o.replaceAll("$subj",t.reference)),r!=null&&r.reference&&(o=o.replaceAll("$encounter",r.reference));const i={},a=o.split("&");for(const l of a){const[c,u]=mae(l,"=",2);i[c]=u}return i}function Fpe(e){return{resourceType:"QuestionnaireResponse",questionnaire:at(e),item:C3(e.item)}}function C3(e){return(e==null?void 0:e.map(E3))??[]}function E3(e){var t;return{id:Bpe(),linkId:e.linkId,text:e.text,item:C3(e.item),answer:((t=e.initial)==null?void 0:t.map(Upe))??[]}}let Vpe=1;function Bpe(){return"id-"+Vpe++}function Upe(e){return{...e}}function Wpe(e){return e.value.display||e.value.reference||Dr(e.value)}function Hpe(e){var r,n,o,i;const t=(r=e==null?void 0:e.item)==null?void 0:r[0];if(t){const a=Vc(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(n=a==null?void 0:a.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}const $3=f.createContext({});function Oy(e){const t=f.useContext($3),r=e.item,n=e.response;function o(u){var p,h,m,g;let d;Array.isArray(u)?d=u:e.index>=(((h=(p=e.response)==null?void 0:p.answer)==null?void 0:h.length)??0)?d=(((m=e.response)==null?void 0:m.answer)??[]).concat([u]):d=(((g=e.response)==null?void 0:g.answer)??[]).map((_,y)=>y===e.index?u:_)??[],e.onChange({id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:r.text,answer:d})}const i=r.type;if(!i)return null;const a=r.linkId;if(!a)return null;const l=r.initial&&r.initial.length>0?r.initial[0]:void 0,c=m1(n,e.index)??xr({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case ut.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case ut.boolean:return s.jsx(U4,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Tn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:c==null?void 0:c.value,onChange:u=>o({valueBoolean:u.currentTarget.checked})})},e.item.linkId);case ut.decimal:return s.jsx(le,{type:"number",step:"any",id:a,name:a,required:r.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDecimal:u.currentTarget.valueAsNumber})});case ut.integer:return s.jsx(le,{type:"number",step:1,id:a,name:a,required:r.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueInteger:u.currentTarget.valueAsNumber})});case ut.date:return s.jsx(le,{type:"date",id:a,name:a,required:r.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case ut.dateTime:return s.jsx(la,{name:a,required:r.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case ut.time:return s.jsx(le,{type:"time",id:a,name:a,required:r.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case ut.string:case ut.url:return s.jsx(le,{id:a,name:a,required:r.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case ut.text:return s.jsx(Nc,{id:a,name:a,required:r.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case ut.attachment:return s.jsx(K,{py:4,children:s.jsx(z4,{name:a,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case ut.reference:return s.jsx(Tm,{name:a,required:r.required,targetTypes:O3(r),searchCriteria:zpe(r,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case ut.quantity:return s.jsx(ca,{name:a,required:r.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case ut.choice:case ut.openChoice:return Xpe(r)&&!r.answerValueSet?s.jsx(qpe,{name:a,item:r,initial:l,response:n,onChangeAnswer:u=>o(u)}):s.jsx(Gpe,{name:a,item:r,initial:l,response:n,onChangeAnswer:u=>o(u)});default:return null}}function qpe(e){var c;const{name:t,item:r,initial:n,response:o}=e;if(!((c=r.answerOption)!=null&&c.length))return s.jsx(k3,{});const i=xr({type:"QuestionnaireItemInitial",value:n},"value"),a=[""];for(const u of r.answerOption){const d=xr({type:"QuestionnaireItemAnswerOption",value:u},"value");a.push(PC(d))}const l=m1(o)??i;if(r.repeats){const{propertyName:u,data:d}=Jpe(e.item),p=Kpe(o);return s.jsx(fm,{data:d,placeholder:"Select items",searchable:!0,defaultValue:p||[PC(i)],onChange:h=>{const m=Ape(h,u,r);e.onChangeAnswer(m)}})}return s.jsx(mt,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const p=r.answerOption[d-1],h=xr({type:"QuestionnaireItemAnswerOption",value:p},"value"),m="value"+er(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:_a(l==null?void 0:l.value)||(l==null?void 0:l.value),data:a})}function Gpe(e){var a;const{name:t,item:r,initial:n,onChangeAnswer:o,response:i}=e;return!((a=r.answerOption)!=null&&a.length)&&!r.answerValueSet?s.jsx(k3,{}):r.answerValueSet?s.jsx(H4,{name:t,binding:r.answerValueSet,onChange:l=>o({valueCoding:l})}):s.jsx(Qpe,{name:(i==null?void 0:i.id)??t,item:r,initial:n,response:i,onChangeAnswer:o})}function Qpe(e){const{name:t,item:r,initial:n,onChangeAnswer:o,response:i}=e,a=Sa("QuestionnaireItemAnswerOption","value[x]"),l=xr({type:"QuestionnaireItemInitial",value:n},"value"),c=[];let u;if(r.answerOption)for(let h=0;h<r.answerOption.length;h++){const m=r.answerOption[h],g=`${t}-option-${h}`,v=xr({type:"QuestionnaireItemAnswerOption",value:m},"value");v!=null&&v.value&&(l&&Dr(v)===Dr(l)&&(u=g),c.push([g,v]))}const d=m1(i),p=Ype(c,d);return s.jsx(Hp.Group,{name:t,value:p??u,onChange:h=>{const m=c.find(g=>g[0]===h);if(m){const g=m[1],v="value"+er(g.type);o({[v]:g.value})}},children:c.map(([h,m])=>s.jsx(Hp,{id:h,value:h,py:4,label:s.jsx(Io,{property:a,propertyType:m.type,value:m.value})},h))})}function k3(){return s.jsx(le,{disabled:!0,placeholder:"No Answers Defined"})}function R3(e){return xr({type:"QuestionnaireItemAnswer",value:e},"value")}function m1(e,t=0){const r=e.answer;return R3((r==null?void 0:r[t])??{})}function Kpe(e){const t=e.answer;return t?t.map(n=>R3(n)).map(n=>_a(n==null?void 0:n.value)||(n==null?void 0:n.value)):[]}function Ype(e,t){var r;return(r=e.find(n=>Bc(n[1].value,t==null?void 0:t.value)))==null?void 0:r[0]}function PC(e){if(e)return e.type==="CodeableConcept"?js(e.value):e.type==="Coding"?_a(e.value):e.type==="Reference"?Wpe(e):e.value.toString()}function Xpe(e){var t;return!!((t=e.extension)!=null&&t.some(r=>{var n,o,i;return r.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(n=r.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code)==="drop-down"}))}function Jpe(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],r=xr({type:"QuestionnaireItemAnswerOption",value:t},"value"),n="value"+er(r.type),o=(e.answerOption??[]).map(a=>({value:jC(a,n),label:jC(a,n)}));return{propertyName:n,data:o}}function jC(e,t){var r;return _a(e.valueCoding)||((r=e[t])==null?void 0:r.toString())}const Zpe=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},questionBody:{maxWidth:600},topActions:{position:"absolute",right:32,top:1,padding:4,color:e.colors.gray[5],fontSize:e.fontSizes.xs},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementActions:{position:"absolute",right:8,top:0,paddingTop:8,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementIcons:{color:e.colors.gray[5]},columnAlignment:{display:"flex",flexDirection:"column"},linkIdInput:{width:100,marginBottom:4},typeSelect:{width:100}}));function ehe(e){const t=ne(),r=et(e.questionnaire),[n,o]=f.useState(!1),[i,a]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){d(void 0)}function h(){c(void 0)}f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(a(ohe(r??{resourceType:"Questionnaire"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]);const m=(g,v)=>{a(g),e.autoSave&&!v&&e.onSubmit&&e.onSubmit(g)};return!n||!i?null:s.jsx("div",{children:s.jsxs(Ne,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[s.jsx(T3,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:m}),s.jsx(re,{type:"submit",children:"Save"})]})})}function T3(e){var j;const{classes:t,cx:r}=Zpe(),n=e.item,o=e.item,i=Vo(e.item),a=i||o.type===ut.group,l=o.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,d=f.useRef();d.current=e.item;function p(C){Ze(C),e.setSelectedKey(e.item.id)}function h(C){Ze(C),e.setHoverKey(e.item.id)}function m(C){var E;const P=d.current;e.onChange({...P,item:(E=P.item)==null?void 0:E.map(k=>k.id===C.id?C:k)})}function g(C,P){e.onChange({...e.item,item:[...e.item.item??[],C]},P)}function v(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.filter(E=>E!==C)})}function _(C,P){e.onChange({...d.current,[C]:P})}function y(C){e.onChange({...e.item,...C})}function x(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.map(E=>E===C?{...E,repeats:!E.repeats}:E)})}function w(C,P){const E=she(e.item.item,C,P);e.onChange({...e.item,item:E})}const b=r(t.section,{[t.editing]:c,[t.hovering]:u&&!c});return s.jsxs("div",{"data-testid":o.linkId,className:b,onClick:p,onMouseOver:h,onFocus:h,children:[s.jsx("div",{className:t.questionBody,children:c?s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{size:"xl",defaultValue:n.title,onBlur:C=>_("title",C.currentTarget.value)}),!i&&s.jsx(Nc,{autosize:!0,minRows:2,defaultValue:o.text,onBlur:C=>_("text",C.currentTarget.value)}),o.type==="reference"&&s.jsx(nhe,{item:o,onChange:y}),Dpe(o)&&s.jsx(the,{item:o,onChange:C=>y(C)})]}):s.jsxs(s.Fragment,{children:[n.title&&s.jsx(ue,{children:n.title}),o.text&&s.jsx("div",{children:o.text}),!a&&s.jsx(Oy,{item:o,index:0,onChange:()=>{},response:{}})]})}),(j=o.item)==null?void 0:j.map((C,P)=>s.jsx("div",{children:s.jsx(T3,{item:C,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:P===0,isLast:P===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:m,onRemove:()=>v(C),onRepeatable:x,onMoveUp:()=>w(P,-1),onMoveDown:()=>w(P,1)})},C.id)),!a&&s.jsx("div",{className:t.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:"xs",className:t.linkIdInput,defaultValue:o.linkId,onBlur:C=>_("linkId",C.currentTarget.value)}),!a&&s.jsx(mt,{size:"xs",className:t.typeSelect,defaultValue:o.type,onChange:C=>_("type",C.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:l})}),!i&&s.jsx(ae,{className:t.movementActions,children:s.jsxs(ae,{className:t.columnAlignment,children:[!e.isFirst&&s.jsx(Fe,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(kce,{"data-testid":"up-button",size:15,className:t.movementIcons})}),!e.isLast&&s.jsx(Fe,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx($ce,{"data-testid":"down-button",size:15,className:t.movementIcons})})]})}),s.jsxs("div",{className:t.bottomActions,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(Fe,{href:"#",onClick:C=>{C.preventDefault(),g({id:da(),linkId:$y("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Fe,{href:"#",onClick:C=>{C.preventDefault(),g({id:da(),linkId:$y("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),i&&s.jsx(Fe,{href:"#",onClick:C=>{C.preventDefault(),g(ahe(),!0)},children:"Add Page"}),c&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(Fe,{href:"#",onClick:C=>{C.preventDefault(),e.onRepeatable&&e.onRepeatable(o)},children:o.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Fe,{href:"#",onClick:C=>{C.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function the(e){const t=Sa("QuestionnaireItemAnswerOption","value[x]"),r=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(le,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:n=>e.onChange({...e.item,answerValueSet:n.target.value})}):s.jsx(rhe,{options:r,property:t,item:e.item,onChange:e.onChange}),s.jsxs(ae,{display:"flex",children:[s.jsx(Fe,{href:"#",onClick:n=>{Ze(n),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...r,{id:da()}]})},children:"Add choice"}),s.jsx(vm,{w:"lg"}),s.jsx(Fe,{href:"#",onClick:n=>{Ze(n),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function rhe(e){return s.jsx("div",{children:e.options.map(t=>{const[r,n]=km({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(Us,{name:"value[x]",property:e.property,defaultPropertyType:n,defaultValue:r,onChange:(o,i)=>{const a=[...e.options],l=a.findIndex(c=>c.id===t.id);a[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:a})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Fe,{href:"#",onClick:o=>{Ze(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function nhe(e){const t=O3(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((r,n)=>s.jsxs(K,{children:[s.jsx(Kx,{name:"resourceType",placeholder:"Resource Type",defaultValue:r,onChange:o=>{e.onChange(Yg(e.item,t.map(i=>i===r?o:i)))}}),s.jsx(Fe,{href:"#",onClick:o=>{Ze(o),e.onChange(Yg(e.item,t.filter(i=>i!==r)))},children:"Remove"})]},`${r}-${n}`)),s.jsx(Fe,{href:"#",onClick:r=>{Ze(r),e.onChange(Yg(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Cy=1,Ey=1;function $y(e){return e+Cy++}function da(){return"id-"+Ey++}function ohe(e){return{...e,id:e.id||da(),item:I3(e.item)}}function I3(e){if(e)return e.forEach(t=>{var r,n;(r=t.id)!=null&&r.match(/^id-\d+$/)&&(Ey=Math.max(Ey,parseInt(t.id.substring(3),10)+1)),(n=t.linkId)!=null&&n.match(/^q\d+$/)&&(Cy=Math.max(Cy,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||da(),item:I3(t.item),answerOption:ihe(t.answerOption)}))}function ihe(e){if(e)return e.map(t=>({...t,id:t.id||da()}))}function ahe(){return{id:da(),linkId:$y("s"),type:"group",text:"New Page",extension:[{url:"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function she(e,t,r){const n=e??[],o=t+r;if(o<0||o>=n.length)return n;const i=[...n];return[i[t],i[o]]=[i[o],i[t]],i}function D3(e){const{item:t,response:r,onChange:n}=e,[o,i]=f.useState(lhe(t,r??{}));if(!e.checkForQuestionEnabled(t)||!r)return null;if(t.type===ut.display)return s.jsx("p",{children:t.text},t.linkId);const a=(t==null?void 0:t.repeats)&&t.type!==ut.choice&&t.type!==ut.openChoice;return t.type===ut.boolean?s.jsx(Oy,{item:t,response:r,onChange:l=>n([l]),index:0},t.linkId):s.jsxs(Je,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx(Oy,{item:t,response:r,onChange:u=>n([u]),index:c},`${t.linkId}-${c}`)),a&&s.jsx(Fe,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function lhe(e,t){if(e.type===ut.choice||e.type===ut.openChoice)return 1;const r=t.answer;return r!=null&&r.length?r.length:1}function N3(e){const[t,r]=f.useState(e.response);if(t.length===0)return null;function n(i,a){const l=t.map((c,u)=>u===a?i[0]:c);r(l),e.onChange(l)}function o(){const i=E3(e.item);r([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,a)=>s.jsx(A3,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>n(l,a)},i.id)),e.item.repeats&&s.jsx(Fe,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function A3(e){var i;const{response:t,checkForQuestionEnabled:r,onChange:n}=e;function o(a){var d;const l=(d=t.item)==null?void 0:d.map(p=>a.find(m=>m.id===p.id)??p),c=l==null?void 0:l.concat(a.slice(1)),u={...t,item:c};n([u])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(ue,{order:3,mb:"md",children:e.item.text}),s.jsx(be,{children:(i=e.item.item)==null?void 0:i.map(a=>{var l,c,u;return a.type===ut.group?a.repeats?s.jsx(N3,{item:a,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===a.linkId))??[],checkForQuestionEnabled:r,onChange:o},a.linkId):s.jsx(A3,{item:a,checkForQuestionEnabled:r,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===a.linkId))??{},onChange:o},a.linkId):s.jsx(D3,{item:a,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===a.linkId),onChange:o,checkForQuestionEnabled:r},a.linkId)})})]},e.item.linkId):null}function che(e){const{items:t,response:r,activePage:n,onChange:o,nextStep:i,prevStep:a,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,p=t.map(h=>{var v;const m=((v=r==null?void 0:r.item)==null?void 0:v.filter(_=>_.linkId===h.linkId))??[],g=h.type===ut.group?s.jsx(N3,{item:h,response:m,onChange:o,checkForQuestionEnabled:d},h.linkId):s.jsx(D3,{item:h,response:m==null?void 0:m[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?s.jsx(pc.Step,{label:h.text,children:g},h.linkId):g});return s.jsxs(s.Fragment,{children:[c&&s.jsx(pc,{active:n??0,allowNextStepsSelect:!1,p:6,children:p}),!c&&s.jsx(be,{children:p}),s.jsx(uhe,{activePage:n??0,numberOfPages:l,nextStep:i,prevStep:a,submitButtonText:u})]})}function uhe(e){const t=e.activePage>0,r=e.activePage<e.numberOfPages-1,n=e.activePage===e.numberOfPages-1;return s.jsxs(K,{position:"right",mt:"xl",spacing:"xs",children:[t&&s.jsx(re,{onClick:e.prevStep,children:"Back"}),r&&s.jsx(re,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),n&&s.jsx(re,{type:"submit",children:e.submitButtonText??"Submit"})]})}function M3(e){const t=ne(),r=t.getProfile(),[n,o]=f.useState(!1),i=et(e.questionnaire),[a,l]=f.useState(),[c,u]=f.useState(0);f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>{l(i?Fpe(i):void 0)},[i]);function d(v){const _=(a==null?void 0:a.item)??[],x={resourceType:"QuestionnaireResponse",item:L3(_,Array.isArray(v)?v:[v])};l(x)}function p(v){return Npe(v,(a==null?void 0:a.item)??[])}if(!n||!i)return null;const h=Hpe(i),m=()=>u(v=>v+1),g=()=>u(v=>v-1);return s.jsx($3.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(Ne,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&a&&e.onSubmit({...a,questionnaire:at(i),subject:e.subject,source:ht(r),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&s.jsx(ue,{children:i.title}),s.jsx(che,{items:i.item??[],response:a,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:p,nextStep:m,prevStep:g})]})})}function dhe(e,t){const r=L3(e.item??[],t.item??[]);return{...t,item:r.length>0?r:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function L3(e,t){const r=[],n=new Set;for(const o of e){const i=o.id,a=t.find(l=>l.id===i);a?(r.push(dhe(o,a)),n.add(a.id)):r.push(o)}for(const o of t)n.has(o.id)||r.push(o);return r}const fhe=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[3]}`,borderRadius:e.radius.sm,transition:"all 0.1s"}})),phe=["gender","age","gestationalAge","context","appliesTo","category"],hhe={definition:{resourceType:"ObservationDefinition"},onSubmit:()=>{}};function mhe(e){e=Object.assign(hhe,e);const t=e.definition,[r,n]=f.useState([]),[o,i]=f.useState(1),[a,l]=f.useState(1);return f.useEffect(()=>{const g=yhe(t,l);n(xhe(g.qualifiedInterval||[],i))},[t]),s.jsxs(Ne,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx(be,{children:r.map(g=>{var v;return s.jsx(ghe,{unit:bhe((v=t.quantitativeDetails)==null?void 0:v.unit),onChange:p,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:g},`group-${g.id}`)})}),s.jsx(yr,{title:"Add Group",size:"sm",onClick:g=>{Ze(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(v=>v+1)},children:s.jsx(mh,{})}),s.jsx(K,{position:"right",children:s.jsx(re,{type:"submit",children:"Save"})})]});function c(){const g=r.flatMap(v=>v.intervals).filter(v=>!_he(v));e.onSubmit({...t,qualifiedInterval:g})}function u(g){n(v=>[...v,g])}function d(g){n(v=>v.filter(_=>_.id!==g.id))}function p(g,v){n(_=>{_=[..._];const y=_.find(w=>w.id===g),x=y==null?void 0:y.intervals.findIndex(w=>w.id===v.id);return x!==void 0&&(y!=null&&y.intervals[x])&&(y.intervals[x]=v),_})}function h(g,v){v.id===void 0&&(v.id=`id-${a}`,l(_=>_+1)),n(_=>{_=[..._];const y=_.findIndex(x=>x.id===g);if(y!==-1){const x={..._[y]};v={...v,...x.filters},x.intervals=[...x.intervals,v],_[y]=x}return _})}function m(g,v){n(_=>{_=[..._];const y=_.find(x=>x.id===g);return y&&(y.intervals=y.intervals.filter(x=>x.id!==v.id)),_})}}function ghe(e){const{intervalGroup:t,unit:r}=e,{classes:n}=fhe();return s.jsx(qc,{"data-testid":t.id,className:n.section,children:s.jsxs(be,{spacing:"lg",children:[s.jsx(K,{position:"right",children:s.jsx(yr,{title:"Remove Group","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:o=>{Ze(o),e.onRemoveGroup(t)},children:s.jsx(hh,{})},`remove-group-button-${t.id}`)}),s.jsx(vhe,{intervalGroup:t,onChange:e.onChange}),s.jsx(mr,{}),t.intervals.map(o=>s.jsxs(be,{spacing:"xs",children:[s.jsxs(K,{children:[s.jsx(le,{"data-testid":`condition-${o.id}`,defaultValue:o.condition,label:"Condition: ",size:"sm",onChange:i=>{Ze(i),e.onChange(t.id,{...o,condition:i.currentTarget.value.trim()})}},`condition-${o.id}`),s.jsx(yr,{title:"Remove Interval",size:"sm","data-testid":`remove-interval-${o.id}`,onClick:i=>{Ze(i),e.onRemove(t.id,o)},children:s.jsx(hh,{})},`remove-interval-${o.id}`)]}),s.jsx(Zx,{onChange:i=>{e.onChange(t.id,{...o,range:i})},name:`range-${o.id}`,defaultValue:o.range},`range-${o.id}`)]},`interval-${o.id}`)),s.jsx(yr,{title:"Add Interval",size:"sm",onClick:o=>{Ze(o),e.onAdd(t.id,{range:{low:{unit:r},high:{unit:r}}})},children:s.jsx(mh,{})})]})})}function vhe(e){var n,o;const{intervalGroup:t,onChange:r}=e;t.filters.age||(t.filters.age={});for(const i of["low","high"])(n=t.filters.age[i])!=null&&n.unit||(t.filters.age[i]={...t.filters.age[i],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(be,{style:{maxWidth:"50%"},children:[s.jsx(K,{children:s.jsx(mt,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),r(t.id,{...a,gender:l})}}})}),s.jsxs(K,{spacing:"xs",children:[s.jsx(oe,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Zx,{name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const a of t.intervals)r(t.id,{...a,age:i})}},`age-${t.id}`)})]}),s.jsx(mt,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,r(t.id,{...a,context:void 0})):r(t.id,{...a,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(mt,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const a of t.intervals){const l=i.currentTarget.value;l===""?r(t.id,{...a,category:void 0}):r(t.id,{...a,category:l})}}})]})}function yhe(e,t){const r=e.qualifiedInterval||[];let n=Math.max(...r.map(o=>{var a;const i=parseInt(((a=o.id)==null?void 0:a.substring(3))||"",10);return isNaN(i)?Number.NEGATIVE_INFINITY:i}))+1;return Number.isFinite(n)||(n=1),e={...e,qualifiedInterval:r.map(o=>({...o,id:o.id||`id-${n++}`}))},t(n),e}function xhe(e,t){let r=1;const n={};for(const o of e){const i=whe(o);i in n||(n[i]={id:`group-id-${r++}`,filters:Object.fromEntries(phe.map(a=>[a,o[a]])),intervals:[]}),n[i].intervals.push(o)}return t(r),Object.values(n)}function whe(e){var r,n;return[`gender=${e.gender}`,`age=${hc(e.age)}`,`gestationalAge=${hc(e.gestationalAge)}`,`context=${(r=e.context)==null?void 0:r.text}`,`appliesTo=${(n=e.appliesTo)==null?void 0:n.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function bhe(e){return e&&(pae(e,"http://unitsofmeasure.org")||e.text)}function _he(e){var t,r,n,o;return((r=(t=e.range)==null?void 0:t.low)==null?void 0:r.value)===void 0&&((o=(n=e.range)==null?void 0:n.high)==null?void 0:o.value)===void 0}function She(e){var u;const t=ne(),r=et(e.value),[n,o]=f.useState(!1),[i,a]=f.useState();if(f.useEffect(()=>{r&&!n&&(t.executeBatch(l(r)).then(a).catch(console.log),o(!0))},[t,r,n]),!r||!i)return null;return s.jsx(ln,{children:(u=r.action)==null?void 0:u.map((d,p)=>{var v,_,y,x,w,b;const h=d.resource&&c(d.resource),m=(_=(v=h==null?void 0:h.input)==null?void 0:v[0])==null?void 0:_.valueReference,g=(x=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:x.valueReference;return s.jsxs(f.Fragment,{children:[s.jsx(ln.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(zce,{}):s.jsx(pue,{color:"gray"})}),s.jsxs(ln.Col,{span:9,p:"xs",children:[s.jsx(oe,{weight:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Gc,{value:(w=h==null?void 0:h.meta)==null?void 0:w.author})," on ",Nr((b=h==null?void 0:h.meta)==null?void 0:b.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(Z4,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(ln.Col,{span:2,p:"md",children:[m&&!g&&s.jsx(re,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&g&&s.jsx(re,{onClick:()=>e.onEdit(h,m,g),children:"Edit"})]})]},`action-${p}`)})});function l(d){var h;const p=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&p.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:p}}function c(d){for(const p of i==null?void 0:i.entry)if(p.resource&&d.reference===at(p.resource))return p.resource}}function z3(e,t){const r=Phe(e,t);return jhe(r,e,t)}function Phe(e,t){const r=e.length,n=t.length,o=r+n+1,i=1+2*o,a=i/2|0,l=new Array(i);l[a+1]={i:0,j:-1,prev:void 0,snake:!0};for(let c=0;c<o;c++){for(let u=-c;u<=c;u+=2){const d=a+u,p=d+1,h=d-1,m=l[p],g=l[h];let v,_=0;u===-c||u!==c&&g.i<m.i?(_=m.i,v=m):(_=g.i+1,v=g),l[h]=void 0;let y=_-u,x={i:_,j:y,prev:Ohe(v),snake:!1};for(;_<r&&y<n&&e[_]===t[y];)_++,y++;if(_>x.i&&(x={i:_,j:y,prev:x,snake:!0}),l[d]=x,_>=r&&y>=n)return l[d]}l[a+c-1]=void 0}}function jhe(e,t,r){const n=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const i=o.i,a=o.j;o=o.prev;const l=o.i,c=o.j,u={position:l,lines:t.slice(l,i)},d={position:c,lines:r.slice(c,a)};let p;u.lines.length===0&&d.lines.length>0?p="insert":u.lines.length>0&&d.lines.length===0?p="delete":p="change",n.push({original:u,revised:d,type:p}),o.snake&&(o=o.prev)}return n}function Ohe(e){return e&&!e.snake&&e.prev?e.prev:e}function Che(e){const t=e.entry.filter(n=>!!n.resource).map(n=>{var o;return{meta:(o=n.resource)==null?void 0:o.meta,lines:Dr(n.resource,!0).match(/[^\r\n]+/g)}}).sort((n,o)=>n.meta.lastUpdated.localeCompare(o.meta.lastUpdated)),r=t[0].lines.map(n=>({id:t[0].meta.versionId,meta:t[0].meta,value:n,span:1}));return Ehe(r,t),$he(r),r}function Ehe(e,t){for(let r=1;r<t.length;r++){const n=z3(t[r-1].lines,t[r].lines);for(const o of n){const i=o.original.position,a=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,a.length),o.type==="insert"||o.type==="change")for(let c=0;c<o.revised.lines.length;c++)e.splice(i+c,0,{id:t[r].meta.versionId,meta:t[r].meta,value:l[c],span:1})}}}function $he(e){let t=0;for(;t<e.length;){let r=t;for(;r<e.length&&e[r].id===e[t].id;)e[r].span=-1,r++;e[t].span=r-t,t=r}}function khe(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function Rhe(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),r=Math.floor(t/31536e3);if(r>0)return La(r,"year");const n=Math.floor(t/2592e3);if(n>0)return La(n,"month");const o=Math.floor(t/86400);if(o>0)return La(o,"day");const i=Math.floor(t/3600);if(i>0)return La(i,"hour");const a=Math.floor(t/60);return a>0?La(a,"minute"):La(t,"second")}function La(e,t){return`${e} ${e===1?t:t+"s"} ago`}const The=W(e=>({container:{overflowX:"auto"},root:{border:`0.1px solid ${e.colors.gray[3]}`,borderCollapse:"collapse",borderRadius:e.radius.sm,borderSpacing:0,fontSize:e.fontSizes.xs,width:"100%","& td":{padding:"2px 4px 0 4px",verticalAlign:"top",whiteSpace:"nowrap"}},startRow:{borderTop:`0.1px solid ${e.colors.gray[3]}`},normalRow:{borderTop:0},author:{lineHeight:"10px"},dateTime:{borderRight:`0.1px solid ${e.colors.gray[3]}`,lineHeight:"20px"},lineNumber:{backgroundColor:e.colors.gray[1],border:0,color:e.colors.gray[5],fontFamily:e.fontFamilyMonospace,padding:`${e.spacing.xs} ${e.spacing.sm}`,textAlign:"right"},line:{fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.sm,padding:`${e.spacing.xs} ${e.spacing.sm}`},pre:{margin:0}}));function Ihe(e){var l,c;const{classes:t}=The(),r=ne(),[n,o]=f.useState(e.history);if(f.useEffect(()=>{!e.history&&e.resourceType&&e.id&&r.readHistory(e.resourceType,e.id).then(o).catch(console.log)},[r,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const i=(c=(l=n.entry)==null?void 0:l[0])==null?void 0:c.resource;if(!i)return null;const a=Che(n);return s.jsx("div",{className:t.container,children:s.jsx("table",{className:t.root,children:s.jsx("tbody",{children:a.map((u,d)=>s.jsxs("tr",{className:u.span>0?t.startRow:t.normalRow,children:[u.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:t.author,rowSpan:u.span,children:s.jsx(ds,{value:u.meta.author,link:!0})}),s.jsx("td",{className:t.dateTime,rowSpan:u.span,children:s.jsx($e,{to:khe(i,u.meta.versionId),children:Rhe(u.meta.lastUpdated)})})]}),s.jsx("td",{className:t.lineNumber,children:d+1}),s.jsx("td",{className:t.line,children:s.jsx("pre",{className:t.pre,children:u.value})})]},"row-"+d))})})})}const Dhe=W(e=>({removed:{color:e.colors.red[7],textDecoration:"line-through"},added:{color:e.colors.green[7]}}));function Nhe(e){let t=e.original,r=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},r={...r,meta:void 0});const n=Dr(t,!0).match(/[^\r\n]+/g),o=Dr(r,!0).match(/[^\r\n]+/g),i=z3(n,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((a,l)=>s.jsx(Ahe,{delta:a},"delta"+l))})}function Ahe(e){const{classes:t}=Dhe();return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:t.removed,children:e.delta.original.lines.join(`
199
+ `)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:t.added,children:e.delta.revised.lines.join(`
200
+ `)}),"...",s.jsx("br",{})]})}function g1(e){const{outcome:t}=e,r=ne(),n=et(e.defaultValue),[o,i]=f.useState(),[a,l]=f.useState();return f.useEffect(()=>{if(n)if(l(ki(n)),e.profileUrl){const c=e.profileUrl;r.requestProfileSchema(e.profileUrl).then(()=>{const u=_m(c);u?i(u.name):console.log(`Schema not found for ${c}`)}).catch(console.log)}else{const c=e.schemaName??(n==null?void 0:n.resourceType);r.requestSchema(c).then(()=>i(c)).catch(console.log)}},[r,n,e.schemaName,e.profileUrl]),!o||!a?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:c=>{c.preventDefault(),e.onSubmit&&e.onSubmit(a)},children:[s.jsxs(be,{mb:"xl",children:[s.jsx(Je,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(le,{name:"resourceType",defaultValue:a.resourceType,disabled:!0})}),s.jsx(Je,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(le,{name:"id",defaultValue:a.id,disabled:!0})})]}),s.jsx(t1,{typeName:o,defaultValue:a,outcome:t,onChange:l,profileUrl:e.profileUrl}),s.jsxs(K,{position:"right",mt:"xl",children:[s.jsx(re,{type:"submit",children:"OK"}),e.onDelete&&s.jsx(re,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(a)},children:"Delete"})]})]})}function Mhe(e){var o;const t=ne(),[r,n]=f.useState(e.history);return f.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(n).catch(console.log)},[t,e.history,e.resourceType,e.id]),r?s.jsxs(wa,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Author"}),s.jsx("th",{children:"Date"}),s.jsx("th",{children:"Version"})]})}),s.jsx("tbody",{children:(o=r.entry)==null?void 0:o.map((i,a)=>s.jsx(Lhe,{entry:i},"entry-"+a))})]}):s.jsx("div",{children:"Loading..."})}function Lhe(e){var n,o,i;const{response:t,resource:r}=e.entry;return r?s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ds,{value:(n=r.meta)==null?void 0:n.author,link:!0})}),s.jsx("td",{children:Nr((o=r.meta)==null?void 0:o.lastUpdated)}),s.jsx("td",{children:s.jsx($e,{to:zhe(r),children:(i=r.meta)==null?void 0:i.versionId})})]}):s.jsx("tr",{children:s.jsx("td",{colSpan:3,children:je(t==null?void 0:t.outcome)})})}function zhe(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function Fhe(e){return s.jsx(Dm,{value:e.serviceRequest,loadTimelineResources:async(t,r,n)=>{const o=`${r}/${n}`,i=100;return Promise.allSettled([t.readHistory("ServiceRequest",n),t.search("Communication",{"based-on":o,_count:i}),t.search("DiagnosticReport",{"based-on":o,_count:i}),t.search("Media",{"based-on":o,_count:i}),t.search("DocumentReference",{related:o,_count:i}),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:i})])},createCommunication:(t,r,n)=>({resourceType:"Communication",status:"completed",basedOn:[ht(t)],subject:t.subject,sender:ht(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",basedOn:[ht(t)],subject:t.subject,operator:ht(r),issued:new Date().toISOString(),content:n})})}function Vhe(e){const t=ne(),{client:r,patient:n,encounter:o,children:i,...a}=e;function l(){t.createResource({resourceType:"SmartAppLaunch",patient:n,encounter:o}).then(c=>{const u=new URL(r.launchUri);u.searchParams.set("iss",t.getBaseUrl()+"fhir/R4"),u.searchParams.set("launch",c.id),window.location.assign(u.toString())}).catch(c=>de({color:"red",message:je(c),autoClose:!1}))}return s.jsx(Fe,{onClick:()=>l(),...a,children:i})}function F3(e){const t=ne(),[r,n]=f.useState();return s.jsxs(Ne,{style:{maxWidth:400},onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){n(lt(i))}},children:[s.jsxs(ar,{sx:{flexDirection:"column"},children:[s.jsx(Nn,{size:32}),s.jsx(ue,{children:"Create project"})]}),s.jsxs(be,{spacing:"xl",children:[s.jsx(le,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Ie(r,"firstName")}),s.jsxs(oe,{color:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Fe,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Fe,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"Create project"})})]})}function V3(e,t){const r=document.getElementsByTagName("head")[0],n=document.createElement("script");n.async=!0,n.src=e,n.onload=t??null,r.appendChild(n)}function B3(e){const t=ne(),{googleClientId:r,handleGoogleCredential:n}=e,o=f.useRef(null),[i,a]=f.useState(typeof google<"u"),[l,c]=f.useState(!1),[u,d]=f.useState(!1);return f.useEffect(()=>{if(typeof google>"u"){V3("https://accounts.google.com/gsi/client",()=>a(!0));return}l||(google.accounts.id.initialize({client_id:r,callback:n}),c(!0)),o.current&&!u&&(google.accounts.id.renderButton(o.current,{}),d(!0))},[t,r,l,i,o,u,n]),r?s.jsx("div",{ref:o}):null}var Bhe={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"2.2.6-f42e4a96",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function U3(e){var t;if(e)return e;if(typeof window<"u"){const r=window.location.protocol+"//"+window.location.host;if((((t=Bhe.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(r))return"__GOOGLE_CLIENT_ID__"}}function W3(e){typeof grecaptcha>"u"&&V3("https://www.google.com/recaptcha/api.js?render="+e)}function H3(e){return new Promise((t,r)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(n){r(n)}})})}function Uhe(e){const t=U3(e.googleClientId),r=e.recaptchaSiteKey,n=ne(),[o,i]=f.useState(),a=Rm(o,void 0);return f.useEffect(()=>{r&&W3(r)},[r]),s.jsxs(Ne,{style:{maxWidth:400},onSubmit:async l=>{try{let c="";r&&(c=await H3(r)),e.handleAuthResponse(await n.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:l.firstName,lastName:l.lastName,email:l.email,password:l.password,remember:l.remember==="true",recaptchaSiteKey:r,recaptchaToken:c}))}catch(c){i(lt(c))}},children:[s.jsx(ar,{sx:{flexDirection:"column"},children:e.children}),s.jsx(lo,{issues:a}),t&&s.jsxs(s.Fragment,{children:[s.jsx(K,{position:"center",p:"xl",style:{height:70},children:s.jsx(B3,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await n.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,createUser:!0}))}catch(c){i(lt(c))}}})}),s.jsx(mr,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(be,{spacing:"xl",children:[s.jsx(le,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Ie(o,"firstName")}),s.jsx(le,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Ie(o,"lastName")}),s.jsx(le,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Ie(o,"email")}),s.jsx(to,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Ie(o,"password")}),s.jsxs(oe,{color:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Fe,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Fe,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(oe,{color:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Fe,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Fe,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(K,{position:"apart",mt:"xl",noWrap:!0,children:[s.jsx(Tn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(re,{type:"submit",children:"Create account"})]})]})}function Whe(e){const{type:t,projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:i,onSuccess:a}=e,l=ne(),[c,u]=f.useState(),[d,p]=f.useState();f.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:r}).then(m=>l.processCode(m.code)).then(()=>a()).catch(m=>p(lt(m)))},[l,t,r,c,a]);function h(m){m.code?l.processCode(m.code).then(()=>a()).catch(console.log):m.login&&u(m.login)}return s.jsxs(we,{width:450,children:[d&&s.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&s.jsx(Uhe,{projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&s.jsx(F3,{login:c,handleAuthResponse:h})]})}function Hhe(e){const[t,r]=f.useState();return t?s.jsx(Ghe,{email:t,...e}):s.jsx(qhe,{setEmail:r,...e})}function qhe(e){const{setEmail:t,onRegister:r,handleAuthResponse:n,children:o,disableEmailAuth:i,...a}=e,l=ne(),c=!e.disableGoogleAuth&&U3(e.googleClientId),u=f.useCallback(async h=>{if(!h.authorizeUrl)return!1;const m=JSON.stringify({...await l.ensureCodeChallenge(a),domain:h.domain}),g=new URL(h.authorizeUrl);return g.searchParams.set("state",m),window.location.assign(g.toString()),!0},[l,a]),d=f.useCallback(async h=>{const m=await l.post("auth/method",{email:h.email});await u(m)||t(h.email)},[l,u,t]),p=f.useCallback(async h=>{const m=await l.startGoogleLogin({...a,googleCredential:h.credential});await u(m)||n(m)},[l,a,u,n]);return s.jsxs(Ne,{style:{maxWidth:400},onSubmit:d,children:[s.jsx(ar,{sx:{flexDirection:"column"},children:o}),c&&s.jsxs(s.Fragment,{children:[s.jsx(K,{position:"center",p:"xl",style:{height:70},children:s.jsx(B3,{googleClientId:c,handleGoogleCredential:p})}),!i&&s.jsx(mr,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&s.jsx(le,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0}),s.jsxs(K,{position:"apart",mt:"xl",spacing:0,noWrap:!0,children:[s.jsx("div",{children:r&&s.jsx(Fe,{component:"button",type:"button",color:"dimmed",onClick:r,size:"xs",children:"Register"})}),!i&&s.jsx(re,{type:"submit",children:"Next"})]})]})}function Ghe(e){const{onForgotPassword:t,handleAuthResponse:r,children:n,...o}=e,i=ne(),[a,l]=f.useState(),c=Rm(a,void 0),u=f.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(r).catch(p=>l(lt(p)))},[i,o,r]);return s.jsxs(Ne,{style:{maxWidth:400},onSubmit:u,children:[s.jsx(ar,{sx:{flexDirection:"column"},children:n}),s.jsx(lo,{issues:c}),s.jsx(be,{spacing:"xl",children:s.jsx(to,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Ie(a,"password")})}),s.jsxs(K,{position:"apart",mt:"xl",spacing:0,noWrap:!0,children:[t&&s.jsx(Fe,{component:"button",type:"button",color:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Tn,{id:"remember",name:"remember",label:"Remember me",size:"xs",sx:{lineHeight:1}}),s.jsx(re,{type:"submit",children:"Sign in"})]})]})}function Qhe(e){const t=ne(),[r,n]=f.useState();return s.jsxs(be,{children:[s.jsxs(ar,{sx:{flexDirection:"column"},children:[s.jsx(Nn,{size:32}),s.jsx(ue,{order:3,children:"Choose profile"})]}),s.jsx(lo,{outcome:r}),e.memberships.map(o=>{var i,a;return s.jsx(Po,{onClick:()=>{t.post("auth/profile",{login:e.login,profile:o.id}).then(e.handleAuthResponse).catch(l=>n(lt(l)))},children:s.jsxs(K,{children:[s.jsx(Mf,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(oe,{size:"sm",weight:500,children:(i=o.profile)==null?void 0:i.display}),s.jsx(oe,{color:"dimmed",size:"xs",children:(a=o.project)==null?void 0:a.display})]})]})},o.id)})]})}function Khe(e){const t=ne();return s.jsx(Ne,{style:{maxWidth:400},onSubmit:r=>{t.post("auth/scope",{login:e.login,scope:Object.keys(r).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(be,{children:[s.jsxs(ar,{sx:{flexDirection:"column"},children:[s.jsx(Nn,{size:32}),s.jsx(ue,{children:"Choose scope"})]}),s.jsx(be,{children:(e.scope??"openid").split(" ").map(r=>s.jsx(Tn,{id:r,name:r,label:r,defaultChecked:!0},r))}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Set scope"})})]})})}function Yhe(e){const t=ne(),[r,n]=f.useState();return s.jsx(Ne,{style:{maxWidth:400},onSubmit:o=>{n(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>n(je(i)))},children:s.jsxs(be,{children:[s.jsxs(ar,{sx:{flexDirection:"column"},children:[s.jsx(Nn,{size:32}),s.jsx(ue,{children:"Enter MFA code"})]}),r&&s.jsx(Rc,{icon:s.jsx(Om,{size:16}),title:"Error",color:"red",children:r}),s.jsx(be,{children:s.jsx(le,{name:"token",label:"MFA code",required:!0})}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Submit code"})})]})})}function q3(e){const{login:t,chooseScopes:r,onSuccess:n,onForgotPassword:o,onRegister:i,onCode:a,...l}=e,c=ne(),[u,d]=f.useState(),[p,h]=f.useState(!1),[m,g]=f.useState(),v=f.useCallback(x=>{a?a(x):c.processCode(x).then(()=>{n&&n()}).catch(w=>de({color:"red",message:je(w)}))},[c,a,n]),_=f.useCallback(x=>{h(!!x.mfaRequired),x.login&&d(x.login),x.memberships&&g(x.memberships),x.code&&(r?g(void 0):v(x.code))},[r,v]),y=f.useCallback(x=>{v(x.code)},[v]);return f.useEffect(()=>{t&&!u&&c.get("auth/login/"+t).then(_).catch(x=>de({color:"red",message:je(x)}))},[c,t,u,_]),s.jsx(we,{width:450,children:u?p?s.jsx(Yhe,{login:u,handleAuthResponse:_}):m?s.jsx(Qhe,{login:u,memberships:m,handleAuthResponse:_}):e.projectId==="new"?s.jsx(F3,{login:u,handleAuthResponse:_}):e.chooseScopes?s.jsx(Khe,{login:u,scope:e.scope,handleAuthResponse:y}):s.jsx("div",{children:"Success"}):s.jsx(Hhe,{onForgotPassword:o,onRegister:i,handleAuthResponse:_,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var G3,OC=Ms;G3=OC.createRoot,OC.hydrateRoot;/**
201
+ * @remix-run/router v1.13.1
202
+ *
203
+ * Copyright (c) Remix Software Inc.
204
+ *
205
+ * This source code is licensed under the MIT license found in the
206
+ * LICENSE.md file in the root directory of this source tree.
207
+ *
208
+ * @license MIT
209
+ */function Pt(){return Pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pt.apply(this,arguments)}var Ot;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ot||(Ot={}));const CC="popstate";function Xhe(e){e===void 0&&(e={});function t(n,o){let{pathname:i,search:a,hash:l}=n.location;return xc("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(n,o){return typeof o=="string"?o:Yc(o)}return Zhe(t,r,null,e)}function Ce(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Jhe(){return Math.random().toString(36).substr(2,8)}function EC(e,t){return{usr:e.state,key:e.key,idx:t}}function xc(e,t,r,n){return r===void 0&&(r=null),Pt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Bo(t):t,{state:r,key:t&&t.key||n||Jhe()})}function Yc(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Bo(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Zhe(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,a=o.history,l=Ot.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Pt({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function p(){l=Ot.Pop;let _=d(),y=_==null?null:_-u;u=_,c&&c({action:l,location:v.location,delta:y})}function h(_,y){l=Ot.Push;let x=xc(v.location,_,y);r&&r(x,_),u=d()+1;let w=EC(x,u),b=v.createHref(x);try{a.pushState(w,"",b)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;o.location.assign(b)}i&&c&&c({action:l,location:v.location,delta:1})}function m(_,y){l=Ot.Replace;let x=xc(v.location,_,y);r&&r(x,_),u=d();let w=EC(x,u),b=v.createHref(x);a.replaceState(w,"",b),i&&c&&c({action:l,location:v.location,delta:0})}function g(_){let y=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof _=="string"?_:Yc(_);return Ce(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let v={get action(){return l},get location(){return e(o,a)},listen(_){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(CC,p),c=_,()=>{o.removeEventListener(CC,p),c=null}},createHref(_){return t(o,_)},createURL:g,encodeLocation(_){let y=g(_);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:m,go(_){return a.go(_)}};return v}var Ct;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ct||(Ct={}));const eme=new Set(["lazy","caseSensitive","path","id","index","children"]);function tme(e){return e.index===!0}function ky(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((o,i)=>{let a=[...r,i],l=typeof o.id=="string"?o.id:a.join("-");if(Ce(o.index!==!0||!o.children,"Cannot specify children on an index route"),Ce(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),tme(o)){let c=Pt({},o,t(o),{id:l});return n[l]=c,c}else{let c=Pt({},o,t(o),{id:l,children:void 0});return n[l]=c,o.children&&(c.children=ky(o.children,t,a,n)),c}})}function ts(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?Bo(t):t,o=Xc(n.pathname||"/",r);if(o==null)return null;let i=Q3(e);nme(i);let a=null;for(let l=0;a==null&&l<i.length;++l)a=fme(i[l],mme(o));return a}function rme(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}function Q3(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let o=(i,a,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(Ce(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=xi([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&(Ce(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Q3(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:ume(u,i.index),routesMeta:d})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let c of K3(i.path))o(i,a,c)}),t}function K3(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return o?[i,""]:[i];let a=K3(n.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function nme(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:dme(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const ome=/^:\w+$/,ime=3,ame=2,sme=1,lme=10,cme=-2,$C=e=>e==="*";function ume(e,t){let r=e.split("/"),n=r.length;return r.some($C)&&(n+=cme),t&&(n+=ame),r.filter(o=>!$C(o)).reduce((o,i)=>o+(ome.test(i)?ime:i===""?sme:lme),n)}function dme(e,t){return e.length===t.length&&e.slice(0,-1).every((n,o)=>n===t[o])?e[e.length-1]-t[t.length-1]:0}function fme(e,t){let{routesMeta:r}=e,n={},o="/",i=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=pme({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u);if(!d)return null;Object.assign(n,d.params);let p=l.route;i.push({params:n,pathname:xi([o,d.pathname]),pathnameBase:xme(xi([o,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(o=xi([o,d.pathnameBase]))}return i}function pme(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=hme(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce((u,d,p)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let v=l[p]||"";a=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[p];return m&&!g?u[h]=void 0:u[h]=gme(g||"",h),u},{}),pathname:i,pathnameBase:a,pattern:e}}function hme(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),fa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(a,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function mme(e){try{return decodeURI(e)}catch(t){return fa(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function gme(e,t){try{return decodeURIComponent(e)}catch(r){return fa(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function Xc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function vme(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Bo(e):e;return{pathname:r?r.startsWith("/")?r:yme(r,t):t,search:wme(n),hash:bme(o)}}function yme(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Xg(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function v1(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Y3(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Bo(e):(o=Pt({},e),Ce(!o.pathname||!o.pathname.includes("?"),Xg("?","pathname","search",o)),Ce(!o.pathname||!o.pathname.includes("#"),Xg("#","pathname","hash",o)),Ce(!o.search||!o.search.includes("#"),Xg("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(a==null)l=r;else if(n){let p=t[t.length-1].replace(/^\//,"").split("/");if(a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),p.pop();o.pathname=h.join("/")}l="/"+p.join("/")}else{let p=t.length-1;if(a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),p-=1;o.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=vme(o,l),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const xi=e=>e.join("/").replace(/\/\/+/g,"/"),xme=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wme=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,bme=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class y1{constructor(t,r,n,o){o===void 0&&(o=!1),this.status=t,this.statusText=r||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function X3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const J3=["post","put","patch","delete"],_me=new Set(J3),Sme=["get",...J3],Pme=new Set(Sme),jme=new Set([301,302,303,307,308]),Ome=new Set([307,308]),Jg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Cme={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Z3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Eme=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),eA="remix-router-transitions";function $me(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;Ce(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let D=e.detectErrorBoundary;o=z=>({hasErrorBoundary:D(z)})}else o=Eme;let i={},a=ky(e.routes,o,void 0,i),l,c=e.basename||"/",u=Pt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),d=null,p=new Set,h=null,m=null,g=null,v=e.hydrationData!=null,_=ts(a,e.history.location,c),y=null;if(_==null){let D=nn(404,{pathname:e.history.location.pathname}),{matches:z,route:U}=MC(a);_=z,y={[U.id]:D}}let x=!_.some(D=>D.route.lazy)&&(!_.some(D=>D.route.loader)||e.hydrationData!=null),w,b={historyAction:e.history.action,location:e.history.location,matches:_,initialized:x,navigation:Jg,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||y,fetchers:new Map,blockers:new Map},j=Ot.Pop,C=!1,P,E=!1,k=new Map,$=null,I=!1,R=!1,N=[],M=[],L=new Map,Q=0,G=-1,T=new Map,F=new Set,V=new Map,X=new Map,J=new Set,_e=new Map,Se=new Map,Xe=!1;function Le(){if(d=e.history.listen(D=>{let{action:z,location:U,delta:Y}=D;if(Xe){Xe=!1;return}fa(Se.size===0||Y!=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 te=Ln({currentLocation:b.location,nextLocation:U,historyAction:z});if(te&&Y!=null){Xe=!0,e.history.go(Y*-1),Mn(te,{state:"blocked",location:U,proceed(){Mn(te,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),e.history.go(Y)},reset(){let ge=new Map(b.blockers);ge.set(te,gl),ke({blockers:ge})}});return}return Gt(z,U)}),r){Fme(t,k);let D=()=>Vme(t,k);t.addEventListener("pagehide",D),$=()=>t.removeEventListener("pagehide",D)}return b.initialized||Gt(Ot.Pop,b.location),w}function gt(){d&&d(),$&&$(),p.clear(),P&&P.abort(),b.fetchers.forEach((D,z)=>me(z)),b.blockers.forEach((D,z)=>Wo(z))}function Nt(D){return p.add(D),()=>p.delete(D)}function ke(D,z){z===void 0&&(z={}),b=Pt({},b,D);let U=[],Y=[];u.v7_fetcherPersist&&b.fetchers.forEach((te,ge)=>{te.state==="idle"&&(J.has(ge)?Y.push(ge):U.push(ge))}),[...p].forEach(te=>te(b,{deletedFetchers:Y,unstable_viewTransitionOpts:z.viewTransitionOpts,unstable_flushSync:z.flushSync===!0})),u.v7_fetcherPersist&&(U.forEach(te=>b.fetchers.delete(te)),Y.forEach(te=>me(te)))}function qt(D,z,U){var Y,te;let{flushSync:ge}=U===void 0?{}:U,xe=b.actionData!=null&&b.navigation.formMethod!=null&&Pn(b.navigation.formMethod)&&b.navigation.state==="loading"&&((Y=D.state)==null?void 0:Y._isRedirect)!==!0,he;z.actionData?Object.keys(z.actionData).length>0?he=z.actionData:he=null:xe?he=b.actionData:he=null;let pe=z.loaderData?AC(b.loaderData,z.loaderData,z.matches||[],z.errors):b.loaderData,Re=b.blockers;Re.size>0&&(Re=new Map(Re),Re.forEach((Ke,rt)=>Re.set(rt,gl)));let Qe=C===!0||b.navigation.formMethod!=null&&Pn(b.navigation.formMethod)&&((te=D.state)==null?void 0:te._isRedirect)!==!0;l&&(a=l,l=void 0),I||j===Ot.Pop||(j===Ot.Push?e.history.push(D,D.state):j===Ot.Replace&&e.history.replace(D,D.state));let Oe;if(j===Ot.Pop){let Ke=k.get(b.location.pathname);Ke&&Ke.has(D.pathname)?Oe={currentLocation:b.location,nextLocation:D}:k.has(D.pathname)&&(Oe={currentLocation:D,nextLocation:b.location})}else if(E){let Ke=k.get(b.location.pathname);Ke?Ke.add(D.pathname):(Ke=new Set([D.pathname]),k.set(b.location.pathname,Ke)),Oe={currentLocation:b.location,nextLocation:D}}ke(Pt({},z,{actionData:he,loaderData:pe,historyAction:j,location:D,initialized:!0,navigation:Jg,revalidation:"idle",restoreScrollPosition:ja(D,z.matches||b.matches),preventScrollReset:Qe,blockers:Re}),{viewTransitionOpts:Oe,flushSync:ge===!0}),j=Ot.Pop,C=!1,E=!1,I=!1,R=!1,N=[],M=[]}async function zr(D,z){if(typeof D=="number"){e.history.go(D);return}let U=Ry(b.location,b.matches,c,u.v7_prependBasename,D,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:Y,submission:te,error:ge}=kC(u.v7_normalizeFormMethod,!1,U,z),xe=b.location,he=xc(b.location,Y,z&&z.state);he=Pt({},he,e.history.encodeLocation(he));let pe=z&&z.replace!=null?z.replace:void 0,Re=Ot.Push;pe===!0?Re=Ot.Replace:pe===!1||te!=null&&Pn(te.formMethod)&&te.formAction===b.location.pathname+b.location.search&&(Re=Ot.Replace);let Qe=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Oe=(z&&z.unstable_flushSync)===!0,Ke=Ln({currentLocation:xe,nextLocation:he,historyAction:Re});if(Ke){Mn(Ke,{state:"blocked",location:he,proceed(){Mn(Ke,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),zr(D,z)},reset(){let rt=new Map(b.blockers);rt.set(Ke,gl),ke({blockers:rt})}});return}return await Gt(Re,he,{submission:te,pendingError:ge,preventScrollReset:Qe,replace:z&&z.replace,enableViewTransition:z&&z.unstable_viewTransition,flushSync:Oe})}function cr(){if(Di(),ke({revalidation:"loading"}),b.navigation.state!=="submitting"){if(b.navigation.state==="idle"){Gt(b.historyAction,b.location,{startUninterruptedRevalidation:!0});return}Gt(j||b.historyAction,b.navigation.location,{overrideNavigation:b.navigation})}}async function Gt(D,z,U){P&&P.abort(),P=null,j=D,I=(U&&U.startUninterruptedRevalidation)===!0,Ho(b.location,b.matches),C=(U&&U.preventScrollReset)===!0,E=(U&&U.enableViewTransition)===!0;let Y=l||a,te=U&&U.overrideNavigation,ge=ts(Y,z,c),xe=(U&&U.flushSync)===!0;if(!ge){let rt=nn(404,{pathname:z.pathname}),{matches:Tt,route:Vr}=MC(Y);po(),qt(z,{matches:Tt,loaderData:{},errors:{[Vr.id]:rt}},{flushSync:xe});return}if(b.initialized&&!R&&Dme(b.location,z)&&!(U&&U.submission&&Pn(U.submission.formMethod))){qt(z,{matches:ge},{flushSync:xe});return}P=new AbortController;let he=yl(e.history,z,P.signal,U&&U.submission),pe,Re;if(U&&U.pendingError)Re={[Ul(ge).route.id]:U.pendingError};else if(U&&U.submission&&Pn(U.submission.formMethod)){let rt=await At(he,z,U.submission,ge,{replace:U.replace,flushSync:xe});if(rt.shortCircuited)return;pe=rt.pendingActionData,Re=rt.pendingActionError,te=Zg(z,U.submission),xe=!1,he=new Request(he.url,{signal:he.signal})}let{shortCircuited:Qe,loaderData:Oe,errors:Ke}=await co(he,z,ge,te,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,xe,pe,Re);Qe||(P=null,qt(z,Pt({matches:ge},pe?{actionData:pe}:{},{loaderData:Oe,errors:Ke})))}async function At(D,z,U,Y,te){te===void 0&&(te={}),Di();let ge=Lme(z,U);ke({navigation:ge},{flushSync:te.flushSync===!0});let xe,he=Iy(Y,z);if(!he.route.action&&!he.route.lazy)xe={type:Ct.error,error:nn(405,{method:D.method,pathname:z.pathname,routeId:he.route.id})};else if(xe=await vl("action",D,he,Y,i,o,c),D.signal.aborted)return{shortCircuited:!0};if(fs(xe)){let pe;return te&&te.replace!=null?pe=te.replace:pe=xe.location===b.location.pathname+b.location.search,await Sr(b,xe,{submission:U,replace:pe}),{shortCircuited:!0}}if(Wl(xe)){let pe=Ul(Y,he.route.id);return(te&&te.replace)!==!0&&(j=Ot.Push),{pendingActionData:{},pendingActionError:{[pe.route.id]:xe.error}}}if(Xi(xe))throw nn(400,{type:"defer-action"});return{pendingActionData:{[he.route.id]:xe.data}}}async function co(D,z,U,Y,te,ge,xe,he,pe,Re){let Qe=Y||Zg(z,te),Oe=te||ge||FC(Qe),Ke=l||a,[rt,Tt]=RC(e.history,b,U,Oe,z,R,N,M,J,V,F,Ke,c,pe,Re);if(po(Ye=>!(U&&U.some(Pr=>Pr.route.id===Ye))||rt&&rt.some(Pr=>Pr.route.id===Ye)),G=++Q,rt.length===0&&Tt.length===0){let Ye=An();return qt(z,Pt({matches:U,loaderData:{},errors:Re||null},pe?{actionData:pe}:{},Ye?{fetchers:new Map(b.fetchers)}:{}),{flushSync:he}),{shortCircuited:!0}}if(!I){Tt.forEach(Pr=>{let Ee=b.fetchers.get(Pr.key),pr=xl(void 0,Ee?Ee.data:void 0);b.fetchers.set(Pr.key,pr)});let Ye=pe||b.actionData;ke(Pt({navigation:Qe},Ye?Object.keys(Ye).length===0?{actionData:null}:{actionData:Ye}:{},Tt.length>0?{fetchers:new Map(b.fetchers)}:{}),{flushSync:he})}Tt.forEach(Ye=>{L.has(Ye.key)&&Ue(Ye.key),Ye.controller&&L.set(Ye.key,Ye.controller)});let Vr=()=>Tt.forEach(Ye=>Ue(Ye.key));P&&P.signal.addEventListener("abort",Vr);let{results:Ai,loaderResults:Oa,fetcherResults:zn}=await ur(b.matches,U,rt,Tt,D);if(D.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",Vr),Tt.forEach(Ye=>L.delete(Ye.key));let Br=LC(Ai);if(Br){if(Br.idx>=rt.length){let Ye=Tt[Br.idx-rt.length].key;F.add(Ye)}return await Sr(b,Br.result,{replace:xe}),{shortCircuited:!0}}let{loaderData:qo,errors:nt}=NC(b,U,rt,Oa,Re,Tt,zn,_e);_e.forEach((Ye,Pr)=>{Ye.subscribe(Ee=>{(Ee||Ye.done)&&_e.delete(Pr)})});let Fn=An(),fr=yn(G),ho=Fn||fr||Tt.length>0;return Pt({loaderData:qo,errors:nt},ho?{fetchers:new Map(b.fetchers)}:{})}function Uo(D,z,U,Y){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");L.has(D)&&Ue(D);let te=(Y&&Y.unstable_flushSync)===!0,ge=l||a,xe=Ry(b.location,b.matches,c,u.v7_prependBasename,U,z,Y==null?void 0:Y.relative),he=ts(ge,xe,c);if(!he){fo(D,z,nn(404,{pathname:xe}),{flushSync:te});return}let{path:pe,submission:Re,error:Qe}=kC(u.v7_normalizeFormMethod,!0,xe,Y);if(Qe){fo(D,z,Qe,{flushSync:te});return}let Oe=Iy(he,pe);if(C=(Y&&Y.preventScrollReset)===!0,Re&&Pn(Re.formMethod)){tt(D,z,pe,Oe,he,te,Re);return}V.set(D,{routeId:z,path:pe}),uo(D,z,pe,Oe,he,te,Re)}async function tt(D,z,U,Y,te,ge,xe){if(Di(),V.delete(D),!Y.route.action&&!Y.route.lazy){let Ee=nn(405,{method:xe.formMethod,pathname:U,routeId:z});fo(D,z,Ee,{flushSync:ge});return}let he=b.fetchers.get(D);en(D,zme(xe,he),{flushSync:ge});let pe=new AbortController,Re=yl(e.history,U,pe.signal,xe);L.set(D,pe);let Qe=Q,Oe=await vl("action",Re,Y,te,i,o,c);if(Re.signal.aborted){L.get(D)===pe&&L.delete(D);return}if(J.has(D)){en(D,Jo(void 0));return}if(fs(Oe))if(L.delete(D),G>Qe){en(D,Jo(void 0));return}else return F.add(D),en(D,xl(xe)),Sr(b,Oe,{fetcherSubmission:xe});if(Wl(Oe)){fo(D,z,Oe.error);return}if(Xi(Oe))throw nn(400,{type:"defer-action"});let Ke=b.navigation.location||b.location,rt=yl(e.history,Ke,pe.signal),Tt=l||a,Vr=b.navigation.state!=="idle"?ts(Tt,b.navigation.location,c):b.matches;Ce(Vr,"Didn't find any matches after fetcher action");let Ai=++Q;T.set(D,Ai);let Oa=xl(xe,Oe.data);b.fetchers.set(D,Oa);let[zn,Br]=RC(e.history,b,Vr,xe,Ke,R,N,M,J,V,F,Tt,c,{[Y.route.id]:Oe.data},void 0);Br.filter(Ee=>Ee.key!==D).forEach(Ee=>{let pr=Ee.key,qs=b.fetchers.get(pr),Ca=xl(void 0,qs?qs.data:void 0);b.fetchers.set(pr,Ca),L.has(pr)&&Ue(pr),Ee.controller&&L.set(pr,Ee.controller)}),ke({fetchers:new Map(b.fetchers)});let qo=()=>Br.forEach(Ee=>Ue(Ee.key));pe.signal.addEventListener("abort",qo);let{results:nt,loaderResults:Fn,fetcherResults:fr}=await ur(b.matches,Vr,zn,Br,rt);if(pe.signal.aborted)return;pe.signal.removeEventListener("abort",qo),T.delete(D),L.delete(D),Br.forEach(Ee=>L.delete(Ee.key));let ho=LC(nt);if(ho){if(ho.idx>=zn.length){let Ee=Br[ho.idx-zn.length].key;F.add(Ee)}return Sr(b,ho.result)}let{loaderData:Ye,errors:Pr}=NC(b,b.matches,zn,Fn,void 0,Br,fr,_e);if(b.fetchers.has(D)){let Ee=Jo(Oe.data);b.fetchers.set(D,Ee)}yn(Ai),b.navigation.state==="loading"&&Ai>G?(Ce(j,"Expected pending action"),P&&P.abort(),qt(b.navigation.location,{matches:Vr,loaderData:Ye,errors:Pr,fetchers:new Map(b.fetchers)})):(ke({errors:Pr,loaderData:AC(b.loaderData,Ye,Vr,Pr),fetchers:new Map(b.fetchers)}),R=!1)}async function uo(D,z,U,Y,te,ge,xe){let he=b.fetchers.get(D);en(D,xl(xe,he?he.data:void 0),{flushSync:ge});let pe=new AbortController,Re=yl(e.history,U,pe.signal);L.set(D,pe);let Qe=Q,Oe=await vl("loader",Re,Y,te,i,o,c);if(Xi(Oe)&&(Oe=await nA(Oe,Re.signal,!0)||Oe),L.get(D)===pe&&L.delete(D),!Re.signal.aborted){if(J.has(D)){en(D,Jo(void 0));return}if(fs(Oe))if(G>Qe){en(D,Jo(void 0));return}else{F.add(D),await Sr(b,Oe);return}if(Wl(Oe)){fo(D,z,Oe.error);return}Ce(!Xi(Oe),"Unhandled fetcher deferred data"),en(D,Jo(Oe.data))}}async function Sr(D,z,U){let{submission:Y,fetcherSubmission:te,replace:ge}=U===void 0?{}:U;z.revalidate&&(R=!0);let xe=xc(D.location,z.location,{_isRedirect:!0});if(Ce(xe,"Expected a location on the redirect navigation"),r){let Ke=!1;if(z.reloadDocument)Ke=!0;else if(Z3.test(z.location)){const rt=e.history.createURL(z.location);Ke=rt.origin!==t.location.origin||Xc(rt.pathname,c)==null}if(Ke){ge?t.location.replace(z.location):t.location.assign(z.location);return}}P=null;let he=ge===!0?Ot.Replace:Ot.Push,{formMethod:pe,formAction:Re,formEncType:Qe}=D.navigation;!Y&&!te&&pe&&Re&&Qe&&(Y=FC(D.navigation));let Oe=Y||te;if(Ome.has(z.status)&&Oe&&Pn(Oe.formMethod))await Gt(he,xe,{submission:Pt({},Oe,{formAction:z.location}),preventScrollReset:C});else{let Ke=Zg(xe,Y);await Gt(he,xe,{overrideNavigation:Ke,fetcherSubmission:te,preventScrollReset:C})}}async function ur(D,z,U,Y,te){let ge=await Promise.all([...U.map(pe=>vl("loader",te,pe,z,i,o,c)),...Y.map(pe=>pe.matches&&pe.match&&pe.controller?vl("loader",yl(e.history,pe.path,pe.controller.signal),pe.match,pe.matches,i,o,c):{type:Ct.error,error:nn(404,{pathname:pe.path})})]),xe=ge.slice(0,U.length),he=ge.slice(U.length);return await Promise.all([zC(D,U,xe,xe.map(()=>te.signal),!1,b.loaderData),zC(D,Y.map(pe=>pe.match),he,Y.map(pe=>pe.controller?pe.controller.signal:null),!0)]),{results:ge,loaderResults:xe,fetcherResults:he}}function Di(){R=!0,N.push(...po()),V.forEach((D,z)=>{L.has(z)&&(M.push(z),Ue(z))})}function en(D,z,U){U===void 0&&(U={}),b.fetchers.set(D,z),ke({fetchers:new Map(b.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function fo(D,z,U,Y){Y===void 0&&(Y={});let te=Ul(b.matches,z);me(D),ke({errors:{[te.route.id]:U},fetchers:new Map(b.fetchers)},{flushSync:(Y&&Y.flushSync)===!0})}function ee(D){return u.v7_fetcherPersist&&(X.set(D,(X.get(D)||0)+1),J.has(D)&&J.delete(D)),b.fetchers.get(D)||Cme}function me(D){let z=b.fetchers.get(D);L.has(D)&&!(z&&z.state==="loading"&&T.has(D))&&Ue(D),V.delete(D),T.delete(D),F.delete(D),J.delete(D),b.fetchers.delete(D)}function ft(D){if(u.v7_fetcherPersist){let z=(X.get(D)||0)-1;z<=0?(X.delete(D),J.add(D)):X.set(D,z)}else me(D);ke({fetchers:new Map(b.fetchers)})}function Ue(D){let z=L.get(D);Ce(z,"Expected fetch controller: "+D),z.abort(),L.delete(D)}function bt(D){for(let z of D){let U=ee(z),Y=Jo(U.data);b.fetchers.set(z,Y)}}function An(){let D=[],z=!1;for(let U of F){let Y=b.fetchers.get(U);Ce(Y,"Expected fetcher: "+U),Y.state==="loading"&&(F.delete(U),D.push(U),z=!0)}return bt(D),z}function yn(D){let z=[];for(let[U,Y]of T)if(Y<D){let te=b.fetchers.get(U);Ce(te,"Expected fetcher: "+U),te.state==="loading"&&(Ue(U),T.delete(U),z.push(U))}return bt(z),z.length>0}function Fr(D,z){let U=b.blockers.get(D)||gl;return Se.get(D)!==z&&Se.set(D,z),U}function Wo(D){b.blockers.delete(D),Se.delete(D)}function Mn(D,z){let U=b.blockers.get(D)||gl;Ce(U.state==="unblocked"&&z.state==="blocked"||U.state==="blocked"&&z.state==="blocked"||U.state==="blocked"&&z.state==="proceeding"||U.state==="blocked"&&z.state==="unblocked"||U.state==="proceeding"&&z.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+z.state);let Y=new Map(b.blockers);Y.set(D,z),ke({blockers:Y})}function Ln(D){let{currentLocation:z,nextLocation:U,historyAction:Y}=D;if(Se.size===0)return;Se.size>1&&fa(!1,"A router only supports one blocker at a time");let te=Array.from(Se.entries()),[ge,xe]=te[te.length-1],he=b.blockers.get(ge);if(!(he&&he.state==="proceeding")&&xe({currentLocation:z,nextLocation:U,historyAction:Y}))return ge}function po(D){let z=[];return _e.forEach((U,Y)=>{(!D||D(Y))&&(U.cancel(),z.push(Y),_e.delete(Y))}),z}function Ni(D,z,U){if(h=D,g=z,m=U||null,!v&&b.navigation===Jg){v=!0;let Y=ja(b.location,b.matches);Y!=null&&ke({restoreScrollPosition:Y})}return()=>{h=null,g=null,m=null}}function dr(D,z){return m&&m(D,z.map(Y=>rme(Y,b.loaderData)))||D.key}function Ho(D,z){if(h&&g){let U=dr(D,z);h[U]=g()}}function ja(D,z){if(h){let U=dr(D,z),Y=h[U];if(typeof Y=="number")return Y}return null}function Wm(D){i={},l=ky(D,o,void 0,i)}return w={get basename(){return c},get state(){return b},get routes(){return a},get window(){return t},initialize:Le,subscribe:Nt,enableScrollRestoration:Ni,navigate:zr,fetch:Uo,revalidate:cr,createHref:D=>e.history.createHref(D),encodeLocation:D=>e.history.encodeLocation(D),getFetcher:ee,deleteFetcher:ft,dispose:gt,getBlocker:Fr,deleteBlocker:Wo,_internalFetchControllers:L,_internalActiveDeferreds:_e,_internalSetRoutes:Wm},w}function kme(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ry(e,t,r,n,o,i,a){let l,c;if(i){l=[];for(let d of t)if(l.push(d),d.route.id===i){c=d;break}}else l=t,c=t[t.length-1];let u=Y3(o||".",v1(l).map(d=>d.pathnameBase),Xc(e.pathname,r)||e.pathname,a==="path");return o==null&&(u.search=e.search,u.hash=e.hash),(o==null||o===""||o===".")&&c&&c.route.index&&!x1(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(u.pathname=u.pathname==="/"?r:xi([r,u.pathname])),Yc(u)}function kC(e,t,r,n){if(!n||!kme(n))return{path:r};if(n.formMethod&&!Mme(n.formMethod))return{path:r,error:nn(405,{method:n.formMethod})};let o=()=>({path:r,error:nn(400,{type:"invalid-body"})}),i=n.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=rA(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Pn(a))return o();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,g)=>{let[v,_]=g;return""+m+v+"="+_+`
210
+ `},""):String(n.body);return{path:r,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!Pn(a))return o();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}Ce(typeof FormData=="function","FormData is not available in this environment");let c,u;if(n.formData)c=Ty(n.formData),u=n.formData;else if(n.body instanceof FormData)c=Ty(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=DC(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=DC(c)}catch{return o()}let d={formMethod:a,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Pn(d.formMethod))return{path:r,submission:d};let p=Bo(r);return t&&p.search&&x1(p.search)&&c.append("index",""),p.search="?"+c,{path:Yc(p),submission:d}}function Rme(e,t){let r=e;if(t){let n=e.findIndex(o=>o.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function RC(e,t,r,n,o,i,a,l,c,u,d,p,h,m,g){let v=g?Object.values(g)[0]:m?Object.values(m)[0]:void 0,_=e.createURL(t.location),y=e.createURL(o),x=g?Object.keys(g)[0]:void 0,b=Rme(r,x).filter((C,P)=>{if(C.route.lazy)return!0;if(C.route.loader==null)return!1;if(Tme(t.loaderData,t.matches[P],C)||a.some($=>$===C.route.id))return!0;let E=t.matches[P],k=C;return TC(C,Pt({currentUrl:_,currentParams:E.params,nextUrl:y,nextParams:k.params},n,{actionResult:v,defaultShouldRevalidate:i||_.pathname+_.search===y.pathname+y.search||_.search!==y.search||tA(E,k)}))}),j=[];return u.forEach((C,P)=>{if(!r.some(R=>R.route.id===C.routeId)||c.has(P))return;let E=ts(p,C.path,h);if(!E){j.push({key:P,routeId:C.routeId,path:C.path,matches:null,match:null,controller:null});return}let k=t.fetchers.get(P),$=Iy(E,C.path),I=!1;d.has(P)?I=!1:l.includes(P)?I=!0:k&&k.state!=="idle"&&k.data===void 0?I=i:I=TC($,Pt({currentUrl:_,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:i})),I&&j.push({key:P,routeId:C.routeId,path:C.path,matches:E,match:$,controller:new AbortController})}),[b,j]}function Tme(e,t,r){let n=!t||r.route.id!==t.route.id,o=e[r.route.id]===void 0;return n||o}function tA(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function TC(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function IC(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let o=r[e.id];Ce(o,"No route found in manifest");let i={};for(let a in n){let c=o[a]!==void 0&&a!=="hasErrorBoundary";fa(!c,'Route "'+o.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!c&&!eme.has(a)&&(i[a]=n[a])}Object.assign(o,i),Object.assign(o,Pt({},t(o),{lazy:void 0}))}async function vl(e,t,r,n,o,i,a,l){l===void 0&&(l={});let c,u,d,p=g=>{let v,_=new Promise((y,x)=>v=x);return d=()=>v(),t.signal.addEventListener("abort",d),Promise.race([g({request:t,params:r.params,context:l.requestContext}),_])};try{let g=r.route[e];if(r.route.lazy)if(g){let v,_=await Promise.all([p(g).catch(y=>{v=y}),IC(r.route,i,o)]);if(v)throw v;u=_[0]}else if(await IC(r.route,i,o),g=r.route[e],g)u=await p(g);else if(e==="action"){let v=new URL(t.url),_=v.pathname+v.search;throw nn(405,{method:t.method,pathname:_,routeId:r.route.id})}else return{type:Ct.data,data:void 0};else if(g)u=await p(g);else{let v=new URL(t.url),_=v.pathname+v.search;throw nn(404,{pathname:_})}Ce(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(g){c=Ct.error,u=g}finally{d&&t.signal.removeEventListener("abort",d)}if(Ame(u)){let g=u.status;if(jme.has(g)){let y=u.headers.get("Location");if(Ce(y,"Redirects returned/thrown from loaders/actions must have a Location header"),!Z3.test(y))y=Ry(new URL(t.url),n.slice(0,n.indexOf(r)+1),a,!0,y);else if(!l.isStaticRequest){let x=new URL(t.url),w=y.startsWith("//")?new URL(x.protocol+y):new URL(y),b=Xc(w.pathname,a)!=null;w.origin===x.origin&&b&&(y=w.pathname+w.search+w.hash)}if(l.isStaticRequest)throw u.headers.set("Location",y),u;return{type:Ct.redirect,status:g,location:y,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===Ct.error?Ct.error:Ct.data,response:u};let v,_=u.headers.get("Content-Type");return _&&/\bapplication\/json\b/.test(_)?v=await u.json():v=await u.text(),c===Ct.error?{type:c,error:new y1(g,u.statusText,v),headers:u.headers}:{type:Ct.data,data:v,statusCode:u.status,headers:u.headers}}if(c===Ct.error)return{type:c,error:u};if(Nme(u)){var h,m;return{type:Ct.deferred,deferredData:u,statusCode:(h=u.init)==null?void 0:h.status,headers:((m=u.init)==null?void 0:m.headers)&&new Headers(u.init.headers)}}return{type:Ct.data,data:u}}function yl(e,t,r,n){let o=e.createURL(rA(t)).toString(),i={signal:r};if(n&&Pn(n.formMethod)){let{formMethod:a,formEncType:l}=n;i.method=a.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(n.json)):l==="text/plain"?i.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?i.body=Ty(n.formData):i.body=n.formData}return new Request(o,i)}function Ty(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function DC(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Ime(e,t,r,n,o){let i={},a=null,l,c=!1,u={};return r.forEach((d,p)=>{let h=t[p].route.id;if(Ce(!fs(d),"Cannot handle redirect results in processLoaderData"),Wl(d)){let m=Ul(e,h),g=d.error;n&&(g=Object.values(n)[0],n=void 0),a=a||{},a[m.route.id]==null&&(a[m.route.id]=g),i[h]=void 0,c||(c=!0,l=X3(d.error)?d.error.status:500),d.headers&&(u[h]=d.headers)}else Xi(d)?(o.set(h,d.deferredData),i[h]=d.deferredData.data):i[h]=d.data,d.statusCode!=null&&d.statusCode!==200&&!c&&(l=d.statusCode),d.headers&&(u[h]=d.headers)}),n&&(a=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:u}}function NC(e,t,r,n,o,i,a,l){let{loaderData:c,errors:u}=Ime(t,r,n,o,l);for(let d=0;d<i.length;d++){let{key:p,match:h,controller:m}=i[d];Ce(a!==void 0&&a[d]!==void 0,"Did not find corresponding fetcher result");let g=a[d];if(!(m&&m.signal.aborted))if(Wl(g)){let v=Ul(e.matches,h==null?void 0:h.route.id);u&&u[v.route.id]||(u=Pt({},u,{[v.route.id]:g.error})),e.fetchers.delete(p)}else if(fs(g))Ce(!1,"Unhandled fetcher revalidation redirect");else if(Xi(g))Ce(!1,"Unhandled fetcher deferred data");else{let v=Jo(g.data);e.fetchers.set(p,v)}}return{loaderData:c,errors:u}}function AC(e,t,r,n){let o=Pt({},t);for(let i of r){let a=i.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(o[a]=t[a]):e[a]!==void 0&&i.route.loader&&(o[a]=e[a]),n&&n.hasOwnProperty(a))break}return o}function Ul(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function MC(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function nn(e,t){let{pathname:r,routeId:n,method:o,type:i}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(a="Not Found",l='No route matches URL "'+r+'"'):e===405&&(a="Method Not Allowed",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new y1(e||500,a,new Error(l),!0)}function LC(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(fs(r))return{result:r,idx:t}}}function rA(e){let t=typeof e=="string"?Bo(e):e;return Yc(Pt({},t,{hash:""}))}function Dme(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Xi(e){return e.type===Ct.deferred}function Wl(e){return e.type===Ct.error}function fs(e){return(e&&e.type)===Ct.redirect}function Nme(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Ame(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Mme(e){return Pme.has(e.toLowerCase())}function Pn(e){return _me.has(e.toLowerCase())}async function zC(e,t,r,n,o,i){for(let a=0;a<r.length;a++){let l=r[a],c=t[a];if(!c)continue;let u=e.find(p=>p.route.id===c.route.id),d=u!=null&&!tA(u,c)&&(i&&i[c.route.id])!==void 0;if(Xi(l)&&(o||d)){let p=n[a];Ce(p,"Expected an AbortSignal for revalidating fetcher deferred result"),await nA(l,p,o).then(h=>{h&&(r[a]=h||r[a])})}}}async function nA(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:Ct.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Ct.error,error:o}}return{type:Ct.data,data:e.deferredData.data}}}function x1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Iy(e,t){let r=typeof t=="string"?Bo(t).search:t.search;if(e[e.length-1].route.index&&x1(r||""))return e[e.length-1];let n=v1(e);return n[n.length-1]}function FC(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:i,json:a}=e;if(!(!t||!r||!n)){if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:a,text:void 0}}}function Zg(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 Lme(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 xl(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 zme(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 Jo(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 Fme(e,t){try{let r=e.sessionStorage.getItem(eA);if(r){let n=JSON.parse(r);for(let[o,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function Vme(e,t){if(t.size>0){let r={};for(let[n,o]of t)r[n]=[...o];try{e.sessionStorage.setItem(eA,JSON.stringify(r))}catch(n){fa(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
211
+ * React Router v6.20.1
212
+ *
213
+ * Copyright (c) Remix Software Inc.
214
+ *
215
+ * This source code is licensed under the MIT license found in the
216
+ * LICENSE.md file in the root directory of this source tree.
217
+ *
218
+ * @license MIT
219
+ */function xh(){return xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xh.apply(this,arguments)}const Mm=f.createContext(null),oA=f.createContext(null),Lm=f.createContext(null),zm=f.createContext(null),Ri=f.createContext({outlet:null,matches:[],isDataRoute:!1}),iA=f.createContext(null);function Fm(){return f.useContext(zm)!=null}function Ti(){return Fm()||Ce(!1),f.useContext(zm).location}function aA(e){f.useContext(Lm).static||f.useLayoutEffect(e)}function jt(){let{isDataRoute:e}=f.useContext(Ri);return e?tge():Bme()}function Bme(){Fm()||Ce(!1);let e=f.useContext(Mm),{basename:t,navigator:r}=f.useContext(Lm),{matches:n}=f.useContext(Ri),{pathname:o}=Ti(),i=JSON.stringify(v1(n).map(c=>c.pathnameBase)),a=f.useRef(!1);return aA(()=>{a.current=!0}),f.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=Y3(c,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:xi([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,i,o,e])}const Ume=f.createContext(null);function Wme(e){let t=f.useContext(Ri).outlet;return t&&f.createElement(Ume.Provider,{value:e},t)}function Ge(){let{matches:e}=f.useContext(Ri),t=e[e.length-1];return t?t.params:{}}function Hme(e,t){return sA(e,t)}function sA(e,t,r){Fm()||Ce(!1);let{navigator:n}=f.useContext(Lm),{matches:o}=f.useContext(Ri),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let c=Ti(),u;if(t){var d;let v=typeof t=="string"?Bo(t):t;l==="/"||(d=v.pathname)!=null&&d.startsWith(l)||Ce(!1),u=v}else u=c;let p=u.pathname||"/",h=l==="/"?p:p.slice(l.length)||"/",m=ts(e,{pathname:h}),g=Yme(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:xi([l,n.encodeLocation?n.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:xi([l,n.encodeLocation?n.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,r);return t&&g?f.createElement(zm.Provider,{value:{location:xh({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Ot.Pop}},g):g}function qme(){let e=ege(),t=X3(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:o},r):null,i)}const Gme=f.createElement(qme,null);class Qme extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error?f.createElement(Ri.Provider,{value:this.props.routeContext},f.createElement(iA.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Kme(e){let{routeContext:t,match:r,children:n}=e,o=f.useContext(Mm);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(Ri.Provider,{value:t},n)}function Yme(e,t,r){var n;if(t===void 0&&(t=[]),r===void 0&&(r=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let i=e,a=(n=r)==null?void 0:n.errors;if(a!=null){let l=i.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id]));l>=0||Ce(!1),i=i.slice(0,Math.min(i.length,l+1))}return i.reduceRight((l,c,u)=>{let d=c.route.id?a==null?void 0:a[c.route.id]:null,p=null;r&&(p=c.route.errorElement||Gme);let h=t.concat(i.slice(0,u+1)),m=()=>{let g;return d?g=p:c.route.Component?g=f.createElement(c.route.Component,null):c.route.element?g=c.route.element:g=l,f.createElement(Kme,{match:c,routeContext:{outlet:l,matches:h,isDataRoute:r!=null},children:g})};return r&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?f.createElement(Qme,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()},null)}var lA=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(lA||{}),wh=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(wh||{});function Xme(e){let t=f.useContext(Mm);return t||Ce(!1),t}function Jme(e){let t=f.useContext(oA);return t||Ce(!1),t}function Zme(e){let t=f.useContext(Ri);return t||Ce(!1),t}function cA(e){let t=Zme(),r=t.matches[t.matches.length-1];return r.route.id||Ce(!1),r.route.id}function ege(){var e;let t=f.useContext(iA),r=Jme(wh.UseRouteError),n=cA(wh.UseRouteError);return t||((e=r.errors)==null?void 0:e[n])}function tge(){let{router:e}=Xme(lA.UseNavigateStable),t=cA(wh.UseNavigateStable),r=f.useRef(!1);return aA(()=>{r.current=!0}),f.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,xh({fromRouteId:t},i)))},[e,t])}function w1(e){return Wme(e.context)}function ce(e){Ce(!1)}function rge(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Ot.Pop,navigator:i,static:a=!1}=e;Fm()&&Ce(!1);let l=t.replace(/^\/*/,"/"),c=f.useMemo(()=>({basename:l,navigator:i,static:a}),[l,i,a]);typeof n=="string"&&(n=Bo(n));let{pathname:u="/",search:d="",hash:p="",state:h=null,key:m="default"}=n,g=f.useMemo(()=>{let v=Xc(u,l);return v==null?null:{location:{pathname:v,search:d,hash:p,state:h,key:m},navigationType:o}},[l,u,d,p,h,m,o]);return g==null?null:f.createElement(Lm.Provider,{value:c},f.createElement(zm.Provider,{children:r,value:g}))}function nge(e){let{children:t,location:r}=e;return Hme(Dy(t),r)}new Promise(()=>{});function Dy(e,t){t===void 0&&(t=[]);let r=[];return f.Children.forEach(e,(n,o)=>{if(!f.isValidElement(n))return;let i=[...t,o];if(n.type===f.Fragment){r.push.apply(r,Dy(n.props.children,i));return}n.type!==ce&&Ce(!1),!n.props.index||!n.props.children||Ce(!1);let a={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=Dy(n.props.children,i)),r.push(a)}),r}function oge(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:f.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
220
+ * React Router DOM v6.20.1
221
+ *
222
+ * Copyright (c) Remix Software Inc.
223
+ *
224
+ * This source code is licensed under the MIT license found in the
225
+ * LICENSE.md file in the root directory of this source tree.
226
+ *
227
+ * @license MIT
228
+ */function bh(){return bh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bh.apply(this,arguments)}function Ny(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function ige(e,t){let r=Ny(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}function age(e,t){return $me({basename:t==null?void 0:t.basename,future:bh({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Xhe({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||sge(),routes:e,mapRouteProperties:oge,window:t==null?void 0:t.window}).initialize()}function sge(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=bh({},t,{errors:lge(t.errors)})),t}function lge(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new y1(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",r[n]=a}catch{}}if(r[n]==null){let i=new Error(o.message);i.stack="",r[n]=i}}else r[n]=o;return r}const cge=f.createContext({isTransitioning:!1}),uge=f.createContext(new Map),dge="startTransition",VC=Hl[dge],fge="flushSync",BC=x8[fge];function pge(e){VC?VC(e):e()}function wl(e){BC?BC(e):e()}class hge{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function mge(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=f.useState(r.state),[a,l]=f.useState(),[c,u]=f.useState({isTransitioning:!1}),[d,p]=f.useState(),[h,m]=f.useState(),[g,v]=f.useState(),_=f.useRef(new Map),{v7_startTransition:y}=n||{},x=f.useCallback(P=>{y?pge(P):P()},[y]),w=f.useCallback((P,E)=>{let{deletedFetchers:k,unstable_flushSync:$,unstable_viewTransitionOpts:I}=E;k.forEach(N=>_.current.delete(N)),P.fetchers.forEach((N,M)=>{N.data!==void 0&&_.current.set(M,N.data)});let R=r.window==null||typeof r.window.document.startViewTransition!="function";if(!I||R){$?wl(()=>i(P)):x(()=>i(P));return}if($){wl(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let N=r.window.document.startViewTransition(()=>{wl(()=>i(P))});N.finished.finally(()=>{wl(()=>{p(void 0),m(void 0),l(void 0),u({isTransitioning:!1})})}),wl(()=>m(N));return}h?(d&&d.resolve(),h.skipTransition(),v({state:P,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(l(P),u({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[r.window,h,d,_,x]);f.useLayoutEffect(()=>r.subscribe(w),[r,w]),f.useEffect(()=>{c.isTransitioning&&!c.flushSync&&p(new hge)},[c]),f.useEffect(()=>{if(d&&a&&r.window){let P=a,E=d.promise,k=r.window.document.startViewTransition(async()=>{x(()=>i(P)),await E});k.finished.finally(()=>{p(void 0),m(void 0),l(void 0),u({isTransitioning:!1})}),m(k)}},[x,a,d,r.window]),f.useEffect(()=>{d&&a&&o.location.key===a.location.key&&d.resolve()},[d,h,o.location,a]),f.useEffect(()=>{!c.isTransitioning&&g&&(l(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[c.isTransitioning,g]);let b=f.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:P=>r.navigate(P),push:(P,E,k)=>r.navigate(P,{state:E,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(P,E,k)=>r.navigate(P,{replace:!0,state:E,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[r]),j=r.basename||"/",C=f.useMemo(()=>({router:r,navigator:b,static:!1,basename:j}),[r,b,j]);return f.createElement(f.Fragment,null,f.createElement(Mm.Provider,{value:C},f.createElement(oA.Provider,{value:o},f.createElement(uge.Provider,{value:_.current},f.createElement(cge.Provider,{value:c},f.createElement(rge,{basename:j,location:o.location,navigationType:o.historyAction,navigator:b},o.initialized?f.createElement(gge,{routes:r.routes,state:o}):t))))),null)}function gge(e){let{routes:t,state:r}=e;return sA(t,void 0,r)}var UC;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(UC||(UC={}));var WC;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(WC||(WC={}));function b1(e){let t=f.useRef(Ny(e)),r=f.useRef(!1),n=Ti(),o=f.useMemo(()=>ige(n.search,r.current?null:t.current),[n.search]),i=jt(),a=f.useCallback((l,c)=>{const u=Ny(typeof l=="function"?l(o):l);r.current=!0,i("?"+u,c)},[i,o]);return[o,a]}var vge=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Jc(e,t){var r=yge(e);if(typeof r.path!="string"){var n=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof n=="string"&&n.length>0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function yge(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var n=t.split(".").pop().toLowerCase(),o=vge.get(n);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var xge=[".DS_Store","Thumbs.db"];function wge(e){return ks(this,void 0,void 0,function(){return Rs(this,function(t){return _h(e)&&bge(e.dataTransfer)?[2,jge(e.dataTransfer,e.type)]:_ge(e)?[2,Sge(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,Pge(e)]:[2,[]]})})}function bge(e){return _h(e)}function _ge(e){return _h(e)&&_h(e.target)}function _h(e){return typeof e=="object"&&e!==null}function Sge(e){return Ay(e.target.files).map(function(t){return Jc(t)})}function Pge(e){return ks(this,void 0,void 0,function(){var t;return Rs(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(n){return Jc(n)})]}})})}function jge(e,t){return ks(this,void 0,void 0,function(){var r,n;return Rs(this,function(o){switch(o.label){case 0:return e.items?(r=Ay(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(Oge))]):[3,2];case 1:return n=o.sent(),[2,HC(uA(n))];case 2:return[2,HC(Ay(e.files).map(function(i){return Jc(i)}))]}})})}function HC(e){return e.filter(function(t){return xge.indexOf(t.name)===-1})}function Ay(e){if(e===null)return[];for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(n)}return t}function Oge(e){if(typeof e.webkitGetAsEntry!="function")return qC(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?dA(t):qC(e)}function uA(e){return e.reduce(function(t,r){return iv(iv([],k1(t),!1),k1(Array.isArray(r)?uA(r):[r]),!1)},[])}function qC(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var r=Jc(t);return Promise.resolve(r)}function Cge(e){return ks(this,void 0,void 0,function(){return Rs(this,function(t){return[2,e.isDirectory?dA(e):Ege(e)]})})}function dA(e){var t=e.createReader();return new Promise(function(r,n){var o=[];function i(){var a=this;t.readEntries(function(l){return ks(a,void 0,void 0,function(){var c,u,d;return Rs(this,function(p){switch(p.label){case 0:if(l.length)return[3,5];p.label=1;case 1:return p.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return c=p.sent(),r(c),[3,4];case 3:return u=p.sent(),n(u),[3,4];case 4:return[3,6];case 5:d=Promise.all(l.map(Cge)),o.push(d),i(),p.label=6;case 6:return[2]}})})},function(l){n(l)})}i()})}function Ege(e){return ks(this,void 0,void 0,function(){return Rs(this,function(t){return[2,new Promise(function(r,n){e.file(function(o){var i=Jc(o,e.fullPath);r(i)},function(o){n(o)})})]})})}var $ge=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return r.some(function(a){var l=a.trim().toLowerCase();return l.charAt(0)==="."?n.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):o===l})}return!0};function GC(e){return Tge(e)||Rge(e)||pA(e)||kge()}function kge(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
229
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tge(e){if(Array.isArray(e))return My(e)}function QC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function KC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QC(Object(r),!0).forEach(function(n){fA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wc(e,t){return Nge(e)||Dge(e,t)||pA(e,t)||Ige()}function Ige(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
230
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pA(e,t){if(e){if(typeof e=="string")return My(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return My(e,t)}}function My(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Dge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,l;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,l=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function Nge(e){if(Array.isArray(e))return e}var Age="file-invalid-type",Mge="file-too-large",Lge="file-too-small",zge="too-many-files",Fge=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var r=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:Age,message:"File type must be ".concat(r)}},YC=function(t){return{code:Mge,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},XC=function(t){return{code:Lge,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Vge={code:zge,message:"Too many files"};function hA(e,t){var r=e.type==="application/x-moz-file"||$ge(e,t);return[r,r?null:Fge(t)]}function mA(e,t,r){if(qi(e.size))if(qi(t)&&qi(r)){if(e.size>r)return[!1,YC(r)];if(e.size<t)return[!1,XC(t)]}else{if(qi(t)&&e.size<t)return[!1,XC(t)];if(qi(r)&&e.size>r)return[!1,YC(r)]}return[!0,null]}function qi(e){return e!=null}function Bge(e){var t=e.files,r=e.accept,n=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,l=e.validator;return!i&&t.length>1||i&&a>=1&&t.length>a?!1:t.every(function(c){var u=hA(c,r),d=wc(u,1),p=d[0],h=mA(c,n,o),m=wc(h,1),g=m[0],v=l?l(c):null;return p&&g&&!v})}function Sh(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Yu(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function JC(e){e.preventDefault()}function Uge(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Wge(e){return e.indexOf("Edge/")!==-1}function Hge(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Uge(e)||Wge(e)}function Wn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return t.some(function(l){return!Sh(n)&&l&&l.apply(void 0,[n].concat(i)),Sh(n)})}}function qge(){return"showOpenFilePicker"in window}function Gge(e){if(qi(e)){var t=Object.entries(e).filter(function(r){var n=wc(r,2),o=n[0],i=n[1],a=!0;return gA(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),a=!1),(!Array.isArray(i)||!i.every(vA))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(r,n){var o=wc(n,2),i=o[0],a=o[1];return KC(KC({},r),{},fA({},i,a))},{});return[{description:"Files",accept:t}]}return e}function Qge(e){if(qi(e))return Object.entries(e).reduce(function(t,r){var n=wc(r,2),o=n[0],i=n[1];return[].concat(GC(t),[o],GC(i))},[]).filter(function(t){return gA(t)||vA(t)}).join(",")}function Kge(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Yge(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function gA(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function vA(e){return/^.*\.[\w]+$/.test(e)}var Xge=["children"],Jge=["open"],Zge=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],eve=["refKey","onChange","onClick"];function tve(e){return ove(e)||nve(e)||yA(e)||rve()}function rve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
231
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ove(e){if(Array.isArray(e))return Ly(e)}function ev(e,t){return sve(e)||ave(e,t)||yA(e,t)||ive()}function ive(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
232
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yA(e,t){if(e){if(typeof e=="string")return Ly(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ly(e,t)}}function Ly(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ave(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,l;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,l=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function sve(e){if(Array.isArray(e))return e}function ZC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZC(Object(r),!0).forEach(function(n){zy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ph(e,t){if(e==null)return{};var r=lve(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lve(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var _1=f.forwardRef(function(e,t){var r=e.children,n=Ph(e,Xge),o=wA(n),i=o.open,a=Ph(o,Jge);return f.useImperativeHandle(t,function(){return{open:i}},[i]),S.createElement(f.Fragment,null,r(vt(vt({},a),{},{open:i})))});_1.displayName="Dropzone";var xA={disabled:!1,getFilesFromEvent:wge,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};_1.defaultProps=xA;_1.propTypes={children:De.func,accept:De.objectOf(De.arrayOf(De.string)),multiple:De.bool,preventDropOnDocument:De.bool,noClick:De.bool,noKeyboard:De.bool,noDrag:De.bool,noDragEventsBubbling:De.bool,minSize:De.number,maxSize:De.number,maxFiles:De.number,disabled:De.bool,getFilesFromEvent:De.func,onFileDialogCancel:De.func,onFileDialogOpen:De.func,useFsAccessApi:De.bool,autoFocus:De.bool,onDragEnter:De.func,onDragLeave:De.func,onDragOver:De.func,onDrop:De.func,onDropAccepted:De.func,onDropRejected:De.func,onError:De.func,validator:De.func};var Fy={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function wA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=vt(vt({},xA),e),r=t.accept,n=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,l=t.multiple,c=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,h=t.onDrop,m=t.onDropAccepted,g=t.onDropRejected,v=t.onFileDialogCancel,_=t.onFileDialogOpen,y=t.useFsAccessApi,x=t.autoFocus,w=t.preventDropOnDocument,b=t.noClick,j=t.noKeyboard,C=t.noDrag,P=t.noDragEventsBubbling,E=t.onError,k=t.validator,$=f.useMemo(function(){return Qge(r)},[r]),I=f.useMemo(function(){return Gge(r)},[r]),R=f.useMemo(function(){return typeof _=="function"?_:eE},[_]),N=f.useMemo(function(){return typeof v=="function"?v:eE},[v]),M=f.useRef(null),L=f.useRef(null),Q=f.useReducer(cve,Fy),G=ev(Q,2),T=G[0],F=G[1],V=T.isFocused,X=T.isFileDialogActive,J=f.useRef(typeof window<"u"&&window.isSecureContext&&y&&qge()),_e=function(){!J.current&&X&&setTimeout(function(){if(L.current){var me=L.current.files;me.length||(F({type:"closeDialog"}),N())}},300)};f.useEffect(function(){return window.addEventListener("focus",_e,!1),function(){window.removeEventListener("focus",_e,!1)}},[L,X,N,J]);var Se=f.useRef([]),Xe=function(me){M.current&&M.current.contains(me.target)||(me.preventDefault(),Se.current=[])};f.useEffect(function(){return w&&(document.addEventListener("dragover",JC,!1),document.addEventListener("drop",Xe,!1)),function(){w&&(document.removeEventListener("dragover",JC),document.removeEventListener("drop",Xe))}},[M,w]),f.useEffect(function(){return!n&&x&&M.current&&M.current.focus(),function(){}},[M,x,n]);var Le=f.useCallback(function(ee){E?E(ee):console.error(ee)},[E]),gt=f.useCallback(function(ee){ee.preventDefault(),ee.persist(),ur(ee),Se.current=[].concat(tve(Se.current),[ee.target]),Yu(ee)&&Promise.resolve(o(ee)).then(function(me){if(!(Sh(ee)&&!P)){var ft=me.length,Ue=ft>0&&Bge({files:me,accept:$,minSize:a,maxSize:i,multiple:l,maxFiles:c,validator:k}),bt=ft>0&&!Ue;F({isDragAccept:Ue,isDragReject:bt,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ee)}}).catch(function(me){return Le(me)})},[o,u,Le,P,$,a,i,l,c,k]),Nt=f.useCallback(function(ee){ee.preventDefault(),ee.persist(),ur(ee);var me=Yu(ee);if(me&&ee.dataTransfer)try{ee.dataTransfer.dropEffect="copy"}catch{}return me&&p&&p(ee),!1},[p,P]),ke=f.useCallback(function(ee){ee.preventDefault(),ee.persist(),ur(ee);var me=Se.current.filter(function(Ue){return M.current&&M.current.contains(Ue)}),ft=me.indexOf(ee.target);ft!==-1&&me.splice(ft,1),Se.current=me,!(me.length>0)&&(F({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Yu(ee)&&d&&d(ee))},[M,d,P]),qt=f.useCallback(function(ee,me){var ft=[],Ue=[];ee.forEach(function(bt){var An=hA(bt,$),yn=ev(An,2),Fr=yn[0],Wo=yn[1],Mn=mA(bt,a,i),Ln=ev(Mn,2),po=Ln[0],Ni=Ln[1],dr=k?k(bt):null;if(Fr&&po&&!dr)ft.push(bt);else{var Ho=[Wo,Ni];dr&&(Ho=Ho.concat(dr)),Ue.push({file:bt,errors:Ho.filter(function(ja){return ja})})}}),(!l&&ft.length>1||l&&c>=1&&ft.length>c)&&(ft.forEach(function(bt){Ue.push({file:bt,errors:[Vge]})}),ft.splice(0)),F({acceptedFiles:ft,fileRejections:Ue,type:"setFiles"}),h&&h(ft,Ue,me),Ue.length>0&&g&&g(Ue,me),ft.length>0&&m&&m(ft,me)},[F,l,$,a,i,c,h,m,g,k]),zr=f.useCallback(function(ee){ee.preventDefault(),ee.persist(),ur(ee),Se.current=[],Yu(ee)&&Promise.resolve(o(ee)).then(function(me){Sh(ee)&&!P||qt(me,ee)}).catch(function(me){return Le(me)}),F({type:"reset"})},[o,qt,Le,P]),cr=f.useCallback(function(){if(J.current){F({type:"openDialog"}),R();var ee={multiple:l,types:I};window.showOpenFilePicker(ee).then(function(me){return o(me)}).then(function(me){qt(me,null),F({type:"closeDialog"})}).catch(function(me){Kge(me)?(N(me),F({type:"closeDialog"})):Yge(me)?(J.current=!1,L.current?(L.current.value=null,L.current.click()):Le(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."))):Le(me)});return}L.current&&(F({type:"openDialog"}),R(),L.current.value=null,L.current.click())},[F,R,N,y,qt,Le,I,l]),Gt=f.useCallback(function(ee){!M.current||!M.current.isEqualNode(ee.target)||(ee.key===" "||ee.key==="Enter"||ee.keyCode===32||ee.keyCode===13)&&(ee.preventDefault(),cr())},[M,cr]),At=f.useCallback(function(){F({type:"focus"})},[]),co=f.useCallback(function(){F({type:"blur"})},[]),Uo=f.useCallback(function(){b||(Hge()?setTimeout(cr,0):cr())},[b,cr]),tt=function(me){return n?null:me},uo=function(me){return j?null:tt(me)},Sr=function(me){return C?null:tt(me)},ur=function(me){P&&me.stopPropagation()},Di=f.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},me=ee.refKey,ft=me===void 0?"ref":me,Ue=ee.role,bt=ee.onKeyDown,An=ee.onFocus,yn=ee.onBlur,Fr=ee.onClick,Wo=ee.onDragEnter,Mn=ee.onDragOver,Ln=ee.onDragLeave,po=ee.onDrop,Ni=Ph(ee,Zge);return vt(vt(zy({onKeyDown:uo(Wn(bt,Gt)),onFocus:uo(Wn(An,At)),onBlur:uo(Wn(yn,co)),onClick:tt(Wn(Fr,Uo)),onDragEnter:Sr(Wn(Wo,gt)),onDragOver:Sr(Wn(Mn,Nt)),onDragLeave:Sr(Wn(Ln,ke)),onDrop:Sr(Wn(po,zr)),role:typeof Ue=="string"&&Ue!==""?Ue:"presentation"},ft,M),!n&&!j?{tabIndex:0}:{}),Ni)}},[M,Gt,At,co,Uo,gt,Nt,ke,zr,j,C,n]),en=f.useCallback(function(ee){ee.stopPropagation()},[]),fo=f.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},me=ee.refKey,ft=me===void 0?"ref":me,Ue=ee.onChange,bt=ee.onClick,An=Ph(ee,eve),yn=zy({accept:$,multiple:l,type:"file",style:{display:"none"},onChange:tt(Wn(Ue,zr)),onClick:tt(Wn(bt,en)),tabIndex:-1},ft,L);return vt(vt({},yn),An)}},[L,r,l,zr,n]);return vt(vt({},T),{},{isFocused:V&&!n,getRootProps:Di,getInputProps:fo,rootRef:M,inputRef:L,open:tt(cr)})}function cve(e,t){switch(t.type){case"focus":return vt(vt({},e),{},{isFocused:!0});case"blur":return vt(vt({},e),{},{isFocused:!1});case"openDialog":return vt(vt({},Fy),{},{isFileDialogActive:!0});case"closeDialog":return vt(vt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return vt(vt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return vt(vt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return vt({},Fy);default:return e}}function eE(){}const[uve,dve]=No("Dropzone component was not found in tree");var tE=Object.getOwnPropertySymbols,fve=Object.prototype.hasOwnProperty,pve=Object.prototype.propertyIsEnumerable,hve=(e,t)=>{var r={};for(var n in e)fve.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tE)for(var n of tE(e))t.indexOf(n)<0&&pve.call(e,n)&&(r[n]=e[n]);return r};function S1(e){const t=r=>{const n=H(`Dropzone${cw(e)}`,{},r),{children:o}=n,i=hve(n,["children"]),a=dve(),l=Ts(o)?o:S.createElement("span",null,o);return a[e]?f.cloneElement(l,i):null};return t.displayName=`@mantine/dropzone/${cw(e)}`,t}const mve=S1("accept"),gve=S1("reject"),vve=S1("idle");var yve=Object.defineProperty,xve=Object.defineProperties,wve=Object.getOwnPropertyDescriptors,rE=Object.getOwnPropertySymbols,bve=Object.prototype.hasOwnProperty,_ve=Object.prototype.propertyIsEnumerable,nE=(e,t,r)=>t in e?yve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oE=(e,t)=>{for(var r in t||(t={}))bve.call(t,r)&&nE(e,r,t[r]);if(rE)for(var r of rE(t))_ve.call(t,r)&&nE(e,r,t[r]);return e},Sve=(e,t)=>xve(e,wve(t)),Pve=W((e,{padding:t,radius:r})=>{const n=e.fn.variant({color:"red",variant:"light"}),o=e.fn.variant({color:e.primaryColor,variant:"light"});return{root:Sve(oE(oE({},e.fn.fontStyles()),e.fn.focusStyles()),{boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${O(2)} dashed ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,padding:A({size:t,sizes:e.spacing}),borderRadius:e.fn.radius(r),cursor:"pointer",userSelect:"none",transition:"background-color 150ms ease",position:"relative","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]},"&[data-loading]":{cursor:"default","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white}},"&[data-accept]":{backgroundColor:e.colorScheme==="dark"?o.background:e.colors[e.primaryColor][0],borderColor:e.colorScheme==="dark"?o.border:e.colors[e.primaryColor][4],"&:hover":{backgroundColor:e.colorScheme==="dark"?o.background:e.colors[e.primaryColor][0]}},"&[data-reject]":{backgroundColor:e.colorScheme==="dark"?n.background:e.colors.red[0],borderColor:e.colorScheme==="dark"?n.border:e.colors.red[4],"&:hover":{backgroundColor:e.colorScheme==="dark"?n.background:e.colors.red[0]}}}),inner:{pointerEvents:"none",userSelect:"none"}}});const jve=Pve;var Ove=Object.defineProperty,Cve=Object.defineProperties,Eve=Object.getOwnPropertyDescriptors,jh=Object.getOwnPropertySymbols,bA=Object.prototype.hasOwnProperty,_A=Object.prototype.propertyIsEnumerable,iE=(e,t,r)=>t in e?Ove(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bl=(e,t)=>{for(var r in t||(t={}))bA.call(t,r)&&iE(e,r,t[r]);if(jh)for(var r of jh(t))_A.call(t,r)&&iE(e,r,t[r]);return e},tv=(e,t)=>Cve(e,Eve(t)),$ve=(e,t)=>{var r={};for(var n in e)bA.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&jh)for(var n of jh(e))t.indexOf(n)<0&&_A.call(e,n)&&(r[n]=e[n]);return r};const kve={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0};function Ws(e){const t=H("Dropzone",kve,e),{className:r,padding:n,radius:o,disabled:i,classNames:a,styles:l,loading:c,multiple:u,maxSize:d,accept:p,children:h,onDropAny:m,onDrop:g,onReject:v,openRef:_,name:y,unstyled:x,maxFiles:w,autoFocus:b,activateOnClick:j,activateOnDrag:C,dragEventsBubbling:P,activateOnKeyboard:E,onDragEnter:k,onDragLeave:$,onDragOver:I,onFileDialogCancel:R,onFileDialogOpen:N,preventDropOnDocument:M,useFsAccessApi:L,getFilesFromEvent:Q,validator:G,variant:T}=t,F=$ve(t,["className","padding","radius","disabled","classNames","styles","loading","multiple","maxSize","accept","children","onDropAny","onDrop","onReject","openRef","name","unstyled","maxFiles","autoFocus","activateOnClick","activateOnDrag","dragEventsBubbling","activateOnKeyboard","onDragEnter","onDragLeave","onDragOver","onFileDialogCancel","onFileDialogOpen","preventDropOnDocument","useFsAccessApi","getFilesFromEvent","validator","variant"]),{classes:V,cx:X}=jve({radius:o,padding:n},{name:"Dropzone",classNames:a,styles:l,unstyled:x,variant:T}),{getRootProps:J,getInputProps:_e,isDragAccept:Se,isDragReject:Xe,open:Le}=wA(bl({onDrop:m,onDropAccepted:g,onDropRejected:v,disabled:i||c,accept:Array.isArray(p)?p.reduce((Nt,ke)=>tv(bl({},Nt),{[ke]:[]}),{}):p,multiple:u,maxSize:d,maxFiles:w,autoFocus:b,noClick:!j,noDrag:!C,noDragEventsBubbling:!P,noKeyboard:!E,onDragEnter:k,onDragLeave:$,onDragOver:I,onFileDialogCancel:R,onFileDialogOpen:N,preventDropOnDocument:M,useFsAccessApi:L,validator:G},Q?{getFilesFromEvent:Q}:null));m$(_,Le);const gt=!Se&&!Xe;return S.createElement(uve,{value:{accept:Se,reject:Xe,idle:gt}},S.createElement(ae,tv(bl(bl({},F),J()),{"data-accept":Se||void 0,"data-reject":Xe||void 0,"data-idle":gt||void 0,"data-loading":c||void 0,className:X(V.root,r)}),S.createElement(SD,{visible:c,radius:o,unstyled:x}),S.createElement("input",tv(bl({},_e()),{name:y})),S.createElement("div",{className:V.inner},h)))}Ws.displayName="@mantine/dropzone/Dropzone";Ws.Accept=mve;Ws.Reject=gve;Ws.Idle=vve;const SA=Ws;var Rve=Object.defineProperty,Tve=Object.defineProperties,Ive=Object.getOwnPropertyDescriptors,aE=Object.getOwnPropertySymbols,Dve=Object.prototype.hasOwnProperty,Nve=Object.prototype.propertyIsEnumerable,sE=(e,t,r)=>t in e?Rve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ave=(e,t)=>{for(var r in t||(t={}))Dve.call(t,r)&&sE(e,r,t[r]);if(aE)for(var r of aE(t))Nve.call(t,r)&&sE(e,r,t[r]);return e},Mve=(e,t)=>Tve(e,Ive(t)),Lve=W(e=>({wrapper:Mve(Ave({},e.fn.cover(0)),{position:"fixed",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,display:"flex",padding:e.spacing.xs,transition:"opacity 100ms ease"}),dropzone:{flex:1}}));const zve=Lve;var Fve=Object.defineProperty,Vve=Object.defineProperties,Bve=Object.getOwnPropertyDescriptors,Oh=Object.getOwnPropertySymbols,PA=Object.prototype.hasOwnProperty,jA=Object.prototype.propertyIsEnumerable,lE=(e,t,r)=>t in e?Fve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rv=(e,t)=>{for(var r in t||(t={}))PA.call(t,r)&&lE(e,r,t[r]);if(Oh)for(var r of Oh(t))jA.call(t,r)&&lE(e,r,t[r]);return e},nv=(e,t)=>Vve(e,Bve(t)),Uve=(e,t)=>{var r={};for(var n in e)PA.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Oh)for(var n of Oh(e))t.indexOf(n)<0&&jA.call(e,n)&&(r[n]=e[n]);return r};const Wve={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Dn("max"),withinPortal:!0};function OA(e){const t=H("DropzoneFullScreen",Wve,e),{classNames:r,styles:n,sx:o,className:i,style:a,unstyled:l,active:c,onDrop:u,onReject:d,zIndex:p,withinPortal:h,portalProps:m}=t,g=Uve(t,["classNames","styles","sx","className","style","unstyled","active","onDrop","onReject","zIndex","withinPortal","portalProps"]),[v,_]=S.useState(0),[y,{open:x,close:w}]=LL(!1),{classes:b,cx:j}=zve(null,{name:"DropzoneFullScreen",classNames:r,styles:n,unstyled:l}),C=E=>{E.dataTransfer.types.includes("Files")&&(_(k=>k+1),x())},P=()=>{_(E=>E-1)};return f.useEffect(()=>{v===0&&w()},[v]),f.useEffect(()=>{if(c)return document.addEventListener("dragenter",C,!1),document.addEventListener("dragleave",P,!1),()=>{document.removeEventListener("dragenter",C,!1),document.removeEventListener("dragleave",P,!1)}},[c]),S.createElement(Ls,nv(rv({},m),{withinPortal:h}),S.createElement(ae,{className:j(b.wrapper,i),sx:o,style:nv(rv({},a),{opacity:y?1:0,pointerEvents:y?"all":"none",zIndex:p})},S.createElement(Ws,nv(rv({},g),{classNames:r,styles:n,unstyled:l,className:b.dropzone,onDrop:E=>{u==null||u(E),w()},onReject:E=>{d==null||d(E),w()}}))))}OA.displayName="@mantine/dropzone/DropzoneFullScreen";SA.FullScreen=OA;const Xu=SA,Hve='{"resourceType": "Bundle"}';function ov({id:e,title:t,message:r,color:n,icon:o,withCloseButton:i=!1,method:a="show",loading:l}){So[a]({id:e,loading:l,title:t,message:r,color:n,icon:o,withCloseButton:i,autoClose:!1})}function qve(){const e=Ht(),t=ne(),[r,n]=f.useState({}),o=f.useCallback(async(l,c)=>{const u="batch-upload";ov({id:u,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{n({});let d=JSON.parse(l);d.type!=="batch"&&d.type!=="transaction"&&(d=_4(d));const p=await t.executeBatch(d);n(h=>({...h,[c]:p})),ov({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(Cm,{size:"1rem"}),withCloseButton:!0})}catch(d){ov({id:u,title:"Batch Upload Failed",color:"red",message:je(d),method:"update",icon:s.jsx(gh,{size:"1rem"}),withCloseButton:!0})}},[t]),i=f.useCallback(async l=>{for(const c of l){const u=new FileReader;u.onload=d=>{var p;return o((p=d.target)==null?void 0:p.result,c.name)},u.readAsText(c)}},[o]),a=f.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return s.jsxs(we,{children:[s.jsx(ue,{children:"Batch Create"}),s.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",s.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(r).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(ze,{defaultValue:"upload",children:[s.jsxs(ze.List,{children:[s.jsx(ze.Tab,{value:"upload",children:"File Upload"}),s.jsx(ze.Tab,{value:"json",children:"JSON"})]}),s.jsx(ze.Panel,{value:"upload",pt:"xs",children:s.jsx(Xu,{onDrop:i,accept:["application/json"],children:s.jsxs(K,{position:"center",spacing:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(Xu.Accept,{children:s.jsx(uC,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(Xu.Reject,{children:s.jsx(gh,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(Xu.Idle,{children:s.jsx(uC,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(oe,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(oe,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(ze.Panel,{value:"json",pt:"xs",children:s.jsxs(Ne,{onSubmit:a,children:[s.jsx(Vs,{"data-testid":"batch-input",name:"input",minRows:20,defaultValue:Hve,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(r).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(ze,{defaultValue:Object.keys(r)[0],children:[s.jsx(ze.List,{children:Object.keys(r).map(l=>s.jsx(ze.Tab,{value:l,children:l},l))}),Object.keys(r).map(l=>s.jsx(ze.Panel,{value:l,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(r[l],void 0,2)})},l))]}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{onClick:()=>n({}),children:"Start over"})})]})]})}function Gve(){const{resourceType:e}=Ge(),r=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[n]=Os("Questionnaire",`subject-type=${e}`);return n?n.length===0?s.jsxs(we,{children:[s.jsxs(ue,{children:["No apps for ",e]}),s.jsx($e,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(we,{children:s.jsx("div",{children:n.map(o=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx($e,{to:`/forms/${o.id}?subject=`+r.map(i=>`${e}/${i}`).join(","),children:o.name})}),s.jsx("p",{children:o.description})]},o.id))})}):s.jsx(In,{})}function Qve(){const e=ne(),[t,r]=f.useState(),[n,o]=f.useState(!1);return s.jsx(we,{width:450,children:s.jsxs(Ne,{style:{maxWidth:400},onSubmit:i=>{r(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(a=>r(lt(a)))},children:[s.jsxs(ar,{sx:{flexDirection:"column"},children:[s.jsx(Nn,{size:32}),s.jsx(ue,{children:"Change password"})]}),!n&&s.jsxs(be,{spacing:"xl",mt:"xl",children:[s.jsx(to,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Ie(t,"oldPassword")}),s.jsx(to,{name:"newPassword",label:"New password",required:!0,error:Ie(t,"newPassword")}),s.jsx(to,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ie(t,"confirmPassword")}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"Change password"})})]}),n&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const CA=["Form","JSON"],Kve=CA[0].toLowerCase();function Yve(){const e=jt(),{resourceType:t}=Ge(),r=window.location.pathname.split("/").pop(),[n,o]=f.useState(r??Kve);function i(a){o(a),e(`/${t}/new/${a}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(dn,{children:[s.jsxs(oe,{p:"md",weight:500,children:["New ",t]}),s.jsx(ga,{children:s.jsx(ze,{defaultValue:"form",value:n,onTabChange:i,children:s.jsx(ze.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:CA.map(a=>s.jsx(ze.Tab,{value:a.toLowerCase(),px:"md",children:a},a))})})})]}),s.jsx(w1,{})]})}function Xve(){return s.jsx(we,{children:s.jsxs(be,{children:[s.jsx(ue,{order:1,children:"Unexpected Error"}),s.jsx(oe,{children:"We're sorry, something went wrong."}),s.jsxs(oe,{children:["Please contact ",s.jsx(Fe,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const Vm=W(e=>({root:{display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 10px"},entry:{display:"inline-block",margin:"5px 20px 5px 5px"},key:{color:e.colors.gray[6],textTransform:"uppercase",fontSize:e.fontSizes.xs,whiteSpace:"nowrap"},value:{fontSize:e.fontSizes.md,fontWeight:600,marginLeft:0,whiteSpace:"nowrap"}}));function Pe(e){const{classes:t}=Vm();return s.jsx(ga,{children:s.jsx("div",{className:t.root,children:e.children})})}Pe.Entry=function(t){const{classes:r}=Vm();return s.jsx("div",{className:r.entry,children:t.children})};Pe.Key=function(t){const{classes:r}=Vm();return s.jsx("div",{className:r.key,children:t.children})};Pe.Value=function(t){const{classes:r}=Vm();return s.jsx("div",{className:r.value,children:t.children})};function Jve(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function EA(e){var r,n;const t=et(e.patient);return t?s.jsxs(Pe,{children:[s.jsx(ji,{value:t,size:"lg",color:Jve(t)}),s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Name"}),s.jsx(Pe.Value,{children:s.jsx($e,{to:t,children:t.name?s.jsx(Hx,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"DoB"}),s.jsx(Pe.Value,{children:t.birthDate})]}),s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Age"}),s.jsx(Pe.Value,{children:oae(t.birthDate)})]})]}),t.gender&&s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Gender"}),s.jsx(Pe.Value,{children:t.gender})]}),t.address&&s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"State"}),s.jsx(Pe.Value,{children:(r=t.address[0])==null?void 0:r.state})]}),(n=t.identifier)==null?void 0:n.map(o=>s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:o==null?void 0:o.system}),s.jsx(Pe.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function $A(e){const t=et(e.resource);if(!t)return null;const r=[{key:"Type",value:s.jsx($e,{to:`/${t.resourceType}`,children:t.resourceType})}];function n(l,c){l&&c&&r.push({key:l,value:c})}function o(l){l&&n(l.system,l.value)}function i(l,c){Array.isArray(c)?c.forEach(u=>i(l,u)):typeof c=="string"?n(l,c):c&&(Array.isArray(c.coding)?n(l,c.coding.map(u=>u.display||u.code).join(", ")):n(l,c.text))}const a=Ro(t);return a!==at(t)&&n("Name",a),"category"in t&&i("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&i("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(o):o(t.identifier)),r.length===1&&r.push({key:"ID",value:t.id}),s.jsx(Pe,{children:r.map(l=>s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:l.key}),s.jsx(Pe.Value,{children:l.value})]},`${l.key}-${l.value}`))})}function P1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function Zve(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 _d(e,t){return new Promise((r,n)=>{var i;const o=new MessageChannel;o.port1.onmessage=({data:a})=>{o.port1.close(),a.error?n(a.error):r(a.result)},(i=e.contentWindow)==null||i.postMessage(t,"https://codeeditor.medplum.com",[o.port2])})}function Ii(e){var t;return Px((t=e.getActiveLogin())==null?void 0:t.project)}function eye(e,t){const r=new Blob([e],{type:Kt.JSON}),n=URL.createObjectURL(r),o=document.createElement("a");o.href=n;const i=t??new Date().toISOString().replace(/\D/g,"");o.download=`${i}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(n)}function tye(){const{id:e}=Ge(),t=Ti(),n=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=ne(),[i,a]=f.useState(!0),[l,c]=f.useState(),[u,d]=f.useState(),[p,h]=f.useState(),[m,g]=f.useState(),[v,_]=f.useState();if(f.useEffect(()=>{const w={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(n){const b=n.split(",").filter(j=>!!j);b.length===1&&w.entry.push({request:{method:"GET",url:b[0]}}),d(b)}o.executeBatch(w).then(b=>{var j,C,P,E,k,$,I;((P=(C=(j=b.entry)==null?void 0:j[0])==null?void 0:C.response)==null?void 0:P.status)!=="200"?g((k=(E=b.entry)==null?void 0:E[0])==null?void 0:k.response):(c(($=b.entry[0])==null?void 0:$.resource),h((I=b.entry[1])==null?void 0:I.resource)),a(!1)}).catch(b=>{g(b),a(!1)})},[o,e,n]),m)return s.jsx(we,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(v)return s.jsxs(we,{children:[s.jsx(ue,{children:l==null?void 0:l.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[v.length===1&&s.jsx("li",{children:s.jsx($e,{to:v[0],children:"Review your answers"})}),v.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:v.map(w=>s.jsx("li",{children:s.jsx($e,{to:w,children:at(w)})},w.id))})]}),p&&s.jsx("li",{children:s.jsxs($e,{to:p,children:["Back to ",Ro(p)]})}),s.jsx("li",{children:s.jsx($e,{to:"/",children:"Go back home"})})]})]});if(i||!l)return s.jsx(In,{});const y=p&&P1(p);return s.jsxs(s.Fragment,{children:[s.jsxs(dn,{shadow:"xs",radius:0,children:[y&&s.jsx(EA,{patient:y}),p&&p.resourceType!=="Patient"&&s.jsx($A,{resource:p}),s.jsx(ae,{px:"xl",py:"md",children:s.jsxs(oe,{children:[Ro(l),u&&u.length>1&&s.jsxs(s.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),s.jsx(we,{children:s.jsx(M3,{questionnaire:l,subject:p&&ht(p),onSubmit:x})})]});async function x(w){const b=[];if(!u||u.length===0)b.push(await o.createResource(w));else for(const j of u)b.push(await o.createResource({...w,subject:{reference:j}}));_(b)}}const rye={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function kA(e,t){const r=e.resourceType||nye(t),n=e.fields??oye(r),o=e.filters??(e.resourceType?void 0:iye(r)),i=e.sortRules??aye(r),a=e.offset??0,l=e.count??Wc;return{...e,resourceType:r,fields:n,filters:o,sortRules:i,offset:a,count:l}}function nye(e){var t,r;return localStorage.getItem("defaultResourceType")??((r=(t=e==null?void 0:e.option)==null?void 0:t.find(n=>n.id==="defaultResourceType"))==null?void 0:r.valueString)??"Patient"}function oye(e){const t=j1(e);if(t!=null&&t.fields)return t.fields;const r=["id","_lastUpdated"];switch(e){case"Patient":r.push("name","birthDate","gender");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":r.push("name");break;case"CodeSystem":case"ValueSet":r.push("name","title","status");break;case"Condition":r.push("subject","code","clinicalStatus");break;case"Device":r.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":r.push("manufacturer[x]","deviceName");break;case"DeviceRequest":r.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":r.push("subject","code","status");break;case"Encounter":r.push("subject");break;case"ServiceRequest":r.push("subject","code","status","orderDetail");break;case"Subscription":r.push("criteria");break;case"User":r.push("email");break}return r}function iye(e){var t;return(t=j1(e))==null?void 0:t.filters}function aye(e){const t=j1(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function j1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function sye(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function lye(e,t){const r={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},n=kA(r,t.getUserConfiguration()),o=await t.search(n.resourceType,es({...n,total:"accurate",fields:void 0}));return _4(o)}const cye=W(e=>({paper:{[`@media (max-width: ${e.breakpoints.sm})`]:{margin:2,padding:4}}}));function cE(){const{classes:e}=cye(),t=ne(),r=jt(),n=Ti(),[o,i]=f.useState();return f.useEffect(()=>{const a=Ele(n.pathname+n.search),l=kA(a,t.getUserConfiguration());n.pathname===`/${l.resourceType}`&&n.search===es(l)?(sye(l),i(l)):r(`/${l.resourceType}${es(l)}`)},[t,r,n]),!(o!=null&&o.resourceType)||!o.fields||o.fields.length===0?s.jsx(In,{}):s.jsx(dn,{shadow:"xs",m:"md",p:"xs",className:e.paper,children:s.jsx(Kc,{checkboxesEnabled:!0,search:o,userConfig:t.getUserConfiguration(),onClick:a=>r(`/${a.resource.resourceType}/${a.resource.id}`),onAuxClick:a=>window.open(`/${a.resource.resourceType}/${a.resource.id}`,"_blank"),onChange:a=>{r(`/${o.resourceType}${es(a.definition)}`)},onNew:()=>{r(rye[o.resourceType]??`/${o.resourceType}/new`)},onExportCsv:()=>{const a=t.fhirUrl(o.resourceType,"$csv")+es(o);t.download(a).then(l=>{window.open(window.URL.createObjectURL(l),"_blank")}).catch(l=>de({color:"red",message:je(l),autoClose:!1}))},onExportTransactionBundle:async()=>{lye(o,t).then(a=>eye(JSON.stringify(a,void 0,2))).catch(a=>de({color:"red",message:je(a),autoClose:!1}))},onDelete:a=>{window.confirm("Are you sure you want to delete these resources?")&&(t.invalidateSearches(o.resourceType),t.executeBatch({resourceType:"Bundle",type:"batch",entry:a.map(l=>({request:{method:"DELETE",url:`${o.resourceType}/${l}`}}))}).then(()=>i({...o})).catch(l=>de({color:"red",message:je(l),autoClose:!1})))},onBulk:a=>{r(`/bulk/${o.resourceType}?ids=${a.join(",")}`)}})})}function uye(){const e=ne(),[t,r]=f.useState(),[n,o]=f.useState(void 0);f.useEffect(()=>{e.get("auth/mfa/status").then(l=>{const c=new URL("https://chart.googleapis.com/chart");c.searchParams.set("chs","300x300"),c.searchParams.set("cht","qr"),c.searchParams.set("chl",l.enrollUri),c.searchParams.set("choe","UTF-8"),r(c.toString()),o(l.enrolled)}).catch(l=>de({color:"red",message:je(l),autoClose:!1}))},[e]);const i=f.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),de({color:"green",message:"Success"})}).catch(c=>de({color:"red",message:je(c),autoClose:!1}))},[e]),a=f.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return n===void 0?null:n?s.jsx(we,{children:s.jsxs(K,{children:[s.jsx(ue,{children:"MFA is enabled"}),s.jsx(re,{onClick:a,children:"Disable MFA"})]})}):s.jsx(we,{width:400,children:s.jsxs(Ne,{onSubmit:i,children:[s.jsx(ue,{children:"Multi Factor Auth Setup"}),s.jsx(ar,{children:s.jsx("img",{src:t})}),s.jsx(le,{name:"token",label:"Code"}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Enroll"})})]})})}const dye={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function Zc(){return dye}function fye(){const e=jt(),[t]=b1(),r=t.get("client_id");if(!r)return null;const n=t.get("scope")||"openid";function o(i){const a=new URL(t.get("redirect_uri"));for(const l of["scope","state","nonce"])t.has(l)&&a.searchParams.set(l,t.get(l));a.searchParams.set("code",i),window.location.assign(a.toString())}return s.jsxs(q3,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Zc().googleClientId,clientId:r||void 0,scope:n,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:n!=="openid",children:[s.jsx(Nn,{size:32}),s.jsx(ue,{children:"Sign in to Medplum"})]})}function pye(){const e=ne(),t=jt(),r=Zc();return f.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),s.jsxs(Whe,{type:"project",onSuccess:()=>t("/"),googleClientId:r.googleClientId,recaptchaSiteKey:r.recaptchaSiteKey,children:[s.jsx(Nn,{size:32}),s.jsx(ue,{children:"Create a new account"})]})}function hye(){const e=jt(),t=ne(),[r,n]=f.useState(),[o,i]=f.useState(!1),a=Zc().recaptchaSiteKey;return f.useEffect(()=>{W3(a)},[a]),s.jsx(we,{width:450,children:s.jsxs(Ne,{style:{maxWidth:400},onSubmit:async l=>{let c="";c=await H3(a),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>n(lt(u)))},children:[s.jsxs(be,{spacing:"lg",mb:"xl",align:"center",children:[s.jsx(Nn,{size:32}),s.jsx(ue,{children:"Medplum Password Reset"})]}),s.jsxs(be,{spacing:"xl",children:[s.jsx(lo,{issues:Rm(r,void 0)}),!o&&s.jsxs(s.Fragment,{children:[s.jsx(le,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Ie(r,"email")}),s.jsxs(K,{position:"apart",mt:"xl",noWrap:!0,children:[s.jsx(Fe,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),s.jsx(re,{type:"submit",children:"Reset password"})]})]}),o&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function mye(){var i;const e=jt(),t=ne(),[r,n]=f.useState();f.useEffect(()=>{t.get("auth/me").then(n).catch(a=>de({color:"red",message:je(a),autoClose:!1}))},[t]);function o(a){t.post("auth/revoke",{loginId:a}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(n).then(()=>de({color:"green",message:"Login revoked"})).catch(l=>de({color:"red",message:je(l),autoClose:!1}))}return r?s.jsxs(s.Fragment,{children:[s.jsxs(we,{children:[s.jsx(ue,{children:"Security"}),s.jsxs(Xx,{children:[s.jsx(us,{term:"ID",children:s.jsx(Fe,{href:`/${at(r.profile)}`,children:r.profile.id})}),s.jsx(us,{term:"Resource Type",children:r.profile.resourceType}),s.jsx(us,{term:"Name",children:Uc((i=r.profile.name)==null?void 0:i[0])})]})]}),s.jsxs(we,{children:[s.jsx(ue,{children:"Sessions"}),s.jsxs(wa,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:r.security.sessions.map(a=>s.jsxs("tr",{children:[s.jsx("td",{children:a.os}),s.jsx("td",{children:a.browser}),s.jsx("td",{children:a.remoteAddress}),s.jsx("td",{children:a.authMethod}),s.jsx("td",{children:Nr(a.lastUpdated)}),s.jsx("td",{children:s.jsx(Fe,{href:"#",onClick:()=>o(a.id),children:"Revoke"})})]},a.id))})]})]}),s.jsxs(we,{children:[s.jsx(ue,{children:"Password"}),s.jsx(re,{onClick:()=>e("/changepassword"),children:"Change password"})]}),s.jsxs(we,{children:[s.jsx(ue,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",r.security.mfaEnrolled.toString()]}),!r.security.mfaEnrolled&&s.jsx(re,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function gye(){const{id:e,secret:t}=Ge(),r=ne(),[n,o]=f.useState(),[i,a]=f.useState(!1),l=Rm(n,void 0);return s.jsxs(we,{width:450,children:[s.jsx(lo,{issues:l}),s.jsxs(Ne,{style:{maxWidth:400},onSubmit:c=>{if(c.password!==c.confirmPassword){o(yi("Passwords do not match","confirmPassword"));return}o(void 0);const u={id:e,secret:t,password:c.password};r.post("auth/setpassword",u).then(()=>a(!0)).catch(d=>o(lt(d)))},children:[s.jsxs(ar,{sx:{flexDirection:"column"},children:[s.jsx(Nn,{size:32}),s.jsx(ue,{children:"Set password"})]}),!i&&s.jsxs(be,{children:[s.jsx(to,{name:"password",label:"New password",required:!0,error:Ie(n,"password")}),s.jsx(to,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ie(n,"confirmPassword")}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Set password"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx($e,{to:"/signin",children:"sign in"}),"."]})]})]})}function vye(){const e=Vx(),t=jt(),[r]=b1(),n=Zc(),o=f.useCallback(()=>{const i=r.get("next");t(i!=null&&i.startsWith("/")?i:"/")},[r,t]);return f.useEffect(()=>{e&&r.has("next")&&o()},[e,r,o]),s.jsxs(q3,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:()=>t("/register"),googleClientId:n.googleClientId,login:r.get("login")||void 0,projectId:r.get("project")||void 0,children:[s.jsx(Nn,{size:32}),s.jsx(ue,{children:"Sign in to Medplum"}),r.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function yye(){const e=jt(),t=Ti(),[r,n]=f.useState(),[o,i]=f.useState(),[a,l]=f.useState();return f.useEffect(()=>{const c=Object.fromEntries(new URLSearchParams(t.search).entries());n(c.resourceType),i(c.query),l(JSON.parse(c.fields))},[t]),!r||!o||!a?null:s.jsx(xpe,{resourceType:r,checkboxesEnabled:!0,query:o,fields:a,onClick:c=>e(`/${r}/${c.resource.id}`),onAuxClick:c=>window.open(`/${r}/${c.resource.id}`,"_blank"),onBulk:c=>{e(`/bulk/${r}?ids=${c.join(",")}`)}})}function Bm(e){const t=ne(),r=Ii(t),n=jt(),[o,i]=f.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ie.EQUALS,value:"Project/"+r},{code:"profile-type",operator:ie.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(Kc,{search:o,onClick:a=>n(`/admin/members/${a.resource.id}`),onChange:a=>i(a.definition),hideFilters:!0,hideToolbar:!0})}function xye(){return s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:"Bots"}),s.jsx(Bm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(K,{position:"right",children:s.jsx($e,{to:"/admin/bots/new",children:"Create new bot"})})]})}function wye(){return s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:"Clients"}),s.jsx(Bm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(K,{position:"right",children:s.jsx($e,{to:"/admin/clients/new",children:"Create new client"})})]})}function Um(e){return s.jsx(Bs,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Vo(t)?e.onChange(ht(t)):e.onChange(void 0)}})}function bye(){const e=ne(),t=Ii(e),[r,n]=f.useState(""),[o,i]=f.useState(""),[a,l]=f.useState(),[c,u]=f.useState(),[d,p]=f.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:"Create new Bot"}),s.jsxs(Ne,{onSubmit:()=>{const h={name:r,description:o,accessPolicy:a};e.post("admin/projects/"+t+"/bot",h).then(m=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),p(m),de({color:"green",message:"Bot created"})}).catch(m=>{de({color:"red",message:je(m),autoClose:!1}),u(lt(m))})},children:[!d&&s.jsxs(be,{children:[s.jsx(Je,{title:"Name",htmlFor:"name",outcome:c,children:s.jsx(le,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>n(h.currentTarget.value),error:Ie(c,"name")})}),s.jsx(Je,{title:"Description",htmlFor:"description",outcome:c,children:s.jsx(le,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:Ie(c,"description")})}),s.jsx(Je,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:s.jsx(Um,{name:"accessPolicy",onChange:l})}),s.jsx(K,{position:"right",children:s.jsx(re,{type:"submit",children:"Create Bot"})})]}),d&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(oe,{children:"Bot created"}),s.jsxs(Er,{children:[s.jsx(Er.Item,{children:s.jsx($e,{to:d,children:"Go to new bot"})}),s.jsx(Er.Item,{children:s.jsx($e,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function _ye(){const e=ne(),t=Ii(e),[r,n]=f.useState(""),[o,i]=f.useState(""),[a,l]=f.useState(""),[c,u]=f.useState(),[d,p]=f.useState(),[h,m]=f.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:"Create new Client"}),s.jsxs(Ne,{onSubmit:()=>{const g={name:r,description:o,redirectUri:a,accessPolicy:c};e.post("admin/projects/"+t+"/client",g).then(v=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),m(v),de({color:"green",message:"Client created"})}).catch(v=>{de({color:"red",message:je(v),autoClose:!1}),p(lt(v))})},children:[!h&&s.jsxs(be,{children:[s.jsx(Je,{title:"Name",htmlFor:"name",outcome:d,children:s.jsx(le,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>n(g.currentTarget.value),error:Ie(d,"name")})}),s.jsx(Je,{title:"Description",htmlFor:"description",outcome:d,children:s.jsx(le,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:Ie(d,"description")})}),s.jsx(Je,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:s.jsx(le,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:Ie(d,"redirectUri")})}),s.jsx(Je,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:s.jsx(Um,{name:"accessPolicy",onChange:u})}),s.jsx(K,{position:"right",children:s.jsx(re,{type:"submit",children:"Create Client"})})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(oe,{children:"Client created"}),s.jsxs(Er,{children:[s.jsx(Er.Item,{children:s.jsx($e,{to:h,children:"Go to new client"})}),s.jsx(Er.Item,{children:s.jsx($e,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function Sye(e){return s.jsx(Bs,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Vo(t)?e.onChange(ht(t)):e.onChange(void 0)}})}function Pye(){const{membershipId:e}=Ge(),t=ne(),r=Ii(t),n=jt(),o=t.get(`admin/projects/${r}/members/${e}`).read(),[i,a]=f.useState(o.accessPolicy),[l,c]=f.useState(o.userConfiguration),[u,d]=f.useState(o.admin),[p,h]=f.useState(),[m,g]=f.useState(!1);function v(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${r}/members/${e}`).then(()=>t.get(`admin/projects/${r}`,{cache:"no-cache"})).then(()=>n("/admin/project")).catch(_=>h(lt(_)))}return s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(ds,{value:o.profile,link:!0})}),s.jsxs(Ne,{onSubmit:()=>{const _={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${r}/members/${e}`,_).then(()=>g(!0)).catch(y=>h(lt(y)))},children:[!m&&s.jsxs(be,{children:[s.jsx(Je,{title:"Access Policy",htmlFor:"accessPolicy",outcome:p,children:s.jsx(Um,{name:"accessPolicy",defaultValue:i,onChange:a})}),s.jsx(Je,{title:"User Configuration",htmlFor:"userConfiguration",outcome:p,children:s.jsx(Sye,{name:"userConfiguration",defaultValue:l,onChange:c})}),s.jsx(Je,{title:"Admin",htmlFor:"admin",outcome:p,children:s.jsx(Tn,{id:"admin",name:"admin",defaultChecked:u,onChange:_=>d(_.currentTarget.checked)})}),s.jsxs(K,{position:"right",mt:"xl",children:[s.jsx(re,{type:"submit",children:"Save"}),s.jsx(re,{type:"button",color:"red",variant:"outline",onClick:v,children:"Remove user"})]})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(p,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx($e,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function jye(){const e=ne(),[t,r]=f.useState(e.getProject()),[n,o]=f.useState(),[i,a]=f.useState(),[l,c]=f.useState(!1),[u,d]=f.useState(void 0),p=f.useCallback(h=>{const m={resourceType:h.resourceType,firstName:h.firstName,lastName:h.lastName,email:h.email,sendEmail:h.sendEmail==="on",accessPolicy:n,admin:h.isAdmin==="on"};e.invite(t==null?void 0:t.id,m).then(g=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),bm(g)?a(g):d(g),c(m.sendEmail??!1),de({color:"green",message:"Invite success"})}).catch(g=>{de({color:"red",message:je(g),autoClose:!1}),a(lt(g))})},[e,t,n]);return s.jsxs(Ne,{onSubmit:p,children:[!u&&!i&&s.jsxs(be,{children:[s.jsx(ue,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(Je,{title:"Project",htmlFor:"project",outcome:i,children:s.jsx(Bs,{resourceType:"Project",name:"project",defaultValue:t,onChange:r})}),s.jsx(mt,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Ie(i,"resourceType")}),s.jsx(le,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Ie(i,"firstName")}),s.jsx(le,{name:"lastName",label:"Last Name",required:!0,error:Ie(i,"lastName")}),s.jsx(le,{name:"email",type:"email",label:"Email",required:!0,error:Ie(i,"email")}),s.jsx(Je,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:s.jsx(Um,{name:"accessPolicy",onChange:o})}),s.jsx(Tn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Tn,{name:"isAdmin",label:"Admin"}),s.jsx(K,{position:"right",children:s.jsx(re,{type:"submit",children:"Invite"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx($e,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(oe,{children:"User created"}),l&&s.jsx(oe,{children:"Email sent"}),s.jsxs(Er,{children:[s.jsx(Er.Item,{children:s.jsx($e,{to:u,children:"Go to new membership"})}),s.jsx(Er.Item,{children:s.jsx($e,{to:u.profile,children:"Go to new profile"})}),s.jsx(Er.Item,{children:s.jsx($e,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function Oye(){return s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:"Patients"}),s.jsx(Bm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(K,{position:"right",children:s.jsx($e,{to:"/admin/invite",children:"Invite new patient"})})]})}function uE(){const e=ne(),t=Ii(e),r=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:"Details"}),s.jsxs(Xx,{children:[s.jsx(us,{term:"ID",children:r.project.id}),s.jsx(us,{term:"Name",children:r.project.name})]})]})}const dE=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function Cye(){const e=jt(),r=Ti().pathname.replace("/admin/","")||dE[0],n=ne(),o=Ii(n),i=f.useMemo(()=>n.get("admin/projects/"+o).read(),[n,o]);function a(l){e(`/admin/${l}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(dn,{children:[s.jsx(Pe,{children:s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Project"}),s.jsx(Pe.Value,{children:i.project.name})]})}),s.jsx(ga,{children:s.jsx(ze,{value:r.toLowerCase(),onTabChange:a,children:s.jsx(ze.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:dE.map(l=>s.jsx(ze.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),s.jsx(we,{children:s.jsx(w1,{})})]})}function Eye(){const e=ne(),t=Ii(e),r=e.get(`admin/projects/${t}`).read(),[n,o]=f.useState(!1),[i,a]=f.useState();return f.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),f.useEffect(()=>{r&&a(ki(r.project.secret||[]))},[e,r]),!n||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/secrets`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>de({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(ue,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(Us,{property:Sa("Project","secret"),name:"secret",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(re,{type:"submit",children:"Save"})]})}function $ye(){const e=ne(),t=Ii(e),r=e.get(`admin/projects/${t}`).read(),[n,o]=f.useState(!1),[i,a]=f.useState();return f.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),f.useEffect(()=>{r&&a(ki(r.project.site||[]))},[e,r]),!n||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/sites`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>de({color:"green",message:"Saved"})).catch(c=>{var d,p,h,m;const u=lt(c);de({color:"red",message:`Error ${(p=(d=u.issue)==null?void 0:d[0].details)==null?void 0:p.text} ${(m=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:m[0]}`,autoClose:!1})})},children:[s.jsx(ue,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(Us,{property:Sa("Project","site"),name:"site",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(re,{type:"submit",children:"Save"})]})}function kye(){const e=ne();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(lo,{outcome:u4});function t(){_l(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function r(){_l(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function n(){_l(e,"Rebuilding Value Sets","admin/super/valuesets")}function o(u){_l(e,"Reindexing Resources","admin/super/reindex",u)}function i(u){_l(e,"Rebuilding Compartments","admin/super/compartments",u)}function a(u){e.post("admin/super/removebotidjobsfromqueue",u).then(()=>de({color:"green",message:"Done"})).catch(d=>de({color:"red",message:je(d),autoClose:!1}))}function l(u){e.post("admin/super/purge",{...u,before:G4(u.before)}).then(()=>de({color:"green",message:"Done"})).catch(d=>de({color:"red",message:je(d),autoClose:!1}))}function c(u){e.post("admin/super/setpassword",u).then(()=>de({color:"green",message:"Done"})).catch(d=>de({color:"red",message:je(d),autoClose:!1}))}return s.jsxs(we,{width:600,children:[s.jsx(ue,{order:1,children:"Super Admin"}),s.jsx(mr,{my:"lg"}),s.jsx(ue,{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(Ne,{children:s.jsx(re,{onClick:t,children:"Rebuild StructureDefinitions"})}),s.jsx(mr,{my:"lg"}),s.jsx(ue,{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(Ne,{children:s.jsx(re,{onClick:r,children:"Rebuild SearchParameters"})}),s.jsx(mr,{my:"lg"}),s.jsx(ue,{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(Ne,{children:s.jsx(re,{onClick:n,children:"Rebuild ValueSets"})}),s.jsx(mr,{my:"lg"}),s.jsx(ue,{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(Ne,{onSubmit:o,children:s.jsxs(be,{children:[s.jsx(Je,{title:"Resource Type",children:s.jsx(le,{name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(re,{type:"submit",children:"Reindex"})]})}),s.jsx(mr,{my:"lg"}),s.jsx(ue,{order:2,children:"Rebuild Compartments"}),s.jsx("p",{children:"When Medplum changes how resource compartments are derived, the system may require a rebuild for old resources to take effect."}),s.jsx(Ne,{onSubmit:i,children:s.jsxs(be,{children:[s.jsx(Je,{title:"Resource Type",children:s.jsx(le,{name:"resourceType",placeholder:"Compartments Resource Type"})}),s.jsx(re,{type:"submit",children:"Rebuild Compartments"})]})}),s.jsx(mr,{my:"lg"}),s.jsx(ue,{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(Ne,{onSubmit:l,children:s.jsxs(be,{children:[s.jsx(Je,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(mt,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(Je,{title:"Purge Before",htmlFor:"before",children:s.jsx(la,{name:"before",placeholder:"Before Date"})}),s.jsx(re,{type:"submit",children:"Purge"})]})}),s.jsx(mr,{my:"lg"}),s.jsx(ue,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(Ne,{onSubmit:a,children:s.jsxs(be,{children:[s.jsx(Je,{title:"Bot ID",children:s.jsx(le,{name:"botId",placeholder:"Bot Id"})}),s.jsx(re,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(mr,{my:"lg"}),s.jsx(ue,{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(Ne,{onSubmit:c,children:s.jsxs(be,{children:[s.jsx(le,{name:"email",label:"Email",required:!0}),s.jsx(to,{name:"password",label:"Password",required:!0}),s.jsx(le,{name:"projectId",label:"Project ID"}),s.jsx(re,{type:"submit",children:"Force Set Password"})]})})]})}function _l(e,t,r,n){So.show({id:r,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST"};n&&(o.body=JSON.stringify(n)),e.startAsyncRequest(r,o).then(()=>{So.update({id:r,color:"green",title:t,message:"Done",icon:s.jsx(Cm,{size:"1rem"}),autoClose:!1,withCloseButton:!0})}).catch(i=>{So.update({id:r,color:"red",title:t,message:je(i),icon:s.jsx(gh,{size:"1rem"}),autoClose:!1,withCloseButton:!0})})}function Rye(){const e=ne();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(lo,{outcome:u4});function t(r){e.post("admin/projects/setpassword",r).then(()=>de({color:"green",message:"Done"})).catch(n=>de({color:"red",message:je(n),autoClose:!1}))}return s.jsxs(we,{width:600,children:[s.jsx(ue,{order:1,children:"Project Admin"}),s.jsx(mr,{my:"lg"}),s.jsx(ue,{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(Ne,{onSubmit:t,children:s.jsxs(be,{children:[s.jsx(le,{name:"email",label:"Email",required:!0}),s.jsx(to,{name:"password",label:"Password",required:!0}),s.jsx(re,{type:"submit",children:"Force Set Password"})]})})]})}function Tye(){return s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:"Users"}),s.jsx(Bm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(K,{position:"right",children:s.jsx($e,{to:"/admin/invite",children:"Invite new user"})})]})}function Iye(){const[e]=Os("ObservationDefinition","_count=100");return e?s.jsxs(wa,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var r,n,o,i;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ro,{value:(r=t.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(ro,{value:t.code})}),s.jsx("td",{children:s.jsx(ro,{value:t.method})}),s.jsx("td",{children:(o=(n=t.quantitativeDetails)==null?void 0:n.unit)==null?void 0:o.text}),s.jsx("td",{children:(i=t.quantitativeDetails)==null?void 0:i.decimalPrecision}),s.jsx("td",{children:s.jsx(Vy,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(In,{})}function Vy(e){const{ranges:t}=e;if(!t)return null;const r=fE(t.map(o=>o.gender));if(r.length>1)return r.sort((o,i)=>o.localeCompare(i)),s.jsx(s.Fragment,{children:r.map(o=>{var i;return s.jsxs(f.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:er(o)})}),s.jsx(Vy,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>a.gender===o)})]},o)})});const n=fE(t.map(o=>o.age&&hc(o.age)));return n.length>1?(n.sort((o,i)=>o.localeCompare(i)),s.jsx(s.Fragment,{children:n.map(o=>{var i;return s.jsxs(f.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:er(o)})}),s.jsx(Vy,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>hc(a.age)===o)})]},o)})})):s.jsx(s.Fragment,{children:t.map(o=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:o.condition}),s.jsx("td",{children:s.jsx(Jx,{value:o.range})})]})})},`range-${o.condition}`))})}function fE(e){return[...new Set(e.filter(t=>!!t))]}function Dye(){const[e]=Os("ActivityDefinition","_count=100"),[t]=Os("ObservationDefinition","_count=100");return!e||!t?s.jsx(In,{}):s.jsxs(wa,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(r=>s.jsx("th",{children:r.name},r.id))]})}),s.jsx("tbody",{children:t.map(r=>{var n;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ro,{value:(n=r.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(ro,{value:r.code})}),e.map(o=>{var i;return s.jsx("td",{children:(i=o.observationResultRequirement)!=null&&i.find(a=>{var l;return(l=a.reference)==null?void 0:l.includes(r.id)})?"✅":""},o.id)})]},r.id)})})]})}function Nye(e){var a;const t=ne(),[r,n]=f.useState(),[o,i]=f.useState();return o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx($e,{to:o,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx($e,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(Ne,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueReference:r}]}).then(i).catch(console.log)},children:s.jsxs(be,{children:[s.jsxs(ue,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(oe,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(oe,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(a=e.planDefinition.action)==null?void 0:a.map((l,c)=>{var u;return s.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&s.jsx(s.Fragment,{children:l.title}),l.code&&s.jsx(ro,{value:l.code[0]})]},`action-${c}`)})}),s.jsx(Je,{title:"Subject",children:s.jsx(Tm,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:r,onChange:n})}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Go"})})]})})}function Aye(){const{resourceType:e,id:t}=Ge(),r=et({reference:e+"/"+t});return r?s.jsx(we,{children:s.jsx(Nye,{planDefinition:r})}):null}function Mye(){const{resourceType:e,id:t}=Ge(),r=et({reference:e+"/"+t}),[n,o]=Os("Questionnaire","subject-type="+e),[i,a]=Os("ClientApplication",{_count:1e3});if(!r||o||a)return s.jsx(In,{});const l=i==null?void 0:i.filter(d=>Lye(e)&&!!d.launchUri);if((!n||n.length===0)&&(!l||l.length===0))return s.jsxs(we,{children:[s.jsx(ue,{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 c,u;return r.resourceType==="Patient"?c=ht(r):r.resourceType==="Encounter"&&(c=r.subject,u=ht(r)),s.jsxs(we,{children:[n==null?void 0:n.map(d=>s.jsxs("div",{children:[s.jsx(ue,{order:3,children:s.jsx($e,{to:`/forms/${d.id}?subject=${at(r)}`,children:d.title||d.name})}),s.jsx(oe,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>s.jsxs("div",{children:[s.jsx(ue,{order:3,children:s.jsx(Vhe,{client:d,patient:c,encounter:u,children:d.name})}),s.jsx(oe,{children:d.description})]},d.id))]})}function Lye(e){return e==="Patient"||e==="Encounter"}function zye(){const{resourceType:e,id:t}=Ge(),r=jt(),[n,o]=f.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ie.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(we,{children:s.jsx(Kc,{search:n,onClick:i=>r(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function Fye(){const e=ne(),{resourceType:t,id:r}=Ge(),n=e.readHistory(t,r).read();return s.jsx(we,{children:s.jsx(Ihe,{history:n})})}function Vye(e){const t="https://codeeditor.medplum.com/bot-runner.html";return s.jsx("iframe",{frameBorder:"0",src:t,className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function Bye(e){const t=e.defaultValue,r=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&r.searchParams.set("module",e.module),s.jsx("iframe",{frameBorder:"0",src:r.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:n=>{_d(n.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Uye=`{
233
+ "resourceType": "Patient",
234
+ "name": [
235
+ {
236
+ "given": [
237
+ "Alice"
238
+ ],
239
+ "family": "Smith"
240
+ }
241
+ ]
242
+ }`,Wye="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-",Hye=W(()=>({hl7Input:{fontFamily:"monospace",fontSize:"12px",lineHeight:1.55,padding:"10px 12px",whiteSpace:"nowrap",width:"100%"}}));function qye(){const e=ne(),{id:t}=Ge(),[r,n]=f.useState(),[o,i]=f.useState(),[a,l]=f.useState(Uye),[c,u]=f.useState(Wye),[d,p]=f.useState(Kt.FHIR_JSON),{classes:h}=Hye(),m=f.useRef(null),g=f.useRef(null),[v,_]=f.useState(!1);f.useEffect(()=>{e.readResource("Bot",t).then(async P=>{n(P),i(await Gye(e,P))}).catch(P=>de({color:"red",message:je(P),autoClose:!1}))},[e,t]);const y=f.useCallback(()=>_d(m.current,{command:"getValue"}),[]),x=f.useCallback(()=>_d(m.current,{command:"getOutput"}),[]),w=f.useCallback(async()=>d===Kt.FHIR_JSON?JSON.parse(a):c,[d,a,c]),b=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),_(!0);try{const E=await y(),k=await e.createAttachment(E,"index.ts","text/typescript"),$=[];r!=null&&r.sourceCode?$.push({op:"replace",path:"/sourceCode",value:k}):$.push({op:"add",path:"/sourceCode",value:k}),await e.patchResource("Bot",t,$),de({color:"green",message:"Saved"})}catch(E){de({color:"red",message:je(E),autoClose:!1})}finally{_(!1)}},[e,t,r,y]),j=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),_(!0);try{const E=await x();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:E}),de({color:"green",message:"Deployed"})}catch(E){de({color:"red",message:je(E),autoClose:!1})}finally{_(!1)}},[e,t,x]),C=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),_(!0);try{const E=await w(),k=await e.post(e.fhirUrl("Bot",t,"$execute"),E,d);await _d(g.current,{command:"setValue",value:k}),de({color:"green",message:"Success"})}catch(E){de({color:"red",message:je(E),autoClose:!1})}finally{_(!1)}},[e,t,w,d]);return!r||o===void 0?null:s.jsxs(ln,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(ln.Col,{span:8,children:s.jsxs(dn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(Bye,{iframeRef:m,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(K,{position:"right",spacing:"xs",children:[s.jsx(re,{type:"button",onClick:b,loading:v,leftIcon:s.jsx(Hce,{size:"1rem"}),children:"Save"}),s.jsx(re,{type:"button",onClick:j,loading:v,leftIcon:s.jsx(Bx,{size:"1rem"}),children:"Deploy"}),s.jsx(re,{type:"button",onClick:C,loading:v,leftIcon:s.jsx(sue,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(ln.Col,{span:4,children:[s.jsxs(dn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(mt,{data:[{label:"FHIR",value:Kt.FHIR_JSON},{label:"HL7",value:Kt.HL7_V2}],onChange:P=>p(P.currentTarget.value)}),d===Kt.FHIR_JSON?s.jsx(Vs,{value:a,onChange:P=>l(P),minRows:15}):s.jsx("textarea",{className:h.hl7Input,value:c,onChange:P=>u(P.currentTarget.value),rows:15})]}),s.jsx(dn,{m:2,p:"xs",shadow:"md",children:s.jsx(Vye,{iframeRef:g,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Gye(e,t){var r,n,o;if((r=t.sourceCode)!=null&&r.url){const i=(o=(n=t.sourceCode.url)==null?void 0:n.split("/"))==null?void 0:o.find(X5);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Hs(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Qye(e,t){var r,n;(n=(r=e==null?void 0:e.meta)==null?void 0:r.profile)!=null&&n.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t))}function Kye(e,t){var r,n;if((n=(r=e==null?void 0:e.meta)==null?void 0:r.profile)!=null&&n.includes(t)){const o=e.meta.profile.indexOf(t);e.meta.profile.splice(o,1)}}function Yye(){const e=ne(),{resourceType:t,id:r}=Ge(),n={reference:t+"/"+r},o=f.useCallback(i=>{e.updateResource(Hs(i)).then(()=>{de({color:"green",message:"Success"})}).catch(a=>{de({color:"red",message:je(a),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(we,{children:s.jsx(Cpe,{value:n,onSubmit:o})});case"Questionnaire":return s.jsx(we,{children:s.jsx(ehe,{questionnaire:n,onSubmit:o})});default:return null}}function Xye(){const{resourceType:e,id:t}=Ge(),r=et({reference:e+"/"+t}),n=jt();return r?s.jsx(we,{children:s.jsx(She,{value:r,onStart:(o,i)=>n(`/forms/${Px(i)}`),onEdit:(o,i,a)=>n(`/${a.reference}}`)})}):null}function Jye(){const e=ne(),{resourceType:t,id:r}=Ge(),n=jt();return s.jsxs(we,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(re,{color:"red",onClick:()=>{e.deleteResource(t,r).then(()=>n(`/${t}`)).catch(o=>de({color:"red",message:je(o),autoClose:!1}))},children:"Delete"})]})}function Zye(){const{resourceType:e,id:t}=Ge(),r=et({reference:e+"/"+t});return r?s.jsx(we,{children:s.jsx(l1,{value:r})}):null}function e0e(){const e=ne(),{resourceType:t,id:r}=Ge(),[n,o]=f.useState(),i=jt(),[a,l]=f.useState();f.useEffect(()=>{e.readResource(t,r).then(d=>o(ki(d))).catch(d=>{l(lt(d)),de({color:"red",message:je(d),autoClose:!1})})},[e,t,r]);const c=f.useCallback(d=>{l(void 0),e.updateResource(Hs(d)).then(()=>{i(`/${t}/${r}/details`),de({color:"green",message:"Success"})}).catch(p=>{l(lt(p)),de({color:"red",message:je(p),autoClose:!1})})},[e,t,r,i]),u=f.useCallback(()=>i(`/${t}/${r}/delete`),[i,t,r]);return n?s.jsx(we,{children:s.jsx(g1,{defaultValue:n,onSubmit:c,onDelete:u,outcome:a})}):null}function t0e(){const e=ne(),{resourceType:t,id:r}=Ge(),n=e.readHistory(t,r).read();return s.jsx(we,{children:s.jsx(Mhe,{history:n})})}function r0e(){const e=ne(),{resourceType:t,id:r}=Ge(),n=et({reference:t+"/"+r}),o=jt(),[i,a]=f.useState(),l=f.useCallback(c=>{e.updateResource(Hs(JSON.parse(c.resource))).then(()=>{a(void 0),o(`/${t}/${r}/details`),de({color:"green",message:"Success"})}).catch(u=>{de({color:"red",message:je(u),autoClose:!1})})},[e,t,r,o]);return n?s.jsxs(we,{children:[i&&s.jsx(lo,{outcome:i}),s.jsxs(Ne,{onSubmit:l,children:[s.jsx(Vs,{name:"resource","data-testid":"resource-json",minRows:24,defaultValue:Dr(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"OK"})})]})]}):null}function n0e(){const{resourceType:e,id:t}=Ge();return et({reference:e+"/"+t})?s.jsxs(we,{children:[s.jsxs(Rc,{icon:s.jsx(Om,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Fe,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(M3,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function o0e(){const e=ne(),{id:t}=Ge(),[r,n]=f.useState(),[o,i]=f.useState(0),a=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>i0e(c,t));function l(){r&&e.createResource({resourceType:"Subscription",status:"active",reason:r.name,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:at(r)}}).then(()=>{n(void 0),i(Date.now()),e.invalidateSearches("Subscription"),de({color:"green",message:"Success"})}).catch(c=>de({color:"red",message:je(c),autoClose:!1}))}return s.jsxs(we,{children:[s.jsx(ue,{children:"Bots"}),a.length===0&&s.jsx("p",{children:"No bots found."}),a.map(c=>{var u;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Gc,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),s.jsx("hr",{}),s.jsx(ue,{children:"Connect to bot"}),s.jsxs(K,{children:[s.jsx(Bs,{name:"bot",resourceType:"Bot",onChange:n}),s.jsx(re,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function i0e(e,t){var o;const r=e.criteria||"",n=((o=e.channel)==null?void 0:o.endpoint)||"";return r.startsWith("QuestionnaireResponse?")&&r.includes(t)&&n.startsWith("Bot/")}function a0e(){const{id:e}=Ge(),t=jt(),[r,n]=f.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ie.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(we,{children:s.jsx(Kc,{search:r,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>n(o.definition),hideFilters:!0,hideToolbar:!0})})}function s0e(){const e=ne(),{resourceType:t,id:r}=Ge(),n=et({reference:t+"/"+r}),o=f.useCallback(i=>{e.updateResource(Hs(i)).then(()=>{de({color:"green",message:"Success"})}).catch(a=>{de({color:"red",message:je(a),autoClose:!1})})},[e]);return n?s.jsx(we,{children:s.jsx(mhe,{onSubmit:o,definition:n})}):null}function l0e(){const{resourceType:e,id:t}=Ge(),r=et({reference:e+"/"+t});return r?s.jsx(we,{children:e==="MeasureReport"?s.jsx(jpe,{measureReport:r}):s.jsx(r1,{value:r})}):null}const c0e=W(e=>({container:{position:"fixed",top:300,left:0,width:160,zIndex:5,fontSize:e.fontSizes.xs,"@media (max-width: 700px)":{display:"none"}},entry:{textAlign:"center",width:150,backgroundColor:e.colors.gray[0],border:`1px solid ${e.colors.gray[3]}`},active:{width:160,backgroundColor:e.colors.yellow[0],border:`1px solid ${e.colors.yellow[5]}`}}));function u0e(e){const{classes:t,cx:r}=c0e(),n=ne(),o=et(e.value),[i,a]=f.useState();return f.useEffect(()=>{if(!o)return;const l=P1(o);if(!l)return;const c="reference"in l?l.reference:at(l);n.search("ServiceRequest","subject="+c).then(u=>{const p=u.entry.map(h=>h.resource);m3(p),p.reverse(),a(p)}).catch(u=>de({color:"red",message:je(u),autoClose:!1}))},[n,o]),i?s.jsx("div",{"data-testid":"quick-service-requests",className:t.container,children:i.map(l=>{var c,u,d,p,h,m,g;return s.jsxs("div",{className:r(t.entry,{[t.active]:l.id===(o==null?void 0:o.id)}),children:[s.jsx("p",{children:s.jsx($e,{to:l,children:d0e(l)})}),((u=(c=l.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(d=l.category[0])==null?void 0:d.text}),((m=(h=(p=l.code)==null?void 0:p.coding)==null?void 0:h[0])==null?void 0:m.code)&&s.jsx("p",{children:(g=l.code.coding[0])==null?void 0:g.code}),s.jsx("p",{children:f0e(l)})]},l.id)})}):null}function d0e(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function f0e(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const p0e=W(()=>({container:{position:"absolute",top:65,right:5,width:200,height:50,zIndex:15}}));function h0e(e){var i,a,l,c;const{classes:t}=p0e(),r=et(e.valueSet);if(!r)return null;const n=[""],o=(c=(l=(a=(i=r.compose)==null?void 0:i.include)==null?void 0:a[0])==null?void 0:l.concept)==null?void 0:c.map(u=>u.code);return o&&n.push(...o),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:t.container,children:s.jsx(mt,{defaultValue:e.defaultValue,onChange:u=>e.onChange(u.currentTarget.value),data:n})})}function m0e(e){var r,n;const t=et(e.specimen);return t?s.jsxs(Pe,{children:[s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Type"}),s.jsx(Pe.Value,{children:"Specimen"})]}),s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Collected"}),s.jsx(Pe.Value,{children:Nr((r=t.collection)==null?void 0:r.collectedDateTime)})]}),s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Specimen Age"}),s.jsx(Pe.Value,{children:g0e(t)})]}),(n=t.collection)!=null&&n.collectedDateTime&&t.receivedTime?s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Specimen Stability"}),s.jsx(Pe.Value,{children:v0e(t)})]}):s.jsx(s.Fragment,{})]}):null}function g0e(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const r=new Date(t);return RA(TA(r,new Date))}function v0e(e){var n;if(!((n=e.collection)!=null&&n.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),r=new Date(e.receivedTime);return RA(TA(t,r))}function RA(e){return e.toString().padStart(3,"0")+"D"}function TA(e,t){const r=t.getTime()-e.getTime();return Math.floor(r/(1e3*3600*24))}function y0e(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),t}const x0e=["Profiles"];function w0e(){var w,b,j,C,P,E,k;const e=ne(),{resourceType:t,id:r}=Ge(),n={reference:t+"/"+r},o=jt(),[i,a]=f.useState(),l=et(n,a),c=y0e(t),[u,d]=f.useState(()=>{const $=window.location.pathname.split("/").pop();return $&&c.map(I=>I.toLowerCase()).includes($)?$:c[0].toLowerCase()}),p=Ht();async function h(){var R,N;const I=(N=(R=(await e.readHistory(t,r)).entry)==null?void 0:R.find(M=>!!M.resource))==null?void 0:N.resource;I?m(I):de({color:"red",message:"No history to restore",autoClose:!1})}function m($){e.updateResource(Hs($)).then(()=>{a(void 0),de({color:"green",message:"Success"})}).catch(I=>{de({color:"red",message:je(I),autoClose:!1})})}if(i)return Tse(i)?s.jsxs(we,{children:[s.jsx(ue,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(re,{color:"red",onClick:h,children:"Restore"})]}):s.jsx(lo,{outcome:i});function g($){d($),o(`/${t}/${r}/${$}`)}function v($){const I=l,R=I.orderDetail||[];R.length===0&&R.push({}),R[0].text!==$&&(R[0].text=$,m({...I,orderDetail:R}))}const _=l&&P1(l),y=l&&Zve(l),x=(j=(b=(w=e.getUserConfiguration())==null?void 0:w.option)==null?void 0:b.find($=>$.id==="statusValueSet"))==null?void 0:j.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&x&&s.jsx(h0e,{valueSet:{reference:x},defaultValue:(P=(C=l.orderDetail)==null?void 0:C[0])==null?void 0:P.text,onChange:v},at(l)+"-"+((k=(E=l.orderDetail)==null?void 0:E[0])==null?void 0:k.text)),l&&s.jsx(u0e,{value:l}),l&&s.jsxs(dn,{children:[_&&s.jsx(EA,{patient:_}),y&&s.jsx(m0e,{specimen:y}),t!=="Patient"&&s.jsx($A,{resource:n}),s.jsx(ga,{children:s.jsx(ze,{value:u.toLowerCase(),onTabChange:g,children:s.jsx(ze.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map($=>s.jsx(ze.Tab,{value:$.toLowerCase(),children:x0e.includes($)?s.jsxs(K,{spacing:2,noWrap:!0,children:[$,s.jsx(QT,{color:p.primaryColor,size:"sm",children:"Beta"})]}):$},$))})})})]}),s.jsx(w1,{})]})}function pE(){var y,x,w,b;const e=jt(),{resourceType:t,id:r,versionId:n,tab:o}=Ge(),i=ne(),[a,l]=f.useState(!0),[c,u]=f.useState(),[d,p]=f.useState();if(f.useEffect(()=>{p(void 0),l(!0),i.readHistory(t,r).then(j=>u(j)).then(()=>l(!1)).catch(j=>{p(j),l(!1)})},[i,t,r]),a)return s.jsx(In,{});if(!c)return s.jsxs(we,{children:[s.jsx(ue,{children:"Resource not found"}),s.jsx($e,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(j=>{var C,P;return((P=(C=j.resource)==null?void 0:C.meta)==null?void 0:P.versionId)===n});if(m===-1)return s.jsxs(we,{children:[s.jsx(ue,{children:"Version not found"}),s.jsx($e,{to:`/${t}/${r}`,children:"Return to resource"})]});const g=h[m].resource,v=m<h.length-1?h[m+1].resource:void 0,_="diff";return s.jsx(s.Fragment,{children:s.jsxs(ze,{value:o||_,onTabChange:j=>e(`/${t}/${r}/_history/${n}/${j}`),children:[s.jsxs(dn,{children:[s.jsx(qc,{fluid:!0,p:"md",children:s.jsx(oe,{children:`${t} ${r}`})}),s.jsxs(ze.List,{children:[s.jsx(ze.Tab,{value:"diff",children:"Diff"}),s.jsx(ze.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(we,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(ze.Panel,{value:"diff",children:v?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(y=g.meta)==null?void 0:y.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx($e,{to:`/${t}/${r}/_history/${(x=v.meta)==null?void 0:x.versionId}`,children:(w=v.meta)==null?void 0:w.versionId})]})]}),s.jsx(Nhe,{original:v,revised:g})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(b=g.meta)==null?void 0:b.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)})]})}),s.jsx(ze.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})})}function b0e(){const{resourceType:e,id:t}=Ge(),r=jt(),[n,o]=f.useState({resourceType:"Subscription",filters:[{code:"url",operator:ie.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(we,{children:s.jsx(Kc,{search:n,onClick:i=>r(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function hE(){const{resourceType:e,id:t}=Ge(),r={reference:e+"/"+t};switch(e){case"Encounter":return s.jsx(Cfe,{encounter:r});case"Patient":return s.jsx(Ope,{patient:r});case"ServiceRequest":return s.jsx(Fhe,{serviceRequest:r});default:return s.jsx(Ofe,{resource:r})}}function IA(e,t){const r=ne(),n=jt();return{defaultValue:{resourceType:e},handleSubmit:a=>{t&&t(void 0),r.createResource(a).then(l=>n("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(lt(l))})}}}function mE(){const{resourceType:e}=Ge(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=IA(e,r);return s.jsx(we,{children:s.jsx(g1,{defaultValue:n,onSubmit:o,outcome:t})})}function _0e(){const{resourceType:e}=Ge(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=IA(e,r),i=f.useCallback(a=>{o(JSON.parse(a["new-resource"]))},[o]);return s.jsxs(we,{children:[t&&s.jsx(lo,{outcome:t}),s.jsxs(Ne,{onSubmit:i,children:[s.jsx(Vs,{name:"new-resource","data-testid":"create-resource-json",minRows:24,defaultValue:Dr(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"OK"})})]})]})}function S0e(){const e=ne(),{resourceType:t,id:r}=Ge(),[n,o]=f.useState(),[i,a]=f.useState(),[l,c]=f.useState();return f.useEffect(()=>{e.readResource(t,r).then(u=>o(ki(u))).catch(u=>{de({color:"red",message:je(u)})})},[e,t,r]),f.useEffect(()=>{e.searchResources("StructureDefinition",{type:t,derivation:"constraint",_count:50}).then(u=>{c(u.filter(cde))}).catch(console.error)},[e,t]),n?s.jsxs(we,{children:[s.jsxs(ue,{order:2,children:["Available ",t," profiles"]}),s.jsx(be,{children:s.jsxs(s.Fragment,{children:[s.jsx(ze,{value:i==null?void 0:i.url,onTabChange:u=>a(l==null?void 0:l.find(d=>d.url===u)),children:s.jsx(ze.List,{children:l==null?void 0:l.map(u=>{var h,m;const d=(m=(h=n.meta)==null?void 0:h.profile)==null?void 0:m.includes(u.url),p=d?"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(ze.Tab,{value:u.url,title:p,rightSection:d&&s.jsx(L5,{variant:"outline",color:"green",size:"xs",sx:{borderStyle:"none"},children:s.jsx(Vce,{size:"90%"})}),children:u.title||u.name},u.url)})})}),i?s.jsx(P0e,{profile:i,resource:n,onResourceUpdated:u=>o(u)},i.url):s.jsx(oe,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const P0e=({profile:e,resource:t,onResourceUpdated:r})=>{const n=ne(),[o,i]=f.useState(),[a,l]=f.useState(()=>{var u,d;return(d=(u=t.meta)==null?void 0:u.profile)==null?void 0:d.includes(e.url)}),c=f.useCallback(u=>{i(void 0);const d=Hs(u);a?Qye(d,e.url):Kye(d,e.url),n.updateResource(d).then(p=>{r(p),de({color:"green",message:"Success"})}).catch(p=>{i(lt(p)),de({color:"red",message:je(p)})})},[n,e.url,r,a]);return s.jsxs(be,{children:[s.jsx(ym,{size:"md",checked:a,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),a?s.jsx(g1,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):s.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:s.jsx(K,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"OK"})})})]})};function j0e(){return s.jsx(nge,{children:s.jsxs(ce,{errorElement:s.jsx(Xve,{}),children:[s.jsx(ce,{path:"/signin",element:s.jsx(vye,{})}),s.jsx(ce,{path:"/oauth",element:s.jsx(fye,{})}),s.jsx(ce,{path:"/resetpassword",element:s.jsx(hye,{})}),s.jsx(ce,{path:"/setpassword/:id/:secret",element:s.jsx(gye,{})}),s.jsx(ce,{path:"/register",element:s.jsx(pye,{})}),s.jsx(ce,{path:"/changepassword",element:s.jsx(Qve,{})}),s.jsx(ce,{path:"/security",element:s.jsx(mye,{})}),s.jsx(ce,{path:"/mfa",element:s.jsx(uye,{})}),s.jsx(ce,{path:"/batch",element:s.jsx(qve,{})}),s.jsx(ce,{path:"/bulk/:resourceType",element:s.jsx(Gve,{})}),s.jsx(ce,{path:"/smart",element:s.jsx(yye,{})}),s.jsx(ce,{path:"/forms/:id",element:s.jsx(tye,{})}),s.jsx(ce,{path:"/admin/super",element:s.jsx(kye,{})}),s.jsx(ce,{path:"/admin/config",element:s.jsx(Rye,{})}),s.jsxs(ce,{path:"/admin",element:s.jsx(Cye,{}),children:[s.jsx(ce,{path:"patients",element:s.jsx(Oye,{})}),s.jsx(ce,{path:"bots/new",element:s.jsx(bye,{})}),s.jsx(ce,{path:"bots",element:s.jsx(xye,{})}),s.jsx(ce,{path:"clients/new",element:s.jsx(_ye,{})}),s.jsx(ce,{path:"clients",element:s.jsx(wye,{})}),s.jsx(ce,{path:"details",element:s.jsx(uE,{})}),s.jsx(ce,{path:"invite",element:s.jsx(jye,{})}),s.jsx(ce,{path:"users",element:s.jsx(Tye,{})}),s.jsx(ce,{path:"project",element:s.jsx(uE,{})}),s.jsx(ce,{path:"secrets",element:s.jsx(Eye,{})}),s.jsx(ce,{path:"sites",element:s.jsx($ye,{})}),s.jsx(ce,{path:"members/:membershipId",element:s.jsx(Pye,{})})]}),s.jsx(ce,{path:"/lab/assays",element:s.jsx(Iye,{})}),s.jsx(ce,{path:"/lab/panels",element:s.jsx(Dye,{})}),s.jsx(ce,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(pE,{})}),s.jsx(ce,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(pE,{})}),s.jsxs(ce,{path:"/:resourceType/new",element:s.jsx(Yve,{}),children:[s.jsx(ce,{index:!0,element:s.jsx(mE,{})}),s.jsx(ce,{path:"form",element:s.jsx(mE,{})}),s.jsx(ce,{path:"json",element:s.jsx(_0e,{})})]}),s.jsxs(ce,{path:"/:resourceType/:id",element:s.jsx(w0e,{}),children:[s.jsx(ce,{index:!0,element:s.jsx(hE,{})}),s.jsx(ce,{path:"apply",element:s.jsx(Aye,{})}),s.jsx(ce,{path:"apps",element:s.jsx(Mye,{})}),s.jsx(ce,{path:"event",element:s.jsx(zye,{})}),s.jsx(ce,{path:"blame",element:s.jsx(Fye,{})}),s.jsx(ce,{path:"bots",element:s.jsx(o0e,{})}),s.jsx(ce,{path:"builder",element:s.jsx(Yye,{})}),s.jsx(ce,{path:"checklist",element:s.jsx(Xye,{})}),s.jsx(ce,{path:"delete",element:s.jsx(Jye,{})}),s.jsx(ce,{path:"details",element:s.jsx(Zye,{})}),s.jsx(ce,{path:"edit",element:s.jsx(e0e,{})}),s.jsx(ce,{path:"editor",element:s.jsx(qye,{})}),s.jsx(ce,{path:"history",element:s.jsx(t0e,{})}),s.jsx(ce,{path:"json",element:s.jsx(r0e,{})}),s.jsx(ce,{path:"preview",element:s.jsx(n0e,{})}),s.jsx(ce,{path:"responses",element:s.jsx(a0e,{})}),s.jsx(ce,{path:"report",element:s.jsx(l0e,{})}),s.jsx(ce,{path:"ranges",element:s.jsx(s0e,{})}),s.jsx(ce,{path:"subscriptions",element:s.jsx(b0e,{})}),s.jsx(ce,{path:"timeline",element:s.jsx(hE,{})}),s.jsx(ce,{path:"profiles",element:s.jsx(S0e,{})})]}),s.jsx(ce,{path:"/:resourceType",element:s.jsx(cE,{})}),s.jsx(ce,{path:"/",element:s.jsx(cE,{})})]})})}function O0e(){const e=ne(),t=e.getUserConfiguration(),r=Ti(),[n]=b1();return e.isLoading()?s.jsx(In,{}):s.jsx(Kue,{logo:s.jsx(Nn,{size:24}),pathname:r.pathname,searchParams:n,version:sce,menus:C0e(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(f.Suspense,{fallback:s.jsx(In,{}),children:s.jsx(j0e,{})})})}function C0e(e){var r;const t=((r=e==null?void 0:e.menu)==null?void 0:r.map(n=>{var o;return{title:n.title,links:((o=n.link)==null?void 0:o.map(i=>({label:i.name,href:i.target,icon:E0e(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(eue,{})}]}),t}const gE={Patient:hue,Practitioner:Xce,Organization:Lce,ServiceRequest:cue,DiagnosticReport:due,Questionnaire:Yce,admin:Nce,AccessPolicy:Zce,Subscription:vue,batch:oue,Observation:nue};function E0e(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in gE){const r=gE[t];return s.jsx(r,{})}}catch{}return s.jsx(vm,{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 $0e(){const e=Zc(),t=new fce({baseUrl:e.baseUrl,clientId:e.clientId,cacheTime:6e4,autoBatchTime:100,onUnauthenticated:()=>{window.location.pathname!=="/signin"&&window.location.pathname!=="/oauth"&&(window.location.href="/signin?next="+encodeURIComponent(window.location.pathname+window.location.search))}}),r={headings:{sizes:{h1:{fontSize:"1.125rem",fontWeight:500,lineHeight:2}}},fontSizes:{xs:"0.6875rem",sm:"0.875rem",md:"0.875rem",lg:"1.0rem",xl:"1.125rem"}},n=age([{path:"*",element:s.jsx(O0e,{})}]),o=a=>n.navigate(a);G3(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(gce,{medplum:t,navigate:o,children:s.jsxs(s$,{theme:r,withGlobalStyles:!0,withNormalizeCSS:!0,children:[s.jsx(ba,{position:"bottom-right"}),s.jsx(mge,{router:n})]})})}))}$0e().catch(console.error);
243
+ //# sourceMappingURL=index-WotRgET-.js.map